mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 07:47:38 +02:00
Resource Optimization (#812)
* right foot creep * look around stay low * optimize the fan club prefab use anim layers for the monkeys * dansa med oss * klappa era hander * cossack sandvich * soldier of dance add speed halving / doubling functionality to choreographies * fix selection of starting dance * asset re-organization * organize the last of the 1.0 games * Wall * floating windows can no longer become larger than the actual screen
This commit is contained in:
@ -21,14 +21,16 @@ namespace Rellac.Windows
|
||||
private void Update()
|
||||
{
|
||||
// limit window size
|
||||
float finalMaxWidth = Mathf.Min(maxWidth, Screen.width);
|
||||
float finalMaxHeight = Mathf.Min(maxHeight, Screen.height);
|
||||
RectTransform rectTransform = GetComponent<RectTransform>();
|
||||
if (maxWidth > 0 && rectTransform.rect.width > maxWidth)
|
||||
if (maxWidth > 0 && rectTransform.rect.width > finalMaxWidth)
|
||||
{
|
||||
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, maxWidth);
|
||||
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, finalMaxWidth);
|
||||
}
|
||||
if (maxHeight > 0 && rectTransform.rect.height > maxHeight)
|
||||
if (maxHeight > 0 && rectTransform.rect.height > finalMaxHeight)
|
||||
{
|
||||
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, maxHeight);
|
||||
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, finalMaxHeight);
|
||||
}
|
||||
|
||||
// keep in bounds of parent
|
||||
|
Reference in New Issue
Block a user