Ejemplo n.º 1
0
        private IEnumerator DoNovaParticle(Character caster, NovaDamageProfile nova)
        {
            yield return(new WaitForSeconds(nova.particleDelay));

            ParticleSystem burst = GameObject.Instantiate(nova.particleBurst,
                                                          caster.transform.position + caster.transform.rotation * nova.centerOffset,
                                                          caster.transform.rotation)
                                   .GetComponent <ParticleSystem>();

            burst.Play(true);
            GameObject.Destroy(burst.gameObject, burst.main.duration);
        }
Ejemplo n.º 2
0
        private IEnumerator DoNovaDamage(Character caster, NovaDamageProfile nova)
        {
            yield return(new WaitForSeconds(nova.damageDelay));

            foreach (Character c in Character.characters
                     .Where(x =>
                            x.CanDamage() &&
                            x != caster &&
                            x.team != caster.team &&
                            Vector3.Distance(caster.transform.position + caster.transform.rotation * nova.centerOffset, x.transform.position) <= nova.damageRadius))
            {
                c.Damage((int)ComputeDamage(caster, c, nova.damageType, nova.damageAmount, nova.damageAffinity));
            }
        }