29 lines
769 B
C#
29 lines
769 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
/*******************************************************************************
|
|
*Create By CG
|
|
*Function
|
|
*******************************************************************************/
|
|
namespace ZXK.LouDiXvMuNiu
|
|
{
|
|
public class SignalCtrl_ChangeMat : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private MeshRenderer _onOffMeshRend;
|
|
[SerializeField]
|
|
private Texture _onPic;
|
|
[SerializeField]
|
|
private Texture _offPic;
|
|
|
|
private void OnEnable()
|
|
{
|
|
_onOffMeshRend.materials[0].SetTexture("_BaseMap", _onPic);
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
_onOffMeshRend.materials[0].SetTexture("_BaseMap", _offPic);
|
|
}
|
|
}
|
|
} |