Beispiel #1
0
 void Update()
 {
     if (IsDialogActive && Input.GetButtonDown(OSInputManager.GetPadMapping("Submit")))
     {
         ShowNextMessage();
     }
 }
Beispiel #2
0
    void Update()
    {
        if (/*Game.puzzleBooksFinished && */ !Game.puzzlePasswordFinished && Input.GetButtonDown(OSInputManager.GetPadMapping("Submit")))
        {
            if (CheckPassword())
            {
                #if UNITY_EDITOR
                Debug.Log("Password puzzle done");
                #endif
                sequencer.StartCoroutine("StartSequence", sequencename);

                //Indicar que ya se ha obtenido ese numero
                Game.puzzlePasswordFinished = true;
                gameObject.SetActive(false);
            }
            else
            {
                GameManager.instance.attacked = true;
            }
        }
        if (Input.GetButtonDown(OSInputManager.GetPadMapping("Cancel")))
        {
            hiddenPannelTrigger.StartCoroutine("ReleaseMessages");
            gameObject.SetActive(false);
        }
    }
Beispiel #3
0
    void Update()
    {
        if (!Game.puzzleClockFinished && Input.GetButtonDown(OSInputManager.GetPadMapping("Submit")))
        {
            if (CheckTime())
            {
                //Iniciar secuencia de obtención del numero
                //Mensaje de que se ha abierto por detrás y hay algo dentro
                Debug.Log("Clock puzzle done");


                Game.puzzlesSolved++;
                gameController.CheckPuzzlesSolved();
                //Entregar item del número correspondiente
                sequencer.StartCoroutine("StartSequence", sequencename);

                //Indicar que ya se ha obtenido ese numero
                Game.puzzleClockFinished = true;
                gameObject.SetActive(false);
            }
            else
            {
                sequencer.StartCoroutine("StartSequence", "failClockPuzzle");
            }
        }
        if (Input.GetButtonDown(OSInputManager.GetPadMapping("Cancel")))
        {
            clockTrigger.StartCoroutine("ReleaseMessages");
            gameObject.SetActive(false);
        }
    }
Beispiel #4
0
 void Update()
 {
     if (playerInside && (Input.GetButtonDown(OSInputManager.GetPadMapping("Submit"))) && playerAnimator.GetFloat("y") == 1 && !guiController.IsMenuActive)
     {
         StartCoroutine("InitPuzzle");
     }
 }
Beispiel #5
0
 void Update()
 {
     if (Input.GetButtonDown(OSInputManager.GetPadMapping("Cancel")))
     {
         StartCoroutine(Cancel());
     }
 }
Beispiel #6
0
 void Update()
 {
     if (playerInside && Input.GetButtonDown(OSInputManager.GetPadMapping("Submit")) && animator.GetFloat("y") == 1f && !msgController.IsDialogActive && !guiController.IsMenuActive)
     {
         StartCoroutine("ManageButtonDown");
     }
 }
Beispiel #7
0
 protected void OnTriggerStay2D(Collider2D other)
 {
     if (other.CompareTag("Player") && Input.GetButton(OSInputManager.GetPadMapping("Submit")) && playerAnimator.GetFloat(axis) == value && !collectible.obtained)
     {
         collectible.ObtainItem();
     }
 }
Beispiel #8
0
 void Update()
 {
     if (playerInside && Input.GetButtonDown(OSInputManager.GetPadMapping("Submit")) && animator.GetFloat("x") == -1f && !msgController.IsDialogActive)
     {
         InteractShowingMessage("Book.Order");
     }
 }
Beispiel #9
0
 void Update()
 {
     if (playerInside && Input.GetButtonDown(OSInputManager.GetPadMapping("Submit")) && !msgController.IsDialogActive &&
         ((player.transform.position.x < transform.position.x && animator.GetFloat("x") == 1) ||
          (player.transform.position.x > transform.position.x && animator.GetFloat("x") == -1)))
     {
         InteractShowingMessage("Curiosities.Robbie");
     }
 }
Beispiel #10
0
 void Update()
 {
     if (Input.GetButtonDown(OSInputManager.GetPadMapping("Cancel")))
     {
         commandsPanel.SetActive(true);
         battlecontroller.ActivateCommandsMenu(battlecontroller.tempAttackButton);
         gameObject.SetActive(false);
     }
 }
