コード例 #1
0
ファイル: Projectile.cs プロジェクト: ziro7/ScriptsGitHub
        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);
            }
        }
コード例 #2
0
 private void Start()
 {
     PoolDictionary.AddPool(minionToSpawn.name, () => SpawnMethod(), 25);
 }