示例#1
0
    void Update()
    {
        timeLeftPlat.text = totalTime.ToString();
        statusPlat.text   = currentState.ToString();


        if (currentState == driverState.driving)
        {
            busy.SetActive(true);
            foreach (GameObject obj in disable)
            {
                obj.SetActive(false);
            }
        }

        if (currentState == driverState.waiting)
        {
            busy.SetActive(false);
            foreach (GameObject obj in disable)
            {
                obj.SetActive(true);
            }
        }

        // Time Managment
        if (time >= totalTime)
        {
            currentState = driverState.waiting;
            time         = 0;
        }
        else
        {
            time += Time.deltaTime;
        }
    }