public static void clearChildren(Transform parent) { foreach (Transform child in parent) { ResFactory.Destroy(child.gameObject); } }
public void playVoice(string voiceName, float delay = 0f) { AudioClip audioClip = ResFactory.loadVoiceClip(voiceName); GameObject go = ResFactory.loadPrefab("audio"); go = ResFactory.createObject <GameObject>(go); go.name = voiceName; AudioSource audioSource = go.GetComponent <AudioSource>(); audioSource.clip = audioClip; audioSource.PlayDelayed(delay); ResFactory.Destroy(go, audioClip.length + delay); go.transform.SetParent(this.audioController.transform); }
protected override void preInit() { base.preInit(); this.mainBody = this.gameObject.transform; if (this.isNullBullet) { AutoDestroy auto = this.gameObject.GetComponent <AutoDestroy>(); if (null != auto) { ResFactory.Destroy(auto); } } else { this._particles = new List <ParticleSystem>(this.GetComponentsInChildren <ParticleSystem>()).ConvertAll <ParticleReset>((p) => { return(new ParticleReset(p)); }); } }
public virtual void clear() { this._map.removeClientView(this); ResFactory.Destroy(this.gameObject); this._cleared = true; }
public void clear() { this._cleared = true; ResFactory.Destroy(this.go); }