mirror of
https://github.com/Xevion/Boids.git
synced 2025-12-06 05:14:27 -06:00
@@ -77,7 +77,7 @@ public class UIController : MonoBehaviour {
|
|||||||
private void Start() {
|
private void Start() {
|
||||||
// Set Target Application Framerate
|
// Set Target Application Framerate
|
||||||
Application.targetFrameRate = 90;
|
Application.targetFrameRate = 90;
|
||||||
|
|
||||||
// Basic variable setup
|
// Basic variable setup
|
||||||
_currentUI = UIStance.Title;
|
_currentUI = UIStance.Title;
|
||||||
_scaler = canvas.GetComponent<CanvasScaler>();
|
_scaler = canvas.GetComponent<CanvasScaler>();
|
||||||
@@ -116,7 +116,15 @@ public class UIController : MonoBehaviour {
|
|||||||
private void Update() {
|
private void Update() {
|
||||||
// on Escape key, attempts to change UI stance to the Title Screen
|
// on Escape key, attempts to change UI stance to the Title Screen
|
||||||
if (Input.GetKeyDown(KeyCode.Escape))
|
if (Input.GetKeyDown(KeyCode.Escape))
|
||||||
ChangeStance(UIStance.Title);
|
if (_currentUI == UIStance.PlayHidden)
|
||||||
|
ChangeStance(UIStance.PlayAdjust);
|
||||||
|
else
|
||||||
|
ChangeStance(UIStance.Title);
|
||||||
|
else if (Input.GetKeyDown(KeyCode.LeftAlt))
|
||||||
|
if (_currentUI == UIStance.PlayAdjust)
|
||||||
|
ChangeStance(UIStance.PlayHidden);
|
||||||
|
else if (_currentUI == UIStance.PlayHidden)
|
||||||
|
ChangeStance(UIStance.PlayAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -170,12 +178,12 @@ public class UIController : MonoBehaviour {
|
|||||||
ShowBoidsTitle(true);
|
ShowBoidsTitle(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Settings/About/Play -> Title
|
// Settings/About/PlayAdjust -> Title
|
||||||
else if (stance == UIStance.Title) {
|
else if (stance == UIStance.Title) {
|
||||||
MoveElements(UIGroup.TitleScreen, false);
|
MoveElements(UIGroup.TitleScreen, false);
|
||||||
if (_currentUI == UIStance.PlayAdjust) {
|
if (_currentUI == UIStance.PlayAdjust) {
|
||||||
MoveElements(UIGroup.AdjustmentsScreen, true);
|
MoveElements(UIGroup.AdjustmentsScreen, true);
|
||||||
if(!showBoidsOnTitleToggle.isOn)
|
if (!showBoidsOnTitleToggle.isOn)
|
||||||
ShowBoidsTitle(false);
|
ShowBoidsTitle(false);
|
||||||
}
|
}
|
||||||
else if (_currentUI == UIStance.Settings)
|
else if (_currentUI == UIStance.Settings)
|
||||||
@@ -183,6 +191,14 @@ public class UIController : MonoBehaviour {
|
|||||||
else if (_currentUI == UIStance.About)
|
else if (_currentUI == UIStance.About)
|
||||||
MoveElements(UIGroup.AboutScreen, true);
|
MoveElements(UIGroup.AboutScreen, true);
|
||||||
}
|
}
|
||||||
|
// PlayAdjust -> PlayHidden
|
||||||
|
else if (stance == UIStance.PlayHidden && _currentUI == UIStance.PlayAdjust) {
|
||||||
|
MoveElements(UIGroup.AdjustmentsScreen, true);
|
||||||
|
}
|
||||||
|
// PlayHidden -> PlayAdjust
|
||||||
|
else if (stance == UIStance.PlayAdjust && _currentUI == UIStance.PlayHidden) {
|
||||||
|
MoveElements(UIGroup.AdjustmentsScreen, false);
|
||||||
|
}
|
||||||
|
|
||||||
_currentUI = stance;
|
_currentUI = stance;
|
||||||
}
|
}
|
||||||
@@ -245,7 +261,7 @@ public class UIController : MonoBehaviour {
|
|||||||
|
|
||||||
private void ShowBoidsTitle(bool active) {
|
private void ShowBoidsTitle(bool active) {
|
||||||
ShowBoids(active);
|
ShowBoids(active);
|
||||||
|
|
||||||
// Works somewhat close to what is needed, but needs a fix.
|
// Works somewhat close to what is needed, but needs a fix.
|
||||||
// if (!active) {
|
// if (!active) {
|
||||||
// print("Fading out");
|
// print("Fading out");
|
||||||
@@ -262,7 +278,7 @@ public class UIController : MonoBehaviour {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void ShowBoids(bool show) {
|
private void ShowBoids(bool show) {
|
||||||
foreach(MeshRenderer meshRenderer in boidController.gameObject.GetComponentsInChildren<MeshRenderer>())
|
foreach (MeshRenderer meshRenderer in boidController.gameObject.GetComponentsInChildren<MeshRenderer>())
|
||||||
meshRenderer.enabled = show;
|
meshRenderer.enabled = show;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user