Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The name 'SteamManager' does not exist in the current context #642

Open
ChurikiTenna opened this issue Aug 22, 2024 · 2 comments
Open

The name 'SteamManager' does not exist in the current context #642

ChurikiTenna opened this issue Aug 22, 2024 · 2 comments

Comments

@ChurikiTenna
Copy link

I have installed Steamworks through Package Manager, and using namespace seems working fine.
However, when I try to use SteamManager according to GettingStarted, it fails with this error:

The name 'SteamManager' does not exist in the current context

Code

#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR
using Steamworks;
#endif
...
#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR
        Debug.Log($"Steamworks.Version {new Steamworks.CGameID()}");//this works
        if(SteamManager.Initialized) {// this does not work.
			string name = SteamFriends.GetPersonaName();
			Debug.Log(name);
		}
        #endif

Running on Mac(Apple Silicon).

@rlabrecque
Copy link
Owner

I think you need to pull down https://github.com/rlabrecque/Steamworks.NET-SteamManager/ into your project separately currently. It's not inside the package manager version because it's supposed to be the starting point for your own code. There's a ticket around here somewhere to make this more-automatic; which is highly needed.

I'm going to leave this ticket open primarily to improve the documentation

@JamesMcGhee
Copy link
Contributor

In general, I would say don't use SteamManager rather use it as a starting point to write your own.

Out of the box it makes some assumptions understandably being an informative bit of a sample

In particular "SteamManager.cs" gets unfortunately packed into a lot of things from UAS or examples you will find on YouTube or what have you so tends to create a little catastrophe here and there :)

not the fault of the script but rather people's abuses of it ;)

@rlabrecque we tend to mark our informational sample scripts with

[Obsolete("This script is for demonstration purposes only and is not intended for production use!")]

Or similar ... that will cause Unity to render a highlighted note about it being "deprecated" and draw the user's attention to that fact. It will still compile and work of course it will just throw a warning for them to be aware of
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants