holopy3/Assets/Scripts/ColorChanger.cs

34 lines
738 B
C#
Raw Permalink Normal View History

2020-12-10 14:25:12 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ColorChanger : MonoBehaviour
{
public Material NormalMat;
public Material HighlightMat;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void ShowHovering()
{
//gameObject.GetComponent<Renderer>().material.EnableKeyword("_EMISSION");
gameObject.GetComponent<Renderer>().material = HighlightMat;
}
public void EndHovering()
{
//gameObject.GetComponent<Renderer>().material.DisableKeyword("_EMISSION");
gameObject.GetComponent<Renderer>().material = NormalMat;
}
}