Beispiel #11
0
    void Update()
    {
        if (Game.finalBossDefeated && (cancelButtonImage.activeSelf || submitButtonImage.activeSelf))
        {
            submitButtonImage.SetActive(false);
            cancelButtonImage.SetActive(false);
        }

        if (playerInside)
        {
            if (!playerController.isOnChest)
            {
                if (Input.GetButtonDown(OSInputManager.GetPadMapping("Cancel")) && playerController.isPushing && !guiController.IsMenuActive)
                {
                    CancelPush();
                }

                if (animator.GetFloat(axis) == value)
                {
                    if (!playerController.isPushing)
                    {
                        UpdateButtons();
                    }

                    if (Input.GetButtonDown(OSInputManager.GetPadMapping("Submit")) && !playerController.isPushing && !sequencer.isOnSequence && !chest.isDialogEnabled && !guiController.IsMenuActive)
                    {
                        CheckToPush();
                    }
                }
                if (animator.GetFloat(axis) != value || guiController.IsMenuActive || sequencer.isOnSequence)
                {
                    submitButtonImage.SetActive(false);
                    cancelButtonImage.SetActive(false);
                }
            }
            else if (playerController.isOnChest)
            {
                if (disableWhenOnChest && gameObject.activeSelf && !playerController.isJumping)
                {
                    gameObject.SetActive(false);
                }

                if (animator.GetFloat(axis) == valueOnChest)
                {
                    ManageOnChest();
                }
                else
                {
                    submitButtonImage.SetActive(false);
                    cancelButtonImage.SetActive(false);
                }
            }
        }
    }
Beispiel #12
0
 void Update()
 {
     if (playerInside && Input.GetButtonDown(OSInputManager.GetPadMapping("Submit")) && !sequencer.isOnSequence && !msgController.IsDialogActive && playerController.GetAnimatorAxisValue("y") == 1)
     {
         if (!doorLocked)
         {
             doorLocked = true;
             StartCoroutine("DoorLocked");
         }
         else
         {
             doorLocked = false;
         }
     }
 }
Beispiel #13
0
    void ManageOnChest()
    {
        if (!submitButtonImage.activeSelf)
        {
            submitButtonImage.SetActive(true);
        }
        submitButtonText.text = m_LanguageManagerInstance.GetTextValue(m_JumpText);
        if (Input.GetButtonDown(OSInputManager.GetPadMapping("Submit")) && !playerController.isPushing && !sequencer.isOnSequence && !questionPanel.activeSelf)
        {
            playerController.StartCoroutine(playerController.Jump(returnToFloorTransform.position, false));
            EnableSiblings();

            CheckForUpdateOffset(defaultYPosition);
        }
    }
Beispiel #14
0
    void Update()
    {
        if (Input.GetButtonDown(OSInputManager.GetPadMapping("Cancel")))
        {
            if (selectedItem != null)
            {
                selectedItem = null;
                StartCoroutine("SelectButton", firstSelectedButton);
            }
            else
            {
                selectedCharacter            = null;
                guiController.characterIndex = 0;
                ShowManageMenu(equipPanel);
            }
        }

        if (Input.GetButtonDown(OSInputManager.GetPadMapping("LButton")))
        {
            List <PlayableCharacter> tempList = CharacterParty.charactersParty;
            if (tempList != null && tempList.Count > 0)
            {
                characterIndex--;
                if (characterIndex < 0)
                {
                    characterIndex = tempList.Count - 1;
                }

                LoadSelectedCharacterData();
            }
        }

        if (Input.GetButtonDown(OSInputManager.GetPadMapping("RButton")))
        {
            List <PlayableCharacter> tempList = CharacterParty.charactersParty;
            if (tempList != null && tempList.Count > 0)
            {
                characterIndex++;
                if (characterIndex > tempList.Count - 1)
                {
                    characterIndex = 0;
                }

                LoadSelectedCharacterData();
            }
        }
    }
Beispiel #15
0
    public override bool ShouldActivateModule()
    {
        if (!base.ShouldActivateModule())
        {
            return(false);
        }

        bool shouldActivate = false;

        shouldActivate |= Input.GetButtonDown(OSInputManager.GetPadMapping(m_SubmitButton));
        shouldActivate |= Input.GetButtonDown(OSInputManager.GetPadMapping(m_CancelButton));
        shouldActivate |= !Mathf.Approximately(Input.GetAxisRaw(m_HorizontalAxis), 0.0f);
        shouldActivate |= !Mathf.Approximately(Input.GetAxisRaw(m_VerticalAxis), 0.0f);
        shouldActivate |= !Mathf.Approximately(Input.GetAxisRaw(OSInputManager.GetPadMapping(m_DPadHorizontal)), 0.0f);
        shouldActivate |= !Mathf.Approximately(Input.GetAxisRaw(OSInputManager.GetPadMapping(m_DPadVertical)), 0.0f);
        return(shouldActivate);
    }
