using System.Collections; using System.Collections.Generic; using UnityEngine; public class DisableGoogleAuthOnIos : MonoBehaviour { public GameObject googleButton; int leftCornerPresses; int rightCornerPresses; int leftXPos = Screen.width / 5; int rightXPos = Screen.width - Screen.width / 5; int yPos = Screen.height - Screen.height / 4; void Start() { //googleButton.SetActive(false);// Application.platform != RuntimePlatform.IPhonePlayer); leftCornerPresses = rightCornerPresses = 0; //googleButton.SetActive(false);// Application.platform != RuntimePlatform.IPhonePlayer); //google2Button.SetActive(false);// Application.platform != RuntimePlatform.IPhonePlayer); //googleButtonLast.SetActive(false);// Application.platform != RuntimePlatform.IPhonePlayer); } private void Update() { //CheckPress(); // Feature for //#if !UNITY_EDITOR && UNITY_ANDROID // if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) // { // CheckPressInRect(Input.GetTouch(0).position); // } //#elif UNITY_EDITOR // if (Input.GetButtonDown("Fire1")) // { // CheckPressInRect(Input.mousePosition); // } //#endif } private void CheckPressInRect(Vector2 _pos) { if (_pos.x < leftXPos && _pos.y >= yPos) { if (leftCornerPresses < 6) { ++leftCornerPresses; Debug.Log("Now left corner pressed: " + leftCornerPresses); } } if (_pos.x > rightXPos && _pos.y >= yPos) { if (leftCornerPresses >= 6 && rightCornerPresses < 6) { ++rightCornerPresses; Debug.Log("Now right corner pressed: " + rightCornerPresses); } } if (leftCornerPresses >= 6 && rightCornerPresses >= 6) { googleButton.SetActive(true); } } }