예제 #1
0
    void Update()
    {
        if (Input.GetMouseButton(0) && IsGrounded)
        {
            body.velocity = Vector2.up * tapforce;
            SoundCTRL.PlaySound("Jump");
        }

        /*if(Input.GetMouseButton(1))
         * {
         *  body.velocity = Vector2.right * tapforce;
         * }*/
    }
예제 #2
0
 void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.gameObject.tag == "ScoreZone")
     {
         SoundCTRL.PlaySound("Coin");
         OnPlayerScored();
     }
     if (collider.gameObject.tag == "DeadZone")
     {
         SoundCTRL.PlaySound("Dead");
         body.simulated = false;
         OnPlayerDied();
     }
 }