mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 22:27:45 +08:00
Allow panels to be dragged further outside the game window
This commit is contained in:
parent
b57e5be2e6
commit
86b036095e
@ -154,14 +154,13 @@ namespace UnityExplorer.UI.Panels
|
|||||||
// Prevent panel going oustide screen bounds
|
// Prevent panel going oustide screen bounds
|
||||||
var halfW = Screen.width * 0.5f;
|
var halfW = Screen.width * 0.5f;
|
||||||
var halfH = Screen.height * 0.5f;
|
var halfH = Screen.height * 0.5f;
|
||||||
pos.x = Math.Max(-halfW, Math.Min(pos.x, halfW - panel.rect.width));
|
|
||||||
pos.y = Math.Max(-halfH + panel.rect.height, Math.Min(pos.y, halfH));
|
pos.x = Math.Max(-halfW - panel.rect.width + 50, Math.Min(pos.x, halfW - 50));
|
||||||
|
pos.y = Math.Max(-halfH + 50, Math.Min(pos.y, halfH));
|
||||||
|
|
||||||
panel.localPosition = pos;
|
panel.localPosition = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region Save Data
|
#region Save Data
|
||||||
|
|
||||||
public abstract void DoSaveToConfigElement();
|
public abstract void DoSaveToConfigElement();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user