using System.Collections; using System.Collections.Generic; using UnityEngine; public class ChangeMaterial : MonoBehaviour { public Material Platinum; private MeshRenderer mr; private void OnEnable() { PassTheEdgeTrigger.OnPassingTheEdge += ChangeMat; } private void OnDisable() { PassTheEdgeTrigger.OnPassingTheEdge -= ChangeMat; } private void Start() { mr = GetComponent(); } private void ChangeMat() { mr.material = Platinum; } }