GQ_Communicate/GQ_TongXin/Assets/Scripts/Focus/SwitchStatus.cs

35 lines
747 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//============================================================
//支持中文文件使用UTF-8编码
//@author #AUTHOR#
//@create #CREATEDATE#
//@company #COMPANY#
//
//@description:
//============================================================
public enum Status
{
Normal,
Warn,
}
public class SwitchStatus : MonoBehaviour
{
public Status status = Status.Normal;
private void Update()
{
if (status == Status.Warn)
{
gameObject.GetComponent<Renderer>().material.color = Color.yellow;
}
else
{
gameObject.GetComponent<Renderer>().material.color = Color.green;
}
}
}