我正在为 Steam 使用 Unity 开发游戏。我正在统一使用 SteamWorks.net 包。我的成就系统运行良好但 SteamOverly 上的暂停游戏无法正常工作。我正在尝试从 Unity Editor 运行。我有任何方法可以从统一编辑器中测试它。我为此使用以下代码
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using Steamworks;
public class SteamScript : MonoBehaviour {
protected Callback<GameOverlayActivated_t> m_GameOverlayActivated;
private void OnEnable() {
if (SteamManager.Initialized) { //This working
Debug.Log("INIT");
m_GameOverlayActivated = Callback<GameOverlayActivated_t>.Create(OnGameOverlayActivated);
}
}
private void OnGameOverlayActivated(GameOverlayActivated_t pCallback) {
Debug.Log("Entered"); //This is not workinfdg
// this is not calling
if(pCallback.m_bActive != 0) {
Debug.Log("Steam Overlay has been activated");
}
else {
Debug.Log("Steam Overlay has been closed");
}
}
}