Exemplo n.º 1
0
    void SpawnOneEnemy()
    {
        EnemyMovePath e = Instantiate <EnemyMovePath>(enemyToSpawnRef);

        e.Init(this);

        EnemyHealth eh = e.gameObject.GetComponent <EnemyHealth>();

        if (eh != null)
        {
            eh.Register(this);
        }

        //if (miscPoints != null)
        //{
        //	EnemyMiscPointsHolder msh = e.gameObject.GetComponent<EnemyMiscPointsHolder>();
        //	if (msh != null)
        //	{
        //		msh.setPointsList(miscPoints);
        //	}
        //}

        enemiesSpawned++;
    }
Exemplo n.º 2
0
    void spawnOneEnemy()
    {
        EnemyMovePath e = Instantiate <EnemyMovePath>(enemyToSpawnRef);

        e.initFromSpawner(this);

        EnemyHealthManager eh = e.gameObject.GetComponent <EnemyHealthManager>();

        if (eh != null)
        {
            eh.register(this);
        }

        if (miscPoints != null)
        {
            EnemyMiscPointsHolder msh = e.gameObject.GetComponent <EnemyMiscPointsHolder>();
            if (msh != null)
            {
                msh.setPointsList(miscPoints);
            }
        }

        enemiesSpawned++;
    }