public override void OnStart()
    {
        base.OnStart();
        GameObject room = GameObject.GetGameObjectByName("TrapSequenceRoom2");

        envScript = GetScript <PuzzleBEnvironmentController>(room);
    }
Exemplo n.º 2
0
    public void OnStart()
    {
        CMeshRenderer mesh = gameObject.RequireComponent <CMeshRenderer>();

        mesh.setEnabled(false);

        GameObject room = GameObject.GetGameObjectByName(_name);
        PuzzleBEnvironmentController envScript = GetScript <PuzzleBEnvironmentController>(room);

        envScript.AddSpawnZone(_region, this);

        _transform = gameObject.RequireComponent <CTransform>();

        Vector3 pos   = _transform.GetPosition(CTransform.TransformSpace.GLOBAL);
        Vector3 scale = _transform.scale;

        position = _transform.GetPosition(CTransform.TransformSpace.GLOBAL);

        minZ = pos.Z - scale.Z * 0.5f;
        maxZ = pos.Z + scale.Z * 0.5f;

        minX = pos.X - scale.X * 0.5f;
        maxX = pos.X + scale.X * 0.5f;

        y = pos.Y;
    }
Exemplo n.º 3
0
    void PassAll()
    {
        for (int i = 0; i < allButtons.Count; ++i)
        {
            allButtons[i].Pass();
        }

        DoorMain doorMainScript = GetScript <DoorMain>(door);

        doorMainScript.UnlockDoor();

        leftLight.SetDiffuse(SharpMocha.GREEN);
        rightLight.SetDiffuse(SharpMocha.GREEN);

        mSound.PlayIndependentEvent("PINPAD_CONFIRM.vente", false, 1);

        ocuConsole.MiniGameFourPlayerEvent("", "", 0, gameObject, 0, true);
        ocuConsole.QueueMessage("Subject [REDACTED] : Deduction test completed", 0.0f, false, true);

        GameObject pz3room = GameObject.GetGameObjectByName("TrapSequenceRoom2");
        PuzzleBEnvironmentController pz3ScaryScript = GetScript <PuzzleBEnvironmentController>(pz3room);

        pz3ScaryScript.finished = true;
    }
