コード例 #1
0
    public override void processPrimaryHit(Item item, GameObject hit, Vector3 hitPoint, Vector3 direction)
    {
        IgniteEffect ignite = hit.AddComponent <IgniteEffect>();//TODO ignite object(applies continuous damage) if in fuel state and no damage if in wet state

        ignite.startEffect(secondaryOnHitEffect, baseDamage, damagePerSecond, lifeTime);
        //playPrimaryOnHitEffect(hit, hitPoint);
        base.processPrimaryHit(item, hit, hitPoint, direction);
    }
コード例 #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();
            }
        }
    }