Beispiel #16
0
    /// <summary>
    /// Process submit keys.
    /// </summary>
    private bool SendSubmitEventToSelectedObject()
    {
        if (eventSystem.currentSelectedGameObject == null)
        {
            return(false);
        }

        var data = GetBaseEventData();

        if (Input.GetButtonDown(OSInputManager.GetPadMapping(m_SubmitButton)))
        {
            ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, data, ExecuteEvents.submitHandler);
        }

        if (Input.GetButtonDown(OSInputManager.GetPadMapping(m_CancelButton)))
        {
            ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, data, ExecuteEvents.cancelHandler);
        }
        return(data.used);
    }
Beispiel #17
0
 void Update()
 {
     if (Input.GetButtonDown(OSInputManager.GetPadMapping("Cancel")))
     {
         if (charactersListPanel != null && charactersListPanel.activeSelf)
         {
             charactersListPanel.SetActive(false);
             SelectFirstItem();
         }
         else if (itemViewerPanel != null && itemViewerPanel.activeSelf)
         {
             itemViewerPanel.SetActive(false);
             SelectFirstItem();
         }
         else
         {
             mainPanel.SetActive(false);
             ShowManageMenu(inventoryPanel);
         }
     }
 }
Beispiel #18
0
 void Update()
 {
     if ((Input.GetButtonDown(OSInputManager.GetPadMapping("Menu")) || (Input.GetButtonDown(OSInputManager.GetPadMapping("Cancel"))) && IsMenuActive) && !sequencer.isOnSequence &&
         !clockDialog.activeSelf && !booksDialog.activeSelf && !questionDialog.activeSelf && !passwordDialog.activeSelf && !msgController.IsDialogActive)
     {
         if (!IsMenuActive)
         {
             ShowGameObject(managementMenuPanel);
             playerController.StopPlayerMove();
             IsMenuActive = true;
             EventSystem.current.SetSelectedGameObject(selectedItem);
         }
         else
         {
             if (managementMenuPanel.activeSelf)
             {
                 CloseMenu();
             }
         }
     }
 }
    void Update()
    {
        if (isSelected)
        {
            float inputY = 0;
            if (!usingDpad)
            {
                inputY = Input.GetAxisRaw("Vertical");
            }

            if (inputY == 0f)
            {
                inputY = Input.GetAxis(OSInputManager.GetPadMapping("DPadVertical"));
                if (!usingDpad)
                {
                    usingDpad = true;
                }
                if (inputY == 0)
                {
                    usingDpad = false;
                }
            }
            // Debug.Log(inputY);
            if ((int)inputY == 1)
            {
                //       value += 1 * Time.deltaTime;
                textField.text = CalculateValue(1).ToString();
            }

            else if ((int)inputY == -1)
            {
                //     value -= 1 * Time.deltaTime;
                textField.text = CalculateValue(-1).ToString();
            }
            else if ((int)inputY == 0)
            {
                axisUp = true;
            }
        }
    }
