game(ui): very-close-to-done ui
This commit is contained in:
parent
417ee5393d
commit
537d2173a3
|
@ -264,7 +264,11 @@ PrefabInstance:
|
|||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 974238578668270704, guid: c708a3b79cd542b42bbfedb17e213bc1,
|
||||
type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 491771526}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: c708a3b79cd542b42bbfedb17e213bc1, type: 3}
|
||||
--- !u!1 &13596640
|
||||
GameObject:
|
||||
|
@ -7346,6 +7350,29 @@ Mesh:
|
|||
offset: 0
|
||||
size: 0
|
||||
path:
|
||||
--- !u!1 &491771518 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 974238578668270704, guid: c708a3b79cd542b42bbfedb17e213bc1,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 1120089}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &491771526
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 491771518}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4995ad0b66292c144ab3819605824571, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
playerPosition: {fileID: 1013448445}
|
||||
interactableDistance: 2
|
||||
raycastLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 439
|
||||
--- !u!43 &554144876
|
||||
Mesh:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -8474,7 +8501,7 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
associatedState: 2
|
||||
mixer: {fileID: 24100000, guid: 7cbb70bac0ada294e87675a4a804cde7, type: 2}
|
||||
mixer: {fileID: 0}
|
||||
--- !u!43 &852189891
|
||||
Mesh:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -9137,6 +9164,12 @@ Mesh:
|
|||
offset: 0
|
||||
size: 0
|
||||
path:
|
||||
--- !u!4 &1013448445 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 5542111180780342647, guid: c708a3b79cd542b42bbfedb17e213bc1,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 1120089}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &1060921175
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -12925,135 +12958,6 @@ MonoBehaviour:
|
|||
m_SelectedFaces:
|
||||
m_SelectedEdges: []
|
||||
m_SelectedVertices:
|
||||
--- !u!1 &1332885280
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1332885282}
|
||||
- component: {fileID: 1332885281}
|
||||
m_Layer: 0
|
||||
m_Name: music
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!82 &1332885281
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1332885280}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 164311610216181747, guid: 7cbb70bac0ada294e87675a4a804cde7,
|
||||
type: 2}
|
||||
m_audioClip: {fileID: 8300000, guid: 5e07e339ddf1eea44b3c4db9a02dd75c, type: 3}
|
||||
m_PlayOnAwake: 1
|
||||
m_Volume: 1
|
||||
m_Pitch: 1
|
||||
Loop: 1
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
Priority: 128
|
||||
DopplerLevel: 1
|
||||
MinDistance: 1
|
||||
MaxDistance: 500
|
||||
Pan2D: 0
|
||||
rolloffMode: 0
|
||||
BypassEffects: 0
|
||||
BypassListenerEffects: 0
|
||||
BypassReverbZones: 0
|
||||
rolloffCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
panLevelCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
spreadCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
reverbZoneMixCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!4 &1332885282
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1332885280}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 483.05478, y: 0.9047287, z: 496.26224}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!43 &1466442468
|
||||
Mesh:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -26462,13 +26366,13 @@ Transform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1226619923}
|
||||
- {fileID: 618797800}
|
||||
- {fileID: 1794617895}
|
||||
- {fileID: 785883831}
|
||||
- {fileID: 1625449502}
|
||||
- {fileID: 395649655}
|
||||
- {fileID: 1826378110}
|
||||
- {fileID: 618797800}
|
||||
- {fileID: 1226619923}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1805235905
|
||||
|
@ -27246,4 +27150,3 @@ SceneRoots:
|
|||
- {fileID: 1060921176}
|
||||
- {fileID: 596429548}
|
||||
- {fileID: 897146492}
|
||||
- {fileID: 1332885282}
|
||||
|
|
|
@ -58,6 +58,7 @@ private void OnTriggerEnter(Collider other)
|
|||
linkedLeapTrigger1.isPlayerInAir = false;
|
||||
if (linkedLeapTrigger2 != null) linkedLeapTrigger2.isPlayerInAir = false;
|
||||
if (linkedLeapTrigger3 != null) linkedLeapTrigger3.isPlayerInAir = false;
|
||||
// TODO: kill player
|
||||
|
||||
GameManager.Instance.SetDisplayState(GameManager.DisplayState.OverlayFailedOverTimeMenu);
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UIElements;
|
||||
using Cursor = UnityEngine.Cursor;
|
||||
|
||||
|
@ -44,6 +45,16 @@ public enum DisplayState
|
|||
/// </summary>
|
||||
[SerializeField] private GameObject guiHudObject;
|
||||
|
||||
/// <summary>
|
||||
/// float to keep track of the elapsed play/run/speeder time
|
||||
/// </summary>
|
||||
private float _elapsedRunTime;
|
||||
|
||||
/// <summary>
|
||||
/// checked when the scene is loaded to restart the game and skip the main menu
|
||||
/// </summary>
|
||||
private bool _restarting;
|
||||
|
||||
/// <summary>
|
||||
/// the current state of the game
|
||||
/// </summary>
|
||||
|
@ -98,12 +109,6 @@ private void Awake()
|
|||
// destroy the new instance if it's not the singleton instance
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
if (guiInteractionPromptObject == null)
|
||||
throw new NullReferenceException("GameManager: guiInteractionPromptObject not set");
|
||||
|
||||
if (guiHudObject == null)
|
||||
throw new NullReferenceException("GameManager: guiHudObject not set");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -112,25 +117,53 @@ private void Awake()
|
|||
// /// <exception cref="Exception">generic exception it couldn't verify a safe state when starting the game</exception>
|
||||
private void Start()
|
||||
{
|
||||
// set to the main menu state
|
||||
if (guiInteractionPromptObject == null)
|
||||
throw new NullReferenceException("GameManager: guiInteractionPromptObject not set");
|
||||
|
||||
if (guiHudObject == null)
|
||||
throw new NullReferenceException("GameManager: guiHudObject not set");
|
||||
|
||||
// if we're restarting, skip the main menu
|
||||
if (_restarting)
|
||||
{
|
||||
Debug.Log("GameManager.Start: inherited _restarting, honouring it rn");
|
||||
NewGame();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("GameManager.Start: setting to main menu and pausing");
|
||||
SetDisplayState(DisplayState.ScreenMainMenu);
|
||||
// pause the game
|
||||
PauseGameHelper(DisplayState.ScreenMainMenu);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// game run speed run stopwatch logic
|
||||
/// </summary>
|
||||
// TODO: implement this (speed-run stopwatch)
|
||||
private void Update()
|
||||
{
|
||||
if (Paused) return;
|
||||
|
||||
_elapsedRunTime += Time.deltaTime;
|
||||
var minutes = _elapsedRunTime / 60;
|
||||
var seconds = _elapsedRunTime % 60;
|
||||
var milliseconds = _elapsedRunTime * 1000 % 1000;
|
||||
_uiLabelStopwatch.text = $"{minutes:00}:{seconds:00}.{milliseconds:000}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// called when the game object is enabled
|
||||
/// </summary>
|
||||
private void OnEnable()
|
||||
{
|
||||
InitialiseInterfaceElements();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// initialise ui elements used by the game[ manager]
|
||||
/// </summary>
|
||||
/// >
|
||||
private void OnEnable()
|
||||
private void InitialiseInterfaceElements()
|
||||
{
|
||||
_ui = guiInteractionPromptObject.GetComponent<UIDocument>()?.rootVisualElement;
|
||||
_uiLabelInteractionPrompt = _ui.Q<Label>("InteractionPromptLabel");
|
||||
|
@ -145,9 +178,9 @@ private void OnEnable()
|
|||
/// </summary>
|
||||
private void HideMenuHelper()
|
||||
{
|
||||
// get all child menus in the "Menus" parent object
|
||||
foreach (var menu in GameObject.FindGameObjectsWithTag("Interfaces"))
|
||||
foreach (Transform menuChild in menu.transform)
|
||||
// get all children in the "Menus" parent object
|
||||
foreach (var child in GameObject.FindGameObjectsWithTag("Interfaces"))
|
||||
foreach (Transform menuChild in child.transform)
|
||||
{
|
||||
// skip if it is 'GameInterface' object
|
||||
if (menuChild.gameObject.CompareTag("GameInterface")) continue;
|
||||
|
@ -160,6 +193,24 @@ private void HideMenuHelper()
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// helper function to hide any game interfaces that are currently showing
|
||||
/// </summary>
|
||||
private void SetInterfaceActive(bool active)
|
||||
{
|
||||
// foreach (var inter in GameObject.FindGameObjectsWithTag("GameInterface"))
|
||||
foreach (var child in GameObject.FindGameObjectsWithTag("Interfaces"))
|
||||
foreach (Transform inter in child.transform)
|
||||
{
|
||||
if (!inter.gameObject.CompareTag("GameInterface")) continue;
|
||||
Debug.Log($"GameManager.SetInterfaceActive: setting interface '{inter}' {active}");
|
||||
inter.gameObject.SetActive(active);
|
||||
}
|
||||
|
||||
if (active)
|
||||
InitialiseInterfaceElements();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// helper function for <c>SetDisplayState()</c> to pause the game,
|
||||
/// called before the incoming game state is set
|
||||
|
@ -182,12 +233,14 @@ private void PauseGameHelper(DisplayState incomingState)
|
|||
Debug.Log("GameManager.PauseGameHelper: freeing cursor for main menu");
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
Cursor.visible = true;
|
||||
|
||||
// only hide interfaces if we're transitioning to the main menu
|
||||
SetInterfaceActive(false);
|
||||
}
|
||||
|
||||
// freeze player input/control if we're not transitioning to a game state
|
||||
if (incomingState != DisplayState.Game)
|
||||
{
|
||||
Debug.Log(GameObject.FindGameObjectWithTag("Player"));
|
||||
var playerInput = GameObject.Find("PlayerArmature")?.GetComponent<PlayerInput>();
|
||||
if (playerInput != null)
|
||||
{
|
||||
|
@ -255,6 +308,9 @@ private void ResumeGameHelper(DisplayState incomingState)
|
|||
// hide any menu that is currently showing
|
||||
HideMenuHelper();
|
||||
|
||||
// show game interfaces
|
||||
SetInterfaceActive(true);
|
||||
|
||||
// free the character controller
|
||||
var playerInput = GameObject.Find("PlayerArmature")?.GetComponent<PlayerInput>();
|
||||
if (playerInput == null) return;
|
||||
|
@ -369,8 +425,17 @@ public void NewGame()
|
|||
/// </summary>
|
||||
public void RestartRun()
|
||||
{
|
||||
// TODO: implement this
|
||||
throw new NotImplementedException();
|
||||
_restarting = true;
|
||||
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// function to restart the game
|
||||
/// </summary>
|
||||
public void RestartGame()
|
||||
{
|
||||
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
|
||||
Destroy(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -21,26 +21,32 @@ public class LiftController : MonoBehaviour
|
|||
/// the time it takes for the lift to move from one floor to another
|
||||
/// </summary>
|
||||
public float duration;
|
||||
|
||||
/// <summary>
|
||||
/// a bool to check if the lift is moving
|
||||
/// </summary>
|
||||
[HideInInspector] public bool moving;
|
||||
|
||||
/// <summary>
|
||||
/// the current time of the lift moving for lerps
|
||||
/// </summary>
|
||||
private float _currentTime;
|
||||
|
||||
/// <summary>
|
||||
/// the door of the lift
|
||||
/// </summary>
|
||||
private Door _liftDoor;
|
||||
|
||||
/// <summary>
|
||||
/// the start position of the lift
|
||||
/// </summary>
|
||||
private Vector3 _start;
|
||||
|
||||
/// <summary>
|
||||
/// the target position of the lift
|
||||
/// </summary>
|
||||
private Vector3 _target;
|
||||
|
||||
/// <summary>
|
||||
/// initialisation function
|
||||
/// </summary>
|
||||
|
@ -49,6 +55,7 @@ private void Start()
|
|||
_liftDoor = transform.parent.GetComponentInChildren<Door>();
|
||||
DoorCloser();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// to check if the door is open and call a function to close it
|
||||
/// </summary>
|
||||
|
@ -59,6 +66,7 @@ public void DoorCloser()
|
|||
Invoke(nameof(CloseDoor), 2f);
|
||||
Invoke(nameof(DoorCloser), 2f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// to close the door
|
||||
/// </summary>
|
||||
|
@ -66,6 +74,7 @@ public void CloseDoor()
|
|||
{
|
||||
_liftDoor.Interact();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// to move the lift
|
||||
/// </summary>
|
||||
|
|
|
@ -17,10 +17,10 @@ public class OverlayPauseMenu : CommonMenu
|
|||
/// </summary>
|
||||
private Button _buttonResume;
|
||||
|
||||
/// <summary>
|
||||
/// button to retry the run
|
||||
/// </summary>
|
||||
private Button _buttonRetry;
|
||||
// /// <summary>
|
||||
// /// button to retry the run
|
||||
// /// </summary>
|
||||
// private Button _buttonRetry;
|
||||
|
||||
/// <summary>
|
||||
/// button to return to the main menu
|
||||
|
@ -42,10 +42,10 @@ public override void OnEnable()
|
|||
_buttonResume.clicked += PlayClick;
|
||||
_buttonResume.clicked += OptionResumeGame;
|
||||
|
||||
// get the retry button from the ui root and subscribe appropriate functions
|
||||
_buttonRetry = UI.Q<Button>("ButtonRetry");
|
||||
_buttonRetry.clicked += PlayClick;
|
||||
_buttonRetry.clicked += OptionRetryGame;
|
||||
// // get the retry button from the ui root and subscribe appropriate functions
|
||||
// _buttonRetry = UI.Q<Button>("ButtonRetry");
|
||||
// _buttonRetry.clicked += PlayClick;
|
||||
// _buttonRetry.clicked += OptionRetryGame;z
|
||||
|
||||
// get the return button from the ui root and subscribe appropriate functions
|
||||
_buttonReturn = UI.Q<Button>("ButtonReturn");
|
||||
|
@ -80,6 +80,6 @@ public static void OptionRetryGame()
|
|||
public static void OptionReturnToMainMenu()
|
||||
{
|
||||
Debug.Log("OverlayPauseMenu.OptionReturnToMainMenu (static shared): clicked, returning to main menu");
|
||||
GameManager.Instance.SetDisplayState(GameManager.DisplayState.ScreenMainMenu);
|
||||
GameManager.Instance.RestartGame();
|
||||
}
|
||||
}
|
|
@ -36,16 +36,16 @@ public class Player : MonoBehaviour
|
|||
/// </summary>
|
||||
private GameManager _game;
|
||||
|
||||
/// <summary>
|
||||
/// the raycast hit information
|
||||
/// </summary>
|
||||
private RaycastHit _hit;
|
||||
|
||||
/// <summary>
|
||||
/// whether the player is looking at an interactable object
|
||||
/// </summary>
|
||||
private bool _raycast;
|
||||
|
||||
/// <summary>
|
||||
/// the raycast hit information
|
||||
/// </summary>
|
||||
public RaycastHit Hit;
|
||||
|
||||
/// <summary>
|
||||
/// initialisation function
|
||||
/// </summary>
|
||||
|
@ -62,7 +62,7 @@ private void Update()
|
|||
_raycast = Physics.Raycast(
|
||||
playerPosition.position,
|
||||
playerPosition.TransformDirection(Vector3.forward),
|
||||
out Hit,
|
||||
out _hit,
|
||||
interactableDistance,
|
||||
raycastLayers
|
||||
);
|
||||
|
@ -75,7 +75,7 @@ private void Update()
|
|||
if (!_raycast) return;
|
||||
|
||||
// show an interaction prompt if we're looking at an interactable object
|
||||
var prompt = Hit.collider.GetComponent<CommonInteractable>()?.interactionPrompt;
|
||||
var prompt = _hit.collider.GetComponent<CommonInteractable>()?.interactionPrompt;
|
||||
if (prompt != "") Debug.Log(prompt);
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ private void Update()
|
|||
private void OnAction()
|
||||
{
|
||||
if (!_raycast) return;
|
||||
Hit.collider.GetComponent<CommonInteractable>()?.Interact();
|
||||
_hit.collider.GetComponent<CommonInteractable>()?.Interact();
|
||||
// _currentInteractable?.Interact();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* description: interaction prompt demo with a probuilder donut
|
||||
*/
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* description: game run completion trigger collision
|
||||
*/
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
|
@ -12,7 +11,6 @@
|
|||
/// </summary>
|
||||
public class RunCompletionTrigger : MonoBehaviour
|
||||
{
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
GameManager.Instance.SetDisplayState(GameManager.DisplayState.OverlayCompleteUnderTimeMenu);
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* description: game run failure trigger collision
|
||||
*/
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
using UnityEngine.Serialization;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
/// <summary>
|
||||
|
@ -20,22 +19,26 @@ public class ScreenOptionsMenu : CommonMenu
|
|||
/// <summary>
|
||||
/// button to return to the main menu
|
||||
/// </summary>
|
||||
public Button ButtonReturn;
|
||||
private Button _buttonReturn;
|
||||
|
||||
/// <summary>
|
||||
/// slider for master (music + sfx) volume
|
||||
/// </summary>
|
||||
public Slider SliderAudioMaster;
|
||||
private Slider _sliderAudioMaster;
|
||||
|
||||
/// <summary>
|
||||
/// slider for music volume
|
||||
/// </summary>
|
||||
public Slider SliderAudioMusic;
|
||||
private Slider _sliderAudioMusic;
|
||||
|
||||
/// <summary>
|
||||
/// slider for sfx volume
|
||||
/// </summary>
|
||||
public Slider SliderAudioSfx;
|
||||
private Slider _sliderAudioSfx;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// function to associate a display state with the menu,
|
||||
|
@ -48,35 +51,24 @@ public override void OnEnable()
|
|||
base.OnEnable();
|
||||
|
||||
// get the start button from the ui root and subscribe appropriate functions
|
||||
ButtonReturn = UI.Q<Button>("ButtonReturn");
|
||||
ButtonReturn.clicked += PlayClick;
|
||||
ButtonReturn.clicked += OverlayPauseMenu.OptionReturnToMainMenu;
|
||||
_buttonReturn = UI.Q<Button>("ButtonReturn");
|
||||
_buttonReturn.clicked += PlayClick;
|
||||
_buttonReturn.clicked += OverlayPauseMenu.OptionReturnToMainMenu;
|
||||
|
||||
// get the music slider from the ui root
|
||||
SliderAudioMaster = UI.Q<Slider>("MasterSlider");
|
||||
// TODO: and set the initial value to the current music volume
|
||||
// SliderAudioMusic.value = Audio.GetMusicVolume() * 100;
|
||||
// and subscribe appropriate functions
|
||||
SliderAudioMaster.RegisterCallback<ChangeEvent<float>>(OptionSetMasterVolume);
|
||||
// get the music slider from the ui root and subscribe appropriate functions
|
||||
_sliderAudioMaster = UI.Q<Slider>("MasterSlider");
|
||||
_sliderAudioMaster.RegisterCallback<ChangeEvent<float>>(OptionSetMasterVolume);
|
||||
|
||||
// get the music slider from the ui root
|
||||
SliderAudioMusic = UI.Q<Slider>("MusicSlider");
|
||||
// TODO: and set the initial value to the current music volume
|
||||
// get the music slider from the ui root and subscribe appropriate functions
|
||||
_sliderAudioMusic = UI.Q<Slider>("MusicSlider");
|
||||
_sliderAudioMusic.RegisterCallback<ChangeEvent<float>>(OptionSetMusicVolume);
|
||||
|
||||
// and subscribe appropriate functions
|
||||
SliderAudioMusic.RegisterCallback<ChangeEvent<float>>(OptionSetMusicVolume);
|
||||
|
||||
// get the sfx slider from the ui root
|
||||
SliderAudioSfx = UI.Q<Slider>("SFXSlider");
|
||||
// TODO: and set the initial value to the current sfx volume
|
||||
// SliderAudioSfx.value = Audio.GetSfxVolume() * 100;
|
||||
// and subscribe appropriate functions
|
||||
SliderAudioSfx.RegisterCallback<ChangeEvent<float>>(OptionSetSfxVolume);
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
|
||||
// get the sfx slider from the ui root and subscribe appropriate functions
|
||||
_sliderAudioSfx = UI.Q<Slider>("SFXSlider");
|
||||
_sliderAudioSfx.RegisterCallback<ChangeEvent<float>>(OptionSetSfxVolume);
|
||||
}
|
||||
|
||||
private static float ConvertVolume(float linearVolume)
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<Style src="project://database/Assets/UI%20Toolkit/Interfaces/Common.uss?fileID=7433441132597879392&guid=7e22eeee55627cf478c5e125a8197039&type=3#Common" />
|
||||
<ui:VisualElement name="Root" style="flex-grow: 1; justify-content: space-around; align-items: center;">
|
||||
<ui:VisualElement name="VertHolder" style="flex-grow: 1; justify-content: flex-start; align-items: center; align-self: auto; margin-top: 2%;">
|
||||
<ui:Label tabindex="-1" parse-escape-sequences="true" display-tooltip-when-elided="true" text="00:53.47" name="CurrentStopwatchLabel" style="color: rgb(255, 255, 255); -unity-text-align: upper-center; white-space: normal; -unity-font: url("project://database/Assets/UI%20Toolkit/RLFonts/Fervojo/Fervojo-Bold.otf?fileID=12800000&guid=505dfbc18d2d4604db47ff55755f9dc8&type=3#Fervojo-Bold"); -unity-font-definition: url("project://database/Assets/UI%20Toolkit/RLFonts/Fervojo/Fervojo-Bold%20SDF.asset?fileID=11400000&guid=1abb65c0bf74b1649863fc75b2b83ac1&type=2#Fervojo-Bold SDF"); font-size: 64px; margin-bottom: 0; padding-bottom: 0;" />
|
||||
<ui:Label tabindex="-1" parse-escape-sequences="true" display-tooltip-when-elided="true" text="1,000" name="CurrentScoreLabel" style="color: rgb(255, 255, 255); -unity-text-align: upper-center; white-space: normal; -unity-font: url("project://database/Assets/UI%20Toolkit/RLFonts/Fervojo/Fervojo-Bold.otf?fileID=12800000&guid=505dfbc18d2d4604db47ff55755f9dc8&type=3#Fervojo-Bold"); -unity-font-definition: url("project://database/Assets/UI%20Toolkit/RLFonts/Fervojo/Fervojo-Bold%20SDF.asset?fileID=11400000&guid=1abb65c0bf74b1649863fc75b2b83ac1&type=2#Fervojo-Bold SDF"); font-size: 32px; margin-top: 0; padding-top: 0;" />
|
||||
<ui:Label tabindex="-1" parse-escape-sequences="true" display-tooltip-when-elided="true" text="00:53.47" name="CurrentStopwatchLabel" enable-rich-text="false" style="color: rgb(255, 255, 255); -unity-text-align: upper-center; white-space: normal; -unity-font: url("project://database/Assets/UI%20Toolkit/RLFonts/Fervojo/Fervojo-Bold.otf?fileID=12800000&guid=505dfbc18d2d4604db47ff55755f9dc8&type=3#Fervojo-Bold"); -unity-font-definition: url("project://database/Assets/UI%20Toolkit/RLFonts/Fervojo/Fervojo-Bold%20SDF.asset?fileID=11400000&guid=1abb65c0bf74b1649863fc75b2b83ac1&type=2#Fervojo-Bold SDF"); font-size: 64px; margin-bottom: 0; padding-bottom: 0;" />
|
||||
<ui:Label tabindex="-1" parse-escape-sequences="true" display-tooltip-when-elided="true" text="1,000" name="CurrentScoreLabel" enable-rich-text="false" style="color: rgb(255, 255, 255); -unity-text-align: upper-center; white-space: normal; -unity-font: url("project://database/Assets/UI%20Toolkit/RLFonts/Fervojo/Fervojo-Bold.otf?fileID=12800000&guid=505dfbc18d2d4604db47ff55755f9dc8&type=3#Fervojo-Bold"); -unity-font-definition: url("project://database/Assets/UI%20Toolkit/RLFonts/Fervojo/Fervojo-Bold%20SDF.asset?fileID=11400000&guid=1abb65c0bf74b1649863fc75b2b83ac1&type=2#Fervojo-Bold SDF"); font-size: 32px; margin-top: 0; padding-top: 0;" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
||||
<ui:VisualElement name="Root" style="flex-grow: 1; justify-content: space-around; align-items: center;">
|
||||
<ui:VisualElement name="VertHolder" style="flex-grow: 1; justify-content: center; margin-top: 30%;">
|
||||
<ui:Label tabindex="-1" parse-escape-sequences="true" display-tooltip-when-elided="true" text="Press E to Interact" name="InteractionPromptLabel" style="background-color: rgba(0, 0, 0, 0.33); color: rgb(255, 255, 255); -unity-text-align: upper-center; padding-right: 8px; padding-left: 8px; padding-top: 8px; padding-bottom: 8px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; white-space: normal; -unity-font: url("project://database/Assets/UI%20Toolkit/RLFonts/Fervojo/Fervojo-Medium.otf?fileID=12800000&guid=9439a6fdc5392c6479cda7dd72a8f3f7&type=3#Fervojo-Medium"); -unity-font-definition: url("project://database/Assets/UI%20Toolkit/RLFonts/Fervojo/Fervojo-Medium%20SDF.asset?fileID=11400000&guid=45943718062c86e448361bd7f6506932&type=2#Fervojo-Medium SDF"); font-size: 28px;" />
|
||||
<ui:Label tabindex="-1" parse-escape-sequences="true" display-tooltip-when-elided="true" text="Press E to Interact" name="InteractionPromptLabel" style="background-color: rgba(0, 0, 0, 0.33); color: rgb(255, 255, 255); -unity-text-align: upper-center; padding-right: 8px; padding-left: 8px; padding-top: 8px; padding-bottom: 8px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; white-space: normal; -unity-font: url("project://database/Assets/UI%20Toolkit/RLFonts/Fervojo/Fervojo-Medium.otf?fileID=12800000&guid=9439a6fdc5392c6479cda7dd72a8f3f7&type=3#Fervojo-Medium"); -unity-font-definition: url("project://database/Assets/UI%20Toolkit/RLFonts/Fervojo/Fervojo-Medium%20SDF.asset?fileID=11400000&guid=45943718062c86e448361bd7f6506932&type=2#Fervojo-Medium SDF"); font-size: 28px; display: flex; visibility: hidden;" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</ui:VisualElement>
|
||||
<ui:VisualElement name="Buttonspace" style="flex-grow: 1; width: 50%; min-width: 50%; height: 50%; min-height: 50%; align-items: center; justify-content: flex-end; align-self: center;">
|
||||
<ui:Button text="Resume Run" parse-escape-sequences="true" display-tooltip-when-elided="true" name="ButtonResume" />
|
||||
<ui:Button text="Retry Run" parse-escape-sequences="true" display-tooltip-when-elided="true" name="ButtonRetry" />
|
||||
<ui:Button text="Retry Run" parse-escape-sequences="true" display-tooltip-when-elided="true" name="ButtonRetry" style="display: none;" />
|
||||
<ui:Button text="Return to Main Menu" parse-escape-sequences="true" display-tooltip-when-elided="true" name="ButtonReturn" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="Buttonspace" style="flex-grow: 1; width: 50%; min-width: 50%; height: 50%; min-height: 50%; align-items: center; justify-content: flex-end; align-self: center;">
|
||||
<ui:Button text="Retry Run" parse-escape-sequences="true" display-tooltip-when-elided="true" name="ButtonRetry" />
|
||||
<ui:Button text="Retry Run" parse-escape-sequences="true" display-tooltip-when-elided="true" name="ButtonRetry" style="display: none;" />
|
||||
<ui:Button text="Return to Main Menu" parse-escape-sequences="true" display-tooltip-when-elided="true" name="ButtonReturn" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
|
|
|
@ -30,6 +30,151 @@
|
|||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "lightmapping.autoUnwrapLightmapUV",
|
||||
"value": "{\"m_Value\":true}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "UnityEngine.ProBuilder.ProBuilderEditor-isUtilityWindow",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "editor.backFaceSelectEnabled",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "editor.toolbarIconGUI",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "experimental.enabled",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "editor.showSceneInfo",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "ShapeComponent.ResetSettings",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "ShapeComponent.SettingsEnabled",
|
||||
"value": "{\"m_Value\":true}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "mesh.newShapesSnapToGrid",
|
||||
"value": "{\"m_Value\":true}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "mesh.meshColliderIsConvex",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "editor.autoRecalculateCollisions",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.SelectMode, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "editor.selectMode",
|
||||
"value": "{\"m_Value\":1}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.SelectionModifierBehavior, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "editor.rectSelectModifier",
|
||||
"value": "{\"m_Value\":2}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.RectSelectMode, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "editor.dragSelectRectMode",
|
||||
"value": "{\"m_Value\":0}"
|
||||
},
|
||||
{
|
||||
"type": "System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "ShapeBuilder.ActiveShapeIndex",
|
||||
"value": "{\"m_Value\":9}"
|
||||
},
|
||||
{
|
||||
"type": "System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "ShapeBuilder.LastPivotLocation",
|
||||
"value": "{\"m_Value\":1}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "mesh.newShapePivotLocation",
|
||||
"value": "{\"m_Value\":1}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.LastPivotPosition",
|
||||
"value": "{\"m_Value\":{\"x\":0.0,\"y\":0.0,\"z\":0.0}}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.LastSize",
|
||||
"value": "{\"m_Value\":{\"x\":2.637908935546875,\"y\":0.6330699920654297,\"z\":2.631824493408203}}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.LastRotation",
|
||||
"value": "{\"m_Value\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0}}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.Material, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "mesh.userMaterial",
|
||||
"value": "{\"m_Value\":{\"instanceID\":0}}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.Rendering.ShadowCastingMode, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "mesh.shadowCastingMode",
|
||||
"value": "{\"m_Value\":1}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEditor.StaticEditorFlags, UnityEditor.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "mesh.defaultStaticEditorFlags",
|
||||
"value": "{\"m_Value\":0}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.ColliderType, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "mesh.newShapeColliderType",
|
||||
"value": "{\"m_Value\":2}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.UnwrapParameters, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "lightmapping.defaultLightmapUnwrapParameters",
|
||||
"value": "{\"m_Value\":{\"m_HardAngle\":88.0,\"m_PackMargin\":20.0,\"m_AngleError\":8.0,\"m_AreaError\":15.0}}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.Plane",
|
||||
"value": "{}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.Stairs",
|
||||
"value": "{}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.Cube",
|
||||
"value": "{}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.Cone",
|
||||
"value": "{}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.Torus",
|
||||
"value": "{}"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Reference in a new issue