コード例 #1
0
    // Use this for initialization
    void Start()
    {
        PlayerLeftScore = PlayerRightScore = 0;
        txtScore.text   = PlayerLeftScore.ToString() + " : " + PlayerRightScore.ToString();

        StartGame();
    }
コード例 #2
0
    public void UpdateScore(bool isRightPlayerLoseAPoint)
    {
        Destroy(ballController.gameObject);

        if (isRightPlayerLoseAPoint)
        {
            PlayerLeftScore++;
            txtNodification.text = "Left Player got a point!";
        }
        else
        {
            PlayerRightScore++;
            txtNodification.text = "Right Player got a point!";
        }
        txtScore.text = PlayerLeftScore.ToString() + " : " + PlayerRightScore.ToString();
        state         = GameState.END;
    }