public static bool GetCameraRight(bool isDraging = false) { #if UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_EDITOR if (Input.GetKey(KeyCode.RightArrow) || Input.GetKey(KeyCode.D)) { return(true); } else if (isDraging && Input.mousePosition.x > Camera.main.pixelWidth * 0.98f) { return(true); } #else if (GlobalInputs.GetSwipe(Vector2.left, true)) { return(true); } else if (Input.touchCount == 1 && isDraging && Input.GetTouch(0).position.x > Camera.main.pixelWidth * 0.98f) { return(true); } #endif return(false); }
public static bool GetCameraDown(bool isDraging = false) { #if UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_EDITOR if (Input.GetKey(KeyCode.DownArrow) || Input.GetKey(KeyCode.S)) { return(true); } else if (isDraging && Input.mousePosition.y < Camera.main.pixelHeight * 0.02f) { return(true); } #else if (GlobalInputs.GetSwipe(Vector2.up, true)) { return(true); } else if (Input.touchCount == 1 && isDraging && Input.GetTouch(0).position.y < Camera.main.pixelHeight * 0.02f) { return(true); } #endif return(false); }