void Awake() { if (instance == null) { instance = this; } else if (instance != this) { DestroyImmediate(this.gameObject); } }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { DestroyImmediate(this.gameObject); } #if !UNITY_EDITOR if (SystemInfo.deviceModel.Contains("iPad") || (Application.platform != RuntimePlatform.IPhonePlayer && DeviceDiagonalSizeInInches() >= 7.5f)) { Debug.Log("This is a tablet!"); deviceIsTablet = true; } #else deviceIsTablet = false; #endif }