mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-01-07 10:03:38 +08:00
fix typo mistake in previous version
This commit is contained in:
parent
d919497e43
commit
31c2debb78
@ -135,13 +135,11 @@ namespace UnityExplorer.Core.Config
|
|||||||
ret.y = float.Parse(split[1], _enCulture);
|
ret.y = float.Parse(split[1], _enCulture);
|
||||||
ret.z = float.Parse(split[2], _enCulture);
|
ret.z = float.Parse(split[2], _enCulture);
|
||||||
ret.w = float.Parse(split[3], _enCulture);
|
ret.w = float.Parse(split[3], _enCulture);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
Window_Anchors = DEFAULT_WINDOW_ANCHORS;
|
return DefaultWindowAnchors();
|
||||||
return new Vector4(0.25f, 0.1f, 0.78f, 0.95f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +151,7 @@ namespace UnityExplorer.Core.Config
|
|||||||
return string.Format(_enCulture, "{0},{1},{2},{3}", new object[]
|
return string.Format(_enCulture, "{0},{1},{2},{3}", new object[]
|
||||||
{
|
{
|
||||||
rect.anchorMin.x,
|
rect.anchorMin.x,
|
||||||
rect.anchorMax.y,
|
rect.anchorMin.y,
|
||||||
rect.anchorMax.x,
|
rect.anchorMax.x,
|
||||||
rect.anchorMax.y
|
rect.anchorMax.y
|
||||||
});
|
});
|
||||||
@ -163,5 +161,11 @@ namespace UnityExplorer.Core.Config
|
|||||||
return DEFAULT_WINDOW_ANCHORS;
|
return DEFAULT_WINDOW_ANCHORS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static Vector4 DefaultWindowAnchors()
|
||||||
|
{
|
||||||
|
Instance.Window_Anchors = DEFAULT_WINDOW_ANCHORS;
|
||||||
|
return new Vector4(0.25f, 0.1f, 0.78f, 0.95f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -151,11 +151,14 @@ namespace UnityExplorer.UI.Main
|
|||||||
MainPanel = UIFactory.CreatePanel(UIManager.CanvasRoot, "MainMenu", out GameObject content);
|
MainPanel = UIFactory.CreatePanel(UIManager.CanvasRoot, "MainMenu", out GameObject content);
|
||||||
|
|
||||||
RectTransform panelRect = MainPanel.GetComponent<RectTransform>();
|
RectTransform panelRect = MainPanel.GetComponent<RectTransform>();
|
||||||
//panelRect.anchorMin = new Vector2(0.25f, 0.1f);
|
|
||||||
//panelRect.anchorMax = new Vector2(0.78f, 0.95f);
|
|
||||||
var anchors = ExplorerConfig.Instance.GetWindowAnchorsVector();
|
var anchors = ExplorerConfig.Instance.GetWindowAnchorsVector();
|
||||||
panelRect.anchorMin = new Vector2(anchors.x, anchors.y);
|
SetPanelAnchors(panelRect, anchors);
|
||||||
panelRect.anchorMax = new Vector2(anchors.z, anchors.w);
|
|
||||||
|
if (panelRect.rect.width < 400 || panelRect.rect.height < 400)
|
||||||
|
{
|
||||||
|
anchors = ExplorerConfig.DefaultWindowAnchors();
|
||||||
|
SetPanelAnchors(panelRect, anchors);
|
||||||
|
}
|
||||||
|
|
||||||
MainPanel.AddComponent<Mask>();
|
MainPanel.AddComponent<Mask>();
|
||||||
|
|
||||||
@ -168,6 +171,12 @@ namespace UnityExplorer.UI.Main
|
|||||||
new DebugConsole(content);
|
new DebugConsole(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetPanelAnchors(RectTransform panelRect, Vector4 anchors)
|
||||||
|
{
|
||||||
|
panelRect.anchorMin = new Vector2(anchors.x, anchors.y);
|
||||||
|
panelRect.anchorMax = new Vector2(anchors.z, anchors.w);
|
||||||
|
}
|
||||||
|
|
||||||
private void ConstructTitleBar(GameObject content)
|
private void ConstructTitleBar(GameObject content)
|
||||||
{
|
{
|
||||||
// Core title bar holder
|
// Core title bar holder
|
||||||
|
Loading…
x
Reference in New Issue
Block a user