Merge branch 'master' into dev

# Conflicts:
#	Assets/Editor/JenkinsAdapter.cs
#	Assets/lua/app/module/battle/component/battle_unit_comp.lua.bytes
#	Assets/lua/app/module/battle/controller/battle_controller.lua.bytes
This commit is contained in:
xiekaidong 2023-07-07 17:14:54 +08:00
commit 07c8ef8648
6 changed files with 14 additions and 8 deletions

View File

@ -35,14 +35,17 @@ namespace BF
public void PlayAnimation(string animName, bool loop, bool forceRefresh) public void PlayAnimation(string animName, bool loop, bool forceRefresh)
{ {
#if UNITY_EDITOR
Spine.Animation animation = skeletonGraphic.skeletonDataAsset.GetAnimationStateData().SkeletonData.FindAnimation(animName); Spine.Animation animation = skeletonGraphic.skeletonDataAsset.GetAnimationStateData().SkeletonData.FindAnimation(animName);
#if UNITY_EDITOR
if(BFLog.LogAssert(animation != null, this.gameObject.name + " not have animation: " + animName + " \n")) if(BFLog.LogAssert(animation != null, this.gameObject.name + " not have animation: " + animName + " \n"))
{ {
return; return;
} }
#endif #endif
if (animation == null)
{
return;
}
animationState.SetAnimation(0, animName, loop); animationState.SetAnimation(0, animName, loop);
if (forceRefresh) if (forceRefresh)
{ {
@ -251,6 +254,7 @@ namespace BF
{ {
List<float> times = new List<float>(); List<float> times = new List<float>();
var animation = skeletonGraphic.skeletonDataAsset.GetAnimationStateData().SkeletonData.FindAnimation(name); var animation = skeletonGraphic.skeletonDataAsset.GetAnimationStateData().SkeletonData.FindAnimation(name);
if (animation != null){
foreach (var timeline in animation.Timelines) foreach (var timeline in animation.Timelines)
{ {
var eventTimeline = timeline as Spine.EventTimeline; var eventTimeline = timeline as Spine.EventTimeline;
@ -262,6 +266,8 @@ namespace BF
} }
} }
} }
}
return times; return times;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB