public IActionResult SavePlatformSettings([FromBody] PlatformSettingModel model) { if (ModelState.IsValid) { PlatformSetting setting = new PlatformSetting { AppName = model.AppName , VersionNumber = model.AppVersion , DataLogEnabled = model.DataLogEnabled , LogLevel = (LogLevel)model.LogLevel , LogEnabled = model.LogEnabled , ShowMenuInUserPrivileges = model.ShowMenuInUserPrivileges , VerifyCodeEnabled = model.VerifyCodeEnabled , MaxFetchRecords = model.MaxFetchRecords , CacheEnabled = model.CacheEnabled }; return(_settingService.Save(setting).SaveResult(T)); } return(SaveFailure(GetModelErrors())); }
/// <summary> /// Khởi tạo thông tin cài đặt /// </summary> public void Init() { Platform = new PlatformSetting(); if (StoreGame.Contains(StoreGame.EType.FULL_SCREEN)) { IsFullScreen = StoreGame.LoadInt(StoreGame.EType.FULL_SCREEN) == (int)StoreGame.EToggle.ON; } if (StoreGame.Contains(StoreGame.EType.LOCK_SCREEN)) { AllowLockScreen = StoreGame.LoadInt(StoreGame.EType.LOCK_SCREEN) == (int)StoreGame.EToggle.ON; } }
private void SaveSettings() { if (texture == null) { return; } var path = AssetDatabase.GetAssetPath(texture); var textureImporter = AssetImporter.GetAtPath(path) as TextureImporter; if (textureImporter == null) { return; } // ------ TextureSetting ------ textureSetting = new TextureSetting(); textureSetting.readable = textureImporter.isReadable; textureSetting.compression = textureImporter.textureCompression; #if !UNITY_5_5_OR_NEWER textureSetting.format = textureImporter.textureFormat: #endif // ------ PlatformSetting ------ #if UNITY_5_5_OR_NEWER platformSettings = new Dictionary <string, PlatformSetting>(); foreach (var platformName in PlatformNames) { var platformTextureSetting = textureImporter.GetPlatformTextureSettings(platformName); if (platformTextureSetting != null) { var platformSetting = new PlatformSetting(); platformSetting.allowsAlphaSplitting = platformTextureSetting.allowsAlphaSplitting; platformSetting.overridden = platformTextureSetting.overridden; platformSetting.format = platformTextureSetting.format; platformSetting.compressionQuality = platformTextureSetting.compressionQuality; platformSetting.compression = platformTextureSetting.textureCompression; platformSettings.Add(platformName, platformSetting); } } #endif }
public PlatformDependentValue(PlatformCategory t) { this.PCSetting = new PlatformSetting <T>(); this.MacSetting = new PlatformSetting <T>(); this.iOSSetting = new PlatformSetting <T>(); this.AndroidSetting = new PlatformSetting <T>(); this.TabletSetting = new PlatformSetting <T>(); this.MiniTabletSetting = new PlatformSetting <T>(); this.PhoneSetting = new PlatformSetting <T>(); this.MouseSetting = new PlatformSetting <T>(); this.TouchSetting = new PlatformSetting <T>(); this.LowMemorySetting = new PlatformSetting <T>(); this.MediumMemorySetting = new PlatformSetting <T>(); this.HighMemorySetting = new PlatformSetting <T>(); this.NormalScreenDensitySetting = new PlatformSetting <T>(); this.HighScreenDensitySetting = new PlatformSetting <T>(); this.type = t; }
// Use this for initialization static void InitialPlatformSetting() { List <PlatformSetting> _psList = new List <PlatformSetting>(); PlatformSetting _ps19800 = new PlatformSetting(); _ps19800.platformName = "19800"; _ps19800.key = "1"; _ps19800.security = "4"; _psList.Add(_ps19800); PlatformSetting _psjubi = new PlatformSetting(); _psjubi.platformName = "jubi"; _psjubi.key = "1"; _psjubi.security = "4"; _psList.Add(_psjubi); string _json = JsonConvert.SerializeObject(_psList); Debug.Log(_json); CommonTool.CreateFile(Application.persistentDataPath, "platformSettings.json", _json); Debug.Log(CommonTool.ReadFile(Application.persistentDataPath, "platformSettings.json")); }