public void Stun(float stunTimeMS, float stunSpeedMod, float ballImpulse) { if (m_properties.Invincible) { return; } if (m_properties.Stunned) { return; } PlayerStunEffect stunEffect = new PlayerStunEffect(); stunEffect.SetDuration(stunTimeMS); stunEffect.Parameters = new StunParamters() { BallImpulse = ballImpulse }; if (m_ball != null) { SlowEffect slowEffect = new SlowEffect(); slowEffect.SetDuration(80); m_ball.AddEffect(slowEffect); } AddEffect(stunEffect); }
public override void Effect(GameObject target) { target.GetComponent <Life>().DealDamage(damage); target.AddComponent <SlowEffect>(); SlowEffect eff = target.GetComponent <SlowEffect>(); eff.SetDuration(slowDuration); eff.SetSlowAmount(slowAmount); }
private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player" && !m_effectAdded) { other.gameObject.AddComponent <SlowEffect>(); SlowEffect slow = other.gameObject.GetComponent <SlowEffect>(); slow.SetDuration(m_freezeDur); slow.SetSlowAmount(100); m_effectAdded = true; } }