点击后 高亮和Tip消失

This commit is contained in:
shenjianxing 2024-12-24 13:52:04 +08:00
parent 0374adf93c
commit 4704defe44
3 changed files with 19 additions and 2 deletions

View File

@ -155,7 +155,7 @@ namespace QFramework
{ {
OnFinished = null; OnFinished = null;
Deinited = true; Deinited = true;
loader.Recycle2Cache(); loader?.Recycle2Cache();
mPool.Recycle(this); mPool.Recycle(this);
} }
} }

View File

@ -21,7 +21,7 @@ public class DeviceItem : MonoBehaviour
{ {
gameObject.GetOrAddComponent<MeshCollider>(); gameObject.GetOrAddComponent<MeshCollider>();
} }
else if (string.IsNullOrEmpty(device.BoxColliderSize)==false) else if (string.IsNullOrEmpty(device.BoxColliderSize) == false)
{ {
BoxCollider box = gameObject.GetOrAddComponent<BoxCollider>(); BoxCollider box = gameObject.GetOrAddComponent<BoxCollider>();
box.size = Utility.GetVector3FromStrArray(device.BoxColliderSize); box.size = Utility.GetVector3FromStrArray(device.BoxColliderSize);
@ -40,6 +40,15 @@ public class DeviceItem : MonoBehaviour
} }
} }
private void OnMouseUpAsButton()
{
var effect = gameObject.GetComponent<HighlightEffect>();
if (effect != null)
{
effect.highlighted = false;
}
}
} }

View File

@ -41,4 +41,12 @@ public class TipItem : MonoBehaviour
tip.Active(false); tip.Active(false);
} }
} }
private void OnMouseUpAsButton()
{
if (tip != null)
{
tip.Active(false);
}
}
} }