Add tutorial splash screen
This commit is contained in:
parent
701ef5a2ec
commit
60ee4185e2
4 changed files with 3342 additions and 8 deletions
2
.erp
2
.erp
|
@ -5,7 +5,7 @@
|
|||
<resetOnSceneChange>false</resetOnSceneChange>
|
||||
<debugMode>false</debugMode>
|
||||
<EditorClosed>true</EditorClosed>
|
||||
<LastTimestamp>1677882343</LastTimestamp>
|
||||
<LastTimestamp>1677885521</LastTimestamp>
|
||||
<LastSessionID>2115309888051293429</LastSessionID>
|
||||
<Errored>false</Errored>
|
||||
</ERPSettings>
|
File diff suppressed because it is too large
Load diff
|
@ -14,6 +14,7 @@ public class GameInput : MonoBehaviour
|
|||
public event EventHandler OnInteractAction;
|
||||
public event EventHandler OnInteractAlteranteAction;
|
||||
public event EventHandler OnPauseAction;
|
||||
public event EventHandler OnKeyRebind;
|
||||
|
||||
public enum Bindings
|
||||
{
|
||||
|
@ -172,6 +173,8 @@ public class GameInput : MonoBehaviour
|
|||
string playerOveridesJson = playerInputActions.SaveBindingOverridesAsJson();
|
||||
PlayerPrefs.SetString(PLAYER_PREFS_BINDINGS, playerOveridesJson);
|
||||
PlayerPrefs.Save();
|
||||
|
||||
OnKeyRebind?.Invoke(this, EventArgs.Empty);
|
||||
}).Start();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ public class GameStateManager : MonoBehaviour
|
|||
private bool isGamePaused = false;
|
||||
|
||||
// --- Timers ---
|
||||
private float waitingToStartTimer = 1f;
|
||||
private float countdownToStartTimer = 3f;
|
||||
private float gamePlayTimer;
|
||||
private float gamePlayTimerMax = 10f;
|
||||
|
@ -38,6 +37,17 @@ public class GameStateManager : MonoBehaviour
|
|||
private void Start()
|
||||
{
|
||||
GameInput.Instance.OnPauseAction += GameInput_OnPauseAction;
|
||||
GameInput.Instance.OnInteractAction += GameInput_OnInteractAction;
|
||||
}
|
||||
|
||||
private void GameInput_OnInteractAction(object sender, EventArgs e)
|
||||
{
|
||||
if (state == State.WaitingToStart)
|
||||
{
|
||||
state = State.StartingCountdown;
|
||||
|
||||
OnStateChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private void GameInput_OnPauseAction(object sender, EventArgs e)
|
||||
|
@ -52,12 +62,6 @@ public class GameStateManager : MonoBehaviour
|
|||
switch (state)
|
||||
{
|
||||
case State.WaitingToStart:
|
||||
waitingToStartTimer -= Time.deltaTime;
|
||||
if (waitingToStartTimer < 0f)
|
||||
{
|
||||
state = State.StartingCountdown;
|
||||
OnStateChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
break;
|
||||
case State.StartingCountdown:
|
||||
countdownToStartTimer -= Time.deltaTime;
|
||||
|
|
Reference in a new issue