public override void OnStealthPlayerMouseInteract()
    {
        // Check if button is facing player
        Vector3 buttonForward = panelParent.transform.GetForwardVector();

        if (Vector3.Dot(buttonForward, Common.GetStealthPlayerCamera().transform.GetForwardVector()) >= 0.0f)
        {
            // Tell controller that I am clicked on
            controllerScript.TriggeredButton(mMyIndex, true); // CenterPull(1);
        }
    }
Beispiel #2
0
    public override void OnTriggered()
    {
        switch (currEvent)
        {
        case CONSOLE_EVENT.DOOR_REQUEST:
            if (savedObject != null)
            {
                if (hasConsoleTextChanged == 0)     // if all the text has displayed, then allow touch to open door
                {
                    // Open the door, then
                    DoorButton buttonScript = GetScript <DoorButton>(savedObject);
                    if (buttonScript != null)
                    {
                        buttonScript.AllowUnlockDoor();
                    }

                    EndOfDoorButtonEvent();
                }
                else     // If still typing out, first click immediately shows all the text
                {
                    UpdateAllTextImmediately();
                }
            }
            break;

        case CONSOLE_EVENT.DOOR_MINIGAME_TURN:
            if (savedObject != null)
            {
                // Open the door, then
                DoorUnlockSequence doorUnlockSeq = GetScript <DoorUnlockSequence>(savedObject);
                if (doorUnlockSeq != null)
                {
                    doorUnlockSeq.CenterPull(0);
                }
            }
            break;

        case CONSOLE_EVENT.MINIGAME_FOUR_PLAYERS:
            if (savedObject != null && eventState != -1 && eventState2 != -1)     // If one of the buttons is active
            {
                MiniGameFourPlayersButtonController minigameScript = GetScript <MiniGameFourPlayersButtonController>(savedObject);
                if (minigameScript != null)
                {
                    minigameScript.TriggeredButton(eventState, false);     // Click on screen to perform action on game
                }
            }
            break;
        }
    }