コード例 #1
0
        public void ReIntergratePoolableObject(GenericParticleController particleController)
        {
            PoolableParticleItem newItem = new PoolableParticleItem();

            newItem.geo = particleController.gameObject;
            newItem.particleController = particleController;

            createdPoolableItems.Add(newItem);
            particleController.transform.SetParent(transform);
            particleController.transform.localPosition = Vector3.zero;
            particleController.transform.localRotation = Quaternion.identity;
        }
コード例 #2
0
 public override void Init()
 {
     for (int i = 0; i < poolingData.amountToSpawn; i++)
     {
         PoolableParticleItem newItem = new PoolableParticleItem();
         newItem.geo = Instantiate(poolingData.objectToPoolPrefab);
         newItem.geo.transform.SetParent(transform);
         newItem.geo.transform.localPosition = Vector3.zero;
         newItem.particleController          = newItem.geo.GetComponent <GenericParticleController>();
         createdPoolableItems.Add(newItem);
         newItem.particleController.ClearOnStart(this);
     }
 }