|
@@ -2,7 +2,6 @@
|
|
|
using FairyGUI;
|
|
|
using Sirenix.Utilities;
|
|
|
using System;
|
|
|
-using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using UnityEngine;
|
|
@@ -86,7 +85,41 @@ namespace ET.Client
|
|
|
|
|
|
private void InitResolutionList(GComboBox list)
|
|
|
{
|
|
|
+#if UNITY_EDITOR
|
|
|
+ list.visible = false;
|
|
|
+#elif UNITY_STANDALONE
|
|
|
+ list.visible = true;
|
|
|
+ int val = GameSetting.Instance.GetInt(GameSetting.Sets.Resolution_int, 0);
|
|
|
+ int select = -1;
|
|
|
+ List<string> showlist = new();
|
|
|
+ foreach (var info in ResolutionInfo.ResolutionList)
|
|
|
+ {
|
|
|
+ showlist.Add(info.ShowName);
|
|
|
+
|
|
|
+ if (select < 0 && val == info.Y)
|
|
|
+ {
|
|
|
+ select = showlist.Count - 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (select < 0)
|
|
|
+ {
|
|
|
+ select = 0;
|
|
|
+ }
|
|
|
+ var cur = ResolutionInfo.ResolutionList[select];
|
|
|
+ Screen.SetResolution(cur.X, cur.Y, false);
|
|
|
+ Log.Debug($"Default resolution x:{cur.X}, y:{cur.Y}");
|
|
|
|
|
|
+ list.items = showlist.ToArray();
|
|
|
+ list.selectedIndex = select;
|
|
|
+ list.onChanged.Set(() =>
|
|
|
+ {
|
|
|
+ var info = ResolutionInfo.ResolutionList[list.selectedIndex];
|
|
|
+ GameSetting.Instance.SetInt(GameSetting.Sets.Resolution_int, info.Y);
|
|
|
+
|
|
|
+ Screen.SetResolution(info.X, info.Y, false);
|
|
|
+ Log.Debug($"SetResolution x:{info.X}, y:{info.Y}");
|
|
|
+ });
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
private void InitLogin(Scene scene, GComponent view)
|