using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class Device_Base : PermanentTriggerBase { /// /// 设备类型 /// public DeviceType deviceType; /// /// trigger触发事件 /// public Func triggerAction; /// /// 是否正在移动 /// public bool isMoving; private Vector3 head_LocalPos; private Vector3 head_LocalEulerAnglesl; protected override void OnAwake() { if (GameManager.RunModelMgr.SceneType == E_SceneType.Site) { base.OnAwake(); } } protected override void OnStart() { if (GameManager.RunModelMgr.SceneType == E_SceneType.Site) { base.OnStart(); AddTriggerAction(GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID); } } protected override void OnMEnter() { if (GameManager.RunModelMgr.SceneType == E_SceneType.Site && GameManager.RunModelMgr.ModeType != E_ModeType.Study) { base.OnMEnter(); _highlight.SetHighlighted(true); } } protected override void OnMExit() { if (GameManager.RunModelMgr.SceneType == E_SceneType.Site && GameManager.RunModelMgr.ModeType != E_ModeType.Study) { base.OnMExit(); _highlight.SetHighlighted(false); } } public void AddTriggerAction(Func action) { this.triggerAction = action; } public void AddStartAction(Action callback) { hand_out_action += callback; } public void AddEndAction(Action callback) { hand_back_action += callback; } /// /// 设置工具回到手中的位置 /// /// /// public void SetHeadPosAndEulerang(Vector3 head_LocalPos, Vector3 head_LocalEulerAnglesl) { this.head_LocalPos = head_LocalPos; this.head_LocalEulerAnglesl = head_LocalEulerAnglesl; } }