UI换了很多,spine主视觉停用
This commit is contained in:
@@ -19,29 +19,33 @@ using Steamworks;
|
||||
// The SteamManager provides a base implementation of Steamworks.NET on which you can build upon.
|
||||
// It handles the basics of starting up and shutting down the SteamAPI for use.
|
||||
//
|
||||
[DefaultExecutionOrder(-10000)]
|
||||
[DisallowMultipleComponent]
|
||||
public class SteamManager : MonoBehaviour {
|
||||
#if !DISABLESTEAMWORKS
|
||||
protected const uint SteamAppIdValue = 2191270;
|
||||
protected static readonly AppId_t SteamAppId = new AppId_t(SteamAppIdValue);
|
||||
protected static bool s_EverInitialized = false;
|
||||
public static bool SteamVerificationEnabled { get; private set; } = true;
|
||||
|
||||
[Header("Steam")]
|
||||
[SerializeField]
|
||||
private bool enableSteamVerification = true;
|
||||
|
||||
protected static SteamManager s_instance;
|
||||
protected static SteamManager Instance {
|
||||
get {
|
||||
if (s_instance == null) {
|
||||
return new GameObject("SteamManager").AddComponent<SteamManager>();
|
||||
}
|
||||
else {
|
||||
return s_instance;
|
||||
s_instance = SceneObjectLookupCache.FindAny<SteamManager>();
|
||||
}
|
||||
return s_instance;
|
||||
}
|
||||
}
|
||||
|
||||
protected bool m_bInitialized = false;
|
||||
public static bool Initialized {
|
||||
get {
|
||||
return Instance.m_bInitialized;
|
||||
return Instance != null && Instance.m_bInitialized;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +85,8 @@ public class SteamManager : MonoBehaviour {
|
||||
// We want our SteamManager Instance to persist across scenes.
|
||||
DontDestroyOnLoad(gameObject);
|
||||
|
||||
SteamVerificationEnabled = enableSteamVerification;
|
||||
|
||||
if (!Packsize.Test()) {
|
||||
Debug.LogError("[Steamworks.NET] Packsize Test returned false, the wrong version of Steamworks.NET is being run in this platform.", this);
|
||||
}
|
||||
@@ -89,28 +95,30 @@ public class SteamManager : MonoBehaviour {
|
||||
Debug.LogError("[Steamworks.NET] DllCheck Test returned false, One or more of the Steamworks binaries seems to be the wrong version.", this);
|
||||
}
|
||||
|
||||
try {
|
||||
// If Steam is not running or the game wasn't started through Steam, SteamAPI_RestartAppIfNecessary starts the
|
||||
// Steam client and also launches this game again if the User owns it. This can act as a rudimentary form of DRM.
|
||||
// Note that this will run which ever version you have installed in steam. Which may not be the precise executable
|
||||
// we were currently running.
|
||||
if (SteamVerificationEnabled) {
|
||||
try {
|
||||
// If Steam is not running or the game wasn't started through Steam, SteamAPI_RestartAppIfNecessary starts the
|
||||
// Steam client and also launches this game again if the User owns it. This can act as a rudimentary form of DRM.
|
||||
// Note that this will run which ever version you have installed in steam. Which may not be the precise executable
|
||||
// we were currently running.
|
||||
|
||||
// Once you get a Steam AppID assigned by Valve, you need to replace AppId_t.Invalid with it and
|
||||
// remove steam_appid.txt from the game depot. eg: "(AppId_t)480" or "new AppId_t(480)".
|
||||
// See the Valve documentation for more information: https://partner.steamgames.com/doc/sdk/api#initialization_and_shutdown
|
||||
if (SteamAPI.RestartAppIfNecessary(SteamAppId)) {
|
||||
Debug.Log("[Steamworks.NET] Shutting down because RestartAppIfNecessary returned true. Steam will restart the application.");
|
||||
// Once you get a Steam AppID assigned by Valve, you need to replace AppId_t.Invalid with it and
|
||||
// remove steam_appid.txt from the game depot. eg: "(AppId_t)480" or "new AppId_t(480)".
|
||||
// See the Valve documentation for more information: https://partner.steamgames.com/doc/sdk/api#initialization_and_shutdown
|
||||
if (SteamAPI.RestartAppIfNecessary(SteamAppId)) {
|
||||
Debug.Log("[Steamworks.NET] Shutting down because RestartAppIfNecessary returned true. Steam will restart the application.");
|
||||
|
||||
Application.Quit();
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (System.DllNotFoundException e) { // We catch this exception here, as it will be the first occurrence of it.
|
||||
Debug.LogError("[Steamworks.NET] 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;
|
||||
}
|
||||
}
|
||||
catch (System.DllNotFoundException e) { // We catch this exception here, as it will be the first occurrence of it.
|
||||
Debug.LogError("[Steamworks.NET] 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;
|
||||
}
|
||||
|
||||
// Initializes the Steamworks API.
|
||||
// If this returns false then this indicates one of the following conditions:
|
||||
@@ -123,7 +131,12 @@ public class SteamManager : MonoBehaviour {
|
||||
// https://partner.steamgames.com/doc/sdk/api#initialization_and_shutdown
|
||||
m_bInitialized = SteamAPI.Init();
|
||||
if (!m_bInitialized) {
|
||||
Debug.LogError("[Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information.", this);
|
||||
if (SteamVerificationEnabled) {
|
||||
Debug.LogError("[Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information.", this);
|
||||
}
|
||||
else {
|
||||
Debug.LogWarning("[Steamworks.NET] SteamAPI_Init() failed, but Steam verification is disabled. Continuing without Steam.", this);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -180,5 +193,11 @@ public class SteamManager : MonoBehaviour {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SteamVerificationEnabled {
|
||||
get {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user