77 lines
1.5 KiB
C#
77 lines
1.5 KiB
C#
// ***********************************************************************
|
|
// Assembly : Game
|
|
// Author : Kimch
|
|
// Created : 2021-06-24
|
|
// Description :
|
|
// Last Modified By :
|
|
// Last Modified On :
|
|
// ***********************************************************************
|
|
// <copyright file= "SettingProxy" company="Kunpo"></copyright>
|
|
// <summary></summary>
|
|
// ***********************************************************************
|
|
|
|
using F;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace G
|
|
{
|
|
/// <summary>
|
|
/// 设置代理
|
|
/// </summary>
|
|
public class SettingProxy : GameProxy
|
|
{
|
|
#region Field
|
|
|
|
public bool lowEffect
|
|
{
|
|
get { return QualityProxy.Instance.qualityLevel == QualityProxy.QualityLevel.Low; }
|
|
set
|
|
{
|
|
QualityProxy.Instance.SetQualityLevel(value ? QualityProxy.QualityLevel.Low : QualityProxy.QualityLevel.High);
|
|
}
|
|
}
|
|
|
|
private bool _screenFit;
|
|
public bool screenFit
|
|
{
|
|
get { return _screenFit; }
|
|
set
|
|
{
|
|
if (_screenFit != value)
|
|
{
|
|
_screenFit = value;
|
|
if (UIHelper.Instance)
|
|
UIHelper.Instance.SetSafeRatio(value ? 1f : 0f);
|
|
PlayerPrefs.SetInt("screen_f", value ? 1 : 0);
|
|
PlayerPrefs.Save();
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Method
|
|
|
|
#endregion
|
|
|
|
#region Unity
|
|
|
|
public static SettingProxy Instance;
|
|
|
|
// Use this for initialization
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
public override void LoadCompleted()
|
|
{
|
|
this.screenFit = PlayerPrefs.GetInt("screen_f", 1) == 1;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|