void Update() { if (currentScreenSize.x != Screen.width || currentScreenSize.y != Screen.height) { RefreshScreenSetting(); } if (!Application.isPlaying) { Instance = this; } }
void Awake() { MobileType = GetDeviceType(); if (Instance == null) { Instance = this; if (!Application.isPlaying) { return; } if (SystemInfo.systemMemorySize < 3500) { LowRam = true; } if (nativeResolution == Vector2.zero) { nativeResolution = new Vector2(Screen.currentResolution.width, Screen.currentResolution.height); } LowGraphicCard = new List <string>(); LowGraphicCard.Add("Mali-T628".ToLower()); LowGraphicCard.Add("Mali-T830".ToLower()); QualityInfo = new PerformanceQualityInfo(); QualityInfo.QualityLevel = 2; //2 = high //1 = medium //0 = low //fps counter always invisible if in production FpsCounter.enabled = ShowFps; #if !UNITY_EDITOR FpsCounter.enabled = false; #endif QualitySettings.vSyncCount = 0; // VSync must be disabled Application.targetFrameRate = 60; //QualityInfo.QualityLevel = QualitySettings.GetQualityLevel(); QualitySettings.asyncUploadTimeSlice = 8; QualitySettings.asyncUploadBufferSize = 16; QualitySettings.asyncUploadPersistentBuffer = true; //we just evaluate first time moron i am //if (GameData.Current.MetaDataState.SettingState.Graphic == -1) //EvaluateQuality(); //here for now //EvaluateQuality(); } else { Destroy(this); } }