|
@@ -3,6 +3,7 @@ using System;
|
|
|
using FairyGUI;
|
|
|
using System.Linq;
|
|
|
using ET;
|
|
|
+using UnityEngine;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
@@ -112,6 +113,21 @@ namespace GFGGame
|
|
|
_floatLayer.AddChild(gObject);
|
|
|
}
|
|
|
|
|
|
+ public static float ViewWidth
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ //这里做了最大宽度适配
|
|
|
+ float maxAspectRatio = 1080 * 1.0f / 1920;
|
|
|
+ if (Screen.width * 1.0f / Screen.height > maxAspectRatio)
|
|
|
+ {
|
|
|
+ return GRoot.inst.height * maxAspectRatio;
|
|
|
+ }
|
|
|
+ return GRoot.inst.width;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 显示一个视图
|
|
|
/// </summary>
|