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;
        }
    }
    public void OnTriggerExit(Collider other)
    {
        BallPhysics ballPhysics = other.GetComponent <BallPhysics>();

        if (ballPhysics)
        {
            ballPhysics.Reset();
        }
    }
Beispiel #3
0
 private void Reset()
 {
     // PlayerOne.Reset();
     // PlayerTwo.Reset();
     StartCoroutine(Ball.Reset(BallResetWaitTime));
 }