using System.Collections.Generic; using UniRx; using UnityEngine; public class ResolutionDatas { public List ResList; } public class ResolutionData { public int Width; public int Height; } public class GameSettingData { /// /// 省份 /// public int Province { get; set; } = 0; /// /// 城市 /// public int City { get; set; } = 0; /// /// 城市代码 /// //public string CityCode { get; set; } = "101010100"; /// /// 实时天气 /// public bool RealTimeWeather { get; set; } = true; /// ///天气 /// public int Weather{get;set; } = 0; /// ///温度 /// public int Temperature{get;set;} = 0; /// ///风力 /// public int WindForce{get;set; } = 2; /// ///风向 /// public int WindDirection{get;set;} = 2; /// ///昼夜交替 /// public bool TimeOfDay{get;set;} = false; /// ///持续时间 /// public float Duration{get;set;} = 0.1f; /// ///时间 /// public float Time{get;set;} = 11; /// ///贴图质量 /// public int TextureQuality{get;set;} = 0; /// ///各向异性 /// public int Anisotropic { get; set; } = 1; public int Quality { get; set; } = 1; /// ///阴影开关 /// public bool ShadowSwitch { get; set; } = true; /* /// ///抗锯齿 /// public int Antialiasing{get;set; } = 1; /// ///阴影质量 /// public int ShadowResolution{get;set; } = 1; /// ///阴影距离 /// public int ShadowDistance{get;set;} = 500;*/ /// ///亮度 /// public float Brightness { get; set; } = 0; /// /// 反射 /// public int Reflection { get; set; } = 1; /// ///分辨率 /// public int Resolution{get;set; } = 1; /// ///全屏 /// public bool FullScreen{get;set;} = false; } public class GameSettingDataReactive:ISetData { /// ///Data /// private GameSettingData Data{get;set;}= new GameSettingData(); /// /// 省份 /// public ReactiveProperty Province { get; set; } = new ReactiveProperty(0); /// /// 城市 /// public ReactiveProperty City { get; set; } = new ReactiveProperty(0); /// /// 城市代码 /// //public ReactiveProperty CityCode { get; set; } = new ReactiveProperty("101010100"); /// /// 实时天气 /// public ReactiveProperty RealTimeWeather { get; set; } = new ReactiveProperty(true); /// ///天气 /// public ReactiveProperty Weather{get;set;}= new ReactiveProperty(0); /// ///温度 /// public ReactiveProperty Temperature{get;set;}= new ReactiveProperty(0); /// ///风力 /// public ReactiveProperty WindForce{get;set;}= new ReactiveProperty(2); /// ///风向 /// public ReactiveProperty WindDirection{get;set;}= new ReactiveProperty(2); /// ///昼夜交替 /// public ReactiveProperty TimeOfDay{get;set;}= new ReactiveProperty(false); /// ///持续时间 /// public ReactiveProperty Duration{get;set;}= new ReactiveProperty(0.1f); /// ///时间 /// public ReactiveProperty Time{get;set;}= new ReactiveProperty(11.0f); /// ///贴图质量 /// public ReactiveProperty TextureQuality{get;set;}= new ReactiveProperty(0); /// ///各向异性 /// public ReactiveProperty Anisotropic { get; set; } = new ReactiveProperty(1); public ReactiveProperty Quality { get; set; } = new ReactiveProperty(1); /// ///阴影开关 /// public ReactiveProperty ShadowSwitch { get; set; } = new ReactiveProperty(true); /* /// ///抗锯齿 /// public ReactiveProperty Antialiasing{get;set;}= new ReactiveProperty(1); /// ///阴影质量 /// public ReactiveProperty ShadowResolution{get;set;}= new ReactiveProperty(1); /// ///阴影距离 /// public ReactiveProperty ShadowDistance{get;set;}= new ReactiveProperty(500); */ /// ///亮度 /// public ReactiveProperty Brightness { get; set; } = new ReactiveProperty(0); /// /// 反射 /// public ReactiveProperty Reflection { get; set; } = new ReactiveProperty(1); /// ///分辨率 /// public ReactiveProperty Resolution{get;set;}= new ReactiveProperty(1); /// ///全屏 /// public ReactiveProperty FullScreen{get;set;}= new ReactiveProperty(false); public GameSettingDataReactive() { Weather.Subscribe(value => Data.Weather= value); Province.Subscribe(value => Data.Province = value); City.Subscribe(value => Data.City = value); //CityCode.Subscribe(value => Data.CityCode = value); RealTimeWeather.Subscribe(value => Data.RealTimeWeather = value); Temperature.Subscribe(value => Data.Temperature= value); WindForce.Subscribe(value => Data.WindForce= value); WindDirection.Subscribe(value => Data.WindDirection= value); TimeOfDay.Subscribe(value => Data.TimeOfDay= value); Duration.Subscribe(value => Data.Duration= value); Time.Subscribe(value => Data.Time= value); TextureQuality.Subscribe(value => Data.TextureQuality= value); Anisotropic.Subscribe(value => Data.Anisotropic = value); Quality.Subscribe(value => Data.Quality = value); //Antialiasing.Subscribe(value => Data.Antialiasing= value); ShadowSwitch.Subscribe(value => Data.ShadowSwitch = value); //ShadowResolution.Subscribe(value => Data.ShadowResolution= value); //ShadowDistance.Subscribe(value => Data.ShadowDistance= value); Brightness.Subscribe(value => Data.Brightness = value); Reflection.Subscribe(value => Data.Reflection = value); Resolution.Subscribe(value => Data.Resolution= value); FullScreen.Subscribe(value => Data.FullScreen= value); } public void SetData(GameSettingData data) { Data = data; Province.Value = data.Province; City.Value = data.City; //CityCode.Value = data.CityCode; RealTimeWeather.Value = data.RealTimeWeather; Weather.Value = data.Weather; Temperature.Value = data.Temperature; WindForce.Value = data.WindForce; WindDirection.Value = data.WindDirection; TimeOfDay.Value = data.TimeOfDay; Duration.Value = data.Duration; Time.Value = data.Time; TextureQuality.Value = data.TextureQuality; Anisotropic.Value = data.Anisotropic; Quality.Value = data.Quality; //Antialiasing.Value = data.Antialiasing; ShadowSwitch.Value = data.ShadowSwitch; //ShadowResolution.Value = data.ShadowResolution; //ShadowDistance.Value = data.ShadowDistance; Brightness.Value = data.Brightness; Reflection.Value = data.Reflection; #if UNITY_STANDALONEL Resolution.Value = data.Resolution; FullScreen.Value = data.FullScreen; #endif } public GameSettingData GetData() { return Data; } }