Hello!
I looked for solutions but did not find anything, here is my problem:
I have updated the steam_appid.txt to my game id (my game is not published yet). I also published the achievemnents online as many mentioned that this was their problem. But I have no idea what I am doing wrong. In steam it still says that I am playing Spacewar and not my game…
Here is the code I use, I created a script as a pipe:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Steamworks;
public class Steam_Events : MonoBehaviour {
protected Callback<GameOverlayActivated_t> m_GameOverlayActivated;
// Use this for initialization
void Start()
{
if (SteamManager.Initialized)
{
Debug.LogWarning("Loaded SteamManager!");
}
}
private void OnEnable()
{
if (SteamManager.Initialized)
{
m_GameOverlayActivated = Callback<GameOverlayActivated_t>.Create(OnGameOverlayActivated);
}
}
private void OnGameOverlayActivated(GameOverlayActivated_t pCallback)
{
if (pCallback.m_bActive != 0)
{
Debug.Log("Steam Overlay has been activated");
Time.timeScale = 0;
}
else
{
Debug.Log("Steam Overlay has been closed");
Time.timeScale = 1;
}
}
static public void UnlockAchive(string achievement)
{
if (SteamManager.Initialized)
{
bool Check_it;
SteamUserStats.SetAchievement(achievement);
Debug.Log("Achievement1: " + achievement + SteamUserStats.GetAchievement(achievement, out Check_it));
StoreStats();
}
}
static public void StoreStats()
{
SteamUserStats.StoreStats();
}
static public void Reset()
{
SteamUserStats.ResetAllStats(true);
}
static public float GetStats(string StatusName)
{
float Stats;
SteamUserStats.GetStat(StatusName, out Stats);
return Stats;
}
// Update is called once per frame
void Update () {
}
}
And this code to call the script:
Steam_Events.UnlockAchive("NEW_ACHIEVEMENT_1_1");
What am I doing wrong?