跳步骤时取消device高亮

增加报错日志
This commit is contained in:
shenjianxing 2025-01-20 18:28:24 +08:00
parent 2571489ea4
commit c24cfe0832
2 changed files with 13 additions and 1 deletions

View File

@ -75,7 +75,7 @@ public class ShowAction : IAction
if (obj == null)
{
Debug.LogError("没有找到物体 :" + path);
Debug.LogError($"没有找到物体 path:{path} deviceName:{deviceName}");
}
else
{

View File

@ -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<HighlightTrigger>();
effect.outlineColor = Color.green;
StringEventSystem.Global.Register<string[]>(Global.HighLightTrigger, OnHighLightTriggerEvent);
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
}
if (device.MeshCollider)
{
@ -40,11 +42,21 @@ public class DeviceItem : MonoBehaviour
}
}
private void OnStepChanged(StepStatusOnChange change)
{
var effect = gameObject.GetComponent<HighlightEffect>();
if (effect != null)
{
effect.highlighted = false;
}
}
public void Close()
{
device = null;
tipItem = null;
StringEventSystem.Global.UnRegister<string[]>(Global.HighLightTrigger, OnHighLightTriggerEvent);
TypeEventSystem.Global.UnRegister<StepStatusOnChange>(OnStepChanged);
}
private void OnHighLightTriggerEvent(string[] obj)