Example #1
0
    public void OnStart()
    {
        _onTime            = 1.0f;
        _transitionOffTime = 0.1f;
        _transitionOnfTime = 0.2f;
        _minOffHoldTime    = 0.1f;
        _maxOffHoldTime    = 0.5f;
        _minOnHoldTime     = 0.1f;
        _maxOnHoldTime     = 0.5f;

        _minoffinten = 0.1f;
        _maxoffinten = 0.5f;
        _minonintern = 0.8f;
        _maxonintern = 1.1f;

        smc    = new StateMachineController();
        light  = gameObject.RequireComponent <CLight>();
        timer += MMath.GetRandomFloat() * 2.0f;

        lighthold = new State(smc, null, null, null, MinOnHoldTime, null);
        lighton   = new State(smc, S_LightOn_Start, S_Light_Update, null, TransitionOnTime, lighthold);
        lightoff  = new State(smc, S_LightOff_Start, S_Light_Update, null, TransitionOffTime, lighthold);
        smc.SetState(lightoff);

        mSound = gameObject.RequireComponent <CSound>();
    }
Example #2
0
        public void GetColor()
        {
            CLight testLight = new CLight();

            testLight.AddColor(new CColor {
                Name = "red",
                Rgb  = new float[] { 1.0f, 0f, 0f }
            });
            testLight.AddColor(new CColor
            {
                Name = "green",
                Rgb  = new float[] { 0f, 1f, 0f }
            });
            testLight.AddColor(new CColor
            {
                Name = "blue",
                Rgb  = new float[] { 0f, 0f, 1f }
            });

            // First change
            testLight.SetRgb(new float[] { 0.1f, 0.2f, 0.3f }, 111);

            var thingOne   = testLight.GetColorValue(0, 11);
            var thingTwo   = testLight.GetColorValue(1, 11);
            var thingThree = testLight.GetColorValue(2, 11);
        }
 public void OnStart()
 {
     light = gameObject.RequireComponent<CLight>();
     Random r = new Random();
     timer += (float)r.NextDouble()*2.0f;
     activated = true;
 }
Example #4
0
        public void SetRgb_Should_SaveOldValuesAndSetNewValues()
        {
            CLight testLight = new CLight();

            // First change
            testLight.SetRgb(new float[] { 0.1f, 0.2f, 0.3f }, 111);

            float[] rgb = testLight.GetRgb();
            Assert.AreEqual(0.1f, rgb[0]);
            Assert.AreEqual(0.2f, rgb[1]);
            Assert.AreEqual(0.3f, rgb[2]);

            // 2nd change
            testLight.SetRgb(new float[] { 0.9f, 0.8f, 0.7f }, 222);
            rgb = testLight.GetRgb();
            Assert.AreEqual(0.9f, rgb[0]);
            Assert.AreEqual(0.8f, rgb[1]);
            Assert.AreEqual(0.7f, rgb[2]);

            rgb = testLight.GetPreviousRgb();
            Assert.AreEqual(0.1f, rgb[0]);
            Assert.AreEqual(0.2f, rgb[1]);
            Assert.AreEqual(0.3f, rgb[2]);
            Assert.AreEqual(111, testLight.PreviousTime);
        }
    public void State_lightson_Start()
    {
        MonsterEncounter1 me = GetScript <MonsterEncounter1>(GameObject.GetGameObjectByName("Monster1"));

        if (current_light == 0)
        {
            lightson.MaxTimeInState = (float)rand.NextDouble() + 0.4f;
        }

        if (current_light < lights.Count)
        {
            CLight light = lights[current_light];
            light.setEnabled(true);
            CSound sound = light.gameObject.RequireComponent <CSound>();
            sound.PlayIndependentEvent("LightTurnOn.vente", false, 1);
        }
        else
        {
            if (!me.gameObject.RequireComponent <CMeshRenderer>().isEnabled())
            {
                lightson.MaxTimeInState = (float)rand.NextDouble() * 15.0f + 5.0f;
            }
            lightson.NextState = lightsoff;
            return;
        }

        current_light++;
    }
    public void OnStart()
    {
        light = gameObject.RequireComponent <CLight>();
        Random r = new Random();

        timer    += (float)r.NextDouble() * 2.0f;
        activated = true;
    }
