private void HandleUserInput()
    {
        if (Input.GetKeyUp(KeyCode.Space))
        {
            m_BallProjComp.OnKickBall();
            //launch
        }

        if (Input.GetKey(KeyCode.W))
        {
            //m_BallProjComp.OnMoveForward(0.05f);
            m_BallProjComp.OnMoveUp(0.05f);
        }
        if (Input.GetKey(KeyCode.S))
        {
            //m_BallProjComp.OnMoveBackward(0.05f);
            m_BallProjComp.OnMoveDown(0.05f);
        }
        if (Input.GetKey(KeyCode.D))
        {
            m_BallProjComp.OnMoveRight(0.05f);
        }
        if (Input.GetKey(KeyCode.A))
        {
            m_BallProjComp.OnMoveLeft(0.05f);
        }
        if (Input.GetKey(KeyCode.R))
        {
            m_BallProjComp.Reset();

            m_NetBehaviour.setLightColor(Color.white);
            bPlayCompelete = false;
        }
    }
Exemplo n.º 2
0
    private void HandleUserInput()
    {
        if (Input.GetKey(KeyCode.Space))
        {
            // Launch

            m_ball.transform.position = new Vector3(0f, 1f, -8f);
            m_ball.OnKickBall();
        }

        if (Input.GetKey(KeyCode.R))
        {
            // MoveForward
            m_ball.OnMoveForward(0.1f);
        }

        if (Input.GetKey(KeyCode.F))
        {
            // MoveBackward
            m_ball.OnMoveBackward(0.1f);
        }

        if (Input.GetKey(KeyCode.D))
        {
            // MoveRight
            m_ball.OnMoveRight(0.1f);
        }

        if (Input.GetKey(KeyCode.A))
        {
            // MoveLeft
            m_ball.OnMoveLeft(0.1f);
        }

        if (Input.GetKey(KeyCode.W))
        {
            // MoveUp
            m_ball.OnMoveUp(0.1f);
        }

        if (Input.GetKey(KeyCode.S))
        {
            // MoveDown
            m_ball.OnMoveDown(0.1f);
        }
        if (Input.GetKey(KeyCode.Escape))
        {
            //Quit
            Application.Quit();
        }
    }