示例#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);
 }
示例#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();
                        }
                    }
                }
            }
        }
示例#3
0
 public override void OnDestroy()
 {
     if (!timeline.IsHostTrack(this))
     {
         XResources.DestroyGameObject(pat, bindObj);
     }
     base.OnDestroy();
 }
示例#4
0
 public override void OnBind()
 {
     if (fx)
     {
         XResources.DestroyGameObject(path, fx);
     }
     Load((BoneFxClipData)data);
 }
示例#5
0
        public override void OnDestroy()
        {
            if (prefabGameObject)
            {
                XResources.DestroyGameObject(path, prefabGameObject);
                particleSystems = null;
            }
            SharedPool <XSceneFxClip> .Return(this);

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

            base.OnDestroy();
        }
示例#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>();
     }
 }
示例#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();
        }
示例#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());
         }
     }
 }
示例#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());
         }
     }
 }