增加跳步关闭高亮状态
This commit is contained in:
parent
677825a26e
commit
a28f22f38a
@ -32,6 +32,7 @@ namespace QFramework
|
|||||||
string deviceName;
|
string deviceName;
|
||||||
|
|
||||||
float totalTime;
|
float totalTime;
|
||||||
|
GameObject obj;
|
||||||
public static AnimationAction Allocate(string path, Dictionary<string, string> datas, System.Action OnFinished = null)
|
public static AnimationAction Allocate(string path, Dictionary<string, string> datas, System.Action OnFinished = null)
|
||||||
{
|
{
|
||||||
var retNode = mPool.Allocate();
|
var retNode = mPool.Allocate();
|
||||||
@ -51,7 +52,6 @@ namespace QFramework
|
|||||||
TweenerCore<float, float, FloatOptions> animDot;
|
TweenerCore<float, float, FloatOptions> animDot;
|
||||||
public void OnStart()
|
public void OnStart()
|
||||||
{
|
{
|
||||||
GameObject obj = null;
|
|
||||||
if (string.IsNullOrEmpty(deviceName))
|
if (string.IsNullOrEmpty(deviceName))
|
||||||
{
|
{
|
||||||
obj = Utility.FindObj(path);
|
obj = Utility.FindObj(path);
|
||||||
@ -149,10 +149,14 @@ namespace QFramework
|
|||||||
{
|
{
|
||||||
if (!Deinited)
|
if (!Deinited)
|
||||||
{
|
{
|
||||||
|
if (obj != null)
|
||||||
|
{
|
||||||
|
anim?.Stop();
|
||||||
|
}
|
||||||
animDot?.Kill();
|
animDot?.Kill();
|
||||||
anim?.Stop();
|
|
||||||
OnFinished = null;
|
OnFinished = null;
|
||||||
Deinited = true;
|
Deinited = true;
|
||||||
|
obj = null;
|
||||||
mPool.Recycle(this);
|
mPool.Recycle(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,6 +72,7 @@ namespace QFramework
|
|||||||
var effect = obj.GetOrAddComponent<HighlightEffect>();
|
var effect = obj.GetOrAddComponent<HighlightEffect>();
|
||||||
effect.outlineColor = color;
|
effect.outlineColor = color;
|
||||||
effect.highlighted = true;
|
effect.highlighted = true;
|
||||||
|
obj.GetOrAddComponent<HighLightOnStepChanged>();
|
||||||
if (string.IsNullOrEmpty(isIndependent) == false)
|
if (string.IsNullOrEmpty(isIndependent) == false)
|
||||||
{
|
{
|
||||||
switch (isIndependent)
|
switch (isIndependent)
|
||||||
|
|||||||
8
Assets/Scripts/OpeartionHelper.meta
Normal file
8
Assets/Scripts/OpeartionHelper.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 27089718485c08142b8d696ce13b2a78
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/OpeartionHelper/OnStepChanged.meta
Normal file
8
Assets/Scripts/OpeartionHelper/OnStepChanged.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7a69538f7c29aeb47804364936ea1c5c
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8dea558b3c0de5a48906a5a7f7806258
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Loading…
x
Reference in New Issue
Block a user