void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player") && currentBubble == null && !blockAnimPlaying) { blockAnimPlaying = true; player.SetCutsceneMode(true); StartCoroutine(WaitForBlockAnimation()); } }
IEnumerator DelayPlayerControl() { player.SetCutsceneMode(true); player.disableAngledControls = true; Rigidbody playerRigidbody = playerObject.GetComponent <Rigidbody>(); input.direction = Vector2.ClampMagnitude(new Vector2(playerRigidbody.velocity.x, playerRigidbody.velocity.z), 1); yield return(new WaitForSeconds(playerControlDelay)); player.disableAngledControls = false; player.SetCutsceneMode(false); }
public void OpenMenu() { foreach (MenuPage p in pages) { p.gameObject.SetActive(false); } pages[0].gameObject.SetActive(true); gameObject.SetActive(true); tabCursor.GetComponent <Cursor>().SetActivityStatus(true); player.SetCutsceneMode(true); player.art.animator.SetFloat("normalizedSpeed", 0); player.art.animator.SetFloat("side", 0); }
void LateUpdate() { if ((player.gameManager.inputManager.isInputDown[4] || player.gameManager.inputManager.isInputDown[5]) && closeDelayExpired && !isClosing) { isClosing = true; foreach (Animator a in animators) { a.SetTrigger("Close"); } player.art.animator.SetBool("ItemGet", false); Destroy(popup.gameObject, destructionDelay); Destroy(gameObject, destructionDelay); player.SetFrozenStatus(false); if (customPopupCloseHandler == null) { if (modifyCutsceneModeState) { player.SetCutsceneMode(false); } } else { customPopupCloseHandler.Invoke(this); } } }
void BubbleClosed() { if (bubbleClosedEvent != null) { bubbleClosedEvent.Invoke(gameObject, null); } player.SetCutsceneMode(false); }
public override void Interact(GameObject playerObject) { base.Interact(playerObject); if (currentBubble == null) { player = playerObject.GetComponent <PlayerMachine>(); GameObject bubble = Instantiate(speechBubble, player.gameManager.uiParent); Typewriter writer = bubble.GetComponent <Typewriter>(); writer.talkSound = talkSound; writer.skipSound = skipSound; writer.OnPageFinished += PageFinished; writer.OnBubbleClosed += BubbleClosed; writer.bubbleImage.color = bubbleTint; writer.textComponent.color = textTint; writer.StartWriting(text); currentBubble = bubble; player.SetCutsceneMode(true); } }
public void StartPopup(BaseItem itemType, PlayerMachine player, int quantity = 1, Action <ItemPopup> customPopupCloseHandler = null, bool modifyCutsceneModeState = true) { this.item = itemType; this.player = player; this.customPopupCloseHandler = customPopupCloseHandler; this.modifyCutsceneModeState = modifyCutsceneModeState; item = itemType; if (modifyCutsceneModeState) { player.SetCutsceneMode(true); } player.SetFrozenStatus(true); if (quantity > 1) { nameText.text = "You got " + quantity + "x <color=red>" + itemType.itemName + "</color>!"; } else { if (itemType.name.StartsWith("A") || itemType.name.StartsWith("E") || itemType.name.StartsWith("I") || itemType.name.StartsWith("O") || itemType.name.StartsWith("U")) { nameText.text = "You got an <color=red>" + itemType.itemName + "</color>!"; } else { nameText.text = "You got a <color=red>" + itemType.itemName + "</color>!"; } } descText.text = itemType.description; popup = Instantiate(iconPopup, player.transform).GetComponent <ItemIconPopup>(); animators.Add(popup.gameObject.GetComponent <Animator>()); popup.Show(item.icon); StartCoroutine(waitBeforeAllowingClose(closeDelay)); }