コード例 #1
0
    // Use this for initialization
    public override void OnStart()
    {
        base.OnStart();

        mSound           = gameObject.RequireComponent <CSound>();
        controllerScript = GetScript <MiniGameFourPlayersButtonController>(
            GameObject.GetGameObjectByName(Common.prefix + "TSR2_DoorUnlockPanelStealthA"));
        mMyIndex = controllerScript.GetButtonIndex(gameObject);

        panelParent = gameObject.transform.GetParent().GetParent().gameObject;

        RandomCenter(); // Initialize the column puzzle
    }
コード例 #2
0
    // Use this for initialization
    public override void OnStart()
    {
        base.OnStart();

        mSound = gameObject.RequireComponent<CSound>();
        controllerScript = GetScript<MiniGameFourPlayersButtonController>(
            GameObject.GetGameObjectByName(Common.prefix + "TSR2_DoorUnlockPanelStealthA"));
        mMyIndex = controllerScript.GetButtonIndex(gameObject);

        panelParent = gameObject.transform.GetParent().GetParent().gameObject;

        RandomCenter(); // Initialize the column puzzle
    }
コード例 #3
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;
        }
    }