Example #1
0
    public EffectParamsGeneric GetEffect(string key)
    {
        EffectPool          pool = this.GetPool(key);
        EffectParamsGeneric effectParamsGeneric = pool.Rent();

        effectParamsGeneric.InitializeFast(BattleEffectManager._camera);
        return(effectParamsGeneric);
    }
Example #2
0
 public void ReturnEffect(EffectParamsGeneric effect)
 {
     if (effect == null)
     {
         global::Debug.LogWarning("引数不正 [ReturnEffect]");
         return;
     }
     this.GetPool(effect.PoolKey).Return(effect);
 }
Example #3
0
    public bool SetPool(string key, Transform parent, GameObject prefab)
    {
        if (string.IsNullOrEmpty(key))
        {
            return(false);
        }
        EffectParamsGeneric component = prefab.GetComponent <EffectParamsGeneric>();

        if (component != null)
        {
            BattleEffectManager._pool.AddOrReplace(key, new EffectPool(key, parent, component));
        }
        return(true);
    }