private void HitEffect() { if (hitEffect != null) { if (!PoolDictionary.pools.ContainsKey(hitEffect.name)) { PoolDictionary.AddPool(hitEffect.name, () => SpawnHitEffekt(), 3); } GameObject projectileInstance = PoolDictionary.pools[hitEffect.name].GetInstance(); projectileInstance.transform.position = GetAimLocation(); projectileInstance.transform.rotation = transform.rotation; projectileInstance.SetActive(true); } }
private void Start() { PoolDictionary.AddPool(minionToSpawn.name, () => SpawnMethod(), 25); }