add
This commit is contained in:
parent
5ce54b749f
commit
9a519a9df0
29
Role/Role.cs
29
Role/Role.cs
@ -74,27 +74,24 @@ public class Role : Fun
|
|||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
//if (AnimationTree.Count == 0)
|
if (AnimationTree.Count == 0)
|
||||||
//{
|
{
|
||||||
// isAnimationPlay = false;
|
isAnimationPlay = false;
|
||||||
// return;
|
return;
|
||||||
//}
|
}
|
||||||
//isAnimationPlay = true;
|
isAnimationPlay = true;
|
||||||
if (animationHighlight > AnimationTree.Count)
|
if (animationHighlight >= AnimationTree.Count)
|
||||||
{
|
{
|
||||||
animationHighlight = AnimationTree.Count - 1;
|
animationHighlight = AnimationTree.Count - 1;
|
||||||
Debug.Log("=---");
|
|
||||||
}
|
}
|
||||||
else if (animationHighlight < 0) {
|
else if (animationHighlight < 0) {
|
||||||
animationHighlight = 0;
|
animationHighlight = 0;
|
||||||
}
|
}
|
||||||
EditorUtility.SetDirty(this);
|
EditorUtility.SetDirty(this);
|
||||||
Debug.Log(animationHighlight > AnimationTree.Count);
|
|
||||||
Debug.Log(animationHighlight);
|
|
||||||
List<Sprite> LightSprite = AnimationTree[animationHighlight].value;
|
List<Sprite> LightSprite = AnimationTree[animationHighlight].value;
|
||||||
if (LightSprite == null )
|
if (LightSprite == null )
|
||||||
{
|
{
|
||||||
//isAnimationPlay = false;
|
isAnimationPlay = false;
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
OnAnimationStart?.Invoke(animationHighlight);
|
OnAnimationStart?.Invoke(animationHighlight);
|
||||||
@ -108,7 +105,7 @@ public class Role : Fun
|
|||||||
{
|
{
|
||||||
spriteRenderer.sprite = sprite;
|
spriteRenderer.sprite = sprite;
|
||||||
}
|
}
|
||||||
if (animationHighlight > 0 && animationHighlight < AnimationTree.Count)
|
if (animationHighlight >= 0 && animationHighlight < AnimationTree.Count)
|
||||||
{
|
{
|
||||||
OnAnimationIng?.Invoke(animationHighlight);
|
OnAnimationIng?.Invoke(animationHighlight);
|
||||||
await Task.Delay(AnimationTree[animationHighlight].CharacterAnimationFrameInterval);
|
await Task.Delay(AnimationTree[animationHighlight].CharacterAnimationFrameInterval);
|
||||||
@ -166,10 +163,10 @@ public class Role : Fun
|
|||||||
// 如果启用 MonoBehaviour,则每个固定帧速率的帧都将调用此函数
|
// 如果启用 MonoBehaviour,则每个固定帧速率的帧都将调用此函数
|
||||||
private void FixedUpdate()
|
private void FixedUpdate()
|
||||||
{
|
{
|
||||||
//if (!isAnimationPlay)
|
if (!isAnimationPlay)
|
||||||
//{
|
{
|
||||||
// updateAnimation();
|
updateAnimation();
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user