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:
commit
07c8ef8648
@ -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,17 +254,20 @@ 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);
|
||||||
foreach (var timeline in animation.Timelines)
|
if (animation != null){
|
||||||
{
|
foreach (var timeline in animation.Timelines)
|
||||||
var eventTimeline = timeline as Spine.EventTimeline;
|
|
||||||
if (eventTimeline != null && eventTimeline.Events.Length > 0)
|
|
||||||
{
|
{
|
||||||
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;
|
return times;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user