跳步骤时取消device高亮
增加报错日志
This commit is contained in:
parent
2571489ea4
commit
c24cfe0832
@ -75,7 +75,7 @@ public class ShowAction : IAction
|
|||||||
|
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
{
|
{
|
||||||
Debug.LogError("没有找到物体 :" + path);
|
Debug.LogError($"没有找到物体 path:{path} deviceName:{deviceName}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5,6 +5,7 @@ using System;
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using static OperationController;
|
||||||
|
|
||||||
public class DeviceItem : MonoBehaviour
|
public class DeviceItem : MonoBehaviour
|
||||||
{
|
{
|
||||||
@ -19,6 +20,7 @@ public class DeviceItem : MonoBehaviour
|
|||||||
gameObject.GetOrAddComponent<HighlightTrigger>();
|
gameObject.GetOrAddComponent<HighlightTrigger>();
|
||||||
effect.outlineColor = Color.green;
|
effect.outlineColor = Color.green;
|
||||||
StringEventSystem.Global.Register<string[]>(Global.HighLightTrigger, OnHighLightTriggerEvent);
|
StringEventSystem.Global.Register<string[]>(Global.HighLightTrigger, OnHighLightTriggerEvent);
|
||||||
|
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
||||||
}
|
}
|
||||||
if (device.MeshCollider)
|
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()
|
public void Close()
|
||||||
{
|
{
|
||||||
device = null;
|
device = null;
|
||||||
tipItem = null;
|
tipItem = null;
|
||||||
StringEventSystem.Global.UnRegister<string[]>(Global.HighLightTrigger, OnHighLightTriggerEvent);
|
StringEventSystem.Global.UnRegister<string[]>(Global.HighLightTrigger, OnHighLightTriggerEvent);
|
||||||
|
TypeEventSystem.Global.UnRegister<StepStatusOnChange>(OnStepChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnHighLightTriggerEvent(string[] obj)
|
private void OnHighLightTriggerEvent(string[] obj)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user