void Awake() { t = gameObject.GetComponent <Transform>(); if (!SimplePool.PoolExists(projectilePrefab.name)) { SimplePool.CreatePool(projectilePrefab); } }
void Start() { foreach (AudioClip c in sounds) { GameObject go = new GameObject(c.name); AudioSource aSource = go.AddComponent <AudioSource>(); LifeTime lt = go.AddComponent <LifeTime>(); lt.lifeTime = c.length; aSource.clip = c; aSource.playOnAwake = true; SimplePool.CreatePool(go, 100); } }
void SetupProjectilePools() { if (!SimplePool.PoolExists(basicProjectilePrefab.name)) { SimplePool.CreatePool(basicProjectilePrefab); } if (!SimplePool.PoolExists(littleYellowProjectilePrefab.name)) { SimplePool.CreatePool(littleYellowProjectilePrefab); } if (!SimplePool.PoolExists(bigBlueProjectilePrefab.name)) { SimplePool.CreatePool(bigBlueProjectilePrefab); } }
void SetupPools() { foreach (GameObject type in enemyTypes) { if (!SimplePool.PoolExists(type.name)) { SimplePool.CreatePool(type); } } foreach (GameObject type in powerUps) { if (!SimplePool.PoolExists(type.name)) { SimplePool.CreatePool(type); } } }