Beispiel #20
0
    void Update()
    {
        if (playerInside)
        {
            if (Input.GetButtonDown(OSInputManager.GetPadMapping("Submit")) && animator.GetFloat("y") == 1f && !msgController.IsDialogActive)
            {
                //Caso 1: Niño aparece y no ha ocurrido el evento de "mirar el reloj tontamente"
                if (Game.boyAppeared && !Game.conversationAboutClockDone)
                {
                    Game.conversationAboutClockDone = true;
                    CharacterStats boyStats = CharacterParty.charactersParty.Find(p => p.charStats.name.Equals(boyName)).charStats;

                    List <MessageDialog> msgList  = new List <MessageDialog> ();
                    MessageDialog        boyMsg1  = new MessageDialog(boyStats.avatar, boyStats.name, "ClockConversation.Part1");
                    MessageDialog        girlMsg1 = new MessageDialog(girlStats.avatar, girlStats.name, "ClockConversation.Part2");
                    MessageDialog        boyMsg2  = new MessageDialog(boyStats.avatar, boyStats.name, "ClockConversation.Part3");

                    msgList.Add(boyMsg1);
                    msgList.Add(girlMsg1);
                    msgList.Add(boyMsg2);


                    if (!Game.puzzleClockFinished)
                    {
                        MessageDialog girlMsg2 = new MessageDialog(girlStats.avatar, girlStats.name, "ClockConversation.Part4");
                        msgList.Add(girlMsg2);
                    }

                    msgController.SetMessagesArray(msgList);
                    msgController.ShowMessage();
                }//Caso 2: Puzle del reloj
                else if (!Game.puzzleClockFinished && !clockPuzzlePanel.activeSelf && !sequencer.isOnSequence && !waitingUntilNewMessage && !msgController.IsDialogActive && msgController.releaseConversation)
                {
                    waitingUntilNewMessage = true;
                    sequencer.StartCoroutine("StartSequence", sequenceName);
                }
            }
        }
    }
Beispiel #21
0
    //Select if H-DPad or H-Axis is being used (only one of them allowed)
    private float SelectHorizontalAxis()
    {
        float horizontalAxis = Input.GetAxisRaw(m_HorizontalAxis);
        float horizontalDPad = Input.GetAxisRaw(OSInputManager.GetPadMapping(m_DPadHorizontal));

        if (horizontalAxis != 0 && currentAxis != "DPad")
        {
            currentAxis = "Axis";
            return(horizontalAxis);
        }
        if (horizontalDPad != 0 && currentAxis != "Axis")
        {
            currentAxis = "DPad";
            return(horizontalDPad);
        }

        if (Mathf.Abs(horizontalAxis) < m_AxisDeadZone && horizontalDPad == 0)
        {
            currentAxis = "";
        }
        return(0);
    }
Beispiel #22
0
    //Select if V-DPad or V-Axis is being used (only one of them allowed)
    private float SelectVerticalAxis()
    {
        float verticalAxis = Input.GetAxisRaw(m_VerticalAxis);
        float verticalDPad = Input.GetAxisRaw(OSInputManager.GetPadMapping(m_DPadVertical));

        if (verticalAxis != 0 && currentAxis != "DPad")
        {
            currentAxis = "Axis";
            return(verticalAxis);
        }
        if (verticalDPad != 0 && currentAxis != "Axis")
        {
            currentAxis = "DPad";
            return(verticalDPad);
        }

        if (Mathf.Abs(verticalAxis) < m_AxisDeadZone && verticalDPad == 0)
        {
            currentAxis = "";
        }
        return(0);
    }
Beispiel #23
0
    private void MovePlayer()
    {
        if (animator.isInitialized)
        {
            float input_x = Input.GetAxisRaw("Horizontal");
            float input_y = Input.GetAxisRaw("Vertical");

            if (input_x == 0 && input_y == 0)
            {
                input_x = Input.GetAxis(OSInputManager.GetPadMapping("DPadHorizontal"));
                input_y = Input.GetAxis(OSInputManager.GetPadMapping("DPadVertical"));
            }

            if (input_x > 0)
            {
                input_x = 1;
            }
            else if (input_x < 0)
            {
                input_x = -1;
            }

            if (input_y > 0)
            {
                input_y = 1;
            }
            else if (input_y < 0)
            {
                input_y = -1;
            }

            ChechIfPlayerIsWalking(input_x, input_y);
            if (!isOnChest)
            {
                rb.velocity = new Vector2(input_x, input_y).normalized *speed *Time.fixedDeltaTime;
            }
        }
    }
Beispiel #24
0
 void Update()
 {
     if (!Game.puzzleBooksFinished && Input.GetButtonDown(OSInputManager.GetPadMapping("Submit")))
     {
         if (CheckSortOrder())
         {
             #if UNITY_EDITOR
             Debug.Log("Books puzzle done");
             #endif
             sequencer.StartCoroutine("StartSequence", sequencename);
             Game.puzzleBooksFinished = true;
             gameObject.SetActive(false);
         }
         else
         {
             sequencer.StartCoroutine("StartSequence", "failLibraryPuzzle");
         }
     }
     if (Input.GetButtonDown(OSInputManager.GetPadMapping("Cancel")))
     {
         libraryTrigger.StartCoroutine("ReleaseMessages");
         gameObject.SetActive(false);
     }
 }