Ejemplo n.º 1
0
        //TODO to much slide while running and jumping
        private void Awake()
        {
            this.GetComponent <Rigidbody2D>().collisionDetectionMode = CollisionDetectionMode2D.Continuous;
            this.GetComponent <Rigidbody2D>().gravityScale           = 0;
            this.GetComponent <Rigidbody2D>().freezeRotation         = true;

            Component[] c = GetComponentsInChildren <HandleCollision>();
            foreach (Component comp in c)
            {
                if (comp.name == "Foot")
                {
                    Foot = comp.GetComponent <HandleCollision>();
                }
                if (comp.name == "Body")
                {
                    Body = comp.GetComponent <HandleCollision>();
                }
                if (comp.name == "Head")
                {
                    Head = comp.GetComponent <HandleCollision>();
                }
            }

            intialiazeJump();
            rigidbody = this.GetComponent <Rigidbody2D>();
        }
Ejemplo n.º 2
0
 void PauseGameMechanic()
 {
     gameOver.enabled = false;
     HUD.enabled = false;
     /* Game Objects */
     handleCollision = GameObject.Find ("HandController").GetComponent<HandleCollision>();
     handleCollision.enabled = false;
     particles = GameObject.FindGameObjectsWithTag("Respawn");
     foreach(GameObject particle in particles) {
         particle.GetComponent<ParticleScript>().TurnOff ();
     }
 }