mirror of
https://github.com/Xevion/Boids.git
synced 2025-12-06 15:14:26 -06:00
update project to include Graphy asset, add adjustments panel close button and tweak sliders to near perfection, small formatting/doc changes to UIController.cs
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -5,10 +5,6 @@ using UnityEngine;
|
|||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class UIController : MonoBehaviour {
|
public class UIController : MonoBehaviour {
|
||||||
public Canvas canvas;
|
|
||||||
|
|
||||||
public BoidController boidController;
|
|
||||||
|
|
||||||
// Main Title Screen Elements
|
// Main Title Screen Elements
|
||||||
public Button startButton;
|
public Button startButton;
|
||||||
public Button settingsButton;
|
public Button settingsButton;
|
||||||
@@ -21,19 +17,27 @@ public class UIController : MonoBehaviour {
|
|||||||
|
|
||||||
// Adjustment Panel Elements
|
// Adjustment Panel Elements
|
||||||
public RectTransform adjPanel;
|
public RectTransform adjPanel;
|
||||||
|
public Button adjCloseButton;
|
||||||
|
|
||||||
// Settings Panel Elements
|
// Settings Panel Elements
|
||||||
public RectTransform settingsPanel;
|
public RectTransform settingsPanel;
|
||||||
public Button settingsCloseButton;
|
public Button settingsCloseButton;
|
||||||
|
|
||||||
// Element Groups
|
// Element Groups (populated on Start)
|
||||||
private GameObject[] _titleElements;
|
private GameObject[] _titleElements;
|
||||||
|
|
||||||
|
// Misc Elements/Cached Objects
|
||||||
|
public Canvas canvas;
|
||||||
|
public BoidController boidController;
|
||||||
private UIStance _currentUI;
|
private UIStance _currentUI;
|
||||||
private CanvasScaler _scaler;
|
private CanvasScaler _scaler;
|
||||||
private Rect _canvasRect;
|
private Rect _canvasRect;
|
||||||
private float _scaleFactor;
|
private float _scaleFactor;
|
||||||
private int _activeTweens;
|
private int _activeTweens;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// returns <c>True</c> when the UI Stance is locked due to active tweening animations
|
||||||
|
/// </summary>
|
||||||
private bool UILock => _activeTweens > 0;
|
private bool UILock => _activeTweens > 0;
|
||||||
|
|
||||||
// Element Displacements
|
// Element Displacements
|
||||||
@@ -84,6 +88,7 @@ public class UIController : MonoBehaviour {
|
|||||||
aboutCloseButton.onClick.AddListener(() => ChangeStance(UIStance.Title));
|
aboutCloseButton.onClick.AddListener(() => ChangeStance(UIStance.Title));
|
||||||
settingsButton.onClick.AddListener(() => ChangeStance(UIStance.Settings));
|
settingsButton.onClick.AddListener(() => ChangeStance(UIStance.Settings));
|
||||||
settingsCloseButton.onClick.AddListener(() => ChangeStance(UIStance.Title));
|
settingsCloseButton.onClick.AddListener(() => ChangeStance(UIStance.Title));
|
||||||
|
adjCloseButton.onClick.AddListener(() => ChangeStance(UIStance.Title));
|
||||||
|
|
||||||
// Calculate UI position deltas
|
// Calculate UI position deltas
|
||||||
_aboutDiff = new Vector3(_canvasRect.size.x * _scaleFactor, 0, 0);
|
_aboutDiff = new Vector3(_canvasRect.size.x * _scaleFactor, 0, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user