steam api implementation
This commit is contained in:
@ -4,6 +4,7 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using Steamworks;
|
||||
|
||||
public class MainMenuManager : MonoBehaviour
|
||||
{
|
||||
@ -37,6 +38,9 @@ public class MainMenuManager : MonoBehaviour
|
||||
|
||||
textList[0].GetComponent<Button>().onClick.AddListener(LoadFirstLevel);
|
||||
textList[2].GetComponent<Button>().onClick.AddListener(ExitApp);
|
||||
|
||||
Cursor.visible = true;
|
||||
Cursor.lockState = CursorLockMode.Confined;
|
||||
}
|
||||
|
||||
|
||||
@ -55,6 +59,18 @@ public class MainMenuManager : MonoBehaviour
|
||||
|
||||
private void LoadFirstLevel()
|
||||
{
|
||||
if (SteamManager.Initialized)
|
||||
{
|
||||
Steamworks.SteamUserStats.GetAchievement("ENTER_THE_STATION", out bool achievementCompleted);
|
||||
if (!achievementCompleted)
|
||||
{
|
||||
SteamUserStats.SetAchievement("ENTER_THE_STATION");
|
||||
SteamUserStats.StoreStats();
|
||||
SteamAPI.RunCallbacks();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!transitioning)
|
||||
{
|
||||
cover.Play("Cover_load_out");
|
||||
|
Reference in New Issue
Block a user