Exemplo n.º 1
0
        public static XTrack GetTrack(TrackData data, XSeqence tl, XTrack parent = null)
        {
            XTrack xTrack = null;

            switch (data.type)
            {
            case AssetType.Marker:
                xTrack = SharedPool <XMarkerTrack> .Get();

                break;

            case AssetType.Animation:
                xTrack = SharedPool <XAnimationTrack> .Get();

                break;

            case AssetType.BoneFx:
                xTrack = SharedPool <XBoneFxTrack> .Get();

                break;

            case AssetType.SceneFx:
                xTrack = SharedPool <XSceneFxTrack> .Get();

                break;

            case AssetType.PostProcess:
                xTrack = SharedPool <XPostprocessTrack> .Get();

                break;

            case AssetType.Transform:
                xTrack = SharedPool <XTransformTrack> .Get();

                break;

            case AssetType.LogicValue:
                xTrack = SharedPool <XLogicTrack> .Get();

                break;

            case AssetType.Group:
                xTrack = SharedPool <XGroupTrack> .Get();

                break;

            default:
                Debug.LogError("unknown track " + data.type);
                break;
            }
            if (xTrack)
            {
                xTrack.Initial(data, tl, parent);
            }
            return(xTrack);
        }
Exemplo n.º 2
0
 public void Initial(TrackData data, XSeqence tl, XTrack parent)
 {
     this.data    = data;
     this.seqence = tl;
     this.parent  = parent;
     if (data != null)
     {
         if (data.clips != null)
         {
             int len = data.clips.Length;
             clips = new IClip[len];
             for (int i = 0; i < len; i++)
             {
                 clips[i] = BuildClip(data.clips[i]);
             }
         }
         if (data.marks != null)
         {
             int len = data.marks.Length;
             marks = new XMarker[len];
             for (int i = 0; i < len; i++)
             {
                 marks[i] = XSeqenceFactory.GetMarker(this, data.marks[i]);
             }
         }
         if (data.childs != null)
         {
             int len = data.childs.Length;
             childs = new XTrack[len];
             for (int i = 0; i < len; i++)
             {
                 childs[i] = XSeqenceFactory.GetTrack(data.childs[i], seqence, this);
             }
         }
     }
     OnPostBuild();
 }