예제 #1
0
 /// <summary>
 /// This method needs to be called by the parent class to initialize the various feedbacks
 /// </summary>
 public virtual void Initialization()
 {
     if (InstantiateVFX && VfxCreateObjectPool)
     {
         GameObject objectPoolGo = new GameObject();
         objectPoolGo.name            = "FeedbackObjectPool";
         _objectPool                  = objectPoolGo.AddComponent <MMSimpleObjectPooler>();
         _objectPool.GameObjectToPool = VfxToInstantiate;
         _objectPool.PoolSize         = VfxObjectPoolSize;
         _objectPool.FillObjectPool();
     }
 }
예제 #2
0
        /// <summary>
        /// Instantiates a simple object pooler and sets it up
        /// </summary>
        protected virtual void InstantiateSimplePool()
        {
            if (PooledSimpleMMFloatingText == null)
            {
                Debug.LogError(this.name + " : no PooledSimpleMMFloatingText prefab has been set.");
                return;
            }
            GameObject newPooler = new GameObject();

            newPooler.name = PooledSimpleMMFloatingText.name + "_Pooler";
            newPooler.transform.SetParent(this.transform);
            MMSimpleObjectPooler simplePooler = newPooler.AddComponent <MMSimpleObjectPooler>();

            simplePooler.PoolSize              = PoolSize;
            simplePooler.GameObjectToPool      = PooledSimpleMMFloatingText.gameObject;
            simplePooler.NestWaitingPool       = NestWaitingPool;
            simplePooler.MutualizeWaitingPools = MutualizeWaitingPools;
            simplePooler.PoolCanExpand         = PoolCanExpand;
            simplePooler.FillObjectPool();
            _pooler = simplePooler;
        }