#if !COMBAT_SERVER

using UnityEngine.Playables;
using UnityEngine.Timeline;
#endif
using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventLogic;

[System.Serializable]
public class TineLineAnimationPlayableSerialization : TimeLineAssetSerialization
{
    public string animName;

    /// <summary>
    /// 0=默认 1=开启循环 2=关闭循环
    /// </summary>
    public int loopMode;

    public bool isRunPlay;
    public int layerId;
    public TineLineAnimationPlayableSerialization()
    {
        
    }
#if !COMBAT_SERVER

    public TineLineAnimationPlayableSerialization(PlayableDirector playableDirector, GroupTrack groupTrack,
        TimelineClip timelineClip) : base(groupTrack, timelineClip)
    {
        TimeLinePlayEntityAnimtionAsset animationPlayableAsset = timelineClip.asset as TimeLinePlayEntityAnimtionAsset;
        if (animationPlayableAsset.clip != null)
        {
            animName = animationPlayableAsset.clip.name;
            loopMode = (int) animationPlayableAsset.loop;
            isRunPlay = animationPlayableAsset.isRunPlay;
            layerId = animationPlayableAsset.layerId;
        }
    }
#endif
    public override TimeLineEventLogicBasic CreateLogic()
    {
        return new TineLineAnimationEventLogic();
    }
}