void Update() { // Flip tile if (gwc.bCanFlip && !spLogic.bGuessingFTW && bHasEntered && !bHasExited && !pause.bPauseActive && !dMan.bDialogueActive && !dMan.bPauseDialogue && (Input.GetButtonDown("Action") || contSupp.ControllerButtonPadBottom("down") || touches.bAaction)) { CheckAndFlip(); } // Tile layer changer if (gwc.bCanFlip && !dMan.bDialogueActive && !pause.bPauseActive && !bAvoidUpdate && (Input.GetKeyDown(KeyCode.LeftShift) || Input.GetKeyDown(KeyCode.RightShift) || contSupp.ControllerButtonPadRight("down") || touches.bBaction || (Input.GetMouseButtonDown(1) && Input.touchCount < 2))) { touches.Vibrate(); FlipLayer(); } // Reset tile layer changer for keyboard if (!pause.bPauseActive && (Input.GetKeyUp(KeyCode.LeftShift) || Input.GetKeyUp(KeyCode.RightShift) || contSupp.ControllerButtonPadRight("up") || (Input.GetMouseButtonUp(1) && devDetect.bIsMobile))) { bAvoidUpdate = false; } // Reset tile layer changer for GUI B button if (!touches.bBaction && bAvoidUpdate) { bAvoidUpdate = false; } }
void Update() { if (contSupp.bControllerConnected && buildDescBar.activeSelf && nodeUI.selectionEffect && !bReturnIsSelected) { returnB.Select(); bReturnIsSelected = true; StartCoroutine(contSupp.BelayAction()); } if (contSupp.bControllerConnected && !contSupp.bBelayAction && buildDescBar.activeSelf && bIsNowBuildDescMode) { if (contSupp.ControllerButtonPadBottom("down") || contSupp.ControllerButtonPadRight("down")) { SelectOption(); } } }
void Update() { //if (Input.GetKeyUp(KeyCode.R)) //{ // Debug.Log("hard reset"); // StartCoroutine(ResetElements()); //} if (bHasEntered && !dMan.bDialogueActive && !ms.bAvoidInvestigating && (Input.GetKeyUp(KeyCode.Space) || contSupp.ControllerButtonPadBottom("up") || touches.bAaction)) { InvestigateElement(); } if (bHasEntered && !dMan.bDialogueActive && (Input.GetKeyUp(KeyCode.F) || contSupp.ControllerButtonPadRight("up") || touches.bBaction)) { FlagElement(); } if (ms.bReset) { StartCoroutine(ResetElements()); } }
void Update() { if ((contSupp.ControllerButtonPadTop("down") || contSupp.ControllerButtonPadLeft("down")) && gMan.bIsHeroMode && !EventSystem.current.IsPointerOverGameObject()) { heroBarMan.ToggleHeroUpgradeShells(); } if (Input.GetKeyDown(KeyCode.Alpha1) && Input.GetKeyDown(KeyCode.Alpha0)) { TD_SBF_PlayerStatistics.ThoughtsPrayers += 1000; } if (heroStats.bIsDead) { return; } if (basicAttackWaitCounter <= 0) { if ((Input.GetMouseButtonDown(0) || contSupp.ControllerButtonPadBottom("down")) && gMan.bIsHeroMode && !EventSystem.current.IsPointerOverGameObject() && !heroBarMan.bUpgrading & !tConts.bAvoidSubUIElements) { BasicAttack(); } } else { basicAttackWaitCounter -= Time.deltaTime; } if (secondaryAttackWaitCounter <= 0) { if ((Input.GetMouseButtonDown(1) || contSupp.ControllerButtonPadRight("down")) && gMan.bIsHeroMode && !EventSystem.current.IsPointerOverGameObject() && !heroBarMan.bUpgrading) { StartSecondaryAttack(); } } else { secondaryAttackWaitCounter -= Time.deltaTime; } }
public void Move(float xInput, float yInput) { movementVector = moveSpeed * new Vector2(xInput, yInput); // Animate movement if (playerAnim) { if (movementVector != Vector2.zero) { playerAnim.SetBool("bIsWalking", true); playerAnim.SetFloat("Input_X", movementVector.x); playerAnim.SetFloat("Input_Y", movementVector.y); } else { playerAnim.SetBool("bIsWalking", false); } } // 2x Move Speed if (touches.bBaction || contSupp.ControllerButtonPadRight("hold") || contSupp.ControllerTriggerRight() != 0 || (Input.GetButton("BAction") && !devDetect.bIsMobile)) { rBody.velocity = movementVector * 2; if (playerAnim) { playerAnim.speed = 2.0f; } // Use Brio if (movementVector != Vector2.zero) { playerBrioMan.FatiguePlayer(0.1f); uMan.UpdateBrio(); } } // 1x Move Speed else { rBody.velocity = movementVector; if (playerAnim) { playerAnim.speed = 1.0f; } } }
void Update() { if (Input.GetKeyUp(KeyCode.Escape) || contSupp.ControllerMenuRight("up") || (bPauseActive && (touches.bBaction || contSupp.ControllerButtonPadRight("up")))) { if (controlsMenu.transform.localScale == Vector3.one) { Controls(false); } else if (soundMenu.transform.localScale == Vector3.one) { Sound(false); } else if (itemMenuCanvas.alpha == 1) { // "Unlock" Joystick from horizontal direction fixedJoy.joystickMode = JoystickMode.AllAxis; stuffBack.localScale = Vector3.one; itemMenuCanvas.alpha = 0; itemMenuCanvas.interactable = false; itemMenuCanvas.blocksRaycasts = false; } else if (stuffMenu.transform.localScale == Vector3.one) { Stuff(false); } else if (bIsGWC && iconsMenu.transform.localScale == Vector3.one) { Icons(false); } else { Pause(); } if (touches.bBaction) { touches.bBaction = false; } } }
void Update() { if (controlsMenu.localScale == Vector3.one) { // Controller Support if (!contSupp.bIsMoving && fixedJoystick.Vertical == 0 && fixedJoystick.Horizontal == 0 && (!touches.bDown && !touches.bUp && !touches.bLeft && !touches.bRight)) { bFreezeControllerInput = false; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() < 0 || contSupp.ControllerLeftJoystickVertical() < 0 || touches.bDown || (Mathf.Abs(fixedJoystick.Vertical) > Mathf.Abs(fixedJoystick.Horizontal) && fixedJoystick.Vertical < 0))) { bControllerDown = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() > 0 || contSupp.ControllerLeftJoystickVertical() > 0 || touches.bUp || (Mathf.Abs(fixedJoystick.Vertical) > Mathf.Abs(fixedJoystick.Horizontal) && fixedJoystick.Vertical > 0))) { bControllerUp = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() > 0 || contSupp.ControllerLeftJoystickHorizontal() > 0 || fixedJoystick.Horizontal > 0 || touches.bRight)) { bControllerRight = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() < 0 || contSupp.ControllerLeftJoystickHorizontal() < 0 || fixedJoystick.Horizontal < 0 || touches.bLeft)) { bControllerLeft = true; bFreezeControllerInput = true; } if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow) || bControllerDown) { bControllerDown = false; if (currentPosition == SelectorPosition.showButtons) { currentPosition = SelectorPosition.opacitySlider; ClearAllSelectors(); buttonOpacitySelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.opacitySlider) { currentPosition = SelectorPosition.dPad; ClearAllSelectors(); dPadSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.dPad) { currentPosition = SelectorPosition.vibrate; ClearAllSelectors(); vibrateSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.vibrate) { currentPosition = SelectorPosition.description; ClearAllSelectors(); controlsDescriptionSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.description) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.back) { currentPosition = SelectorPosition.showButtons; ClearAllSelectors(); showButtonsSelector.transform.localScale = Vector3.one; } } else if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow) || bControllerUp) { bControllerUp = false; if (currentPosition == SelectorPosition.back) { currentPosition = SelectorPosition.description; ClearAllSelectors(); controlsDescriptionSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.description) { currentPosition = SelectorPosition.vibrate; ClearAllSelectors(); vibrateSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.vibrate) { currentPosition = SelectorPosition.dPad; ClearAllSelectors(); dPadSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.dPad) { currentPosition = SelectorPosition.opacitySlider; ClearAllSelectors(); buttonOpacitySelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.opacitySlider) { currentPosition = SelectorPosition.showButtons; ClearAllSelectors(); showButtonsSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.showButtons) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } } else if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow) || bControllerLeft) { bControllerLeft = false; if (currentPosition == SelectorPosition.opacitySlider) { uMan.DecreaseOpacity(); } } else if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow) || bControllerRight) { bControllerRight = false; if (currentPosition == SelectorPosition.opacitySlider) { uMan.IncreaseOpacity(); } } else if ((Input.GetButtonDown("Action") || contSupp.ControllerButtonPadBottom("down") || touches.bAaction)) { if (currentPosition == SelectorPosition.showButtons) { showButtonsToggle.isOn = !showButtonsToggle.isOn; uMan.ToggleControls(); touches.Vibrate(); } else if (currentPosition == SelectorPosition.dPad && !uMan.bOnlyDPad) { dPadToggle.isOn = !dPadToggle.isOn; uMan.ToggleDPadControl(); touches.Vibrate(); } else if (currentPosition == SelectorPosition.vibrate) { vibrateToggle.isOn = !vibrateToggle.isOn; touches.ToggleVibrate(); touches.Vibrate(); } else if (currentPosition == SelectorPosition.back) { ResetSelectors(); movePMA.bDelayAction = true; pause.Controls(false); } touches.bAaction = false; } else if (Input.GetKeyDown(KeyCode.Escape) || contSupp.ControllerMenuRight("down") || contSupp.ControllerButtonPadRight("down") || Input.GetButton("BAction") || touches.bBaction) { ResetSelectors(); } if (contSupp.ControllerRightJoystickVertical() > 0) { if (controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>(). offsetMin.y < 0) { controlsMenu.GetChild(0).GetChild(0).localPosition = new Vector3( controlsMenu.GetChild(0).GetChild(0).localPosition.x, controlsMenu.GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(), controlsMenu.GetChild(0).GetChild(0).localPosition.z); } else { controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>(). offsetMin = new Vector2(controlsMenu.GetChild(0). GetChild(0).GetComponent <RectTransform>().offsetMin.x, 0); } } else if (contSupp.ControllerRightJoystickVertical() < 0) { if (controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>(). offsetMax.y * -1f < 0) { controlsMenu.GetChild(0).GetChild(0).localPosition = new Vector3( controlsMenu.GetChild(0).GetChild(0).localPosition.x, controlsMenu.GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(), controlsMenu.GetChild(0).GetChild(0).localPosition.z); } else { controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>(). offsetMax = new Vector2(controlsMenu.GetChild(0). GetChild(0).GetComponent <RectTransform>().offsetMax.x, 0); } } // Dev Support if (currentPosition == SelectorPosition.opacitySlider && (Input.GetButton("Action") || contSupp.ControllerButtonPadBottom("hold") || (touches.bAvoidSubUIElements && touches.bUIactive))) { devSupportTimer -= 0.01f; if (devSupportTimer <= 0) { bDevSupportActive = !bDevSupportActive; ToggleDevSupport(); } } } }
void Update() { if ((Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.P) || contSupp.ControllerMenuRight("down")) && !characterCanvas.activeSelf) { ToggleOptions(); } if (characterCanvas.activeSelf) { // Controller Support if (!contSupp.bIsMoving) { bFreezeControllerInput = false; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() < 0 || contSupp.ControllerLeftJoystickVertical() < 0)) { bControllerDown = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() > 0 || contSupp.ControllerLeftJoystickVertical() > 0)) { bControllerUp = true; bFreezeControllerInput = true; } //else if (!bFreezeControllerInput && // (contSupp.ControllerDirectionalPadHorizontal() > 0 || // contSupp.ControllerLeftJoystickHorizontal() > 0)) //{ // bControllerRight = true; // bFreezeControllerInput = true; //} //else if (!bFreezeControllerInput && // (contSupp.ControllerDirectionalPadHorizontal() < 0 || // contSupp.ControllerLeftJoystickHorizontal() < 0)) //{ // bControllerLeft = true; // bFreezeControllerInput = true; //} if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow) || bControllerDown) { bControllerDown = false; if (currentPosition == SelectorPosition.jesus) { currentPosition = SelectorPosition.modes; backToModes.Select(); } else if (currentPosition == SelectorPosition.modes) { currentPosition = SelectorPosition.jesus; characterButtons[0].Select(); } } else if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow) || bControllerUp) { bControllerUp = false; if (currentPosition == SelectorPosition.jesus) { currentPosition = SelectorPosition.modes; backToModes.Select(); } else if (currentPosition == SelectorPosition.modes) { currentPosition = SelectorPosition.jesus; characterButtons[0].Select(); } } //else if (Input.GetKeyDown(KeyCode.A) || // Input.GetKeyDown(KeyCode.LeftArrow) || // bControllerLeft) //{ // bControllerLeft = false; // if (currentPosition == SelectorPosition.volume) // vMan.LowerVolume(); // else if (currentPosition == SelectorPosition.music) // vMan.LowerMusic(); //} //else if (Input.GetKeyDown(KeyCode.D) || // Input.GetKeyDown(KeyCode.RightArrow) || // bControllerRight) //{ // bControllerRight = false; // if (currentPosition == SelectorPosition.volume) // vMan.RaiseVolume(); // else if (currentPosition == SelectorPosition.music) // vMan.RaiseMusic(); //} else if (Input.GetButtonDown("Action") || contSupp.ControllerButtonPadBottom("down")) { if (currentPosition == SelectorPosition.jesus) { characterButtons[0].onClick.Invoke(); } else if (currentPosition == SelectorPosition.modes) { backToModes.onClick.Invoke(); } } else if (contSupp.ControllerButtonPadRight("down")) { backToModes.onClick.Invoke(); BackToArcade(); } if (contSupp.ControllerRightJoystickVertical() > 0) { if (characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMin.y < 0) { characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition = new Vector3( characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition.x, characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(), characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition.z); } else { characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMin = new Vector2( characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMin.x, 0); } } else if (contSupp.ControllerRightJoystickVertical() < 0) { if (characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMax.y * -1f < 0) { characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition = new Vector3( characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition.x, characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(), characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition.z); } else { characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMax = new Vector2( characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMax.x, 0); } } } }
private void HandleInputs() { // Zoom Out if (Input.GetKey(KeyCode.I) || contSupp.ControllerTriggerRight() > 0 || tConts.bYaction) { if (scale > 0.00000001f) { scale *= .99f; } // Jump to max zoomed-out level else { scale = 75000f; } } // Zoom In else if (Input.GetKey(KeyCode.K) || contSupp.ControllerTriggerLeft() > 0 || tConts.bXaction) { if (scale < 75000f) { scale *= 1.01f; } // Jump to max zoomed-in level else { scale = 0.00000001f; smoothScale = Mathf.Lerp(scale, scale, 0.0333f); pos.x = -0.7500075f; pos.y = 0.003150068f; mat.SetVector("_Area", new Vector4(pos.x, pos.y, scale, scale)); } } // Rotate Left if (Input.GetKey(KeyCode.J) || contSupp.ControllerBumperLeft("hold") || tConts.bAaction) { angle -= 0.01f; } // Rotate Right else if (Input.GetKey(KeyCode.L) || contSupp.ControllerBumperRight("hold") || tConts.bBaction) { angle += 0.01f; } Vector2 dir = new Vector2(0.01f * scale, 0); float s = Mathf.Sin(angle); float c = Mathf.Cos(angle); dir = new Vector2(dir.x * c, dir.x * s); // Move Left if (Input.GetKey(KeyCode.A) || contSupp.ControllerLeftJoystickHorizontal() < 0 || contSupp.ControllerDirectionalPadHorizontal() < 0 || tConts.bLeft) { pos -= dir; } // Move Right else if (Input.GetKey(KeyCode.D) || contSupp.ControllerLeftJoystickHorizontal() > 0 || contSupp.ControllerDirectionalPadHorizontal() > 0 || tConts.bRight) { pos += dir; } dir = new Vector2(-dir.y, dir.x); // Move Down if (Input.GetKey(KeyCode.S) || contSupp.ControllerLeftJoystickVertical() < 0 || contSupp.ControllerDirectionalPadVertical() < 0 || tConts.bDown) { pos -= dir; } // Move Up else if (Input.GetKey(KeyCode.W) || contSupp.ControllerLeftJoystickVertical() > 0 || contSupp.ControllerDirectionalPadVertical() > 0 || tConts.bUp) { pos += dir; } // Cycle Colors if (Input.GetKey(KeyCode.U) || contSupp.ControllerButtonPadTop("hold") || tConts.bUpLeft) { if (color > 0) { color -= 0.01f; } } else if (Input.GetKey(KeyCode.O) || contSupp.ControllerButtonPadLeft("hold") || tConts.bUpRight) { if (color < 1) { color += 0.01f; } } // Kaleidoscope if (Input.GetKey(KeyCode.E) || contSupp.ControllerButtonPadRight("hold") || tConts.bDownLeft) { if (symmetry > 0) { symmetry -= 0.1f; } else if (symmetry < 0) { symmetry = 0; } } else if (Input.GetKey(KeyCode.Q) || contSupp.ControllerButtonPadBottom("hold") || tConts.bDownRight) { if (symmetry < 1) { symmetry += 0.1f; } } if (Input.GetKey(KeyCode.R) || contSupp.ControllerMenuLeft("hold") || Input.touchCount == 3) { ResetShader(); } }
void Update() { if (hbMan.bUpgrading) { if (contSupp.ControllerRightJoystickVertical() != 0 || contSupp.ControllerRightJoystickHorizontal() != 0) { if (contSupp.ControllerRightJoystickHorizontal() > -0.333f && contSupp.ControllerRightJoystickHorizontal() < 0.333f && contSupp.ControllerRightJoystickVertical() < -0.85f) { currentSelection = UpgradeSection.Section1; sec1.GetComponentInChildren <Button>().Select(); } else if (contSupp.ControllerRightJoystickHorizontal() > 0.333f && contSupp.ControllerRightJoystickHorizontal() < 0.85f && contSupp.ControllerRightJoystickVertical() > -0.85f && contSupp.ControllerRightJoystickVertical() < -0.333f) { currentSelection = UpgradeSection.Section2; sec2.GetComponentInChildren <Button>().Select(); } else if (contSupp.ControllerRightJoystickHorizontal() > 0.85f && contSupp.ControllerRightJoystickVertical() > -0.333f && contSupp.ControllerRightJoystickVertical() < 0.333f) { currentSelection = UpgradeSection.Section3; sec3.GetComponentInChildren <Button>().Select(); } else if (contSupp.ControllerRightJoystickHorizontal() > 0.333f && contSupp.ControllerRightJoystickHorizontal() < 0.85f && contSupp.ControllerRightJoystickVertical() > 0.333f && contSupp.ControllerRightJoystickVertical() < 0.85f) { currentSelection = UpgradeSection.Section4; sec4.GetComponentInChildren <Button>().Select(); } else if (contSupp.ControllerRightJoystickHorizontal() > -0.333f && contSupp.ControllerRightJoystickHorizontal() < 0.333f && contSupp.ControllerRightJoystickVertical() > 0.85f) { currentSelection = UpgradeSection.Section5; sec5.GetComponentInChildren <Button>().Select(); } else if (contSupp.ControllerRightJoystickHorizontal() > -0.85f && contSupp.ControllerRightJoystickHorizontal() < -0.333f && contSupp.ControllerRightJoystickVertical() > 0.333f && contSupp.ControllerRightJoystickVertical() < 0.85f) { currentSelection = UpgradeSection.Section6; sec6.GetComponentInChildren <Button>().Select(); } else if (contSupp.ControllerRightJoystickHorizontal() < -0.85f && contSupp.ControllerRightJoystickVertical() > -0.333f && contSupp.ControllerRightJoystickVertical() < 0.333f) { currentSelection = UpgradeSection.Section7; sec7.GetComponentInChildren <Button>().Select(); } else if (contSupp.ControllerRightJoystickHorizontal() > -0.85f && contSupp.ControllerRightJoystickHorizontal() < -0.333f && contSupp.ControllerRightJoystickVertical() > -0.85f && contSupp.ControllerRightJoystickVertical() < -0.333f) { if (heroStats.bIsDead) { currentSelection = UpgradeSection.Section8; sec8.GetComponentInChildren <Button>().Select(); } } } if (contSupp.ControllerButtonPadBottom("down")) { if (currentSelection == UpgradeSection.Section1) { sec1.GetComponentInChildren <Button>().onClick.Invoke(); } else if (currentSelection == UpgradeSection.Section2) { sec2.GetComponentInChildren <Button>().onClick.Invoke(); } else if (currentSelection == UpgradeSection.Section3) { sec3.GetComponentInChildren <Button>().onClick.Invoke(); } else if (currentSelection == UpgradeSection.Section4) { sec4.GetComponentInChildren <Button>().onClick.Invoke(); } else if (currentSelection == UpgradeSection.Section5) { sec5.GetComponentInChildren <Button>().onClick.Invoke(); } else if (currentSelection == UpgradeSection.Section6) { sec6.GetComponentInChildren <Button>().onClick.Invoke(); } else if (currentSelection == UpgradeSection.Section7) { sec7.GetComponentInChildren <Button>().onClick.Invoke(); } else if (currentSelection == UpgradeSection.Section8) { sec8.GetComponentInChildren <Button>().onClick.Invoke(); } } if (contSupp.ControllerButtonPadRight("down")) { hbMan.ToggleHeroUpgradeShells(); } } }
void Update() { if (contSupp.bControllerConnected && upgradeShell.activeSelf && !bIsNowNodeUIMode && !buildDescBarSel.bIsNowBuildDescMode) { upgradeB.Select(); bIsNowNodeUIMode = true; currentSelection = NodeUISelection.Upgrade; cMan.OnTUB(); cMan.RestoreTUBInteractability(); contSupp.bBelayAction = true; } if (contSupp.bControllerConnected && bIsNowNodeUIMode && upgradeShell.activeSelf) { // Controller Support if (contSupp.ControllerRightJoystickVertical() == 0) { bFreezeControllerInput = false; } else if (!bFreezeControllerInput && contSupp.ControllerRightJoystickVertical() > 0) { bControllerDown = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && contSupp.ControllerRightJoystickVertical() < 0) { bControllerUp = true; bFreezeControllerInput = true; } if (bControllerDown) { bControllerDown = false; MoveDown(); } else if (bControllerUp) { bControllerUp = false; MoveUp(); } else if (contSupp.ControllerButtonPadBottom("down")) { SelectOption(); } else if (contSupp.ControllerButtonPadRight("down")) { StartCoroutine(contSupp.BelayAction()); ResetNodeUI(); shopSel.ResetTowerMode(); } else if (contSupp.ControllerBumperRight("down") || contSupp.ControllerBumperLeft("down")) { shopSel.ResetScroll(); } } }
void Update() { if (itemMenu.gameObject.GetComponent <CanvasGroup>().alpha == 1) { // Controller Support if (contSupp.ControllerDirectionalPadHorizontal() == 0 && contSupp.ControllerLeftJoystickHorizontal() == 0 && joystick.Horizontal == 0 && (!touches.bLeft && !touches.bRight)) { bFreezeControllerInput = false; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() > 0 || contSupp.ControllerLeftJoystickHorizontal() > 0 || joystick.Horizontal > 0 || touches.bRight)) { bControllerRight = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() < 0 || contSupp.ControllerLeftJoystickHorizontal() < 0 || joystick.Horizontal < 0 || touches.bLeft)) { bControllerLeft = true; bFreezeControllerInput = true; } if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow) || bControllerRight) { bControllerRight = false; if (currentPosition == ItemArrowPos.Use) { currentPosition = ItemArrowPos.Drop; ClearAllArrows(); DropArw.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f); } else if (currentPosition == ItemArrowPos.Drop) { currentPosition = ItemArrowPos.Back; ClearAllArrows(); BackArw.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f); } } else if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow) || bControllerLeft) { bControllerLeft = false; if (currentPosition == ItemArrowPos.Back) { currentPosition = ItemArrowPos.Drop; ClearAllArrows(); DropArw.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f); } else if (currentPosition == ItemArrowPos.Drop) { currentPosition = ItemArrowPos.Use; ClearAllArrows(); UseArw.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f); } } else if (Input.GetButtonDown("Action") || contSupp.ControllerButtonPadBottom("down") || touches.bAaction) { if (currentPosition == ItemArrowPos.Use) { UseBtn.onClick.Invoke(); } else if (currentPosition == ItemArrowPos.Drop) { DropBtn.onClick.Invoke(); } else if (currentPosition == ItemArrowPos.Back) { BackBtn.onClick.Invoke(); } moveSMA.bAllowSelection = false; moveSMA.bAvoidAllower = false; touches.bAaction = false; } else if (Input.GetKeyDown(KeyCode.Escape) || contSupp.ControllerMenuRight("down") || contSupp.ControllerButtonPadRight("down") || Input.GetButton("BAction") || touches.bBaction) { ResetArrowPos(); } } }
// Update is called once per frame void Update() { if (controlsMenu.localScale == Vector3.one) { // Controller Support if (!contSupp.bIsMoving && fixedJoystickLeft.Vertical == 0 && fixedJoystickLeft.Horizontal == 0) { bFreezeControllerInput = false; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() < 0 || contSupp.ControllerLeftJoystickVertical() < 0 || (Mathf.Abs(fixedJoystickLeft.Vertical) > Mathf.Abs(fixedJoystickLeft.Horizontal) && fixedJoystickLeft.Vertical < 0))) { bControllerDown = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() > 0 || contSupp.ControllerLeftJoystickVertical() > 0 || (Mathf.Abs(fixedJoystickRight.Vertical) > Mathf.Abs(fixedJoystickRight.Horizontal) && fixedJoystickRight.Vertical > 0))) { bControllerUp = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() > 0 || contSupp.ControllerLeftJoystickHorizontal() > 0 || fixedJoystickLeft.Horizontal > 0)) { bControllerRight = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() < 0 || contSupp.ControllerLeftJoystickHorizontal() < 0 || fixedJoystickLeft.Horizontal < 0)) { bControllerLeft = true; bFreezeControllerInput = true; } if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow) || bControllerDown) { bControllerDown = false; if (currentPosition == SelectorPosition.opacitySlider) { currentPosition = SelectorPosition.vibrate; ClearAllSelectors(); vibrateSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.vibrate) { currentPosition = SelectorPosition.description; ClearAllSelectors(); controlsDescriptionSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.description) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.back) { currentPosition = SelectorPosition.opacitySlider; ClearAllSelectors(); buttonOpacitySelector.transform.localScale = Vector3.one; } } else if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow) || bControllerUp) { bControllerUp = false; if (currentPosition == SelectorPosition.opacitySlider) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.vibrate) { currentPosition = SelectorPosition.opacitySlider; ClearAllSelectors(); buttonOpacitySelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.description) { currentPosition = SelectorPosition.vibrate; ClearAllSelectors(); vibrateSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.back) { currentPosition = SelectorPosition.description; ClearAllSelectors(); controlsDescriptionSelector.transform.localScale = Vector3.one; } } else if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow) || bControllerLeft) { bControllerLeft = false; if (currentPosition == SelectorPosition.opacitySlider) { touches.DecreaseOpacity(); } } else if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow) || bControllerRight) { bControllerRight = false; if (currentPosition == SelectorPosition.opacitySlider) { touches.IncreaseOpacity(); } } else if (Input.GetButtonDown("Action") || contSupp.ControllerButtonPadBottom("down")) { if (currentPosition == SelectorPosition.vibrate) { vibrateToggle.isOn = !vibrateToggle.isOn; touches.ToggleVibrate(); touches.Vibrate(); } else if (currentPosition == SelectorPosition.back) { ResetSelectors(); //movePMA.bDelayAction = true; // DC TODO pause.ToggleControls(); } } else if (Input.GetKeyDown(KeyCode.Escape) || contSupp.ControllerMenuRight("down") || contSupp.ControllerButtonPadRight("down") || Input.GetButton("BAction")) { ResetSelectors(); } if (contSupp.ControllerRightJoystickVertical() > 0) { if (controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>(). offsetMin.y < 0) { controlsMenu.GetChild(0).GetChild(0).localPosition = new Vector3( controlsMenu.GetChild(0).GetChild(0).localPosition.x, controlsMenu.GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(), controlsMenu.GetChild(0).GetChild(0).localPosition.z); } else { controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>(). offsetMin = new Vector2(controlsMenu.GetChild(0). GetChild(0).GetComponent <RectTransform>().offsetMin.x, 0); } } else if (contSupp.ControllerRightJoystickVertical() < 0) { if (controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>(). offsetMax.y * -1f < 0) { controlsMenu.GetChild(0).GetChild(0).localPosition = new Vector3( controlsMenu.GetChild(0).GetChild(0).localPosition.x, controlsMenu.GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(), controlsMenu.GetChild(0).GetChild(0).localPosition.z); } else { controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>(). offsetMax = new Vector2(controlsMenu.GetChild(0). GetChild(0).GetComponent <RectTransform>().offsetMax.x, 0); } } } }
void Update() { // Skip animations if ((Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0) || contSupp.ControllerButtonPadBottom("down") || contSupp.ControllerButtonPadRight("down")) && towerDeez.GetComponent <Image>().color.a != 1f && !bIsLoaded) { if (Screen.width >= Screen.height) { characters_h.GetComponent <DelayAnimation>().bAvoidAni = true; characters_h.GetComponent <Animator>().enabled = false; characters_h.GetComponent <CanvasGroup>().alpha = 1; curtain_h.GetComponent <DelayAnimation>().bAvoidAni = true; curtain_h.GetComponent <Animator>().enabled = false; curtain_h.transform.localScale = Vector3.zero; curtain_h.GetComponent <Image>().color = new Color(0, 0, 0, 0); sbf_h.GetComponent <DelayAnimation>().bAvoidAni = true; sbf_h.GetComponent <Animator>().enabled = false; sbf_h.transform.localScale = new Vector3(4.75f, 4.75f, 1); } else { characters_v.GetComponent <DelayAnimation>().bAvoidAni = true; characters_v.GetComponent <Animator>().enabled = false; characters_v.GetComponent <CanvasGroup>().alpha = 1; curtain_v.GetComponent <DelayAnimation>().bAvoidAni = true; curtain_v.GetComponent <Animator>().enabled = false; curtain_v.transform.localScale = Vector3.zero; curtain_v.GetComponent <Image>().color = new Color(0, 0, 0, 0); sbf_v.GetComponent <DelayAnimation>().bAvoidAni = true; sbf_v.GetComponent <Animator>().enabled = false; sbf_v.transform.localScale = new Vector3(4.75f, 4.75f, 1); towerDefense.GetComponent <RectTransform>().sizeDelta = new Vector2(500f, 83.333f); } towerDeez.GetComponent <DelayAnimation>().bAvoidAni = true; towerDeez.GetComponent <Animator>().enabled = false; towerDeez.GetComponent <Image>().color = new Color(255f, 255f, 255f, 1); towerDeez.GetComponent <Button>().Select(); towerDefense.GetComponent <DelayAnimation>().bAvoidAni = true; towerDefense.GetComponent <Animator>().enabled = false; towerDefense.GetComponent <Image>().color = new Color(255f, 255f, 255f, 1); bIsLoaded = true; StartCoroutine(DelaySelectable()); } if ((Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0) || contSupp.ControllerButtonPadBottom("down")) && bIsSelectable) { bIsLoaded = true; towerDeez.GetComponent <Button>().onClick.Invoke(); } }
void Update() { if (bPauseDialogue) { pauseTime -= Time.deltaTime; if (pauseTime < 0) { UnpauseDialogue(); } } // Advance active dialogues if (bDialogueActive && !bPauseDialogue && !pause.bPausing && !pause.bPauseActive && (touches.bAaction || Input.GetButtonDown("Action") || Input.GetButtonDown("BAction") || contSupp.ControllerButtonPadBottom("down") || contSupp.ControllerButtonPadRight("down") || (Input.GetButtonDown("DialogueAction") && !uMan.bControlsActive))) { touches.Vibrate(); if (!bTypewriting) { if (currentLine < dialogueLines.Length) { currentLine++; // 05/10/2019 DC -- Avoids the GWC double tap bug if (!oMan.bOptionsActive) { touches.bAaction = false; } } if (bDialogueActive && !oMan.bOptionsActive && currentLine <= dialogueLines.Length - 1) { StartCoroutine(TypewriteText()); } } else { delayForTypewriting = delayForTypewriting / 10f; } } // Show Options if present and w/ the last dialogue prompt; otherwise, reset the dialogue if (bDialogueActive && oMan.bDiaToOpts && !bTypewriting && !oMan.bOptionsActive && currentLine >= dialogueLines.Length - 1) { oMan.ShowOptions(); } else if (!oMan.bOptionsActive && currentLine >= dialogueLines.Length) { ResetDialogue(); } // Temp: Update Camera display / aspect ratio & virtual joystick if (Input.GetKeyUp(KeyCode.R) || contSupp.ControllerMenuLeft("up")) { ConfigureParameters(); fixedJoy.JoystickPosition(); uMan.SetMenus(); } //Check sizing stuff //if (Input.GetKeyDown(KeyCode.T)) //{ // Debug.Log("Cam rect:" + mainCamera.GetComponent<Camera>().rect); // Debug.Log("Cam width:" + mainCamera.GetComponent<Camera>().rect.width); // Debug.Log("Cam height:" + mainCamera.GetComponent<Camera>().rect.height); //} }
void Update() { //if (contSupp.ControllerButtonPadBottom("down")) //{ // Debug.Log("bIsSelectable: " + bIsSelectable); // Debug.Log("bAvoidSelection: " + bAvoidSelection); //} // Skip animations if ((Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0) || contSupp.ControllerButtonPadBottom("down") || contSupp.ControllerButtonPadRight("down")) && danFace.GetComponent <CanvasRenderer>().GetAlpha() != 1f) { starExploding.GetComponent <Animator>().enabled = false; starExploding.GetComponent <ImageFader>().enabled = false; starExploding.GetComponent <Image>().enabled = false; whiteness.GetComponent <ImageFader>().enabled = false; whiteness.GetComponent <Image>().enabled = false; spaceTwinkling.GetComponent <ImageFader>().enabled = false; spaceTwinkling.GetComponent <Image>().enabled = false; spaceMoving.GetComponent <ImageFader>().enabled = false; spaceMoving.GetComponent <CanvasRenderer>().SetAlpha(1f); smokeRings.GetComponent <ImageFader>().enabled = false; smokeRings.GetComponent <CanvasRenderer>().SetAlpha(1f); title.GetComponent <ImageFader>().enabled = false; title.GetComponent <CanvasRenderer>().SetAlpha(1f); danFace.GetComponent <ImageFader>().enabled = false; danFace.GetComponent <CanvasRenderer>().SetAlpha(1f); endB.GetComponent <ImageFader>().enabled = false; endB.GetComponent <CanvasRenderer>().SetAlpha(1f); if (bHasSavedData) { goOnB.GetComponent <ImageFader>().enabled = false; goOnB.GetComponent <CanvasRenderer>().SetAlpha(1f); newB.GetComponent <ImageFader>().enabled = false; newB.GetComponent <CanvasRenderer>().SetAlpha(1f); } else { startB.GetComponent <ImageFader>().enabled = false; startB.GetComponent <CanvasRenderer>().SetAlpha(1f); } StartCoroutine(DelaySelectable()); } if ((contSupp.ControllerButtonPadBottom("down") || Input.GetKeyDown(KeyCode.Space)) && bIsSelectable) { //Debug.Log("selecting..."); SelectOption(); } // Controller Support // DC TODO -- Controller wide support for drift // Noticed here, but is present everywhere (other menus, walking, etc.) // Drift causes the bFreeze to "malfunction" and the stick has to be toggled to free it // Should re-work my controller logic or find a way to "clear" drift if (!contSupp.bIsMoving) { bFreezeControllerInput = false; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() < 0 || contSupp.ControllerLeftJoystickVertical() < 0)) { bControllerDown = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() > 0 || contSupp.ControllerLeftJoystickVertical() > 0)) { bControllerUp = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() > 0 || contSupp.ControllerLeftJoystickHorizontal() > 0)) { bControllerRight = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() < 0 || contSupp.ControllerLeftJoystickHorizontal() < 0)) { bControllerLeft = true; bFreezeControllerInput = true; } if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow) || bControllerDown) { bControllerDown = false; //bAvoidSelection = false; if (bIsSelectable) { MoveDown(); } } else if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow) || bControllerUp) { bControllerUp = false; //bAvoidSelection = false; if (bIsSelectable) { MoveUp(); } } else if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow) || bControllerLeft) { bControllerLeft = false; //bAvoidSelection = false; if (bIsSelectable) { MoveLeft(); } } else if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow) || bControllerRight) { bControllerRight = false; //bAvoidSelection = false; if (bIsSelectable) { MoveRight(); } } }
void Update() { if (soundMenu.localScale == Vector3.one) { // Controller Support if (!contSupp.bIsMoving && fixedJoystick.Vertical == 0 && fixedJoystick.Horizontal == 0 && (!touches.bDown && !touches.bUp && !touches.bLeft && !touches.bRight)) { bFreezeControllerInput = false; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() < 0 || contSupp.ControllerLeftJoystickVertical() < 0 || touches.bDown || (Mathf.Abs(fixedJoystick.Vertical) > Mathf.Abs(fixedJoystick.Horizontal) && fixedJoystick.Vertical < 0))) { bControllerDown = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() > 0 || contSupp.ControllerLeftJoystickVertical() > 0 || touches.bUp || (Mathf.Abs(fixedJoystick.Vertical) > Mathf.Abs(fixedJoystick.Horizontal) && fixedJoystick.Vertical > 0))) { bControllerUp = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() > 0 || contSupp.ControllerLeftJoystickHorizontal() > 0 || fixedJoystick.Horizontal > 0 || touches.bRight)) { bControllerRight = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() < 0 || contSupp.ControllerLeftJoystickHorizontal() < 0 || fixedJoystick.Horizontal < 0 || touches.bLeft)) { bControllerLeft = true; bFreezeControllerInput = true; } if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow) || bControllerDown) { bControllerDown = false; if (currentPosition == SelectorPosition.volumeSlider) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.back) { currentPosition = SelectorPosition.volumeSlider; ClearAllSelectors(); volumeSelector.transform.localScale = Vector3.one; } } else if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow) || bControllerUp) { bControllerUp = false; if (currentPosition == SelectorPosition.volumeSlider) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.back) { currentPosition = SelectorPosition.volumeSlider; ClearAllSelectors(); volumeSelector.transform.localScale = Vector3.one; } } else if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow) || bControllerLeft) { bControllerLeft = false; if (currentPosition == SelectorPosition.volumeSlider) { vMan.LowerVolume(); } } else if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow) || bControllerRight) { bControllerRight = false; if (currentPosition == SelectorPosition.volumeSlider) { vMan.RaiseVolume(); } } else if ((Input.GetButtonDown("Action") || contSupp.ControllerButtonPadBottom("down") || touches.bAaction)) { if (currentPosition == SelectorPosition.back) { ResetSelectors(); movePMA.bDelayAction = true; pause.Sound(false); } touches.bAaction = false; } else if (Input.GetKeyDown(KeyCode.Escape) || contSupp.ControllerMenuRight("down") || contSupp.ControllerButtonPadRight("down") || Input.GetButton("BAction") || touches.bBaction) { ResetSelectors(); } } }
void Update() { if (bDelayAction) { bDelayAction = false; return; } if (pauseMenu.localScale == Vector3.one && pauseScreen.localScale == Vector3.one && itemMenuAlpha.alpha == 0) { // Controller Support if (contSupp.ControllerDirectionalPadVertical() == 0 && contSupp.ControllerLeftJoystickVertical() == 0 && joystick.Vertical == 0 && (!touches.bDown && !touches.bUp)) { bFreezeControllerInput = false; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() < 0 || contSupp.ControllerLeftJoystickVertical() < 0 || joystick.Vertical < 0 || touches.bDown)) { bControllerDown = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() > 0 || contSupp.ControllerLeftJoystickVertical() > 0 || joystick.Vertical > 0 || touches.bUp)) { bControllerUp = true; bFreezeControllerInput = true; } if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow) || bControllerDown) { bControllerDown = false; MoveDown(); } else if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow) || bControllerUp) { bControllerUp = false; MoveUp(); } else if (Input.GetButtonDown("Action") || contSupp.ControllerButtonPadBottom("down") || touches.bAaction) { SelectOption(); } else if (Input.GetKeyDown(KeyCode.Escape) || contSupp.ControllerMenuRight("down") || contSupp.ControllerButtonPadRight("down") || Input.GetButton("BAction") || touches.bBaction) { SaveBtn.GetComponentInChildren <Text>().text = "Save"; ResetArrows(); } } }
void Update() { if (stuffMenu.localScale == Vector3.one && itemMenu.GetComponent <CanvasGroup>().alpha == 0) { // Controller Support if (bDelayAction) { bDelayAction = false; return; } // Controller Support if (!contSupp.bIsMoving && fixedJoystick.Vertical == 0 && fixedJoystick.Horizontal == 0 && (!touches.bDown && !touches.bUp && !touches.bLeft && !touches.bRight)) { bFreezeControllerInput = false; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() < 0 || contSupp.ControllerLeftJoystickVertical() < 0 || touches.bDown || (Mathf.Abs(fixedJoystick.Vertical) > Mathf.Abs(fixedJoystick.Horizontal) && fixedJoystick.Vertical < 0))) { bControllerDown = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() > 0 || contSupp.ControllerLeftJoystickVertical() > 0 || touches.bUp || (Mathf.Abs(fixedJoystick.Vertical) > Mathf.Abs(fixedJoystick.Horizontal) && fixedJoystick.Vertical > 0))) { bControllerUp = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() > 0 || contSupp.ControllerLeftJoystickHorizontal() > 0 || fixedJoystick.Horizontal > 0 || touches.bRight)) { bControllerRight = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() < 0 || contSupp.ControllerLeftJoystickHorizontal() < 0 || fixedJoystick.Horizontal < 0 || touches.bLeft)) { bControllerLeft = true; bFreezeControllerInput = true; } if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow) || bControllerDown) { bControllerDown = false; if (currentPosition == SelectorPosition.item1) { currentPosition = SelectorPosition.item6; ClearAllSelectors(); itemSelector6.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item2) { currentPosition = SelectorPosition.item7; ClearAllSelectors(); itemSelector7.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item3) { currentPosition = SelectorPosition.item8; ClearAllSelectors(); itemSelector8.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item4) { currentPosition = SelectorPosition.item9; ClearAllSelectors(); itemSelector9.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item5) { currentPosition = SelectorPosition.item10; ClearAllSelectors(); itemSelector10.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item6) { currentPosition = SelectorPosition.item11; ClearAllSelectors(); itemSelector11.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item7) { currentPosition = SelectorPosition.item12; ClearAllSelectors(); itemSelector12.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item8) { currentPosition = SelectorPosition.item13; ClearAllSelectors(); itemSelector13.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item9) { currentPosition = SelectorPosition.item14; ClearAllSelectors(); itemSelector14.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item10) { currentPosition = SelectorPosition.item15; ClearAllSelectors(); itemSelector15.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item11) { currentPosition = SelectorPosition.item16; ClearAllSelectors(); itemSelector16.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item12) { currentPosition = SelectorPosition.item17; ClearAllSelectors(); itemSelector17.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item13) { currentPosition = SelectorPosition.item18; ClearAllSelectors(); itemSelector18.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item14) { currentPosition = SelectorPosition.item19; ClearAllSelectors(); itemSelector19.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item15) { currentPosition = SelectorPosition.item20; ClearAllSelectors(); itemSelector20.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item16) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item17) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item18) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item19) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item20) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.back) { if (selectorColumn == 1) { backSelector.transform.localScale = Vector3.zero; currentPosition = SelectorPosition.item1; itemSelector1.transform.localScale = Vector3.one; } else if (selectorColumn == 2) { backSelector.transform.localScale = Vector3.zero; currentPosition = SelectorPosition.item2; itemSelector2.transform.localScale = Vector3.one; } else if (selectorColumn == 3) { backSelector.transform.localScale = Vector3.zero; currentPosition = SelectorPosition.item3; itemSelector3.transform.localScale = Vector3.one; } else if (selectorColumn == 4) { backSelector.transform.localScale = Vector3.zero; currentPosition = SelectorPosition.item4; itemSelector4.transform.localScale = Vector3.one; } else if (selectorColumn == 5) { backSelector.transform.localScale = Vector3.zero; currentPosition = SelectorPosition.item5; itemSelector5.transform.localScale = Vector3.one; } } } else if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow) || bControllerUp) { bControllerUp = false; if (currentPosition == SelectorPosition.item1) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item2) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item3) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item4) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item5) { currentPosition = SelectorPosition.back; ClearAllSelectors(); backSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item6) { currentPosition = SelectorPosition.item1; ClearAllSelectors(); itemSelector1.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item7) { currentPosition = SelectorPosition.item2; ClearAllSelectors(); itemSelector2.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item8) { currentPosition = SelectorPosition.item3; ClearAllSelectors(); itemSelector3.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item9) { currentPosition = SelectorPosition.item4; ClearAllSelectors(); itemSelector4.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item10) { currentPosition = SelectorPosition.item5; ClearAllSelectors(); itemSelector5.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item11) { currentPosition = SelectorPosition.item6; ClearAllSelectors(); itemSelector6.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item12) { currentPosition = SelectorPosition.item7; ClearAllSelectors(); itemSelector7.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item13) { currentPosition = SelectorPosition.item8; ClearAllSelectors(); itemSelector8.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item14) { currentPosition = SelectorPosition.item9; ClearAllSelectors(); itemSelector9.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item15) { currentPosition = SelectorPosition.item10; ClearAllSelectors(); itemSelector10.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item16) { currentPosition = SelectorPosition.item11; ClearAllSelectors(); itemSelector11.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item17) { currentPosition = SelectorPosition.item12; ClearAllSelectors(); itemSelector12.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item18) { currentPosition = SelectorPosition.item13; ClearAllSelectors(); itemSelector13.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item19) { currentPosition = SelectorPosition.item14; ClearAllSelectors(); itemSelector14.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item20) { currentPosition = SelectorPosition.item15; ClearAllSelectors(); itemSelector15.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.back) { if (selectorColumn == 1) { backSelector.transform.localScale = Vector3.zero; currentPosition = SelectorPosition.item16; itemSelector16.transform.localScale = Vector3.one; } else if (selectorColumn == 2) { backSelector.transform.localScale = Vector3.zero; currentPosition = SelectorPosition.item17; itemSelector17.transform.localScale = Vector3.one; } else if (selectorColumn == 3) { backSelector.transform.localScale = Vector3.zero; currentPosition = SelectorPosition.item18; itemSelector18.transform.localScale = Vector3.one; } else if (selectorColumn == 4) { backSelector.transform.localScale = Vector3.zero; currentPosition = SelectorPosition.item19; itemSelector19.transform.localScale = Vector3.one; } else if (selectorColumn == 5) { backSelector.transform.localScale = Vector3.zero; currentPosition = SelectorPosition.item20; itemSelector20.transform.localScale = Vector3.one; } } } else if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow) || bControllerLeft) { bControllerLeft = false; if (currentPosition == SelectorPosition.item1) { currentPosition = SelectorPosition.item5; selectorColumn = 5; ClearAllSelectors(); itemSelector5.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item2) { currentPosition = SelectorPosition.item1; selectorColumn = 1; ClearAllSelectors(); itemSelector1.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item3) { currentPosition = SelectorPosition.item2; selectorColumn = 2; ClearAllSelectors(); itemSelector2.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item4) { currentPosition = SelectorPosition.item3; selectorColumn = 3; ClearAllSelectors(); itemSelector3.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item5) { currentPosition = SelectorPosition.item4; selectorColumn = 4; ClearAllSelectors(); itemSelector4.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item6) { currentPosition = SelectorPosition.item10; selectorColumn = 5; ClearAllSelectors(); itemSelector10.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item7) { currentPosition = SelectorPosition.item6; selectorColumn = 1; ClearAllSelectors(); itemSelector6.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item8) { currentPosition = SelectorPosition.item7; selectorColumn = 2; ClearAllSelectors(); itemSelector7.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item9) { currentPosition = SelectorPosition.item8; selectorColumn = 3; ClearAllSelectors(); itemSelector8.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item10) { currentPosition = SelectorPosition.item9; selectorColumn = 4; ClearAllSelectors(); itemSelector9.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item11) { currentPosition = SelectorPosition.item15; selectorColumn = 5; ClearAllSelectors(); itemSelector15.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item12) { currentPosition = SelectorPosition.item11; selectorColumn = 1; ClearAllSelectors(); itemSelector11.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item13) { currentPosition = SelectorPosition.item12; selectorColumn = 2; ClearAllSelectors(); itemSelector12.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item14) { currentPosition = SelectorPosition.item13; selectorColumn = 3; ClearAllSelectors(); itemSelector13.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item15) { currentPosition = SelectorPosition.item14; selectorColumn = 4; ClearAllSelectors(); itemSelector14.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item16) { currentPosition = SelectorPosition.item20; selectorColumn = 5; ClearAllSelectors(); itemSelector20.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item17) { currentPosition = SelectorPosition.item16; selectorColumn = 1; ClearAllSelectors(); itemSelector16.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item18) { currentPosition = SelectorPosition.item17; selectorColumn = 2; ClearAllSelectors(); itemSelector17.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item19) { currentPosition = SelectorPosition.item18; selectorColumn = 3; ClearAllSelectors(); itemSelector18.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item20) { currentPosition = SelectorPosition.item19; selectorColumn = 4; ClearAllSelectors(); itemSelector19.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.back) { if (selectorColumn == 1) { selectorColumn = 5; } else if (selectorColumn == 2) { selectorColumn = 1; } else if (selectorColumn == 3) { selectorColumn = 2; } else if (selectorColumn == 4) { selectorColumn = 3; } else if (selectorColumn == 5) { selectorColumn = 4; } } } else if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow) || bControllerRight) { bControllerRight = false; if (currentPosition == SelectorPosition.item1) { currentPosition = SelectorPosition.item2; selectorColumn = 2; ClearAllSelectors(); itemSelector2.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item2) { currentPosition = SelectorPosition.item3; selectorColumn = 3; ClearAllSelectors(); itemSelector3.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item3) { currentPosition = SelectorPosition.item4; selectorColumn = 4; ClearAllSelectors(); itemSelector4.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item4) { currentPosition = SelectorPosition.item5; selectorColumn = 5; ClearAllSelectors(); itemSelector5.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item5) { currentPosition = SelectorPosition.item1; selectorColumn = 1; ClearAllSelectors(); itemSelector1.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item6) { currentPosition = SelectorPosition.item7; selectorColumn = 2; ClearAllSelectors(); itemSelector7.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item7) { currentPosition = SelectorPosition.item8; selectorColumn = 3; ClearAllSelectors(); itemSelector8.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item8) { currentPosition = SelectorPosition.item9; selectorColumn = 4; ClearAllSelectors(); itemSelector9.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item9) { currentPosition = SelectorPosition.item10; selectorColumn = 5; ClearAllSelectors(); itemSelector10.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item10) { currentPosition = SelectorPosition.item6; selectorColumn = 1; ClearAllSelectors(); itemSelector6.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item11) { currentPosition = SelectorPosition.item12; selectorColumn = 2; ClearAllSelectors(); itemSelector12.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item12) { currentPosition = SelectorPosition.item13; selectorColumn = 3; ClearAllSelectors(); itemSelector13.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item13) { currentPosition = SelectorPosition.item14; selectorColumn = 4; ClearAllSelectors(); itemSelector14.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item14) { currentPosition = SelectorPosition.item15; selectorColumn = 5; ClearAllSelectors(); itemSelector15.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item15) { currentPosition = SelectorPosition.item11; selectorColumn = 1; ClearAllSelectors(); itemSelector11.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item16) { currentPosition = SelectorPosition.item17; selectorColumn = 2; ClearAllSelectors(); itemSelector17.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item17) { currentPosition = SelectorPosition.item18; selectorColumn = 3; ClearAllSelectors(); itemSelector18.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item18) { currentPosition = SelectorPosition.item19; selectorColumn = 4; ClearAllSelectors(); itemSelector19.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item19) { currentPosition = SelectorPosition.item20; selectorColumn = 5; ClearAllSelectors(); itemSelector20.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.item20) { currentPosition = SelectorPosition.item16; selectorColumn = 1; ClearAllSelectors(); itemSelector16.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.back) { if (selectorColumn == 1) { selectorColumn = 2; } else if (selectorColumn == 2) { selectorColumn = 3; } else if (selectorColumn == 3) { selectorColumn = 4; } else if (selectorColumn == 4) { selectorColumn = 5; } else if (selectorColumn == 5) { selectorColumn = 1; } } } else if (bAllowSelection && (Input.GetButtonDown("Action") || contSupp.ControllerButtonPadBottom("down") || touches.bAaction)) { if (currentPosition == SelectorPosition.item1) { item1.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item2) { item2.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item3) { item3.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item4) { item4.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item5) { item5.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item6) { item6.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item7) { item7.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item8) { item8.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item9) { item9.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item10) { item10.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item11) { item11.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item12) { item12.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item13) { item13.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item14) { item14.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item15) { item15.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item16) { item16.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item17) { item17.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item18) { item18.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item19) { item19.onClick.Invoke(); } else if (currentPosition == SelectorPosition.item20) { item20.onClick.Invoke(); } else if (currentPosition == SelectorPosition.back) { ResetSelectors(); movePMA.bDelayAction = true; bDelayAction = true; pause.Stuff(false); } touches.bAaction = false; } else if (Input.GetKeyDown(KeyCode.Escape) || contSupp.ControllerMenuRight("down") || contSupp.ControllerButtonPadRight("down") || Input.GetButton("BAction") || touches.bBaction) { ResetSelectors(); } if (!bAvoidAllower) { bAvoidAllower = true; bAllowSelection = true; } } }
void Update() { if (pauseCanvas.activeSelf) { // Controller Support if (!contSupp.bIsMoving) { bFreezeControllerInput = false; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() < 0 || contSupp.ControllerLeftJoystickVertical() < 0)) { bControllerDown = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadVertical() > 0 || contSupp.ControllerLeftJoystickVertical() > 0)) { bControllerUp = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() > 0 || contSupp.ControllerLeftJoystickHorizontal() > 0)) { bControllerRight = true; bFreezeControllerInput = true; } else if (!bFreezeControllerInput && (contSupp.ControllerDirectionalPadHorizontal() < 0 || contSupp.ControllerLeftJoystickHorizontal() < 0)) { bControllerLeft = true; bFreezeControllerInput = true; } if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow) || bControllerDown) { bControllerDown = false; if (menuMain.activeSelf) { if (currentPosition == SelectorPosition.goOn) { currentPosition = SelectorPosition.options; mainOptionsBtn.Select(); } else if (currentPosition == SelectorPosition.options) { currentPosition = SelectorPosition.end; mainEndBtn.Select(); } else if (currentPosition == SelectorPosition.end) { currentPosition = SelectorPosition.goOn; mainGoOnBtn.Select(); } } else if (menuOptions.activeSelf) { if (currentPosition == SelectorPosition.audio) { currentPosition = SelectorPosition.controls; optsControlsBtn.Select(); } else if (currentPosition == SelectorPosition.controls) { currentPosition = SelectorPosition.muor; optsMuorBtn.Select(); } else if (currentPosition == SelectorPosition.muor) { currentPosition = SelectorPosition.back; optsBackBtn.Select(); } else if (currentPosition == SelectorPosition.back) { currentPosition = SelectorPosition.audio; optsAudioBtn.Select(); } } else if (menuAudio.activeSelf) { if (currentPosition == SelectorPosition.volume) { currentPosition = SelectorPosition.music; volumeSelector.transform.localScale = Vector3.zero; musicSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.music) { currentPosition = SelectorPosition.audioBack; audioBackBtn.Select(); musicSelector.transform.localScale = Vector3.zero; } else if (currentPosition == SelectorPosition.audioBack) { currentPosition = SelectorPosition.volume; DeselectAll(); volumeSelector.transform.localScale = Vector3.one; } } else if (menuControls.activeSelf && controlsOpacSlider) { if (currentPosition == SelectorPosition.controlsOpacity) { currentPosition = SelectorPosition.controlsVibrate; controlsOpaSelector.transform.localScale = Vector3.zero; controlsVibSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.controlsVibrate) { currentPosition = SelectorPosition.controlsDescription; controlsVibSelector.transform.localScale = Vector3.zero; controlsDescSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.controlsDescription) { currentPosition = SelectorPosition.controlsBack; controlsDescSelector.transform.localScale = Vector3.zero; controlsBackBtn.Select(); } else if (currentPosition == SelectorPosition.controlsBack) { currentPosition = SelectorPosition.controlsOpacity; DeselectAll(); controlsOpaSelector.transform.localScale = Vector3.one; } } else if (menuMuor.activeSelf) { if (currentPosition == SelectorPosition.credits) { currentPosition = SelectorPosition.muorBack; muorBackBtn.Select(); } else if (currentPosition == SelectorPosition.muorBack) { currentPosition = SelectorPosition.credits; muorCreditsBtn.Select(); } } } else if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow) || bControllerUp) { bControllerUp = false; if (menuMain.activeSelf) { if (currentPosition == SelectorPosition.goOn) { currentPosition = SelectorPosition.end; mainEndBtn.Select(); } else if (currentPosition == SelectorPosition.options) { currentPosition = SelectorPosition.goOn; mainGoOnBtn.Select(); } else if (currentPosition == SelectorPosition.end) { currentPosition = SelectorPosition.options; mainOptionsBtn.Select(); } } else if (menuOptions.activeSelf) { if (currentPosition == SelectorPosition.audio) { currentPosition = SelectorPosition.back; optsBackBtn.Select(); } else if (currentPosition == SelectorPosition.controls) { currentPosition = SelectorPosition.audio; optsAudioBtn.Select(); } else if (currentPosition == SelectorPosition.muor) { currentPosition = SelectorPosition.controls; optsControlsBtn.Select(); } else if (currentPosition == SelectorPosition.back) { currentPosition = SelectorPosition.muor; optsMuorBtn.Select(); } } else if (menuAudio.activeSelf) { if (currentPosition == SelectorPosition.volume) { currentPosition = SelectorPosition.audioBack; volumeSelector.transform.localScale = Vector3.zero; audioBackBtn.Select(); } else if (currentPosition == SelectorPosition.music) { currentPosition = SelectorPosition.volume; musicSelector.transform.localScale = Vector3.zero; volumeSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.audioBack) { currentPosition = SelectorPosition.music; DeselectAll(); musicSelector.transform.localScale = Vector3.one; } } else if (menuControls.activeSelf && controlsOpacSlider) { if (currentPosition == SelectorPosition.controlsOpacity) { currentPosition = SelectorPosition.controlsBack; controlsOpaSelector.transform.localScale = Vector3.zero; controlsBackBtn.Select(); } else if (currentPosition == SelectorPosition.controlsVibrate) { currentPosition = SelectorPosition.controlsOpacity; controlsVibSelector.transform.localScale = Vector3.zero; controlsOpaSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.controlsDescription) { currentPosition = SelectorPosition.controlsVibrate; controlsDescSelector.transform.localScale = Vector3.zero; controlsVibSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.controlsBack) { currentPosition = SelectorPosition.controlsDescription; DeselectAll(); controlsDescSelector.transform.localScale = Vector3.one; } } else if (menuMuor.activeSelf) { if (currentPosition == SelectorPosition.credits) { currentPosition = SelectorPosition.muorBack; muorBackBtn.Select(); } else if (currentPosition == SelectorPosition.muorBack) { currentPosition = SelectorPosition.credits; muorCreditsBtn.Select(); } } } else if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow) || bControllerLeft) { bControllerLeft = false; if (currentPosition == SelectorPosition.volume) { vMan.LowerVolume(); vMan.AdjustSliders(); } else if (currentPosition == SelectorPosition.music) { vMan.LowerMusic(); vMan.AdjustSliders(); } else if (currentPosition == SelectorPosition.controlsOpacity) { touches.DecreaseOpacity(); touches.AdjustSlider(); } } else if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow) || bControllerRight) { bControllerRight = false; if (currentPosition == SelectorPosition.volume) { vMan.RaiseVolume(); vMan.AdjustSliders(); } else if (currentPosition == SelectorPosition.music) { vMan.RaiseMusic(); vMan.AdjustSliders(); } else if (currentPosition == SelectorPosition.controlsOpacity) { touches.IncreaseOpacity(); touches.AdjustSlider(); } } else if (Input.GetButtonDown("Action") || contSupp.ControllerButtonPadBottom("down")) { if (currentPosition == SelectorPosition.goOn) { mainGoOnBtn.onClick.Invoke(); //scriptMan.ResetParameters("TD_SBF_ModeSelector"); } else if (currentPosition == SelectorPosition.options) { mainOptionsBtn.onClick.Invoke(); DeselectAll(); currentPosition = SelectorPosition.audio; optsAudioBtn.Select(); } else if (currentPosition == SelectorPosition.end) { mainEndBtn.onClick.Invoke(); DeselectAll(); } else if (currentPosition == SelectorPosition.audio) { optsAudioBtn.onClick.Invoke(); DeselectAll(); currentPosition = SelectorPosition.volume; volumeSelector.transform.localScale = Vector3.one; } else if (currentPosition == SelectorPosition.controls) { optsControlsBtn.onClick.Invoke(); DeselectAll(); if (controlsOpacSlider) { currentPosition = SelectorPosition.controlsOpacity; controlsOpaSelector.transform.localScale = Vector3.one; } else { currentPosition = SelectorPosition.controlsBack; controlsBackBtn.Select(); } } else if (currentPosition == SelectorPosition.muor) { optsMuorBtn.onClick.Invoke(); DeselectAll(); currentPosition = SelectorPosition.credits; muorCreditsBtn.Select(); } else if (currentPosition == SelectorPosition.back) { optsBackBtn.onClick.Invoke(); DeselectAll(); currentPosition = SelectorPosition.goOn; mainGoOnBtn.Select(); } else if (currentPosition == SelectorPosition.audioBack) { audioBackBtn.onClick.Invoke(); DeselectAll(); currentPosition = SelectorPosition.audio; optsAudioBtn.Select(); } else if (currentPosition == SelectorPosition.controlsVibrate) { controlsVibToggle.isOn = !controlsVibToggle.isOn; touches.ToggleVibrate(); touches.Vibrate(); } else if (currentPosition == SelectorPosition.controlsBack) { controlsBackBtn.onClick.Invoke(); DeselectAll(); currentPosition = SelectorPosition.controls; optsControlsBtn.Select(); } else if (currentPosition == SelectorPosition.credits) { muorCreditsBtn.onClick.Invoke(); DeselectAll(); currentPosition = SelectorPosition.creditsBack; creditsBackBtn.Select(); } else if (currentPosition == SelectorPosition.muorBack) { muorBackBtn.onClick.Invoke(); DeselectAll(); currentPosition = SelectorPosition.audio; optsAudioBtn.Select(); } else if (currentPosition == SelectorPosition.creditsBack) { creditsBackBtn.onClick.Invoke(); DeselectAll(); currentPosition = SelectorPosition.credits; muorCreditsBtn.Select(); } } else if (contSupp.ControllerButtonPadRight("down")) { DeselectAll(); if (menuMain.activeSelf) { mainGoOnBtn.onClick.Invoke(); } else if (menuOptions.activeSelf) { pause.ToggleOptions(); currentPosition = SelectorPosition.goOn; mainGoOnBtn.Select(); } else if (menuAudio.activeSelf) { pause.ToggleAudio(); currentPosition = SelectorPosition.audio; optsAudioBtn.Select(); } else if (menuControls.activeSelf) { pause.ToggleControls(); currentPosition = SelectorPosition.audio; optsAudioBtn.Select(); } else if (menuMuor.activeSelf) { pause.ToggleMuor(); currentPosition = SelectorPosition.audio; optsAudioBtn.Select(); } else if (menuCredits.activeSelf) { pause.ToggleCredits(); currentPosition = SelectorPosition.credits; muorCreditsBtn.Select(); } } } if (contSupp.ControllerRightJoystickVertical() > 0) { if (menuControls.activeSelf) { if (menuControls.transform.GetChild(0).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMin.y < 0) { menuControls.transform.GetChild(0).GetChild(0).GetChild(0).localPosition = new Vector3( menuControls.transform.GetChild(0).GetChild(0).GetChild(0).localPosition.x, menuControls.transform.GetChild(0).GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(), menuControls.transform.GetChild(0).GetChild(0).GetChild(0).localPosition.z); } else { menuControls.transform.GetChild(0).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMin = new Vector2( menuControls.transform.GetChild(0).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMin.x, 0); } } else if (menuCredits.activeSelf) { if (menuCredits.transform.GetChild(0).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMin.y < 0) { menuCredits.transform.GetChild(0).GetChild(0).GetChild(0).localPosition = new Vector3( menuCredits.transform.GetChild(0).GetChild(0).GetChild(0).localPosition.x, menuCredits.transform.GetChild(0).GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(), menuCredits.transform.GetChild(0).GetChild(0).GetChild(0).localPosition.z); } else { menuCredits.transform.GetChild(0).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMin = new Vector2( menuCredits.transform.GetChild(0).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMin.x, 0); } } } else if (contSupp.ControllerRightJoystickVertical() < 0) { if (menuControls.activeSelf) { if (menuControls.transform.GetChild(0).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMax.y * -1f < 0) { menuControls.transform.GetChild(0).GetChild(0).GetChild(0).localPosition = new Vector3( menuControls.transform.GetChild(0).GetChild(0).GetChild(0).localPosition.x, menuControls.transform.GetChild(0).GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(), menuControls.transform.GetChild(0).GetChild(0).GetChild(0).localPosition.z); } else { menuControls.transform.GetChild(0).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMax = new Vector2( menuControls.transform.GetChild(0).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMax.x, 0); } } else if (menuCredits.activeSelf) { if (menuCredits.transform.GetChild(0).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMax.y * -1f < 0) { menuCredits.transform.GetChild(0).GetChild(0).GetChild(0).localPosition = new Vector3( menuCredits.transform.GetChild(0).GetChild(0).GetChild(0).localPosition.x, menuCredits.transform.GetChild(0).GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(), menuCredits.transform.GetChild(0).GetChild(0).GetChild(0).localPosition.z); } else { menuCredits.transform.GetChild(0).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMax = new Vector2( menuCredits.transform.GetChild(0).GetChild(0).GetChild(0). GetComponent <RectTransform>().offsetMax.x, 0); } } } }
void Update() { // Quick skip on loading screens / scenes if (scene.name == "LogoSplash" && (Input.anyKeyDown || contSupp.ControllerButtonPadBottom("down") || contSupp.ControllerButtonPadRight("down") || contSupp.ControllerMenuRight("down"))) { SceneManager.LoadScene(AlphaLoad); } if (scene.name == "SceneTransitioner") { if (!bLoadScene) { bLoadScene = true; switch (BetaLoad) { case "Chp0": sceneTitle.text = "Chapter 0"; sceneSubtitle.text = "Before the beginning..."; break; case "Chp1": sceneTitle.text = "Chapter 1"; sceneSubtitle.text = "In the beginning..."; break; case "CS_ShadowMonster": sceneTitle.text = "Be a Monster"; sceneSubtitle.text = "Akira's Shadow"; break; case "CS_TreeTunnel": sceneTitle.text = "A Great Tree"; sceneSubtitle.text = "Offering you a branch.."; break; case "CS_TyrannyTunnel": sceneTitle.text = "I'm So Tired"; sceneSubtitle.text = "/u/SnowflakeSorcerer & @TheBirminghamBear"; break; case "CS_Wealthy": sceneTitle.text = "Be Wealthy"; sceneSubtitle.text = "Akira's How To"; break; case "Minesweeper": sceneTitle.text = "Minesweeper"; sceneSubtitle.text = "Boom baby..."; break; case "GuessWhoColluded": sceneTitle.text = "Guess Who"; sceneSubtitle.text = "Colluded..."; break; case "PookieVision": sceneTitle.text = "Pookie Vision"; sceneSubtitle.text = "For the kids.."; break; case "TD_Menu": sceneTitle.text = "TowerDeez"; sceneSubtitle.text = "And it's nuts.."; break; case "TD_SBF_Menu": sceneTitle.text = "Super Best Friends TD"; sceneSubtitle.text = "Hoooooooooooo.."; break; default: sceneTitle.text = "n_n"; sceneSubtitle.text = "Loading some scene..."; break; } StartCoroutine(LoadNewScene()); } if (bLoadScene) { // Animation //sceneSubtitle.color = new Color(sceneSubtitle.color.r, sceneSubtitle.color.g, sceneSubtitle.color.b, Mathf.PingPong(Time.time, 1)); } } }