public void Awake() { single_SS = this; DontDestroyOnLoad(gameObject); if (!SteamManager.Initialized) { return; } nameIsSet = true; nickname = SteamFriends.GetPersonaName(); }
void OnEnable() { // This should only get called after an Assembly reload, You should never disable the Steamworks Manager yourself. if (m_SteamTest == null) { m_SteamTest = this; } if (!m_bInitialized) { return; } if (SteamAPIWarningMessageHook == null) { SteamAPIWarningMessageHook = new SteamAPIWarningMessageHook_t(SteamAPIDebugTextHook); SteamClient.SetWarningMessageHook(SteamAPIWarningMessageHook); } }
public void RenderOnGUI(SteamTest.EGUIState state) { GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); GUILayout.Label("Variables:"); GUILayout.Label("m_NumGamesStat: " + m_NumGamesStat); GUILayout.Label("m_FeetTraveledStat: " + m_FeetTraveledStat); GUILayout.Label("m_AchievedWinOneGame: " + m_AchievedWinOneGame); GUILayout.Label("m_SteamLeaderboard: " + m_SteamLeaderboard); GUILayout.Label("m_SteamLeaderboardEntries: " + m_SteamLeaderboardEntries); GUILayout.Label("m_Icon:"); GUILayout.Label(m_Icon); GUILayout.EndArea(); if (state == SteamTest.EGUIState.SteamUserStatsTest) { RenderPageOne(); } else { RenderPageTwo(); } }
public void RenderOnGUI(SteamTest.EGUIState state) { GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); GUILayout.Label("Variables:"); GUILayout.Label("m_Message: "); m_Message = GUILayout.TextField(m_Message, 40); GUILayout.Label("m_FileCount: " + m_FileCount); GUILayout.Label("m_FileSize: " + m_FileSize); GUILayout.Label("m_TotalBytes: " + m_TotalBytes); GUILayout.Label("m_FileSizeInBytes: " + m_FileSizeInBytes); GUILayout.Label("m_FileStream: " + m_FileStream); GUILayout.Label("m_UGCHandle: " + m_UGCHandle); GUILayout.Label("m_PublishedFileId: " + m_PublishedFileId); GUILayout.Label("m_PublishedFileUpdateHandle: " + m_PublishedFileUpdateHandle); GUILayout.EndArea(); if (state == SteamTest.EGUIState.SteamRemoteStorage) { RenderPageOne(); } else { RenderPageTwo(); } }
public void RenderOnGUI(SteamTest.EGUIState state) { GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); GUILayout.Label("Variables:"); GUILayout.Label("m_Friend: " + m_Friend); GUILayout.Label("m_Clan: " + m_Clan); GUILayout.Label("m_SmallAvatar:"); GUILayout.Label(m_SmallAvatar); GUILayout.Label("m_MediumAvatar:"); GUILayout.Label(m_MediumAvatar); GUILayout.Label("m_LargeAvatar:"); // This is an example of how to flip a Texture2D when using OnGUI(). if (m_LargeAvatar) { GUI.DrawTexture(new Rect(0, m_LargeAvatar.height * 2 + 85, m_LargeAvatar.width, -m_LargeAvatar.height), m_LargeAvatar); } GUILayout.EndArea(); if (state == SteamTest.EGUIState.SteamFriends) { RenderPageOne(); } else { RenderPageTwo(); } }
void Awake() { // Only one instance of Steamworks at a time! if (m_SteamTest != null) { Destroy(gameObject); return; } m_SteamTest = this; // We want our Steam Instance to persist across scenes. DontDestroyOnLoad(gameObject); if (!Packsize.Test()) { throw new System.Exception("Packsize is wrong! You are likely using a Linux/OSX build on Windows or vice versa."); } if (!DllCheck.Test()) { throw new System.Exception("DllCheck returned false."); } try { m_bInitialized = SteamAPI.Init(); } catch (System.DllNotFoundException e) { // We catch this exception here, as it will be the first occurrence of it. Debug.LogError("[Steamworks] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details.\n" + e, this); Application.Quit(); return; } if (!m_bInitialized) { Debug.LogError("SteamAPI_Init() failed", this); return; } // Set up our callback to recieve warning messages from Steam. // You must launch with "-debug_steamapi" in the launch args to recieve warnings. SteamAPIWarningMessageHook = new SteamAPIWarningMessageHook_t(SteamAPIDebugTextHook); SteamClient.SetWarningMessageHook(SteamAPIWarningMessageHook); // Register our Steam Callbacks AppListTest = gameObject.AddComponent <SteamAppListTest>(); AppsTest = gameObject.AddComponent <SteamAppsTest>(); ClientTest = gameObject.AddComponent <SteamClientTest>(); ControllerTest = gameObject.AddComponent <SteamControllerTest>(); FriendsTest = gameObject.AddComponent <SteamFriendsTest>(); HTMLSurfaceTest = gameObject.AddComponent <SteamHTMLSurfaceTest>(); HTTPTest = gameObject.AddComponent <SteamHTTPTest>(); InventoryTest = gameObject.AddComponent <SteamInventoryTest>(); MatchmakingTest = gameObject.AddComponent <SteamMatchmakingTest>(); MatchmakingServersTest = gameObject.AddComponent <SteamMatchmakingServersTest>(); MusicTest = gameObject.AddComponent <SteamMusicTest>(); MusicRemoteTest = gameObject.AddComponent <SteamMusicRemoteTest>(); NetworkingTest = gameObject.AddComponent <SteamNetworkingTest>(); ParentalSettingsTest = gameObject.AddComponent <SteamParentalSettingsTest>(); RemoteStorageTest = gameObject.AddComponent <SteamRemoteStorageTest>(); ScreenshotsTest = gameObject.AddComponent <SteamScreenshotsTest>(); UGCTest = gameObject.AddComponent <SteamUGCTest>(); UserTest = gameObject.AddComponent <SteamUserTest>(); UserStatsTest = gameObject.AddComponent <SteamUserStatsTest>(); UtilsTest = gameObject.AddComponent <SteamUtilsTest>(); VideoTest = gameObject.AddComponent <SteamVideoTest>(); }
void Awake() { // Only one instance of Steamworks at a time! if (m_SteamTest != null) { Destroy(gameObject); return; } m_SteamTest = this; // We want our Steam Instance to persist across scenes. DontDestroyOnLoad(gameObject); if (!Packsize.Test()) { throw new System.Exception("Packsize is wrong! You are likely using a Linux/OSX build on Windows or vice versa."); } try { m_bInitialized = SteamAPI.Init(); } catch (System.DllNotFoundException e) { // We catch this exception here, as it will be the first occurence of it. Debug.LogError("[Steamworks] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details.\n" + e, this); Application.Quit(); return; } if (!m_bInitialized) { Debug.LogError("SteamAPI_Init() failed", this); return; } // Set up our callback to recieve warning messages from Steam. // You must launch with "-debug_steamapi" in the launch args to recieve warnings. SteamAPIWarningMessageHook = new SteamAPIWarningMessageHook_t(SteamAPIDebugTextHook); SteamClient.SetWarningMessageHook(SteamAPIWarningMessageHook); // We are going to use the controller interface, initialize it, which is a seperate step as it // create a new thread in the game proc and we don't want to force that on games that don't // have native Steam controller implementations m_bControllerInitialized = SteamController.Init(Application.dataPath + "/controller.vdf"); if (!m_bControllerInitialized) { Debug.LogWarning("Steam Controller Failed to Initialize"); } // Register our Steam Callbacks AppListTest = gameObject.AddComponent<SteamAppListTest>(); AppsTest = gameObject.AddComponent<SteamAppsTest>(); ClientTest = gameObject.AddComponent<SteamClientTest>(); ControllerTest = gameObject.AddComponent<SteamControllerTest>(); FriendsTest = gameObject.AddComponent<SteamFriendsTest>(); HTTPTest = gameObject.AddComponent<SteamHTTPTest>(); MatchmakingTest = gameObject.AddComponent<SteamMatchmakingTest>(); MatchmakingServersTest = gameObject.AddComponent<SteamMatchmakingServersTest>(); MusicTest = gameObject.AddComponent<SteamMusicTest>(); RemoteStorageTest = gameObject.AddComponent<SteamRemoteStorageTest>(); ScreenshotsTest = gameObject.AddComponent<SteamScreenshotsTest>(); UGCTest = gameObject.AddComponent<SteamUGCTest>(); UnifiedMessagesTest = gameObject.AddComponent<SteamUnifiedMessagesTest>(); UserTest = gameObject.AddComponent<SteamUserTest>(); UserStatsTest = gameObject.AddComponent<SteamUserStatsTest>(); UtilsTest = gameObject.AddComponent<SteamUtilsTest>(); }
void Awake() { // Only one instance of Steamworks at a time! if (m_SteamTest != null) { Destroy(gameObject); return; } m_SteamTest = this; // We want our Steam Instance to persist across scenes. DontDestroyOnLoad(gameObject); if (!Packsize.Test()) { throw new System.Exception("Packsize is wrong! You are likely using a Linux/OSX build on Windows or vice versa."); } try { m_bInitialized = SteamAPI.Init(); } catch (System.DllNotFoundException e) { // We catch this exception here, as it will be the first occurence of it. Debug.LogError("[Steamworks] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details.\n" + e, this); Application.Quit(); return; } if (!m_bInitialized) { Debug.LogError("SteamAPI_Init() failed", this); return; } // Set up our callback to recieve warning messages from Steam. // You must launch with "-debug_steamapi" in the launch args to recieve warnings. SteamAPIWarningMessageHook = new SteamAPIWarningMessageHook_t(SteamAPIDebugTextHook); SteamClient.SetWarningMessageHook(SteamAPIWarningMessageHook); // We are going to use the controller interface, initialize it, which is a seperate step as it // create a new thread in the game proc and we don't want to force that on games that don't // have native Steam controller implementations m_bControllerInitialized = SteamController.Init(Application.dataPath + "/controller.vdf"); if (!m_bControllerInitialized) { Debug.LogWarning("Steam Controller Failed to Initialize"); } // Register our Steam Callbacks AppListTest = gameObject.AddComponent <SteamAppListTest>(); AppsTest = gameObject.AddComponent <SteamAppsTest>(); ClientTest = gameObject.AddComponent <SteamClientTest>(); ControllerTest = gameObject.AddComponent <SteamControllerTest>(); FriendsTest = gameObject.AddComponent <SteamFriendsTest>(); HTTPTest = gameObject.AddComponent <SteamHTTPTest>(); MatchmakingTest = gameObject.AddComponent <SteamMatchmakingTest>(); MatchmakingServersTest = gameObject.AddComponent <SteamMatchmakingServersTest>(); MusicTest = gameObject.AddComponent <SteamMusicTest>(); RemoteStorageTest = gameObject.AddComponent <SteamRemoteStorageTest>(); ScreenshotsTest = gameObject.AddComponent <SteamScreenshotsTest>(); UGCTest = gameObject.AddComponent <SteamUGCTest>(); UnifiedMessagesTest = gameObject.AddComponent <SteamUnifiedMessagesTest>(); UserTest = gameObject.AddComponent <SteamUserTest>(); UserStatsTest = gameObject.AddComponent <SteamUserStatsTest>(); UtilsTest = gameObject.AddComponent <SteamUtilsTest>(); }