Exemplo n.º 1
0
 public override void processPrimaryHit(Item item, GameObject hit, Vector3 hitPoint, Vector3 direction)
 {
     Collider[] objects = Physics.OverlapSphere(hitPoint, radius, LayerMask.GetMask("Destructable"));
     foreach (var colliderObject in objects)
     {
         if (colliderObject.gameObject.GetComponent <CombustioEffect>() != null)
         {
             break;
         }
         CombustioEffect c = colliderObject.gameObject.AddComponent <CombustioEffect>();
         c.startEffect(flames, burnTime, damagePerSecond, lifeTime);
     }
     base.processPrimaryHit(item, hit, hitPoint, direction);
 }
Exemplo n.º 2
0
    protected void combust()
    {
        if (combusted)
        {
            return;
        }
        combusted = true;
        GetComponent <IgniteEffect>()?.endEffect();
        IgniteEffect newEffect = gameObject.AddComponent <IgniteEffect>();

        newEffect.startEffect(flames, 10, damagePerSecond, burnTime);

        Collider[] objects = Physics.OverlapSphere(transform.position, 7.5f, LayerMask.GetMask("Destructable"));
        foreach (var colliderObject in objects)
        {
            CombustioEffect combustio = colliderObject.GetComponent <CombustioEffect>();
            if (combustio != null)
            {
                colliderObject.GetComponent <CombustioEffect>().combust();
            }
        }
    }