mirror of
https://github.com/originalnicodr/CinematicUnityExplorer.git
synced 2026-10-10 13:03:15 +08:00
Make UnityExplorer UI scale with higher resolutions.
This commit is contained in:
@@ -79,6 +79,8 @@ namespace UnityExplorer
|
||||
// InspectorManager.Inspect(typeof(Tests.TestClass));
|
||||
|
||||
KeypressListener.Setup();
|
||||
|
||||
MakeUEUIScale();
|
||||
}
|
||||
|
||||
internal static void Update()
|
||||
@@ -193,5 +195,17 @@ namespace UnityExplorer
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private static void MakeUEUIScale(){
|
||||
List<CanvasScaler> canvasScalers = RuntimeHelper.FindObjectsOfTypeAll(typeof(CanvasScaler))
|
||||
.Select(obj => obj.TryCast<CanvasScaler>())
|
||||
.Where(c => c.name.Contains("unityexplorer"))
|
||||
.ToList();
|
||||
|
||||
foreach (CanvasScaler scaler in canvasScalers)
|
||||
{
|
||||
scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user