Inheritance: MonoBehaviour
Esempio n. 1
0
        GameObject SpawnObject(Vector3 position)
        {
            GameObject spawnedObj = Instantiate(spawnObjectPrefab, position, Quaternion.identity) as GameObject;

            if (spawnedObjectParent != null)
            {
                spawnedObj.transform.SetParent(spawnedObjectParent);
            }

            _cooldownTimer = cooldown;
            _currNumObjects++;

            AutoSpawnedObject aso = spawnedObj.AddComponent <AutoSpawnedObject>();

            aso.autoSpawner = this;

            return(spawnedObj);
        }
Esempio n. 2
0
 void IAutoSpawner.OnSpawnedObjectDestroy(AutoSpawnedObject spawnedObj)
 {
     _currNumObjects--;
 }