public EffectParamsGeneric GetEffect(string key) { EffectPool pool = this.GetPool(key); EffectParamsGeneric effectParamsGeneric = pool.Rent(); effectParamsGeneric.InitializeFast(BattleEffectManager._camera); return(effectParamsGeneric); }
public void ReturnEffect(EffectParamsGeneric effect) { if (effect == null) { global::Debug.LogWarning("引数不正 [ReturnEffect]"); return; } this.GetPool(effect.PoolKey).Return(effect); }
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); }