holopy3/Assets/Scripts/ChangeMaterial.cs
Lena Biresch 490ef558ef CleanUp
2021-01-28 13:07:52 +01:00

29 lines
544 B
C#

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<MeshRenderer>();
}
private void ChangeMat()
{
mr.material = Platinum;
}
}