Example #1
0
 public override void Affect(BasicAffectable other)
 {
     foreach (IEffect effect in this._effects)
     {
         effect.Affect(other);
     }
 }
Example #2
0
    public virtual void Affect(BasicAffectable other)
    {
        if (this.Effect != null)
        {
            this.Effect.Affect(other);
        }
        else
        {
            Debug.LogWarning($"{this.name}: has no effects?");
        }

        if (this.OnAffect != null)
        {
            this.OnAffect.Invoke(other);
        }
    }
    private void OnEnable()
    {
        if (this.Subject == null)
        {
            if (this.TryGetComponent(out Transform subject))
            {
                Debug.LogWarning($"{this.name}: monitor subject missing!");
                this.Subject = subject;
            }
            else
            {
                Debug.LogError($"{this.name}: can't find monitor subject!");
            }
        }

        this._player     = this.Subject.GetComponent <Player>();
        this._affectable = this.Subject.GetComponent <BasicAffectable>();
    }
Example #4
0
 public override void Affect(BasicAffectable other)
 {
     other.GetComponent <Mover>().Speed *= this.SpeedMultiplier;
 }
Example #5
0
 public override void Affect(BasicAffectable other)
 {
     Debug.Log($"{this.name}: InteractedBy {other.name}");
 }
Example #6
0
 public override void Affect(BasicAffectable other)
 {
     this.gameObject.SetActive(false);
     base.Affect(other);
 }
Example #7
0
 public override void Affect(BasicAffectable other)
 {
     this._amin.SetTrigger("Press");
 }
Example #8
0
 public override void Affect(BasicAffectable other)
 {
     this.SwapControls(other.GetComponent <InputProcessor>().ActionKeyCodes);
 }
Example #9
0
 public abstract void Affect(BasicAffectable other);