Example #7
0
    public void OnStart()
    {
        gameObject.SetFlag(Common.tagForInteractables);
        light = gameObject.GetComponentInChildren <CLight>();

        spookg = GameObject.GetGameObjectByName("zSpook", true);
        startY = spookg.transform.position.y;
        spookg.transform.SetPositionY(-1000);
    }
Example #8
0
    public void OnStart()
    {
        gameObject.SetFlag(Common.tagForInteractables);
        light = gameObject.GetComponentInChildren<CLight>();

        spookg = GameObject.GetGameObjectByName("zSpook", true);
        startY = spookg.transform.position.y;
        spookg.transform.SetPositionY(-1000);
    }
    public void OnStart()
    {
        offPointLightColor = new Color(0.8f, 0.0f, 0.0f, 1.0f);
        onPointLightColor  = new Color(0.0f, 0.8f, 0.0f, 1.0f);

        // Initialize into the common list
        GameObject camInMap;

        Common.AddCameraObjectToList(gameObject, out camInMap, out camInMapArea);
        CameraInMap inMapScript = GetScript <CameraInMap>(camInMapArea);

        inMapScript.SetTwin(gameObject); // Set in map to be able to direct to me (camInWorld)
        if (gameObject == Common.GetRCCarCam())
        {
            inMapScript.isActive = true; // always default RCCar to active
        }

        prevXCurrRot = xCurrRot = 0.0f;
        prevYCurrRot = yCurrRot = 0.0f;

        UpdateVectors();

        if (xRotationLimit == 0.0f && yRotationLimit == 0.0f)
        {
            shouldPhysicalCameraRotate = false;
        }

        for (uint i = 0; i < gameObject.transform.GetNumberOfChildren(); ++i)
        {
            GameObject childObj = gameObject.transform.GetChild(i).gameObject;
            if (childObj.GetName() == Common.nameForCamLight)
            {
                spotlight = childObj.RequireComponent <CLight>();
                spotlight.SetDiffuse(new Color(0.706f, 0.96f, 0.714f, 1.0f)); // FFB4FCB6
                // spotlight.SetRange(10.0f);
                // spotlight.SetSpot(10.0f);
                // spotlight.SetAtt(1.0f);
                // spotlight.SetLightType(CLight.LIGHTTYPE.SPOTLIGHT);
                spotlight.setEnabled(false);
            }
            else if (childObj.GetName() == Common.nameForCamPointLight)
            {
                pointlight = childObj.RequireComponent <CLight>();
                SetPointLight(false);
                pointlight.setEnabled(true);
            }
        }

        mSound       = gameObject.RequireComponent <CSound>();
        mCamRotateID = mSound.GetUniqueEvent("CAM_ROTATE.vente", 1);
    }
    public override void OnStart()
    {
        base.OnStart();
        monsterCroak = "C1_PAIN.vente";
        GameObject face     = GameObject.GetGameObjectByName(scaryObjName);
        GameObject lightObj = GameObject.GetGameObjectByName(scaryLightName);

        light         = lightObj.RequireComponent <CLight>();
        lightScript   = GetScript <LightFlicker>(lightObj);
        distortScript = GetScript <DistortForTime>(gameObject);
        scaryRender   = face.RequireComponent <CSkinMeshRenderer>();
        scaryRender.setEnabled(false);
        _sound = gameObject.RequireComponent <CSound>();
    }
    public override void OnStart()
    {
        base.OnStart();
        monsterCroak = "C1_PAIN.vente";
        GameObject face = GameObject.GetGameObjectByName(scaryObjName);
        GameObject lightObj = GameObject.GetGameObjectByName(scaryLightName);

        light = lightObj.RequireComponent<CLight>();
        lightScript = GetScript<LightFlicker>(lightObj);
        distortScript = GetScript<DistortForTime>(gameObject);
        scaryRender = face.RequireComponent<CSkinMeshRenderer>();
        scaryRender.setEnabled(false);
        _sound = gameObject.RequireComponent<CSound>();
    }
    public override void OnStart()
    {
        light = gameObject.GetComponentInChildren<CLight>();
        light.setEnabled(false);
        lightState = InitialLightState;
        gameObject.GetComponent<CForwardRenderer>().mEmissiveColor = new Color(0.1f,0.1f,0.1f,1.0f);
        sound = gameObject.RequireComponent<CSound>();

        GameObject tr = GameObject.GetGameObjectByName("Monster4TriggerArea");
        if (tr != null) {
            trigger = GetScript<Monster4TriggerArea>(tr);
            trigger.M4LightsToTurnOff++;
            Logger.Log("M4Light to turn on, found for M4: #" + trigger.M4LightsToTurnOff.ToString());
        }

        base.OnStart();
    }
