You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using UnityEngine;using Steamworks;publicclassMyScript:MonoBehaviour{protectedCallback<SteamInventoryResult_t>m_SteamInventoryResult;privatevoidOnEnable(){if(SteamManager.Initialized){m_SteamInventoryResult=Callback<SteamInventoryResult_t>.Create(OnSteamInventoryResult);// this line throws exception}elsethrownew System.Exception("Steam Manager not initialized!");}privatevoidStart(){
SteamInventory.GetAllItems(out SteamInventoryResult_t handle);}privatevoidOnSteamInventoryResult(SteamInventoryResult_tp_callback){
print("method pass");
SteamInventory.DestroyResult(p_callback);}}
Change appid in project directory/steam_appid.txt
Create new scene
Add game object with SteamManager and MyScript
Play the scene
Exception:
Exception: Callback number not found for struct Steamworks.SteamInventoryResult_t
Steamworks.CallbackIdentities.GetCallbackIdentity (System.Type callbackStruct) (at ./Library/PackageCache/com.rlabrecque.steamworks.net@a3fe8091f7/Runtime/CallbackIdentity.cs:22)
Steamworks.CallbackDispatcher.Register (Steamworks.Callback cb) (at ./Library/PackageCache/com.rlabrecque.steamworks.net@a3fe8091f7/Runtime/CallbackDispatcher.cs:78)
Steamworks.Callback`1[T].Register (Steamworks.Callback`1+DispatchDelegate[T] func) (at ./Library/PackageCache/com.rlabrecque.steamworks.net@a3fe8091f7/Runtime/CallbackDispatcher.cs:272)
Steamworks.Callback`1[T]..ctor (Steamworks.Callback`1+DispatchDelegate[T] func, System.Boolean bGameServer) (at ./Library/PackageCache/com.rlabrecque.steamworks.net@a3fe8091f7/Runtime/CallbackDispatcher.cs:240)
Steamworks.Callback`1[T].Create (Steamworks.Callback`1+DispatchDelegate[T] func) (at ./Library/PackageCache/com.rlabrecque.steamworks.net@a3fe8091f7/Runtime/CallbackDispatcher.cs:226)
MyScript.OnEnable () (at Assets/Scripts/MyScript.cs:12)
The text was updated successfully, but these errors were encountered:
Steps for Reproduction:
MyScript.cs
The text was updated successfully, but these errors were encountered: