29 lines
544 B
C#
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;
|
|
}
|
|
}
|