Example #13
0
    public void OnStart()
    {
        smc            = new StateMachineController();
        lightsmc       = new StateMachineController();
        player         = Common.GetStealthPlayer();
        binds          = GameObject.GetGameObjectByName("Monster4Binds");
        attackParticle = GameObject.GetGameObjectByName("Monster4AttackParts").GetComponent <CParticleEmitter>();
        attackParticle.setEnabled(false);
        poofParticle = GameObject.GetGameObjectByName("Monster4Poof").GetComponent <CParticleEmitter>();
        mlight       = gameObject.GetComponentInChildren <CLight>();
        sound        = gameObject.RequireComponent <CSound>();

        screen = Common.GetConsoleScreenScript();

        mesh = GameObject.GetGameObjectByName("M4Mesh").RequireComponent <CMeshRenderer>();

        hunting         = new State(smc, S_hunting_Start, S_hunting_Update, null);
        respawning      = new State(smc, S_respawning_Start, null, S_respawning_End, RESPAWNTIME, hunting);
        attacking       = new State(smc, S_attacking_Start, S_attacking_Update, S_attacking_End);
        attacking_intro = new State(smc, S_attacking_intro_Start, S_attacking_intro_Update, null, 1.0f, attacking);
        incoming        = new State(smc, S_incoming_Start, S_incoming_Update, null, 3.0f, respawning);
        hurting         = new State(smc, S_hurting_Start, S_hurting_Update, null, 1.0f, respawning);
        idle            = new State(smc);
        dying           = new State(smc, S_dying_Start, null, S_dying_End, 2.0f, idle);

        //light smc
        hold       = new State(lightsmc, null, null, null);
        turningoff = new State(lightsmc, null, S_turningoff_Update, null, 0.5f, hold);
        turningon  = new State(lightsmc, null, S_turningon_Update, null, 0.5f, hold);

        //binds smc
        bindssmc      = new StateMachineController();
        bindhold      = new State(bindssmc, null, null, null);
        bindsmoveup   = new State(bindssmc, S_bindsmoveup_Start, S_bindsmoveup_Update, null, 0.5f, bindhold);
        bindsmovedown = new State(bindssmc, null, S_bindsmovedown_Update, S_bindsmovedown_End, 0.5f, bindhold);

        helper = new MonsterHelper();

        smc.SetState(respawning);
        lightsmc.SetState(hold);

        DisplayCorruption();
    }
    public void OnStart()
    {
        smc = new StateMachineController();
        lightsmc = new StateMachineController();
        player = Common.GetStealthPlayer();
        binds = GameObject.GetGameObjectByName("Monster4Binds");
        attackParticle = GameObject.GetGameObjectByName("Monster4AttackParts").GetComponent<CParticleEmitter>();
        attackParticle.setEnabled(false);
        poofParticle = GameObject.GetGameObjectByName("Monster4Poof").GetComponent<CParticleEmitter>();
        mlight = gameObject.GetComponentInChildren<CLight>();
        sound = gameObject.RequireComponent<CSound>();

        screen = Common.GetConsoleScreenScript();

        mesh = GameObject.GetGameObjectByName("M4Mesh").RequireComponent<CMeshRenderer>();

        hunting = new State(smc, S_hunting_Start, S_hunting_Update, null);
        respawning = new State(smc, S_respawning_Start, null, S_respawning_End, RESPAWNTIME, hunting);
        attacking = new State(smc, S_attacking_Start, S_attacking_Update, S_attacking_End);
        attacking_intro = new State(smc, S_attacking_intro_Start, S_attacking_intro_Update, null, 1.0f, attacking);
        incoming = new State(smc, S_incoming_Start, S_incoming_Update, null, 3.0f, respawning);
        hurting = new State(smc, S_hurting_Start, S_hurting_Update, null, 1.0f, respawning);
        idle = new State(smc);
        dying = new State(smc, S_dying_Start, null, S_dying_End, 2.0f, idle);

        //light smc
        hold = new State(lightsmc, null, null, null);
        turningoff = new State(lightsmc, null, S_turningoff_Update, null, 0.5f, hold);
        turningon = new State(lightsmc, null, S_turningon_Update, null, 0.5f, hold);

        //binds smc
        bindssmc = new StateMachineController();
        bindhold = new State(bindssmc, null, null, null);
        bindsmoveup = new State(bindssmc, S_bindsmoveup_Start, S_bindsmoveup_Update, null, 0.5f, bindhold);
        bindsmovedown = new State(bindssmc, null, S_bindsmovedown_Update, S_bindsmovedown_End, 0.5f, bindhold);

        helper = new MonsterHelper();

        smc.SetState(respawning);
        lightsmc.SetState(hold);

        DisplayCorruption();
    }
Example #15
0
    public override void OnStart()
    {
        light = gameObject.GetComponentInChildren <CLight>();
        light.setEnabled(false);
        lightState = InitialLightState;
        gameObject.GetComponent <CForwardRenderer>().mEmissiveColor = new Color(0.1f, 0.1f, 0.1f, 1.0f);
        sound = gameObject.RequireComponent <CSound>();

        GameObject tr = GameObject.GetGameObjectByName("Monster4TriggerArea");

        if (tr != null)
        {
            trigger = GetScript <Monster4TriggerArea>(tr);
            trigger.M4LightsToTurnOff++;
            Logger.Log("M4Light to turn on, found for M4: #" + trigger.M4LightsToTurnOff.ToString());
        }

        base.OnStart();
    }
Example #16
0
    public void State_lightson_Start()
    {
        if (current_light < lights.Count)
        {
            CLight light = lights[current_light];
            light.setEnabled(true);
            CSound sound = light.gameObject.RequireComponent <CSound>();
            sound.PlayIndependentEvent("LightTurnOn.vente", false, 1);
        }
        else
        {
            if (stage == 1)
            {
                foreach (GameObject g in GameObject.GetGameObjectsWithTag("FlickerLight"))
                {
                    GetScriptClass <LightFlicker>(g).activated = true;
                }
            }

            //active monster
            lightson.MaxTimeInState = _lightson[stage];
            if (stage != 0)
            {
                MonsterEncounter1 me = GetScript <MonsterEncounter1>(GameObject.GetGameObjectByName("Level4Monster1"));
                me.Advance();
                if (me.gameObject.transform.position.z < 20)
                {
                    lightsoff.NextState      = finale;
                    lightsoff.MaxTimeInState = 5.0f;
                }
                smc.SetState(lightsoff);
            }
            else
            {
                MonsterEncounter1 me = GetScript <MonsterEncounter1>(GameObject.GetGameObjectByName("Level4Monster1"));
                me.Advance();
                smc.SetState(lightsonwait);
            }
            return;
        }

        current_light++;
    }
Example #17
0
    // Use this for initialization
    public void OnStart()
    {
        mSound     = gameObject.RequireComponent <CSound>();
        ocuConsole = Common.GetConsoleScreenScript();
        door       = GameObject.GetGameObjectByName(Common.prefix + "GeneticsLabDoor2");

        GameObject lightObj = GameObject.GetGameObjectByName(Common.prefix + "GLD_RightLight2");

        rightLight = lightObj.RequireComponent <CLight>();
        lightObj   = GameObject.GetGameObjectByName(Common.prefix + "GLD_LeftLight2");
        leftLight  = lightObj.RequireComponent <CLight>();

        correctIndexOrder.Add(0);
        correctHeights.Add(3); // 3A
        correctIndexOrder.Add(2);
        correctHeights.Add(6); // 6C
        correctIndexOrder.Add(3);
        correctHeights.Add(5); // 5D
        correctIndexOrder.Add(1);
        correctHeights.Add(3); // 3B
    }
