#if !COMBAT_SERVER

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

/// <summary>
/// 激活父物体对象
/// </summary>
[System.Serializable]
public class TimeLineActiveGameObjectSerializtion : TimeLineAssetSerialization
{
    public bool isActive;
    public string targetName;

    public TimeLineActiveGameObjectSerializtion()
    {
    }
#if !COMBAT_SERVER

    public TimeLineActiveGameObjectSerializtion(PlayableDirector playableDirector, GroupTrack groupTrack, TimelineClip timelineClip) : base(groupTrack, timelineClip)
    {
        ActiveGameObjectPlayableAsset activeGameObjectPlayableAsset = timelineClip.asset as ActiveGameObjectPlayableAsset;
        if (activeGameObjectPlayableAsset.gameObject.Resolve(playableDirector.playableGraph.GetResolver()) != null)
        {
            targetName = activeGameObjectPlayableAsset.gameObject.Resolve(playableDirector.playableGraph.GetResolver()).name;
            isActive = activeGameObjectPlayableAsset.isActive;
        }
    }
#endif
    public override TimeLineEventLogicBasic CreateLogic()
    {
        return new TimeLineAudioEventLogic();
    }
}