Esempio n. 1
0
        void SpawnUnitCreep(int waveId, UnitCreep creep)
        {
            Vector3 position = creep.path.waypoints[0];
            GameObject go = ObjectPool.GetEnemy(transform.parent.gameObject, creep.prefab, position);
            go.name = creep.prefab.name + "_" + waveId + "_" + creep.id;

            PathFinder finder = go.GetComponent<PathFinder> ();
            if (finder != null) {
                finder.path = creep.path;
            }
        }
Esempio n. 2
0
        void SpawnUnitCreep(int waveId, UnitCreep creep)
        {
            Vector3    position = creep.path.waypoints[0];
            GameObject go       = ObjectPool.GetEnemy(transform.parent.gameObject, creep.prefab, position);

            go.name = creep.prefab.name + "_" + waveId + "_" + creep.id;

            PathFinder finder = go.GetComponent <PathFinder> ();

            if (finder != null)
            {
                finder.path = creep.path;
            }
        }