You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
715 B
29 lines
715 B
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class InfraredSourceView : MonoBehaviour
|
|
{
|
|
public GameObject InfraredSourceManager;
|
|
private InfraredSourceManager _InfraredManager;
|
|
|
|
void Start ()
|
|
{
|
|
GetComponent<Renderer>().material.SetTextureScale("_MainTex", new Vector2(-1, 1));
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
if (InfraredSourceManager == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
_InfraredManager = InfraredSourceManager.GetComponent<InfraredSourceManager>();
|
|
if (_InfraredManager == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
GetComponent<Renderer>().material.mainTexture = _InfraredManager.GetInfraredTexture();
|
|
}
|
|
}
|
|
|