示例#1
0
    public void Activate(GrenadeCurrent gc)
    {
        grenadeCurrent = gc;
        useRef         = GetComponent <UseableObjectUse>();
        switch (useRef.useableItemIndex)
        {
        case 7: explodeOnContact = true; break;

        case 8: explodeOnContact = true; break;

        case 9: explodeOnContact = true; break;

        case 10: timeFinished = Time.time + gc.earthShakerTimeSetting; useTimer = true; break;

        case 11: useProx = true; break;

        case 12: timeFinished = Time.time + gc.nitroTimeSetting; useTimer = true; break;

        case 13: explodeOnContact = true; break;

        default: break;
        }
        ToggleTexture();
        tickFinished = Time.time + tickTime;
        active       = true;
    }
示例#2
0
    // Check all active and existing scripts on this gameObject that can be used and use them
    // Called by MouseLookScript.cs from a Use() raycast
    public void Use(UseData ud)
    {
        // ButtonSwitch - used by static switches and button panels
        bs = GetComponent <ButtonSwitch>();
        if (useButtonSwitch && bs != null)
        {
            bs.Use(ud);
        }

        cs = GetComponent <ChargeStation>();
        if (useChargeStation && cs != null)
        {
            cs.Use(ud);
        }

        dr = GetComponent <Door>();
        if (useDoor && dr != null)
        {
            dr.Use(ud);
        }

        hb = GetComponent <HealingBed>();
        if (useHealingBed && hb != null)
        {
            hb.Use(ud);
        }

        ke = GetComponent <KeypadElevator>();
        if (useKeypadElevator && ke != null)
        {
            ke.Use(ud);
        }

        kk = GetComponent <KeypadKeycode>();
        if (useKeypadKeycode && kk != null)
        {
            kk.Use(ud);
        }

        pl = GetComponent <PaperLog>();
        if (usePaperLog && pl != null)
        {
            pl.Use(ud);
        }

        pgp = GetComponent <PuzzleGridPuzzle>();
        if (usePuzzleGridPuzzle && pgp != null)
        {
            pgp.Use(ud);
        }

        uou = GetComponent <UseableObjectUse>();
        if (useUseableObjectUse && uou != null)
        {
            uou.Use(ud);
        }

        ua = GetComponent <UseableAttachment>();
        if (useUseableAttachment && ua != null)
        {
            ua.Use(ud);
        }
    }