示例#1
0
    // Update is called once per frame
    void Update()
    //Shows the success rate of the last 100 attempts
    {
        if (robotAgent.GetTimesDone() == 0)
        {
            return;
        }

        float successRate = (((robotAgent.GetTimesWon() + 0f) / (robotAgent.GetTimesDone() + 0f)) * 100f);

        text.text = "Success rate: " + (successRate.ToString("0.00") + "%");
    }