Пример #1
0
		void SetupShellPool()
		{
			GameObject templateShell = (GameObject) Instantiate(GameDatabase.Instance.GetModel("BDArmory/Models/shell/model"));
			templateShell.SetActive(false);
			templateShell.AddComponent<ShellCasing>();

			shellPool = ObjectPool.CreateObjectPool(templateShell, 50, true, true);
		}
Пример #2
0
        void SetupFlarePool()
        {
            GameObject cm = (GameObject)Instantiate(GameDatabase.Instance.GetModel("BDArmory/Models/CMFlare/model"));

            cm.SetActive(false);
            cm.AddComponent <CMFlare>();
            flarePool = ObjectPool.CreateObjectPool(cm, 10, true, true);
        }
Пример #3
0
		void SetupBulletPool()
		{
			GameObject templateBullet = new GameObject("Bullet");
			templateBullet.SetActive(false);
			templateBullet.AddComponent<PooledBullet>();


			bulletPool = ObjectPool.CreateObjectPool(templateBullet, 100, true, true);
		}