holopy3/Assets/Scripts/ColorChanger.cs
2020-12-10 15:25:12 +01:00

33 lines
738 B
C#

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;
}
}