Example #18
0
    public void OnStart()
    {
        sound = gameObject.RequireComponent <CSound>();

        redButton     = GameObject.GetGameObjectByName("redButton");
        greenButton   = GameObject.GetGameObjectByName("greenButton");
        blueButton    = GameObject.GetGameObjectByName("blueButton");
        consoleScreen = Common.GetSurveillancePlayerConsoleScreen();
        consoleScript = GetScript <OcuConsoleScreen>(consoleScreen);
        //lights = GameObject.GetGameObjectsWithTag("phase1light");
        GameObject doorObj = GameObject.GetGameObjectByName("Terminal1Door");

        door1Script = GetScript <DoorMain>(doorObj);
        doorObj     = GameObject.GetGameObjectByName("Terminal2Door");
        door2Script = GetScript <DoorMain>(doorObj);

        GameObject checkpoint = GameObject.GetGameObjectByName("Checkpoint1a");

        checkpointScript = GetScript <DeathCheckpointTriggerArea>(checkpoint);
        chilloutFace     = GameObject.GetGameObjectByName("chilloutface 1");
        cFace            = (chilloutFace.RequireComponent <CMeshRenderer>());

        GameObject lightObj = GameObject.GetGameObjectByName("Light1a");

        lightAtDoor = lightObj.RequireComponent <CLight>();
        lightAtDoor.setEnabled(false);

        foreach (GameObject obj in GameObject.GetGameObjectsWithTag("phase1light"))
        {
            lights.Add(obj.RequireComponent <CLight>());
        }
        sequence.Add(1); sequence.Add(3); sequence.Add(2);
        if (lights.Count == 0)
        {
        }

        geneticsAccessLeftLightObj = GameObject.GetGameObjectByName("GLD_LeftLight");
        geneticsAccessLeftLight    = geneticsAccessLeftLightObj.RequireComponent <CLight>();
    }
    public void TurnOffHouse(char house)
    {
        switch (house)
        {
        case 'A':
            ALight.SetActive(false);
            A = false;
            break;

        case 'B':
            BLight.SetActive(false);
            B = false;
            break;

        case 'C':
            CLight.SetActive(false);
            C = false;
            break;

        default:
            break;
        }
    }
    public void OnStart()
    {
        geneticsAccessRightLightObj = GameObject.GetGameObjectByName("GLD_RightLight");
        geneticsAccessRightLight    = geneticsAccessRightLightObj.RequireComponent <CLight>();
        geneticsLabDoor             = GameObject.GetGameObjectByName("GeneticsLabDoor");
        doorScript = GetScript <DoorMain>(geneticsLabDoor);
        GameObject doorTerminal = GameObject.GetGameObjectByName("Terminal2Door");

        doorTerminalScript     = GetScript <DoorMain>(doorTerminal);
        boobyTrapControllerObj = GameObject.GetGameObjectByName("TSR_SeqScrambler");
        boobyTrapScript        = GetScript <BoobyTrapControllerScript>(boobyTrapControllerObj);
        GameObject triggerArea = GameObject.GetGameObjectByName("TrapTrigger");

        trapAreaScript = GetScript <ConsoleSequenceInitiator>(triggerArea);

        //ADD SEQUENCES MANUALLY HERE
        List <int> redRoomTrapSeq = new List <int>();

        redRoomTrapSeq.Add(43); redRoomTrapSeq.Add(82); redRoomTrapSeq.Add(13); redRoomTrapSeq.Add(35);
        sequence.validSequence = redRoomTrapSeq;

        sound = gameObject.RequireComponent <CSound>();
    }
    bool isActivated = false; // has player stepped into the area

    public override void OnStart()
    {
        base.OnStart();

        mSound = gameObject.RequireComponent <CSound>();

        flickeringLights = new List <CLight>();
        GameObject lightObj        = GameObject.GetGameObjectByName("LightFlicker");
        CLight     flickeringLight = lightObj.RequireComponent <CLight>();

        originalIntensity = flickeringLight.GetAtt();
        flickeringLights.Add(flickeringLight);

        for (int index = 2; index <= 6; ++index)
        {
            string lightName = "LightFlicker " + index.ToString();
            lightObj        = GameObject.GetGameObjectByName(lightName);
            flickeringLight = lightObj.RequireComponent <CLight>();
            flickeringLights.Add(flickeringLight);
        }
        foreach (CLight light in flickeringLights)
        {
            light.setEnabled(false); // Turn off all lights at start
        }

        glass       = GameObject.GetGameObjectByName("GlassMonster");
        glassScript = GetScript <TutorialGlassSound>(glass);

        monster        = GameObject.GetGameObjectByName("Monster");
        monsterInitPos = monster.transform.position;
        GameObject doorObj = GameObject.GetGameObjectByName("door6");

        door = GetScript <DoorMain>(doorObj);

        mDirectionToRun       = gameObject.transform.GetForwardVector();
        mDirectionTowardGlass = gameObject.transform.GetRightVector();
    }
    void Update()
    {
        char c = (char)serial.ReadChar();

        Debug.Log(c);
        if (serial.IsOpen)
        {
            if (!A && c == 'A')
            {
                ALight.SetActive(true);
                A = true;
            }
            if (!B && c == 'B')
            {
                BLight.SetActive(true);
                B = true;
            }
            if (!C && c == 'C')
            {
                CLight.SetActive(true);
                C = true;
            }
        }
    }
    public void OnStart()
    {
        _onTime = 1.0f;
        _transitionOffTime = 0.0f;
        _transitionOnTime = 0.1f;
        _minOffHoldTime 	 = 1.05f;
        _maxOffHoldTime 	 = 1.15f;
        _minOnHoldTime 	 = 1.1f;
        _maxOnHoldTime 	 = 1.9f;

        _minoffinten 		 = 0.3f;
        _maxoffinten 		 = 0.3f;
        _minoninten 		 = 0.7f;
        _maxoninten 		 = 1.0f;

        smc = new StateMachineController();
        light = gameObject.RequireComponent<CLight>();
        timer += MMath.GetRandomFloat() * 2.0f;

        lighthold = new State(smc, null, null, null, _minOnHoldTime, null);
        lighton = new State(smc, S_LightOn_Start, S_Light_Update, null, _transitionOnTime, lighthold);
        lightoff = new State(smc, S_LightOff_Start, S_Light_Update, null, _transitionOffTime, lighthold);
        smc.SetState(lightoff);
    }
    // Use this for initialization
    public void OnStart()
    {
        mSound = gameObject.RequireComponent<CSound>();
        ocuConsole = Common.GetConsoleScreenScript();
        door = GameObject.GetGameObjectByName(Common.prefix + "GeneticsLabDoor2");

        GameObject lightObj = GameObject.GetGameObjectByName(Common.prefix + "GLD_RightLight2");
        rightLight = lightObj.RequireComponent<CLight>();
        lightObj = GameObject.GetGameObjectByName(Common.prefix + "GLD_LeftLight2");
        leftLight = lightObj.RequireComponent<CLight>();

        correctIndexOrder.Add(0);
        correctHeights.Add(3); // 3A
        correctIndexOrder.Add(2);
        correctHeights.Add(6); // 6C
        correctIndexOrder.Add(3);
        correctHeights.Add(5); // 5D
        correctIndexOrder.Add(1);
        correctHeights.Add(3); // 3B
    }
    public void OnStart()
    {
        offPointLightColor = new Color(0.8f, 0.0f, 0.0f, 1.0f);
        onPointLightColor = new Color(0.0f, 0.8f, 0.0f, 1.0f);

        // Initialize into the common list
        GameObject camInMap;
        Common.AddCameraObjectToList(gameObject, out camInMap, out camInMapArea);
        CameraInMap inMapScript = GetScript<CameraInMap>(camInMapArea);
        inMapScript.SetTwin(gameObject); // Set in map to be able to direct to me (camInWorld)
        if (gameObject == Common.GetRCCarCam())
        {
            inMapScript.isActive = true; // always default RCCar to active
        }

        prevXCurrRot = xCurrRot = 0.0f;
        prevYCurrRot = yCurrRot = 0.0f;

        UpdateVectors();

        if (xRotationLimit == 0.0f && yRotationLimit == 0.0f)
        {
            shouldPhysicalCameraRotate = false;
        }

        for (uint i = 0; i < gameObject.transform.GetNumberOfChildren(); ++i)
        {
            GameObject childObj = gameObject.transform.GetChild(i).gameObject;
            if (childObj.GetName() == Common.nameForCamLight)
            {
                spotlight = childObj.RequireComponent<CLight>();
                spotlight.SetDiffuse(new Color(0.706f, 0.96f, 0.714f, 1.0f)); // FFB4FCB6
                // spotlight.SetRange(10.0f);
                // spotlight.SetSpot(10.0f);
                // spotlight.SetAtt(1.0f);
                // spotlight.SetLightType(CLight.LIGHTTYPE.SPOTLIGHT);
                spotlight.setEnabled(false);
            }
            else if (childObj.GetName() == Common.nameForCamPointLight)
            {
                pointlight = childObj.RequireComponent<CLight>();
                SetPointLight(false);
                pointlight.setEnabled(true);
            }
        }

        mSound = gameObject.RequireComponent<CSound>();
        mCamRotateID = mSound.GetUniqueEvent("CAM_ROTATE.vente", 1);
    }
    public void OnStart()
    {
        geneticsAccessRightLightObj = GameObject.GetGameObjectByName("GLD_RightLight");
        geneticsAccessRightLight = geneticsAccessRightLightObj.RequireComponent<CLight>();
        geneticsLabDoor = GameObject.GetGameObjectByName("GeneticsLabDoor");
        doorScript = GetScript<DoorMain>(geneticsLabDoor);
        GameObject doorTerminal = GameObject.GetGameObjectByName("Terminal2Door");
        doorTerminalScript = GetScript<DoorMain>(doorTerminal);
        boobyTrapControllerObj = GameObject.GetGameObjectByName("TSR_SeqScrambler");
        boobyTrapScript = GetScript<BoobyTrapControllerScript>(boobyTrapControllerObj);
        GameObject triggerArea = GameObject.GetGameObjectByName("TrapTrigger");
        trapAreaScript = GetScript<ConsoleSequenceInitiator>(triggerArea);

        //ADD SEQUENCES MANUALLY HERE
        List<int> redRoomTrapSeq = new List<int>();
        redRoomTrapSeq.Add(43); redRoomTrapSeq.Add(82); redRoomTrapSeq.Add(13); redRoomTrapSeq.Add(35);
        sequence.validSequence = redRoomTrapSeq;

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

        redButton = GameObject.GetGameObjectByName("redButton");
        greenButton = GameObject.GetGameObjectByName("greenButton");
        blueButton = GameObject.GetGameObjectByName("blueButton");
        consoleScreen = Common.GetSurveillancePlayerConsoleScreen();
        consoleScript = GetScript<OcuConsoleScreen>(consoleScreen);
        //lights = GameObject.GetGameObjectsWithTag("phase1light");
        GameObject doorObj = GameObject.GetGameObjectByName("Terminal1Door");
        door1Script = GetScript<DoorMain>(doorObj);
        doorObj = GameObject.GetGameObjectByName("Terminal2Door");
        door2Script = GetScript<DoorMain>(doorObj);

        GameObject checkpoint = GameObject.GetGameObjectByName("Checkpoint1a");
        checkpointScript = GetScript<DeathCheckpointTriggerArea>(checkpoint);
        chilloutFace = GameObject.GetGameObjectByName("chilloutface 1");
        cFace = (chilloutFace.RequireComponent<CMeshRenderer>());

        GameObject lightObj = GameObject.GetGameObjectByName("Light1a");
        lightAtDoor = lightObj.RequireComponent<CLight>();
        lightAtDoor.setEnabled(false);

        foreach (GameObject obj in GameObject.GetGameObjectsWithTag("phase1light"))
        {
            lights.Add(obj.RequireComponent<CLight>());
        }
        sequence.Add(1); sequence.Add(3); sequence.Add(2);
        if(lights.Count == 0)
        {
        }

        geneticsAccessLeftLightObj = GameObject.GetGameObjectByName("GLD_LeftLight");
        geneticsAccessLeftLight = geneticsAccessLeftLightObj.RequireComponent<CLight>();
    }
Example #28
0
 public void OnStart()
 {
     compLight = gameObject.RequireComponent <CLight>();
     compLight.SetAtt(startAtt);
     currAtt = startAtt;
 }
 public void OnStart()
 {
     compLight = gameObject.RequireComponent<CLight>();
     compLight.SetAtt(startAtt);
     currAtt = startAtt;
 }