1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- 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);
- }
- }
- }
|