practice mode
This commit is contained in:
@@ -27,9 +27,11 @@ public class MainMenuManager : MonoBehaviour
|
||||
public GameObject withdrawalScreen;
|
||||
[Header("Play")]
|
||||
public Button btnPlay;
|
||||
public Button btnTutorial;
|
||||
public TMP_Text rcPlayText;
|
||||
public TMP_Text entryFeeTxt;
|
||||
public TMP_Text rcPrizeTxt;
|
||||
[SerializeField] string tutorialGameScene = GameTutorialManager.DefaultGameSceneName;
|
||||
|
||||
[Header("Dummy Buy")]
|
||||
public Button btnBuyUsd5;
|
||||
@@ -99,6 +101,8 @@ public class MainMenuManager : MonoBehaviour
|
||||
btnPaste.onClick.AddListener(OnPasteFromClipboard);
|
||||
|
||||
btnPlay.onClick.AddListener(OnPlay);
|
||||
if (btnTutorial != null && btnTutorial != btnPlay)
|
||||
btnTutorial.onClick.AddListener(OnPlayTutorial);
|
||||
|
||||
toggleSfx.onToggleValueChanged.AddListener(OnToggleSfx);
|
||||
toggleMusic.onToggleValueChanged.AddListener(OnToggleMusic);
|
||||
@@ -114,6 +118,8 @@ public class MainMenuManager : MonoBehaviour
|
||||
LoginManager.OnUserDataUpdated -= OnUserUpdated;
|
||||
toggleSfx.onToggleValueChanged.RemoveListener(OnToggleSfx);
|
||||
toggleMusic.onToggleValueChanged.RemoveListener(OnToggleMusic);
|
||||
if (btnTutorial != null && btnTutorial != btnPlay)
|
||||
btnTutorial.onClick.RemoveListener(OnPlayTutorial);
|
||||
}
|
||||
|
||||
void OnToggleSfx(bool isOn)
|
||||
@@ -146,6 +152,32 @@ public class MainMenuManager : MonoBehaviour
|
||||
CupidLobby.instance.Matchmake();
|
||||
}
|
||||
|
||||
public void OnPlayTutorial()
|
||||
{
|
||||
if (LoginManager.CurrentUser == null)
|
||||
{
|
||||
Debug.LogError("Tutorial blocked: user profile not loaded.");
|
||||
return;
|
||||
}
|
||||
if (LevelLoadManager.instance == null)
|
||||
{
|
||||
Debug.LogError("Tutorial blocked: LevelLoadManager is missing.");
|
||||
return;
|
||||
}
|
||||
StartCoroutine(CoLaunchTutorial());
|
||||
}
|
||||
|
||||
IEnumerator CoLaunchTutorial()
|
||||
{
|
||||
MatchmadePlayer myPlayer = GameTutorialManager.CreateMyPlayerFromUser(LoginManager.CurrentUser);
|
||||
MatchmadePlayer cpuPlayer = GameTutorialManager.CreateCpuOpponent();
|
||||
|
||||
yield return GameTutorialManager.CoFetchPlayerL10(myPlayer);
|
||||
|
||||
GameTutorialManager.PrepareLaunch(myPlayer, cpuPlayer);
|
||||
LevelLoadManager.LoadLevel(tutorialGameScene);
|
||||
}
|
||||
|
||||
void OnCryptoAddressChanged(string value)
|
||||
{
|
||||
PlayerPrefs.SetString(CryptoAddressPrefsKey, value ?? string.Empty);
|
||||
|
||||
Reference in New Issue
Block a user