DisableGoogleAuthOnIos.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class DisableGoogleAuthOnIos : MonoBehaviour
  5. {
  6. public GameObject googleButton;
  7. int leftCornerPresses;
  8. int rightCornerPresses;
  9. int leftXPos = Screen.width / 5;
  10. int rightXPos = Screen.width - Screen.width / 5;
  11. int yPos = Screen.height - Screen.height / 4;
  12. void Start()
  13. {
  14. //googleButton.SetActive(false);// Application.platform != RuntimePlatform.IPhonePlayer);
  15. leftCornerPresses = rightCornerPresses = 0;
  16. //googleButton.SetActive(false);// Application.platform != RuntimePlatform.IPhonePlayer);
  17. //google2Button.SetActive(false);// Application.platform != RuntimePlatform.IPhonePlayer);
  18. //googleButtonLast.SetActive(false);// Application.platform != RuntimePlatform.IPhonePlayer);
  19. }
  20. private void Update()
  21. {
  22. //CheckPress();
  23. // Feature for
  24. //#if !UNITY_EDITOR && UNITY_ANDROID
  25. // if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)
  26. // {
  27. // CheckPressInRect(Input.GetTouch(0).position);
  28. // }
  29. //#elif UNITY_EDITOR
  30. // if (Input.GetButtonDown("Fire1"))
  31. // {
  32. // CheckPressInRect(Input.mousePosition);
  33. // }
  34. //#endif
  35. }
  36. private void CheckPressInRect(Vector2 _pos)
  37. {
  38. if (_pos.x < leftXPos && _pos.y >= yPos)
  39. {
  40. if (leftCornerPresses < 6)
  41. {
  42. ++leftCornerPresses;
  43. Debug.Log("Now left corner pressed: " + leftCornerPresses);
  44. }
  45. }
  46. if (_pos.x > rightXPos && _pos.y >= yPos)
  47. {
  48. if (leftCornerPresses >= 6 && rightCornerPresses < 6)
  49. {
  50. ++rightCornerPresses;
  51. Debug.Log("Now right corner pressed: " + rightCornerPresses);
  52. }
  53. }
  54. if (leftCornerPresses >= 6 && rightCornerPresses >= 6)
  55. {
  56. googleButton.SetActive(true);
  57. }
  58. }
  59. }