跳步骤时取消device高亮
增加报错日志
This commit is contained in:
parent
2571489ea4
commit
c24cfe0832
@ -75,7 +75,7 @@ public class ShowAction : IAction
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
Debug.LogError("没有找到物体 :" + path);
|
||||
Debug.LogError($"没有找到物体 path:{path} deviceName:{deviceName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user