Beispiel #1
0
 public void Initial(ClipData data, int port)
 {
     this.port = port;
     anData    = data as AnimClipData;
     aclip     = XResources.LoadSharedAsset <AnimationClip>(anData.anim);
     playable  = AnimationClipPlayable.Create(XTimeline.graph, aclip);
 }
Beispiel #2
0
        private void Load(BoneFxClipData data)
        {
            var        root = track.root;
            XBindTrack bt   = root as XBindTrack;
            var        seed = data.seed;

            if (bt)
            {
                var go = bt.bindObj;
                if (go != null && !string.IsNullOrEmpty(data.bone))
                {
                    var tf = go.transform.Find(data.bone);
                    fx = XResources.LoadGameObject(data.prefab);
                    fx.SetActive(false);
                    path = data.prefab;
                    if (fx)
                    {
                        fx.transform.parent        = tf;
                        fx.transform.localPosition = data.pos;
                        fx.transform.localRotation = Quaternion.Euler(data.rot);
                        fx.transform.localScale    = data.scale;
                        ps = fx.GetComponentsInChildren <ParticleSystem>();
                        for (int i = 0; i < ps.Length; i++)
                        {
                            ps[i].randomSeed = seed;
                            ps[i].Stop();
                        }
                    }
                }
            }
        }
Beispiel #3
0
 public override void OnDestroy()
 {
     if (!timeline.IsHostTrack(this))
     {
         XResources.DestroyGameObject(pat, bindObj);
     }
     base.OnDestroy();
 }
Beispiel #4
0
 public override void OnBind()
 {
     if (fx)
     {
         XResources.DestroyGameObject(path, fx);
     }
     Load((BoneFxClipData)data);
 }
Beispiel #5
0
        public override void OnDestroy()
        {
            if (prefabGameObject)
            {
                XResources.DestroyGameObject(path, prefabGameObject);
                particleSystems = null;
            }
            SharedPool <XSceneFxClip> .Return(this);

            base.OnDestroy();
        }
Beispiel #6
0
        public override void OnDestroy()
        {
            if (fx)
            {
                XResources.DestroyGameObject(path, fx);
                fx = null;
            }
            ps = null;
            SharedPool <XBoneFxClip> .Return(this);

            base.OnDestroy();
        }
Beispiel #7
0
 public void Load(string path, Vector3 pos, Vector3 rot, Vector3 scale)
 {
     this.path        = path;
     prefabGameObject = XResources.LoadGameObject(path);
     if (prefabGameObject != null)
     {
         seqence.BindGo(prefabGameObject);
         var tf = prefabGameObject.transform;
         tf.position     = pos;
         tf.rotation     = Quaternion.Euler(rot);
         tf.localScale   = scale;
         particleSystems = tf.GetComponentsInChildren <ParticleSystem>();
     }
 }
Beispiel #8
0
        public override void OnDestroy()
        {
            if (playable.IsValid())
            {
                playable.Destroy();
                if (track.mixPlayable.IsValid())
                {
                    track.mixPlayable.SetInputCount(0);
                }
            }
            AnimClipData anData = data as AnimClipData;

            XResources.DestroySharedAsset(anData.anim);
            SharedPool <XAnimationClip> .Return(this);

            base.OnDestroy();
        }
Beispiel #9
0
 private void Rebind(string prefab)
 {
     if (!string.IsNullOrEmpty(prefab) && bindObj == null)
     {
         pat = prefab;
         GameObject obj = null;
         if (seqence.IsHostTrack(this) && seqence.hostAnimator != null)
         {
             obj = seqence.hostAnimator.gameObject;
         }
         else
         {
             obj = XResources.LoadGameObject(prefab);
         }
         if (obj)
         {
             bindObj = obj;
             seqence.BindGo(bindObj);
             (data as BindTrackData).prefab = prefab;
             //childs & self
             ForeachHierachyTrack(x => x.OnBind());
         }
     }
 }
Beispiel #10
0
 public void Rebind(string prefab)
 {
     if (!string.IsNullOrEmpty(prefab) && bindObj == null)
     {
         pat = prefab;
         GameObject obj = null;
         if (timeline.IsHostTrack(this))
         {
             obj = timeline.blendPlayableOutput.GetTarget().gameObject;
         }
         else
         {
             obj = XResources.LoadGameObject(prefab);
         }
         if (obj)
         {
             bindObj = obj;
             timeline.BindGo(bindObj);
             (data as BindTrackData).prefab = prefab;
             //childs & self
             ForeachHierachyTrack(x => x.OnBind());
         }
     }
 }