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);
    }
Exemplo n.º 3
0
    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);
    }
 protected void OnExplosion(ExplosionEvent e)
 {
     if (e.InExplosionRadius(transform.position))
     {
         _rigidbody.AddExplosionForce(e.Force, e.Position, e.Radius);
     }
 }
        /// <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();
        }
Exemplo n.º 6
0
    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 override void OnEvent(ExplosionEvent evnt)
 {
     GameObject prefab = Instantiate(ExplosionPrefab);
     prefab.transform.position = evnt.Position;
     Destroy(prefab, 10f);
 }
 public PreviewData(ExplosionEvent explosion, float slope, float totalIntensity)
 {
     Slope          = slope;
     TotalIntensity = totalIntensity;
     Explosion      = explosion;
 }
Exemplo n.º 9
0
 void Explode()
 {
     ExplosionEvent.Invoke(this, transform.position, correctArea);
 }
Exemplo n.º 10
0
 void ProjectileExploded(Projectile projectile, Vector3 position, bool correctArea)
 {
     ResetProjectile(projectile);
     ExplosionEvent.Invoke(position, correctArea);
 }
Exemplo n.º 11
0
 public void bind(ExplosionEvent explosion)
 {
     this.explosion = explosion;
 }
Exemplo n.º 12
0
 private void OnExplosion(double top, double left, double width, double height)
 {
     ExplosionEvent?.Invoke(this, top, left, width, height);
 }