上海虹口龙之梦项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

259 lines
8.1 KiB

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