diff --git a/Assets/Scripts/Actions/ShowAction.cs b/Assets/Scripts/Actions/ShowAction.cs index 096d196a..a34ce52b 100644 --- a/Assets/Scripts/Actions/ShowAction.cs +++ b/Assets/Scripts/Actions/ShowAction.cs @@ -75,7 +75,7 @@ public class ShowAction : IAction if (obj == null) { - Debug.LogError("没有找到物体 :" + path); + Debug.LogError($"没有找到物体 path:{path} deviceName:{deviceName}"); } else { diff --git a/Assets/Scripts/Item/DeviceItem.cs b/Assets/Scripts/Item/DeviceItem.cs index 5cd14286..13dff345 100644 --- a/Assets/Scripts/Item/DeviceItem.cs +++ b/Assets/Scripts/Item/DeviceItem.cs @@ -5,6 +5,7 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; +using static OperationController; public class DeviceItem : MonoBehaviour { @@ -19,6 +20,7 @@ public class DeviceItem : MonoBehaviour gameObject.GetOrAddComponent(); effect.outlineColor = Color.green; StringEventSystem.Global.Register(Global.HighLightTrigger, OnHighLightTriggerEvent); + TypeEventSystem.Global.Register(OnStepChanged); } if (device.MeshCollider) { @@ -40,11 +42,21 @@ public class DeviceItem : MonoBehaviour } } + private void OnStepChanged(StepStatusOnChange change) + { + var effect = gameObject.GetComponent(); + if (effect != null) + { + effect.highlighted = false; + } + } + public void Close() { device = null; tipItem = null; StringEventSystem.Global.UnRegister(Global.HighLightTrigger, OnHighLightTriggerEvent); + TypeEventSystem.Global.UnRegister(OnStepChanged); } private void OnHighLightTriggerEvent(string[] obj)