Ejemplo n.º 1
0
    //void SwitchMode()
    //{
    //	if (Input.GetKeyDown(KeyCode.Alpha1))
    //	{
    //		SpecifyControlMode (1);
    //	}
    //
    //	if (Input.GetKeyDown(KeyCode.Alpha2))
    //	{
    //		SpecifyControlMode (2);
    //	}
    //
    //	if (Input.GetKeyDown(KeyCode.Alpha3))
    //	{
    //		SpecifyControlMode (3);
    //	}
//}

    void OnCollisionEnter(Collision other)
    {
        if (other.gameObject.tag == "Walk Trigger")
        {
            SpecifyControlMode(1);
            Debug.Log("I Walk!");

            instructions.text = "Walking Enabled - Press Space to jump";
        }

        if (other.gameObject.tag == "Glide Trigger")
        {
            SpecifyControlMode(2);
            Debug.Log("I Glide!");

            instructions.text = "Gliding Enabled - Hold Space in air to glide";
        }
        if (other.gameObject.tag == "Fly Trigger")
        {
            SpecifyControlMode(3);
            Debug.Log("I Fly!");

            instructions.text = "Flying Enabled - Press Space in air to flap wings";
        }
        if (other.gameObject.tag == "Fly Better Trigger")
        {
            maxJumpStamina = 6;
            flyHeight      = 5;
        }
        if (other.gameObject.tag == "Death")
        {
            this.transform.position = Checkpoints.GetActiveCPPosition();
            Debug.Log(Checkpoints.GetActiveCPPosition());
        }
    }