示例#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);
		}