1118OPSSNew/Assets/Zion/Scripts/GameScene/Processes/Button/CarControlSwitchBtn.cs

42 lines
1.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 车控终端电源按钮
/// </summary>
public class CarControlSwitchBtn : ButtonBase
{
/// <summary>
/// 指示灯
/// </summary>
public FunctionSync_Active indicatorLight;
/// <summary>
/// 车控终端电源
/// </summary>
public OneValueSyncObject switchOn;
public override void PressedEvent()
{
base.PressedEvent();
if (!switchOn.mybool)
{
indicatorLight.ShowObject();
switchOn.mybool = true;
switchOn.SendSync();
if (switchOn.action_apprisedetail != null) switchOn.action_apprisedetail.Invoke();
}
else
{
indicatorLight.DisShowObject();
switchOn.mybool = false;
switchOn.SendSync();
if (switchOn.action_apprisedetail != null) switchOn.action_apprisedetail.Invoke();
}
}
public override void Init()
{
base.Init();
}
}