private void Die() { UpdateManager.UNITUPDATE -= UpdateManager_UNITUPDATE; HideLifebar(); // Explosion does the ExplosionsManager... StaticExploader.Exploade(1, this.transform.position); //Destruction now does the UnitDestructionsManagement... UnitDestructionManagement.SignInForDestruction(this.gameObject); }
// public bool staticExplosionStarted = false; void UpdateManager_WEAPONUPDATES() {// Flying... if (!IsExploading) { Rotation(); if (LaunchButton) { Throttle(); } } else {// Exploading ! if (this.audio.isPlaying) { if (emission.enableEmission) { emission.enableEmission = false; StaticExploader.Exploade(0, this.gameObject.transform.position); } // later an ID for playing an AudioClip could be addedt in the StaticExploasionsManager.... } else { if (this.transform.GetChild(1).gameObject) { GameObject.Destroy(this.transform.GetChild(1).gameObject); } if (this.transform.GetChild(0).gameObject) { GameObject.Destroy(this.transform.GetChild(0).gameObject); } GameObject.Destroy(this.gameObject); } } }