Exemplo n.º 1
0
    private void SelfDestruct()
    {
        GameObject shootHitEffect = ObjectPool.GetObject(explodeEffect, "Effects");

        shootHitEffect.transform.position = Source.transform.position;

        Entity entity;

        if ((Target.transform.position - Source.transform.position).magnitude < radius)
        {
            entity = Target.GetComponent <Entity>();
            if (entity != null)
            {
                healthModifier.Health     = entity.GetCapability <Health>();
                healthModifier.DeltaValue = -damage;
            }
            healthModifier.TakeEffect();
        }

        entity = Source.GetComponent <Entity>();
        if (entity != null)
        {
            healthModifier.Health     = entity.GetCapability <Health>();
            healthModifier.DeltaValue = -selfDamage;
        }
        healthModifier.TakeEffect();
    }
Exemplo n.º 2
0
 private void TakeEffect()
 {
     healthModifier.TakeEffect();
     animatorTrigger.TakeEffect();
     audioPlayModifier.TakeEffect();
     creatEffectModifier.TakeEffect();
 }
Exemplo n.º 3
0
    private void OnTriggerStay2D(Collider2D other)
    {
        var gameObject = other.gameObject;

        if (gameObject == Target)
        {
            var entity = gameObject.GetComponent <Entity>();
            if (entity != null)
            {
                healthModifier.Health = entity.GetCapability <Health>();
                healthModifier.TakeEffect();

                targetAnimator.Animator = gameObject.GetComponent <Animator>();
                targetAnimator.TakeEffect();
            }
            ObjectPool.RecycleObject(this.gameObject);
        }
    }
Exemplo n.º 4
0
 private void TakeEffect()
 {
     healthModifier.TakeEffect();
     animatorTrigger.TakeEffect();
 }