From c24cfe0832981ce42c3a95958d7ae1fd43595e99 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 20 Jan 2025 18:28:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=B3=E6=AD=A5=E9=AA=A4=E6=97=B6=E5=8F=96?= =?UTF-8?q?=E6=B6=88device=E9=AB=98=E4=BA=AE=20=E5=A2=9E=E5=8A=A0=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Actions/ShowAction.cs | 2 +- Assets/Scripts/Item/DeviceItem.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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)