2024-04-17 20:53:46 -07:00
|
|
|
using System;
|
2024-04-19 03:46:17 -07:00
|
|
|
using GadGame.Manager;
|
2024-04-11 01:55:35 -07:00
|
|
|
using GadGame.SO;
|
|
|
|
using GadGame.State;
|
2024-04-15 04:10:00 -07:00
|
|
|
using GadGame.State.MainFlowState;
|
2024-04-19 03:46:17 -07:00
|
|
|
using Sirenix.OdinInspector;
|
2024-04-11 01:55:35 -07:00
|
|
|
|
2024-04-15 04:10:00 -07:00
|
|
|
namespace GadGame
|
2024-04-11 01:55:35 -07:00
|
|
|
{
|
2024-04-17 20:53:46 -07:00
|
|
|
public class MainFlow : SingletonStateRunner<MainFlow>
|
2024-04-11 01:55:35 -07:00
|
|
|
{
|
|
|
|
public SceneFlowConfig SceneFlowConfig;
|
2024-04-17 20:53:46 -07:00
|
|
|
public event Action<float> OnReadyCountDown;
|
|
|
|
public event Action<bool> OnReady;
|
2024-04-11 01:55:35 -07:00
|
|
|
|
|
|
|
protected override void Awake()
|
|
|
|
{
|
|
|
|
base.Awake();
|
|
|
|
DontDestroyOnLoad(gameObject);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void Start()
|
|
|
|
{
|
2024-04-15 04:10:00 -07:00
|
|
|
SetState<IdleState>();
|
2024-04-11 01:55:35 -07:00
|
|
|
}
|
2024-04-17 20:53:46 -07:00
|
|
|
|
|
|
|
public void ReadyCountDown(float duration)
|
|
|
|
{
|
|
|
|
OnReadyCountDown?.Invoke(duration);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Ready(bool ready)
|
|
|
|
{
|
|
|
|
OnReady?.Invoke(ready);
|
|
|
|
}
|
2024-04-11 01:55:35 -07:00
|
|
|
}
|
|
|
|
}
|