protected void OnExplosion(ExplosionEvent e) { if (e.InExplosionRadius(transform.position)) { _rigidbody.AddExplosionForce(e.Force, e.Position, e.Radius); } }
public override void OnEvent(ExplosionEvent evnt) { GameObject prefab = Instantiate(ExplosionPrefab); prefab.transform.position = evnt.Position; Destroy(prefab, 10f); }
public void Detonate() { Collider[] targets = Physics.OverlapSphere(this.transform.position, explosionRadius); int i = 0; while (i < targets.Length) { //If something in the radius is a player, deal damage to them. GameObject target = targets[i].gameObject; IPlayer hitplayer = target.GetComponent <AbstractPlayer>(); if (hitplayer != null) { hitplayer.TakeDamage(damage, Thrower, (target.transform.position - this.transform.position), 0); } i++; } //--------Put in something here to create an explosion particle effect------------ //OK, I will, here goes: ExplosionEvent evnt = ExplosionEvent.Create(Bolt.GlobalTargets.Everyone, Bolt.ReliabilityModes.Unreliable); evnt.Position = transform.position; evnt.Send(); //done //Once the whole array has been checked through, delete the grenade. BoltNetwork.Destroy(this.gameObject); }
/// <summary> /// Simulates the effect of getting hit by an explosion. /// </summary> public virtual void ExplosionEffect(float intensity) { m_PlayerHealthSource.ForcePlay(m_ExplosionNoise, m_ExplosionNoiseVolume); m_StunnedSnapshot.TransitionTo(0.1f); float duration = m_DeafnessDuration.x + (m_DeafnessDuration.y - m_DeafnessDuration.x) * intensity; Invoke(nameof(SetNormalSnapshot), duration); ExplosionEvent?.Invoke(); }
static void RaiseEvent(ExplosionEvent in_Event) { if (in_Event != null) { in_Event(); if (bPrintDebug) { Debug.Log("Event: " + in_Event.Method); } } else { PrintNullEventWarning(in_Event.ToString()); } }
public PreviewData(ExplosionEvent explosion, float slope, float totalIntensity) { Slope = slope; TotalIntensity = totalIntensity; Explosion = explosion; }
void Explode() { ExplosionEvent.Invoke(this, transform.position, correctArea); }
void ProjectileExploded(Projectile projectile, Vector3 position, bool correctArea) { ResetProjectile(projectile); ExplosionEvent.Invoke(position, correctArea); }
public void bind(ExplosionEvent explosion) { this.explosion = explosion; }
private void OnExplosion(double top, double left, double width, double height) { ExplosionEvent?.Invoke(this, top, left, width, height); }