private void Update() { if (animator.GetBool("IsOpen")) { if (GlobalRegistry.CheckKey("Next")) { DisplayNextSentence(); } } }
private void activePower(int index) { if (GlobalRegistry.CheckKey("Mechanic" + index)) { keyMechanics[index].Activate(); } if (GlobalRegistry.CheckKeyUp("Mechanic" + index)) { keyMechanics[index].Release(); } }
void Update() { if (GlobalRegistry.CheckKey("ToggleL")) { toggleHand(-1); } if (GlobalRegistry.CheckKey("ToggleR")) { toggleHand(1); } if (GlobalRegistry.CheckKey("Use")) { useHeldItem(); } }
// Update is called once per frame void Update() { //Check the STATIC OBJECT ARRAY, which is an array of PowerSlot Objects, and if either 0, 1 or 2 has a keycode that is being //pressed, get its power attached and do it. for (int i = 0; i < MECHANIC_SLOTS; i++) { //Open a Power-choosing menu if (GlobalRegistry.CheckKey("PowerMenu" + i)) { mechanicMenu[i] = true; //If the Image is currently shrinking, stop it from doing that! Timing.KillCoroutines("PowerUI" + i); //Start new routine Timing.RunCoroutine(resizeUIImage(UISlots[i], 75), "PowerUI" + i); Player.GetPlayer().SetMobility(false); } if (GlobalRegistry.CheckKeyUp("PowerMenu" + i)) { mechanicMenu[i] = false; //If the Image is currently growing, stop it from doing that! Timing.KillCoroutines("PowerUI" + i); //Start new routine Timing.RunCoroutine(resizeUIImage(UISlots[i], 50), "PowerUI" + i); //If all other mechanicMenu variables are false as well, reactivate mobility //Start by reactivating mobility... Player.GetPlayer().SetMobility(true); for (int j = 0; j < MECHANIC_SLOTS; j++) { //...But if any other mechanicMenu variables ARE true, reset it to false! if (mechanicMenu[j] == true) { Player.GetPlayer().SetMobility(false); } } } //Activating a Power if (mechanicMenu[i] == false) { activePower(i); } else { activeMenu(i); } } }
// Update is called once per frame void Update() { if (GlobalRegistry.CheckKey("PickUp")) { playerCollider.enabled = false; RaycastHit2D touched = Physics2D.CircleCast( (Vector2)playerTransform.position, GlobalRegistry.PLAYER_REACH(), playerInstance.GetDirection(), GlobalRegistry.PLAYER_REACH(), layerMask); playerCollider.enabled = true; //Pick up the object if (touched.collider.gameObject.GetComponent <Material>()) { if (touched.collider != null) { playerInstance.PickUp(touched.collider.gameObject); } } } }