Exemple #1
0
 public static void clearChildren(Transform parent)
 {
     foreach (Transform child in parent)
     {
         ResFactory.Destroy(child.gameObject);
     }
 }
Exemple #2
0
    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);
    }
Exemple #3
0
 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)); });
     }
 }
Exemple #4
0
 public virtual void clear()
 {
     this._map.removeClientView(this);
     ResFactory.Destroy(this.gameObject);
     this._cleared = true;
 }
Exemple #5
0
 public void clear()
 {
     this._cleared = true;
     ResFactory.Destroy(this.go);
 }