增加跳步关闭高亮状态

This commit is contained in:
shenjianxing 2025-01-22 10:33:42 +08:00
parent 677825a26e
commit a28f22f38a
6 changed files with 64 additions and 2 deletions

View File

@ -32,6 +32,7 @@ namespace QFramework
string deviceName;
float totalTime;
GameObject obj;
public static AnimationAction Allocate(string path, Dictionary<string, string> datas, System.Action OnFinished = null)
{
var retNode = mPool.Allocate();
@ -51,7 +52,6 @@ namespace QFramework
TweenerCore<float, float, FloatOptions> animDot;
public void OnStart()
{
GameObject obj = null;
if (string.IsNullOrEmpty(deviceName))
{
obj = Utility.FindObj(path);
@ -149,10 +149,14 @@ namespace QFramework
{
if (!Deinited)
{
animDot?.Kill();
if (obj != null)
{
anim?.Stop();
}
animDot?.Kill();
OnFinished = null;
Deinited = true;
obj = null;
mPool.Recycle(this);
}
}

View File

@ -72,6 +72,7 @@ namespace QFramework
var effect = obj.GetOrAddComponent<HighlightEffect>();
effect.outlineColor = color;
effect.highlighted = true;
obj.GetOrAddComponent<HighLightOnStepChanged>();
if (string.IsNullOrEmpty(isIndependent) == false)
{
switch (isIndependent)

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 27089718485c08142b8d696ce13b2a78
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7a69538f7c29aeb47804364936ea1c5c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,30 @@
using HighlightPlus;
using QFramework;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static OperationController;
public class HighLightOnStepChanged : MonoBehaviour
{
private void Awake()
{
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
}
private void OnStepChanged(StepStatusOnChange change)
{
var effect = GetComponent<HighlightEffect>();
if (effect != null)
{
effect.highlighted = false;
}
}
private void OnDestroy()
{
TypeEventSystem.Global.UnRegister<StepStatusOnChange>(OnStepChanged);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8dea558b3c0de5a48906a5a7f7806258
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: