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

41 lines
1.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 车控终端
/// </summary>
public class CheKongZhongDuan : ButtonBase
{
public FunctionSync_Active chekong;
public OneValueSyncObject detectionPower;
public override void PressedEvent()
{
base.PressedEvent();
linkageObject.transform.localPosition = new Vector3(0.004f, 0, 0);
linkageObject.GetControl();
detectionPower.mybool = !detectionPower.mybool;
if (detectionPower.mybool)
{
detectionPower.SendSync();
if (detectionPower.action_apprisedetail != null) detectionPower.action_apprisedetail.Invoke();
chekong.ShowObject();
}
else
{
chekong.DisShowObject();
}
}
public override void ReleasedEvent()
{
base.ReleasedEvent();
linkageObject.transform.localPosition = new Vector3(0.002f, 0, 0);
linkageObject.ReleaseControl();
}
public override void Init()
{
}
}