Esempio n. 1
0
    /// <summary>
    /// in ResetGame we reset the game so that the next round can be played
    /// </summary>
    private void ResetGame()
    {
        // we put the orange ball on its initial position
        _newPositionOrange          = ballOrange.GetComponent <Transform>();
        _newPositionOrange.position = MoveBall.InitialPosition;

        // we put the blue ball on its initial position
        _newPositionBlue          = ballBlue.GetComponent <Transform>();
        _newPositionBlue.position = MoveBallBlue.InitialPosition;

        //we say that both targets are not hit
        _orange = false;
        _blue   = false;

        // we set our datapoints active again in order to collect new data in the next round
        orangePoint1.gameObject.SetActive(true);
        orangePoint2.gameObject.SetActive(true);
        orangePoint3.gameObject.SetActive(true);
        orangePoint4.gameObject.SetActive(true);
        orangePoint5.gameObject.SetActive(true);

        bluePoint1.gameObject.SetActive(true);
        bluePoint2.gameObject.SetActive(true);
        bluePoint3.gameObject.SetActive(true);
        bluePoint4.gameObject.SetActive(true);
        bluePoint5.gameObject.SetActive(true);


        // we reset our data lists in order to use them again
        for (int i = 0; i < 5; i++)
        {
            ballBlue.timePoints[i] = "not used";
        }
        for (int i = 0; i < 5; i++)
        {
            ballOrange.timePoints[i] = "not used";
        }
    }