public void ApplyEffect(Effect effect) { if (effectManager != null) { effectManager.ApplyEffect(effect); } }
/// <summary> /// Consumes the effect. /// </summary> /// <param name="effectManager">Effect manager to apply the effect to.</param> void ConsumeEffect(EffectManager effectManager) { effectManager.ApplyEffect(_effect); Destroy(gameObject); OnConsumed?.Invoke(this, new System.EventArgs()); Debug.Log(string.Format("effect {0} applied to {1}", _effect, effectManager)); }
void Awake() { _effects = GetComponent <EffectManager>(); _effects.Init(this); if (!_effects.HasEffect <EffectImpl.LandmarkWrapperEffect>()) { _effects.ApplyEffect(new EffectImpl.LandmarkWrapperEffect()); } _cardManager = GetComponent <CardManager>(); }