Exemplo n.º 4
0
    public void MiniGameFourPlayerEvent(string gameString, string seqText, int buttonIndex,
                                        GameObject buttonObj, int currHeight, bool isUnlocked)
    {
        if (isUnlocked)
        {
            // If the door is unlocked, then game has ended.
            QueueMessage("Access Granted. Door Opening...", 0.0f, false, true);

            ResetToDefaultState();
        }
        else
        {
            if (currEvent != CONSOLE_EVENT.MINIGAME_FOUR_PLAYERS) // First time trigger into minigame
            {
                GameObject pz3room = GameObject.GetGameObjectByName("TrapSequenceRoom2");
                PuzzleBEnvironmentController pz3ScaryScript = GetScript <PuzzleBEnvironmentController>(pz3room);
                pz3ScaryScript.activated = true;
                savedObject = buttonObj; // Save the last pressed button, so surveillance player can input into that button

                ChangeHeader("DOOR SYSTEM:");
                QueueMessage("Door Access Requested. \\nUnlock Sequence Initiating...", 0.0f, false, true);
                QueueMessage("<#1,1,0,1#>Yellow " + Common.ConvertColorToStringTag(mColorOfText) +
                             "external input required.", 0.6f, true, false);
                currEvent = CONSOLE_EVENT.MINIGAME_FOUR_PLAYERS;

                GameObject sequenceText = ObjectFactory.getInstance().Instantiate(Common.nameForFixedWidthText);
                Vector3    sequencePos  = mCenterPosForText;
                sequencePos.X += 2.4f;
                sequencePos.Y += 1.5f;
                sequenceText.transform.SetPosition(sequencePos);
                CFontRenderer sequenceTextFont = sequenceText.GetComponent <CFontRenderer>();
                sequenceTextFont.mText           = "Code Sequence: \\n3A - 6C - 5D - 3B";
                sequenceTextFont.mFontScale      = 0.0032f;
                sequenceTextFont.mJustification  = CFontRenderer.FONT_JUSTIFICATION.CENTER_JUSTIFIED;
                sequenceTextFont.mNewlineSpacing = 1.1f;

                GameObject currButtonText = ObjectFactory.getInstance().Instantiate(Common.nameForFixedWidthText);
                Vector3    currButtonPos  = sequencePos;
                currButtonPos.X += 0.4f;
                currButtonPos.Y -= 0.7f;
                currButtonText.transform.SetPosition(currButtonPos);
                CFontRenderer currButtonTextFont = currButtonText.GetComponent <CFontRenderer>();
                //currButtonTextFont.mText = "Sequence A: ";
                currButtonTextFont.mJustification  = CFontRenderer.FONT_JUSTIFICATION.RIGHT_JUSTIFIED;
                currButtonTextFont.mNewlineSpacing = 1.1f;

                // Create game screen column itself
                GameObject headerText = ObjectFactory.getInstance().Instantiate(Common.nameForFixedWidthText);
                Vector3    headerPos  = currButtonPos;
                headerPos.X += 0.05f;
                headerText.transform.SetPosition(headerPos);
                CFontRenderer headerTextFont = headerText.GetComponent <CFontRenderer>();
                headerTextFont.mFontScale      = 0.003f;
                headerTextFont.mJustification  = CFontRenderer.FONT_JUSTIFICATION.LEFT_JUSTIFIED;
                headerTextFont.mNewlineSpacing = 1.5f;

                // Create "Input ..." feedback at the btm
                GameObject btmText = ObjectFactory.getInstance().Instantiate(Common.nameForFixedWidthText);
                Vector3    btmPos  = sequencePos;
                btmPos.Y = headerPos.Y - 2.0f;
                btmText.transform.SetPosition(btmPos);
                CFontRenderer btmTextFont = btmText.GetComponent <CFontRenderer>();
                btmTextFont.mText          = "Touch to enter your input";
                btmTextFont.mJustification = CFontRenderer.FONT_JUSTIFICATION.CENTER_JUSTIFIED;
                btmTextFont.mFontScale     = 0.002f;

                // Create divider
                GameObject dottedLine = CreateDividerText();

                mExtraTexts.Add(headerText);
                mExtraTexts.Add(btmText);
                mExtraTexts.Add(dottedLine);
                mExtraTexts.Add(sequenceText);
                mExtraTexts.Add(currButtonText);
            }

            // Update minigame based on what is keyed in
            CFontRenderer textFont = mExtraTexts[0].GetComponent <CFontRenderer>();
            textFont.mText = gameString;                              // Update the main game column

            textFont = mExtraTexts[4].GetComponent <CFontRenderer>(); // the current button text
            CFontRenderer headerSeqFont = mExtraTexts[3].GetComponent <CFontRenderer>();
            if (buttonIndex == -1)
            {
                textFont.mText = seqText;

                string headerSeqText = "Code Sequence: \\n3A - 6C - 5D - 3B";
                headerSeqFont.mText = headerSeqText; // Reset code sequence coloring when got it wrong
            }
            else
            {
                string headerSeqText = "";
                bool   toChangeText  = false;
                switch (buttonIndex)
                {
                case 0:     // A is done
                    if (currHeight == 3)
                    {
                        toChangeText  = true;
                        headerSeqText = "Code Sequence: \\n<#0,1,0,1#>3A<#1,1,1,1#> - 6C - 5D - 3B";
                    }
                    break;

                case 2:     // C is done
                    if (currHeight == 6)
                    {
                        toChangeText  = true;
                        headerSeqText = "Code Sequence: \\n<#0,1,0,1#>3A - 6C<#1,1,1,1#> - 5D - 3B";
                    }
                    break;

                case 3:     // D is done
                    if (currHeight == 5)
                    {
                        toChangeText  = true;
                        headerSeqText = "Code Sequence: \\n<#0,1,0,1#>3A - 6C - 5D<#1,1,1,1#> - 3B";
                    }
                    break;

                case 1:     // B is done
                    if (currHeight == 3)
                    {
                        toChangeText  = true;
                        headerSeqText = "Code Sequence: \\n<#0,1,0,1#>3A - 6C - 5D - 3B";
                    }
                    break;
                }
                if (toChangeText)
                {
                    headerSeqFont.mText = headerSeqText;
                }

                textFont.mText = "Sequence " + seqText + ": ";
            }

            eventState2 = currHeight;
            eventState  = buttonIndex;
        }
    }
 public override void OnStart()
 {
     base.OnStart();
     GameObject room = GameObject.GetGameObjectByName("TrapSequenceRoom2");
     envScript = GetScript<PuzzleBEnvironmentController>(room);
 }