Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.D))
        {
            myCharacter.velocity = new Vector3(0, 0, 0);
            rotationAngleY      += 90.0f;
            myCharacter.rotation = Quaternion.Euler(0, rotationAngleY, 0);
            Debug.Log(myCharacter.rotation.eulerAngles.y);
            this.FixedUpdate();
        }

        if (Input.GetKeyDown(KeyCode.A))
        {
            myCharacter.velocity = new Vector3(0, 0, 0);
            rotationAngleY      -= 90.0f;
            myCharacter.rotation = Quaternion.Euler(0, rotationAngleY, 0);
            Debug.Log(myCharacter.rotation.eulerAngles.y);
            this.FixedUpdate();
        }

        if (Input.GetKeyDown(KeyCode.Space) && noJumpDuration >= 0.65f)
        {
            TimeKeeper.PlayerJumped();
            Jump();
            noJumpDuration = 0.0f;
        }

        noJumpDuration += Time.deltaTime;
    }