Facepunch.Steamworks icon indicating copy to clipboard operation
Facepunch.Steamworks copied to clipboard

Namespace "Steamworks" wasn't found

Open ozhanghe opened this issue 2 years ago • 1 comments

Describe the bug I import the library from the releases page, it says that the namespace "Steamworks" wasn't found. I'm on linux if that helps. Unity Version: 2020.3.24f1. My Unity Player uses Mono with Net Standard 2.0.

To Reproduce Steps to reproduce the behavior:

  1. Use Unity Editor 2020.3.24f1.
  2. Select Mono with Net Standard 2.0.
  3. Attempt to import the library.
  4. See error.

Calling Code

    public uint id;
    // Start is called before the first frame update
    void Start()
    {
        DontDestroyOnLoad(gameObject);
        try
        {
            Steamworks.SteamClient.Init( id );
        }
        catch ( System.Exception e )
        {
            // Something went wrong - it's one of these:
            //
            //     Steam is closed?
            //     Can't find steam_api dll?
            //     Don't have permission to play app?
            //
            Debug.LogError(e.Message);
        }
    }

    // Update is called once per frame
    void Update()
    {
        Steamworks.SteamClient.RunCallbacks();
    }

    void OnDisable()
    {
        Steamworks.SteamClient.Shutdown();
    }

Expected behavior I expected to be able to use the namespace Steamworks.

Desktop (please complete the following information):

  • OS: Linux
  • Unity: 2020.3.24f1

Additional context Mono Net Standard 2.0 (No IL2CPP). Tried to compile library from source but still didn't work.

ozhanghe avatar Jul 25 '22 18:07 ozhanghe

@ozhanghe as a workaround install latest version and change Facepunch.Steamworks.Posix dll Editor settings to OS linux:

image image

TLmaK0 avatar Aug 08 '22 06:08 TLmaK0

Just to share info FWIW, it seems working fine if setting OS to AnyOS and adding a UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX constraint. It should support Mac and Linux with the same code then.

yunhailuo avatar Nov 23 '22 02:11 yunhailuo

It's working now. Thanks!

ozhanghe avatar Nov 23 '22 03:11 ozhanghe