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().material.EnableKeyword("_EMISSION"); gameObject.GetComponent().material = HighlightMat; } public void EndHovering() { //gameObject.GetComponent().material.DisableKeyword("_EMISSION"); gameObject.GetComponent().material = NormalMat; } }