Exemplo n.º 1
0
    public void arrive(FlyingDoge theDoge)
    {
        theDoge.canMove = false;
        theDoge.reset();

        dogePool.Enqueue(theDoge.gameObject);
        dogeCount--;
    }
Exemplo n.º 2
0
    private IEnumerator generateDoge()
    {
        while (true)
        {
            // gen
            if (dogeCount < dogeCountLimit && Random.Range(0f, 1f) < prob)
            {
                FlyingDoge nextDoge = dogePool.Dequeue().GetComponent <FlyingDoge>();
                nextDoge.canMove = true;
                nextDoge.reset();
                nextDoge.startFly();

                dogeCount++;
            }

            yield return(new WaitForSeconds(coolDown));
        }
    }