/// <summary> /// This is the Method to call when destroying a Frenzy Banana. It will call a method on a the GameObject /// in the scene that holds/activates the "Frenzy" sprite renderer, starts the Frenzy Fruit Spawner's for 5-8 /// seconds, and makes the BG change color rapidly. Then the method instantiates a particle system at the hit or /// death location, and then SetActive(false)'s the object. /// </summary> void FenzyBananaDestroy() { //The start effect gets called on the scene FrenzyEffect object (starts the "Frenzy" Sprite Renderer, //and changes BG color. frenzyEffectGameObject.StartEffect(); //We instantiate the star and blast ring effect that is used for all of the Banana PowerUps //it simple, and there aren't any gibs used... would look better with some banana gibs, maybe we //could make some simple shapes that use the UV space of the respective objects texture. Left //out for now. Instantiate(frenzyParticleEffect, transform.position - new Vector3(0, 0, 20), Quaternion.identity); //set this object inactive so that it can be called from the pool again. thisGameObject.SetActive(false); }
/// <summary> /// This is the Method to call when destroying a Frenzy Banana. It will call a method on a the GameObject /// in the scene that holds/activates the "Frenzy" sprite renderer, starts the Frenzy Fruit Spawner's for 5-8 /// seconds, and makes the BG change color rapidly. Then the method instantiates a particle system at the hit or /// death location, and then SetActive(false)'s the object. /// </summary> void FenzyBananaDestroy() { //The start effect gets called on the scene FrenzyEffect object (starts the "Frenzy" Sprite Renderer, //and changes BG color. antidoteIconAnim = GameObject.Find("AntidoteIcon").GetComponent <Animator>(); antidoteIconAnim.SetTrigger(Tags.antidoteAnimationTrigger); frenzyEffectGameObject.StartEffect(); //We instantiate the star and blast ring effect that is used for all of the Banana PowerUps //it simple, and there aren't any gibs used... would look better with some banana gibs, maybe we //could make some simple shapes that use the UV space of the respective objects texture. Left //out for now. Instantiate(frenzyParticleEffect, transform.position - new Vector3(0, 0, 20), Quaternion.identity); //set this object inactive so that it can be called from the pool again. thisGameObject.SetActive(false); GameController.GameControllerInstance.numAntidot = Mathf.Min(1, GameController.GameControllerInstance.numAntidot + 1); }