public void Emit(Transform owner, int type, long hurt, bool critical) { EmitComponent ec; if (_componentPool.Count > 0) { ec = _componentPool.Pop(); } else { ec = new EmitComponent(); } ec.SetHurt(owner, type, hurt, critical); }
public void ReturnComponent(EmitComponent com) { _componentPool.Push(com); }