Exemplo n.º 1
0
    void Turn()
    {
        xMove = Input.GetAxis("Horizontal");

        transform.Translate(xMove * horizontalSpeed * Time.deltaTime, 0, 0);

        mesh.eulerAngles = new Vector3(0, 30 * xMove, 0);

        if (xMove != 0)
        {
            if (MGM == null)
            {
                MGM = FindObjectOfType <MinigameManager>();
            }

            MGM.AddTurnAcceleration(Mathf.Sign(xMove));
        }
    }