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)
{
#if UNITY_EDITOR
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"))
{
return;
}
#endif
if (animation == null)
{
return;
}
animationState.SetAnimation(0, animName, loop);
if (forceRefresh)
{
@ -251,17 +254,20 @@ namespace BF
{
List<float> times = new List<float>();
var animation = skeletonGraphic.skeletonDataAsset.GetAnimationStateData().SkeletonData.FindAnimation(name);
foreach (var timeline in animation.Timelines)
{
var eventTimeline = timeline as Spine.EventTimeline;
if (eventTimeline != null && eventTimeline.Events.Length > 0)
if (animation != null){
foreach (var timeline in animation.Timelines)
{
foreach (var eventInfo in eventTimeline.Events)
var eventTimeline = timeline as Spine.EventTimeline;
if (eventTimeline != null && eventTimeline.Events.Length > 0)
{
times.Add(eventInfo.Time);
foreach (var eventInfo in eventTimeline.Events)
{
times.Add(eventInfo.Time);
}
}
}
}
return times;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB