// Use this for initialization
    void Start()
    {
        totalTime = timeRemaining;
        OnChangeTimeRemaining(0);

        waitTick = new WaitForSecondsIEnum(1f, delegate {
            OnChangeTimeRemaining(-1);

            if (timeRemaining <= totalTime / 2)
            {
                noOfKangaroos = 2;
            }

            if (timeRemaining == 0)
            {
                timeRef.color = Color.green;
                EndGame();
            }
            else
            {
                // Next Tick
                waitTick.Run(this);
            }
        });
        waitTick.Run(this);
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        totalRef.text = "/ " + totalNo;
        UpdatePickedNumber(0);

        waitTick = new WaitForSecondsIEnum(0, delegate {
            GameObject item         = Instantiate <GameObject>(items[Random.Range(0, items.Length)]);
            item.transform.position = startPosition;

            item.GetComponent <FlowItem>().RelativeSpeed = Random.Range(minSpeed, maxSpeed);

            if (!isEnded)
            {
                waitTick.SetSeconds(Random.Range(minInterval, maxInterval)).Run(this);
            }
        });

        waitTick.Run(this);
    }