void CheckToPush() { //Para empujar el cofre debe de estar vacío y el player debe de estar andando hacia el cofre if (playerController.isWalking) { if (!Game.chestEmpty) { //Hay que vaciar el cofre primero playerController.StopPlayerMove(); chest.buttonsDisabled = true; sequencer.StartCoroutine("StartSequence", sequenceName); } else if (!playerController.isJumping && !playerController.isOnChest) { rabbitCollider.enabled = true; joint.enabled = true; rigidBody.bodyType = RigidbodyType2D.Dynamic; submitButtonImage.SetActive(false); cancelButtonImage.SetActive(true); playerController.isPushing = true; animator.SetBool("isPushing", true); } } else if (!playerController.isOnChest && !playerController.isPushing && !chest.isAtBottom) { playerController.StartCoroutine(playerController.Jump(jumpPosition.position, true)); CheckForUpdateOffset(onUpPosition); } }
public IEnumerator InitPuzzle() { yield return(null); if (!Game.puzzlePasswordFinished && !puzzlePanel.activeSelf && !sequencer.isOnSequence && !waitingUntilNewMessage && !msgController.IsDialogActive) { playerController.StopPlayerMove(); waitingUntilNewMessage = true; sequencer.StartCoroutine("StartSequence", sequenceName); } }
//void Update () { // if (Input.GetKeyDown(KeyCode.B)) // LoadBattleScene(); // } public void LoadBattleScene() { playerController.canMove = false; playerController.StopPlayerMove(); Game.chestPosition = chestTransform.position; foreach (PlayableCharacter character in CharacterParty.charactersParty) { GameObjectData data = new GameObjectData(); character.orderInLayer = character.gameObject.GetComponent <SpriteRenderer>().sortingOrder; Transform objTransform = null; data.objName = character.CharGameObject.name; objTransform = character.CharGameObject.transform; data.position = objTransform.position; data.rotation = objTransform.rotation; data.localScale = objTransform.localScale; Game.AddObjectStatus(data); } lightningAnimator.enabled = true; Game.timePlayed += Time.timeSinceLevelLoad; }
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(); } } } }