This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Steamworks | |
{ | |
static class InterfaceHelper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH | |
#define DISABLESTEAMWORKS | |
#endif | |
#if !DISABLESTEAMWORKS | |
using System; | |
using System.Runtime.InteropServices; | |
using IntPtr = System.IntPtr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static bool Init() | |
{ | |
HSteamUser hSteamUser = SteamAPI.GetHSteamUser(); | |
HSteamPipe hSteamPipe = SteamAPI.GetHSteamPipe(); | |
if (hSteamPipe == (HSteamPipe)0) { return false; } | |
using (var pchVersionString = new InteropHelp.UTF8StringHandle(Constants.STEAMCLIENT_INTERFACE_VERSION)) | |
{ | |
m_pSteamClient = NativeMethods.SteamInternal_CreateInterface(pchVersionString); | |
} |