public void SetAtHitPoint(Vector3 hitPoint) { if (_particleSystem != null && _properties != null) { AttachTransform.Detach(_particleSystem.gameObject); _particleSystem.transform.position = hitPoint; } }
public void Recycle(GameObject go) { if (_active.Contains(go)) { AttachTransform.Detach(go); _ready.Add(go); _active.Remove(go); go.transform.SetParent(GenericPoolSingleton.Instance.transform); } }
private void OnParticleFieldAdd(MoveEditor.ParticleEventProperties properties, ParticleSystem ps, bool flipped) { CleanUpPreviewParticle(); if (ps != null && _previewGameObject != null) { _previewParticleSystem = MoveEditor.MoveUtils.InstantiateParticle(this, properties, GetAnimator(), flipped, true); if (_previewParticleSystem != null) { AttachTransform.Detach(_previewParticleSystem.gameObject); _previewParticleSystem.transform.parent = MoveEditor.MoveUtils.GetBodyPartTransform(GetAnimator(), properties._bodyPart, properties._attachmentPath); Selection.activeTransform = _previewParticleSystem.transform; } } }
// Shut down all systems public void Retire() { for (int i = _active.Count - 1; i >= 0; --i) { if (_active[i] != null) { U tri = _active[i].GetComponent <U>(); tri.Stop(); AttachTransform.Detach(_active[i]); _active[i].transform.SetParent(GenericPoolSingleton.Instance.transform); _ready.Add(_active[i]); } _active.RemoveAt(i); } }
public void Update() { for (int i = _active.Count - 1; i >= 0; --i) { if (_active[i] == null) { continue; } U tri = _active[i].GetComponent <U>(); if (tri != null && !tri.IsPlaying) { AttachTransform.Detach(_active[i]); _ready.Add(_active[i]); _active[i].transform.SetParent(GenericPoolSingleton.Instance.transform); _active.RemoveAt(i); } } }