Beispiel #1
0
    void spawnChild()
    {
        Vector3 spawnPos;

        do
        {
            spawnPos = getRandomSpawn();
        } while (!isValidSpawn(spawnPos) || (spawnPos.x > 60 || spawnPos.x < -60 || spawnPos.y > 40 || spawnPos.y < -40));
        if (gm.currentCycle == GameManager.DayNightCycle.NIGHT)
        {
            gm.spawnEnemyAtLocation(spawnPos, (int)Random.Range(0f, (float)EnemyType.getTypeSize()));
        }
        gm.spawnEnemyAtLocation(spawnPos, 0);
    }