private IEnumerator TimerCountdown()
    {
        remainingIdleTimeTitleText.enabled = true;
        remainingIdleTimeText.enabled      = true;

        while (bt.GetIdlePauseTime() - bt.GetIdlePauseTimer() > Mathf.Epsilon)
        {
            remainingIdleTimeText.text = (bt.GetIdlePauseTime() - bt.GetIdlePauseTimer()).ToString("0.00");
            yield return(null);
        }

        StopTimer();

        yield break;
    }
Esempio n. 2
0
    public override NodeStates Process(BlackboardBase bb)
    {
        if (debug)
        {
            Debug.Log($"IDLE");
        }

        RobotBlackboard robotBB = bb as RobotBlackboard;

        if (robotBB.GetIdlePauseTimer() < robotBB.GetIdlePauseTime())
        {
            robotBB.SetIdlePauseTimer(robotBB.GetIdlePauseTimer() + Time.deltaTime);

            return(NodeStates.Running);
        }
        else
        {
            robotBB.SetIdlePauseTimer(robotBB.GetIdlePauseTime());
            return(NodeStates.Success);
        }
    }