You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
612 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace TFHC_Shader_Samples
{
public class highlightAnimated : MonoBehaviour
{
private Material mat;
void Start()
{
mat = GetComponent<Renderer>().material;
}
void OnMouseEnter()
{
switchhighlighted(true);
}
void OnMouseExit()
{
switchhighlighted(false);
}
void switchhighlighted(bool highlighted)
{
mat.SetFloat("_Highlighted", (highlighted ? 1.0f : 0.0f));
}
}
}