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