Ejemplo n.º 1
0
        private void ExplodeObject(GameObject gameObject)
        {
            var exploder = Exploder2D.Utils.Exploder2DSingleton.Exploder2DInstance;

            exploder.transform.position = Exploder2DUtils.GetCentroid(gameObject);
            exploder.Radius             = 1.0f;
            exploder.Explode();
        }
Ejemplo n.º 2
0
 private void explode()
 {
     // Blow up comet
     Exploder2DUtils.SetActive(exploder.gameObject, true);
     exploder.transform.position = Exploder2DUtils.GetCentroid(gameObject);
     GameObject.FindGameObjectWithTag(Constants.EXPLOSION_PLAYER).GetComponent <AudioSource>().Play();
     exploder.Explode();
     Invoke("destroy", DESTROY_DELAY);
 }
Ejemplo n.º 3
0
 private void explode()
 {
     Exploder2DUtils.SetActive(exploder.gameObject, true);
     exploder.Radius             = 0.1f;
     exploder.Force              = 1.0f;
     exploder.TargetFragments    = 50;
     exploder.transform.position = Exploder2DUtils.GetCentroid(gameObject);
     exploder.Explode();
 }
Ejemplo n.º 4
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (!other.CompareTag("Player"))
     {
         return;
     }
     FindObjectOfType <CameraController>().StopFollowingPlayer();
     other.gameObject.tag = Constants.EXPLODER_2D;
     Exploder2DUtils.SetActive(exploder.gameObject, true);
     exploder.transform.position = Exploder2DUtils.GetCentroid(other.gameObject);
     exploder.Radius             = 1.0f;
     exploder.Force           = 5.0f;
     exploder.TargetFragments = 50;
     exploder.Explode();
     GetComponent <AudioSource>().Play();
     Invoke("fadeOut", FADE_DELAY);
 }
Ejemplo n.º 5
0
        void ExplodeList()
        {
            if (index >= sprites.Count)
            {
                return;
            }

            var exploder = Exploder2DSingleton.Exploder2DInstance;

            // move exploder object to the same position
            exploder.transform.position = Exploder2DUtils.GetCentroid(sprites[index]);

            // decrease the radius so the exploder is not interfering other objects
            exploder.Radius = 1.0f;

            exploder.Explode(OnExplosion);
        }
Ejemplo n.º 6
0
        void ExplodeObject(GameObject obj)
        {
            // activate exploder
            Exploder2DUtils.SetActive(exploder.gameObject, true);

            // move exploder object to the same position
            exploder.transform.position = Exploder2DUtils.GetCentroid(obj);

            // decrease the radius so the exploder is not interfering other objects
            exploder.Radius = 0.1f;

            // DONE!
#if ENABLE_CRACK_AND_EXPLODE
            exploder.Crack(OnCracked);
#else
            exploder.Explode(OnExplosion);
#endif
        }
Ejemplo n.º 7
0
 private void startBlackHole()
 {
     if (sunExploded)
     {
         return;
     }
     FindObjectOfType <LevelManager>().PlayEvilBGM();
     sun.tag = Constants.EXPLODER_2D;
     Exploder2DUtils.SetActive(sun, true);
     exploder.transform.position = Exploder2DUtils.GetCentroid(sun);
     exploder.Radius             = 100.0f;
     exploder.Force           = 32.0f;
     exploder.TargetFragments = 420;
     sunExploded = true;
     exploder.Explode();
     blackHoleIsActive = true;
     blackHole.SetActive(true);
 }