public void SwitchToggle() { isOn = !isOn; myImg.sprite = isOn ? onSprite : offSprite; onToggle.Invoke(isOn); CrossPlatformInputManager.SetButtonDown("Dir"); StartCoroutine("ResetDirButon"); }
// Normal button events void OnPowerButtonDown(GameObject sender) { if (sender == powerButton.gameObject && CrossPlatformInputManager.ButtonExists(powerButton.GetButtonName())) { #if MOBILE_INPUT CrossPlatformInputManager.SetButtonDown(powerButton.GetButtonName()); #endif } }
// Update is called once per frame void Update() { if (Input.GetKeyDown(keyboardButton)) { CrossPlatformInputManager.SetButtonDown(crossplatformInputButtonName); } else if (Input.GetKeyUp(keyboardButton)) { CrossPlatformInputManager.SetButtonUp(crossplatformInputButtonName); } }
public void OnPointerDown(PointerEventData data) { CrossPlatformInputManager.SetButtonDown(ButtonName); BaseImage.gameObject.SetActive(true); BaseImage.position = data.position; mDragging = true; mId = data.pointerId; if (Style != ControlStyle.Absolute) { mCenter = data.position; } }
void DoSetButton() { #if CROSS_PLATFORM_INPUT if (value.Value) { CrossPlatformInputManager.SetButtonUp(buttonName.Value); } else { CrossPlatformInputManager.SetButtonDown(buttonName.Value); } #endif }
public void SetDownState() { if (!isInUse) { CrossPlatformInputManager.SetButtonDown(Name); isInUse = true; } else { isInUse = false; CrossPlatformInputManager.SetButtonUp(Name); } }
// Update is called once per frame void Update() { //Check if the left button is pressed lPressed = leftButton.GetComponent <LeftButtonScript>().getPressed(); // If either button are pressed and the button is hovered over then set button to down if ((lPressed || pressed) && hover) { CrossPlatformInputManager.SetButtonDown(Name); } else { CrossPlatformInputManager.SetButtonUp(Name); } }
private void Update() { //Debug.Log("Update " + joystick.Vertical + " " + _verticalAxisPressed + " " + _verticalAxisReset); if (joystick.Vertical <= 0) { _verticalAxisReset = true; } if (joystick.Vertical > 0 && !_verticalAxisPressed && _verticalAxisReset) { _verticalAxisPressed = true; _verticalAxisReset = false; CrossPlatformInputManager.SetButtonDown("Jump"); } CrossPlatformInputManager.SetAxis("Horizontal", joystick.Horizontal); }
public void OnPointerDown(PointerEventData eventData) { if (_activated && !isOnTouch) { pointId = eventData.pointerId; axis.ResetAxis(); axis.axisState = ETCAxis.AxisState.Down; isOnPress = false; isOnTouch = true; onDown.Invoke(); ApllyState(); axis.UpdateButton(); // modified by cat heaven CrossPlatformInputManager.SetButtonDown(axis.unityAxis); // modified by cat heaven } }
void NegVTriggerButtonDown(GameObject sender) { if (powerType == PowerType.Joystick) { if (sender == powerJoystick.gameObject && CrossPlatformInputManager.ButtonExists(powerJoystick.GetVNegButtonName())) { #if MOBILE_INPUT CrossPlatformInputManager.SetButtonDown(powerJoystick.GetVNegButtonName()); #endif } } if (powerType == PowerType.DPad) { if (sender == powerDPad.gameObject && CrossPlatformInputManager.ButtonExists(powerDPad.GetVNegButtonName())) { #if MOBILE_INPUT CrossPlatformInputManager.SetButtonDown(powerDPad.GetVNegButtonName()); #endif } } }
// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { downPos = Input.mousePosition; } else if (Input.GetMouseButtonUp(0)) { if (downPos != Vector3.zero) { Vector3 move = Input.mousePosition - downPos; if (Mathf.Abs(move.x) > Mathf.Abs(move.y)) { if (move.x > 0) { CrossPlatformInputManager.SetButtonDown(CrossPlatformInput.RIGHT); } else { CrossPlatformInputManager.SetButtonDown(CrossPlatformInput.LEFT); } } else { if (move.y > 0) { CrossPlatformInputManager.SetButtonDown(CrossPlatformInput.UP); } else { CrossPlatformInputManager.SetButtonDown(CrossPlatformInput.DOWN); } } } downPos = Vector3.zero; } }
void Update() { if (Input.GetKey("space")) { CrossPlatformInputManager.SetButtonDown("Jump"); } else { CrossPlatformInputManager.SetButtonUp("Jump"); } if (Input.GetKey("c")) { CrossPlatformInputManager.SetButtonDown("Sneak"); } else { CrossPlatformInputManager.SetButtonUp("Sneak"); } CrossPlatformInputManager.SetAxis("Horizontal", Input.GetAxis("Horizontal")); CrossPlatformInputManager.SetAxis("Vertical", Input.GetAxis("Vertical")); }
// Update is called once per frame void Update() { if (Input.touchCount > 0) { if (Input.GetTouch(0).phase == TouchPhase.Began) { downPos = Input.GetTouch(0).position; } else if (Input.GetTouch(0).phase == TouchPhase.Ended) { Vector2 move = Input.GetTouch(0).position - downPos; if (Mathf.Abs(move.x) > Mathf.Abs(move.y)) { if (move.x > 0) { CrossPlatformInputManager.SetButtonDown(CrossPlatformInput.RIGHT); } else { CrossPlatformInputManager.SetButtonDown(CrossPlatformInput.LEFT); } } else { if (move.y > 0) { CrossPlatformInputManager.SetButtonDown(CrossPlatformInput.UP); } else { CrossPlatformInputManager.SetButtonDown(CrossPlatformInput.DOWN); } } } } }
//called by pressing the icon in the top left public void RemoveMorph() { //if (CrossPlatformInputManager.AxisExists ("Shake")) { CrossPlatformInputManager.SetButtonDown("Shake"); //} }
/// <summary> /// presses the endturn button down /// </summary> public void Button_End_Turn_Down() { CrossPlatformInputManager.SetButtonDown("endturn"); }
public void SetDownState() { CrossPlatformInputManager.SetButtonDown(Name); }
public void OnPointerDown(PointerEventData eventData) { CrossPlatformInputManager.SetButtonDown(buttonName); }
public void OnPointerDown(PointerEventData eventData) { print("down registered"); CrossPlatformInputManager.SetButtonDown(Name); }
public void Jump() { Debug.Log("in jump CustomControllerScript"); CrossPlatformInputManager.SetButtonDown("Jump"); }
public void Attack() { SwingAudioSrc.Play(); CrossPlatformInputManager.SetButtonDown("attack"); CrossPlatformInputManager.SetButtonUp("attack"); }
public void OnColorChangeButtonPressed() { CrossPlatformInputManager.SetButtonDown("ColorChange"); _colorChangeButtonPressed = true; }