예제 #1
0
    public void OnStart()
    {
        GameObject panel = GameObject.GetGameObjectByName("PuzzleButton1").transform.GetChild(0).gameObject;

        panel1 = GetScript <BoobyTrapDeactivator>(panel);
        panel  = GameObject.GetGameObjectByName("PuzzleButton2").transform.GetChild(0).gameObject;
        panel2 = GetScript <BoobyTrapDeactivator>(panel);
        panel  = GameObject.GetGameObjectByName("PuzzleButton3").transform.GetChild(0).gameObject;
        panel3 = GetScript <BoobyTrapDeactivator>(panel);
        panel  = GameObject.GetGameObjectByName("PuzzleButton4").transform.GetChild(0).gameObject;
        panel4 = GetScript <BoobyTrapDeactivator>(panel);

        trapLightW        = GameObject.GetGameObjectByName("TrapLightW");
        trapLightR1       = GameObject.GetGameObjectByName("TrapLightR1");
        trapLightR1script = GetScript <PulsingLightScript>(trapLightR1);
        trapLightR2       = GameObject.GetGameObjectByName("TrapLightR2");
        trapLightR2script = GetScript <PulsingLightScript>(trapLightR2);
        trapLightR3       = GameObject.GetGameObjectByName("TrapLightR3");
        trapLightR3script = GetScript <PulsingLightScript>(trapLightR3);
        trapLightR4       = GameObject.GetGameObjectByName("TrapLightR4");
        trapLightR4script = GetScript <PulsingLightScript>(trapLightR4);

        poisonGas = GameObject.GetGameObjectByName("TSR_PoisonGas");
        gas       = poisonGas.GetComponent <CParticleEmitter>();
        gasScript = GetScript <TransformRiserScript>(poisonGas);

        GameObject boobyControllerObj = GameObject.GetGameObjectByName("TSR_TrapController");//trapControllerName);

        controllerScript = GetScript <BoobyTrapDeactivatorController>(boobyControllerObj);

        gasTimerShutdown = gas.mEmitterProperty.mMaxLifetime;

        mSound = gameObject.RequireComponent <CSound>();
    }
    public void OnStart()
    {
        GameObject panel = GameObject.GetGameObjectByName("PuzzleButton1").transform.GetChild(0).gameObject;
        panel1 = GetScript<BoobyTrapDeactivator>(panel);
        panel = GameObject.GetGameObjectByName("PuzzleButton2").transform.GetChild(0).gameObject;
        panel2 = GetScript<BoobyTrapDeactivator>(panel);
        panel = GameObject.GetGameObjectByName("PuzzleButton3").transform.GetChild(0).gameObject;
        panel3 = GetScript<BoobyTrapDeactivator>(panel);
        panel = GameObject.GetGameObjectByName("PuzzleButton4").transform.GetChild(0).gameObject;
        panel4 = GetScript<BoobyTrapDeactivator>(panel);

        trapLightW = GameObject.GetGameObjectByName("TrapLightW");
        trapLightR1 = GameObject.GetGameObjectByName("TrapLightR1");
        trapLightR1script = GetScript<PulsingLightScript>(trapLightR1);
        trapLightR2 = GameObject.GetGameObjectByName("TrapLightR2");
        trapLightR2script = GetScript<PulsingLightScript>(trapLightR2);
        trapLightR3 = GameObject.GetGameObjectByName("TrapLightR3");
        trapLightR3script = GetScript<PulsingLightScript>(trapLightR3);
        trapLightR4 = GameObject.GetGameObjectByName("TrapLightR4");
        trapLightR4script = GetScript<PulsingLightScript>(trapLightR4);

        poisonGas = GameObject.GetGameObjectByName("TSR_PoisonGas");
        gas = poisonGas.GetComponent<CParticleEmitter>();
        gasScript = GetScript<TransformRiserScript>(poisonGas);

        GameObject boobyControllerObj = GameObject.GetGameObjectByName("TSR_TrapController");//trapControllerName);
        controllerScript = GetScript<BoobyTrapDeactivatorController>(boobyControllerObj);

        gasTimerShutdown = gas.mEmitterProperty.mMaxLifetime;

        mSound = gameObject.RequireComponent<CSound>();
    }
예제 #3
0
    public override void OnStart()
    {
        base.OnStart();

        mInitZ = gameObject.transform.GetPosition(CTransform.TransformSpace.LOCAL).z;
        Reset();

        boobyControllerObj = GameObject.GetGameObjectByName("TSR_TrapController"); //trapControllerName);
        controllerScript   = GetScript <BoobyTrapDeactivatorController>(boobyControllerObj);
        controllerScript.allPanels.Add(gameObject);                                // Add myself to the controller list of buttons

        sound = gameObject.RequireComponent <CSound>();
    }
    public override void OnStart()
    {
        base.OnStart();

        mInitZ = gameObject.transform.GetPosition(CTransform.TransformSpace.LOCAL).z;
        Reset();

        boobyControllerObj = GameObject.GetGameObjectByName("TSR_TrapController");//trapControllerName);
        controllerScript = GetScript<BoobyTrapDeactivatorController>(boobyControllerObj);
        controllerScript.allPanels.Add(gameObject); // Add myself to the controller list of buttons

        sound = gameObject.RequireComponent<CSound>();
    }
예제 #5
0
    public void RespawnToCheckpoint()
    {
        // Differentiate by checkpoint name
        if (gameObject.GetName() == "Checkpoint1a")
        {
            // Reset booby trap event and Unlock door to area 1B
            GameObject boobyControllerObj = GameObject.GetGameObjectByName("TSR_TrapController");//trapControllerName);
            BoobyTrapDeactivatorController controllerScript = GetScript <BoobyTrapDeactivatorController>(boobyControllerObj);
            controllerScript.ResetUponDeathOfPlayer();
        }
        else if (gameObject.GetName() == "Checkpoint3")
        {
            // Reset panels event
            GameObject           deathControllerObj = GameObject.GetGameObjectByName("PuzzleRoom3");//trapControllerName);
            DeathPanelController controllerScript   = GetScript <DeathPanelController>(deathControllerObj);
            controllerScript.ResetUponDeathOfPlayer();
        }

        // Reset the console screen
        Common.GetConsoleScreenScript().RestoreToSavedState();
    }
예제 #6
0
    void UpdateEvent(float dt)
    {
        switch (currEvent)
        {
        case CONSOLE_EVENT.BOOBY_TRAP:
        {
            CFontRenderer alertTextFont = mExtraTexts[0].GetComponent <CFontRenderer>();
            if (eventState == 0)         // waiting for codes to show
            {
                eventTimer -= dt;
                if (eventTimer <= 0.0f)
                {
                    eventState = 1;         // Show the countdown timer
                    eventTimer = 100.0f;
                    alertTextFont.setEnabled(true);
                }
            }
            else if (eventState == 1)
            {
                eventTimer -= dt;
                if (eventTimer <= 0.0f)
                {
                    eventState = 2;
                    eventTimer = 0.0f;

                    BoobyTrapDeactivatorController boobyTrapScript = GetScript <BoobyTrapDeactivatorController>(savedObject, false);
                    if (boobyTrapScript != null)
                    {
                        boobyTrapScript.TimeIsUp();
                    }
                    QueueMessage("Lockdown is in effect.\\n<#1,0,0,1#>Now cleansing Terminal 2 of organic matter.", 0.0f, true, true);
                }
                alertTextFont.mText = "Lockdown in\\n<#1,0,0,1#>" + eventTimer.ToString("0.00");         // 2 decimal places
            }
        }
        break;
        }
    }