using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Net; using System.Net.Sockets; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security; using System.Text; using Microsoft.Win32.SafeHandles; using Unity.Collections; using UnityEngine; using UnityEngine.AI; using UnityEngine.Animations; using UnityEngine.Events; using UnityEngine.Experimental.Animations; using UnityEngine.Playables; using UnityEngine.Serialization; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] namespace Steamworks { public static class SteamAppList { public static uint GetNumInstalledApps() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamAppList_GetNumInstalledApps(CSteamAPIContext.GetSteamAppList()); } public static uint GetInstalledApps(AppId_t[] pvecAppID, uint unMaxAppIDs) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamAppList_GetInstalledApps(CSteamAPIContext.GetSteamAppList(), pvecAppID, unMaxAppIDs); } public static int GetAppName(AppId_t nAppID, out string pchName, int cchNameMax) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cchNameMax); int num = NativeMethods.ISteamAppList_GetAppName(CSteamAPIContext.GetSteamAppList(), nAppID, intPtr, cchNameMax); pchName = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static int GetAppInstallDir(AppId_t nAppID, out string pchDirectory, int cchNameMax) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cchNameMax); int num = NativeMethods.ISteamAppList_GetAppInstallDir(CSteamAPIContext.GetSteamAppList(), nAppID, intPtr, cchNameMax); pchDirectory = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static int GetAppBuildId(AppId_t nAppID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamAppList_GetAppBuildId(CSteamAPIContext.GetSteamAppList(), nAppID); } } public static class SteamApps { public static bool BIsSubscribed() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_BIsSubscribed(CSteamAPIContext.GetSteamApps()); } public static bool BIsLowViolence() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_BIsLowViolence(CSteamAPIContext.GetSteamApps()); } public static bool BIsCybercafe() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_BIsCybercafe(CSteamAPIContext.GetSteamApps()); } public static bool BIsVACBanned() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_BIsVACBanned(CSteamAPIContext.GetSteamApps()); } public static string GetCurrentGameLanguage() { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetCurrentGameLanguage(CSteamAPIContext.GetSteamApps())); } public static string GetAvailableGameLanguages() { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetAvailableGameLanguages(CSteamAPIContext.GetSteamApps())); } public static bool BIsSubscribedApp(AppId_t appID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_BIsSubscribedApp(CSteamAPIContext.GetSteamApps(), appID); } public static bool BIsDlcInstalled(AppId_t appID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_BIsDlcInstalled(CSteamAPIContext.GetSteamApps(), appID); } public static uint GetEarliestPurchaseUnixTime(AppId_t nAppID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_GetEarliestPurchaseUnixTime(CSteamAPIContext.GetSteamApps(), nAppID); } public static bool BIsSubscribedFromFreeWeekend() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_BIsSubscribedFromFreeWeekend(CSteamAPIContext.GetSteamApps()); } public static int GetDLCCount() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_GetDLCCount(CSteamAPIContext.GetSteamApps()); } public static bool BGetDLCDataByIndex(int iDLC, out AppId_t pAppID, out bool pbAvailable, out string pchName, int cchNameBufferSize) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cchNameBufferSize); bool flag = NativeMethods.ISteamApps_BGetDLCDataByIndex(CSteamAPIContext.GetSteamApps(), iDLC, out pAppID, out pbAvailable, intPtr, cchNameBufferSize); pchName = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static void InstallDLC(AppId_t nAppID) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamApps_InstallDLC(CSteamAPIContext.GetSteamApps(), nAppID); } public static void UninstallDLC(AppId_t nAppID) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamApps_UninstallDLC(CSteamAPIContext.GetSteamApps(), nAppID); } public static void RequestAppProofOfPurchaseKey(AppId_t nAppID) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamApps_RequestAppProofOfPurchaseKey(CSteamAPIContext.GetSteamApps(), nAppID); } public static bool GetCurrentBetaName(out string pchName, int cchNameBufferSize) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cchNameBufferSize); bool flag = NativeMethods.ISteamApps_GetCurrentBetaName(CSteamAPIContext.GetSteamApps(), intPtr, cchNameBufferSize); pchName = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static bool MarkContentCorrupt(bool bMissingFilesOnly) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_MarkContentCorrupt(CSteamAPIContext.GetSteamApps(), bMissingFilesOnly); } public static uint GetInstalledDepots(AppId_t appID, DepotId_t[] pvecDepots, uint cMaxDepots) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_GetInstalledDepots(CSteamAPIContext.GetSteamApps(), appID, pvecDepots, cMaxDepots); } public static uint GetAppInstallDir(AppId_t appID, out string pchFolder, uint cchFolderBufferSize) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchFolderBufferSize); uint num = NativeMethods.ISteamApps_GetAppInstallDir(CSteamAPIContext.GetSteamApps(), appID, intPtr, cchFolderBufferSize); pchFolder = ((num != 0) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static bool BIsAppInstalled(AppId_t appID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_BIsAppInstalled(CSteamAPIContext.GetSteamApps(), appID); } public static CSteamID GetAppOwner() { InteropHelp.TestIfAvailableClient(); return (CSteamID)NativeMethods.ISteamApps_GetAppOwner(CSteamAPIContext.GetSteamApps()); } public static string GetLaunchQueryParam(string pchKey) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetLaunchQueryParam(CSteamAPIContext.GetSteamApps(), pchKey2)); } public static bool GetDlcDownloadProgress(AppId_t nAppID, out ulong punBytesDownloaded, out ulong punBytesTotal) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_GetDlcDownloadProgress(CSteamAPIContext.GetSteamApps(), nAppID, out punBytesDownloaded, out punBytesTotal); } public static int GetAppBuildId() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_GetAppBuildId(CSteamAPIContext.GetSteamApps()); } public static void RequestAllProofOfPurchaseKeys() { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamApps_RequestAllProofOfPurchaseKeys(CSteamAPIContext.GetSteamApps()); } public static SteamAPICall_t GetFileDetails(string pszFileName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszFileName2 = new InteropHelp.UTF8StringHandle(pszFileName); return (SteamAPICall_t)NativeMethods.ISteamApps_GetFileDetails(CSteamAPIContext.GetSteamApps(), pszFileName2); } public static int GetLaunchCommandLine(out string pszCommandLine, int cubCommandLine) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cubCommandLine); int num = NativeMethods.ISteamApps_GetLaunchCommandLine(CSteamAPIContext.GetSteamApps(), intPtr, cubCommandLine); pszCommandLine = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static bool BIsSubscribedFromFamilySharing() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamApps_BIsSubscribedFromFamilySharing(CSteamAPIContext.GetSteamApps()); } } public static class SteamClient { public static HSteamPipe CreateSteamPipe() { InteropHelp.TestIfAvailableClient(); return (HSteamPipe)NativeMethods.ISteamClient_CreateSteamPipe(CSteamAPIContext.GetSteamClient()); } public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamClient_BReleaseSteamPipe(CSteamAPIContext.GetSteamClient(), hSteamPipe); } public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe) { InteropHelp.TestIfAvailableClient(); return (HSteamUser)NativeMethods.ISteamClient_ConnectToGlobalUser(CSteamAPIContext.GetSteamClient(), hSteamPipe); } public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType) { InteropHelp.TestIfAvailableClient(); return (HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(CSteamAPIContext.GetSteamClient(), out phSteamPipe, eAccountType); } public static void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamClient_ReleaseUser(CSteamAPIContext.GetSteamClient(), hSteamPipe, hUser); } public static IntPtr GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamUser(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamGameServer(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static void SetLocalIPBinding(ref SteamIPAddress_t unIP, ushort usPort) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamClient_SetLocalIPBinding(CSteamAPIContext.GetSteamClient(), ref unIP, usPort); } public static IntPtr GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamFriends(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamUtils(HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamUtils(CSteamAPIContext.GetSteamClient(), hSteamPipe, pchVersion2); } public static IntPtr GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamMatchmaking(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamMatchmakingServers(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamGenericInterface(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamUserStats(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamGameServerStats(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamApps(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamNetworking(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamRemoteStorage(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamScreenshots(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamGameSearch(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamGameSearch(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static uint GetIPCCallCount() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamClient_GetIPCCallCount(CSteamAPIContext.GetSteamClient()); } public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamClient_SetWarningMessageHook(CSteamAPIContext.GetSteamClient(), pFunction); } public static bool BShutdownIfAllPipesClosed() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamClient_BShutdownIfAllPipesClosed(CSteamAPIContext.GetSteamClient()); } public static IntPtr GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamHTTP(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamController(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamUGC(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamAppList(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamAppList(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamMusic(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamMusicRemote(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamHTMLSurface(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamInventory(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamVideo(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamParentalSettings(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamInput(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamInput(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamParties(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamParties(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamRemotePlay(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamRemotePlay(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } public static class SteamController { public static bool Init() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamController_Init(CSteamAPIContext.GetSteamController()); } public static bool Shutdown() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamController_Shutdown(CSteamAPIContext.GetSteamController()); } public static void RunFrame() { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamController_RunFrame(CSteamAPIContext.GetSteamController()); } public static int GetConnectedControllers(ControllerHandle_t[] handlesOut) { InteropHelp.TestIfAvailableClient(); if (handlesOut != null && handlesOut.Length != 16) { throw new ArgumentException("handlesOut must be the same size as Constants.STEAM_CONTROLLER_MAX_COUNT!"); } return NativeMethods.ISteamController_GetConnectedControllers(CSteamAPIContext.GetSteamController(), handlesOut); } public static ControllerActionSetHandle_t GetActionSetHandle(string pszActionSetName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszActionSetName2 = new InteropHelp.UTF8StringHandle(pszActionSetName); return (ControllerActionSetHandle_t)NativeMethods.ISteamController_GetActionSetHandle(CSteamAPIContext.GetSteamController(), pszActionSetName2); } public static void ActivateActionSet(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamController_ActivateActionSet(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetHandle); } public static ControllerActionSetHandle_t GetCurrentActionSet(ControllerHandle_t controllerHandle) { InteropHelp.TestIfAvailableClient(); return (ControllerActionSetHandle_t)NativeMethods.ISteamController_GetCurrentActionSet(CSteamAPIContext.GetSteamController(), controllerHandle); } public static void ActivateActionSetLayer(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamController_ActivateActionSetLayer(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetLayerHandle); } public static void DeactivateActionSetLayer(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamController_DeactivateActionSetLayer(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetLayerHandle); } public static void DeactivateAllActionSetLayers(ControllerHandle_t controllerHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamController_DeactivateAllActionSetLayers(CSteamAPIContext.GetSteamController(), controllerHandle); } public static int GetActiveActionSetLayers(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t[] handlesOut) { InteropHelp.TestIfAvailableClient(); if (handlesOut != null && handlesOut.Length != 16) { throw new ArgumentException("handlesOut must be the same size as Constants.STEAM_CONTROLLER_MAX_ACTIVE_LAYERS!"); } return NativeMethods.ISteamController_GetActiveActionSetLayers(CSteamAPIContext.GetSteamController(), controllerHandle, handlesOut); } public static ControllerDigitalActionHandle_t GetDigitalActionHandle(string pszActionName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszActionName2 = new InteropHelp.UTF8StringHandle(pszActionName); return (ControllerDigitalActionHandle_t)NativeMethods.ISteamController_GetDigitalActionHandle(CSteamAPIContext.GetSteamController(), pszActionName2); } public static InputDigitalActionData_t GetDigitalActionData(ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamController_GetDigitalActionData(CSteamAPIContext.GetSteamController(), controllerHandle, digitalActionHandle); } public static int GetDigitalActionOrigins(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin[] originsOut) { InteropHelp.TestIfAvailableClient(); if (originsOut != null && originsOut.Length != 8) { throw new ArgumentException("originsOut must be the same size as Constants.STEAM_CONTROLLER_MAX_ORIGINS!"); } return NativeMethods.ISteamController_GetDigitalActionOrigins(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetHandle, digitalActionHandle, originsOut); } public static ControllerAnalogActionHandle_t GetAnalogActionHandle(string pszActionName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszActionName2 = new InteropHelp.UTF8StringHandle(pszActionName); return (ControllerAnalogActionHandle_t)NativeMethods.ISteamController_GetAnalogActionHandle(CSteamAPIContext.GetSteamController(), pszActionName2); } public static InputAnalogActionData_t GetAnalogActionData(ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamController_GetAnalogActionData(CSteamAPIContext.GetSteamController(), controllerHandle, analogActionHandle); } public static int GetAnalogActionOrigins(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin[] originsOut) { InteropHelp.TestIfAvailableClient(); if (originsOut != null && originsOut.Length != 8) { throw new ArgumentException("originsOut must be the same size as Constants.STEAM_CONTROLLER_MAX_ORIGINS!"); } return NativeMethods.ISteamController_GetAnalogActionOrigins(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetHandle, analogActionHandle, originsOut); } public static string GetGlyphForActionOrigin(EControllerActionOrigin eOrigin) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamController_GetGlyphForActionOrigin(CSteamAPIContext.GetSteamController(), eOrigin)); } public static string GetStringForActionOrigin(EControllerActionOrigin eOrigin) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamController_GetStringForActionOrigin(CSteamAPIContext.GetSteamController(), eOrigin)); } public static void StopAnalogActionMomentum(ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamController_StopAnalogActionMomentum(CSteamAPIContext.GetSteamController(), controllerHandle, eAction); } public static InputMotionData_t GetMotionData(ControllerHandle_t controllerHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamController_GetMotionData(CSteamAPIContext.GetSteamController(), controllerHandle); } public static void TriggerHapticPulse(ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamController_TriggerHapticPulse(CSteamAPIContext.GetSteamController(), controllerHandle, eTargetPad, usDurationMicroSec); } public static void TriggerRepeatedHapticPulse(ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamController_TriggerRepeatedHapticPulse(CSteamAPIContext.GetSteamController(), controllerHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags); } public static void TriggerVibration(ControllerHandle_t controllerHandle, ushort usLeftSpeed, ushort usRightSpeed) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamController_TriggerVibration(CSteamAPIContext.GetSteamController(), controllerHandle, usLeftSpeed, usRightSpeed); } public static void SetLEDColor(ControllerHandle_t controllerHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamController_SetLEDColor(CSteamAPIContext.GetSteamController(), controllerHandle, nColorR, nColorG, nColorB, nFlags); } public static bool ShowBindingPanel(ControllerHandle_t controllerHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamController_ShowBindingPanel(CSteamAPIContext.GetSteamController(), controllerHandle); } public static ESteamInputType GetInputTypeForHandle(ControllerHandle_t controllerHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamController_GetInputTypeForHandle(CSteamAPIContext.GetSteamController(), controllerHandle); } public static ControllerHandle_t GetControllerForGamepadIndex(int nIndex) { InteropHelp.TestIfAvailableClient(); return (ControllerHandle_t)NativeMethods.ISteamController_GetControllerForGamepadIndex(CSteamAPIContext.GetSteamController(), nIndex); } public static int GetGamepadIndexForController(ControllerHandle_t ulControllerHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamController_GetGamepadIndexForController(CSteamAPIContext.GetSteamController(), ulControllerHandle); } public static string GetStringForXboxOrigin(EXboxOrigin eOrigin) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamController_GetStringForXboxOrigin(CSteamAPIContext.GetSteamController(), eOrigin)); } public static string GetGlyphForXboxOrigin(EXboxOrigin eOrigin) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamController_GetGlyphForXboxOrigin(CSteamAPIContext.GetSteamController(), eOrigin)); } public static EControllerActionOrigin GetActionOriginFromXboxOrigin(ControllerHandle_t controllerHandle, EXboxOrigin eOrigin) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamController_GetActionOriginFromXboxOrigin(CSteamAPIContext.GetSteamController(), controllerHandle, eOrigin); } public static EControllerActionOrigin TranslateActionOrigin(ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamController_TranslateActionOrigin(CSteamAPIContext.GetSteamController(), eDestinationInputType, eSourceOrigin); } public static bool GetControllerBindingRevision(ControllerHandle_t controllerHandle, out int pMajor, out int pMinor) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamController_GetControllerBindingRevision(CSteamAPIContext.GetSteamController(), controllerHandle, out pMajor, out pMinor); } } public static class SteamFriends { public static string GetPersonaName() { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetPersonaName(CSteamAPIContext.GetSteamFriends())); } public static SteamAPICall_t SetPersonaName(string pchPersonaName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchPersonaName2 = new InteropHelp.UTF8StringHandle(pchPersonaName); return (SteamAPICall_t)NativeMethods.ISteamFriends_SetPersonaName(CSteamAPIContext.GetSteamFriends(), pchPersonaName2); } public static EPersonaState GetPersonaState() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetPersonaState(CSteamAPIContext.GetSteamFriends()); } public static int GetFriendCount(EFriendFlags iFriendFlags) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetFriendCount(CSteamAPIContext.GetSteamFriends(), iFriendFlags); } public static CSteamID GetFriendByIndex(int iFriend, EFriendFlags iFriendFlags) { InteropHelp.TestIfAvailableClient(); return (CSteamID)NativeMethods.ISteamFriends_GetFriendByIndex(CSteamAPIContext.GetSteamFriends(), iFriend, iFriendFlags); } public static EFriendRelationship GetFriendRelationship(CSteamID steamIDFriend) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetFriendRelationship(CSteamAPIContext.GetSteamFriends(), steamIDFriend); } public static EPersonaState GetFriendPersonaState(CSteamID steamIDFriend) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetFriendPersonaState(CSteamAPIContext.GetSteamFriends(), steamIDFriend); } public static string GetFriendPersonaName(CSteamID steamIDFriend) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendPersonaName(CSteamAPIContext.GetSteamFriends(), steamIDFriend)); } public static bool GetFriendGamePlayed(CSteamID steamIDFriend, out FriendGameInfo_t pFriendGameInfo) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetFriendGamePlayed(CSteamAPIContext.GetSteamFriends(), steamIDFriend, out pFriendGameInfo); } public static string GetFriendPersonaNameHistory(CSteamID steamIDFriend, int iPersonaName) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendPersonaNameHistory(CSteamAPIContext.GetSteamFriends(), steamIDFriend, iPersonaName)); } public static int GetFriendSteamLevel(CSteamID steamIDFriend) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetFriendSteamLevel(CSteamAPIContext.GetSteamFriends(), steamIDFriend); } public static string GetPlayerNickname(CSteamID steamIDPlayer) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetPlayerNickname(CSteamAPIContext.GetSteamFriends(), steamIDPlayer)); } public static int GetFriendsGroupCount() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetFriendsGroupCount(CSteamAPIContext.GetSteamFriends()); } public static FriendsGroupID_t GetFriendsGroupIDByIndex(int iFG) { InteropHelp.TestIfAvailableClient(); return (FriendsGroupID_t)NativeMethods.ISteamFriends_GetFriendsGroupIDByIndex(CSteamAPIContext.GetSteamFriends(), iFG); } public static string GetFriendsGroupName(FriendsGroupID_t friendsGroupID) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendsGroupName(CSteamAPIContext.GetSteamFriends(), friendsGroupID)); } public static int GetFriendsGroupMembersCount(FriendsGroupID_t friendsGroupID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetFriendsGroupMembersCount(CSteamAPIContext.GetSteamFriends(), friendsGroupID); } public static void GetFriendsGroupMembersList(FriendsGroupID_t friendsGroupID, CSteamID[] pOutSteamIDMembers, int nMembersCount) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamFriends_GetFriendsGroupMembersList(CSteamAPIContext.GetSteamFriends(), friendsGroupID, pOutSteamIDMembers, nMembersCount); } public static bool HasFriend(CSteamID steamIDFriend, EFriendFlags iFriendFlags) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_HasFriend(CSteamAPIContext.GetSteamFriends(), steamIDFriend, iFriendFlags); } public static int GetClanCount() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetClanCount(CSteamAPIContext.GetSteamFriends()); } public static CSteamID GetClanByIndex(int iClan) { InteropHelp.TestIfAvailableClient(); return (CSteamID)NativeMethods.ISteamFriends_GetClanByIndex(CSteamAPIContext.GetSteamFriends(), iClan); } public static string GetClanName(CSteamID steamIDClan) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetClanName(CSteamAPIContext.GetSteamFriends(), steamIDClan)); } public static string GetClanTag(CSteamID steamIDClan) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetClanTag(CSteamAPIContext.GetSteamFriends(), steamIDClan)); } public static bool GetClanActivityCounts(CSteamID steamIDClan, out int pnOnline, out int pnInGame, out int pnChatting) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetClanActivityCounts(CSteamAPIContext.GetSteamFriends(), steamIDClan, out pnOnline, out pnInGame, out pnChatting); } public static SteamAPICall_t DownloadClanActivityCounts(CSteamID[] psteamIDClans, int cClansToRequest) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamFriends_DownloadClanActivityCounts(CSteamAPIContext.GetSteamFriends(), psteamIDClans, cClansToRequest); } public static int GetFriendCountFromSource(CSteamID steamIDSource) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetFriendCountFromSource(CSteamAPIContext.GetSteamFriends(), steamIDSource); } public static CSteamID GetFriendFromSourceByIndex(CSteamID steamIDSource, int iFriend) { InteropHelp.TestIfAvailableClient(); return (CSteamID)NativeMethods.ISteamFriends_GetFriendFromSourceByIndex(CSteamAPIContext.GetSteamFriends(), steamIDSource, iFriend); } public static bool IsUserInSource(CSteamID steamIDUser, CSteamID steamIDSource) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_IsUserInSource(CSteamAPIContext.GetSteamFriends(), steamIDUser, steamIDSource); } public static void SetInGameVoiceSpeaking(CSteamID steamIDUser, bool bSpeaking) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamFriends_SetInGameVoiceSpeaking(CSteamAPIContext.GetSteamFriends(), steamIDUser, bSpeaking); } public static void ActivateGameOverlay(string pchDialog) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchDialog2 = new InteropHelp.UTF8StringHandle(pchDialog); NativeMethods.ISteamFriends_ActivateGameOverlay(CSteamAPIContext.GetSteamFriends(), pchDialog2); } public static void ActivateGameOverlayToUser(string pchDialog, CSteamID steamID) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchDialog2 = new InteropHelp.UTF8StringHandle(pchDialog); NativeMethods.ISteamFriends_ActivateGameOverlayToUser(CSteamAPIContext.GetSteamFriends(), pchDialog2, steamID); } public static void ActivateGameOverlayToWebPage(string pchURL, EActivateGameOverlayToWebPageMode eMode = EActivateGameOverlayToWebPageMode.k_EActivateGameOverlayToWebPageMode_Default) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchURL2 = new InteropHelp.UTF8StringHandle(pchURL); NativeMethods.ISteamFriends_ActivateGameOverlayToWebPage(CSteamAPIContext.GetSteamFriends(), pchURL2, eMode); } public static void ActivateGameOverlayToStore(AppId_t nAppID, EOverlayToStoreFlag eFlag) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamFriends_ActivateGameOverlayToStore(CSteamAPIContext.GetSteamFriends(), nAppID, eFlag); } public static void SetPlayedWith(CSteamID steamIDUserPlayedWith) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamFriends_SetPlayedWith(CSteamAPIContext.GetSteamFriends(), steamIDUserPlayedWith); } public static void ActivateGameOverlayInviteDialog(CSteamID steamIDLobby) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamFriends_ActivateGameOverlayInviteDialog(CSteamAPIContext.GetSteamFriends(), steamIDLobby); } public static int GetSmallFriendAvatar(CSteamID steamIDFriend) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetSmallFriendAvatar(CSteamAPIContext.GetSteamFriends(), steamIDFriend); } public static int GetMediumFriendAvatar(CSteamID steamIDFriend) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetMediumFriendAvatar(CSteamAPIContext.GetSteamFriends(), steamIDFriend); } public static int GetLargeFriendAvatar(CSteamID steamIDFriend) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetLargeFriendAvatar(CSteamAPIContext.GetSteamFriends(), steamIDFriend); } public static bool RequestUserInformation(CSteamID steamIDUser, bool bRequireNameOnly) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_RequestUserInformation(CSteamAPIContext.GetSteamFriends(), steamIDUser, bRequireNameOnly); } public static SteamAPICall_t RequestClanOfficerList(CSteamID steamIDClan) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamFriends_RequestClanOfficerList(CSteamAPIContext.GetSteamFriends(), steamIDClan); } public static CSteamID GetClanOwner(CSteamID steamIDClan) { InteropHelp.TestIfAvailableClient(); return (CSteamID)NativeMethods.ISteamFriends_GetClanOwner(CSteamAPIContext.GetSteamFriends(), steamIDClan); } public static int GetClanOfficerCount(CSteamID steamIDClan) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetClanOfficerCount(CSteamAPIContext.GetSteamFriends(), steamIDClan); } public static CSteamID GetClanOfficerByIndex(CSteamID steamIDClan, int iOfficer) { InteropHelp.TestIfAvailableClient(); return (CSteamID)NativeMethods.ISteamFriends_GetClanOfficerByIndex(CSteamAPIContext.GetSteamFriends(), steamIDClan, iOfficer); } public static uint GetUserRestrictions() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetUserRestrictions(CSteamAPIContext.GetSteamFriends()); } public static bool SetRichPresence(string pchKey, string pchValue) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); using InteropHelp.UTF8StringHandle pchValue2 = new InteropHelp.UTF8StringHandle(pchValue); return NativeMethods.ISteamFriends_SetRichPresence(CSteamAPIContext.GetSteamFriends(), pchKey2, pchValue2); } public static void ClearRichPresence() { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamFriends_ClearRichPresence(CSteamAPIContext.GetSteamFriends()); } public static string GetFriendRichPresence(CSteamID steamIDFriend, string pchKey) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendRichPresence(CSteamAPIContext.GetSteamFriends(), steamIDFriend, pchKey2)); } public static int GetFriendRichPresenceKeyCount(CSteamID steamIDFriend) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetFriendRichPresenceKeyCount(CSteamAPIContext.GetSteamFriends(), steamIDFriend); } public static string GetFriendRichPresenceKeyByIndex(CSteamID steamIDFriend, int iKey) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendRichPresenceKeyByIndex(CSteamAPIContext.GetSteamFriends(), steamIDFriend, iKey)); } public static void RequestFriendRichPresence(CSteamID steamIDFriend) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamFriends_RequestFriendRichPresence(CSteamAPIContext.GetSteamFriends(), steamIDFriend); } public static bool InviteUserToGame(CSteamID steamIDFriend, string pchConnectString) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchConnectString2 = new InteropHelp.UTF8StringHandle(pchConnectString); return NativeMethods.ISteamFriends_InviteUserToGame(CSteamAPIContext.GetSteamFriends(), steamIDFriend, pchConnectString2); } public static int GetCoplayFriendCount() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetCoplayFriendCount(CSteamAPIContext.GetSteamFriends()); } public static CSteamID GetCoplayFriend(int iCoplayFriend) { InteropHelp.TestIfAvailableClient(); return (CSteamID)NativeMethods.ISteamFriends_GetCoplayFriend(CSteamAPIContext.GetSteamFriends(), iCoplayFriend); } public static int GetFriendCoplayTime(CSteamID steamIDFriend) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetFriendCoplayTime(CSteamAPIContext.GetSteamFriends(), steamIDFriend); } public static AppId_t GetFriendCoplayGame(CSteamID steamIDFriend) { InteropHelp.TestIfAvailableClient(); return (AppId_t)NativeMethods.ISteamFriends_GetFriendCoplayGame(CSteamAPIContext.GetSteamFriends(), steamIDFriend); } public static SteamAPICall_t JoinClanChatRoom(CSteamID steamIDClan) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamFriends_JoinClanChatRoom(CSteamAPIContext.GetSteamFriends(), steamIDClan); } public static bool LeaveClanChatRoom(CSteamID steamIDClan) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_LeaveClanChatRoom(CSteamAPIContext.GetSteamFriends(), steamIDClan); } public static int GetClanChatMemberCount(CSteamID steamIDClan) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetClanChatMemberCount(CSteamAPIContext.GetSteamFriends(), steamIDClan); } public static CSteamID GetChatMemberByIndex(CSteamID steamIDClan, int iUser) { InteropHelp.TestIfAvailableClient(); return (CSteamID)NativeMethods.ISteamFriends_GetChatMemberByIndex(CSteamAPIContext.GetSteamFriends(), steamIDClan, iUser); } public static bool SendClanChatMessage(CSteamID steamIDClanChat, string pchText) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchText2 = new InteropHelp.UTF8StringHandle(pchText); return NativeMethods.ISteamFriends_SendClanChatMessage(CSteamAPIContext.GetSteamFriends(), steamIDClanChat, pchText2); } public static int GetClanChatMessage(CSteamID steamIDClanChat, int iMessage, out string prgchText, int cchTextMax, out EChatEntryType peChatEntryType, out CSteamID psteamidChatter) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cchTextMax); int num = NativeMethods.ISteamFriends_GetClanChatMessage(CSteamAPIContext.GetSteamFriends(), steamIDClanChat, iMessage, intPtr, cchTextMax, out peChatEntryType, out psteamidChatter); prgchText = ((num != 0) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static bool IsClanChatAdmin(CSteamID steamIDClanChat, CSteamID steamIDUser) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_IsClanChatAdmin(CSteamAPIContext.GetSteamFriends(), steamIDClanChat, steamIDUser); } public static bool IsClanChatWindowOpenInSteam(CSteamID steamIDClanChat) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_IsClanChatWindowOpenInSteam(CSteamAPIContext.GetSteamFriends(), steamIDClanChat); } public static bool OpenClanChatWindowInSteam(CSteamID steamIDClanChat) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_OpenClanChatWindowInSteam(CSteamAPIContext.GetSteamFriends(), steamIDClanChat); } public static bool CloseClanChatWindowInSteam(CSteamID steamIDClanChat) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_CloseClanChatWindowInSteam(CSteamAPIContext.GetSteamFriends(), steamIDClanChat); } public static bool SetListenForFriendsMessages(bool bInterceptEnabled) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_SetListenForFriendsMessages(CSteamAPIContext.GetSteamFriends(), bInterceptEnabled); } public static bool ReplyToFriendMessage(CSteamID steamIDFriend, string pchMsgToSend) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchMsgToSend2 = new InteropHelp.UTF8StringHandle(pchMsgToSend); return NativeMethods.ISteamFriends_ReplyToFriendMessage(CSteamAPIContext.GetSteamFriends(), steamIDFriend, pchMsgToSend2); } public static int GetFriendMessage(CSteamID steamIDFriend, int iMessageID, out string pvData, int cubData, out EChatEntryType peChatEntryType) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cubData); int num = NativeMethods.ISteamFriends_GetFriendMessage(CSteamAPIContext.GetSteamFriends(), steamIDFriend, iMessageID, intPtr, cubData, out peChatEntryType); pvData = ((num != 0) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static SteamAPICall_t GetFollowerCount(CSteamID steamID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamFriends_GetFollowerCount(CSteamAPIContext.GetSteamFriends(), steamID); } public static SteamAPICall_t IsFollowing(CSteamID steamID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamFriends_IsFollowing(CSteamAPIContext.GetSteamFriends(), steamID); } public static SteamAPICall_t EnumerateFollowingList(uint unStartIndex) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamFriends_EnumerateFollowingList(CSteamAPIContext.GetSteamFriends(), unStartIndex); } public static bool IsClanPublic(CSteamID steamIDClan) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_IsClanPublic(CSteamAPIContext.GetSteamFriends(), steamIDClan); } public static bool IsClanOfficialGameGroup(CSteamID steamIDClan) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_IsClanOfficialGameGroup(CSteamAPIContext.GetSteamFriends(), steamIDClan); } public static int GetNumChatsWithUnreadPriorityMessages() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamFriends_GetNumChatsWithUnreadPriorityMessages(CSteamAPIContext.GetSteamFriends()); } public static void ActivateGameOverlayRemotePlayTogetherInviteDialog(CSteamID steamIDLobby) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamFriends_ActivateGameOverlayRemotePlayTogetherInviteDialog(CSteamAPIContext.GetSteamFriends(), steamIDLobby); } } public static class SteamGameServer { public static void SetProduct(string pszProduct) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszProduct2 = new InteropHelp.UTF8StringHandle(pszProduct); NativeMethods.ISteamGameServer_SetProduct(CSteamGameServerAPIContext.GetSteamGameServer(), pszProduct2); } public static void SetGameDescription(string pszGameDescription) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszGameDescription2 = new InteropHelp.UTF8StringHandle(pszGameDescription); NativeMethods.ISteamGameServer_SetGameDescription(CSteamGameServerAPIContext.GetSteamGameServer(), pszGameDescription2); } public static void SetModDir(string pszModDir) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszModDir2 = new InteropHelp.UTF8StringHandle(pszModDir); NativeMethods.ISteamGameServer_SetModDir(CSteamGameServerAPIContext.GetSteamGameServer(), pszModDir2); } public static void SetDedicatedServer(bool bDedicated) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_SetDedicatedServer(CSteamGameServerAPIContext.GetSteamGameServer(), bDedicated); } public static void LogOn(string pszToken) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszToken2 = new InteropHelp.UTF8StringHandle(pszToken); NativeMethods.ISteamGameServer_LogOn(CSteamGameServerAPIContext.GetSteamGameServer(), pszToken2); } public static void LogOnAnonymous() { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_LogOnAnonymous(CSteamGameServerAPIContext.GetSteamGameServer()); } public static void LogOff() { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_LogOff(CSteamGameServerAPIContext.GetSteamGameServer()); } public static bool BLoggedOn() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamGameServer_BLoggedOn(CSteamGameServerAPIContext.GetSteamGameServer()); } public static bool BSecure() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamGameServer_BSecure(CSteamGameServerAPIContext.GetSteamGameServer()); } public static CSteamID GetSteamID() { InteropHelp.TestIfAvailableGameServer(); return (CSteamID)NativeMethods.ISteamGameServer_GetSteamID(CSteamGameServerAPIContext.GetSteamGameServer()); } public static bool WasRestartRequested() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamGameServer_WasRestartRequested(CSteamGameServerAPIContext.GetSteamGameServer()); } public static void SetMaxPlayerCount(int cPlayersMax) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_SetMaxPlayerCount(CSteamGameServerAPIContext.GetSteamGameServer(), cPlayersMax); } public static void SetBotPlayerCount(int cBotplayers) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_SetBotPlayerCount(CSteamGameServerAPIContext.GetSteamGameServer(), cBotplayers); } public static void SetServerName(string pszServerName) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszServerName2 = new InteropHelp.UTF8StringHandle(pszServerName); NativeMethods.ISteamGameServer_SetServerName(CSteamGameServerAPIContext.GetSteamGameServer(), pszServerName2); } public static void SetMapName(string pszMapName) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszMapName2 = new InteropHelp.UTF8StringHandle(pszMapName); NativeMethods.ISteamGameServer_SetMapName(CSteamGameServerAPIContext.GetSteamGameServer(), pszMapName2); } public static void SetPasswordProtected(bool bPasswordProtected) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_SetPasswordProtected(CSteamGameServerAPIContext.GetSteamGameServer(), bPasswordProtected); } public static void SetSpectatorPort(ushort unSpectatorPort) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_SetSpectatorPort(CSteamGameServerAPIContext.GetSteamGameServer(), unSpectatorPort); } public static void SetSpectatorServerName(string pszSpectatorServerName) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszSpectatorServerName2 = new InteropHelp.UTF8StringHandle(pszSpectatorServerName); NativeMethods.ISteamGameServer_SetSpectatorServerName(CSteamGameServerAPIContext.GetSteamGameServer(), pszSpectatorServerName2); } public static void ClearAllKeyValues() { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_ClearAllKeyValues(CSteamGameServerAPIContext.GetSteamGameServer()); } public static void SetKeyValue(string pKey, string pValue) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pKey2 = new InteropHelp.UTF8StringHandle(pKey); using InteropHelp.UTF8StringHandle pValue2 = new InteropHelp.UTF8StringHandle(pValue); NativeMethods.ISteamGameServer_SetKeyValue(CSteamGameServerAPIContext.GetSteamGameServer(), pKey2, pValue2); } public static void SetGameTags(string pchGameTags) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchGameTags2 = new InteropHelp.UTF8StringHandle(pchGameTags); NativeMethods.ISteamGameServer_SetGameTags(CSteamGameServerAPIContext.GetSteamGameServer(), pchGameTags2); } public static void SetGameData(string pchGameData) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchGameData2 = new InteropHelp.UTF8StringHandle(pchGameData); NativeMethods.ISteamGameServer_SetGameData(CSteamGameServerAPIContext.GetSteamGameServer(), pchGameData2); } public static void SetRegion(string pszRegion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszRegion2 = new InteropHelp.UTF8StringHandle(pszRegion); NativeMethods.ISteamGameServer_SetRegion(CSteamGameServerAPIContext.GetSteamGameServer(), pszRegion2); } public static bool SendUserConnectAndAuthenticate(uint unIPClient, byte[] pvAuthBlob, uint cubAuthBlobSize, out CSteamID pSteamIDUser) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamGameServer_SendUserConnectAndAuthenticate(CSteamGameServerAPIContext.GetSteamGameServer(), unIPClient, pvAuthBlob, cubAuthBlobSize, out pSteamIDUser); } public static CSteamID CreateUnauthenticatedUserConnection() { InteropHelp.TestIfAvailableGameServer(); return (CSteamID)NativeMethods.ISteamGameServer_CreateUnauthenticatedUserConnection(CSteamGameServerAPIContext.GetSteamGameServer()); } public static void SendUserDisconnect(CSteamID steamIDUser) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_SendUserDisconnect(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDUser); } public static bool BUpdateUserData(CSteamID steamIDUser, string pchPlayerName, uint uScore) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchPlayerName2 = new InteropHelp.UTF8StringHandle(pchPlayerName); return NativeMethods.ISteamGameServer_BUpdateUserData(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDUser, pchPlayerName2, uScore); } public static HAuthTicket GetAuthSessionTicket(byte[] pTicket, int cbMaxTicket, out uint pcbTicket) { InteropHelp.TestIfAvailableGameServer(); return (HAuthTicket)NativeMethods.ISteamGameServer_GetAuthSessionTicket(CSteamGameServerAPIContext.GetSteamGameServer(), pTicket, cbMaxTicket, out pcbTicket); } public static EBeginAuthSessionResult BeginAuthSession(byte[] pAuthTicket, int cbAuthTicket, CSteamID steamID) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamGameServer_BeginAuthSession(CSteamGameServerAPIContext.GetSteamGameServer(), pAuthTicket, cbAuthTicket, steamID); } public static void EndAuthSession(CSteamID steamID) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_EndAuthSession(CSteamGameServerAPIContext.GetSteamGameServer(), steamID); } public static void CancelAuthTicket(HAuthTicket hAuthTicket) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_CancelAuthTicket(CSteamGameServerAPIContext.GetSteamGameServer(), hAuthTicket); } public static EUserHasLicenseForAppResult UserHasLicenseForApp(CSteamID steamID, AppId_t appID) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamGameServer_UserHasLicenseForApp(CSteamGameServerAPIContext.GetSteamGameServer(), steamID, appID); } public static bool RequestUserGroupStatus(CSteamID steamIDUser, CSteamID steamIDGroup) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamGameServer_RequestUserGroupStatus(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDUser, steamIDGroup); } public static void GetGameplayStats() { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_GetGameplayStats(CSteamGameServerAPIContext.GetSteamGameServer()); } public static SteamAPICall_t GetServerReputation() { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamGameServer_GetServerReputation(CSteamGameServerAPIContext.GetSteamGameServer()); } public static SteamIPAddress_t GetPublicIP() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamGameServer_GetPublicIP(CSteamGameServerAPIContext.GetSteamGameServer()); } public static bool HandleIncomingPacket(byte[] pData, int cbData, uint srcIP, ushort srcPort) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamGameServer_HandleIncomingPacket(CSteamGameServerAPIContext.GetSteamGameServer(), pData, cbData, srcIP, srcPort); } public static int GetNextOutgoingPacket(byte[] pOut, int cbMaxOut, out uint pNetAdr, out ushort pPort) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamGameServer_GetNextOutgoingPacket(CSteamGameServerAPIContext.GetSteamGameServer(), pOut, cbMaxOut, out pNetAdr, out pPort); } public static void EnableHeartbeats(bool bActive) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_EnableHeartbeats(CSteamGameServerAPIContext.GetSteamGameServer(), bActive); } public static void SetHeartbeatInterval(int iHeartbeatInterval) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_SetHeartbeatInterval(CSteamGameServerAPIContext.GetSteamGameServer(), iHeartbeatInterval); } public static void ForceHeartbeat() { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamGameServer_ForceHeartbeat(CSteamGameServerAPIContext.GetSteamGameServer()); } public static SteamAPICall_t AssociateWithClan(CSteamID steamIDClan) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamGameServer_AssociateWithClan(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDClan); } public static SteamAPICall_t ComputeNewPlayerCompatibility(CSteamID steamIDNewPlayer) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamGameServer_ComputeNewPlayerCompatibility(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDNewPlayer); } } public static class SteamGameServerApps { public static bool BIsSubscribed() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_BIsSubscribed(CSteamGameServerAPIContext.GetSteamApps()); } public static bool BIsLowViolence() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_BIsLowViolence(CSteamGameServerAPIContext.GetSteamApps()); } public static bool BIsCybercafe() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_BIsCybercafe(CSteamGameServerAPIContext.GetSteamApps()); } public static bool BIsVACBanned() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_BIsVACBanned(CSteamGameServerAPIContext.GetSteamApps()); } public static string GetCurrentGameLanguage() { InteropHelp.TestIfAvailableGameServer(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetCurrentGameLanguage(CSteamGameServerAPIContext.GetSteamApps())); } public static string GetAvailableGameLanguages() { InteropHelp.TestIfAvailableGameServer(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetAvailableGameLanguages(CSteamGameServerAPIContext.GetSteamApps())); } public static bool BIsSubscribedApp(AppId_t appID) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_BIsSubscribedApp(CSteamGameServerAPIContext.GetSteamApps(), appID); } public static bool BIsDlcInstalled(AppId_t appID) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_BIsDlcInstalled(CSteamGameServerAPIContext.GetSteamApps(), appID); } public static uint GetEarliestPurchaseUnixTime(AppId_t nAppID) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_GetEarliestPurchaseUnixTime(CSteamGameServerAPIContext.GetSteamApps(), nAppID); } public static bool BIsSubscribedFromFreeWeekend() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_BIsSubscribedFromFreeWeekend(CSteamGameServerAPIContext.GetSteamApps()); } public static int GetDLCCount() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_GetDLCCount(CSteamGameServerAPIContext.GetSteamApps()); } public static bool BGetDLCDataByIndex(int iDLC, out AppId_t pAppID, out bool pbAvailable, out string pchName, int cchNameBufferSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal(cchNameBufferSize); bool flag = NativeMethods.ISteamApps_BGetDLCDataByIndex(CSteamGameServerAPIContext.GetSteamApps(), iDLC, out pAppID, out pbAvailable, intPtr, cchNameBufferSize); pchName = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static void InstallDLC(AppId_t nAppID) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamApps_InstallDLC(CSteamGameServerAPIContext.GetSteamApps(), nAppID); } public static void UninstallDLC(AppId_t nAppID) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamApps_UninstallDLC(CSteamGameServerAPIContext.GetSteamApps(), nAppID); } public static void RequestAppProofOfPurchaseKey(AppId_t nAppID) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamApps_RequestAppProofOfPurchaseKey(CSteamGameServerAPIContext.GetSteamApps(), nAppID); } public static bool GetCurrentBetaName(out string pchName, int cchNameBufferSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal(cchNameBufferSize); bool flag = NativeMethods.ISteamApps_GetCurrentBetaName(CSteamGameServerAPIContext.GetSteamApps(), intPtr, cchNameBufferSize); pchName = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static bool MarkContentCorrupt(bool bMissingFilesOnly) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_MarkContentCorrupt(CSteamGameServerAPIContext.GetSteamApps(), bMissingFilesOnly); } public static uint GetInstalledDepots(AppId_t appID, DepotId_t[] pvecDepots, uint cMaxDepots) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_GetInstalledDepots(CSteamGameServerAPIContext.GetSteamApps(), appID, pvecDepots, cMaxDepots); } public static uint GetAppInstallDir(AppId_t appID, out string pchFolder, uint cchFolderBufferSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchFolderBufferSize); uint num = NativeMethods.ISteamApps_GetAppInstallDir(CSteamGameServerAPIContext.GetSteamApps(), appID, intPtr, cchFolderBufferSize); pchFolder = ((num != 0) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static bool BIsAppInstalled(AppId_t appID) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_BIsAppInstalled(CSteamGameServerAPIContext.GetSteamApps(), appID); } public static CSteamID GetAppOwner() { InteropHelp.TestIfAvailableGameServer(); return (CSteamID)NativeMethods.ISteamApps_GetAppOwner(CSteamGameServerAPIContext.GetSteamApps()); } public static string GetLaunchQueryParam(string pchKey) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetLaunchQueryParam(CSteamGameServerAPIContext.GetSteamApps(), pchKey2)); } public static bool GetDlcDownloadProgress(AppId_t nAppID, out ulong punBytesDownloaded, out ulong punBytesTotal) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_GetDlcDownloadProgress(CSteamGameServerAPIContext.GetSteamApps(), nAppID, out punBytesDownloaded, out punBytesTotal); } public static int GetAppBuildId() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_GetAppBuildId(CSteamGameServerAPIContext.GetSteamApps()); } public static void RequestAllProofOfPurchaseKeys() { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamApps_RequestAllProofOfPurchaseKeys(CSteamGameServerAPIContext.GetSteamApps()); } public static SteamAPICall_t GetFileDetails(string pszFileName) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszFileName2 = new InteropHelp.UTF8StringHandle(pszFileName); return (SteamAPICall_t)NativeMethods.ISteamApps_GetFileDetails(CSteamGameServerAPIContext.GetSteamApps(), pszFileName2); } public static int GetLaunchCommandLine(out string pszCommandLine, int cubCommandLine) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal(cubCommandLine); int num = NativeMethods.ISteamApps_GetLaunchCommandLine(CSteamGameServerAPIContext.GetSteamApps(), intPtr, cubCommandLine); pszCommandLine = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static bool BIsSubscribedFromFamilySharing() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamApps_BIsSubscribedFromFamilySharing(CSteamGameServerAPIContext.GetSteamApps()); } } public static class SteamGameServerClient { public static HSteamPipe CreateSteamPipe() { InteropHelp.TestIfAvailableGameServer(); return (HSteamPipe)NativeMethods.ISteamClient_CreateSteamPipe(CSteamGameServerAPIContext.GetSteamClient()); } public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamClient_BReleaseSteamPipe(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe); } public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe) { InteropHelp.TestIfAvailableGameServer(); return (HSteamUser)NativeMethods.ISteamClient_ConnectToGlobalUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe); } public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType) { InteropHelp.TestIfAvailableGameServer(); return (HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(CSteamGameServerAPIContext.GetSteamClient(), out phSteamPipe, eAccountType); } public static void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamClient_ReleaseUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, hUser); } public static IntPtr GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamGameServer(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static void SetLocalIPBinding(ref SteamIPAddress_t unIP, ushort usPort) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamClient_SetLocalIPBinding(CSteamGameServerAPIContext.GetSteamClient(), ref unIP, usPort); } public static IntPtr GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamFriends(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamUtils(HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamUtils(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, pchVersion2); } public static IntPtr GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamMatchmaking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamMatchmakingServers(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamGenericInterface(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamUserStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamGameServerStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamApps(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamNetworking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamRemoteStorage(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamScreenshots(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamGameSearch(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamGameSearch(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static uint GetIPCCallCount() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamClient_GetIPCCallCount(CSteamGameServerAPIContext.GetSteamClient()); } public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamClient_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamClient(), pFunction); } public static bool BShutdownIfAllPipesClosed() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamClient_BShutdownIfAllPipesClosed(CSteamGameServerAPIContext.GetSteamClient()); } public static IntPtr GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamHTTP(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamController(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamUGC(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamAppList(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamAppList(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamMusic(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamMusicRemote(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamHTMLSurface(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamInventory(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamVideo(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamParentalSettings(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamInput(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamInput(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamParties(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamParties(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } public static IntPtr GetISteamRemotePlay(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion); return NativeMethods.ISteamClient_GetISteamRemotePlay(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } public static class SteamGameServerHTTP { public static HTTPRequestHandle CreateHTTPRequest(EHTTPMethod eHTTPRequestMethod, string pchAbsoluteURL) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchAbsoluteURL2 = new InteropHelp.UTF8StringHandle(pchAbsoluteURL); return (HTTPRequestHandle)NativeMethods.ISteamHTTP_CreateHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), eHTTPRequestMethod, pchAbsoluteURL2); } public static bool SetHTTPRequestContextValue(HTTPRequestHandle hRequest, ulong ulContextValue) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_SetHTTPRequestContextValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, ulContextValue); } public static bool SetHTTPRequestNetworkActivityTimeout(HTTPRequestHandle hRequest, uint unTimeoutSeconds) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unTimeoutSeconds); } public static bool SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, string pchHeaderValue) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName); using InteropHelp.UTF8StringHandle pchHeaderValue2 = new InteropHelp.UTF8StringHandle(pchHeaderValue); return NativeMethods.ISteamHTTP_SetHTTPRequestHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pchHeaderValue2); } public static bool SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, string pchParamName, string pchParamValue) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchParamName2 = new InteropHelp.UTF8StringHandle(pchParamName); using InteropHelp.UTF8StringHandle pchParamValue2 = new InteropHelp.UTF8StringHandle(pchParamValue); return NativeMethods.ISteamHTTP_SetHTTPRequestGetOrPostParameter(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchParamName2, pchParamValue2); } public static bool SendHTTPRequest(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_SendHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle); } public static bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_SendHTTPRequestAndStreamResponse(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle); } public static bool DeferHTTPRequest(HTTPRequestHandle hRequest) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_DeferHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); } public static bool PrioritizeHTTPRequest(HTTPRequestHandle hRequest) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_PrioritizeHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); } public static bool GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, string pchHeaderName, out uint unResponseHeaderSize) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName); return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderSize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, out unResponseHeaderSize); } public static bool GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, byte[] pHeaderValueBuffer, uint unBufferSize) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName); return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pHeaderValueBuffer, unBufferSize); } public static bool GetHTTPResponseBodySize(HTTPRequestHandle hRequest, out uint unBodySize) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_GetHTTPResponseBodySize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out unBodySize); } public static bool GetHTTPResponseBodyData(HTTPRequestHandle hRequest, byte[] pBodyDataBuffer, uint unBufferSize) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_GetHTTPResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pBodyDataBuffer, unBufferSize); } public static bool GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint cOffset, byte[] pBodyDataBuffer, uint unBufferSize) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_GetHTTPStreamingResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, cOffset, pBodyDataBuffer, unBufferSize); } public static bool ReleaseHTTPRequest(HTTPRequestHandle hRequest) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_ReleaseHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest); } public static bool GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, out float pflPercentOut) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_GetHTTPDownloadProgressPct(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pflPercentOut); } public static bool SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, string pchContentType, byte[] pubBody, uint unBodyLen) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchContentType2 = new InteropHelp.UTF8StringHandle(pchContentType); return NativeMethods.ISteamHTTP_SetHTTPRequestRawPostBody(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchContentType2, pubBody, unBodyLen); } public static HTTPCookieContainerHandle CreateCookieContainer(bool bAllowResponsesToModify) { InteropHelp.TestIfAvailableGameServer(); return (HTTPCookieContainerHandle)NativeMethods.ISteamHTTP_CreateCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), bAllowResponsesToModify); } public static bool ReleaseCookieContainer(HTTPCookieContainerHandle hCookieContainer) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_ReleaseCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer); } public static bool SetCookie(HTTPCookieContainerHandle hCookieContainer, string pchHost, string pchUrl, string pchCookie) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchHost2 = new InteropHelp.UTF8StringHandle(pchHost); using InteropHelp.UTF8StringHandle pchUrl2 = new InteropHelp.UTF8StringHandle(pchUrl); using InteropHelp.UTF8StringHandle pchCookie2 = new InteropHelp.UTF8StringHandle(pchCookie); return NativeMethods.ISteamHTTP_SetCookie(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer, pchHost2, pchUrl2, pchCookie2); } public static bool SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_SetHTTPRequestCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, hCookieContainer); } public static bool SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, string pchUserAgentInfo) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchUserAgentInfo2 = new InteropHelp.UTF8StringHandle(pchUserAgentInfo); return NativeMethods.ISteamHTTP_SetHTTPRequestUserAgentInfo(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchUserAgentInfo2); } public static bool SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, bRequireVerifiedCertificate); } public static bool SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, uint unMilliseconds) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unMilliseconds); } public static bool GetHTTPRequestWasTimedOut(HTTPRequestHandle hRequest, out bool pbWasTimedOut) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamHTTP_GetHTTPRequestWasTimedOut(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pbWasTimedOut); } } public static class SteamGameServerInventory { public static EResult GetResultStatus(SteamInventoryResult_t resultHandle) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_GetResultStatus(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); } public static bool GetResultItems(SteamInventoryResult_t resultHandle, SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize) { InteropHelp.TestIfAvailableGameServer(); if (pOutItemsArray != null && pOutItemsArray.Length != punOutItemsArraySize) { throw new ArgumentException("pOutItemsArray must be the same size as punOutItemsArraySize!"); } return NativeMethods.ISteamInventory_GetResultItems(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutItemsArray, ref punOutItemsArraySize); } public static bool GetResultItemProperty(SteamInventoryResult_t resultHandle, uint unItemIndex, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)punValueBufferSizeOut); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); bool flag = NativeMethods.ISteamInventory_GetResultItemProperty(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, unItemIndex, pchPropertyName2, intPtr, ref punValueBufferSizeOut); pchValueBuffer = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static uint GetResultTimestamp(SteamInventoryResult_t resultHandle) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_GetResultTimestamp(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); } public static bool CheckResultSteamID(SteamInventoryResult_t resultHandle, CSteamID steamIDExpected) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_CheckResultSteamID(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, steamIDExpected); } public static void DestroyResult(SteamInventoryResult_t resultHandle) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamInventory_DestroyResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle); } public static bool GetAllItems(out SteamInventoryResult_t pResultHandle) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_GetAllItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle); } public static bool GetItemsByID(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t[] pInstanceIDs, uint unCountInstanceIDs) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_GetItemsByID(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pInstanceIDs, unCountInstanceIDs); } public static bool SerializeResult(SteamInventoryResult_t resultHandle, byte[] pOutBuffer, out uint punOutBufferSize) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_SerializeResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutBuffer, out punOutBufferSize); } public static bool DeserializeResult(out SteamInventoryResult_t pOutResultHandle, byte[] pBuffer, uint unBufferSize, bool bRESERVED_MUST_BE_FALSE = false) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_DeserializeResult(CSteamGameServerAPIContext.GetSteamInventory(), out pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE); } public static bool GenerateItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_GenerateItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength); } public static bool GrantPromoItems(out SteamInventoryResult_t pResultHandle) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_GrantPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle); } public static bool AddPromoItem(out SteamInventoryResult_t pResultHandle, SteamItemDef_t itemDef) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_AddPromoItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemDef); } public static bool AddPromoItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint unArrayLength) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_AddPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, unArrayLength); } public static bool ConsumeItem(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemConsume, uint unQuantity) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_ConsumeItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemConsume, unQuantity); } public static bool ExchangeItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayGenerate, uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, SteamItemInstanceID_t[] pArrayDestroy, uint[] punArrayDestroyQuantity, uint unArrayDestroyLength) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_ExchangeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength); } public static bool TransferItemQuantity(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemIdSource, uint unQuantity, SteamItemInstanceID_t itemIdDest) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_TransferItemQuantity(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemIdSource, unQuantity, itemIdDest); } public static void SendItemDropHeartbeat() { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamInventory_SendItemDropHeartbeat(CSteamGameServerAPIContext.GetSteamInventory()); } public static bool TriggerItemDrop(out SteamInventoryResult_t pResultHandle, SteamItemDef_t dropListDefinition) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_TriggerItemDrop(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, dropListDefinition); } public static bool TradeItems(out SteamInventoryResult_t pResultHandle, CSteamID steamIDTradePartner, SteamItemInstanceID_t[] pArrayGive, uint[] pArrayGiveQuantity, uint nArrayGiveLength, SteamItemInstanceID_t[] pArrayGet, uint[] pArrayGetQuantity, uint nArrayGetLength) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_TradeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength); } public static bool LoadItemDefinitions() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_LoadItemDefinitions(CSteamGameServerAPIContext.GetSteamInventory()); } public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) { InteropHelp.TestIfAvailableGameServer(); if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize) { throw new ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!"); } return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), pItemDefIDs, ref punItemDefIDsArraySize); } public static bool GetItemDefinitionProperty(SteamItemDef_t iDefinition, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)punValueBufferSizeOut); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); bool flag = NativeMethods.ISteamInventory_GetItemDefinitionProperty(CSteamGameServerAPIContext.GetSteamInventory(), iDefinition, pchPropertyName2, intPtr, ref punValueBufferSizeOut); pchValueBuffer = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs(CSteamID steamID) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID); } public static bool GetEligiblePromoItemDefinitionIDs(CSteamID steamID, SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) { InteropHelp.TestIfAvailableGameServer(); if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize) { throw new ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!"); } return NativeMethods.ISteamInventory_GetEligiblePromoItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID, pItemDefIDs, ref punItemDefIDsArraySize); } public static SteamAPICall_t StartPurchase(SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamInventory_StartPurchase(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, punArrayQuantity, unArrayLength); } public static SteamAPICall_t RequestPrices() { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamInventory_RequestPrices(CSteamGameServerAPIContext.GetSteamInventory()); } public static uint GetNumItemsWithPrices() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_GetNumItemsWithPrices(CSteamGameServerAPIContext.GetSteamInventory()); } public static bool GetItemsWithPrices(SteamItemDef_t[] pArrayItemDefs, ulong[] pCurrentPrices, ulong[] pBasePrices, uint unArrayLength) { InteropHelp.TestIfAvailableGameServer(); if (pArrayItemDefs != null && pArrayItemDefs.Length != unArrayLength) { throw new ArgumentException("pArrayItemDefs must be the same size as unArrayLength!"); } if (pCurrentPrices != null && pCurrentPrices.Length != unArrayLength) { throw new ArgumentException("pCurrentPrices must be the same size as unArrayLength!"); } if (pBasePrices != null && pBasePrices.Length != unArrayLength) { throw new ArgumentException("pBasePrices must be the same size as unArrayLength!"); } return NativeMethods.ISteamInventory_GetItemsWithPrices(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, pCurrentPrices, pBasePrices, unArrayLength); } public static bool GetItemPrice(SteamItemDef_t iDefinition, out ulong pCurrentPrice, out ulong pBasePrice) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_GetItemPrice(CSteamGameServerAPIContext.GetSteamInventory(), iDefinition, out pCurrentPrice, out pBasePrice); } public static SteamInventoryUpdateHandle_t StartUpdateProperties() { InteropHelp.TestIfAvailableGameServer(); return (SteamInventoryUpdateHandle_t)NativeMethods.ISteamInventory_StartUpdateProperties(CSteamGameServerAPIContext.GetSteamInventory()); } public static bool RemoveProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); return NativeMethods.ISteamInventory_RemoveProperty(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2); } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, string pchPropertyValue) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); using InteropHelp.UTF8StringHandle pchPropertyValue2 = new InteropHelp.UTF8StringHandle(pchPropertyValue); return NativeMethods.ISteamInventory_SetPropertyString(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, pchPropertyValue2); } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, bool bValue) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); return NativeMethods.ISteamInventory_SetPropertyBool(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, bValue); } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, long nValue) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); return NativeMethods.ISteamInventory_SetPropertyInt64(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, nValue); } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, float flValue) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); return NativeMethods.ISteamInventory_SetPropertyFloat(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, flValue); } public static bool SubmitUpdateProperties(SteamInventoryUpdateHandle_t handle, out SteamInventoryResult_t pResultHandle) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamInventory_SubmitUpdateProperties(CSteamGameServerAPIContext.GetSteamInventory(), handle, out pResultHandle); } } public static class SteamGameServerNetworking { public static bool SendP2PPacket(CSteamID steamIDRemote, byte[] pubData, uint cubData, EP2PSend eP2PSendType, int nChannel = 0) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_SendP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, pubData, cubData, eP2PSendType, nChannel); } public static bool IsP2PPacketAvailable(out uint pcubMsgSize, int nChannel = 0) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_IsP2PPacketAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), out pcubMsgSize, nChannel); } public static bool ReadP2PPacket(byte[] pubDest, uint cubDest, out uint pcubMsgSize, out CSteamID psteamIDRemote, int nChannel = 0) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_ReadP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel); } public static bool AcceptP2PSessionWithUser(CSteamID steamIDRemote) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_AcceptP2PSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote); } public static bool CloseP2PSessionWithUser(CSteamID steamIDRemote) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_CloseP2PSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote); } public static bool CloseP2PChannelWithUser(CSteamID steamIDRemote, int nChannel) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_CloseP2PChannelWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, nChannel); } public static bool GetP2PSessionState(CSteamID steamIDRemote, out P2PSessionState_t pConnectionState) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_GetP2PSessionState(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, out pConnectionState); } public static bool AllowP2PPacketRelay(bool bAllow) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_AllowP2PPacketRelay(CSteamGameServerAPIContext.GetSteamNetworking(), bAllow); } public static SNetListenSocket_t CreateListenSocket(int nVirtualP2PPort, SteamIPAddress_t nIP, ushort nPort, bool bAllowUseOfPacketRelay) { InteropHelp.TestIfAvailableGameServer(); return (SNetListenSocket_t)NativeMethods.ISteamNetworking_CreateListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay); } public static SNetSocket_t CreateP2PConnectionSocket(CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay) { InteropHelp.TestIfAvailableGameServer(); return (SNetSocket_t)NativeMethods.ISteamNetworking_CreateP2PConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay); } public static SNetSocket_t CreateConnectionSocket(SteamIPAddress_t nIP, ushort nPort, int nTimeoutSec) { InteropHelp.TestIfAvailableGameServer(); return (SNetSocket_t)NativeMethods.ISteamNetworking_CreateConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nIP, nPort, nTimeoutSec); } public static bool DestroySocket(SNetSocket_t hSocket, bool bNotifyRemoteEnd) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_DestroySocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd); } public static bool DestroyListenSocket(SNetListenSocket_t hSocket, bool bNotifyRemoteEnd) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_DestroyListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd); } public static bool SendDataOnSocket(SNetSocket_t hSocket, byte[] pubData, uint cubData, bool bReliable) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_SendDataOnSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, pubData, cubData, bReliable); } public static bool IsDataAvailableOnSocket(SNetSocket_t hSocket, out uint pcubMsgSize) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_IsDataAvailableOnSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, out pcubMsgSize); } public static bool RetrieveDataFromSocket(SNetSocket_t hSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_RetrieveDataFromSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, pubDest, cubDest, out pcubMsgSize); } public static bool IsDataAvailable(SNetListenSocket_t hListenSocket, out uint pcubMsgSize, out SNetSocket_t phSocket) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_IsDataAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pcubMsgSize, out phSocket); } public static bool RetrieveData(SNetListenSocket_t hListenSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize, out SNetSocket_t phSocket) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_RetrieveData(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, pubDest, cubDest, out pcubMsgSize, out phSocket); } public static bool GetSocketInfo(SNetSocket_t hSocket, out CSteamID pSteamIDRemote, out int peSocketStatus, out SteamIPAddress_t punIPRemote, out ushort punPortRemote) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_GetSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, out pSteamIDRemote, out peSocketStatus, out punIPRemote, out punPortRemote); } public static bool GetListenSocketInfo(SNetListenSocket_t hListenSocket, out SteamIPAddress_t pnIP, out ushort pnPort) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_GetListenSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pnIP, out pnPort); } public static ESNetSocketConnectionType GetSocketConnectionType(SNetSocket_t hSocket) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_GetSocketConnectionType(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket); } public static int GetMaxPacketSize(SNetSocket_t hSocket) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworking_GetMaxPacketSize(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket); } } public static class SteamGameServerNetworkingSockets { public static HSteamListenSocket CreateListenSocketIP(ref SteamNetworkingIPAddr localAddress, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateListenSocketIP(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref localAddress, nOptions, pOptions); } public static HSteamNetConnection ConnectByIPAddress(ref SteamNetworkingIPAddr address, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectByIPAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref address, nOptions, pOptions); } public static HSteamListenSocket CreateListenSocketP2P(int nVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateListenSocketP2P(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nVirtualPort, nOptions, pOptions); } public static HSteamNetConnection ConnectP2P(ref SteamNetworkingIdentity identityRemote, int nVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectP2P(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityRemote, nVirtualPort, nOptions, pOptions); } public static EResult AcceptConnection(HSteamNetConnection hConn) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_AcceptConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn); } public static bool CloseConnection(HSteamNetConnection hPeer, int nReason, string pszDebug, bool bEnableLinger) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszDebug2 = new InteropHelp.UTF8StringHandle(pszDebug); return NativeMethods.ISteamNetworkingSockets_CloseConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, nReason, pszDebug2, bEnableLinger); } public static bool CloseListenSocket(HSteamListenSocket hSocket) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_CloseListenSocket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hSocket); } public static bool SetConnectionUserData(HSteamNetConnection hPeer, long nUserData) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_SetConnectionUserData(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, nUserData); } public static long GetConnectionUserData(HSteamNetConnection hPeer) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_GetConnectionUserData(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer); } public static void SetConnectionName(HSteamNetConnection hPeer, string pszName) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszName2 = new InteropHelp.UTF8StringHandle(pszName); NativeMethods.ISteamNetworkingSockets_SetConnectionName(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, pszName2); } public static bool GetConnectionName(HSteamNetConnection hPeer, out string pszName, int nMaxLen) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal(nMaxLen); bool flag = NativeMethods.ISteamNetworkingSockets_GetConnectionName(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPeer, intPtr, nMaxLen); pszName = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static EResult SendMessageToConnection(HSteamNetConnection hConn, IntPtr pData, uint cbData, int nSendFlags, out long pOutMessageNumber) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_SendMessageToConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, pData, cbData, nSendFlags, out pOutMessageNumber); } public static void SendMessages(int nMessages, SteamNetworkingMessage_t[] pMessages, long[] pOutMessageNumberOrResult) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamNetworkingSockets_SendMessages(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nMessages, pMessages, pOutMessageNumberOrResult); } public static EResult FlushMessagesOnConnection(HSteamNetConnection hConn) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_FlushMessagesOnConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn); } public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, IntPtr[] ppOutMessages, int nMaxMessages) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnConnection(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, ppOutMessages, nMaxMessages); } public static bool GetConnectionInfo(HSteamNetConnection hConn, out SteamNetConnectionInfo_t pInfo) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); } public static bool GetQuickConnectionStatus(HSteamNetConnection hConn, out SteamNetworkingQuickConnectionStatus pStats) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_GetQuickConnectionStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, out pStats); } public static int GetDetailedConnectionStatus(HSteamNetConnection hConn, out string pszBuf, int cbBuf) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal(cbBuf); int num = NativeMethods.ISteamNetworkingSockets_GetDetailedConnectionStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, intPtr, cbBuf); pszBuf = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static bool GetListenSocketAddress(HSteamListenSocket hSocket, out SteamNetworkingIPAddr address) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_GetListenSocketAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hSocket, out address); } public static bool CreateSocketPair(out HSteamNetConnection pOutConnection1, out HSteamNetConnection pOutConnection2, bool bUseNetworkLoopback, ref SteamNetworkingIdentity pIdentity1, ref SteamNetworkingIdentity pIdentity2) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_CreateSocketPair(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pOutConnection1, out pOutConnection2, bUseNetworkLoopback, ref pIdentity1, ref pIdentity2); } public static bool GetIdentity(out SteamNetworkingIdentity pIdentity) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_GetIdentity(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pIdentity); } public static ESteamNetworkingAvailability InitAuthentication() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_InitAuthentication(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } public static ESteamNetworkingAvailability GetAuthenticationStatus(out SteamNetAuthenticationStatus_t pDetails) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_GetAuthenticationStatus(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pDetails); } public static HSteamNetPollGroup CreatePollGroup() { InteropHelp.TestIfAvailableGameServer(); return (HSteamNetPollGroup)NativeMethods.ISteamNetworkingSockets_CreatePollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } public static bool DestroyPollGroup(HSteamNetPollGroup hPollGroup) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_DestroyPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPollGroup); } public static bool SetConnectionPollGroup(HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_SetConnectionPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, hPollGroup); } public static int ReceiveMessagesOnPollGroup(HSteamNetPollGroup hPollGroup, IntPtr[] ppOutMessages, int nMaxMessages) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnPollGroup(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hPollGroup, ppOutMessages, nMaxMessages); } public static bool ReceivedRelayAuthTicket(IntPtr pvTicket, int cbTicket, out SteamDatagramRelayAuthTicket pOutParsedTicket) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_ReceivedRelayAuthTicket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pvTicket, cbTicket, out pOutParsedTicket); } public static int FindRelayAuthTicketForServer(ref SteamNetworkingIdentity identityGameServer, int nVirtualPort, out SteamDatagramRelayAuthTicket pOutParsedTicket) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_FindRelayAuthTicketForServer(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityGameServer, nVirtualPort, out pOutParsedTicket); } public static HSteamNetConnection ConnectToHostedDedicatedServer(ref SteamNetworkingIdentity identityTarget, int nVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectToHostedDedicatedServer(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), ref identityTarget, nVirtualPort, nOptions, pOptions); } public static ushort GetHostedDedicatedServerPort() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_GetHostedDedicatedServerPort(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } public static SteamNetworkingPOPID GetHostedDedicatedServerPOPID() { InteropHelp.TestIfAvailableGameServer(); return (SteamNetworkingPOPID)NativeMethods.ISteamNetworkingSockets_GetHostedDedicatedServerPOPID(CSteamGameServerAPIContext.GetSteamNetworkingSockets()); } public static EResult GetHostedDedicatedServerAddress(out SteamDatagramHostedAddress pRouting) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_GetHostedDedicatedServerAddress(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pRouting); } public static HSteamListenSocket CreateHostedDedicatedServerListenSocket(int nVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateHostedDedicatedServerListenSocket(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), nVirtualPort, nOptions, pOptions); } public static EResult GetGameCoordinatorServerLogin(out SteamDatagramGameCoordinatorServerLogin pLoginInfo, out int pcbSignedBlob, IntPtr pBlob) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_GetGameCoordinatorServerLogin(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pLoginInfo, out pcbSignedBlob, pBlob); } public static HSteamNetConnection ConnectP2PCustomSignaling(out ISteamNetworkingConnectionCustomSignaling pSignaling, ref SteamNetworkingIdentity pPeerIdentity, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableGameServer(); return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectP2PCustomSignaling(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pSignaling, ref pPeerIdentity, nOptions, pOptions); } public static bool ReceivedP2PCustomSignal(IntPtr pMsg, int cbMsg, out ISteamNetworkingCustomSignalingRecvContext pContext) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_ReceivedP2PCustomSignal(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pMsg, cbMsg, out pContext); } public static bool GetCertificateRequest(out int pcbBlob, IntPtr pBlob, out SteamNetworkingErrMsg errMsg) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_GetCertificateRequest(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), out pcbBlob, pBlob, out errMsg); } public static bool SetCertificate(IntPtr pCertificate, int cbCertificate, out SteamNetworkingErrMsg errMsg) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingSockets_SetCertificate(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), pCertificate, cbCertificate, out errMsg); } } public static class SteamGameServerNetworkingUtils { public static IntPtr AllocateMessage(int cbAllocateBuffer) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_AllocateMessage(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), cbAllocateBuffer); } public static ESteamNetworkingAvailability GetRelayNetworkStatus(out SteamRelayNetworkStatus_t pDetails) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_GetRelayNetworkStatus(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pDetails); } public static float GetLocalPingLocation(out SteamNetworkPingLocation_t result) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_GetLocalPingLocation(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out result); } public static int EstimatePingTimeBetweenTwoLocations(ref SteamNetworkPingLocation_t location1, ref SteamNetworkPingLocation_t location2) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_EstimatePingTimeBetweenTwoLocations(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref location1, ref location2); } public static int EstimatePingTimeFromLocalHost(ref SteamNetworkPingLocation_t remoteLocation) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_EstimatePingTimeFromLocalHost(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref remoteLocation); } public static void ConvertPingLocationToString(ref SteamNetworkPingLocation_t location, out string pszBuf, int cchBufSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal(cchBufSize); NativeMethods.ISteamNetworkingUtils_ConvertPingLocationToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref location, intPtr, cchBufSize); pszBuf = InteropHelp.PtrToStringUTF8(intPtr); Marshal.FreeHGlobal(intPtr); } public static bool ParsePingLocationString(string pszString, out SteamNetworkPingLocation_t result) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszString2 = new InteropHelp.UTF8StringHandle(pszString); return NativeMethods.ISteamNetworkingUtils_ParsePingLocationString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), pszString2, out result); } public static bool CheckPingDataUpToDate(float flMaxAgeSeconds) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_CheckPingDataUpToDate(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), flMaxAgeSeconds); } public static int GetPingToDataCenter(SteamNetworkingPOPID popID, out SteamNetworkingPOPID pViaRelayPoP) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_GetPingToDataCenter(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), popID, out pViaRelayPoP); } public static int GetDirectPingToPOP(SteamNetworkingPOPID popID) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_GetDirectPingToPOP(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), popID); } public static int GetPOPCount() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_GetPOPCount(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); } public static int GetPOPList(out SteamNetworkingPOPID list, int nListSz) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_GetPOPList(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out list, nListSz); } public static SteamNetworkingMicroseconds GetLocalTimestamp() { InteropHelp.TestIfAvailableGameServer(); return (SteamNetworkingMicroseconds)NativeMethods.ISteamNetworkingUtils_GetLocalTimestamp(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); } public static void SetDebugOutputFunction(ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamNetworkingUtils_SetDebugOutputFunction(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eDetailLevel, pfnFunc); } public static bool SetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, ESteamNetworkingConfigDataType eDataType, IntPtr pArg) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_SetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, eDataType, pArg); } public static ESteamNetworkingGetConfigValueResult GetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, out ESteamNetworkingConfigDataType pOutDataType, IntPtr pResult, out ulong cbResult) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_GetConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, out pOutDataType, pResult, out cbResult); } public static bool GetConfigValueInfo(ESteamNetworkingConfigValue eValue, IntPtr pOutName, out ESteamNetworkingConfigDataType pOutDataType, out ESteamNetworkingConfigScope pOutScope, out ESteamNetworkingConfigValue pOutNextValue) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_GetConfigValueInfo(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), eValue, pOutName, out pOutDataType, out pOutScope, out pOutNextValue); } public static ESteamNetworkingConfigValue GetFirstConfigValue() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamNetworkingUtils_GetFirstConfigValue(CSteamGameServerAPIContext.GetSteamNetworkingUtils()); } public static void SteamNetworkingIPAddr_ToString(ref SteamNetworkingIPAddr addr, out string buf, uint cbBuf, bool bWithPort) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)cbBuf); NativeMethods.ISteamNetworkingUtils_SteamNetworkingIPAddr_ToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref addr, intPtr, cbBuf, bWithPort); buf = InteropHelp.PtrToStringUTF8(intPtr); Marshal.FreeHGlobal(intPtr); } public static bool SteamNetworkingIPAddr_ParseString(out SteamNetworkingIPAddr pAddr, string pszStr) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszStr2 = new InteropHelp.UTF8StringHandle(pszStr); return NativeMethods.ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pAddr, pszStr2); } public static void SteamNetworkingIdentity_ToString(ref SteamNetworkingIdentity identity, out string buf, uint cbBuf) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)cbBuf); NativeMethods.ISteamNetworkingUtils_SteamNetworkingIdentity_ToString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), ref identity, intPtr, cbBuf); buf = InteropHelp.PtrToStringUTF8(intPtr); Marshal.FreeHGlobal(intPtr); } public static bool SteamNetworkingIdentity_ParseString(out SteamNetworkingIdentity pIdentity, string pszStr) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszStr2 = new InteropHelp.UTF8StringHandle(pszStr); return NativeMethods.ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString(CSteamGameServerAPIContext.GetSteamNetworkingUtils(), out pIdentity, pszStr2); } } public static class SteamGameServerStats { public static SteamAPICall_t RequestUserStats(CSteamID steamIDUser) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamGameServerStats_RequestUserStats(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser); } public static bool GetUserStat(CSteamID steamIDUser, string pchName, out int pData) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamGameServerStats_GetUserStatInt32(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, out pData); } public static bool GetUserStat(CSteamID steamIDUser, string pchName, out float pData) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamGameServerStats_GetUserStatFloat(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, out pData); } public static bool GetUserAchievement(CSteamID steamIDUser, string pchName, out bool pbAchieved) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamGameServerStats_GetUserAchievement(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, out pbAchieved); } public static bool SetUserStat(CSteamID steamIDUser, string pchName, int nData) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamGameServerStats_SetUserStatInt32(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, nData); } public static bool SetUserStat(CSteamID steamIDUser, string pchName, float fData) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamGameServerStats_SetUserStatFloat(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, fData); } public static bool UpdateUserAvgRateStat(CSteamID steamIDUser, string pchName, float flCountThisSession, double dSessionLength) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamGameServerStats_UpdateUserAvgRateStat(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, flCountThisSession, dSessionLength); } public static bool SetUserAchievement(CSteamID steamIDUser, string pchName) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamGameServerStats_SetUserAchievement(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2); } public static bool ClearUserAchievement(CSteamID steamIDUser, string pchName) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamGameServerStats_ClearUserAchievement(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2); } public static SteamAPICall_t StoreUserStats(CSteamID steamIDUser) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamGameServerStats_StoreUserStats(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser); } } public static class SteamGameServerUGC { public static UGCQueryHandle_t CreateQueryUserUGCRequest(AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage) { InteropHelp.TestIfAvailableGameServer(); return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryUserUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage); } public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage) { InteropHelp.TestIfAvailableGameServer(); return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryAllUGCRequestPage(CSteamGameServerAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage); } public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, string pchCursor = null) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchCursor2 = new InteropHelp.UTF8StringHandle(pchCursor); return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryAllUGCRequestCursor(CSteamGameServerAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, pchCursor2); } public static UGCQueryHandle_t CreateQueryUGCDetailsRequest(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableGameServer(); return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryUGCDetailsRequest(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); } public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_SendQueryUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), handle); } public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, out pDetails); } public static bool GetQueryUGCPreviewURL(UGCQueryHandle_t handle, uint index, out string pchURL, uint cchURLSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchURLSize); bool flag = NativeMethods.ISteamUGC_GetQueryUGCPreviewURL(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, intPtr, cchURLSize); pchURL = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static bool GetQueryUGCMetadata(UGCQueryHandle_t handle, uint index, out string pchMetadata, uint cchMetadatasize) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchMetadatasize); bool flag = NativeMethods.ISteamUGC_GetQueryUGCMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, intPtr, cchMetadatasize); pchMetadata = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static bool GetQueryUGCChildren(UGCQueryHandle_t handle, uint index, PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_GetQueryUGCChildren(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pvecPublishedFileID, cMaxEntries); } public static bool GetQueryUGCStatistic(UGCQueryHandle_t handle, uint index, EItemStatistic eStatType, out ulong pStatValue) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_GetQueryUGCStatistic(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, eStatType, out pStatValue); } public static uint GetQueryUGCNumAdditionalPreviews(UGCQueryHandle_t handle, uint index) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_GetQueryUGCNumAdditionalPreviews(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); } public static bool GetQueryUGCAdditionalPreview(UGCQueryHandle_t handle, uint index, uint previewIndex, out string pchURLOrVideoID, uint cchURLSize, out string pchOriginalFileName, uint cchOriginalFileNameSize, out EItemPreviewType pPreviewType) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchURLSize); IntPtr intPtr2 = Marshal.AllocHGlobal((int)cchOriginalFileNameSize); bool flag = NativeMethods.ISteamUGC_GetQueryUGCAdditionalPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, previewIndex, intPtr, cchURLSize, intPtr2, cchOriginalFileNameSize, out pPreviewType); pchURLOrVideoID = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); pchOriginalFileName = (flag ? InteropHelp.PtrToStringUTF8(intPtr2) : null); Marshal.FreeHGlobal(intPtr2); return flag; } public static uint GetQueryUGCNumKeyValueTags(UGCQueryHandle_t handle, uint index) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_GetQueryUGCNumKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); } public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, out string pchKey, uint cchKeySize, out string pchValue, uint cchValueSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchKeySize); IntPtr intPtr2 = Marshal.AllocHGlobal((int)cchValueSize); bool flag = NativeMethods.ISteamUGC_GetQueryUGCKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, keyValueTagIndex, intPtr, cchKeySize, intPtr2, cchValueSize); pchKey = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); pchValue = (flag ? InteropHelp.PtrToStringUTF8(intPtr2) : null); Marshal.FreeHGlobal(intPtr2); return flag; } public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, string pchKey, out string pchValue, uint cchValueSize) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchValueSize); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); bool flag = NativeMethods.ISteamUGC_GetQueryFirstUGCKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchKey2, intPtr, cchValueSize); pchValue = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static bool ReleaseQueryUGCRequest(UGCQueryHandle_t handle) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_ReleaseQueryUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), handle); } public static bool AddRequiredTag(UGCQueryHandle_t handle, string pTagName) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pTagName2 = new InteropHelp.UTF8StringHandle(pTagName); return NativeMethods.ISteamUGC_AddRequiredTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pTagName2); } public static bool AddRequiredTagGroup(UGCQueryHandle_t handle, IList pTagGroups) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_AddRequiredTagGroup(CSteamGameServerAPIContext.GetSteamUGC(), handle, new InteropHelp.SteamParamStringArray(pTagGroups)); } public static bool AddExcludedTag(UGCQueryHandle_t handle, string pTagName) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pTagName2 = new InteropHelp.UTF8StringHandle(pTagName); return NativeMethods.ISteamUGC_AddExcludedTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pTagName2); } public static bool SetReturnOnlyIDs(UGCQueryHandle_t handle, bool bReturnOnlyIDs) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetReturnOnlyIDs(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnOnlyIDs); } public static bool SetReturnKeyValueTags(UGCQueryHandle_t handle, bool bReturnKeyValueTags) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetReturnKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnKeyValueTags); } public static bool SetReturnLongDescription(UGCQueryHandle_t handle, bool bReturnLongDescription) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetReturnLongDescription(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnLongDescription); } public static bool SetReturnMetadata(UGCQueryHandle_t handle, bool bReturnMetadata) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetReturnMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnMetadata); } public static bool SetReturnChildren(UGCQueryHandle_t handle, bool bReturnChildren) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetReturnChildren(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnChildren); } public static bool SetReturnAdditionalPreviews(UGCQueryHandle_t handle, bool bReturnAdditionalPreviews) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetReturnAdditionalPreviews(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnAdditionalPreviews); } public static bool SetReturnTotalOnly(UGCQueryHandle_t handle, bool bReturnTotalOnly) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetReturnTotalOnly(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnTotalOnly); } public static bool SetReturnPlaytimeStats(UGCQueryHandle_t handle, uint unDays) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetReturnPlaytimeStats(CSteamGameServerAPIContext.GetSteamUGC(), handle, unDays); } public static bool SetLanguage(UGCQueryHandle_t handle, string pchLanguage) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchLanguage2 = new InteropHelp.UTF8StringHandle(pchLanguage); return NativeMethods.ISteamUGC_SetLanguage(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchLanguage2); } public static bool SetAllowCachedResponse(UGCQueryHandle_t handle, uint unMaxAgeSeconds) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetAllowCachedResponse(CSteamGameServerAPIContext.GetSteamUGC(), handle, unMaxAgeSeconds); } public static bool SetCloudFileNameFilter(UGCQueryHandle_t handle, string pMatchCloudFileName) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pMatchCloudFileName2 = new InteropHelp.UTF8StringHandle(pMatchCloudFileName); return NativeMethods.ISteamUGC_SetCloudFileNameFilter(CSteamGameServerAPIContext.GetSteamUGC(), handle, pMatchCloudFileName2); } public static bool SetMatchAnyTag(UGCQueryHandle_t handle, bool bMatchAnyTag) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetMatchAnyTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, bMatchAnyTag); } public static bool SetSearchText(UGCQueryHandle_t handle, string pSearchText) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pSearchText2 = new InteropHelp.UTF8StringHandle(pSearchText); return NativeMethods.ISteamUGC_SetSearchText(CSteamGameServerAPIContext.GetSteamUGC(), handle, pSearchText2); } public static bool SetRankedByTrendDays(UGCQueryHandle_t handle, uint unDays) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetRankedByTrendDays(CSteamGameServerAPIContext.GetSteamUGC(), handle, unDays); } public static bool AddRequiredKeyValueTag(UGCQueryHandle_t handle, string pKey, string pValue) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pKey2 = new InteropHelp.UTF8StringHandle(pKey); using InteropHelp.UTF8StringHandle pValue2 = new InteropHelp.UTF8StringHandle(pValue); return NativeMethods.ISteamUGC_AddRequiredKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pKey2, pValue2); } public static SteamAPICall_t RequestUGCDetails(PublishedFileId_t nPublishedFileID, uint unMaxAgeSeconds) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_RequestUGCDetails(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, unMaxAgeSeconds); } public static SteamAPICall_t CreateItem(AppId_t nConsumerAppId, EWorkshopFileType eFileType) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_CreateItem(CSteamGameServerAPIContext.GetSteamUGC(), nConsumerAppId, eFileType); } public static UGCUpdateHandle_t StartItemUpdate(AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); return (UGCUpdateHandle_t)NativeMethods.ISteamUGC_StartItemUpdate(CSteamGameServerAPIContext.GetSteamUGC(), nConsumerAppId, nPublishedFileID); } public static bool SetItemTitle(UGCUpdateHandle_t handle, string pchTitle) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle); return NativeMethods.ISteamUGC_SetItemTitle(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchTitle2); } public static bool SetItemDescription(UGCUpdateHandle_t handle, string pchDescription) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription); return NativeMethods.ISteamUGC_SetItemDescription(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchDescription2); } public static bool SetItemUpdateLanguage(UGCUpdateHandle_t handle, string pchLanguage) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchLanguage2 = new InteropHelp.UTF8StringHandle(pchLanguage); return NativeMethods.ISteamUGC_SetItemUpdateLanguage(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchLanguage2); } public static bool SetItemMetadata(UGCUpdateHandle_t handle, string pchMetaData) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchMetaData2 = new InteropHelp.UTF8StringHandle(pchMetaData); return NativeMethods.ISteamUGC_SetItemMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchMetaData2); } public static bool SetItemVisibility(UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetItemVisibility(CSteamGameServerAPIContext.GetSteamUGC(), handle, eVisibility); } public static bool SetItemTags(UGCUpdateHandle_t updateHandle, IList pTags) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetItemTags(CSteamGameServerAPIContext.GetSteamUGC(), updateHandle, new InteropHelp.SteamParamStringArray(pTags)); } public static bool SetItemContent(UGCUpdateHandle_t handle, string pszContentFolder) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszContentFolder2 = new InteropHelp.UTF8StringHandle(pszContentFolder); return NativeMethods.ISteamUGC_SetItemContent(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszContentFolder2); } public static bool SetItemPreview(UGCUpdateHandle_t handle, string pszPreviewFile) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile); return NativeMethods.ISteamUGC_SetItemPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszPreviewFile2); } public static bool SetAllowLegacyUpload(UGCUpdateHandle_t handle, bool bAllowLegacyUpload) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_SetAllowLegacyUpload(CSteamGameServerAPIContext.GetSteamUGC(), handle, bAllowLegacyUpload); } public static bool RemoveAllItemKeyValueTags(UGCUpdateHandle_t handle) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_RemoveAllItemKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle); } public static bool RemoveItemKeyValueTags(UGCUpdateHandle_t handle, string pchKey) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); return NativeMethods.ISteamUGC_RemoveItemKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchKey2); } public static bool AddItemKeyValueTag(UGCUpdateHandle_t handle, string pchKey, string pchValue) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); using InteropHelp.UTF8StringHandle pchValue2 = new InteropHelp.UTF8StringHandle(pchValue); return NativeMethods.ISteamUGC_AddItemKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchKey2, pchValue2); } public static bool AddItemPreviewFile(UGCUpdateHandle_t handle, string pszPreviewFile, EItemPreviewType type) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile); return NativeMethods.ISteamUGC_AddItemPreviewFile(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszPreviewFile2, type); } public static bool AddItemPreviewVideo(UGCUpdateHandle_t handle, string pszVideoID) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszVideoID2 = new InteropHelp.UTF8StringHandle(pszVideoID); return NativeMethods.ISteamUGC_AddItemPreviewVideo(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszVideoID2); } public static bool UpdateItemPreviewFile(UGCUpdateHandle_t handle, uint index, string pszPreviewFile) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile); return NativeMethods.ISteamUGC_UpdateItemPreviewFile(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pszPreviewFile2); } public static bool UpdateItemPreviewVideo(UGCUpdateHandle_t handle, uint index, string pszVideoID) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszVideoID2 = new InteropHelp.UTF8StringHandle(pszVideoID); return NativeMethods.ISteamUGC_UpdateItemPreviewVideo(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pszVideoID2); } public static bool RemoveItemPreview(UGCUpdateHandle_t handle, uint index) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_RemoveItemPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, index); } public static SteamAPICall_t SubmitItemUpdate(UGCUpdateHandle_t handle, string pchChangeNote) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchChangeNote2 = new InteropHelp.UTF8StringHandle(pchChangeNote); return (SteamAPICall_t)NativeMethods.ISteamUGC_SubmitItemUpdate(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchChangeNote2); } public static EItemUpdateStatus GetItemUpdateProgress(UGCUpdateHandle_t handle, out ulong punBytesProcessed, out ulong punBytesTotal) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_GetItemUpdateProgress(CSteamGameServerAPIContext.GetSteamUGC(), handle, out punBytesProcessed, out punBytesTotal); } public static SteamAPICall_t SetUserItemVote(PublishedFileId_t nPublishedFileID, bool bVoteUp) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_SetUserItemVote(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, bVoteUp); } public static SteamAPICall_t GetUserItemVote(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_GetUserItemVote(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } public static SteamAPICall_t AddItemToFavorites(AppId_t nAppId, PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_AddItemToFavorites(CSteamGameServerAPIContext.GetSteamUGC(), nAppId, nPublishedFileID); } public static SteamAPICall_t RemoveItemFromFavorites(AppId_t nAppId, PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveItemFromFavorites(CSteamGameServerAPIContext.GetSteamUGC(), nAppId, nPublishedFileID); } public static SteamAPICall_t SubscribeItem(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_SubscribeItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } public static SteamAPICall_t UnsubscribeItem(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_UnsubscribeItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } public static uint GetNumSubscribedItems() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_GetNumSubscribedItems(CSteamGameServerAPIContext.GetSteamUGC()); } public static uint GetSubscribedItems(PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_GetSubscribedItems(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, cMaxEntries); } public static uint GetItemState(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_GetItemState(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } public static bool GetItemInstallInfo(PublishedFileId_t nPublishedFileID, out ulong punSizeOnDisk, out string pchFolder, uint cchFolderSize, out uint punTimeStamp) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchFolderSize); bool flag = NativeMethods.ISteamUGC_GetItemInstallInfo(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, out punSizeOnDisk, intPtr, cchFolderSize, out punTimeStamp); pchFolder = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static bool GetItemDownloadInfo(PublishedFileId_t nPublishedFileID, out ulong punBytesDownloaded, out ulong punBytesTotal) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_GetItemDownloadInfo(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, out punBytesDownloaded, out punBytesTotal); } public static bool DownloadItem(PublishedFileId_t nPublishedFileID, bool bHighPriority) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUGC_DownloadItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, bHighPriority); } public static bool BInitWorkshopForGameServer(DepotId_t unWorkshopDepotID, string pszFolder) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pszFolder2 = new InteropHelp.UTF8StringHandle(pszFolder); return NativeMethods.ISteamUGC_BInitWorkshopForGameServer(CSteamGameServerAPIContext.GetSteamUGC(), unWorkshopDepotID, pszFolder2); } public static void SuspendDownloads(bool bSuspend) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamUGC_SuspendDownloads(CSteamGameServerAPIContext.GetSteamUGC(), bSuspend); } public static SteamAPICall_t StartPlaytimeTracking(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_StartPlaytimeTracking(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); } public static SteamAPICall_t StopPlaytimeTracking(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_StopPlaytimeTracking(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); } public static SteamAPICall_t StopPlaytimeTrackingForAllItems() { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_StopPlaytimeTrackingForAllItems(CSteamGameServerAPIContext.GetSteamUGC()); } public static SteamAPICall_t AddDependency(PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_AddDependency(CSteamGameServerAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID); } public static SteamAPICall_t RemoveDependency(PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveDependency(CSteamGameServerAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID); } public static SteamAPICall_t AddAppDependency(PublishedFileId_t nPublishedFileID, AppId_t nAppID) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_AddAppDependency(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, nAppID); } public static SteamAPICall_t RemoveAppDependency(PublishedFileId_t nPublishedFileID, AppId_t nAppID) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveAppDependency(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, nAppID); } public static SteamAPICall_t GetAppDependencies(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_GetAppDependencies(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } public static SteamAPICall_t DeleteItem(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableGameServer(); return (SteamAPICall_t)NativeMethods.ISteamUGC_DeleteItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID); } } public static class SteamGameServerUtils { public static uint GetSecondsSinceAppActive() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_GetSecondsSinceAppActive(CSteamGameServerAPIContext.GetSteamUtils()); } public static uint GetSecondsSinceComputerActive() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_GetSecondsSinceComputerActive(CSteamGameServerAPIContext.GetSteamUtils()); } public static EUniverse GetConnectedUniverse() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_GetConnectedUniverse(CSteamGameServerAPIContext.GetSteamUtils()); } public static uint GetServerRealTime() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_GetServerRealTime(CSteamGameServerAPIContext.GetSteamUtils()); } public static string GetIPCountry() { InteropHelp.TestIfAvailableGameServer(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUtils_GetIPCountry(CSteamGameServerAPIContext.GetSteamUtils())); } public static bool GetImageSize(int iImage, out uint pnWidth, out uint pnHeight) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_GetImageSize(CSteamGameServerAPIContext.GetSteamUtils(), iImage, out pnWidth, out pnHeight); } public static bool GetImageRGBA(int iImage, byte[] pubDest, int nDestBufferSize) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_GetImageRGBA(CSteamGameServerAPIContext.GetSteamUtils(), iImage, pubDest, nDestBufferSize); } public static bool GetCSERIPPort(out uint unIP, out ushort usPort) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_GetCSERIPPort(CSteamGameServerAPIContext.GetSteamUtils(), out unIP, out usPort); } public static byte GetCurrentBatteryPower() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_GetCurrentBatteryPower(CSteamGameServerAPIContext.GetSteamUtils()); } public static AppId_t GetAppID() { InteropHelp.TestIfAvailableGameServer(); return (AppId_t)NativeMethods.ISteamUtils_GetAppID(CSteamGameServerAPIContext.GetSteamUtils()); } public static void SetOverlayNotificationPosition(ENotificationPosition eNotificationPosition) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamUtils_SetOverlayNotificationPosition(CSteamGameServerAPIContext.GetSteamUtils(), eNotificationPosition); } public static bool IsAPICallCompleted(SteamAPICall_t hSteamAPICall, out bool pbFailed) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_IsAPICallCompleted(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall, out pbFailed); } public static ESteamAPICallFailure GetAPICallFailureReason(SteamAPICall_t hSteamAPICall) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_GetAPICallFailureReason(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall); } public static bool GetAPICallResult(SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, out bool pbFailed) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_GetAPICallResult(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall, pCallback, cubCallback, iCallbackExpected, out pbFailed); } public static uint GetIPCCallCount() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_GetIPCCallCount(CSteamGameServerAPIContext.GetSteamUtils()); } public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamUtils_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamUtils(), pFunction); } public static bool IsOverlayEnabled() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_IsOverlayEnabled(CSteamGameServerAPIContext.GetSteamUtils()); } public static bool BOverlayNeedsPresent() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_BOverlayNeedsPresent(CSteamGameServerAPIContext.GetSteamUtils()); } public static SteamAPICall_t CheckFileSignature(string szFileName) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle szFileName2 = new InteropHelp.UTF8StringHandle(szFileName); return (SteamAPICall_t)NativeMethods.ISteamUtils_CheckFileSignature(CSteamGameServerAPIContext.GetSteamUtils(), szFileName2); } public static bool ShowGamepadTextInput(EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, string pchDescription, uint unCharMax, string pchExistingText) { InteropHelp.TestIfAvailableGameServer(); using InteropHelp.UTF8StringHandle pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription); using InteropHelp.UTF8StringHandle pchExistingText2 = new InteropHelp.UTF8StringHandle(pchExistingText); return NativeMethods.ISteamUtils_ShowGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), eInputMode, eLineInputMode, pchDescription2, unCharMax, pchExistingText2); } public static uint GetEnteredGamepadTextLength() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_GetEnteredGamepadTextLength(CSteamGameServerAPIContext.GetSteamUtils()); } public static bool GetEnteredGamepadTextInput(out string pchText, uint cchText) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchText); bool flag = NativeMethods.ISteamUtils_GetEnteredGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), intPtr, cchText); pchText = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static string GetSteamUILanguage() { InteropHelp.TestIfAvailableGameServer(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUtils_GetSteamUILanguage(CSteamGameServerAPIContext.GetSteamUtils())); } public static bool IsSteamRunningInVR() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_IsSteamRunningInVR(CSteamGameServerAPIContext.GetSteamUtils()); } public static void SetOverlayNotificationInset(int nHorizontalInset, int nVerticalInset) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamUtils_SetOverlayNotificationInset(CSteamGameServerAPIContext.GetSteamUtils(), nHorizontalInset, nVerticalInset); } public static bool IsSteamInBigPictureMode() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_IsSteamInBigPictureMode(CSteamGameServerAPIContext.GetSteamUtils()); } public static void StartVRDashboard() { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamUtils_StartVRDashboard(CSteamGameServerAPIContext.GetSteamUtils()); } public static bool IsVRHeadsetStreamingEnabled() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_IsVRHeadsetStreamingEnabled(CSteamGameServerAPIContext.GetSteamUtils()); } public static void SetVRHeadsetStreamingEnabled(bool bEnabled) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamUtils_SetVRHeadsetStreamingEnabled(CSteamGameServerAPIContext.GetSteamUtils(), bEnabled); } public static bool IsSteamChinaLauncher() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_IsSteamChinaLauncher(CSteamGameServerAPIContext.GetSteamUtils()); } public static bool InitFilterText() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_InitFilterText(CSteamGameServerAPIContext.GetSteamUtils()); } public static int FilterText(out string pchOutFilteredText, uint nByteSizeOutFilteredText, string pchInputMessage, bool bLegalOnly) { InteropHelp.TestIfAvailableGameServer(); IntPtr intPtr = Marshal.AllocHGlobal((int)nByteSizeOutFilteredText); using InteropHelp.UTF8StringHandle pchInputMessage2 = new InteropHelp.UTF8StringHandle(pchInputMessage); int num = NativeMethods.ISteamUtils_FilterText(CSteamGameServerAPIContext.GetSteamUtils(), intPtr, nByteSizeOutFilteredText, pchInputMessage2, bLegalOnly); pchOutFilteredText = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static ESteamIPv6ConnectivityState GetIPv6ConnectivityState(ESteamIPv6ConnectivityProtocol eProtocol) { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamUtils_GetIPv6ConnectivityState(CSteamGameServerAPIContext.GetSteamUtils(), eProtocol); } } public static class SteamHTMLSurface { public static bool Init() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTMLSurface_Init(CSteamAPIContext.GetSteamHTMLSurface()); } public static bool Shutdown() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTMLSurface_Shutdown(CSteamAPIContext.GetSteamHTMLSurface()); } public static SteamAPICall_t CreateBrowser(string pchUserAgent, string pchUserCSS) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchUserAgent2 = new InteropHelp.UTF8StringHandle(pchUserAgent); using InteropHelp.UTF8StringHandle pchUserCSS2 = new InteropHelp.UTF8StringHandle(pchUserCSS); return (SteamAPICall_t)NativeMethods.ISteamHTMLSurface_CreateBrowser(CSteamAPIContext.GetSteamHTMLSurface(), pchUserAgent2, pchUserCSS2); } public static void RemoveBrowser(HHTMLBrowser unBrowserHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_RemoveBrowser(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle); } public static void LoadURL(HHTMLBrowser unBrowserHandle, string pchURL, string pchPostData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchURL2 = new InteropHelp.UTF8StringHandle(pchURL); using InteropHelp.UTF8StringHandle pchPostData2 = new InteropHelp.UTF8StringHandle(pchPostData); NativeMethods.ISteamHTMLSurface_LoadURL(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, pchURL2, pchPostData2); } public static void SetSize(HHTMLBrowser unBrowserHandle, uint unWidth, uint unHeight) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_SetSize(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, unWidth, unHeight); } public static void StopLoad(HHTMLBrowser unBrowserHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_StopLoad(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle); } public static void Reload(HHTMLBrowser unBrowserHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_Reload(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle); } public static void GoBack(HHTMLBrowser unBrowserHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_GoBack(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle); } public static void GoForward(HHTMLBrowser unBrowserHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_GoForward(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle); } public static void AddHeader(HHTMLBrowser unBrowserHandle, string pchKey, string pchValue) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); using InteropHelp.UTF8StringHandle pchValue2 = new InteropHelp.UTF8StringHandle(pchValue); NativeMethods.ISteamHTMLSurface_AddHeader(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, pchKey2, pchValue2); } public static void ExecuteJavascript(HHTMLBrowser unBrowserHandle, string pchScript) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchScript2 = new InteropHelp.UTF8StringHandle(pchScript); NativeMethods.ISteamHTMLSurface_ExecuteJavascript(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, pchScript2); } public static void MouseUp(HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_MouseUp(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, eMouseButton); } public static void MouseDown(HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_MouseDown(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, eMouseButton); } public static void MouseDoubleClick(HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_MouseDoubleClick(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, eMouseButton); } public static void MouseMove(HHTMLBrowser unBrowserHandle, int x, int y) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_MouseMove(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, x, y); } public static void MouseWheel(HHTMLBrowser unBrowserHandle, int nDelta) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_MouseWheel(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, nDelta); } public static void KeyDown(HHTMLBrowser unBrowserHandle, uint nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers, bool bIsSystemKey = false) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_KeyDown(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers, bIsSystemKey); } public static void KeyUp(HHTMLBrowser unBrowserHandle, uint nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_KeyUp(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers); } public static void KeyChar(HHTMLBrowser unBrowserHandle, uint cUnicodeChar, EHTMLKeyModifiers eHTMLKeyModifiers) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_KeyChar(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, cUnicodeChar, eHTMLKeyModifiers); } public static void SetHorizontalScroll(HHTMLBrowser unBrowserHandle, uint nAbsolutePixelScroll) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_SetHorizontalScroll(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, nAbsolutePixelScroll); } public static void SetVerticalScroll(HHTMLBrowser unBrowserHandle, uint nAbsolutePixelScroll) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_SetVerticalScroll(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, nAbsolutePixelScroll); } public static void SetKeyFocus(HHTMLBrowser unBrowserHandle, bool bHasKeyFocus) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_SetKeyFocus(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, bHasKeyFocus); } public static void ViewSource(HHTMLBrowser unBrowserHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_ViewSource(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle); } public static void CopyToClipboard(HHTMLBrowser unBrowserHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_CopyToClipboard(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle); } public static void PasteFromClipboard(HHTMLBrowser unBrowserHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_PasteFromClipboard(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle); } public static void Find(HHTMLBrowser unBrowserHandle, string pchSearchStr, bool bCurrentlyInFind, bool bReverse) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchSearchStr2 = new InteropHelp.UTF8StringHandle(pchSearchStr); NativeMethods.ISteamHTMLSurface_Find(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, pchSearchStr2, bCurrentlyInFind, bReverse); } public static void StopFind(HHTMLBrowser unBrowserHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_StopFind(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle); } public static void GetLinkAtPosition(HHTMLBrowser unBrowserHandle, int x, int y) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_GetLinkAtPosition(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, x, y); } public static void SetCookie(string pchHostname, string pchKey, string pchValue, string pchPath = "/", uint nExpires = 0u, bool bSecure = false, bool bHTTPOnly = false) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchHostname2 = new InteropHelp.UTF8StringHandle(pchHostname); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); using InteropHelp.UTF8StringHandle pchValue2 = new InteropHelp.UTF8StringHandle(pchValue); using InteropHelp.UTF8StringHandle pchPath2 = new InteropHelp.UTF8StringHandle(pchPath); NativeMethods.ISteamHTMLSurface_SetCookie(CSteamAPIContext.GetSteamHTMLSurface(), pchHostname2, pchKey2, pchValue2, pchPath2, nExpires, bSecure, bHTTPOnly); } public static void SetPageScaleFactor(HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_SetPageScaleFactor(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, flZoom, nPointX, nPointY); } public static void SetBackgroundMode(HHTMLBrowser unBrowserHandle, bool bBackgroundMode) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_SetBackgroundMode(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, bBackgroundMode); } public static void SetDPIScalingFactor(HHTMLBrowser unBrowserHandle, float flDPIScaling) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_SetDPIScalingFactor(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, flDPIScaling); } public static void OpenDeveloperTools(HHTMLBrowser unBrowserHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_OpenDeveloperTools(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle); } public static void AllowStartRequest(HHTMLBrowser unBrowserHandle, bool bAllowed) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_AllowStartRequest(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, bAllowed); } public static void JSDialogResponse(HHTMLBrowser unBrowserHandle, bool bResult) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_JSDialogResponse(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, bResult); } public static void FileLoadDialogResponse(HHTMLBrowser unBrowserHandle, IntPtr pchSelectedFiles) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamHTMLSurface_FileLoadDialogResponse(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, pchSelectedFiles); } } public static class SteamHTTP { public static HTTPRequestHandle CreateHTTPRequest(EHTTPMethod eHTTPRequestMethod, string pchAbsoluteURL) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchAbsoluteURL2 = new InteropHelp.UTF8StringHandle(pchAbsoluteURL); return (HTTPRequestHandle)NativeMethods.ISteamHTTP_CreateHTTPRequest(CSteamAPIContext.GetSteamHTTP(), eHTTPRequestMethod, pchAbsoluteURL2); } public static bool SetHTTPRequestContextValue(HTTPRequestHandle hRequest, ulong ulContextValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_SetHTTPRequestContextValue(CSteamAPIContext.GetSteamHTTP(), hRequest, ulContextValue); } public static bool SetHTTPRequestNetworkActivityTimeout(HTTPRequestHandle hRequest, uint unTimeoutSeconds) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(CSteamAPIContext.GetSteamHTTP(), hRequest, unTimeoutSeconds); } public static bool SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, string pchHeaderValue) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName); using InteropHelp.UTF8StringHandle pchHeaderValue2 = new InteropHelp.UTF8StringHandle(pchHeaderValue); return NativeMethods.ISteamHTTP_SetHTTPRequestHeaderValue(CSteamAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pchHeaderValue2); } public static bool SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, string pchParamName, string pchParamValue) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchParamName2 = new InteropHelp.UTF8StringHandle(pchParamName); using InteropHelp.UTF8StringHandle pchParamValue2 = new InteropHelp.UTF8StringHandle(pchParamValue); return NativeMethods.ISteamHTTP_SetHTTPRequestGetOrPostParameter(CSteamAPIContext.GetSteamHTTP(), hRequest, pchParamName2, pchParamValue2); } public static bool SendHTTPRequest(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_SendHTTPRequest(CSteamAPIContext.GetSteamHTTP(), hRequest, out pCallHandle); } public static bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_SendHTTPRequestAndStreamResponse(CSteamAPIContext.GetSteamHTTP(), hRequest, out pCallHandle); } public static bool DeferHTTPRequest(HTTPRequestHandle hRequest) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_DeferHTTPRequest(CSteamAPIContext.GetSteamHTTP(), hRequest); } public static bool PrioritizeHTTPRequest(HTTPRequestHandle hRequest) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_PrioritizeHTTPRequest(CSteamAPIContext.GetSteamHTTP(), hRequest); } public static bool GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, string pchHeaderName, out uint unResponseHeaderSize) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName); return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderSize(CSteamAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, out unResponseHeaderSize); } public static bool GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, byte[] pHeaderValueBuffer, uint unBufferSize) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName); return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderValue(CSteamAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pHeaderValueBuffer, unBufferSize); } public static bool GetHTTPResponseBodySize(HTTPRequestHandle hRequest, out uint unBodySize) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_GetHTTPResponseBodySize(CSteamAPIContext.GetSteamHTTP(), hRequest, out unBodySize); } public static bool GetHTTPResponseBodyData(HTTPRequestHandle hRequest, byte[] pBodyDataBuffer, uint unBufferSize) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_GetHTTPResponseBodyData(CSteamAPIContext.GetSteamHTTP(), hRequest, pBodyDataBuffer, unBufferSize); } public static bool GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint cOffset, byte[] pBodyDataBuffer, uint unBufferSize) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_GetHTTPStreamingResponseBodyData(CSteamAPIContext.GetSteamHTTP(), hRequest, cOffset, pBodyDataBuffer, unBufferSize); } public static bool ReleaseHTTPRequest(HTTPRequestHandle hRequest) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_ReleaseHTTPRequest(CSteamAPIContext.GetSteamHTTP(), hRequest); } public static bool GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, out float pflPercentOut) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_GetHTTPDownloadProgressPct(CSteamAPIContext.GetSteamHTTP(), hRequest, out pflPercentOut); } public static bool SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, string pchContentType, byte[] pubBody, uint unBodyLen) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchContentType2 = new InteropHelp.UTF8StringHandle(pchContentType); return NativeMethods.ISteamHTTP_SetHTTPRequestRawPostBody(CSteamAPIContext.GetSteamHTTP(), hRequest, pchContentType2, pubBody, unBodyLen); } public static HTTPCookieContainerHandle CreateCookieContainer(bool bAllowResponsesToModify) { InteropHelp.TestIfAvailableClient(); return (HTTPCookieContainerHandle)NativeMethods.ISteamHTTP_CreateCookieContainer(CSteamAPIContext.GetSteamHTTP(), bAllowResponsesToModify); } public static bool ReleaseCookieContainer(HTTPCookieContainerHandle hCookieContainer) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_ReleaseCookieContainer(CSteamAPIContext.GetSteamHTTP(), hCookieContainer); } public static bool SetCookie(HTTPCookieContainerHandle hCookieContainer, string pchHost, string pchUrl, string pchCookie) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchHost2 = new InteropHelp.UTF8StringHandle(pchHost); using InteropHelp.UTF8StringHandle pchUrl2 = new InteropHelp.UTF8StringHandle(pchUrl); using InteropHelp.UTF8StringHandle pchCookie2 = new InteropHelp.UTF8StringHandle(pchCookie); return NativeMethods.ISteamHTTP_SetCookie(CSteamAPIContext.GetSteamHTTP(), hCookieContainer, pchHost2, pchUrl2, pchCookie2); } public static bool SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_SetHTTPRequestCookieContainer(CSteamAPIContext.GetSteamHTTP(), hRequest, hCookieContainer); } public static bool SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, string pchUserAgentInfo) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchUserAgentInfo2 = new InteropHelp.UTF8StringHandle(pchUserAgentInfo); return NativeMethods.ISteamHTTP_SetHTTPRequestUserAgentInfo(CSteamAPIContext.GetSteamHTTP(), hRequest, pchUserAgentInfo2); } public static bool SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(CSteamAPIContext.GetSteamHTTP(), hRequest, bRequireVerifiedCertificate); } public static bool SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, uint unMilliseconds) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(CSteamAPIContext.GetSteamHTTP(), hRequest, unMilliseconds); } public static bool GetHTTPRequestWasTimedOut(HTTPRequestHandle hRequest, out bool pbWasTimedOut) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamHTTP_GetHTTPRequestWasTimedOut(CSteamAPIContext.GetSteamHTTP(), hRequest, out pbWasTimedOut); } } public static class SteamInput { public static bool Init() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInput_Init(CSteamAPIContext.GetSteamInput()); } public static bool Shutdown() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInput_Shutdown(CSteamAPIContext.GetSteamInput()); } public static void RunFrame() { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamInput_RunFrame(CSteamAPIContext.GetSteamInput()); } public static int GetConnectedControllers(InputHandle_t[] handlesOut) { InteropHelp.TestIfAvailableClient(); if (handlesOut != null && handlesOut.Length != 16) { throw new ArgumentException("handlesOut must be the same size as Constants.STEAM_INPUT_MAX_COUNT!"); } return NativeMethods.ISteamInput_GetConnectedControllers(CSteamAPIContext.GetSteamInput(), handlesOut); } public static InputActionSetHandle_t GetActionSetHandle(string pszActionSetName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszActionSetName2 = new InteropHelp.UTF8StringHandle(pszActionSetName); return (InputActionSetHandle_t)NativeMethods.ISteamInput_GetActionSetHandle(CSteamAPIContext.GetSteamInput(), pszActionSetName2); } public static void ActivateActionSet(InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamInput_ActivateActionSet(CSteamAPIContext.GetSteamInput(), inputHandle, actionSetHandle); } public static InputActionSetHandle_t GetCurrentActionSet(InputHandle_t inputHandle) { InteropHelp.TestIfAvailableClient(); return (InputActionSetHandle_t)NativeMethods.ISteamInput_GetCurrentActionSet(CSteamAPIContext.GetSteamInput(), inputHandle); } public static void ActivateActionSetLayer(InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamInput_ActivateActionSetLayer(CSteamAPIContext.GetSteamInput(), inputHandle, actionSetLayerHandle); } public static void DeactivateActionSetLayer(InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamInput_DeactivateActionSetLayer(CSteamAPIContext.GetSteamInput(), inputHandle, actionSetLayerHandle); } public static void DeactivateAllActionSetLayers(InputHandle_t inputHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamInput_DeactivateAllActionSetLayers(CSteamAPIContext.GetSteamInput(), inputHandle); } public static int GetActiveActionSetLayers(InputHandle_t inputHandle, InputActionSetHandle_t[] handlesOut) { InteropHelp.TestIfAvailableClient(); if (handlesOut != null && handlesOut.Length != 16) { throw new ArgumentException("handlesOut must be the same size as Constants.STEAM_INPUT_MAX_ACTIVE_LAYERS!"); } return NativeMethods.ISteamInput_GetActiveActionSetLayers(CSteamAPIContext.GetSteamInput(), inputHandle, handlesOut); } public static InputDigitalActionHandle_t GetDigitalActionHandle(string pszActionName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszActionName2 = new InteropHelp.UTF8StringHandle(pszActionName); return (InputDigitalActionHandle_t)NativeMethods.ISteamInput_GetDigitalActionHandle(CSteamAPIContext.GetSteamInput(), pszActionName2); } public static InputDigitalActionData_t GetDigitalActionData(InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInput_GetDigitalActionData(CSteamAPIContext.GetSteamInput(), inputHandle, digitalActionHandle); } public static int GetDigitalActionOrigins(InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, EInputActionOrigin[] originsOut) { InteropHelp.TestIfAvailableClient(); if (originsOut != null && originsOut.Length != 8) { throw new ArgumentException("originsOut must be the same size as Constants.STEAM_INPUT_MAX_ORIGINS!"); } return NativeMethods.ISteamInput_GetDigitalActionOrigins(CSteamAPIContext.GetSteamInput(), inputHandle, actionSetHandle, digitalActionHandle, originsOut); } public static InputAnalogActionHandle_t GetAnalogActionHandle(string pszActionName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszActionName2 = new InteropHelp.UTF8StringHandle(pszActionName); return (InputAnalogActionHandle_t)NativeMethods.ISteamInput_GetAnalogActionHandle(CSteamAPIContext.GetSteamInput(), pszActionName2); } public static InputAnalogActionData_t GetAnalogActionData(InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInput_GetAnalogActionData(CSteamAPIContext.GetSteamInput(), inputHandle, analogActionHandle); } public static int GetAnalogActionOrigins(InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, EInputActionOrigin[] originsOut) { InteropHelp.TestIfAvailableClient(); if (originsOut != null && originsOut.Length != 8) { throw new ArgumentException("originsOut must be the same size as Constants.STEAM_INPUT_MAX_ORIGINS!"); } return NativeMethods.ISteamInput_GetAnalogActionOrigins(CSteamAPIContext.GetSteamInput(), inputHandle, actionSetHandle, analogActionHandle, originsOut); } public static string GetGlyphForActionOrigin(EInputActionOrigin eOrigin) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamInput_GetGlyphForActionOrigin(CSteamAPIContext.GetSteamInput(), eOrigin)); } public static string GetStringForActionOrigin(EInputActionOrigin eOrigin) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamInput_GetStringForActionOrigin(CSteamAPIContext.GetSteamInput(), eOrigin)); } public static void StopAnalogActionMomentum(InputHandle_t inputHandle, InputAnalogActionHandle_t eAction) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamInput_StopAnalogActionMomentum(CSteamAPIContext.GetSteamInput(), inputHandle, eAction); } public static InputMotionData_t GetMotionData(InputHandle_t inputHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInput_GetMotionData(CSteamAPIContext.GetSteamInput(), inputHandle); } public static void TriggerVibration(InputHandle_t inputHandle, ushort usLeftSpeed, ushort usRightSpeed) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamInput_TriggerVibration(CSteamAPIContext.GetSteamInput(), inputHandle, usLeftSpeed, usRightSpeed); } public static void SetLEDColor(InputHandle_t inputHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamInput_SetLEDColor(CSteamAPIContext.GetSteamInput(), inputHandle, nColorR, nColorG, nColorB, nFlags); } public static void TriggerHapticPulse(InputHandle_t inputHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamInput_TriggerHapticPulse(CSteamAPIContext.GetSteamInput(), inputHandle, eTargetPad, usDurationMicroSec); } public static void TriggerRepeatedHapticPulse(InputHandle_t inputHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamInput_TriggerRepeatedHapticPulse(CSteamAPIContext.GetSteamInput(), inputHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags); } public static bool ShowBindingPanel(InputHandle_t inputHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInput_ShowBindingPanel(CSteamAPIContext.GetSteamInput(), inputHandle); } public static ESteamInputType GetInputTypeForHandle(InputHandle_t inputHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInput_GetInputTypeForHandle(CSteamAPIContext.GetSteamInput(), inputHandle); } public static InputHandle_t GetControllerForGamepadIndex(int nIndex) { InteropHelp.TestIfAvailableClient(); return (InputHandle_t)NativeMethods.ISteamInput_GetControllerForGamepadIndex(CSteamAPIContext.GetSteamInput(), nIndex); } public static int GetGamepadIndexForController(InputHandle_t ulinputHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInput_GetGamepadIndexForController(CSteamAPIContext.GetSteamInput(), ulinputHandle); } public static string GetStringForXboxOrigin(EXboxOrigin eOrigin) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamInput_GetStringForXboxOrigin(CSteamAPIContext.GetSteamInput(), eOrigin)); } public static string GetGlyphForXboxOrigin(EXboxOrigin eOrigin) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamInput_GetGlyphForXboxOrigin(CSteamAPIContext.GetSteamInput(), eOrigin)); } public static EInputActionOrigin GetActionOriginFromXboxOrigin(InputHandle_t inputHandle, EXboxOrigin eOrigin) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInput_GetActionOriginFromXboxOrigin(CSteamAPIContext.GetSteamInput(), inputHandle, eOrigin); } public static EInputActionOrigin TranslateActionOrigin(ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInput_TranslateActionOrigin(CSteamAPIContext.GetSteamInput(), eDestinationInputType, eSourceOrigin); } public static bool GetDeviceBindingRevision(InputHandle_t inputHandle, out int pMajor, out int pMinor) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInput_GetDeviceBindingRevision(CSteamAPIContext.GetSteamInput(), inputHandle, out pMajor, out pMinor); } public static uint GetRemotePlaySessionID(InputHandle_t inputHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInput_GetRemotePlaySessionID(CSteamAPIContext.GetSteamInput(), inputHandle); } } public static class SteamInventory { public static EResult GetResultStatus(SteamInventoryResult_t resultHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_GetResultStatus(CSteamAPIContext.GetSteamInventory(), resultHandle); } public static bool GetResultItems(SteamInventoryResult_t resultHandle, SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize) { InteropHelp.TestIfAvailableClient(); if (pOutItemsArray != null && pOutItemsArray.Length != punOutItemsArraySize) { throw new ArgumentException("pOutItemsArray must be the same size as punOutItemsArraySize!"); } return NativeMethods.ISteamInventory_GetResultItems(CSteamAPIContext.GetSteamInventory(), resultHandle, pOutItemsArray, ref punOutItemsArraySize); } public static bool GetResultItemProperty(SteamInventoryResult_t resultHandle, uint unItemIndex, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)punValueBufferSizeOut); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); bool flag = NativeMethods.ISteamInventory_GetResultItemProperty(CSteamAPIContext.GetSteamInventory(), resultHandle, unItemIndex, pchPropertyName2, intPtr, ref punValueBufferSizeOut); pchValueBuffer = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static uint GetResultTimestamp(SteamInventoryResult_t resultHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_GetResultTimestamp(CSteamAPIContext.GetSteamInventory(), resultHandle); } public static bool CheckResultSteamID(SteamInventoryResult_t resultHandle, CSteamID steamIDExpected) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_CheckResultSteamID(CSteamAPIContext.GetSteamInventory(), resultHandle, steamIDExpected); } public static void DestroyResult(SteamInventoryResult_t resultHandle) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamInventory_DestroyResult(CSteamAPIContext.GetSteamInventory(), resultHandle); } public static bool GetAllItems(out SteamInventoryResult_t pResultHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_GetAllItems(CSteamAPIContext.GetSteamInventory(), out pResultHandle); } public static bool GetItemsByID(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t[] pInstanceIDs, uint unCountInstanceIDs) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_GetItemsByID(CSteamAPIContext.GetSteamInventory(), out pResultHandle, pInstanceIDs, unCountInstanceIDs); } public static bool SerializeResult(SteamInventoryResult_t resultHandle, byte[] pOutBuffer, out uint punOutBufferSize) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_SerializeResult(CSteamAPIContext.GetSteamInventory(), resultHandle, pOutBuffer, out punOutBufferSize); } public static bool DeserializeResult(out SteamInventoryResult_t pOutResultHandle, byte[] pBuffer, uint unBufferSize, bool bRESERVED_MUST_BE_FALSE = false) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_DeserializeResult(CSteamAPIContext.GetSteamInventory(), out pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE); } public static bool GenerateItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_GenerateItems(CSteamAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength); } public static bool GrantPromoItems(out SteamInventoryResult_t pResultHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_GrantPromoItems(CSteamAPIContext.GetSteamInventory(), out pResultHandle); } public static bool AddPromoItem(out SteamInventoryResult_t pResultHandle, SteamItemDef_t itemDef) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_AddPromoItem(CSteamAPIContext.GetSteamInventory(), out pResultHandle, itemDef); } public static bool AddPromoItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint unArrayLength) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_AddPromoItems(CSteamAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, unArrayLength); } public static bool ConsumeItem(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemConsume, uint unQuantity) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_ConsumeItem(CSteamAPIContext.GetSteamInventory(), out pResultHandle, itemConsume, unQuantity); } public static bool ExchangeItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayGenerate, uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, SteamItemInstanceID_t[] pArrayDestroy, uint[] punArrayDestroyQuantity, uint unArrayDestroyLength) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_ExchangeItems(CSteamAPIContext.GetSteamInventory(), out pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength); } public static bool TransferItemQuantity(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemIdSource, uint unQuantity, SteamItemInstanceID_t itemIdDest) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_TransferItemQuantity(CSteamAPIContext.GetSteamInventory(), out pResultHandle, itemIdSource, unQuantity, itemIdDest); } public static void SendItemDropHeartbeat() { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamInventory_SendItemDropHeartbeat(CSteamAPIContext.GetSteamInventory()); } public static bool TriggerItemDrop(out SteamInventoryResult_t pResultHandle, SteamItemDef_t dropListDefinition) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_TriggerItemDrop(CSteamAPIContext.GetSteamInventory(), out pResultHandle, dropListDefinition); } public static bool TradeItems(out SteamInventoryResult_t pResultHandle, CSteamID steamIDTradePartner, SteamItemInstanceID_t[] pArrayGive, uint[] pArrayGiveQuantity, uint nArrayGiveLength, SteamItemInstanceID_t[] pArrayGet, uint[] pArrayGetQuantity, uint nArrayGetLength) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_TradeItems(CSteamAPIContext.GetSteamInventory(), out pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength); } public static bool LoadItemDefinitions() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_LoadItemDefinitions(CSteamAPIContext.GetSteamInventory()); } public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) { InteropHelp.TestIfAvailableClient(); if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize) { throw new ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!"); } return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamAPIContext.GetSteamInventory(), pItemDefIDs, ref punItemDefIDsArraySize); } public static bool GetItemDefinitionProperty(SteamItemDef_t iDefinition, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)punValueBufferSizeOut); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); bool flag = NativeMethods.ISteamInventory_GetItemDefinitionProperty(CSteamAPIContext.GetSteamInventory(), iDefinition, pchPropertyName2, intPtr, ref punValueBufferSizeOut); pchValueBuffer = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs(CSteamID steamID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(CSteamAPIContext.GetSteamInventory(), steamID); } public static bool GetEligiblePromoItemDefinitionIDs(CSteamID steamID, SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) { InteropHelp.TestIfAvailableClient(); if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize) { throw new ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!"); } return NativeMethods.ISteamInventory_GetEligiblePromoItemDefinitionIDs(CSteamAPIContext.GetSteamInventory(), steamID, pItemDefIDs, ref punItemDefIDsArraySize); } public static SteamAPICall_t StartPurchase(SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamInventory_StartPurchase(CSteamAPIContext.GetSteamInventory(), pArrayItemDefs, punArrayQuantity, unArrayLength); } public static SteamAPICall_t RequestPrices() { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamInventory_RequestPrices(CSteamAPIContext.GetSteamInventory()); } public static uint GetNumItemsWithPrices() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_GetNumItemsWithPrices(CSteamAPIContext.GetSteamInventory()); } public static bool GetItemsWithPrices(SteamItemDef_t[] pArrayItemDefs, ulong[] pCurrentPrices, ulong[] pBasePrices, uint unArrayLength) { InteropHelp.TestIfAvailableClient(); if (pArrayItemDefs != null && pArrayItemDefs.Length != unArrayLength) { throw new ArgumentException("pArrayItemDefs must be the same size as unArrayLength!"); } if (pCurrentPrices != null && pCurrentPrices.Length != unArrayLength) { throw new ArgumentException("pCurrentPrices must be the same size as unArrayLength!"); } if (pBasePrices != null && pBasePrices.Length != unArrayLength) { throw new ArgumentException("pBasePrices must be the same size as unArrayLength!"); } return NativeMethods.ISteamInventory_GetItemsWithPrices(CSteamAPIContext.GetSteamInventory(), pArrayItemDefs, pCurrentPrices, pBasePrices, unArrayLength); } public static bool GetItemPrice(SteamItemDef_t iDefinition, out ulong pCurrentPrice, out ulong pBasePrice) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_GetItemPrice(CSteamAPIContext.GetSteamInventory(), iDefinition, out pCurrentPrice, out pBasePrice); } public static SteamInventoryUpdateHandle_t StartUpdateProperties() { InteropHelp.TestIfAvailableClient(); return (SteamInventoryUpdateHandle_t)NativeMethods.ISteamInventory_StartUpdateProperties(CSteamAPIContext.GetSteamInventory()); } public static bool RemoveProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); return NativeMethods.ISteamInventory_RemoveProperty(CSteamAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2); } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, string pchPropertyValue) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); using InteropHelp.UTF8StringHandle pchPropertyValue2 = new InteropHelp.UTF8StringHandle(pchPropertyValue); return NativeMethods.ISteamInventory_SetPropertyString(CSteamAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, pchPropertyValue2); } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, bool bValue) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); return NativeMethods.ISteamInventory_SetPropertyBool(CSteamAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, bValue); } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, long nValue) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); return NativeMethods.ISteamInventory_SetPropertyInt64(CSteamAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, nValue); } public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, float flValue) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName); return NativeMethods.ISteamInventory_SetPropertyFloat(CSteamAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, flValue); } public static bool SubmitUpdateProperties(SteamInventoryUpdateHandle_t handle, out SteamInventoryResult_t pResultHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamInventory_SubmitUpdateProperties(CSteamAPIContext.GetSteamInventory(), handle, out pResultHandle); } } public static class SteamMatchmaking { public static int GetFavoriteGameCount() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_GetFavoriteGameCount(CSteamAPIContext.GetSteamMatchmaking()); } public static bool GetFavoriteGame(int iGame, out AppId_t pnAppID, out uint pnIP, out ushort pnConnPort, out ushort pnQueryPort, out uint punFlags, out uint pRTime32LastPlayedOnServer) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_GetFavoriteGame(CSteamAPIContext.GetSteamMatchmaking(), iGame, out pnAppID, out pnIP, out pnConnPort, out pnQueryPort, out punFlags, out pRTime32LastPlayedOnServer); } public static int AddFavoriteGame(AppId_t nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_AddFavoriteGame(CSteamAPIContext.GetSteamMatchmaking(), nAppID, nIP, nConnPort, nQueryPort, unFlags, rTime32LastPlayedOnServer); } public static bool RemoveFavoriteGame(AppId_t nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_RemoveFavoriteGame(CSteamAPIContext.GetSteamMatchmaking(), nAppID, nIP, nConnPort, nQueryPort, unFlags); } public static SteamAPICall_t RequestLobbyList() { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamMatchmaking_RequestLobbyList(CSteamAPIContext.GetSteamMatchmaking()); } public static void AddRequestLobbyListStringFilter(string pchKeyToMatch, string pchValueToMatch, ELobbyComparison eComparisonType) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKeyToMatch2 = new InteropHelp.UTF8StringHandle(pchKeyToMatch); using InteropHelp.UTF8StringHandle pchValueToMatch2 = new InteropHelp.UTF8StringHandle(pchValueToMatch); NativeMethods.ISteamMatchmaking_AddRequestLobbyListStringFilter(CSteamAPIContext.GetSteamMatchmaking(), pchKeyToMatch2, pchValueToMatch2, eComparisonType); } public static void AddRequestLobbyListNumericalFilter(string pchKeyToMatch, int nValueToMatch, ELobbyComparison eComparisonType) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKeyToMatch2 = new InteropHelp.UTF8StringHandle(pchKeyToMatch); NativeMethods.ISteamMatchmaking_AddRequestLobbyListNumericalFilter(CSteamAPIContext.GetSteamMatchmaking(), pchKeyToMatch2, nValueToMatch, eComparisonType); } public static void AddRequestLobbyListNearValueFilter(string pchKeyToMatch, int nValueToBeCloseTo) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKeyToMatch2 = new InteropHelp.UTF8StringHandle(pchKeyToMatch); NativeMethods.ISteamMatchmaking_AddRequestLobbyListNearValueFilter(CSteamAPIContext.GetSteamMatchmaking(), pchKeyToMatch2, nValueToBeCloseTo); } public static void AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(CSteamAPIContext.GetSteamMatchmaking(), nSlotsAvailable); } public static void AddRequestLobbyListDistanceFilter(ELobbyDistanceFilter eLobbyDistanceFilter) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMatchmaking_AddRequestLobbyListDistanceFilter(CSteamAPIContext.GetSteamMatchmaking(), eLobbyDistanceFilter); } public static void AddRequestLobbyListResultCountFilter(int cMaxResults) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMatchmaking_AddRequestLobbyListResultCountFilter(CSteamAPIContext.GetSteamMatchmaking(), cMaxResults); } public static void AddRequestLobbyListCompatibleMembersFilter(CSteamID steamIDLobby) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby); } public static CSteamID GetLobbyByIndex(int iLobby) { InteropHelp.TestIfAvailableClient(); return (CSteamID)NativeMethods.ISteamMatchmaking_GetLobbyByIndex(CSteamAPIContext.GetSteamMatchmaking(), iLobby); } public static SteamAPICall_t CreateLobby(ELobbyType eLobbyType, int cMaxMembers) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamMatchmaking_CreateLobby(CSteamAPIContext.GetSteamMatchmaking(), eLobbyType, cMaxMembers); } public static SteamAPICall_t JoinLobby(CSteamID steamIDLobby) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamMatchmaking_JoinLobby(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby); } public static void LeaveLobby(CSteamID steamIDLobby) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMatchmaking_LeaveLobby(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby); } public static bool InviteUserToLobby(CSteamID steamIDLobby, CSteamID steamIDInvitee) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_InviteUserToLobby(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, steamIDInvitee); } public static int GetNumLobbyMembers(CSteamID steamIDLobby) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_GetNumLobbyMembers(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby); } public static CSteamID GetLobbyMemberByIndex(CSteamID steamIDLobby, int iMember) { InteropHelp.TestIfAvailableClient(); return (CSteamID)NativeMethods.ISteamMatchmaking_GetLobbyMemberByIndex(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, iMember); } public static string GetLobbyData(CSteamID steamIDLobby, string pchKey) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamMatchmaking_GetLobbyData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pchKey2)); } public static bool SetLobbyData(CSteamID steamIDLobby, string pchKey, string pchValue) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); using InteropHelp.UTF8StringHandle pchValue2 = new InteropHelp.UTF8StringHandle(pchValue); return NativeMethods.ISteamMatchmaking_SetLobbyData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pchKey2, pchValue2); } public static int GetLobbyDataCount(CSteamID steamIDLobby) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_GetLobbyDataCount(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby); } public static bool GetLobbyDataByIndex(CSteamID steamIDLobby, int iLobbyData, out string pchKey, int cchKeyBufferSize, out string pchValue, int cchValueBufferSize) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cchKeyBufferSize); IntPtr intPtr2 = Marshal.AllocHGlobal(cchValueBufferSize); bool flag = NativeMethods.ISteamMatchmaking_GetLobbyDataByIndex(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, iLobbyData, intPtr, cchKeyBufferSize, intPtr2, cchValueBufferSize); pchKey = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); pchValue = (flag ? InteropHelp.PtrToStringUTF8(intPtr2) : null); Marshal.FreeHGlobal(intPtr2); return flag; } public static bool DeleteLobbyData(CSteamID steamIDLobby, string pchKey) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); return NativeMethods.ISteamMatchmaking_DeleteLobbyData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pchKey2); } public static string GetLobbyMemberData(CSteamID steamIDLobby, CSteamID steamIDUser, string pchKey) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamMatchmaking_GetLobbyMemberData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, steamIDUser, pchKey2)); } public static void SetLobbyMemberData(CSteamID steamIDLobby, string pchKey, string pchValue) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); using InteropHelp.UTF8StringHandle pchValue2 = new InteropHelp.UTF8StringHandle(pchValue); NativeMethods.ISteamMatchmaking_SetLobbyMemberData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pchKey2, pchValue2); } public static bool SendLobbyChatMsg(CSteamID steamIDLobby, byte[] pvMsgBody, int cubMsgBody) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_SendLobbyChatMsg(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pvMsgBody, cubMsgBody); } public static int GetLobbyChatEntry(CSteamID steamIDLobby, int iChatID, out CSteamID pSteamIDUser, byte[] pvData, int cubData, out EChatEntryType peChatEntryType) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_GetLobbyChatEntry(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, iChatID, out pSteamIDUser, pvData, cubData, out peChatEntryType); } public static bool RequestLobbyData(CSteamID steamIDLobby) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_RequestLobbyData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby); } public static void SetLobbyGameServer(CSteamID steamIDLobby, uint unGameServerIP, ushort unGameServerPort, CSteamID steamIDGameServer) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMatchmaking_SetLobbyGameServer(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, unGameServerIP, unGameServerPort, steamIDGameServer); } public static bool GetLobbyGameServer(CSteamID steamIDLobby, out uint punGameServerIP, out ushort punGameServerPort, out CSteamID psteamIDGameServer) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_GetLobbyGameServer(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, out punGameServerIP, out punGameServerPort, out psteamIDGameServer); } public static bool SetLobbyMemberLimit(CSteamID steamIDLobby, int cMaxMembers) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_SetLobbyMemberLimit(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, cMaxMembers); } public static int GetLobbyMemberLimit(CSteamID steamIDLobby) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_GetLobbyMemberLimit(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby); } public static bool SetLobbyType(CSteamID steamIDLobby, ELobbyType eLobbyType) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_SetLobbyType(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, eLobbyType); } public static bool SetLobbyJoinable(CSteamID steamIDLobby, bool bLobbyJoinable) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_SetLobbyJoinable(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, bLobbyJoinable); } public static CSteamID GetLobbyOwner(CSteamID steamIDLobby) { InteropHelp.TestIfAvailableClient(); return (CSteamID)NativeMethods.ISteamMatchmaking_GetLobbyOwner(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby); } public static bool SetLobbyOwner(CSteamID steamIDLobby, CSteamID steamIDNewOwner) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_SetLobbyOwner(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, steamIDNewOwner); } public static bool SetLinkedLobby(CSteamID steamIDLobby, CSteamID steamIDLobbyDependent) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmaking_SetLinkedLobby(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, steamIDLobbyDependent); } } public static class SteamMatchmakingServers { public static HServerListRequest RequestInternetServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse) { InteropHelp.TestIfAvailableClient(); return (HServerListRequest)NativeMethods.ISteamMatchmakingServers_RequestInternetServerList(CSteamAPIContext.GetSteamMatchmakingServers(), iApp, new MMKVPMarshaller(ppchFilters), nFilters, (IntPtr)pRequestServersResponse); } public static HServerListRequest RequestLANServerList(AppId_t iApp, ISteamMatchmakingServerListResponse pRequestServersResponse) { InteropHelp.TestIfAvailableClient(); return (HServerListRequest)NativeMethods.ISteamMatchmakingServers_RequestLANServerList(CSteamAPIContext.GetSteamMatchmakingServers(), iApp, (IntPtr)pRequestServersResponse); } public static HServerListRequest RequestFriendsServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse) { InteropHelp.TestIfAvailableClient(); return (HServerListRequest)NativeMethods.ISteamMatchmakingServers_RequestFriendsServerList(CSteamAPIContext.GetSteamMatchmakingServers(), iApp, new MMKVPMarshaller(ppchFilters), nFilters, (IntPtr)pRequestServersResponse); } public static HServerListRequest RequestFavoritesServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse) { InteropHelp.TestIfAvailableClient(); return (HServerListRequest)NativeMethods.ISteamMatchmakingServers_RequestFavoritesServerList(CSteamAPIContext.GetSteamMatchmakingServers(), iApp, new MMKVPMarshaller(ppchFilters), nFilters, (IntPtr)pRequestServersResponse); } public static HServerListRequest RequestHistoryServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse) { InteropHelp.TestIfAvailableClient(); return (HServerListRequest)NativeMethods.ISteamMatchmakingServers_RequestHistoryServerList(CSteamAPIContext.GetSteamMatchmakingServers(), iApp, new MMKVPMarshaller(ppchFilters), nFilters, (IntPtr)pRequestServersResponse); } public static HServerListRequest RequestSpectatorServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse) { InteropHelp.TestIfAvailableClient(); return (HServerListRequest)NativeMethods.ISteamMatchmakingServers_RequestSpectatorServerList(CSteamAPIContext.GetSteamMatchmakingServers(), iApp, new MMKVPMarshaller(ppchFilters), nFilters, (IntPtr)pRequestServersResponse); } public static void ReleaseRequest(HServerListRequest hServerListRequest) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMatchmakingServers_ReleaseRequest(CSteamAPIContext.GetSteamMatchmakingServers(), hServerListRequest); } public static gameserveritem_t GetServerDetails(HServerListRequest hRequest, int iServer) { InteropHelp.TestIfAvailableClient(); return (gameserveritem_t)Marshal.PtrToStructure(NativeMethods.ISteamMatchmakingServers_GetServerDetails(CSteamAPIContext.GetSteamMatchmakingServers(), hRequest, iServer), typeof(gameserveritem_t)); } public static void CancelQuery(HServerListRequest hRequest) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMatchmakingServers_CancelQuery(CSteamAPIContext.GetSteamMatchmakingServers(), hRequest); } public static void RefreshQuery(HServerListRequest hRequest) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMatchmakingServers_RefreshQuery(CSteamAPIContext.GetSteamMatchmakingServers(), hRequest); } public static bool IsRefreshing(HServerListRequest hRequest) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmakingServers_IsRefreshing(CSteamAPIContext.GetSteamMatchmakingServers(), hRequest); } public static int GetServerCount(HServerListRequest hRequest) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMatchmakingServers_GetServerCount(CSteamAPIContext.GetSteamMatchmakingServers(), hRequest); } public static void RefreshServer(HServerListRequest hRequest, int iServer) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMatchmakingServers_RefreshServer(CSteamAPIContext.GetSteamMatchmakingServers(), hRequest, iServer); } public static HServerQuery PingServer(uint unIP, ushort usPort, ISteamMatchmakingPingResponse pRequestServersResponse) { InteropHelp.TestIfAvailableClient(); return (HServerQuery)NativeMethods.ISteamMatchmakingServers_PingServer(CSteamAPIContext.GetSteamMatchmakingServers(), unIP, usPort, (IntPtr)pRequestServersResponse); } public static HServerQuery PlayerDetails(uint unIP, ushort usPort, ISteamMatchmakingPlayersResponse pRequestServersResponse) { InteropHelp.TestIfAvailableClient(); return (HServerQuery)NativeMethods.ISteamMatchmakingServers_PlayerDetails(CSteamAPIContext.GetSteamMatchmakingServers(), unIP, usPort, (IntPtr)pRequestServersResponse); } public static HServerQuery ServerRules(uint unIP, ushort usPort, ISteamMatchmakingRulesResponse pRequestServersResponse) { InteropHelp.TestIfAvailableClient(); return (HServerQuery)NativeMethods.ISteamMatchmakingServers_ServerRules(CSteamAPIContext.GetSteamMatchmakingServers(), unIP, usPort, (IntPtr)pRequestServersResponse); } public static void CancelServerQuery(HServerQuery hServerQuery) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMatchmakingServers_CancelServerQuery(CSteamAPIContext.GetSteamMatchmakingServers(), hServerQuery); } } public static class SteamGameSearch { public static EGameSearchErrorCode_t AddGameSearchParams(string pchKeyToFind, string pchValuesToFind) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKeyToFind2 = new InteropHelp.UTF8StringHandle(pchKeyToFind); using InteropHelp.UTF8StringHandle pchValuesToFind2 = new InteropHelp.UTF8StringHandle(pchValuesToFind); return NativeMethods.ISteamGameSearch_AddGameSearchParams(CSteamAPIContext.GetSteamGameSearch(), pchKeyToFind2, pchValuesToFind2); } public static EGameSearchErrorCode_t SearchForGameWithLobby(CSteamID steamIDLobby, int nPlayerMin, int nPlayerMax) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamGameSearch_SearchForGameWithLobby(CSteamAPIContext.GetSteamGameSearch(), steamIDLobby, nPlayerMin, nPlayerMax); } public static EGameSearchErrorCode_t SearchForGameSolo(int nPlayerMin, int nPlayerMax) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamGameSearch_SearchForGameSolo(CSteamAPIContext.GetSteamGameSearch(), nPlayerMin, nPlayerMax); } public static EGameSearchErrorCode_t AcceptGame() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamGameSearch_AcceptGame(CSteamAPIContext.GetSteamGameSearch()); } public static EGameSearchErrorCode_t DeclineGame() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamGameSearch_DeclineGame(CSteamAPIContext.GetSteamGameSearch()); } public static EGameSearchErrorCode_t RetrieveConnectionDetails(CSteamID steamIDHost, out string pchConnectionDetails, int cubConnectionDetails) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cubConnectionDetails); EGameSearchErrorCode_t eGameSearchErrorCode_t = NativeMethods.ISteamGameSearch_RetrieveConnectionDetails(CSteamAPIContext.GetSteamGameSearch(), steamIDHost, intPtr, cubConnectionDetails); pchConnectionDetails = ((eGameSearchErrorCode_t != 0) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return eGameSearchErrorCode_t; } public static EGameSearchErrorCode_t EndGameSearch() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamGameSearch_EndGameSearch(CSteamAPIContext.GetSteamGameSearch()); } public static EGameSearchErrorCode_t SetGameHostParams(string pchKey, string pchValue) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); using InteropHelp.UTF8StringHandle pchValue2 = new InteropHelp.UTF8StringHandle(pchValue); return NativeMethods.ISteamGameSearch_SetGameHostParams(CSteamAPIContext.GetSteamGameSearch(), pchKey2, pchValue2); } public static EGameSearchErrorCode_t SetConnectionDetails(string pchConnectionDetails, int cubConnectionDetails) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchConnectionDetails2 = new InteropHelp.UTF8StringHandle(pchConnectionDetails); return NativeMethods.ISteamGameSearch_SetConnectionDetails(CSteamAPIContext.GetSteamGameSearch(), pchConnectionDetails2, cubConnectionDetails); } public static EGameSearchErrorCode_t RequestPlayersForGame(int nPlayerMin, int nPlayerMax, int nMaxTeamSize) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamGameSearch_RequestPlayersForGame(CSteamAPIContext.GetSteamGameSearch(), nPlayerMin, nPlayerMax, nMaxTeamSize); } public static EGameSearchErrorCode_t HostConfirmGameStart(ulong ullUniqueGameID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamGameSearch_HostConfirmGameStart(CSteamAPIContext.GetSteamGameSearch(), ullUniqueGameID); } public static EGameSearchErrorCode_t CancelRequestPlayersForGame() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamGameSearch_CancelRequestPlayersForGame(CSteamAPIContext.GetSteamGameSearch()); } public static EGameSearchErrorCode_t SubmitPlayerResult(ulong ullUniqueGameID, CSteamID steamIDPlayer, EPlayerResult_t EPlayerResult) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamGameSearch_SubmitPlayerResult(CSteamAPIContext.GetSteamGameSearch(), ullUniqueGameID, steamIDPlayer, EPlayerResult); } public static EGameSearchErrorCode_t EndGame(ulong ullUniqueGameID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamGameSearch_EndGame(CSteamAPIContext.GetSteamGameSearch(), ullUniqueGameID); } } public static class SteamParties { public static uint GetNumActiveBeacons() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamParties_GetNumActiveBeacons(CSteamAPIContext.GetSteamParties()); } public static PartyBeaconID_t GetBeaconByIndex(uint unIndex) { InteropHelp.TestIfAvailableClient(); return (PartyBeaconID_t)NativeMethods.ISteamParties_GetBeaconByIndex(CSteamAPIContext.GetSteamParties(), unIndex); } public static bool GetBeaconDetails(PartyBeaconID_t ulBeaconID, out CSteamID pSteamIDBeaconOwner, out SteamPartyBeaconLocation_t pLocation, out string pchMetadata, int cchMetadata) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cchMetadata); bool flag = NativeMethods.ISteamParties_GetBeaconDetails(CSteamAPIContext.GetSteamParties(), ulBeaconID, out pSteamIDBeaconOwner, out pLocation, intPtr, cchMetadata); pchMetadata = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static SteamAPICall_t JoinParty(PartyBeaconID_t ulBeaconID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamParties_JoinParty(CSteamAPIContext.GetSteamParties(), ulBeaconID); } public static bool GetNumAvailableBeaconLocations(out uint puNumLocations) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamParties_GetNumAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), out puNumLocations); } public static bool GetAvailableBeaconLocations(SteamPartyBeaconLocation_t[] pLocationList, uint uMaxNumLocations) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamParties_GetAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), pLocationList, uMaxNumLocations); } public static SteamAPICall_t CreateBeacon(uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, string pchConnectString, string pchMetadata) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchConnectString2 = new InteropHelp.UTF8StringHandle(pchConnectString); using InteropHelp.UTF8StringHandle pchMetadata2 = new InteropHelp.UTF8StringHandle(pchMetadata); return (SteamAPICall_t)NativeMethods.ISteamParties_CreateBeacon(CSteamAPIContext.GetSteamParties(), unOpenSlots, ref pBeaconLocation, pchConnectString2, pchMetadata2); } public static void OnReservationCompleted(PartyBeaconID_t ulBeacon, CSteamID steamIDUser) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamParties_OnReservationCompleted(CSteamAPIContext.GetSteamParties(), ulBeacon, steamIDUser); } public static void CancelReservation(PartyBeaconID_t ulBeacon, CSteamID steamIDUser) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamParties_CancelReservation(CSteamAPIContext.GetSteamParties(), ulBeacon, steamIDUser); } public static SteamAPICall_t ChangeNumOpenSlots(PartyBeaconID_t ulBeacon, uint unOpenSlots) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamParties_ChangeNumOpenSlots(CSteamAPIContext.GetSteamParties(), ulBeacon, unOpenSlots); } public static bool DestroyBeacon(PartyBeaconID_t ulBeacon) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamParties_DestroyBeacon(CSteamAPIContext.GetSteamParties(), ulBeacon); } public static bool GetBeaconLocationData(SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, out string pchDataStringOut, int cchDataStringOut) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cchDataStringOut); bool flag = NativeMethods.ISteamParties_GetBeaconLocationData(CSteamAPIContext.GetSteamParties(), BeaconLocation, eData, intPtr, cchDataStringOut); pchDataStringOut = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } } public static class SteamMusic { public static bool BIsEnabled() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusic_BIsEnabled(CSteamAPIContext.GetSteamMusic()); } public static bool BIsPlaying() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusic_BIsPlaying(CSteamAPIContext.GetSteamMusic()); } public static AudioPlayback_Status GetPlaybackStatus() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusic_GetPlaybackStatus(CSteamAPIContext.GetSteamMusic()); } public static void Play() { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMusic_Play(CSteamAPIContext.GetSteamMusic()); } public static void Pause() { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMusic_Pause(CSteamAPIContext.GetSteamMusic()); } public static void PlayPrevious() { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMusic_PlayPrevious(CSteamAPIContext.GetSteamMusic()); } public static void PlayNext() { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMusic_PlayNext(CSteamAPIContext.GetSteamMusic()); } public static void SetVolume(float flVolume) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamMusic_SetVolume(CSteamAPIContext.GetSteamMusic(), flVolume); } public static float GetVolume() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusic_GetVolume(CSteamAPIContext.GetSteamMusic()); } } public static class SteamMusicRemote { public static bool RegisterSteamMusicRemote(string pchName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamMusicRemote_RegisterSteamMusicRemote(CSteamAPIContext.GetSteamMusicRemote(), pchName2); } public static bool DeregisterSteamMusicRemote() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_DeregisterSteamMusicRemote(CSteamAPIContext.GetSteamMusicRemote()); } public static bool BIsCurrentMusicRemote() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_BIsCurrentMusicRemote(CSteamAPIContext.GetSteamMusicRemote()); } public static bool BActivationSuccess(bool bValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_BActivationSuccess(CSteamAPIContext.GetSteamMusicRemote(), bValue); } public static bool SetDisplayName(string pchDisplayName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchDisplayName2 = new InteropHelp.UTF8StringHandle(pchDisplayName); return NativeMethods.ISteamMusicRemote_SetDisplayName(CSteamAPIContext.GetSteamMusicRemote(), pchDisplayName2); } public static bool SetPNGIcon_64x64(byte[] pvBuffer, uint cbBufferLength) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_SetPNGIcon_64x64(CSteamAPIContext.GetSteamMusicRemote(), pvBuffer, cbBufferLength); } public static bool EnablePlayPrevious(bool bValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_EnablePlayPrevious(CSteamAPIContext.GetSteamMusicRemote(), bValue); } public static bool EnablePlayNext(bool bValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_EnablePlayNext(CSteamAPIContext.GetSteamMusicRemote(), bValue); } public static bool EnableShuffled(bool bValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_EnableShuffled(CSteamAPIContext.GetSteamMusicRemote(), bValue); } public static bool EnableLooped(bool bValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_EnableLooped(CSteamAPIContext.GetSteamMusicRemote(), bValue); } public static bool EnableQueue(bool bValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_EnableQueue(CSteamAPIContext.GetSteamMusicRemote(), bValue); } public static bool EnablePlaylists(bool bValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_EnablePlaylists(CSteamAPIContext.GetSteamMusicRemote(), bValue); } public static bool UpdatePlaybackStatus(AudioPlayback_Status nStatus) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_UpdatePlaybackStatus(CSteamAPIContext.GetSteamMusicRemote(), nStatus); } public static bool UpdateShuffled(bool bValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_UpdateShuffled(CSteamAPIContext.GetSteamMusicRemote(), bValue); } public static bool UpdateLooped(bool bValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_UpdateLooped(CSteamAPIContext.GetSteamMusicRemote(), bValue); } public static bool UpdateVolume(float flValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_UpdateVolume(CSteamAPIContext.GetSteamMusicRemote(), flValue); } public static bool CurrentEntryWillChange() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_CurrentEntryWillChange(CSteamAPIContext.GetSteamMusicRemote()); } public static bool CurrentEntryIsAvailable(bool bAvailable) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_CurrentEntryIsAvailable(CSteamAPIContext.GetSteamMusicRemote(), bAvailable); } public static bool UpdateCurrentEntryText(string pchText) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchText2 = new InteropHelp.UTF8StringHandle(pchText); return NativeMethods.ISteamMusicRemote_UpdateCurrentEntryText(CSteamAPIContext.GetSteamMusicRemote(), pchText2); } public static bool UpdateCurrentEntryElapsedSeconds(int nValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds(CSteamAPIContext.GetSteamMusicRemote(), nValue); } public static bool UpdateCurrentEntryCoverArt(byte[] pvBuffer, uint cbBufferLength) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_UpdateCurrentEntryCoverArt(CSteamAPIContext.GetSteamMusicRemote(), pvBuffer, cbBufferLength); } public static bool CurrentEntryDidChange() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_CurrentEntryDidChange(CSteamAPIContext.GetSteamMusicRemote()); } public static bool QueueWillChange() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_QueueWillChange(CSteamAPIContext.GetSteamMusicRemote()); } public static bool ResetQueueEntries() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_ResetQueueEntries(CSteamAPIContext.GetSteamMusicRemote()); } public static bool SetQueueEntry(int nID, int nPosition, string pchEntryText) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchEntryText2 = new InteropHelp.UTF8StringHandle(pchEntryText); return NativeMethods.ISteamMusicRemote_SetQueueEntry(CSteamAPIContext.GetSteamMusicRemote(), nID, nPosition, pchEntryText2); } public static bool SetCurrentQueueEntry(int nID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_SetCurrentQueueEntry(CSteamAPIContext.GetSteamMusicRemote(), nID); } public static bool QueueDidChange() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_QueueDidChange(CSteamAPIContext.GetSteamMusicRemote()); } public static bool PlaylistWillChange() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_PlaylistWillChange(CSteamAPIContext.GetSteamMusicRemote()); } public static bool ResetPlaylistEntries() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_ResetPlaylistEntries(CSteamAPIContext.GetSteamMusicRemote()); } public static bool SetPlaylistEntry(int nID, int nPosition, string pchEntryText) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchEntryText2 = new InteropHelp.UTF8StringHandle(pchEntryText); return NativeMethods.ISteamMusicRemote_SetPlaylistEntry(CSteamAPIContext.GetSteamMusicRemote(), nID, nPosition, pchEntryText2); } public static bool SetCurrentPlaylistEntry(int nID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_SetCurrentPlaylistEntry(CSteamAPIContext.GetSteamMusicRemote(), nID); } public static bool PlaylistDidChange() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamMusicRemote_PlaylistDidChange(CSteamAPIContext.GetSteamMusicRemote()); } } public static class SteamNetworking { public static bool SendP2PPacket(CSteamID steamIDRemote, byte[] pubData, uint cubData, EP2PSend eP2PSendType, int nChannel = 0) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_SendP2PPacket(CSteamAPIContext.GetSteamNetworking(), steamIDRemote, pubData, cubData, eP2PSendType, nChannel); } public static bool IsP2PPacketAvailable(out uint pcubMsgSize, int nChannel = 0) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_IsP2PPacketAvailable(CSteamAPIContext.GetSteamNetworking(), out pcubMsgSize, nChannel); } public static bool ReadP2PPacket(byte[] pubDest, uint cubDest, out uint pcubMsgSize, out CSteamID psteamIDRemote, int nChannel = 0) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_ReadP2PPacket(CSteamAPIContext.GetSteamNetworking(), pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel); } public static bool AcceptP2PSessionWithUser(CSteamID steamIDRemote) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_AcceptP2PSessionWithUser(CSteamAPIContext.GetSteamNetworking(), steamIDRemote); } public static bool CloseP2PSessionWithUser(CSteamID steamIDRemote) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_CloseP2PSessionWithUser(CSteamAPIContext.GetSteamNetworking(), steamIDRemote); } public static bool CloseP2PChannelWithUser(CSteamID steamIDRemote, int nChannel) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_CloseP2PChannelWithUser(CSteamAPIContext.GetSteamNetworking(), steamIDRemote, nChannel); } public static bool GetP2PSessionState(CSteamID steamIDRemote, out P2PSessionState_t pConnectionState) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_GetP2PSessionState(CSteamAPIContext.GetSteamNetworking(), steamIDRemote, out pConnectionState); } public static bool AllowP2PPacketRelay(bool bAllow) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_AllowP2PPacketRelay(CSteamAPIContext.GetSteamNetworking(), bAllow); } public static SNetListenSocket_t CreateListenSocket(int nVirtualP2PPort, SteamIPAddress_t nIP, ushort nPort, bool bAllowUseOfPacketRelay) { InteropHelp.TestIfAvailableClient(); return (SNetListenSocket_t)NativeMethods.ISteamNetworking_CreateListenSocket(CSteamAPIContext.GetSteamNetworking(), nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay); } public static SNetSocket_t CreateP2PConnectionSocket(CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay) { InteropHelp.TestIfAvailableClient(); return (SNetSocket_t)NativeMethods.ISteamNetworking_CreateP2PConnectionSocket(CSteamAPIContext.GetSteamNetworking(), steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay); } public static SNetSocket_t CreateConnectionSocket(SteamIPAddress_t nIP, ushort nPort, int nTimeoutSec) { InteropHelp.TestIfAvailableClient(); return (SNetSocket_t)NativeMethods.ISteamNetworking_CreateConnectionSocket(CSteamAPIContext.GetSteamNetworking(), nIP, nPort, nTimeoutSec); } public static bool DestroySocket(SNetSocket_t hSocket, bool bNotifyRemoteEnd) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_DestroySocket(CSteamAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd); } public static bool DestroyListenSocket(SNetListenSocket_t hSocket, bool bNotifyRemoteEnd) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_DestroyListenSocket(CSteamAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd); } public static bool SendDataOnSocket(SNetSocket_t hSocket, byte[] pubData, uint cubData, bool bReliable) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_SendDataOnSocket(CSteamAPIContext.GetSteamNetworking(), hSocket, pubData, cubData, bReliable); } public static bool IsDataAvailableOnSocket(SNetSocket_t hSocket, out uint pcubMsgSize) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_IsDataAvailableOnSocket(CSteamAPIContext.GetSteamNetworking(), hSocket, out pcubMsgSize); } public static bool RetrieveDataFromSocket(SNetSocket_t hSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_RetrieveDataFromSocket(CSteamAPIContext.GetSteamNetworking(), hSocket, pubDest, cubDest, out pcubMsgSize); } public static bool IsDataAvailable(SNetListenSocket_t hListenSocket, out uint pcubMsgSize, out SNetSocket_t phSocket) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_IsDataAvailable(CSteamAPIContext.GetSteamNetworking(), hListenSocket, out pcubMsgSize, out phSocket); } public static bool RetrieveData(SNetListenSocket_t hListenSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize, out SNetSocket_t phSocket) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_RetrieveData(CSteamAPIContext.GetSteamNetworking(), hListenSocket, pubDest, cubDest, out pcubMsgSize, out phSocket); } public static bool GetSocketInfo(SNetSocket_t hSocket, out CSteamID pSteamIDRemote, out int peSocketStatus, out SteamIPAddress_t punIPRemote, out ushort punPortRemote) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_GetSocketInfo(CSteamAPIContext.GetSteamNetworking(), hSocket, out pSteamIDRemote, out peSocketStatus, out punIPRemote, out punPortRemote); } public static bool GetListenSocketInfo(SNetListenSocket_t hListenSocket, out SteamIPAddress_t pnIP, out ushort pnPort) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_GetListenSocketInfo(CSteamAPIContext.GetSteamNetworking(), hListenSocket, out pnIP, out pnPort); } public static ESNetSocketConnectionType GetSocketConnectionType(SNetSocket_t hSocket) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_GetSocketConnectionType(CSteamAPIContext.GetSteamNetworking(), hSocket); } public static int GetMaxPacketSize(SNetSocket_t hSocket) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworking_GetMaxPacketSize(CSteamAPIContext.GetSteamNetworking(), hSocket); } } public static class SteamNetworkingSockets { public static HSteamListenSocket CreateListenSocketIP(ref SteamNetworkingIPAddr localAddress, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableClient(); return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateListenSocketIP(CSteamAPIContext.GetSteamNetworkingSockets(), ref localAddress, nOptions, pOptions); } public static HSteamNetConnection ConnectByIPAddress(ref SteamNetworkingIPAddr address, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableClient(); return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectByIPAddress(CSteamAPIContext.GetSteamNetworkingSockets(), ref address, nOptions, pOptions); } public static HSteamListenSocket CreateListenSocketP2P(int nVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableClient(); return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateListenSocketP2P(CSteamAPIContext.GetSteamNetworkingSockets(), nVirtualPort, nOptions, pOptions); } public static HSteamNetConnection ConnectP2P(ref SteamNetworkingIdentity identityRemote, int nVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableClient(); return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectP2P(CSteamAPIContext.GetSteamNetworkingSockets(), ref identityRemote, nVirtualPort, nOptions, pOptions); } public static EResult AcceptConnection(HSteamNetConnection hConn) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_AcceptConnection(CSteamAPIContext.GetSteamNetworkingSockets(), hConn); } public static bool CloseConnection(HSteamNetConnection hPeer, int nReason, string pszDebug, bool bEnableLinger) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszDebug2 = new InteropHelp.UTF8StringHandle(pszDebug); return NativeMethods.ISteamNetworkingSockets_CloseConnection(CSteamAPIContext.GetSteamNetworkingSockets(), hPeer, nReason, pszDebug2, bEnableLinger); } public static bool CloseListenSocket(HSteamListenSocket hSocket) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_CloseListenSocket(CSteamAPIContext.GetSteamNetworkingSockets(), hSocket); } public static bool SetConnectionUserData(HSteamNetConnection hPeer, long nUserData) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_SetConnectionUserData(CSteamAPIContext.GetSteamNetworkingSockets(), hPeer, nUserData); } public static long GetConnectionUserData(HSteamNetConnection hPeer) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_GetConnectionUserData(CSteamAPIContext.GetSteamNetworkingSockets(), hPeer); } public static void SetConnectionName(HSteamNetConnection hPeer, string pszName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszName2 = new InteropHelp.UTF8StringHandle(pszName); NativeMethods.ISteamNetworkingSockets_SetConnectionName(CSteamAPIContext.GetSteamNetworkingSockets(), hPeer, pszName2); } public static bool GetConnectionName(HSteamNetConnection hPeer, out string pszName, int nMaxLen) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(nMaxLen); bool flag = NativeMethods.ISteamNetworkingSockets_GetConnectionName(CSteamAPIContext.GetSteamNetworkingSockets(), hPeer, intPtr, nMaxLen); pszName = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static EResult SendMessageToConnection(HSteamNetConnection hConn, IntPtr pData, uint cbData, int nSendFlags, out long pOutMessageNumber) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_SendMessageToConnection(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, pData, cbData, nSendFlags, out pOutMessageNumber); } public static void SendMessages(int nMessages, SteamNetworkingMessage_t[] pMessages, long[] pOutMessageNumberOrResult) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamNetworkingSockets_SendMessages(CSteamAPIContext.GetSteamNetworkingSockets(), nMessages, pMessages, pOutMessageNumberOrResult); } public static EResult FlushMessagesOnConnection(HSteamNetConnection hConn) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_FlushMessagesOnConnection(CSteamAPIContext.GetSteamNetworkingSockets(), hConn); } public static int ReceiveMessagesOnConnection(HSteamNetConnection hConn, IntPtr[] ppOutMessages, int nMaxMessages) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnConnection(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, ppOutMessages, nMaxMessages); } public static bool GetConnectionInfo(HSteamNetConnection hConn, out SteamNetConnectionInfo_t pInfo) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_GetConnectionInfo(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, out pInfo); } public static bool GetQuickConnectionStatus(HSteamNetConnection hConn, out SteamNetworkingQuickConnectionStatus pStats) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_GetQuickConnectionStatus(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, out pStats); } public static int GetDetailedConnectionStatus(HSteamNetConnection hConn, out string pszBuf, int cbBuf) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cbBuf); int num = NativeMethods.ISteamNetworkingSockets_GetDetailedConnectionStatus(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, intPtr, cbBuf); pszBuf = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static bool GetListenSocketAddress(HSteamListenSocket hSocket, out SteamNetworkingIPAddr address) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_GetListenSocketAddress(CSteamAPIContext.GetSteamNetworkingSockets(), hSocket, out address); } public static bool CreateSocketPair(out HSteamNetConnection pOutConnection1, out HSteamNetConnection pOutConnection2, bool bUseNetworkLoopback, ref SteamNetworkingIdentity pIdentity1, ref SteamNetworkingIdentity pIdentity2) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_CreateSocketPair(CSteamAPIContext.GetSteamNetworkingSockets(), out pOutConnection1, out pOutConnection2, bUseNetworkLoopback, ref pIdentity1, ref pIdentity2); } public static bool GetIdentity(out SteamNetworkingIdentity pIdentity) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_GetIdentity(CSteamAPIContext.GetSteamNetworkingSockets(), out pIdentity); } public static ESteamNetworkingAvailability InitAuthentication() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_InitAuthentication(CSteamAPIContext.GetSteamNetworkingSockets()); } public static ESteamNetworkingAvailability GetAuthenticationStatus(out SteamNetAuthenticationStatus_t pDetails) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_GetAuthenticationStatus(CSteamAPIContext.GetSteamNetworkingSockets(), out pDetails); } public static HSteamNetPollGroup CreatePollGroup() { InteropHelp.TestIfAvailableClient(); return (HSteamNetPollGroup)NativeMethods.ISteamNetworkingSockets_CreatePollGroup(CSteamAPIContext.GetSteamNetworkingSockets()); } public static bool DestroyPollGroup(HSteamNetPollGroup hPollGroup) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_DestroyPollGroup(CSteamAPIContext.GetSteamNetworkingSockets(), hPollGroup); } public static bool SetConnectionPollGroup(HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_SetConnectionPollGroup(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, hPollGroup); } public static int ReceiveMessagesOnPollGroup(HSteamNetPollGroup hPollGroup, IntPtr[] ppOutMessages, int nMaxMessages) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_ReceiveMessagesOnPollGroup(CSteamAPIContext.GetSteamNetworkingSockets(), hPollGroup, ppOutMessages, nMaxMessages); } public static bool ReceivedRelayAuthTicket(IntPtr pvTicket, int cbTicket, out SteamDatagramRelayAuthTicket pOutParsedTicket) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_ReceivedRelayAuthTicket(CSteamAPIContext.GetSteamNetworkingSockets(), pvTicket, cbTicket, out pOutParsedTicket); } public static int FindRelayAuthTicketForServer(ref SteamNetworkingIdentity identityGameServer, int nVirtualPort, out SteamDatagramRelayAuthTicket pOutParsedTicket) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_FindRelayAuthTicketForServer(CSteamAPIContext.GetSteamNetworkingSockets(), ref identityGameServer, nVirtualPort, out pOutParsedTicket); } public static HSteamNetConnection ConnectToHostedDedicatedServer(ref SteamNetworkingIdentity identityTarget, int nVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableClient(); return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectToHostedDedicatedServer(CSteamAPIContext.GetSteamNetworkingSockets(), ref identityTarget, nVirtualPort, nOptions, pOptions); } public static ushort GetHostedDedicatedServerPort() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_GetHostedDedicatedServerPort(CSteamAPIContext.GetSteamNetworkingSockets()); } public static SteamNetworkingPOPID GetHostedDedicatedServerPOPID() { InteropHelp.TestIfAvailableClient(); return (SteamNetworkingPOPID)NativeMethods.ISteamNetworkingSockets_GetHostedDedicatedServerPOPID(CSteamAPIContext.GetSteamNetworkingSockets()); } public static EResult GetHostedDedicatedServerAddress(out SteamDatagramHostedAddress pRouting) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_GetHostedDedicatedServerAddress(CSteamAPIContext.GetSteamNetworkingSockets(), out pRouting); } public static HSteamListenSocket CreateHostedDedicatedServerListenSocket(int nVirtualPort, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableClient(); return (HSteamListenSocket)NativeMethods.ISteamNetworkingSockets_CreateHostedDedicatedServerListenSocket(CSteamAPIContext.GetSteamNetworkingSockets(), nVirtualPort, nOptions, pOptions); } public static EResult GetGameCoordinatorServerLogin(out SteamDatagramGameCoordinatorServerLogin pLoginInfo, out int pcbSignedBlob, IntPtr pBlob) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_GetGameCoordinatorServerLogin(CSteamAPIContext.GetSteamNetworkingSockets(), out pLoginInfo, out pcbSignedBlob, pBlob); } public static HSteamNetConnection ConnectP2PCustomSignaling(out ISteamNetworkingConnectionCustomSignaling pSignaling, ref SteamNetworkingIdentity pPeerIdentity, int nOptions, SteamNetworkingConfigValue_t[] pOptions) { InteropHelp.TestIfAvailableClient(); return (HSteamNetConnection)NativeMethods.ISteamNetworkingSockets_ConnectP2PCustomSignaling(CSteamAPIContext.GetSteamNetworkingSockets(), out pSignaling, ref pPeerIdentity, nOptions, pOptions); } public static bool ReceivedP2PCustomSignal(IntPtr pMsg, int cbMsg, out ISteamNetworkingCustomSignalingRecvContext pContext) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_ReceivedP2PCustomSignal(CSteamAPIContext.GetSteamNetworkingSockets(), pMsg, cbMsg, out pContext); } public static bool GetCertificateRequest(out int pcbBlob, IntPtr pBlob, out SteamNetworkingErrMsg errMsg) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_GetCertificateRequest(CSteamAPIContext.GetSteamNetworkingSockets(), out pcbBlob, pBlob, out errMsg); } public static bool SetCertificate(IntPtr pCertificate, int cbCertificate, out SteamNetworkingErrMsg errMsg) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingSockets_SetCertificate(CSteamAPIContext.GetSteamNetworkingSockets(), pCertificate, cbCertificate, out errMsg); } } public static class SteamNetworkingUtils { public static IntPtr AllocateMessage(int cbAllocateBuffer) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_AllocateMessage(CSteamAPIContext.GetSteamNetworkingUtils(), cbAllocateBuffer); } public static ESteamNetworkingAvailability GetRelayNetworkStatus(out SteamRelayNetworkStatus_t pDetails) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_GetRelayNetworkStatus(CSteamAPIContext.GetSteamNetworkingUtils(), out pDetails); } public static float GetLocalPingLocation(out SteamNetworkPingLocation_t result) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_GetLocalPingLocation(CSteamAPIContext.GetSteamNetworkingUtils(), out result); } public static int EstimatePingTimeBetweenTwoLocations(ref SteamNetworkPingLocation_t location1, ref SteamNetworkPingLocation_t location2) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_EstimatePingTimeBetweenTwoLocations(CSteamAPIContext.GetSteamNetworkingUtils(), ref location1, ref location2); } public static int EstimatePingTimeFromLocalHost(ref SteamNetworkPingLocation_t remoteLocation) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_EstimatePingTimeFromLocalHost(CSteamAPIContext.GetSteamNetworkingUtils(), ref remoteLocation); } public static void ConvertPingLocationToString(ref SteamNetworkPingLocation_t location, out string pszBuf, int cchBufSize) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cchBufSize); NativeMethods.ISteamNetworkingUtils_ConvertPingLocationToString(CSteamAPIContext.GetSteamNetworkingUtils(), ref location, intPtr, cchBufSize); pszBuf = InteropHelp.PtrToStringUTF8(intPtr); Marshal.FreeHGlobal(intPtr); } public static bool ParsePingLocationString(string pszString, out SteamNetworkPingLocation_t result) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszString2 = new InteropHelp.UTF8StringHandle(pszString); return NativeMethods.ISteamNetworkingUtils_ParsePingLocationString(CSteamAPIContext.GetSteamNetworkingUtils(), pszString2, out result); } public static bool CheckPingDataUpToDate(float flMaxAgeSeconds) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_CheckPingDataUpToDate(CSteamAPIContext.GetSteamNetworkingUtils(), flMaxAgeSeconds); } public static int GetPingToDataCenter(SteamNetworkingPOPID popID, out SteamNetworkingPOPID pViaRelayPoP) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_GetPingToDataCenter(CSteamAPIContext.GetSteamNetworkingUtils(), popID, out pViaRelayPoP); } public static int GetDirectPingToPOP(SteamNetworkingPOPID popID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_GetDirectPingToPOP(CSteamAPIContext.GetSteamNetworkingUtils(), popID); } public static int GetPOPCount() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_GetPOPCount(CSteamAPIContext.GetSteamNetworkingUtils()); } public static int GetPOPList(out SteamNetworkingPOPID list, int nListSz) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_GetPOPList(CSteamAPIContext.GetSteamNetworkingUtils(), out list, nListSz); } public static SteamNetworkingMicroseconds GetLocalTimestamp() { InteropHelp.TestIfAvailableClient(); return (SteamNetworkingMicroseconds)NativeMethods.ISteamNetworkingUtils_GetLocalTimestamp(CSteamAPIContext.GetSteamNetworkingUtils()); } public static void SetDebugOutputFunction(ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamNetworkingUtils_SetDebugOutputFunction(CSteamAPIContext.GetSteamNetworkingUtils(), eDetailLevel, pfnFunc); } public static bool SetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, ESteamNetworkingConfigDataType eDataType, IntPtr pArg) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_SetConfigValue(CSteamAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, eDataType, pArg); } public static ESteamNetworkingGetConfigValueResult GetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, out ESteamNetworkingConfigDataType pOutDataType, IntPtr pResult, out ulong cbResult) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_GetConfigValue(CSteamAPIContext.GetSteamNetworkingUtils(), eValue, eScopeType, scopeObj, out pOutDataType, pResult, out cbResult); } public static bool GetConfigValueInfo(ESteamNetworkingConfigValue eValue, IntPtr pOutName, out ESteamNetworkingConfigDataType pOutDataType, out ESteamNetworkingConfigScope pOutScope, out ESteamNetworkingConfigValue pOutNextValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_GetConfigValueInfo(CSteamAPIContext.GetSteamNetworkingUtils(), eValue, pOutName, out pOutDataType, out pOutScope, out pOutNextValue); } public static ESteamNetworkingConfigValue GetFirstConfigValue() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamNetworkingUtils_GetFirstConfigValue(CSteamAPIContext.GetSteamNetworkingUtils()); } public static void SteamNetworkingIPAddr_ToString(ref SteamNetworkingIPAddr addr, out string buf, uint cbBuf, bool bWithPort) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)cbBuf); NativeMethods.ISteamNetworkingUtils_SteamNetworkingIPAddr_ToString(CSteamAPIContext.GetSteamNetworkingUtils(), ref addr, intPtr, cbBuf, bWithPort); buf = InteropHelp.PtrToStringUTF8(intPtr); Marshal.FreeHGlobal(intPtr); } public static bool SteamNetworkingIPAddr_ParseString(out SteamNetworkingIPAddr pAddr, string pszStr) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszStr2 = new InteropHelp.UTF8StringHandle(pszStr); return NativeMethods.ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString(CSteamAPIContext.GetSteamNetworkingUtils(), out pAddr, pszStr2); } public static void SteamNetworkingIdentity_ToString(ref SteamNetworkingIdentity identity, out string buf, uint cbBuf) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)cbBuf); NativeMethods.ISteamNetworkingUtils_SteamNetworkingIdentity_ToString(CSteamAPIContext.GetSteamNetworkingUtils(), ref identity, intPtr, cbBuf); buf = InteropHelp.PtrToStringUTF8(intPtr); Marshal.FreeHGlobal(intPtr); } public static bool SteamNetworkingIdentity_ParseString(out SteamNetworkingIdentity pIdentity, string pszStr) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszStr2 = new InteropHelp.UTF8StringHandle(pszStr); return NativeMethods.ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString(CSteamAPIContext.GetSteamNetworkingUtils(), out pIdentity, pszStr2); } } public static class SteamParentalSettings { public static bool BIsParentalLockEnabled() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamParentalSettings_BIsParentalLockEnabled(CSteamAPIContext.GetSteamParentalSettings()); } public static bool BIsParentalLockLocked() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamParentalSettings_BIsParentalLockLocked(CSteamAPIContext.GetSteamParentalSettings()); } public static bool BIsAppBlocked(AppId_t nAppID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamParentalSettings_BIsAppBlocked(CSteamAPIContext.GetSteamParentalSettings(), nAppID); } public static bool BIsAppInBlockList(AppId_t nAppID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamParentalSettings_BIsAppInBlockList(CSteamAPIContext.GetSteamParentalSettings(), nAppID); } public static bool BIsFeatureBlocked(EParentalFeature eFeature) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamParentalSettings_BIsFeatureBlocked(CSteamAPIContext.GetSteamParentalSettings(), eFeature); } public static bool BIsFeatureInBlockList(EParentalFeature eFeature) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamParentalSettings_BIsFeatureInBlockList(CSteamAPIContext.GetSteamParentalSettings(), eFeature); } } public static class SteamRemotePlay { public static uint GetSessionCount() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemotePlay_GetSessionCount(CSteamAPIContext.GetSteamRemotePlay()); } public static RemotePlaySessionID_t GetSessionID(int iSessionIndex) { InteropHelp.TestIfAvailableClient(); return (RemotePlaySessionID_t)NativeMethods.ISteamRemotePlay_GetSessionID(CSteamAPIContext.GetSteamRemotePlay(), iSessionIndex); } public static CSteamID GetSessionSteamID(RemotePlaySessionID_t unSessionID) { InteropHelp.TestIfAvailableClient(); return (CSteamID)NativeMethods.ISteamRemotePlay_GetSessionSteamID(CSteamAPIContext.GetSteamRemotePlay(), unSessionID); } public static string GetSessionClientName(RemotePlaySessionID_t unSessionID) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamRemotePlay_GetSessionClientName(CSteamAPIContext.GetSteamRemotePlay(), unSessionID)); } public static ESteamDeviceFormFactor GetSessionClientFormFactor(RemotePlaySessionID_t unSessionID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemotePlay_GetSessionClientFormFactor(CSteamAPIContext.GetSteamRemotePlay(), unSessionID); } public static bool BGetSessionClientResolution(RemotePlaySessionID_t unSessionID, out int pnResolutionX, out int pnResolutionY) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemotePlay_BGetSessionClientResolution(CSteamAPIContext.GetSteamRemotePlay(), unSessionID, out pnResolutionX, out pnResolutionY); } public static bool BSendRemotePlayTogetherInvite(CSteamID steamIDFriend) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemotePlay_BSendRemotePlayTogetherInvite(CSteamAPIContext.GetSteamRemotePlay(), steamIDFriend); } } public static class SteamRemoteStorage { public static bool FileWrite(string pchFile, byte[] pvData, int cubData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return NativeMethods.ISteamRemoteStorage_FileWrite(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, pvData, cubData); } public static int FileRead(string pchFile, byte[] pvData, int cubDataToRead) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return NativeMethods.ISteamRemoteStorage_FileRead(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, pvData, cubDataToRead); } public static SteamAPICall_t FileWriteAsync(string pchFile, byte[] pvData, uint cubData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_FileWriteAsync(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, pvData, cubData); } public static SteamAPICall_t FileReadAsync(string pchFile, uint nOffset, uint cubToRead) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_FileReadAsync(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, nOffset, cubToRead); } public static bool FileReadAsyncComplete(SteamAPICall_t hReadCall, byte[] pvBuffer, uint cubToRead) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemoteStorage_FileReadAsyncComplete(CSteamAPIContext.GetSteamRemoteStorage(), hReadCall, pvBuffer, cubToRead); } public static bool FileForget(string pchFile) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return NativeMethods.ISteamRemoteStorage_FileForget(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); } public static bool FileDelete(string pchFile) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return NativeMethods.ISteamRemoteStorage_FileDelete(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); } public static SteamAPICall_t FileShare(string pchFile) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_FileShare(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); } public static bool SetSyncPlatforms(string pchFile, ERemoteStoragePlatform eRemoteStoragePlatform) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return NativeMethods.ISteamRemoteStorage_SetSyncPlatforms(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, eRemoteStoragePlatform); } public static UGCFileWriteStreamHandle_t FileWriteStreamOpen(string pchFile) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return (UGCFileWriteStreamHandle_t)NativeMethods.ISteamRemoteStorage_FileWriteStreamOpen(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); } public static bool FileWriteStreamWriteChunk(UGCFileWriteStreamHandle_t writeHandle, byte[] pvData, int cubData) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemoteStorage_FileWriteStreamWriteChunk(CSteamAPIContext.GetSteamRemoteStorage(), writeHandle, pvData, cubData); } public static bool FileWriteStreamClose(UGCFileWriteStreamHandle_t writeHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemoteStorage_FileWriteStreamClose(CSteamAPIContext.GetSteamRemoteStorage(), writeHandle); } public static bool FileWriteStreamCancel(UGCFileWriteStreamHandle_t writeHandle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemoteStorage_FileWriteStreamCancel(CSteamAPIContext.GetSteamRemoteStorage(), writeHandle); } public static bool FileExists(string pchFile) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return NativeMethods.ISteamRemoteStorage_FileExists(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); } public static bool FilePersisted(string pchFile) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return NativeMethods.ISteamRemoteStorage_FilePersisted(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); } public static int GetFileSize(string pchFile) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return NativeMethods.ISteamRemoteStorage_GetFileSize(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); } public static long GetFileTimestamp(string pchFile) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return NativeMethods.ISteamRemoteStorage_GetFileTimestamp(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); } public static ERemoteStoragePlatform GetSyncPlatforms(string pchFile) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return NativeMethods.ISteamRemoteStorage_GetSyncPlatforms(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2); } public static int GetFileCount() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemoteStorage_GetFileCount(CSteamAPIContext.GetSteamRemoteStorage()); } public static string GetFileNameAndSize(int iFile, out int pnFileSizeInBytes) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamRemoteStorage_GetFileNameAndSize(CSteamAPIContext.GetSteamRemoteStorage(), iFile, out pnFileSizeInBytes)); } public static bool GetQuota(out ulong pnTotalBytes, out ulong puAvailableBytes) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemoteStorage_GetQuota(CSteamAPIContext.GetSteamRemoteStorage(), out pnTotalBytes, out puAvailableBytes); } public static bool IsCloudEnabledForAccount() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemoteStorage_IsCloudEnabledForAccount(CSteamAPIContext.GetSteamRemoteStorage()); } public static bool IsCloudEnabledForApp() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemoteStorage_IsCloudEnabledForApp(CSteamAPIContext.GetSteamRemoteStorage()); } public static void SetCloudEnabledForApp(bool bEnabled) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamRemoteStorage_SetCloudEnabledForApp(CSteamAPIContext.GetSteamRemoteStorage(), bEnabled); } public static SteamAPICall_t UGCDownload(UGCHandle_t hContent, uint unPriority) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_UGCDownload(CSteamAPIContext.GetSteamRemoteStorage(), hContent, unPriority); } public static bool GetUGCDownloadProgress(UGCHandle_t hContent, out int pnBytesDownloaded, out int pnBytesExpected) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemoteStorage_GetUGCDownloadProgress(CSteamAPIContext.GetSteamRemoteStorage(), hContent, out pnBytesDownloaded, out pnBytesExpected); } public static bool GetUGCDetails(UGCHandle_t hContent, out AppId_t pnAppID, out string ppchName, out int pnFileSizeInBytes, out CSteamID pSteamIDOwner) { InteropHelp.TestIfAvailableClient(); IntPtr ppchName2; bool flag = NativeMethods.ISteamRemoteStorage_GetUGCDetails(CSteamAPIContext.GetSteamRemoteStorage(), hContent, out pnAppID, out ppchName2, out pnFileSizeInBytes, out pSteamIDOwner); ppchName = (flag ? InteropHelp.PtrToStringUTF8(ppchName2) : null); return flag; } public static int UGCRead(UGCHandle_t hContent, byte[] pvData, int cubDataToRead, uint cOffset, EUGCReadAction eAction) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemoteStorage_UGCRead(CSteamAPIContext.GetSteamRemoteStorage(), hContent, pvData, cubDataToRead, cOffset, eAction); } public static int GetCachedUGCCount() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemoteStorage_GetCachedUGCCount(CSteamAPIContext.GetSteamRemoteStorage()); } public static UGCHandle_t GetCachedUGCHandle(int iCachedContent) { InteropHelp.TestIfAvailableClient(); return (UGCHandle_t)NativeMethods.ISteamRemoteStorage_GetCachedUGCHandle(CSteamAPIContext.GetSteamRemoteStorage(), iCachedContent); } public static SteamAPICall_t PublishWorkshopFile(string pchFile, string pchPreviewFile, AppId_t nConsumerAppId, string pchTitle, string pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, IList pTags, EWorkshopFileType eWorkshopFileType) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); using InteropHelp.UTF8StringHandle pchPreviewFile2 = new InteropHelp.UTF8StringHandle(pchPreviewFile); using InteropHelp.UTF8StringHandle pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle); using InteropHelp.UTF8StringHandle pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_PublishWorkshopFile(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, pchPreviewFile2, nConsumerAppId, pchTitle2, pchDescription2, eVisibility, new InteropHelp.SteamParamStringArray(pTags), eWorkshopFileType); } public static PublishedFileUpdateHandle_t CreatePublishedFileUpdateRequest(PublishedFileId_t unPublishedFileId) { InteropHelp.TestIfAvailableClient(); return (PublishedFileUpdateHandle_t)NativeMethods.ISteamRemoteStorage_CreatePublishedFileUpdateRequest(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId); } public static bool UpdatePublishedFileFile(PublishedFileUpdateHandle_t updateHandle, string pchFile) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFile2 = new InteropHelp.UTF8StringHandle(pchFile); return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileFile(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchFile2); } public static bool UpdatePublishedFilePreviewFile(PublishedFileUpdateHandle_t updateHandle, string pchPreviewFile) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchPreviewFile2 = new InteropHelp.UTF8StringHandle(pchPreviewFile); return NativeMethods.ISteamRemoteStorage_UpdatePublishedFilePreviewFile(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchPreviewFile2); } public static bool UpdatePublishedFileTitle(PublishedFileUpdateHandle_t updateHandle, string pchTitle) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle); return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileTitle(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchTitle2); } public static bool UpdatePublishedFileDescription(PublishedFileUpdateHandle_t updateHandle, string pchDescription) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription); return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileDescription(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchDescription2); } public static bool UpdatePublishedFileVisibility(PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileVisibility(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, eVisibility); } public static bool UpdatePublishedFileTags(PublishedFileUpdateHandle_t updateHandle, IList pTags) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileTags(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, new InteropHelp.SteamParamStringArray(pTags)); } public static SteamAPICall_t CommitPublishedFileUpdate(PublishedFileUpdateHandle_t updateHandle) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_CommitPublishedFileUpdate(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle); } public static SteamAPICall_t GetPublishedFileDetails(PublishedFileId_t unPublishedFileId, uint unMaxSecondsOld) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_GetPublishedFileDetails(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId, unMaxSecondsOld); } public static SteamAPICall_t DeletePublishedFile(PublishedFileId_t unPublishedFileId) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_DeletePublishedFile(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId); } public static SteamAPICall_t EnumerateUserPublishedFiles(uint unStartIndex) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumerateUserPublishedFiles(CSteamAPIContext.GetSteamRemoteStorage(), unStartIndex); } public static SteamAPICall_t SubscribePublishedFile(PublishedFileId_t unPublishedFileId) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_SubscribePublishedFile(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId); } public static SteamAPICall_t EnumerateUserSubscribedFiles(uint unStartIndex) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumerateUserSubscribedFiles(CSteamAPIContext.GetSteamRemoteStorage(), unStartIndex); } public static SteamAPICall_t UnsubscribePublishedFile(PublishedFileId_t unPublishedFileId) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_UnsubscribePublishedFile(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId); } public static bool UpdatePublishedFileSetChangeDescription(PublishedFileUpdateHandle_t updateHandle, string pchChangeDescription) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchChangeDescription2 = new InteropHelp.UTF8StringHandle(pchChangeDescription); return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchChangeDescription2); } public static SteamAPICall_t GetPublishedItemVoteDetails(PublishedFileId_t unPublishedFileId) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_GetPublishedItemVoteDetails(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId); } public static SteamAPICall_t UpdateUserPublishedItemVote(PublishedFileId_t unPublishedFileId, bool bVoteUp) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_UpdateUserPublishedItemVote(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId, bVoteUp); } public static SteamAPICall_t GetUserPublishedItemVoteDetails(PublishedFileId_t unPublishedFileId) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_GetUserPublishedItemVoteDetails(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId); } public static SteamAPICall_t EnumerateUserSharedWorkshopFiles(CSteamID steamId, uint unStartIndex, IList pRequiredTags, IList pExcludedTags) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(CSteamAPIContext.GetSteamRemoteStorage(), steamId, unStartIndex, new InteropHelp.SteamParamStringArray(pRequiredTags), new InteropHelp.SteamParamStringArray(pExcludedTags)); } public static SteamAPICall_t PublishVideo(EWorkshopVideoProvider eVideoProvider, string pchVideoAccount, string pchVideoIdentifier, string pchPreviewFile, AppId_t nConsumerAppId, string pchTitle, string pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, IList pTags) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchVideoAccount2 = new InteropHelp.UTF8StringHandle(pchVideoAccount); using InteropHelp.UTF8StringHandle pchVideoIdentifier2 = new InteropHelp.UTF8StringHandle(pchVideoIdentifier); using InteropHelp.UTF8StringHandle pchPreviewFile2 = new InteropHelp.UTF8StringHandle(pchPreviewFile); using InteropHelp.UTF8StringHandle pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle); using InteropHelp.UTF8StringHandle pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_PublishVideo(CSteamAPIContext.GetSteamRemoteStorage(), eVideoProvider, pchVideoAccount2, pchVideoIdentifier2, pchPreviewFile2, nConsumerAppId, pchTitle2, pchDescription2, eVisibility, new InteropHelp.SteamParamStringArray(pTags)); } public static SteamAPICall_t SetUserPublishedFileAction(PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_SetUserPublishedFileAction(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId, eAction); } public static SteamAPICall_t EnumeratePublishedFilesByUserAction(EWorkshopFileAction eAction, uint unStartIndex) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumeratePublishedFilesByUserAction(CSteamAPIContext.GetSteamRemoteStorage(), eAction, unStartIndex); } public static SteamAPICall_t EnumeratePublishedWorkshopFiles(EWorkshopEnumerationType eEnumerationType, uint unStartIndex, uint unCount, uint unDays, IList pTags, IList pUserTags) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumeratePublishedWorkshopFiles(CSteamAPIContext.GetSteamRemoteStorage(), eEnumerationType, unStartIndex, unCount, unDays, new InteropHelp.SteamParamStringArray(pTags), new InteropHelp.SteamParamStringArray(pUserTags)); } public static SteamAPICall_t UGCDownloadToLocation(UGCHandle_t hContent, string pchLocation, uint unPriority) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchLocation2 = new InteropHelp.UTF8StringHandle(pchLocation); return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_UGCDownloadToLocation(CSteamAPIContext.GetSteamRemoteStorage(), hContent, pchLocation2, unPriority); } } public static class SteamScreenshots { public static ScreenshotHandle WriteScreenshot(byte[] pubRGB, uint cubRGB, int nWidth, int nHeight) { InteropHelp.TestIfAvailableClient(); return (ScreenshotHandle)NativeMethods.ISteamScreenshots_WriteScreenshot(CSteamAPIContext.GetSteamScreenshots(), pubRGB, cubRGB, nWidth, nHeight); } public static ScreenshotHandle AddScreenshotToLibrary(string pchFilename, string pchThumbnailFilename, int nWidth, int nHeight) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFilename2 = new InteropHelp.UTF8StringHandle(pchFilename); using InteropHelp.UTF8StringHandle pchThumbnailFilename2 = new InteropHelp.UTF8StringHandle(pchThumbnailFilename); return (ScreenshotHandle)NativeMethods.ISteamScreenshots_AddScreenshotToLibrary(CSteamAPIContext.GetSteamScreenshots(), pchFilename2, pchThumbnailFilename2, nWidth, nHeight); } public static void TriggerScreenshot() { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamScreenshots_TriggerScreenshot(CSteamAPIContext.GetSteamScreenshots()); } public static void HookScreenshots(bool bHook) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamScreenshots_HookScreenshots(CSteamAPIContext.GetSteamScreenshots(), bHook); } public static bool SetLocation(ScreenshotHandle hScreenshot, string pchLocation) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchLocation2 = new InteropHelp.UTF8StringHandle(pchLocation); return NativeMethods.ISteamScreenshots_SetLocation(CSteamAPIContext.GetSteamScreenshots(), hScreenshot, pchLocation2); } public static bool TagUser(ScreenshotHandle hScreenshot, CSteamID steamID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamScreenshots_TagUser(CSteamAPIContext.GetSteamScreenshots(), hScreenshot, steamID); } public static bool TagPublishedFile(ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamScreenshots_TagPublishedFile(CSteamAPIContext.GetSteamScreenshots(), hScreenshot, unPublishedFileID); } public static bool IsScreenshotsHooked() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamScreenshots_IsScreenshotsHooked(CSteamAPIContext.GetSteamScreenshots()); } public static ScreenshotHandle AddVRScreenshotToLibrary(EVRScreenshotType eType, string pchFilename, string pchVRFilename) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchFilename2 = new InteropHelp.UTF8StringHandle(pchFilename); using InteropHelp.UTF8StringHandle pchVRFilename2 = new InteropHelp.UTF8StringHandle(pchVRFilename); return (ScreenshotHandle)NativeMethods.ISteamScreenshots_AddVRScreenshotToLibrary(CSteamAPIContext.GetSteamScreenshots(), eType, pchFilename2, pchVRFilename2); } } public static class SteamUGC { public static UGCQueryHandle_t CreateQueryUserUGCRequest(AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage) { InteropHelp.TestIfAvailableClient(); return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryUserUGCRequest(CSteamAPIContext.GetSteamUGC(), unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage); } public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage) { InteropHelp.TestIfAvailableClient(); return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryAllUGCRequestPage(CSteamAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage); } public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, string pchCursor = null) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchCursor2 = new InteropHelp.UTF8StringHandle(pchCursor); return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryAllUGCRequestCursor(CSteamAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, pchCursor2); } public static UGCQueryHandle_t CreateQueryUGCDetailsRequest(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableClient(); return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryUGCDetailsRequest(CSteamAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); } public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_SendQueryUGCRequest(CSteamAPIContext.GetSteamUGC(), handle); } public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamAPIContext.GetSteamUGC(), handle, index, out pDetails); } public static bool GetQueryUGCPreviewURL(UGCQueryHandle_t handle, uint index, out string pchURL, uint cchURLSize) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchURLSize); bool flag = NativeMethods.ISteamUGC_GetQueryUGCPreviewURL(CSteamAPIContext.GetSteamUGC(), handle, index, intPtr, cchURLSize); pchURL = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static bool GetQueryUGCMetadata(UGCQueryHandle_t handle, uint index, out string pchMetadata, uint cchMetadatasize) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchMetadatasize); bool flag = NativeMethods.ISteamUGC_GetQueryUGCMetadata(CSteamAPIContext.GetSteamUGC(), handle, index, intPtr, cchMetadatasize); pchMetadata = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static bool GetQueryUGCChildren(UGCQueryHandle_t handle, uint index, PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_GetQueryUGCChildren(CSteamAPIContext.GetSteamUGC(), handle, index, pvecPublishedFileID, cMaxEntries); } public static bool GetQueryUGCStatistic(UGCQueryHandle_t handle, uint index, EItemStatistic eStatType, out ulong pStatValue) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_GetQueryUGCStatistic(CSteamAPIContext.GetSteamUGC(), handle, index, eStatType, out pStatValue); } public static uint GetQueryUGCNumAdditionalPreviews(UGCQueryHandle_t handle, uint index) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_GetQueryUGCNumAdditionalPreviews(CSteamAPIContext.GetSteamUGC(), handle, index); } public static bool GetQueryUGCAdditionalPreview(UGCQueryHandle_t handle, uint index, uint previewIndex, out string pchURLOrVideoID, uint cchURLSize, out string pchOriginalFileName, uint cchOriginalFileNameSize, out EItemPreviewType pPreviewType) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchURLSize); IntPtr intPtr2 = Marshal.AllocHGlobal((int)cchOriginalFileNameSize); bool flag = NativeMethods.ISteamUGC_GetQueryUGCAdditionalPreview(CSteamAPIContext.GetSteamUGC(), handle, index, previewIndex, intPtr, cchURLSize, intPtr2, cchOriginalFileNameSize, out pPreviewType); pchURLOrVideoID = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); pchOriginalFileName = (flag ? InteropHelp.PtrToStringUTF8(intPtr2) : null); Marshal.FreeHGlobal(intPtr2); return flag; } public static uint GetQueryUGCNumKeyValueTags(UGCQueryHandle_t handle, uint index) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_GetQueryUGCNumKeyValueTags(CSteamAPIContext.GetSteamUGC(), handle, index); } public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, out string pchKey, uint cchKeySize, out string pchValue, uint cchValueSize) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchKeySize); IntPtr intPtr2 = Marshal.AllocHGlobal((int)cchValueSize); bool flag = NativeMethods.ISteamUGC_GetQueryUGCKeyValueTag(CSteamAPIContext.GetSteamUGC(), handle, index, keyValueTagIndex, intPtr, cchKeySize, intPtr2, cchValueSize); pchKey = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); pchValue = (flag ? InteropHelp.PtrToStringUTF8(intPtr2) : null); Marshal.FreeHGlobal(intPtr2); return flag; } public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, string pchKey, out string pchValue, uint cchValueSize) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchValueSize); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); bool flag = NativeMethods.ISteamUGC_GetQueryFirstUGCKeyValueTag(CSteamAPIContext.GetSteamUGC(), handle, index, pchKey2, intPtr, cchValueSize); pchValue = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static bool ReleaseQueryUGCRequest(UGCQueryHandle_t handle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_ReleaseQueryUGCRequest(CSteamAPIContext.GetSteamUGC(), handle); } public static bool AddRequiredTag(UGCQueryHandle_t handle, string pTagName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pTagName2 = new InteropHelp.UTF8StringHandle(pTagName); return NativeMethods.ISteamUGC_AddRequiredTag(CSteamAPIContext.GetSteamUGC(), handle, pTagName2); } public static bool AddRequiredTagGroup(UGCQueryHandle_t handle, IList pTagGroups) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_AddRequiredTagGroup(CSteamAPIContext.GetSteamUGC(), handle, new InteropHelp.SteamParamStringArray(pTagGroups)); } public static bool AddExcludedTag(UGCQueryHandle_t handle, string pTagName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pTagName2 = new InteropHelp.UTF8StringHandle(pTagName); return NativeMethods.ISteamUGC_AddExcludedTag(CSteamAPIContext.GetSteamUGC(), handle, pTagName2); } public static bool SetReturnOnlyIDs(UGCQueryHandle_t handle, bool bReturnOnlyIDs) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetReturnOnlyIDs(CSteamAPIContext.GetSteamUGC(), handle, bReturnOnlyIDs); } public static bool SetReturnKeyValueTags(UGCQueryHandle_t handle, bool bReturnKeyValueTags) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetReturnKeyValueTags(CSteamAPIContext.GetSteamUGC(), handle, bReturnKeyValueTags); } public static bool SetReturnLongDescription(UGCQueryHandle_t handle, bool bReturnLongDescription) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetReturnLongDescription(CSteamAPIContext.GetSteamUGC(), handle, bReturnLongDescription); } public static bool SetReturnMetadata(UGCQueryHandle_t handle, bool bReturnMetadata) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetReturnMetadata(CSteamAPIContext.GetSteamUGC(), handle, bReturnMetadata); } public static bool SetReturnChildren(UGCQueryHandle_t handle, bool bReturnChildren) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetReturnChildren(CSteamAPIContext.GetSteamUGC(), handle, bReturnChildren); } public static bool SetReturnAdditionalPreviews(UGCQueryHandle_t handle, bool bReturnAdditionalPreviews) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetReturnAdditionalPreviews(CSteamAPIContext.GetSteamUGC(), handle, bReturnAdditionalPreviews); } public static bool SetReturnTotalOnly(UGCQueryHandle_t handle, bool bReturnTotalOnly) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetReturnTotalOnly(CSteamAPIContext.GetSteamUGC(), handle, bReturnTotalOnly); } public static bool SetReturnPlaytimeStats(UGCQueryHandle_t handle, uint unDays) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetReturnPlaytimeStats(CSteamAPIContext.GetSteamUGC(), handle, unDays); } public static bool SetLanguage(UGCQueryHandle_t handle, string pchLanguage) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchLanguage2 = new InteropHelp.UTF8StringHandle(pchLanguage); return NativeMethods.ISteamUGC_SetLanguage(CSteamAPIContext.GetSteamUGC(), handle, pchLanguage2); } public static bool SetAllowCachedResponse(UGCQueryHandle_t handle, uint unMaxAgeSeconds) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetAllowCachedResponse(CSteamAPIContext.GetSteamUGC(), handle, unMaxAgeSeconds); } public static bool SetCloudFileNameFilter(UGCQueryHandle_t handle, string pMatchCloudFileName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pMatchCloudFileName2 = new InteropHelp.UTF8StringHandle(pMatchCloudFileName); return NativeMethods.ISteamUGC_SetCloudFileNameFilter(CSteamAPIContext.GetSteamUGC(), handle, pMatchCloudFileName2); } public static bool SetMatchAnyTag(UGCQueryHandle_t handle, bool bMatchAnyTag) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetMatchAnyTag(CSteamAPIContext.GetSteamUGC(), handle, bMatchAnyTag); } public static bool SetSearchText(UGCQueryHandle_t handle, string pSearchText) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pSearchText2 = new InteropHelp.UTF8StringHandle(pSearchText); return NativeMethods.ISteamUGC_SetSearchText(CSteamAPIContext.GetSteamUGC(), handle, pSearchText2); } public static bool SetRankedByTrendDays(UGCQueryHandle_t handle, uint unDays) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetRankedByTrendDays(CSteamAPIContext.GetSteamUGC(), handle, unDays); } public static bool AddRequiredKeyValueTag(UGCQueryHandle_t handle, string pKey, string pValue) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pKey2 = new InteropHelp.UTF8StringHandle(pKey); using InteropHelp.UTF8StringHandle pValue2 = new InteropHelp.UTF8StringHandle(pValue); return NativeMethods.ISteamUGC_AddRequiredKeyValueTag(CSteamAPIContext.GetSteamUGC(), handle, pKey2, pValue2); } public static SteamAPICall_t RequestUGCDetails(PublishedFileId_t nPublishedFileID, uint unMaxAgeSeconds) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_RequestUGCDetails(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, unMaxAgeSeconds); } public static SteamAPICall_t CreateItem(AppId_t nConsumerAppId, EWorkshopFileType eFileType) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_CreateItem(CSteamAPIContext.GetSteamUGC(), nConsumerAppId, eFileType); } public static UGCUpdateHandle_t StartItemUpdate(AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableClient(); return (UGCUpdateHandle_t)NativeMethods.ISteamUGC_StartItemUpdate(CSteamAPIContext.GetSteamUGC(), nConsumerAppId, nPublishedFileID); } public static bool SetItemTitle(UGCUpdateHandle_t handle, string pchTitle) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle); return NativeMethods.ISteamUGC_SetItemTitle(CSteamAPIContext.GetSteamUGC(), handle, pchTitle2); } public static bool SetItemDescription(UGCUpdateHandle_t handle, string pchDescription) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription); return NativeMethods.ISteamUGC_SetItemDescription(CSteamAPIContext.GetSteamUGC(), handle, pchDescription2); } public static bool SetItemUpdateLanguage(UGCUpdateHandle_t handle, string pchLanguage) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchLanguage2 = new InteropHelp.UTF8StringHandle(pchLanguage); return NativeMethods.ISteamUGC_SetItemUpdateLanguage(CSteamAPIContext.GetSteamUGC(), handle, pchLanguage2); } public static bool SetItemMetadata(UGCUpdateHandle_t handle, string pchMetaData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchMetaData2 = new InteropHelp.UTF8StringHandle(pchMetaData); return NativeMethods.ISteamUGC_SetItemMetadata(CSteamAPIContext.GetSteamUGC(), handle, pchMetaData2); } public static bool SetItemVisibility(UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetItemVisibility(CSteamAPIContext.GetSteamUGC(), handle, eVisibility); } public static bool SetItemTags(UGCUpdateHandle_t updateHandle, IList pTags) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetItemTags(CSteamAPIContext.GetSteamUGC(), updateHandle, new InteropHelp.SteamParamStringArray(pTags)); } public static bool SetItemContent(UGCUpdateHandle_t handle, string pszContentFolder) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszContentFolder2 = new InteropHelp.UTF8StringHandle(pszContentFolder); return NativeMethods.ISteamUGC_SetItemContent(CSteamAPIContext.GetSteamUGC(), handle, pszContentFolder2); } public static bool SetItemPreview(UGCUpdateHandle_t handle, string pszPreviewFile) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile); return NativeMethods.ISteamUGC_SetItemPreview(CSteamAPIContext.GetSteamUGC(), handle, pszPreviewFile2); } public static bool SetAllowLegacyUpload(UGCUpdateHandle_t handle, bool bAllowLegacyUpload) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_SetAllowLegacyUpload(CSteamAPIContext.GetSteamUGC(), handle, bAllowLegacyUpload); } public static bool RemoveAllItemKeyValueTags(UGCUpdateHandle_t handle) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_RemoveAllItemKeyValueTags(CSteamAPIContext.GetSteamUGC(), handle); } public static bool RemoveItemKeyValueTags(UGCUpdateHandle_t handle, string pchKey) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); return NativeMethods.ISteamUGC_RemoveItemKeyValueTags(CSteamAPIContext.GetSteamUGC(), handle, pchKey2); } public static bool AddItemKeyValueTag(UGCUpdateHandle_t handle, string pchKey, string pchValue) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); using InteropHelp.UTF8StringHandle pchValue2 = new InteropHelp.UTF8StringHandle(pchValue); return NativeMethods.ISteamUGC_AddItemKeyValueTag(CSteamAPIContext.GetSteamUGC(), handle, pchKey2, pchValue2); } public static bool AddItemPreviewFile(UGCUpdateHandle_t handle, string pszPreviewFile, EItemPreviewType type) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile); return NativeMethods.ISteamUGC_AddItemPreviewFile(CSteamAPIContext.GetSteamUGC(), handle, pszPreviewFile2, type); } public static bool AddItemPreviewVideo(UGCUpdateHandle_t handle, string pszVideoID) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszVideoID2 = new InteropHelp.UTF8StringHandle(pszVideoID); return NativeMethods.ISteamUGC_AddItemPreviewVideo(CSteamAPIContext.GetSteamUGC(), handle, pszVideoID2); } public static bool UpdateItemPreviewFile(UGCUpdateHandle_t handle, uint index, string pszPreviewFile) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile); return NativeMethods.ISteamUGC_UpdateItemPreviewFile(CSteamAPIContext.GetSteamUGC(), handle, index, pszPreviewFile2); } public static bool UpdateItemPreviewVideo(UGCUpdateHandle_t handle, uint index, string pszVideoID) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszVideoID2 = new InteropHelp.UTF8StringHandle(pszVideoID); return NativeMethods.ISteamUGC_UpdateItemPreviewVideo(CSteamAPIContext.GetSteamUGC(), handle, index, pszVideoID2); } public static bool RemoveItemPreview(UGCUpdateHandle_t handle, uint index) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_RemoveItemPreview(CSteamAPIContext.GetSteamUGC(), handle, index); } public static SteamAPICall_t SubmitItemUpdate(UGCUpdateHandle_t handle, string pchChangeNote) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchChangeNote2 = new InteropHelp.UTF8StringHandle(pchChangeNote); return (SteamAPICall_t)NativeMethods.ISteamUGC_SubmitItemUpdate(CSteamAPIContext.GetSteamUGC(), handle, pchChangeNote2); } public static EItemUpdateStatus GetItemUpdateProgress(UGCUpdateHandle_t handle, out ulong punBytesProcessed, out ulong punBytesTotal) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_GetItemUpdateProgress(CSteamAPIContext.GetSteamUGC(), handle, out punBytesProcessed, out punBytesTotal); } public static SteamAPICall_t SetUserItemVote(PublishedFileId_t nPublishedFileID, bool bVoteUp) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_SetUserItemVote(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, bVoteUp); } public static SteamAPICall_t GetUserItemVote(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_GetUserItemVote(CSteamAPIContext.GetSteamUGC(), nPublishedFileID); } public static SteamAPICall_t AddItemToFavorites(AppId_t nAppId, PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_AddItemToFavorites(CSteamAPIContext.GetSteamUGC(), nAppId, nPublishedFileID); } public static SteamAPICall_t RemoveItemFromFavorites(AppId_t nAppId, PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveItemFromFavorites(CSteamAPIContext.GetSteamUGC(), nAppId, nPublishedFileID); } public static SteamAPICall_t SubscribeItem(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_SubscribeItem(CSteamAPIContext.GetSteamUGC(), nPublishedFileID); } public static SteamAPICall_t UnsubscribeItem(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_UnsubscribeItem(CSteamAPIContext.GetSteamUGC(), nPublishedFileID); } public static uint GetNumSubscribedItems() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_GetNumSubscribedItems(CSteamAPIContext.GetSteamUGC()); } public static uint GetSubscribedItems(PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_GetSubscribedItems(CSteamAPIContext.GetSteamUGC(), pvecPublishedFileID, cMaxEntries); } public static uint GetItemState(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_GetItemState(CSteamAPIContext.GetSteamUGC(), nPublishedFileID); } public static bool GetItemInstallInfo(PublishedFileId_t nPublishedFileID, out ulong punSizeOnDisk, out string pchFolder, uint cchFolderSize, out uint punTimeStamp) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchFolderSize); bool flag = NativeMethods.ISteamUGC_GetItemInstallInfo(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, out punSizeOnDisk, intPtr, cchFolderSize, out punTimeStamp); pchFolder = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static bool GetItemDownloadInfo(PublishedFileId_t nPublishedFileID, out ulong punBytesDownloaded, out ulong punBytesTotal) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_GetItemDownloadInfo(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, out punBytesDownloaded, out punBytesTotal); } public static bool DownloadItem(PublishedFileId_t nPublishedFileID, bool bHighPriority) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUGC_DownloadItem(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, bHighPriority); } public static bool BInitWorkshopForGameServer(DepotId_t unWorkshopDepotID, string pszFolder) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pszFolder2 = new InteropHelp.UTF8StringHandle(pszFolder); return NativeMethods.ISteamUGC_BInitWorkshopForGameServer(CSteamAPIContext.GetSteamUGC(), unWorkshopDepotID, pszFolder2); } public static void SuspendDownloads(bool bSuspend) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamUGC_SuspendDownloads(CSteamAPIContext.GetSteamUGC(), bSuspend); } public static SteamAPICall_t StartPlaytimeTracking(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_StartPlaytimeTracking(CSteamAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); } public static SteamAPICall_t StopPlaytimeTracking(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_StopPlaytimeTracking(CSteamAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs); } public static SteamAPICall_t StopPlaytimeTrackingForAllItems() { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_StopPlaytimeTrackingForAllItems(CSteamAPIContext.GetSteamUGC()); } public static SteamAPICall_t AddDependency(PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_AddDependency(CSteamAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID); } public static SteamAPICall_t RemoveDependency(PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveDependency(CSteamAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID); } public static SteamAPICall_t AddAppDependency(PublishedFileId_t nPublishedFileID, AppId_t nAppID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_AddAppDependency(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, nAppID); } public static SteamAPICall_t RemoveAppDependency(PublishedFileId_t nPublishedFileID, AppId_t nAppID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveAppDependency(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, nAppID); } public static SteamAPICall_t GetAppDependencies(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_GetAppDependencies(CSteamAPIContext.GetSteamUGC(), nPublishedFileID); } public static SteamAPICall_t DeleteItem(PublishedFileId_t nPublishedFileID) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUGC_DeleteItem(CSteamAPIContext.GetSteamUGC(), nPublishedFileID); } } public static class SteamUser { public static HSteamUser GetHSteamUser() { InteropHelp.TestIfAvailableClient(); return (HSteamUser)NativeMethods.ISteamUser_GetHSteamUser(CSteamAPIContext.GetSteamUser()); } public static bool BLoggedOn() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_BLoggedOn(CSteamAPIContext.GetSteamUser()); } public static CSteamID GetSteamID() { InteropHelp.TestIfAvailableClient(); return (CSteamID)NativeMethods.ISteamUser_GetSteamID(CSteamAPIContext.GetSteamUser()); } public static int InitiateGameConnection(byte[] pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint unIPServer, ushort usPortServer, bool bSecure) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_InitiateGameConnection(CSteamAPIContext.GetSteamUser(), pAuthBlob, cbMaxAuthBlob, steamIDGameServer, unIPServer, usPortServer, bSecure); } public static void TerminateGameConnection(uint unIPServer, ushort usPortServer) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamUser_TerminateGameConnection(CSteamAPIContext.GetSteamUser(), unIPServer, usPortServer); } public static void TrackAppUsageEvent(CGameID gameID, int eAppUsageEvent, string pchExtraInfo = "") { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchExtraInfo2 = new InteropHelp.UTF8StringHandle(pchExtraInfo); NativeMethods.ISteamUser_TrackAppUsageEvent(CSteamAPIContext.GetSteamUser(), gameID, eAppUsageEvent, pchExtraInfo2); } public static bool GetUserDataFolder(out string pchBuffer, int cubBuffer) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(cubBuffer); bool flag = NativeMethods.ISteamUser_GetUserDataFolder(CSteamAPIContext.GetSteamUser(), intPtr, cubBuffer); pchBuffer = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static void StartVoiceRecording() { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamUser_StartVoiceRecording(CSteamAPIContext.GetSteamUser()); } public static void StopVoiceRecording() { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamUser_StopVoiceRecording(CSteamAPIContext.GetSteamUser()); } public static EVoiceResult GetAvailableVoice(out uint pcbCompressed) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_GetAvailableVoice(CSteamAPIContext.GetSteamUser(), out pcbCompressed, IntPtr.Zero, 0u); } public static EVoiceResult GetVoice(bool bWantCompressed, byte[] pDestBuffer, uint cbDestBufferSize, out uint nBytesWritten) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_GetVoice(CSteamAPIContext.GetSteamUser(), bWantCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, bWantUncompressed_Deprecated: false, IntPtr.Zero, 0u, IntPtr.Zero, 0u); } public static EVoiceResult DecompressVoice(byte[] pCompressed, uint cbCompressed, byte[] pDestBuffer, uint cbDestBufferSize, out uint nBytesWritten, uint nDesiredSampleRate) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_DecompressVoice(CSteamAPIContext.GetSteamUser(), pCompressed, cbCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, nDesiredSampleRate); } public static uint GetVoiceOptimalSampleRate() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_GetVoiceOptimalSampleRate(CSteamAPIContext.GetSteamUser()); } public static HAuthTicket GetAuthSessionTicket(byte[] pTicket, int cbMaxTicket, out uint pcbTicket) { InteropHelp.TestIfAvailableClient(); return (HAuthTicket)NativeMethods.ISteamUser_GetAuthSessionTicket(CSteamAPIContext.GetSteamUser(), pTicket, cbMaxTicket, out pcbTicket); } public static EBeginAuthSessionResult BeginAuthSession(byte[] pAuthTicket, int cbAuthTicket, CSteamID steamID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_BeginAuthSession(CSteamAPIContext.GetSteamUser(), pAuthTicket, cbAuthTicket, steamID); } public static void EndAuthSession(CSteamID steamID) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamUser_EndAuthSession(CSteamAPIContext.GetSteamUser(), steamID); } public static void CancelAuthTicket(HAuthTicket hAuthTicket) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamUser_CancelAuthTicket(CSteamAPIContext.GetSteamUser(), hAuthTicket); } public static EUserHasLicenseForAppResult UserHasLicenseForApp(CSteamID steamID, AppId_t appID) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_UserHasLicenseForApp(CSteamAPIContext.GetSteamUser(), steamID, appID); } public static bool BIsBehindNAT() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_BIsBehindNAT(CSteamAPIContext.GetSteamUser()); } public static void AdvertiseGame(CSteamID steamIDGameServer, uint unIPServer, ushort usPortServer) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamUser_AdvertiseGame(CSteamAPIContext.GetSteamUser(), steamIDGameServer, unIPServer, usPortServer); } public static SteamAPICall_t RequestEncryptedAppTicket(byte[] pDataToInclude, int cbDataToInclude) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUser_RequestEncryptedAppTicket(CSteamAPIContext.GetSteamUser(), pDataToInclude, cbDataToInclude); } public static bool GetEncryptedAppTicket(byte[] pTicket, int cbMaxTicket, out uint pcbTicket) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_GetEncryptedAppTicket(CSteamAPIContext.GetSteamUser(), pTicket, cbMaxTicket, out pcbTicket); } public static int GetGameBadgeLevel(int nSeries, bool bFoil) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_GetGameBadgeLevel(CSteamAPIContext.GetSteamUser(), nSeries, bFoil); } public static int GetPlayerSteamLevel() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_GetPlayerSteamLevel(CSteamAPIContext.GetSteamUser()); } public static SteamAPICall_t RequestStoreAuthURL(string pchRedirectURL) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchRedirectURL2 = new InteropHelp.UTF8StringHandle(pchRedirectURL); return (SteamAPICall_t)NativeMethods.ISteamUser_RequestStoreAuthURL(CSteamAPIContext.GetSteamUser(), pchRedirectURL2); } public static bool BIsPhoneVerified() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_BIsPhoneVerified(CSteamAPIContext.GetSteamUser()); } public static bool BIsTwoFactorEnabled() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_BIsTwoFactorEnabled(CSteamAPIContext.GetSteamUser()); } public static bool BIsPhoneIdentifying() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_BIsPhoneIdentifying(CSteamAPIContext.GetSteamUser()); } public static bool BIsPhoneRequiringVerification() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUser_BIsPhoneRequiringVerification(CSteamAPIContext.GetSteamUser()); } public static SteamAPICall_t GetMarketEligibility() { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUser_GetMarketEligibility(CSteamAPIContext.GetSteamUser()); } public static SteamAPICall_t GetDurationControl() { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUser_GetDurationControl(CSteamAPIContext.GetSteamUser()); } } public static class SteamUserStats { public static bool RequestCurrentStats() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUserStats_RequestCurrentStats(CSteamAPIContext.GetSteamUserStats()); } public static bool GetStat(string pchName, out int pData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_GetStatInt32(CSteamAPIContext.GetSteamUserStats(), pchName2, out pData); } public static bool GetStat(string pchName, out float pData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_GetStatFloat(CSteamAPIContext.GetSteamUserStats(), pchName2, out pData); } public static bool SetStat(string pchName, int nData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_SetStatInt32(CSteamAPIContext.GetSteamUserStats(), pchName2, nData); } public static bool SetStat(string pchName, float fData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_SetStatFloat(CSteamAPIContext.GetSteamUserStats(), pchName2, fData); } public static bool UpdateAvgRateStat(string pchName, float flCountThisSession, double dSessionLength) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_UpdateAvgRateStat(CSteamAPIContext.GetSteamUserStats(), pchName2, flCountThisSession, dSessionLength); } public static bool GetAchievement(string pchName, out bool pbAchieved) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_GetAchievement(CSteamAPIContext.GetSteamUserStats(), pchName2, out pbAchieved); } public static bool SetAchievement(string pchName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_SetAchievement(CSteamAPIContext.GetSteamUserStats(), pchName2); } public static bool ClearAchievement(string pchName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_ClearAchievement(CSteamAPIContext.GetSteamUserStats(), pchName2); } public static bool GetAchievementAndUnlockTime(string pchName, out bool pbAchieved, out uint punUnlockTime) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_GetAchievementAndUnlockTime(CSteamAPIContext.GetSteamUserStats(), pchName2, out pbAchieved, out punUnlockTime); } public static bool StoreStats() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUserStats_StoreStats(CSteamAPIContext.GetSteamUserStats()); } public static int GetAchievementIcon(string pchName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_GetAchievementIcon(CSteamAPIContext.GetSteamUserStats(), pchName2); } public static string GetAchievementDisplayAttribute(string pchName, string pchKey) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUserStats_GetAchievementDisplayAttribute(CSteamAPIContext.GetSteamUserStats(), pchName2, pchKey2)); } public static bool IndicateAchievementProgress(string pchName, uint nCurProgress, uint nMaxProgress) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_IndicateAchievementProgress(CSteamAPIContext.GetSteamUserStats(), pchName2, nCurProgress, nMaxProgress); } public static uint GetNumAchievements() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUserStats_GetNumAchievements(CSteamAPIContext.GetSteamUserStats()); } public static string GetAchievementName(uint iAchievement) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUserStats_GetAchievementName(CSteamAPIContext.GetSteamUserStats(), iAchievement)); } public static SteamAPICall_t RequestUserStats(CSteamID steamIDUser) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUserStats_RequestUserStats(CSteamAPIContext.GetSteamUserStats(), steamIDUser); } public static bool GetUserStat(CSteamID steamIDUser, string pchName, out int pData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_GetUserStatInt32(CSteamAPIContext.GetSteamUserStats(), steamIDUser, pchName2, out pData); } public static bool GetUserStat(CSteamID steamIDUser, string pchName, out float pData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_GetUserStatFloat(CSteamAPIContext.GetSteamUserStats(), steamIDUser, pchName2, out pData); } public static bool GetUserAchievement(CSteamID steamIDUser, string pchName, out bool pbAchieved) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_GetUserAchievement(CSteamAPIContext.GetSteamUserStats(), steamIDUser, pchName2, out pbAchieved); } public static bool GetUserAchievementAndUnlockTime(CSteamID steamIDUser, string pchName, out bool pbAchieved, out uint punUnlockTime) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_GetUserAchievementAndUnlockTime(CSteamAPIContext.GetSteamUserStats(), steamIDUser, pchName2, out pbAchieved, out punUnlockTime); } public static bool ResetAllStats(bool bAchievementsToo) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUserStats_ResetAllStats(CSteamAPIContext.GetSteamUserStats(), bAchievementsToo); } public static SteamAPICall_t FindOrCreateLeaderboard(string pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchLeaderboardName2 = new InteropHelp.UTF8StringHandle(pchLeaderboardName); return (SteamAPICall_t)NativeMethods.ISteamUserStats_FindOrCreateLeaderboard(CSteamAPIContext.GetSteamUserStats(), pchLeaderboardName2, eLeaderboardSortMethod, eLeaderboardDisplayType); } public static SteamAPICall_t FindLeaderboard(string pchLeaderboardName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchLeaderboardName2 = new InteropHelp.UTF8StringHandle(pchLeaderboardName); return (SteamAPICall_t)NativeMethods.ISteamUserStats_FindLeaderboard(CSteamAPIContext.GetSteamUserStats(), pchLeaderboardName2); } public static string GetLeaderboardName(SteamLeaderboard_t hSteamLeaderboard) { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUserStats_GetLeaderboardName(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard)); } public static int GetLeaderboardEntryCount(SteamLeaderboard_t hSteamLeaderboard) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUserStats_GetLeaderboardEntryCount(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard); } public static ELeaderboardSortMethod GetLeaderboardSortMethod(SteamLeaderboard_t hSteamLeaderboard) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUserStats_GetLeaderboardSortMethod(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard); } public static ELeaderboardDisplayType GetLeaderboardDisplayType(SteamLeaderboard_t hSteamLeaderboard) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUserStats_GetLeaderboardDisplayType(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard); } public static SteamAPICall_t DownloadLeaderboardEntries(SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUserStats_DownloadLeaderboardEntries(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd); } public static SteamAPICall_t DownloadLeaderboardEntriesForUsers(SteamLeaderboard_t hSteamLeaderboard, CSteamID[] prgUsers, int cUsers) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUserStats_DownloadLeaderboardEntriesForUsers(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard, prgUsers, cUsers); } public static bool GetDownloadedLeaderboardEntry(SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, out LeaderboardEntry_t pLeaderboardEntry, int[] pDetails, int cDetailsMax) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUserStats_GetDownloadedLeaderboardEntry(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboardEntries, index, out pLeaderboardEntry, pDetails, cDetailsMax); } public static SteamAPICall_t UploadLeaderboardScore(SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, int[] pScoreDetails, int cScoreDetailsCount) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUserStats_UploadLeaderboardScore(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount); } public static SteamAPICall_t AttachLeaderboardUGC(SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUserStats_AttachLeaderboardUGC(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard, hUGC); } public static SteamAPICall_t GetNumberOfCurrentPlayers() { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUserStats_GetNumberOfCurrentPlayers(CSteamAPIContext.GetSteamUserStats()); } public static SteamAPICall_t RequestGlobalAchievementPercentages() { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUserStats_RequestGlobalAchievementPercentages(CSteamAPIContext.GetSteamUserStats()); } public static int GetMostAchievedAchievementInfo(out string pchName, uint unNameBufLen, out float pflPercent, out bool pbAchieved) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)unNameBufLen); int num = NativeMethods.ISteamUserStats_GetMostAchievedAchievementInfo(CSteamAPIContext.GetSteamUserStats(), intPtr, unNameBufLen, out pflPercent, out pbAchieved); pchName = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static int GetNextMostAchievedAchievementInfo(int iIteratorPrevious, out string pchName, uint unNameBufLen, out float pflPercent, out bool pbAchieved) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)unNameBufLen); int num = NativeMethods.ISteamUserStats_GetNextMostAchievedAchievementInfo(CSteamAPIContext.GetSteamUserStats(), iIteratorPrevious, intPtr, unNameBufLen, out pflPercent, out pbAchieved); pchName = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static bool GetAchievementAchievedPercent(string pchName, out float pflPercent) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchName2 = new InteropHelp.UTF8StringHandle(pchName); return NativeMethods.ISteamUserStats_GetAchievementAchievedPercent(CSteamAPIContext.GetSteamUserStats(), pchName2, out pflPercent); } public static SteamAPICall_t RequestGlobalStats(int nHistoryDays) { InteropHelp.TestIfAvailableClient(); return (SteamAPICall_t)NativeMethods.ISteamUserStats_RequestGlobalStats(CSteamAPIContext.GetSteamUserStats(), nHistoryDays); } public static bool GetGlobalStat(string pchStatName, out long pData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchStatName2 = new InteropHelp.UTF8StringHandle(pchStatName); return NativeMethods.ISteamUserStats_GetGlobalStatInt64(CSteamAPIContext.GetSteamUserStats(), pchStatName2, out pData); } public static bool GetGlobalStat(string pchStatName, out double pData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchStatName2 = new InteropHelp.UTF8StringHandle(pchStatName); return NativeMethods.ISteamUserStats_GetGlobalStatDouble(CSteamAPIContext.GetSteamUserStats(), pchStatName2, out pData); } public static int GetGlobalStatHistory(string pchStatName, long[] pData, uint cubData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchStatName2 = new InteropHelp.UTF8StringHandle(pchStatName); return NativeMethods.ISteamUserStats_GetGlobalStatHistoryInt64(CSteamAPIContext.GetSteamUserStats(), pchStatName2, pData, cubData); } public static int GetGlobalStatHistory(string pchStatName, double[] pData, uint cubData) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchStatName2 = new InteropHelp.UTF8StringHandle(pchStatName); return NativeMethods.ISteamUserStats_GetGlobalStatHistoryDouble(CSteamAPIContext.GetSteamUserStats(), pchStatName2, pData, cubData); } } public static class SteamUtils { public static uint GetSecondsSinceAppActive() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_GetSecondsSinceAppActive(CSteamAPIContext.GetSteamUtils()); } public static uint GetSecondsSinceComputerActive() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_GetSecondsSinceComputerActive(CSteamAPIContext.GetSteamUtils()); } public static EUniverse GetConnectedUniverse() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_GetConnectedUniverse(CSteamAPIContext.GetSteamUtils()); } public static uint GetServerRealTime() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_GetServerRealTime(CSteamAPIContext.GetSteamUtils()); } public static string GetIPCountry() { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUtils_GetIPCountry(CSteamAPIContext.GetSteamUtils())); } public static bool GetImageSize(int iImage, out uint pnWidth, out uint pnHeight) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_GetImageSize(CSteamAPIContext.GetSteamUtils(), iImage, out pnWidth, out pnHeight); } public static bool GetImageRGBA(int iImage, byte[] pubDest, int nDestBufferSize) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_GetImageRGBA(CSteamAPIContext.GetSteamUtils(), iImage, pubDest, nDestBufferSize); } public static bool GetCSERIPPort(out uint unIP, out ushort usPort) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_GetCSERIPPort(CSteamAPIContext.GetSteamUtils(), out unIP, out usPort); } public static byte GetCurrentBatteryPower() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_GetCurrentBatteryPower(CSteamAPIContext.GetSteamUtils()); } public static AppId_t GetAppID() { InteropHelp.TestIfAvailableClient(); return (AppId_t)NativeMethods.ISteamUtils_GetAppID(CSteamAPIContext.GetSteamUtils()); } public static void SetOverlayNotificationPosition(ENotificationPosition eNotificationPosition) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamUtils_SetOverlayNotificationPosition(CSteamAPIContext.GetSteamUtils(), eNotificationPosition); } public static bool IsAPICallCompleted(SteamAPICall_t hSteamAPICall, out bool pbFailed) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_IsAPICallCompleted(CSteamAPIContext.GetSteamUtils(), hSteamAPICall, out pbFailed); } public static ESteamAPICallFailure GetAPICallFailureReason(SteamAPICall_t hSteamAPICall) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_GetAPICallFailureReason(CSteamAPIContext.GetSteamUtils(), hSteamAPICall); } public static bool GetAPICallResult(SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, out bool pbFailed) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_GetAPICallResult(CSteamAPIContext.GetSteamUtils(), hSteamAPICall, pCallback, cubCallback, iCallbackExpected, out pbFailed); } public static uint GetIPCCallCount() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_GetIPCCallCount(CSteamAPIContext.GetSteamUtils()); } public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamUtils_SetWarningMessageHook(CSteamAPIContext.GetSteamUtils(), pFunction); } public static bool IsOverlayEnabled() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_IsOverlayEnabled(CSteamAPIContext.GetSteamUtils()); } public static bool BOverlayNeedsPresent() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_BOverlayNeedsPresent(CSteamAPIContext.GetSteamUtils()); } public static SteamAPICall_t CheckFileSignature(string szFileName) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle szFileName2 = new InteropHelp.UTF8StringHandle(szFileName); return (SteamAPICall_t)NativeMethods.ISteamUtils_CheckFileSignature(CSteamAPIContext.GetSteamUtils(), szFileName2); } public static bool ShowGamepadTextInput(EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, string pchDescription, uint unCharMax, string pchExistingText) { InteropHelp.TestIfAvailableClient(); using InteropHelp.UTF8StringHandle pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription); using InteropHelp.UTF8StringHandle pchExistingText2 = new InteropHelp.UTF8StringHandle(pchExistingText); return NativeMethods.ISteamUtils_ShowGamepadTextInput(CSteamAPIContext.GetSteamUtils(), eInputMode, eLineInputMode, pchDescription2, unCharMax, pchExistingText2); } public static uint GetEnteredGamepadTextLength() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_GetEnteredGamepadTextLength(CSteamAPIContext.GetSteamUtils()); } public static bool GetEnteredGamepadTextInput(out string pchText, uint cchText) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)cchText); bool flag = NativeMethods.ISteamUtils_GetEnteredGamepadTextInput(CSteamAPIContext.GetSteamUtils(), intPtr, cchText); pchText = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } public static string GetSteamUILanguage() { InteropHelp.TestIfAvailableClient(); return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUtils_GetSteamUILanguage(CSteamAPIContext.GetSteamUtils())); } public static bool IsSteamRunningInVR() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_IsSteamRunningInVR(CSteamAPIContext.GetSteamUtils()); } public static void SetOverlayNotificationInset(int nHorizontalInset, int nVerticalInset) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamUtils_SetOverlayNotificationInset(CSteamAPIContext.GetSteamUtils(), nHorizontalInset, nVerticalInset); } public static bool IsSteamInBigPictureMode() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_IsSteamInBigPictureMode(CSteamAPIContext.GetSteamUtils()); } public static void StartVRDashboard() { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamUtils_StartVRDashboard(CSteamAPIContext.GetSteamUtils()); } public static bool IsVRHeadsetStreamingEnabled() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_IsVRHeadsetStreamingEnabled(CSteamAPIContext.GetSteamUtils()); } public static void SetVRHeadsetStreamingEnabled(bool bEnabled) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamUtils_SetVRHeadsetStreamingEnabled(CSteamAPIContext.GetSteamUtils(), bEnabled); } public static bool IsSteamChinaLauncher() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_IsSteamChinaLauncher(CSteamAPIContext.GetSteamUtils()); } public static bool InitFilterText() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_InitFilterText(CSteamAPIContext.GetSteamUtils()); } public static int FilterText(out string pchOutFilteredText, uint nByteSizeOutFilteredText, string pchInputMessage, bool bLegalOnly) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal((int)nByteSizeOutFilteredText); using InteropHelp.UTF8StringHandle pchInputMessage2 = new InteropHelp.UTF8StringHandle(pchInputMessage); int num = NativeMethods.ISteamUtils_FilterText(CSteamAPIContext.GetSteamUtils(), intPtr, nByteSizeOutFilteredText, pchInputMessage2, bLegalOnly); pchOutFilteredText = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return num; } public static ESteamIPv6ConnectivityState GetIPv6ConnectivityState(ESteamIPv6ConnectivityProtocol eProtocol) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamUtils_GetIPv6ConnectivityState(CSteamAPIContext.GetSteamUtils(), eProtocol); } } public static class SteamVideo { public static void GetVideoURL(AppId_t unVideoAppID) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamVideo_GetVideoURL(CSteamAPIContext.GetSteamVideo(), unVideoAppID); } public static bool IsBroadcasting(out int pnNumViewers) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamVideo_IsBroadcasting(CSteamAPIContext.GetSteamVideo(), out pnNumViewers); } public static void GetOPFSettings(AppId_t unVideoAppID) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamVideo_GetOPFSettings(CSteamAPIContext.GetSteamVideo(), unVideoAppID); } public static bool GetOPFStringForApp(AppId_t unVideoAppID, out string pchBuffer, ref int pnBufferSize) { InteropHelp.TestIfAvailableClient(); IntPtr intPtr = Marshal.AllocHGlobal(pnBufferSize); bool flag = NativeMethods.ISteamVideo_GetOPFStringForApp(CSteamAPIContext.GetSteamVideo(), unVideoAppID, intPtr, ref pnBufferSize); pchBuffer = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); Marshal.FreeHGlobal(intPtr); return flag; } } [SuppressUnmanagedCodeSecurity] internal static class NativeMethods { internal const string NativeLibraryName = "steam_api64"; internal const string NativeLibrary_SDKEncryptedAppTicket = "sdkencryptedappticket64"; [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_Init(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_Shutdown(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_RestartAppIfNecessary(AppId_t unOwnAppID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_ReleaseCurrentThreadMemory(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_WriteMiniDump(uint uStructuredExceptionCode, IntPtr pvExceptionInfo, uint uBuildID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SetMiniDumpComment(InteropHelp.UTF8StringHandle pchMsg); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_RunCallbacks(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_RegisterCallback(IntPtr pCallback, int iCallback); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_UnregisterCallback(IntPtr pCallback); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_RegisterCallResult(IntPtr pCallback, ulong hAPICall); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_UnregisterCallResult(IntPtr pCallback, ulong hAPICall); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_IsSteamRunning(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern int SteamAPI_GetSteamInstallPath(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern int SteamAPI_GetHSteamPipe(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SetTryCatchCallbacks([MarshalAs(UnmanagedType.I1)] bool bTryCatchCallbacks); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern int SteamAPI_GetHSteamUser(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SteamInternal_ContextInit(IntPtr pContextInitData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SteamInternal_CreateInterface(InteropHelp.UTF8StringHandle ver); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SteamInternal_FindOrCreateUserInterface(HSteamUser hSteamUser, InteropHelp.UTF8StringHandle pszVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SteamInternal_FindOrCreateGameServerInterface(HSteamUser hSteamUser, InteropHelp.UTF8StringHandle pszVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_UseBreakpadCrashHandler(InteropHelp.UTF8StringHandle pchVersion, InteropHelp.UTF8StringHandle pchDate, InteropHelp.UTF8StringHandle pchTime, [MarshalAs(UnmanagedType.I1)] bool bFullMemoryDumps, IntPtr pvContext, IntPtr m_pfnPreMinidumpCallback); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SetBreakpadAppID(uint unAppID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_ManualDispatch_Init(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_ManualDispatch_RunFrame(HSteamPipe hSteamPipe); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_ManualDispatch_GetNextCallback(HSteamPipe hSteamPipe, IntPtr pCallbackMsg); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_ManualDispatch_FreeLastCallback(HSteamPipe hSteamPipe); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamGameServer_InitSafe")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamGameServer_Init(uint unIP, ushort usSteamPort, ushort usGamePort, ushort usQueryPort, EServerMode eServerMode, InteropHelp.UTF8StringHandle pchVersionString); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamGameServer_Shutdown(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamGameServer_RunCallbacks(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamGameServer_ReleaseCurrentThreadMemory(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamGameServer_BSecure(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern ulong SteamGameServer_GetSteamID(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern int SteamGameServer_GetHSteamPipe(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern int SteamGameServer_GetHSteamUser(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamInternal_GameServer_Init(uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, EServerMode eServerMode, InteropHelp.UTF8StringHandle pchVersionString); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SteamClient(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SteamGameServerClient(); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SteamNetworkingIPAddr_Clear(ref SteamNetworkingIPAddr self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_SteamNetworkingIPAddr_IsIPv6AllZeros(ref SteamNetworkingIPAddr self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SteamNetworkingIPAddr_SetIPv6(ref SteamNetworkingIPAddr self, [In][Out] byte[] ipv6, ushort nPort); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SteamNetworkingIPAddr_SetIPv4(ref SteamNetworkingIPAddr self, uint nIP, ushort nPort); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_SteamNetworkingIPAddr_IsIPv4(ref SteamNetworkingIPAddr self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern uint SteamAPI_SteamNetworkingIPAddr_GetIPv4(ref SteamNetworkingIPAddr self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SteamNetworkingIPAddr_SetIPv6LocalHost(ref SteamNetworkingIPAddr self, ushort nPort); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_SteamNetworkingIPAddr_IsLocalHost(ref SteamNetworkingIPAddr self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SteamNetworkingIPAddr_ToString(ref SteamNetworkingIPAddr self, IntPtr buf, uint cbBuf, [MarshalAs(UnmanagedType.I1)] bool bWithPort); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_SteamNetworkingIPAddr_ParseString(ref SteamNetworkingIPAddr self, InteropHelp.UTF8StringHandle pszStr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_SteamNetworkingIPAddr_IsEqualTo(ref SteamNetworkingIPAddr self, ref SteamNetworkingIPAddr x); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SteamNetworkingIdentity_Clear(ref SteamNetworkingIdentity self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_SteamNetworkingIdentity_SetIPAddr")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_SteamNetworkingIdentity_IsInvalid(ref SteamNetworkingIdentity self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SteamNetworkingIdentity_SetSteamID(ref SteamNetworkingIdentity self, ulong steamID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern ulong SteamAPI_SteamNetworkingIdentity_GetSteamID(ref SteamNetworkingIdentity self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SteamNetworkingIdentity_SetSteamID64(ref SteamNetworkingIdentity self, ulong steamID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern ulong SteamAPI_SteamNetworkingIdentity_GetSteamID64(ref SteamNetworkingIdentity self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_SteamNetworkingIdentity_SetXboxPairwiseID(ref SteamNetworkingIdentity self, InteropHelp.UTF8StringHandle pszString); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SteamAPI_SteamNetworkingIdentity_GetXboxPairwiseID(ref SteamNetworkingIdentity self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SteamAPI_SteamNetworkingIdentity_SetIPAddr(ref SteamNetworkingIdentity self, ref SteamNetworkingIPAddr addr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SteamAPI_SteamNetworkingIdentity_GetIPAddr(ref SteamNetworkingIdentity self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SteamNetworkingIdentity_SetLocalHost(ref SteamNetworkingIdentity self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_SteamNetworkingIdentity_IsLocalHost(ref SteamNetworkingIdentity self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_SteamNetworkingIdentity_SetGenericString(ref SteamNetworkingIdentity self, InteropHelp.UTF8StringHandle pszString); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SteamAPI_SteamNetworkingIdentity_GetGenericString(ref SteamNetworkingIdentity self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_SteamNetworkingIdentity_SetGenericBytes(ref SteamNetworkingIdentity self, [In][Out] byte[] data, uint cbLen); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SteamAPI_SteamNetworkingIdentity_GetGenericBytes(ref SteamNetworkingIdentity self, out int cbLen); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_SteamNetworkingIdentity_IsEqualTo(ref SteamNetworkingIdentity self, ref SteamNetworkingIdentity x); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SteamNetworkingIdentity_ToString(ref SteamNetworkingIdentity self, IntPtr buf, uint cbBuf); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_SteamNetworkingIdentity_ParseString(ref SteamNetworkingIdentity self, InteropHelp.UTF8StringHandle pszStr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SteamNetworkingMessage_t_Release(IntPtr self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamAPI_ISteamNetworkingConnectionCustomSignaling_SendSignal(ref ISteamNetworkingConnectionCustomSignaling self, HSteamNetConnection hConn, ref SteamNetConnectionInfo_t info, IntPtr pMsg, int cbMsg); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_ISteamNetworkingConnectionCustomSignaling_Release(ref ISteamNetworkingConnectionCustomSignaling self); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SteamAPI_ISteamNetworkingCustomSignalingRecvContext_OnConnectRequest(ref ISteamNetworkingCustomSignalingRecvContext self, HSteamNetConnection hConn, ref SteamNetworkingIdentity identityPeer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_ISteamNetworkingCustomSignalingRecvContext_SendRejectionSignal(ref ISteamNetworkingCustomSignalingRecvContext self, ref SteamNetworkingIdentity identityPeer, IntPtr pMsg, int cbMsg); [DllImport("sdkencryptedappticket64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamEncryptedAppTicket_BDecryptTicket([In][Out] byte[] rgubTicketEncrypted, uint cubTicketEncrypted, [In][Out] byte[] rgubTicketDecrypted, ref uint pcubTicketDecrypted, [MarshalAs(UnmanagedType.LPArray, SizeConst = 32)] byte[] rgubKey, int cubKey); [DllImport("sdkencryptedappticket64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamEncryptedAppTicket_BIsTicketForApp([In][Out] byte[] rgubTicketDecrypted, uint cubTicketDecrypted, AppId_t nAppID); [DllImport("sdkencryptedappticket64", CallingConvention = CallingConvention.Cdecl)] public static extern uint SteamEncryptedAppTicket_GetTicketIssueTime([In][Out] byte[] rgubTicketDecrypted, uint cubTicketDecrypted); [DllImport("sdkencryptedappticket64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamEncryptedAppTicket_GetTicketSteamID([In][Out] byte[] rgubTicketDecrypted, uint cubTicketDecrypted, out CSteamID psteamID); [DllImport("sdkencryptedappticket64", CallingConvention = CallingConvention.Cdecl)] public static extern uint SteamEncryptedAppTicket_GetTicketAppID([In][Out] byte[] rgubTicketDecrypted, uint cubTicketDecrypted); [DllImport("sdkencryptedappticket64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamEncryptedAppTicket_BUserOwnsAppInTicket([In][Out] byte[] rgubTicketDecrypted, uint cubTicketDecrypted, AppId_t nAppID); [DllImport("sdkencryptedappticket64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamEncryptedAppTicket_BUserIsVacBanned([In][Out] byte[] rgubTicketDecrypted, uint cubTicketDecrypted); [DllImport("sdkencryptedappticket64", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SteamEncryptedAppTicket_GetUserVariableData([In][Out] byte[] rgubTicketDecrypted, uint cubTicketDecrypted, out uint pcubUserData); [DllImport("sdkencryptedappticket64", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool SteamEncryptedAppTicket_BIsTicketSigned([In][Out] byte[] rgubTicketDecrypted, uint cubTicketDecrypted, [In][Out] byte[] pubRSAKey, uint cubRSAKey); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamAppList_GetNumInstalledApps")] public static extern uint ISteamAppList_GetNumInstalledApps(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamAppList_GetInstalledApps")] public static extern uint ISteamAppList_GetInstalledApps(IntPtr instancePtr, [In][Out] AppId_t[] pvecAppID, uint unMaxAppIDs); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamAppList_GetAppName")] public static extern int ISteamAppList_GetAppName(IntPtr instancePtr, AppId_t nAppID, IntPtr pchName, int cchNameMax); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamAppList_GetAppInstallDir")] public static extern int ISteamAppList_GetAppInstallDir(IntPtr instancePtr, AppId_t nAppID, IntPtr pchDirectory, int cchNameMax); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamAppList_GetAppBuildId")] public static extern int ISteamAppList_GetAppBuildId(IntPtr instancePtr, AppId_t nAppID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribed")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamApps_BIsSubscribed(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_BIsLowViolence")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamApps_BIsLowViolence(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_BIsCybercafe")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamApps_BIsCybercafe(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_BIsVACBanned")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamApps_BIsVACBanned(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_GetCurrentGameLanguage")] public static extern IntPtr ISteamApps_GetCurrentGameLanguage(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_GetAvailableGameLanguages")] public static extern IntPtr ISteamApps_GetAvailableGameLanguages(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribedApp")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamApps_BIsSubscribedApp(IntPtr instancePtr, AppId_t appID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_BIsDlcInstalled")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamApps_BIsDlcInstalled(IntPtr instancePtr, AppId_t appID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime")] public static extern uint ISteamApps_GetEarliestPurchaseUnixTime(IntPtr instancePtr, AppId_t nAppID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamApps_BIsSubscribedFromFreeWeekend(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_GetDLCCount")] public static extern int ISteamApps_GetDLCCount(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_BGetDLCDataByIndex")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamApps_BGetDLCDataByIndex(IntPtr instancePtr, int iDLC, out AppId_t pAppID, out bool pbAvailable, IntPtr pchName, int cchNameBufferSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_InstallDLC")] public static extern void ISteamApps_InstallDLC(IntPtr instancePtr, AppId_t nAppID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_UninstallDLC")] public static extern void ISteamApps_UninstallDLC(IntPtr instancePtr, AppId_t nAppID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey")] public static extern void ISteamApps_RequestAppProofOfPurchaseKey(IntPtr instancePtr, AppId_t nAppID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_GetCurrentBetaName")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamApps_GetCurrentBetaName(IntPtr instancePtr, IntPtr pchName, int cchNameBufferSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_MarkContentCorrupt")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamApps_MarkContentCorrupt(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bMissingFilesOnly); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_GetInstalledDepots")] public static extern uint ISteamApps_GetInstalledDepots(IntPtr instancePtr, AppId_t appID, [In][Out] DepotId_t[] pvecDepots, uint cMaxDepots); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_GetAppInstallDir")] public static extern uint ISteamApps_GetAppInstallDir(IntPtr instancePtr, AppId_t appID, IntPtr pchFolder, uint cchFolderBufferSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_BIsAppInstalled")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamApps_BIsAppInstalled(IntPtr instancePtr, AppId_t appID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_GetAppOwner")] public static extern ulong ISteamApps_GetAppOwner(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_GetLaunchQueryParam")] public static extern IntPtr ISteamApps_GetLaunchQueryParam(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchKey); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_GetDlcDownloadProgress")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamApps_GetDlcDownloadProgress(IntPtr instancePtr, AppId_t nAppID, out ulong punBytesDownloaded, out ulong punBytesTotal); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_GetAppBuildId")] public static extern int ISteamApps_GetAppBuildId(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys")] public static extern void ISteamApps_RequestAllProofOfPurchaseKeys(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_GetFileDetails")] public static extern ulong ISteamApps_GetFileDetails(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszFileName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_GetLaunchCommandLine")] public static extern int ISteamApps_GetLaunchCommandLine(IntPtr instancePtr, IntPtr pszCommandLine, int cubCommandLine); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamApps_BIsSubscribedFromFamilySharing(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_CreateSteamPipe")] public static extern int ISteamClient_CreateSteamPipe(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_BReleaseSteamPipe")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamClient_BReleaseSteamPipe(IntPtr instancePtr, HSteamPipe hSteamPipe); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_ConnectToGlobalUser")] public static extern int ISteamClient_ConnectToGlobalUser(IntPtr instancePtr, HSteamPipe hSteamPipe); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_CreateLocalUser")] public static extern int ISteamClient_CreateLocalUser(IntPtr instancePtr, out HSteamPipe phSteamPipe, EAccountType eAccountType); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_ReleaseUser")] public static extern void ISteamClient_ReleaseUser(IntPtr instancePtr, HSteamPipe hSteamPipe, HSteamUser hUser); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamUser")] public static extern IntPtr ISteamClient_GetISteamUser(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamGameServer")] public static extern IntPtr ISteamClient_GetISteamGameServer(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_SetLocalIPBinding")] public static extern void ISteamClient_SetLocalIPBinding(IntPtr instancePtr, ref SteamIPAddress_t unIP, ushort usPort); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamFriends")] public static extern IntPtr ISteamClient_GetISteamFriends(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamUtils")] public static extern IntPtr ISteamClient_GetISteamUtils(IntPtr instancePtr, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamMatchmaking")] public static extern IntPtr ISteamClient_GetISteamMatchmaking(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamMatchmakingServers")] public static extern IntPtr ISteamClient_GetISteamMatchmakingServers(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamGenericInterface")] public static extern IntPtr ISteamClient_GetISteamGenericInterface(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamUserStats")] public static extern IntPtr ISteamClient_GetISteamUserStats(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamGameServerStats")] public static extern IntPtr ISteamClient_GetISteamGameServerStats(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamApps")] public static extern IntPtr ISteamClient_GetISteamApps(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamNetworking")] public static extern IntPtr ISteamClient_GetISteamNetworking(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamRemoteStorage")] public static extern IntPtr ISteamClient_GetISteamRemoteStorage(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamScreenshots")] public static extern IntPtr ISteamClient_GetISteamScreenshots(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamGameSearch")] public static extern IntPtr ISteamClient_GetISteamGameSearch(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetIPCCallCount")] public static extern uint ISteamClient_GetIPCCallCount(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_SetWarningMessageHook")] public static extern void ISteamClient_SetWarningMessageHook(IntPtr instancePtr, SteamAPIWarningMessageHook_t pFunction); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_BShutdownIfAllPipesClosed")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamClient_BShutdownIfAllPipesClosed(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamHTTP")] public static extern IntPtr ISteamClient_GetISteamHTTP(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamController")] public static extern IntPtr ISteamClient_GetISteamController(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamUGC")] public static extern IntPtr ISteamClient_GetISteamUGC(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamAppList")] public static extern IntPtr ISteamClient_GetISteamAppList(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamMusic")] public static extern IntPtr ISteamClient_GetISteamMusic(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamMusicRemote")] public static extern IntPtr ISteamClient_GetISteamMusicRemote(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamHTMLSurface")] public static extern IntPtr ISteamClient_GetISteamHTMLSurface(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamInventory")] public static extern IntPtr ISteamClient_GetISteamInventory(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamVideo")] public static extern IntPtr ISteamClient_GetISteamVideo(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamParentalSettings")] public static extern IntPtr ISteamClient_GetISteamParentalSettings(IntPtr instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamInput")] public static extern IntPtr ISteamClient_GetISteamInput(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamParties")] public static extern IntPtr ISteamClient_GetISteamParties(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamClient_GetISteamRemotePlay")] public static extern IntPtr ISteamClient_GetISteamRemotePlay(IntPtr instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, InteropHelp.UTF8StringHandle pchVersion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_Init")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamController_Init(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_Shutdown")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamController_Shutdown(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_RunFrame")] public static extern void ISteamController_RunFrame(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetConnectedControllers")] public static extern int ISteamController_GetConnectedControllers(IntPtr instancePtr, [In][Out] ControllerHandle_t[] handlesOut); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetActionSetHandle")] public static extern ulong ISteamController_GetActionSetHandle(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszActionSetName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_ActivateActionSet")] public static extern void ISteamController_ActivateActionSet(IntPtr instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetCurrentActionSet")] public static extern ulong ISteamController_GetCurrentActionSet(IntPtr instancePtr, ControllerHandle_t controllerHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_ActivateActionSetLayer")] public static extern void ISteamController_ActivateActionSetLayer(IntPtr instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_DeactivateActionSetLayer")] public static extern void ISteamController_DeactivateActionSetLayer(IntPtr instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_DeactivateAllActionSetLayers")] public static extern void ISteamController_DeactivateAllActionSetLayers(IntPtr instancePtr, ControllerHandle_t controllerHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetActiveActionSetLayers")] public static extern int ISteamController_GetActiveActionSetLayers(IntPtr instancePtr, ControllerHandle_t controllerHandle, [In][Out] ControllerActionSetHandle_t[] handlesOut); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetDigitalActionHandle")] public static extern ulong ISteamController_GetDigitalActionHandle(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszActionName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetDigitalActionData")] public static extern InputDigitalActionData_t ISteamController_GetDigitalActionData(IntPtr instancePtr, ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetDigitalActionOrigins")] public static extern int ISteamController_GetDigitalActionOrigins(IntPtr instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, [In][Out] EControllerActionOrigin[] originsOut); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetAnalogActionHandle")] public static extern ulong ISteamController_GetAnalogActionHandle(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszActionName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetAnalogActionData")] public static extern InputAnalogActionData_t ISteamController_GetAnalogActionData(IntPtr instancePtr, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetAnalogActionOrigins")] public static extern int ISteamController_GetAnalogActionOrigins(IntPtr instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, [In][Out] EControllerActionOrigin[] originsOut); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetGlyphForActionOrigin")] public static extern IntPtr ISteamController_GetGlyphForActionOrigin(IntPtr instancePtr, EControllerActionOrigin eOrigin); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetStringForActionOrigin")] public static extern IntPtr ISteamController_GetStringForActionOrigin(IntPtr instancePtr, EControllerActionOrigin eOrigin); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_StopAnalogActionMomentum")] public static extern void ISteamController_StopAnalogActionMomentum(IntPtr instancePtr, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetMotionData")] public static extern InputMotionData_t ISteamController_GetMotionData(IntPtr instancePtr, ControllerHandle_t controllerHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_TriggerHapticPulse")] public static extern void ISteamController_TriggerHapticPulse(IntPtr instancePtr, ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_TriggerRepeatedHapticPulse")] public static extern void ISteamController_TriggerRepeatedHapticPulse(IntPtr instancePtr, ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_TriggerVibration")] public static extern void ISteamController_TriggerVibration(IntPtr instancePtr, ControllerHandle_t controllerHandle, ushort usLeftSpeed, ushort usRightSpeed); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_SetLEDColor")] public static extern void ISteamController_SetLEDColor(IntPtr instancePtr, ControllerHandle_t controllerHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_ShowBindingPanel")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamController_ShowBindingPanel(IntPtr instancePtr, ControllerHandle_t controllerHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetInputTypeForHandle")] public static extern ESteamInputType ISteamController_GetInputTypeForHandle(IntPtr instancePtr, ControllerHandle_t controllerHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetControllerForGamepadIndex")] public static extern ulong ISteamController_GetControllerForGamepadIndex(IntPtr instancePtr, int nIndex); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetGamepadIndexForController")] public static extern int ISteamController_GetGamepadIndexForController(IntPtr instancePtr, ControllerHandle_t ulControllerHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetStringForXboxOrigin")] public static extern IntPtr ISteamController_GetStringForXboxOrigin(IntPtr instancePtr, EXboxOrigin eOrigin); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetGlyphForXboxOrigin")] public static extern IntPtr ISteamController_GetGlyphForXboxOrigin(IntPtr instancePtr, EXboxOrigin eOrigin); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetActionOriginFromXboxOrigin")] public static extern EControllerActionOrigin ISteamController_GetActionOriginFromXboxOrigin(IntPtr instancePtr, ControllerHandle_t controllerHandle, EXboxOrigin eOrigin); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_TranslateActionOrigin")] public static extern EControllerActionOrigin ISteamController_TranslateActionOrigin(IntPtr instancePtr, ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamController_GetControllerBindingRevision")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamController_GetControllerBindingRevision(IntPtr instancePtr, ControllerHandle_t controllerHandle, out int pMajor, out int pMinor); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetPersonaName")] public static extern IntPtr ISteamFriends_GetPersonaName(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_SetPersonaName")] public static extern ulong ISteamFriends_SetPersonaName(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchPersonaName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetPersonaState")] public static extern EPersonaState ISteamFriends_GetPersonaState(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendCount")] public static extern int ISteamFriends_GetFriendCount(IntPtr instancePtr, EFriendFlags iFriendFlags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendByIndex")] public static extern ulong ISteamFriends_GetFriendByIndex(IntPtr instancePtr, int iFriend, EFriendFlags iFriendFlags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendRelationship")] public static extern EFriendRelationship ISteamFriends_GetFriendRelationship(IntPtr instancePtr, CSteamID steamIDFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendPersonaState")] public static extern EPersonaState ISteamFriends_GetFriendPersonaState(IntPtr instancePtr, CSteamID steamIDFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendPersonaName")] public static extern IntPtr ISteamFriends_GetFriendPersonaName(IntPtr instancePtr, CSteamID steamIDFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendGamePlayed")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_GetFriendGamePlayed(IntPtr instancePtr, CSteamID steamIDFriend, out FriendGameInfo_t pFriendGameInfo); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendPersonaNameHistory")] public static extern IntPtr ISteamFriends_GetFriendPersonaNameHistory(IntPtr instancePtr, CSteamID steamIDFriend, int iPersonaName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendSteamLevel")] public static extern int ISteamFriends_GetFriendSteamLevel(IntPtr instancePtr, CSteamID steamIDFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetPlayerNickname")] public static extern IntPtr ISteamFriends_GetPlayerNickname(IntPtr instancePtr, CSteamID steamIDPlayer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupCount")] public static extern int ISteamFriends_GetFriendsGroupCount(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex")] public static extern short ISteamFriends_GetFriendsGroupIDByIndex(IntPtr instancePtr, int iFG); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupName")] public static extern IntPtr ISteamFriends_GetFriendsGroupName(IntPtr instancePtr, FriendsGroupID_t friendsGroupID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupMembersCount")] public static extern int ISteamFriends_GetFriendsGroupMembersCount(IntPtr instancePtr, FriendsGroupID_t friendsGroupID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupMembersList")] public static extern void ISteamFriends_GetFriendsGroupMembersList(IntPtr instancePtr, FriendsGroupID_t friendsGroupID, [In][Out] CSteamID[] pOutSteamIDMembers, int nMembersCount); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_HasFriend")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_HasFriend(IntPtr instancePtr, CSteamID steamIDFriend, EFriendFlags iFriendFlags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetClanCount")] public static extern int ISteamFriends_GetClanCount(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetClanByIndex")] public static extern ulong ISteamFriends_GetClanByIndex(IntPtr instancePtr, int iClan); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetClanName")] public static extern IntPtr ISteamFriends_GetClanName(IntPtr instancePtr, CSteamID steamIDClan); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetClanTag")] public static extern IntPtr ISteamFriends_GetClanTag(IntPtr instancePtr, CSteamID steamIDClan); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetClanActivityCounts")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_GetClanActivityCounts(IntPtr instancePtr, CSteamID steamIDClan, out int pnOnline, out int pnInGame, out int pnChatting); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_DownloadClanActivityCounts")] public static extern ulong ISteamFriends_DownloadClanActivityCounts(IntPtr instancePtr, [In][Out] CSteamID[] psteamIDClans, int cClansToRequest); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendCountFromSource")] public static extern int ISteamFriends_GetFriendCountFromSource(IntPtr instancePtr, CSteamID steamIDSource); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendFromSourceByIndex")] public static extern ulong ISteamFriends_GetFriendFromSourceByIndex(IntPtr instancePtr, CSteamID steamIDSource, int iFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_IsUserInSource")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_IsUserInSource(IntPtr instancePtr, CSteamID steamIDUser, CSteamID steamIDSource); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_SetInGameVoiceSpeaking")] public static extern void ISteamFriends_SetInGameVoiceSpeaking(IntPtr instancePtr, CSteamID steamIDUser, [MarshalAs(UnmanagedType.I1)] bool bSpeaking); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlay")] public static extern void ISteamFriends_ActivateGameOverlay(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchDialog); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToUser")] public static extern void ISteamFriends_ActivateGameOverlayToUser(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchDialog, CSteamID steamID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage")] public static extern void ISteamFriends_ActivateGameOverlayToWebPage(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchURL, EActivateGameOverlayToWebPageMode eMode); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToStore")] public static extern void ISteamFriends_ActivateGameOverlayToStore(IntPtr instancePtr, AppId_t nAppID, EOverlayToStoreFlag eFlag); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_SetPlayedWith")] public static extern void ISteamFriends_SetPlayedWith(IntPtr instancePtr, CSteamID steamIDUserPlayedWith); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog")] public static extern void ISteamFriends_ActivateGameOverlayInviteDialog(IntPtr instancePtr, CSteamID steamIDLobby); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetSmallFriendAvatar")] public static extern int ISteamFriends_GetSmallFriendAvatar(IntPtr instancePtr, CSteamID steamIDFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetMediumFriendAvatar")] public static extern int ISteamFriends_GetMediumFriendAvatar(IntPtr instancePtr, CSteamID steamIDFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetLargeFriendAvatar")] public static extern int ISteamFriends_GetLargeFriendAvatar(IntPtr instancePtr, CSteamID steamIDFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_RequestUserInformation")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_RequestUserInformation(IntPtr instancePtr, CSteamID steamIDUser, [MarshalAs(UnmanagedType.I1)] bool bRequireNameOnly); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_RequestClanOfficerList")] public static extern ulong ISteamFriends_RequestClanOfficerList(IntPtr instancePtr, CSteamID steamIDClan); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetClanOwner")] public static extern ulong ISteamFriends_GetClanOwner(IntPtr instancePtr, CSteamID steamIDClan); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetClanOfficerCount")] public static extern int ISteamFriends_GetClanOfficerCount(IntPtr instancePtr, CSteamID steamIDClan); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetClanOfficerByIndex")] public static extern ulong ISteamFriends_GetClanOfficerByIndex(IntPtr instancePtr, CSteamID steamIDClan, int iOfficer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetUserRestrictions")] public static extern uint ISteamFriends_GetUserRestrictions(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_SetRichPresence")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_SetRichPresence(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchKey, InteropHelp.UTF8StringHandle pchValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_ClearRichPresence")] public static extern void ISteamFriends_ClearRichPresence(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendRichPresence")] public static extern IntPtr ISteamFriends_GetFriendRichPresence(IntPtr instancePtr, CSteamID steamIDFriend, InteropHelp.UTF8StringHandle pchKey); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount")] public static extern int ISteamFriends_GetFriendRichPresenceKeyCount(IntPtr instancePtr, CSteamID steamIDFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex")] public static extern IntPtr ISteamFriends_GetFriendRichPresenceKeyByIndex(IntPtr instancePtr, CSteamID steamIDFriend, int iKey); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_RequestFriendRichPresence")] public static extern void ISteamFriends_RequestFriendRichPresence(IntPtr instancePtr, CSteamID steamIDFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_InviteUserToGame")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_InviteUserToGame(IntPtr instancePtr, CSteamID steamIDFriend, InteropHelp.UTF8StringHandle pchConnectString); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetCoplayFriendCount")] public static extern int ISteamFriends_GetCoplayFriendCount(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetCoplayFriend")] public static extern ulong ISteamFriends_GetCoplayFriend(IntPtr instancePtr, int iCoplayFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendCoplayTime")] public static extern int ISteamFriends_GetFriendCoplayTime(IntPtr instancePtr, CSteamID steamIDFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendCoplayGame")] public static extern uint ISteamFriends_GetFriendCoplayGame(IntPtr instancePtr, CSteamID steamIDFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_JoinClanChatRoom")] public static extern ulong ISteamFriends_JoinClanChatRoom(IntPtr instancePtr, CSteamID steamIDClan); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_LeaveClanChatRoom")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_LeaveClanChatRoom(IntPtr instancePtr, CSteamID steamIDClan); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetClanChatMemberCount")] public static extern int ISteamFriends_GetClanChatMemberCount(IntPtr instancePtr, CSteamID steamIDClan); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetChatMemberByIndex")] public static extern ulong ISteamFriends_GetChatMemberByIndex(IntPtr instancePtr, CSteamID steamIDClan, int iUser); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_SendClanChatMessage")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_SendClanChatMessage(IntPtr instancePtr, CSteamID steamIDClanChat, InteropHelp.UTF8StringHandle pchText); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetClanChatMessage")] public static extern int ISteamFriends_GetClanChatMessage(IntPtr instancePtr, CSteamID steamIDClanChat, int iMessage, IntPtr prgchText, int cchTextMax, out EChatEntryType peChatEntryType, out CSteamID psteamidChatter); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_IsClanChatAdmin")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_IsClanChatAdmin(IntPtr instancePtr, CSteamID steamIDClanChat, CSteamID steamIDUser); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_IsClanChatWindowOpenInSteam(IntPtr instancePtr, CSteamID steamIDClanChat); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_OpenClanChatWindowInSteam")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_OpenClanChatWindowInSteam(IntPtr instancePtr, CSteamID steamIDClanChat); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_CloseClanChatWindowInSteam")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_CloseClanChatWindowInSteam(IntPtr instancePtr, CSteamID steamIDClanChat); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_SetListenForFriendsMessages")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_SetListenForFriendsMessages(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bInterceptEnabled); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_ReplyToFriendMessage")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_ReplyToFriendMessage(IntPtr instancePtr, CSteamID steamIDFriend, InteropHelp.UTF8StringHandle pchMsgToSend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFriendMessage")] public static extern int ISteamFriends_GetFriendMessage(IntPtr instancePtr, CSteamID steamIDFriend, int iMessageID, IntPtr pvData, int cubData, out EChatEntryType peChatEntryType); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetFollowerCount")] public static extern ulong ISteamFriends_GetFollowerCount(IntPtr instancePtr, CSteamID steamID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_IsFollowing")] public static extern ulong ISteamFriends_IsFollowing(IntPtr instancePtr, CSteamID steamID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_EnumerateFollowingList")] public static extern ulong ISteamFriends_EnumerateFollowingList(IntPtr instancePtr, uint unStartIndex); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_IsClanPublic")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_IsClanPublic(IntPtr instancePtr, CSteamID steamIDClan); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_IsClanOfficialGameGroup")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamFriends_IsClanOfficialGameGroup(IntPtr instancePtr, CSteamID steamIDClan); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages")] public static extern int ISteamFriends_GetNumChatsWithUnreadPriorityMessages(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayRemotePlayTogetherInviteDialog")] public static extern void ISteamFriends_ActivateGameOverlayRemotePlayTogetherInviteDialog(IntPtr instancePtr, CSteamID steamIDLobby); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetProduct")] public static extern void ISteamGameServer_SetProduct(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszProduct); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetGameDescription")] public static extern void ISteamGameServer_SetGameDescription(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszGameDescription); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetModDir")] public static extern void ISteamGameServer_SetModDir(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszModDir); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetDedicatedServer")] public static extern void ISteamGameServer_SetDedicatedServer(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bDedicated); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_LogOn")] public static extern void ISteamGameServer_LogOn(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszToken); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_LogOnAnonymous")] public static extern void ISteamGameServer_LogOnAnonymous(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_LogOff")] public static extern void ISteamGameServer_LogOff(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_BLoggedOn")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServer_BLoggedOn(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_BSecure")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServer_BSecure(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_GetSteamID")] public static extern ulong ISteamGameServer_GetSteamID(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_WasRestartRequested")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServer_WasRestartRequested(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetMaxPlayerCount")] public static extern void ISteamGameServer_SetMaxPlayerCount(IntPtr instancePtr, int cPlayersMax); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetBotPlayerCount")] public static extern void ISteamGameServer_SetBotPlayerCount(IntPtr instancePtr, int cBotplayers); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetServerName")] public static extern void ISteamGameServer_SetServerName(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszServerName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetMapName")] public static extern void ISteamGameServer_SetMapName(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszMapName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetPasswordProtected")] public static extern void ISteamGameServer_SetPasswordProtected(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bPasswordProtected); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetSpectatorPort")] public static extern void ISteamGameServer_SetSpectatorPort(IntPtr instancePtr, ushort unSpectatorPort); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetSpectatorServerName")] public static extern void ISteamGameServer_SetSpectatorServerName(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszSpectatorServerName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_ClearAllKeyValues")] public static extern void ISteamGameServer_ClearAllKeyValues(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetKeyValue")] public static extern void ISteamGameServer_SetKeyValue(IntPtr instancePtr, InteropHelp.UTF8StringHandle pKey, InteropHelp.UTF8StringHandle pValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetGameTags")] public static extern void ISteamGameServer_SetGameTags(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchGameTags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetGameData")] public static extern void ISteamGameServer_SetGameData(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchGameData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetRegion")] public static extern void ISteamGameServer_SetRegion(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszRegion); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServer_SendUserConnectAndAuthenticate(IntPtr instancePtr, uint unIPClient, byte[] pvAuthBlob, uint cubAuthBlobSize, out CSteamID pSteamIDUser); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection")] public static extern ulong ISteamGameServer_CreateUnauthenticatedUserConnection(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SendUserDisconnect")] public static extern void ISteamGameServer_SendUserDisconnect(IntPtr instancePtr, CSteamID steamIDUser); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_BUpdateUserData")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServer_BUpdateUserData(IntPtr instancePtr, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchPlayerName, uint uScore); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_GetAuthSessionTicket")] public static extern uint ISteamGameServer_GetAuthSessionTicket(IntPtr instancePtr, byte[] pTicket, int cbMaxTicket, out uint pcbTicket); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_BeginAuthSession")] public static extern EBeginAuthSessionResult ISteamGameServer_BeginAuthSession(IntPtr instancePtr, byte[] pAuthTicket, int cbAuthTicket, CSteamID steamID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_EndAuthSession")] public static extern void ISteamGameServer_EndAuthSession(IntPtr instancePtr, CSteamID steamID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_CancelAuthTicket")] public static extern void ISteamGameServer_CancelAuthTicket(IntPtr instancePtr, HAuthTicket hAuthTicket); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_UserHasLicenseForApp")] public static extern EUserHasLicenseForAppResult ISteamGameServer_UserHasLicenseForApp(IntPtr instancePtr, CSteamID steamID, AppId_t appID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_RequestUserGroupStatus")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServer_RequestUserGroupStatus(IntPtr instancePtr, CSteamID steamIDUser, CSteamID steamIDGroup); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_GetGameplayStats")] public static extern void ISteamGameServer_GetGameplayStats(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_GetServerReputation")] public static extern ulong ISteamGameServer_GetServerReputation(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_GetPublicIP")] public static extern SteamIPAddress_t ISteamGameServer_GetPublicIP(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_HandleIncomingPacket")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServer_HandleIncomingPacket(IntPtr instancePtr, byte[] pData, int cbData, uint srcIP, ushort srcPort); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_GetNextOutgoingPacket")] public static extern int ISteamGameServer_GetNextOutgoingPacket(IntPtr instancePtr, byte[] pOut, int cbMaxOut, out uint pNetAdr, out ushort pPort); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_EnableHeartbeats")] public static extern void ISteamGameServer_EnableHeartbeats(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bActive); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_SetHeartbeatInterval")] public static extern void ISteamGameServer_SetHeartbeatInterval(IntPtr instancePtr, int iHeartbeatInterval); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_ForceHeartbeat")] public static extern void ISteamGameServer_ForceHeartbeat(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_AssociateWithClan")] public static extern ulong ISteamGameServer_AssociateWithClan(IntPtr instancePtr, CSteamID steamIDClan); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility")] public static extern ulong ISteamGameServer_ComputeNewPlayerCompatibility(IntPtr instancePtr, CSteamID steamIDNewPlayer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServerStats_RequestUserStats")] public static extern ulong ISteamGameServerStats_RequestUserStats(IntPtr instancePtr, CSteamID steamIDUser); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserStatInt32")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServerStats_GetUserStatInt32(IntPtr instancePtr, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchName, out int pData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserStatFloat")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServerStats_GetUserStatFloat(IntPtr instancePtr, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchName, out float pData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserAchievement")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServerStats_GetUserAchievement(IntPtr instancePtr, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchName, out bool pbAchieved); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserStatInt32")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServerStats_SetUserStatInt32(IntPtr instancePtr, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchName, int nData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserStatFloat")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServerStats_SetUserStatFloat(IntPtr instancePtr, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchName, float fData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServerStats_UpdateUserAvgRateStat(IntPtr instancePtr, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchName, float flCountThisSession, double dSessionLength); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserAchievement")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServerStats_SetUserAchievement(IntPtr instancePtr, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServerStats_ClearUserAchievement")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamGameServerStats_ClearUserAchievement(IntPtr instancePtr, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameServerStats_StoreUserStats")] public static extern ulong ISteamGameServerStats_StoreUserStats(IntPtr instancePtr, CSteamID steamIDUser); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_Init")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTMLSurface_Init(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_Shutdown")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTMLSurface_Shutdown(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_CreateBrowser")] public static extern ulong ISteamHTMLSurface_CreateBrowser(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchUserAgent, InteropHelp.UTF8StringHandle pchUserCSS); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_RemoveBrowser")] public static extern void ISteamHTMLSurface_RemoveBrowser(IntPtr instancePtr, HHTMLBrowser unBrowserHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_LoadURL")] public static extern void ISteamHTMLSurface_LoadURL(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, InteropHelp.UTF8StringHandle pchURL, InteropHelp.UTF8StringHandle pchPostData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetSize")] public static extern void ISteamHTMLSurface_SetSize(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, uint unWidth, uint unHeight); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_StopLoad")] public static extern void ISteamHTMLSurface_StopLoad(IntPtr instancePtr, HHTMLBrowser unBrowserHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_Reload")] public static extern void ISteamHTMLSurface_Reload(IntPtr instancePtr, HHTMLBrowser unBrowserHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_GoBack")] public static extern void ISteamHTMLSurface_GoBack(IntPtr instancePtr, HHTMLBrowser unBrowserHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_GoForward")] public static extern void ISteamHTMLSurface_GoForward(IntPtr instancePtr, HHTMLBrowser unBrowserHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_AddHeader")] public static extern void ISteamHTMLSurface_AddHeader(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, InteropHelp.UTF8StringHandle pchKey, InteropHelp.UTF8StringHandle pchValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_ExecuteJavascript")] public static extern void ISteamHTMLSurface_ExecuteJavascript(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, InteropHelp.UTF8StringHandle pchScript); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseUp")] public static extern void ISteamHTMLSurface_MouseUp(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseDown")] public static extern void ISteamHTMLSurface_MouseDown(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseDoubleClick")] public static extern void ISteamHTMLSurface_MouseDoubleClick(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseMove")] public static extern void ISteamHTMLSurface_MouseMove(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, int x, int y); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseWheel")] public static extern void ISteamHTMLSurface_MouseWheel(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, int nDelta); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyDown")] public static extern void ISteamHTMLSurface_KeyDown(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, uint nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers, [MarshalAs(UnmanagedType.I1)] bool bIsSystemKey); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyUp")] public static extern void ISteamHTMLSurface_KeyUp(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, uint nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyChar")] public static extern void ISteamHTMLSurface_KeyChar(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, uint cUnicodeChar, EHTMLKeyModifiers eHTMLKeyModifiers); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetHorizontalScroll")] public static extern void ISteamHTMLSurface_SetHorizontalScroll(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, uint nAbsolutePixelScroll); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetVerticalScroll")] public static extern void ISteamHTMLSurface_SetVerticalScroll(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, uint nAbsolutePixelScroll); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetKeyFocus")] public static extern void ISteamHTMLSurface_SetKeyFocus(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, [MarshalAs(UnmanagedType.I1)] bool bHasKeyFocus); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_ViewSource")] public static extern void ISteamHTMLSurface_ViewSource(IntPtr instancePtr, HHTMLBrowser unBrowserHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_CopyToClipboard")] public static extern void ISteamHTMLSurface_CopyToClipboard(IntPtr instancePtr, HHTMLBrowser unBrowserHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_PasteFromClipboard")] public static extern void ISteamHTMLSurface_PasteFromClipboard(IntPtr instancePtr, HHTMLBrowser unBrowserHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_Find")] public static extern void ISteamHTMLSurface_Find(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, InteropHelp.UTF8StringHandle pchSearchStr, [MarshalAs(UnmanagedType.I1)] bool bCurrentlyInFind, [MarshalAs(UnmanagedType.I1)] bool bReverse); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_StopFind")] public static extern void ISteamHTMLSurface_StopFind(IntPtr instancePtr, HHTMLBrowser unBrowserHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_GetLinkAtPosition")] public static extern void ISteamHTMLSurface_GetLinkAtPosition(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, int x, int y); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetCookie")] public static extern void ISteamHTMLSurface_SetCookie(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchHostname, InteropHelp.UTF8StringHandle pchKey, InteropHelp.UTF8StringHandle pchValue, InteropHelp.UTF8StringHandle pchPath, uint nExpires, [MarshalAs(UnmanagedType.I1)] bool bSecure, [MarshalAs(UnmanagedType.I1)] bool bHTTPOnly); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetPageScaleFactor")] public static extern void ISteamHTMLSurface_SetPageScaleFactor(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetBackgroundMode")] public static extern void ISteamHTMLSurface_SetBackgroundMode(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, [MarshalAs(UnmanagedType.I1)] bool bBackgroundMode); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor")] public static extern void ISteamHTMLSurface_SetDPIScalingFactor(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, float flDPIScaling); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_OpenDeveloperTools")] public static extern void ISteamHTMLSurface_OpenDeveloperTools(IntPtr instancePtr, HHTMLBrowser unBrowserHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_AllowStartRequest")] public static extern void ISteamHTMLSurface_AllowStartRequest(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, [MarshalAs(UnmanagedType.I1)] bool bAllowed); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_JSDialogResponse")] public static extern void ISteamHTMLSurface_JSDialogResponse(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, [MarshalAs(UnmanagedType.I1)] bool bResult); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTMLSurface_FileLoadDialogResponse")] public static extern void ISteamHTMLSurface_FileLoadDialogResponse(IntPtr instancePtr, HHTMLBrowser unBrowserHandle, IntPtr pchSelectedFiles); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_CreateHTTPRequest")] public static extern uint ISteamHTTP_CreateHTTPRequest(IntPtr instancePtr, EHTTPMethod eHTTPRequestMethod, InteropHelp.UTF8StringHandle pchAbsoluteURL); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestContextValue")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_SetHTTPRequestContextValue(IntPtr instancePtr, HTTPRequestHandle hRequest, ulong ulContextValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(IntPtr instancePtr, HTTPRequestHandle hRequest, uint unTimeoutSeconds); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_SetHTTPRequestHeaderValue(IntPtr instancePtr, HTTPRequestHandle hRequest, InteropHelp.UTF8StringHandle pchHeaderName, InteropHelp.UTF8StringHandle pchHeaderValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_SetHTTPRequestGetOrPostParameter(IntPtr instancePtr, HTTPRequestHandle hRequest, InteropHelp.UTF8StringHandle pchParamName, InteropHelp.UTF8StringHandle pchParamValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_SendHTTPRequest")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_SendHTTPRequest(IntPtr instancePtr, HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_SendHTTPRequestAndStreamResponse(IntPtr instancePtr, HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_DeferHTTPRequest")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_DeferHTTPRequest(IntPtr instancePtr, HTTPRequestHandle hRequest); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_PrioritizeHTTPRequest")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_PrioritizeHTTPRequest(IntPtr instancePtr, HTTPRequestHandle hRequest); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_GetHTTPResponseHeaderSize(IntPtr instancePtr, HTTPRequestHandle hRequest, InteropHelp.UTF8StringHandle pchHeaderName, out uint unResponseHeaderSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_GetHTTPResponseHeaderValue(IntPtr instancePtr, HTTPRequestHandle hRequest, InteropHelp.UTF8StringHandle pchHeaderName, byte[] pHeaderValueBuffer, uint unBufferSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseBodySize")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_GetHTTPResponseBodySize(IntPtr instancePtr, HTTPRequestHandle hRequest, out uint unBodySize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseBodyData")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_GetHTTPResponseBodyData(IntPtr instancePtr, HTTPRequestHandle hRequest, byte[] pBodyDataBuffer, uint unBufferSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_GetHTTPStreamingResponseBodyData(IntPtr instancePtr, HTTPRequestHandle hRequest, uint cOffset, byte[] pBodyDataBuffer, uint unBufferSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_ReleaseHTTPRequest")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_ReleaseHTTPRequest(IntPtr instancePtr, HTTPRequestHandle hRequest); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_GetHTTPDownloadProgressPct(IntPtr instancePtr, HTTPRequestHandle hRequest, out float pflPercentOut); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_SetHTTPRequestRawPostBody(IntPtr instancePtr, HTTPRequestHandle hRequest, InteropHelp.UTF8StringHandle pchContentType, byte[] pubBody, uint unBodyLen); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_CreateCookieContainer")] public static extern uint ISteamHTTP_CreateCookieContainer(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bAllowResponsesToModify); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_ReleaseCookieContainer")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_ReleaseCookieContainer(IntPtr instancePtr, HTTPCookieContainerHandle hCookieContainer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_SetCookie")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_SetCookie(IntPtr instancePtr, HTTPCookieContainerHandle hCookieContainer, InteropHelp.UTF8StringHandle pchHost, InteropHelp.UTF8StringHandle pchUrl, InteropHelp.UTF8StringHandle pchCookie); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_SetHTTPRequestCookieContainer(IntPtr instancePtr, HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_SetHTTPRequestUserAgentInfo(IntPtr instancePtr, HTTPRequestHandle hRequest, InteropHelp.UTF8StringHandle pchUserAgentInfo); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(IntPtr instancePtr, HTTPRequestHandle hRequest, [MarshalAs(UnmanagedType.I1)] bool bRequireVerifiedCertificate); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(IntPtr instancePtr, HTTPRequestHandle hRequest, uint unMilliseconds); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamHTTP_GetHTTPRequestWasTimedOut(IntPtr instancePtr, HTTPRequestHandle hRequest, out bool pbWasTimedOut); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_Init")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInput_Init(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_Shutdown")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInput_Shutdown(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_RunFrame")] public static extern void ISteamInput_RunFrame(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetConnectedControllers")] public static extern int ISteamInput_GetConnectedControllers(IntPtr instancePtr, [In][Out] InputHandle_t[] handlesOut); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetActionSetHandle")] public static extern ulong ISteamInput_GetActionSetHandle(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszActionSetName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_ActivateActionSet")] public static extern void ISteamInput_ActivateActionSet(IntPtr instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetCurrentActionSet")] public static extern ulong ISteamInput_GetCurrentActionSet(IntPtr instancePtr, InputHandle_t inputHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_ActivateActionSetLayer")] public static extern void ISteamInput_ActivateActionSetLayer(IntPtr instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_DeactivateActionSetLayer")] public static extern void ISteamInput_DeactivateActionSetLayer(IntPtr instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_DeactivateAllActionSetLayers")] public static extern void ISteamInput_DeactivateAllActionSetLayers(IntPtr instancePtr, InputHandle_t inputHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetActiveActionSetLayers")] public static extern int ISteamInput_GetActiveActionSetLayers(IntPtr instancePtr, InputHandle_t inputHandle, [In][Out] InputActionSetHandle_t[] handlesOut); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionHandle")] public static extern ulong ISteamInput_GetDigitalActionHandle(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszActionName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionData")] public static extern InputDigitalActionData_t ISteamInput_GetDigitalActionData(IntPtr instancePtr, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionOrigins")] public static extern int ISteamInput_GetDigitalActionOrigins(IntPtr instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, [In][Out] EInputActionOrigin[] originsOut); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionHandle")] public static extern ulong ISteamInput_GetAnalogActionHandle(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszActionName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionData")] public static extern InputAnalogActionData_t ISteamInput_GetAnalogActionData(IntPtr instancePtr, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionOrigins")] public static extern int ISteamInput_GetAnalogActionOrigins(IntPtr instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, [In][Out] EInputActionOrigin[] originsOut); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetGlyphForActionOrigin")] public static extern IntPtr ISteamInput_GetGlyphForActionOrigin(IntPtr instancePtr, EInputActionOrigin eOrigin); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetStringForActionOrigin")] public static extern IntPtr ISteamInput_GetStringForActionOrigin(IntPtr instancePtr, EInputActionOrigin eOrigin); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_StopAnalogActionMomentum")] public static extern void ISteamInput_StopAnalogActionMomentum(IntPtr instancePtr, InputHandle_t inputHandle, InputAnalogActionHandle_t eAction); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetMotionData")] public static extern InputMotionData_t ISteamInput_GetMotionData(IntPtr instancePtr, InputHandle_t inputHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_TriggerVibration")] public static extern void ISteamInput_TriggerVibration(IntPtr instancePtr, InputHandle_t inputHandle, ushort usLeftSpeed, ushort usRightSpeed); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_SetLEDColor")] public static extern void ISteamInput_SetLEDColor(IntPtr instancePtr, InputHandle_t inputHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_TriggerHapticPulse")] public static extern void ISteamInput_TriggerHapticPulse(IntPtr instancePtr, InputHandle_t inputHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_TriggerRepeatedHapticPulse")] public static extern void ISteamInput_TriggerRepeatedHapticPulse(IntPtr instancePtr, InputHandle_t inputHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_ShowBindingPanel")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInput_ShowBindingPanel(IntPtr instancePtr, InputHandle_t inputHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetInputTypeForHandle")] public static extern ESteamInputType ISteamInput_GetInputTypeForHandle(IntPtr instancePtr, InputHandle_t inputHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetControllerForGamepadIndex")] public static extern ulong ISteamInput_GetControllerForGamepadIndex(IntPtr instancePtr, int nIndex); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetGamepadIndexForController")] public static extern int ISteamInput_GetGamepadIndexForController(IntPtr instancePtr, InputHandle_t ulinputHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetStringForXboxOrigin")] public static extern IntPtr ISteamInput_GetStringForXboxOrigin(IntPtr instancePtr, EXboxOrigin eOrigin); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetGlyphForXboxOrigin")] public static extern IntPtr ISteamInput_GetGlyphForXboxOrigin(IntPtr instancePtr, EXboxOrigin eOrigin); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin")] public static extern EInputActionOrigin ISteamInput_GetActionOriginFromXboxOrigin(IntPtr instancePtr, InputHandle_t inputHandle, EXboxOrigin eOrigin); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_TranslateActionOrigin")] public static extern EInputActionOrigin ISteamInput_TranslateActionOrigin(IntPtr instancePtr, ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetDeviceBindingRevision")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInput_GetDeviceBindingRevision(IntPtr instancePtr, InputHandle_t inputHandle, out int pMajor, out int pMinor); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInput_GetRemotePlaySessionID")] public static extern uint ISteamInput_GetRemotePlaySessionID(IntPtr instancePtr, InputHandle_t inputHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GetResultStatus")] public static extern EResult ISteamInventory_GetResultStatus(IntPtr instancePtr, SteamInventoryResult_t resultHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GetResultItems")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_GetResultItems(IntPtr instancePtr, SteamInventoryResult_t resultHandle, [In][Out] SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GetResultItemProperty")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_GetResultItemProperty(IntPtr instancePtr, SteamInventoryResult_t resultHandle, uint unItemIndex, InteropHelp.UTF8StringHandle pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GetResultTimestamp")] public static extern uint ISteamInventory_GetResultTimestamp(IntPtr instancePtr, SteamInventoryResult_t resultHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_CheckResultSteamID")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_CheckResultSteamID(IntPtr instancePtr, SteamInventoryResult_t resultHandle, CSteamID steamIDExpected); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_DestroyResult")] public static extern void ISteamInventory_DestroyResult(IntPtr instancePtr, SteamInventoryResult_t resultHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GetAllItems")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_GetAllItems(IntPtr instancePtr, out SteamInventoryResult_t pResultHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GetItemsByID")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_GetItemsByID(IntPtr instancePtr, out SteamInventoryResult_t pResultHandle, [In][Out] SteamItemInstanceID_t[] pInstanceIDs, uint unCountInstanceIDs); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_SerializeResult")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_SerializeResult(IntPtr instancePtr, SteamInventoryResult_t resultHandle, byte[] pOutBuffer, out uint punOutBufferSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_DeserializeResult")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_DeserializeResult(IntPtr instancePtr, out SteamInventoryResult_t pOutResultHandle, byte[] pBuffer, uint unBufferSize, [MarshalAs(UnmanagedType.I1)] bool bRESERVED_MUST_BE_FALSE); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GenerateItems")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_GenerateItems(IntPtr instancePtr, out SteamInventoryResult_t pResultHandle, [In][Out] SteamItemDef_t[] pArrayItemDefs, [In][Out] uint[] punArrayQuantity, uint unArrayLength); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GrantPromoItems")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_GrantPromoItems(IntPtr instancePtr, out SteamInventoryResult_t pResultHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_AddPromoItem")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_AddPromoItem(IntPtr instancePtr, out SteamInventoryResult_t pResultHandle, SteamItemDef_t itemDef); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_AddPromoItems")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_AddPromoItems(IntPtr instancePtr, out SteamInventoryResult_t pResultHandle, [In][Out] SteamItemDef_t[] pArrayItemDefs, uint unArrayLength); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_ConsumeItem")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_ConsumeItem(IntPtr instancePtr, out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemConsume, uint unQuantity); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_ExchangeItems")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_ExchangeItems(IntPtr instancePtr, out SteamInventoryResult_t pResultHandle, [In][Out] SteamItemDef_t[] pArrayGenerate, [In][Out] uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, [In][Out] SteamItemInstanceID_t[] pArrayDestroy, [In][Out] uint[] punArrayDestroyQuantity, uint unArrayDestroyLength); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_TransferItemQuantity")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_TransferItemQuantity(IntPtr instancePtr, out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemIdSource, uint unQuantity, SteamItemInstanceID_t itemIdDest); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_SendItemDropHeartbeat")] public static extern void ISteamInventory_SendItemDropHeartbeat(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_TriggerItemDrop")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_TriggerItemDrop(IntPtr instancePtr, out SteamInventoryResult_t pResultHandle, SteamItemDef_t dropListDefinition); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_TradeItems")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_TradeItems(IntPtr instancePtr, out SteamInventoryResult_t pResultHandle, CSteamID steamIDTradePartner, [In][Out] SteamItemInstanceID_t[] pArrayGive, [In][Out] uint[] pArrayGiveQuantity, uint nArrayGiveLength, [In][Out] SteamItemInstanceID_t[] pArrayGet, [In][Out] uint[] pArrayGetQuantity, uint nArrayGetLength); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_LoadItemDefinitions")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_LoadItemDefinitions(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GetItemDefinitionIDs")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_GetItemDefinitionIDs(IntPtr instancePtr, [In][Out] SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GetItemDefinitionProperty")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_GetItemDefinitionProperty(IntPtr instancePtr, SteamItemDef_t iDefinition, InteropHelp.UTF8StringHandle pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs")] public static extern ulong ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(IntPtr instancePtr, CSteamID steamID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_GetEligiblePromoItemDefinitionIDs(IntPtr instancePtr, CSteamID steamID, [In][Out] SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_StartPurchase")] public static extern ulong ISteamInventory_StartPurchase(IntPtr instancePtr, [In][Out] SteamItemDef_t[] pArrayItemDefs, [In][Out] uint[] punArrayQuantity, uint unArrayLength); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_RequestPrices")] public static extern ulong ISteamInventory_RequestPrices(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GetNumItemsWithPrices")] public static extern uint ISteamInventory_GetNumItemsWithPrices(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GetItemsWithPrices")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_GetItemsWithPrices(IntPtr instancePtr, [In][Out] SteamItemDef_t[] pArrayItemDefs, [In][Out] ulong[] pCurrentPrices, [In][Out] ulong[] pBasePrices, uint unArrayLength); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_GetItemPrice")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_GetItemPrice(IntPtr instancePtr, SteamItemDef_t iDefinition, out ulong pCurrentPrice, out ulong pBasePrice); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_StartUpdateProperties")] public static extern ulong ISteamInventory_StartUpdateProperties(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_RemoveProperty")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_RemoveProperty(IntPtr instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, InteropHelp.UTF8StringHandle pchPropertyName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_SetPropertyString")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_SetPropertyString(IntPtr instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, InteropHelp.UTF8StringHandle pchPropertyName, InteropHelp.UTF8StringHandle pchPropertyValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_SetPropertyBool")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_SetPropertyBool(IntPtr instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, InteropHelp.UTF8StringHandle pchPropertyName, [MarshalAs(UnmanagedType.I1)] bool bValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_SetPropertyInt64")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_SetPropertyInt64(IntPtr instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, InteropHelp.UTF8StringHandle pchPropertyName, long nValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_SetPropertyFloat")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_SetPropertyFloat(IntPtr instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, InteropHelp.UTF8StringHandle pchPropertyName, float flValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamInventory_SubmitUpdateProperties")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamInventory_SubmitUpdateProperties(IntPtr instancePtr, SteamInventoryUpdateHandle_t handle, out SteamInventoryResult_t pResultHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGameCount")] public static extern int ISteamMatchmaking_GetFavoriteGameCount(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGame")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_GetFavoriteGame(IntPtr instancePtr, int iGame, out AppId_t pnAppID, out uint pnIP, out ushort pnConnPort, out ushort pnQueryPort, out uint punFlags, out uint pRTime32LastPlayedOnServer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_AddFavoriteGame")] public static extern int ISteamMatchmaking_AddFavoriteGame(IntPtr instancePtr, AppId_t nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_RemoveFavoriteGame")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_RemoveFavoriteGame(IntPtr instancePtr, AppId_t nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_RequestLobbyList")] public static extern ulong ISteamMatchmaking_RequestLobbyList(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter")] public static extern void ISteamMatchmaking_AddRequestLobbyListStringFilter(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchKeyToMatch, InteropHelp.UTF8StringHandle pchValueToMatch, ELobbyComparison eComparisonType); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter")] public static extern void ISteamMatchmaking_AddRequestLobbyListNumericalFilter(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchKeyToMatch, int nValueToMatch, ELobbyComparison eComparisonType); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter")] public static extern void ISteamMatchmaking_AddRequestLobbyListNearValueFilter(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchKeyToMatch, int nValueToBeCloseTo); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable")] public static extern void ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(IntPtr instancePtr, int nSlotsAvailable); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter")] public static extern void ISteamMatchmaking_AddRequestLobbyListDistanceFilter(IntPtr instancePtr, ELobbyDistanceFilter eLobbyDistanceFilter); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter")] public static extern void ISteamMatchmaking_AddRequestLobbyListResultCountFilter(IntPtr instancePtr, int cMaxResults); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter")] public static extern void ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(IntPtr instancePtr, CSteamID steamIDLobby); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyByIndex")] public static extern ulong ISteamMatchmaking_GetLobbyByIndex(IntPtr instancePtr, int iLobby); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_CreateLobby")] public static extern ulong ISteamMatchmaking_CreateLobby(IntPtr instancePtr, ELobbyType eLobbyType, int cMaxMembers); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_JoinLobby")] public static extern ulong ISteamMatchmaking_JoinLobby(IntPtr instancePtr, CSteamID steamIDLobby); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_LeaveLobby")] public static extern void ISteamMatchmaking_LeaveLobby(IntPtr instancePtr, CSteamID steamIDLobby); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_InviteUserToLobby")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_InviteUserToLobby(IntPtr instancePtr, CSteamID steamIDLobby, CSteamID steamIDInvitee); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_GetNumLobbyMembers")] public static extern int ISteamMatchmaking_GetNumLobbyMembers(IntPtr instancePtr, CSteamID steamIDLobby); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex")] public static extern ulong ISteamMatchmaking_GetLobbyMemberByIndex(IntPtr instancePtr, CSteamID steamIDLobby, int iMember); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyData")] public static extern IntPtr ISteamMatchmaking_GetLobbyData(IntPtr instancePtr, CSteamID steamIDLobby, InteropHelp.UTF8StringHandle pchKey); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyData")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_SetLobbyData(IntPtr instancePtr, CSteamID steamIDLobby, InteropHelp.UTF8StringHandle pchKey, InteropHelp.UTF8StringHandle pchValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyDataCount")] public static extern int ISteamMatchmaking_GetLobbyDataCount(IntPtr instancePtr, CSteamID steamIDLobby); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_GetLobbyDataByIndex(IntPtr instancePtr, CSteamID steamIDLobby, int iLobbyData, IntPtr pchKey, int cchKeyBufferSize, IntPtr pchValue, int cchValueBufferSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_DeleteLobbyData")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_DeleteLobbyData(IntPtr instancePtr, CSteamID steamIDLobby, InteropHelp.UTF8StringHandle pchKey); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberData")] public static extern IntPtr ISteamMatchmaking_GetLobbyMemberData(IntPtr instancePtr, CSteamID steamIDLobby, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchKey); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyMemberData")] public static extern void ISteamMatchmaking_SetLobbyMemberData(IntPtr instancePtr, CSteamID steamIDLobby, InteropHelp.UTF8StringHandle pchKey, InteropHelp.UTF8StringHandle pchValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_SendLobbyChatMsg")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_SendLobbyChatMsg(IntPtr instancePtr, CSteamID steamIDLobby, byte[] pvMsgBody, int cubMsgBody); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyChatEntry")] public static extern int ISteamMatchmaking_GetLobbyChatEntry(IntPtr instancePtr, CSteamID steamIDLobby, int iChatID, out CSteamID pSteamIDUser, byte[] pvData, int cubData, out EChatEntryType peChatEntryType); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_RequestLobbyData")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_RequestLobbyData(IntPtr instancePtr, CSteamID steamIDLobby); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyGameServer")] public static extern void ISteamMatchmaking_SetLobbyGameServer(IntPtr instancePtr, CSteamID steamIDLobby, uint unGameServerIP, ushort unGameServerPort, CSteamID steamIDGameServer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyGameServer")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_GetLobbyGameServer(IntPtr instancePtr, CSteamID steamIDLobby, out uint punGameServerIP, out ushort punGameServerPort, out CSteamID psteamIDGameServer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_SetLobbyMemberLimit(IntPtr instancePtr, CSteamID steamIDLobby, int cMaxMembers); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit")] public static extern int ISteamMatchmaking_GetLobbyMemberLimit(IntPtr instancePtr, CSteamID steamIDLobby); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyType")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_SetLobbyType(IntPtr instancePtr, CSteamID steamIDLobby, ELobbyType eLobbyType); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyJoinable")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_SetLobbyJoinable(IntPtr instancePtr, CSteamID steamIDLobby, [MarshalAs(UnmanagedType.I1)] bool bLobbyJoinable); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyOwner")] public static extern ulong ISteamMatchmaking_GetLobbyOwner(IntPtr instancePtr, CSteamID steamIDLobby); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyOwner")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_SetLobbyOwner(IntPtr instancePtr, CSteamID steamIDLobby, CSteamID steamIDNewOwner); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLinkedLobby")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmaking_SetLinkedLobby(IntPtr instancePtr, CSteamID steamIDLobby, CSteamID steamIDLobbyDependent); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestInternetServerList")] public static extern IntPtr ISteamMatchmakingServers_RequestInternetServerList(IntPtr instancePtr, AppId_t iApp, IntPtr ppchFilters, uint nFilters, IntPtr pRequestServersResponse); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestLANServerList")] public static extern IntPtr ISteamMatchmakingServers_RequestLANServerList(IntPtr instancePtr, AppId_t iApp, IntPtr pRequestServersResponse); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList")] public static extern IntPtr ISteamMatchmakingServers_RequestFriendsServerList(IntPtr instancePtr, AppId_t iApp, IntPtr ppchFilters, uint nFilters, IntPtr pRequestServersResponse); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList")] public static extern IntPtr ISteamMatchmakingServers_RequestFavoritesServerList(IntPtr instancePtr, AppId_t iApp, IntPtr ppchFilters, uint nFilters, IntPtr pRequestServersResponse); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList")] public static extern IntPtr ISteamMatchmakingServers_RequestHistoryServerList(IntPtr instancePtr, AppId_t iApp, IntPtr ppchFilters, uint nFilters, IntPtr pRequestServersResponse); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList")] public static extern IntPtr ISteamMatchmakingServers_RequestSpectatorServerList(IntPtr instancePtr, AppId_t iApp, IntPtr ppchFilters, uint nFilters, IntPtr pRequestServersResponse); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_ReleaseRequest")] public static extern void ISteamMatchmakingServers_ReleaseRequest(IntPtr instancePtr, HServerListRequest hServerListRequest); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_GetServerDetails")] public static extern IntPtr ISteamMatchmakingServers_GetServerDetails(IntPtr instancePtr, HServerListRequest hRequest, int iServer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_CancelQuery")] public static extern void ISteamMatchmakingServers_CancelQuery(IntPtr instancePtr, HServerListRequest hRequest); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RefreshQuery")] public static extern void ISteamMatchmakingServers_RefreshQuery(IntPtr instancePtr, HServerListRequest hRequest); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_IsRefreshing")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMatchmakingServers_IsRefreshing(IntPtr instancePtr, HServerListRequest hRequest); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_GetServerCount")] public static extern int ISteamMatchmakingServers_GetServerCount(IntPtr instancePtr, HServerListRequest hRequest); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RefreshServer")] public static extern void ISteamMatchmakingServers_RefreshServer(IntPtr instancePtr, HServerListRequest hRequest, int iServer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_PingServer")] public static extern int ISteamMatchmakingServers_PingServer(IntPtr instancePtr, uint unIP, ushort usPort, IntPtr pRequestServersResponse); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_PlayerDetails")] public static extern int ISteamMatchmakingServers_PlayerDetails(IntPtr instancePtr, uint unIP, ushort usPort, IntPtr pRequestServersResponse); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_ServerRules")] public static extern int ISteamMatchmakingServers_ServerRules(IntPtr instancePtr, uint unIP, ushort usPort, IntPtr pRequestServersResponse); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMatchmakingServers_CancelServerQuery")] public static extern void ISteamMatchmakingServers_CancelServerQuery(IntPtr instancePtr, HServerQuery hServerQuery); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_AddGameSearchParams")] public static extern EGameSearchErrorCode_t ISteamGameSearch_AddGameSearchParams(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchKeyToFind, InteropHelp.UTF8StringHandle pchValuesToFind); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_SearchForGameWithLobby")] public static extern EGameSearchErrorCode_t ISteamGameSearch_SearchForGameWithLobby(IntPtr instancePtr, CSteamID steamIDLobby, int nPlayerMin, int nPlayerMax); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_SearchForGameSolo")] public static extern EGameSearchErrorCode_t ISteamGameSearch_SearchForGameSolo(IntPtr instancePtr, int nPlayerMin, int nPlayerMax); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_AcceptGame")] public static extern EGameSearchErrorCode_t ISteamGameSearch_AcceptGame(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_DeclineGame")] public static extern EGameSearchErrorCode_t ISteamGameSearch_DeclineGame(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_RetrieveConnectionDetails")] public static extern EGameSearchErrorCode_t ISteamGameSearch_RetrieveConnectionDetails(IntPtr instancePtr, CSteamID steamIDHost, IntPtr pchConnectionDetails, int cubConnectionDetails); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_EndGameSearch")] public static extern EGameSearchErrorCode_t ISteamGameSearch_EndGameSearch(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_SetGameHostParams")] public static extern EGameSearchErrorCode_t ISteamGameSearch_SetGameHostParams(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchKey, InteropHelp.UTF8StringHandle pchValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_SetConnectionDetails")] public static extern EGameSearchErrorCode_t ISteamGameSearch_SetConnectionDetails(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchConnectionDetails, int cubConnectionDetails); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_RequestPlayersForGame")] public static extern EGameSearchErrorCode_t ISteamGameSearch_RequestPlayersForGame(IntPtr instancePtr, int nPlayerMin, int nPlayerMax, int nMaxTeamSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_HostConfirmGameStart")] public static extern EGameSearchErrorCode_t ISteamGameSearch_HostConfirmGameStart(IntPtr instancePtr, ulong ullUniqueGameID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_CancelRequestPlayersForGame")] public static extern EGameSearchErrorCode_t ISteamGameSearch_CancelRequestPlayersForGame(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_SubmitPlayerResult")] public static extern EGameSearchErrorCode_t ISteamGameSearch_SubmitPlayerResult(IntPtr instancePtr, ulong ullUniqueGameID, CSteamID steamIDPlayer, EPlayerResult_t EPlayerResult); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamGameSearch_EndGame")] public static extern EGameSearchErrorCode_t ISteamGameSearch_EndGame(IntPtr instancePtr, ulong ullUniqueGameID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParties_GetNumActiveBeacons")] public static extern uint ISteamParties_GetNumActiveBeacons(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParties_GetBeaconByIndex")] public static extern ulong ISteamParties_GetBeaconByIndex(IntPtr instancePtr, uint unIndex); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParties_GetBeaconDetails")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetBeaconDetails(IntPtr instancePtr, PartyBeaconID_t ulBeaconID, out CSteamID pSteamIDBeaconOwner, out SteamPartyBeaconLocation_t pLocation, IntPtr pchMetadata, int cchMetadata); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParties_JoinParty")] public static extern ulong ISteamParties_JoinParty(IntPtr instancePtr, PartyBeaconID_t ulBeaconID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParties_GetNumAvailableBeaconLocations")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetNumAvailableBeaconLocations(IntPtr instancePtr, out uint puNumLocations); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParties_GetAvailableBeaconLocations")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetAvailableBeaconLocations(IntPtr instancePtr, [In][Out] SteamPartyBeaconLocation_t[] pLocationList, uint uMaxNumLocations); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParties_CreateBeacon")] public static extern ulong ISteamParties_CreateBeacon(IntPtr instancePtr, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, InteropHelp.UTF8StringHandle pchConnectString, InteropHelp.UTF8StringHandle pchMetadata); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParties_OnReservationCompleted")] public static extern void ISteamParties_OnReservationCompleted(IntPtr instancePtr, PartyBeaconID_t ulBeacon, CSteamID steamIDUser); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParties_CancelReservation")] public static extern void ISteamParties_CancelReservation(IntPtr instancePtr, PartyBeaconID_t ulBeacon, CSteamID steamIDUser); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParties_ChangeNumOpenSlots")] public static extern ulong ISteamParties_ChangeNumOpenSlots(IntPtr instancePtr, PartyBeaconID_t ulBeacon, uint unOpenSlots); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParties_DestroyBeacon")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_DestroyBeacon(IntPtr instancePtr, PartyBeaconID_t ulBeacon); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParties_GetBeaconLocationData")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParties_GetBeaconLocationData(IntPtr instancePtr, SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusic_BIsEnabled")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusic_BIsEnabled(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusic_BIsPlaying")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusic_BIsPlaying(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusic_GetPlaybackStatus")] public static extern AudioPlayback_Status ISteamMusic_GetPlaybackStatus(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusic_Play")] public static extern void ISteamMusic_Play(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusic_Pause")] public static extern void ISteamMusic_Pause(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusic_PlayPrevious")] public static extern void ISteamMusic_PlayPrevious(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusic_PlayNext")] public static extern void ISteamMusic_PlayNext(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusic_SetVolume")] public static extern void ISteamMusic_SetVolume(IntPtr instancePtr, float flVolume); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusic_GetVolume")] public static extern float ISteamMusic_GetVolume(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_RegisterSteamMusicRemote(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_DeregisterSteamMusicRemote(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_BIsCurrentMusicRemote(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_BActivationSuccess")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_BActivationSuccess(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_SetDisplayName")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_SetDisplayName(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchDisplayName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_SetPNGIcon_64x64(IntPtr instancePtr, byte[] pvBuffer, uint cbBufferLength); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_EnablePlayPrevious")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_EnablePlayPrevious(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_EnablePlayNext")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_EnablePlayNext(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_EnableShuffled")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_EnableShuffled(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_EnableLooped")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_EnableLooped(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_EnableQueue")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_EnableQueue(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_EnablePlaylists")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_EnablePlaylists(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_UpdatePlaybackStatus(IntPtr instancePtr, AudioPlayback_Status nStatus); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateShuffled")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_UpdateShuffled(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateLooped")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_UpdateLooped(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateVolume")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_UpdateVolume(IntPtr instancePtr, float flValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_CurrentEntryWillChange")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_CurrentEntryWillChange(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_CurrentEntryIsAvailable(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bAvailable); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_UpdateCurrentEntryText(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchText); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds(IntPtr instancePtr, int nValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_UpdateCurrentEntryCoverArt(IntPtr instancePtr, byte[] pvBuffer, uint cbBufferLength); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_CurrentEntryDidChange")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_CurrentEntryDidChange(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_QueueWillChange")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_QueueWillChange(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_ResetQueueEntries")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_ResetQueueEntries(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_SetQueueEntry")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_SetQueueEntry(IntPtr instancePtr, int nID, int nPosition, InteropHelp.UTF8StringHandle pchEntryText); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_SetCurrentQueueEntry(IntPtr instancePtr, int nID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_QueueDidChange")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_QueueDidChange(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_PlaylistWillChange")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_PlaylistWillChange(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_ResetPlaylistEntries")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_ResetPlaylistEntries(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_SetPlaylistEntry")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_SetPlaylistEntry(IntPtr instancePtr, int nID, int nPosition, InteropHelp.UTF8StringHandle pchEntryText); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_SetCurrentPlaylistEntry(IntPtr instancePtr, int nID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamMusicRemote_PlaylistDidChange")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamMusicRemote_PlaylistDidChange(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_SendP2PPacket")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_SendP2PPacket(IntPtr instancePtr, CSteamID steamIDRemote, byte[] pubData, uint cubData, EP2PSend eP2PSendType, int nChannel); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_IsP2PPacketAvailable")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_IsP2PPacketAvailable(IntPtr instancePtr, out uint pcubMsgSize, int nChannel); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_ReadP2PPacket")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_ReadP2PPacket(IntPtr instancePtr, byte[] pubDest, uint cubDest, out uint pcubMsgSize, out CSteamID psteamIDRemote, int nChannel); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_AcceptP2PSessionWithUser(IntPtr instancePtr, CSteamID steamIDRemote); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_CloseP2PSessionWithUser")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_CloseP2PSessionWithUser(IntPtr instancePtr, CSteamID steamIDRemote); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_CloseP2PChannelWithUser")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_CloseP2PChannelWithUser(IntPtr instancePtr, CSteamID steamIDRemote, int nChannel); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_GetP2PSessionState")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_GetP2PSessionState(IntPtr instancePtr, CSteamID steamIDRemote, out P2PSessionState_t pConnectionState); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_AllowP2PPacketRelay")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_AllowP2PPacketRelay(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bAllow); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_CreateListenSocket")] public static extern uint ISteamNetworking_CreateListenSocket(IntPtr instancePtr, int nVirtualP2PPort, SteamIPAddress_t nIP, ushort nPort, [MarshalAs(UnmanagedType.I1)] bool bAllowUseOfPacketRelay); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_CreateP2PConnectionSocket")] public static extern uint ISteamNetworking_CreateP2PConnectionSocket(IntPtr instancePtr, CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, [MarshalAs(UnmanagedType.I1)] bool bAllowUseOfPacketRelay); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_CreateConnectionSocket")] public static extern uint ISteamNetworking_CreateConnectionSocket(IntPtr instancePtr, SteamIPAddress_t nIP, ushort nPort, int nTimeoutSec); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_DestroySocket")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_DestroySocket(IntPtr instancePtr, SNetSocket_t hSocket, [MarshalAs(UnmanagedType.I1)] bool bNotifyRemoteEnd); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_DestroyListenSocket")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_DestroyListenSocket(IntPtr instancePtr, SNetListenSocket_t hSocket, [MarshalAs(UnmanagedType.I1)] bool bNotifyRemoteEnd); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_SendDataOnSocket")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_SendDataOnSocket(IntPtr instancePtr, SNetSocket_t hSocket, byte[] pubData, uint cubData, [MarshalAs(UnmanagedType.I1)] bool bReliable); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_IsDataAvailableOnSocket")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_IsDataAvailableOnSocket(IntPtr instancePtr, SNetSocket_t hSocket, out uint pcubMsgSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_RetrieveDataFromSocket")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_RetrieveDataFromSocket(IntPtr instancePtr, SNetSocket_t hSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_IsDataAvailable")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_IsDataAvailable(IntPtr instancePtr, SNetListenSocket_t hListenSocket, out uint pcubMsgSize, out SNetSocket_t phSocket); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_RetrieveData")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_RetrieveData(IntPtr instancePtr, SNetListenSocket_t hListenSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize, out SNetSocket_t phSocket); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_GetSocketInfo")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_GetSocketInfo(IntPtr instancePtr, SNetSocket_t hSocket, out CSteamID pSteamIDRemote, out int peSocketStatus, out SteamIPAddress_t punIPRemote, out ushort punPortRemote); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_GetListenSocketInfo")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworking_GetListenSocketInfo(IntPtr instancePtr, SNetListenSocket_t hListenSocket, out SteamIPAddress_t pnIP, out ushort pnPort); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_GetSocketConnectionType")] public static extern ESNetSocketConnectionType ISteamNetworking_GetSocketConnectionType(IntPtr instancePtr, SNetSocket_t hSocket); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworking_GetMaxPacketSize")] public static extern int ISteamNetworking_GetMaxPacketSize(IntPtr instancePtr, SNetSocket_t hSocket); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreateListenSocketIP")] public static extern uint ISteamNetworkingSockets_CreateListenSocketIP(IntPtr instancePtr, ref SteamNetworkingIPAddr localAddress, int nOptions, [In][Out] SteamNetworkingConfigValue_t[] pOptions); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ConnectByIPAddress")] public static extern uint ISteamNetworkingSockets_ConnectByIPAddress(IntPtr instancePtr, ref SteamNetworkingIPAddr address, int nOptions, [In][Out] SteamNetworkingConfigValue_t[] pOptions); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreateListenSocketP2P")] public static extern uint ISteamNetworkingSockets_CreateListenSocketP2P(IntPtr instancePtr, int nVirtualPort, int nOptions, [In][Out] SteamNetworkingConfigValue_t[] pOptions); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ConnectP2P")] public static extern uint ISteamNetworkingSockets_ConnectP2P(IntPtr instancePtr, ref SteamNetworkingIdentity identityRemote, int nVirtualPort, int nOptions, [In][Out] SteamNetworkingConfigValue_t[] pOptions); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_AcceptConnection")] public static extern EResult ISteamNetworkingSockets_AcceptConnection(IntPtr instancePtr, HSteamNetConnection hConn); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CloseConnection")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_CloseConnection(IntPtr instancePtr, HSteamNetConnection hPeer, int nReason, InteropHelp.UTF8StringHandle pszDebug, [MarshalAs(UnmanagedType.I1)] bool bEnableLinger); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CloseListenSocket")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_CloseListenSocket(IntPtr instancePtr, HSteamListenSocket hSocket); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_SetConnectionUserData")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_SetConnectionUserData(IntPtr instancePtr, HSteamNetConnection hPeer, long nUserData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetConnectionUserData")] public static extern long ISteamNetworkingSockets_GetConnectionUserData(IntPtr instancePtr, HSteamNetConnection hPeer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_SetConnectionName")] public static extern void ISteamNetworkingSockets_SetConnectionName(IntPtr instancePtr, HSteamNetConnection hPeer, InteropHelp.UTF8StringHandle pszName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetConnectionName")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_GetConnectionName(IntPtr instancePtr, HSteamNetConnection hPeer, IntPtr pszName, int nMaxLen); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_SendMessageToConnection")] public static extern EResult ISteamNetworkingSockets_SendMessageToConnection(IntPtr instancePtr, HSteamNetConnection hConn, IntPtr pData, uint cbData, int nSendFlags, out long pOutMessageNumber); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_SendMessages")] public static extern void ISteamNetworkingSockets_SendMessages(IntPtr instancePtr, int nMessages, [In][Out] SteamNetworkingMessage_t[] pMessages, [In][Out] long[] pOutMessageNumberOrResult); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_FlushMessagesOnConnection")] public static extern EResult ISteamNetworkingSockets_FlushMessagesOnConnection(IntPtr instancePtr, HSteamNetConnection hConn); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnConnection")] public static extern int ISteamNetworkingSockets_ReceiveMessagesOnConnection(IntPtr instancePtr, HSteamNetConnection hConn, [In][Out] IntPtr[] ppOutMessages, int nMaxMessages); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetConnectionInfo")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_GetConnectionInfo(IntPtr instancePtr, HSteamNetConnection hConn, out SteamNetConnectionInfo_t pInfo); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetQuickConnectionStatus")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_GetQuickConnectionStatus(IntPtr instancePtr, HSteamNetConnection hConn, out SteamNetworkingQuickConnectionStatus pStats); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetDetailedConnectionStatus")] public static extern int ISteamNetworkingSockets_GetDetailedConnectionStatus(IntPtr instancePtr, HSteamNetConnection hConn, IntPtr pszBuf, int cbBuf); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetListenSocketAddress")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_GetListenSocketAddress(IntPtr instancePtr, HSteamListenSocket hSocket, out SteamNetworkingIPAddr address); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreateSocketPair")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_CreateSocketPair(IntPtr instancePtr, out HSteamNetConnection pOutConnection1, out HSteamNetConnection pOutConnection2, [MarshalAs(UnmanagedType.I1)] bool bUseNetworkLoopback, ref SteamNetworkingIdentity pIdentity1, ref SteamNetworkingIdentity pIdentity2); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetIdentity")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_GetIdentity(IntPtr instancePtr, out SteamNetworkingIdentity pIdentity); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_InitAuthentication")] public static extern ESteamNetworkingAvailability ISteamNetworkingSockets_InitAuthentication(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetAuthenticationStatus")] public static extern ESteamNetworkingAvailability ISteamNetworkingSockets_GetAuthenticationStatus(IntPtr instancePtr, out SteamNetAuthenticationStatus_t pDetails); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreatePollGroup")] public static extern uint ISteamNetworkingSockets_CreatePollGroup(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_DestroyPollGroup")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_DestroyPollGroup(IntPtr instancePtr, HSteamNetPollGroup hPollGroup); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_SetConnectionPollGroup")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_SetConnectionPollGroup(IntPtr instancePtr, HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnPollGroup")] public static extern int ISteamNetworkingSockets_ReceiveMessagesOnPollGroup(IntPtr instancePtr, HSteamNetPollGroup hPollGroup, [In][Out] IntPtr[] ppOutMessages, int nMaxMessages); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ReceivedRelayAuthTicket")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_ReceivedRelayAuthTicket(IntPtr instancePtr, IntPtr pvTicket, int cbTicket, out SteamDatagramRelayAuthTicket pOutParsedTicket); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_FindRelayAuthTicketForServer")] public static extern int ISteamNetworkingSockets_FindRelayAuthTicketForServer(IntPtr instancePtr, ref SteamNetworkingIdentity identityGameServer, int nVirtualPort, out SteamDatagramRelayAuthTicket pOutParsedTicket); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ConnectToHostedDedicatedServer")] public static extern uint ISteamNetworkingSockets_ConnectToHostedDedicatedServer(IntPtr instancePtr, ref SteamNetworkingIdentity identityTarget, int nVirtualPort, int nOptions, [In][Out] SteamNetworkingConfigValue_t[] pOptions); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerPort")] public static extern ushort ISteamNetworkingSockets_GetHostedDedicatedServerPort(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerPOPID")] public static extern uint ISteamNetworkingSockets_GetHostedDedicatedServerPOPID(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerAddress")] public static extern EResult ISteamNetworkingSockets_GetHostedDedicatedServerAddress(IntPtr instancePtr, out SteamDatagramHostedAddress pRouting); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreateHostedDedicatedServerListenSocket")] public static extern uint ISteamNetworkingSockets_CreateHostedDedicatedServerListenSocket(IntPtr instancePtr, int nVirtualPort, int nOptions, [In][Out] SteamNetworkingConfigValue_t[] pOptions); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetGameCoordinatorServerLogin")] public static extern EResult ISteamNetworkingSockets_GetGameCoordinatorServerLogin(IntPtr instancePtr, out SteamDatagramGameCoordinatorServerLogin pLoginInfo, out int pcbSignedBlob, IntPtr pBlob); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ConnectP2PCustomSignaling")] public static extern uint ISteamNetworkingSockets_ConnectP2PCustomSignaling(IntPtr instancePtr, out ISteamNetworkingConnectionCustomSignaling pSignaling, ref SteamNetworkingIdentity pPeerIdentity, int nOptions, [In][Out] SteamNetworkingConfigValue_t[] pOptions); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_ReceivedP2PCustomSignal(IntPtr instancePtr, IntPtr pMsg, int cbMsg, out ISteamNetworkingCustomSignalingRecvContext pContext); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetCertificateRequest")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_GetCertificateRequest(IntPtr instancePtr, out int pcbBlob, IntPtr pBlob, out SteamNetworkingErrMsg errMsg); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingSockets_SetCertificate")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingSockets_SetCertificate(IntPtr instancePtr, IntPtr pCertificate, int cbCertificate, out SteamNetworkingErrMsg errMsg); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_AllocateMessage")] public static extern IntPtr ISteamNetworkingUtils_AllocateMessage(IntPtr instancePtr, int cbAllocateBuffer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetRelayNetworkStatus")] public static extern ESteamNetworkingAvailability ISteamNetworkingUtils_GetRelayNetworkStatus(IntPtr instancePtr, out SteamRelayNetworkStatus_t pDetails); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetLocalPingLocation")] public static extern float ISteamNetworkingUtils_GetLocalPingLocation(IntPtr instancePtr, out SteamNetworkPingLocation_t result); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_EstimatePingTimeBetweenTwoLocations")] public static extern int ISteamNetworkingUtils_EstimatePingTimeBetweenTwoLocations(IntPtr instancePtr, ref SteamNetworkPingLocation_t location1, ref SteamNetworkPingLocation_t location2); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_EstimatePingTimeFromLocalHost")] public static extern int ISteamNetworkingUtils_EstimatePingTimeFromLocalHost(IntPtr instancePtr, ref SteamNetworkPingLocation_t remoteLocation); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_ConvertPingLocationToString")] public static extern void ISteamNetworkingUtils_ConvertPingLocationToString(IntPtr instancePtr, ref SteamNetworkPingLocation_t location, IntPtr pszBuf, int cchBufSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_ParsePingLocationString")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingUtils_ParsePingLocationString(IntPtr instancePtr, InteropHelp.UTF8StringHandle pszString, out SteamNetworkPingLocation_t result); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_CheckPingDataUpToDate")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingUtils_CheckPingDataUpToDate(IntPtr instancePtr, float flMaxAgeSeconds); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetPingToDataCenter")] public static extern int ISteamNetworkingUtils_GetPingToDataCenter(IntPtr instancePtr, SteamNetworkingPOPID popID, out SteamNetworkingPOPID pViaRelayPoP); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetDirectPingToPOP")] public static extern int ISteamNetworkingUtils_GetDirectPingToPOP(IntPtr instancePtr, SteamNetworkingPOPID popID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetPOPCount")] public static extern int ISteamNetworkingUtils_GetPOPCount(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetPOPList")] public static extern int ISteamNetworkingUtils_GetPOPList(IntPtr instancePtr, out SteamNetworkingPOPID list, int nListSz); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetLocalTimestamp")] public static extern long ISteamNetworkingUtils_GetLocalTimestamp(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetDebugOutputFunction")] public static extern void ISteamNetworkingUtils_SetDebugOutputFunction(IntPtr instancePtr, ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConfigValue")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingUtils_SetConfigValue(IntPtr instancePtr, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, ESteamNetworkingConfigDataType eDataType, IntPtr pArg); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetConfigValue")] public static extern ESteamNetworkingGetConfigValueResult ISteamNetworkingUtils_GetConfigValue(IntPtr instancePtr, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, IntPtr scopeObj, out ESteamNetworkingConfigDataType pOutDataType, IntPtr pResult, out ulong cbResult); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetConfigValueInfo")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingUtils_GetConfigValueInfo(IntPtr instancePtr, ESteamNetworkingConfigValue eValue, IntPtr pOutName, out ESteamNetworkingConfigDataType pOutDataType, out ESteamNetworkingConfigScope pOutScope, out ESteamNetworkingConfigValue pOutNextValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetFirstConfigValue")] public static extern ESteamNetworkingConfigValue ISteamNetworkingUtils_GetFirstConfigValue(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ToString")] public static extern void ISteamNetworkingUtils_SteamNetworkingIPAddr_ToString(IntPtr instancePtr, ref SteamNetworkingIPAddr addr, IntPtr buf, uint cbBuf, [MarshalAs(UnmanagedType.I1)] bool bWithPort); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString(IntPtr instancePtr, out SteamNetworkingIPAddr pAddr, InteropHelp.UTF8StringHandle pszStr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ToString")] public static extern void ISteamNetworkingUtils_SteamNetworkingIdentity_ToString(IntPtr instancePtr, ref SteamNetworkingIdentity identity, IntPtr buf, uint cbBuf); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString(IntPtr instancePtr, out SteamNetworkingIdentity pIdentity, InteropHelp.UTF8StringHandle pszStr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParentalSettings_BIsParentalLockEnabled(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsParentalLockLocked")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParentalSettings_BIsParentalLockLocked(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsAppBlocked")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParentalSettings_BIsAppBlocked(IntPtr instancePtr, AppId_t nAppID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsAppInBlockList")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParentalSettings_BIsAppInBlockList(IntPtr instancePtr, AppId_t nAppID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsFeatureBlocked")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParentalSettings_BIsFeatureBlocked(IntPtr instancePtr, EParentalFeature eFeature); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamParentalSettings_BIsFeatureInBlockList(IntPtr instancePtr, EParentalFeature eFeature); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemotePlay_GetSessionCount")] public static extern uint ISteamRemotePlay_GetSessionCount(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemotePlay_GetSessionID")] public static extern uint ISteamRemotePlay_GetSessionID(IntPtr instancePtr, int iSessionIndex); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemotePlay_GetSessionSteamID")] public static extern ulong ISteamRemotePlay_GetSessionSteamID(IntPtr instancePtr, RemotePlaySessionID_t unSessionID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemotePlay_GetSessionClientName")] public static extern IntPtr ISteamRemotePlay_GetSessionClientName(IntPtr instancePtr, RemotePlaySessionID_t unSessionID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemotePlay_GetSessionClientFormFactor")] public static extern ESteamDeviceFormFactor ISteamRemotePlay_GetSessionClientFormFactor(IntPtr instancePtr, RemotePlaySessionID_t unSessionID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemotePlay_BGetSessionClientResolution")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemotePlay_BGetSessionClientResolution(IntPtr instancePtr, RemotePlaySessionID_t unSessionID, out int pnResolutionX, out int pnResolutionY); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemotePlay_BSendRemotePlayTogetherInvite")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemotePlay_BSendRemotePlayTogetherInvite(IntPtr instancePtr, CSteamID steamIDFriend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWrite")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_FileWrite(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile, byte[] pvData, int cubData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileRead")] public static extern int ISteamRemoteStorage_FileRead(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile, byte[] pvData, int cubDataToRead); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteAsync")] public static extern ulong ISteamRemoteStorage_FileWriteAsync(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile, byte[] pvData, uint cubData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileReadAsync")] public static extern ulong ISteamRemoteStorage_FileReadAsync(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile, uint nOffset, uint cubToRead); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_FileReadAsyncComplete(IntPtr instancePtr, SteamAPICall_t hReadCall, byte[] pvBuffer, uint cubToRead); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileForget")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_FileForget(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileDelete")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_FileDelete(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileShare")] public static extern ulong ISteamRemoteStorage_FileShare(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_SetSyncPlatforms")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_SetSyncPlatforms(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile, ERemoteStoragePlatform eRemoteStoragePlatform); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen")] public static extern ulong ISteamRemoteStorage_FileWriteStreamOpen(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_FileWriteStreamWriteChunk(IntPtr instancePtr, UGCFileWriteStreamHandle_t writeHandle, byte[] pvData, int cubData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamClose")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_FileWriteStreamClose(IntPtr instancePtr, UGCFileWriteStreamHandle_t writeHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_FileWriteStreamCancel(IntPtr instancePtr, UGCFileWriteStreamHandle_t writeHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileExists")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_FileExists(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_FilePersisted")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_FilePersisted(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileSize")] public static extern int ISteamRemoteStorage_GetFileSize(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileTimestamp")] public static extern long ISteamRemoteStorage_GetFileTimestamp(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetSyncPlatforms")] public static extern ERemoteStoragePlatform ISteamRemoteStorage_GetSyncPlatforms(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileCount")] public static extern int ISteamRemoteStorage_GetFileCount(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileNameAndSize")] public static extern IntPtr ISteamRemoteStorage_GetFileNameAndSize(IntPtr instancePtr, int iFile, out int pnFileSizeInBytes); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetQuota")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_GetQuota(IntPtr instancePtr, out ulong pnTotalBytes, out ulong puAvailableBytes); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_IsCloudEnabledForAccount(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_IsCloudEnabledForApp(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp")] public static extern void ISteamRemoteStorage_SetCloudEnabledForApp(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bEnabled); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownload")] public static extern ulong ISteamRemoteStorage_UGCDownload(IntPtr instancePtr, UGCHandle_t hContent, uint unPriority); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_GetUGCDownloadProgress(IntPtr instancePtr, UGCHandle_t hContent, out int pnBytesDownloaded, out int pnBytesExpected); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUGCDetails")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_GetUGCDetails(IntPtr instancePtr, UGCHandle_t hContent, out AppId_t pnAppID, out IntPtr ppchName, out int pnFileSizeInBytes, out CSteamID pSteamIDOwner); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCRead")] public static extern int ISteamRemoteStorage_UGCRead(IntPtr instancePtr, UGCHandle_t hContent, byte[] pvData, int cubDataToRead, uint cOffset, EUGCReadAction eAction); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetCachedUGCCount")] public static extern int ISteamRemoteStorage_GetCachedUGCCount(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle")] public static extern ulong ISteamRemoteStorage_GetCachedUGCHandle(IntPtr instancePtr, int iCachedContent); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishWorkshopFile")] public static extern ulong ISteamRemoteStorage_PublishWorkshopFile(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFile, InteropHelp.UTF8StringHandle pchPreviewFile, AppId_t nConsumerAppId, InteropHelp.UTF8StringHandle pchTitle, InteropHelp.UTF8StringHandle pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, IntPtr pTags, EWorkshopFileType eWorkshopFileType); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest")] public static extern ulong ISteamRemoteStorage_CreatePublishedFileUpdateRequest(IntPtr instancePtr, PublishedFileId_t unPublishedFileId); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_UpdatePublishedFileFile(IntPtr instancePtr, PublishedFileUpdateHandle_t updateHandle, InteropHelp.UTF8StringHandle pchFile); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_UpdatePublishedFilePreviewFile(IntPtr instancePtr, PublishedFileUpdateHandle_t updateHandle, InteropHelp.UTF8StringHandle pchPreviewFile); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_UpdatePublishedFileTitle(IntPtr instancePtr, PublishedFileUpdateHandle_t updateHandle, InteropHelp.UTF8StringHandle pchTitle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_UpdatePublishedFileDescription(IntPtr instancePtr, PublishedFileUpdateHandle_t updateHandle, InteropHelp.UTF8StringHandle pchDescription); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_UpdatePublishedFileVisibility(IntPtr instancePtr, PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_UpdatePublishedFileTags(IntPtr instancePtr, PublishedFileUpdateHandle_t updateHandle, IntPtr pTags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate")] public static extern ulong ISteamRemoteStorage_CommitPublishedFileUpdate(IntPtr instancePtr, PublishedFileUpdateHandle_t updateHandle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails")] public static extern ulong ISteamRemoteStorage_GetPublishedFileDetails(IntPtr instancePtr, PublishedFileId_t unPublishedFileId, uint unMaxSecondsOld); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_DeletePublishedFile")] public static extern ulong ISteamRemoteStorage_DeletePublishedFile(IntPtr instancePtr, PublishedFileId_t unPublishedFileId); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles")] public static extern ulong ISteamRemoteStorage_EnumerateUserPublishedFiles(IntPtr instancePtr, uint unStartIndex); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_SubscribePublishedFile")] public static extern ulong ISteamRemoteStorage_SubscribePublishedFile(IntPtr instancePtr, PublishedFileId_t unPublishedFileId); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles")] public static extern ulong ISteamRemoteStorage_EnumerateUserSubscribedFiles(IntPtr instancePtr, uint unStartIndex); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile")] public static extern ulong ISteamRemoteStorage_UnsubscribePublishedFile(IntPtr instancePtr, PublishedFileId_t unPublishedFileId); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription(IntPtr instancePtr, PublishedFileUpdateHandle_t updateHandle, InteropHelp.UTF8StringHandle pchChangeDescription); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails")] public static extern ulong ISteamRemoteStorage_GetPublishedItemVoteDetails(IntPtr instancePtr, PublishedFileId_t unPublishedFileId); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote")] public static extern ulong ISteamRemoteStorage_UpdateUserPublishedItemVote(IntPtr instancePtr, PublishedFileId_t unPublishedFileId, [MarshalAs(UnmanagedType.I1)] bool bVoteUp); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails")] public static extern ulong ISteamRemoteStorage_GetUserPublishedItemVoteDetails(IntPtr instancePtr, PublishedFileId_t unPublishedFileId); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles")] public static extern ulong ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(IntPtr instancePtr, CSteamID steamId, uint unStartIndex, IntPtr pRequiredTags, IntPtr pExcludedTags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_PublishVideo")] public static extern ulong ISteamRemoteStorage_PublishVideo(IntPtr instancePtr, EWorkshopVideoProvider eVideoProvider, InteropHelp.UTF8StringHandle pchVideoAccount, InteropHelp.UTF8StringHandle pchVideoIdentifier, InteropHelp.UTF8StringHandle pchPreviewFile, AppId_t nConsumerAppId, InteropHelp.UTF8StringHandle pchTitle, InteropHelp.UTF8StringHandle pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, IntPtr pTags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction")] public static extern ulong ISteamRemoteStorage_SetUserPublishedFileAction(IntPtr instancePtr, PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction")] public static extern ulong ISteamRemoteStorage_EnumeratePublishedFilesByUserAction(IntPtr instancePtr, EWorkshopFileAction eAction, uint unStartIndex); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles")] public static extern ulong ISteamRemoteStorage_EnumeratePublishedWorkshopFiles(IntPtr instancePtr, EWorkshopEnumerationType eEnumerationType, uint unStartIndex, uint unCount, uint unDays, IntPtr pTags, IntPtr pUserTags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation")] public static extern ulong ISteamRemoteStorage_UGCDownloadToLocation(IntPtr instancePtr, UGCHandle_t hContent, InteropHelp.UTF8StringHandle pchLocation, uint unPriority); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamScreenshots_WriteScreenshot")] public static extern uint ISteamScreenshots_WriteScreenshot(IntPtr instancePtr, byte[] pubRGB, uint cubRGB, int nWidth, int nHeight); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamScreenshots_AddScreenshotToLibrary")] public static extern uint ISteamScreenshots_AddScreenshotToLibrary(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchFilename, InteropHelp.UTF8StringHandle pchThumbnailFilename, int nWidth, int nHeight); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamScreenshots_TriggerScreenshot")] public static extern void ISteamScreenshots_TriggerScreenshot(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamScreenshots_HookScreenshots")] public static extern void ISteamScreenshots_HookScreenshots(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bHook); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamScreenshots_SetLocation")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamScreenshots_SetLocation(IntPtr instancePtr, ScreenshotHandle hScreenshot, InteropHelp.UTF8StringHandle pchLocation); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamScreenshots_TagUser")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamScreenshots_TagUser(IntPtr instancePtr, ScreenshotHandle hScreenshot, CSteamID steamID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamScreenshots_TagPublishedFile")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamScreenshots_TagPublishedFile(IntPtr instancePtr, ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamScreenshots_IsScreenshotsHooked")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamScreenshots_IsScreenshotsHooked(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary")] public static extern uint ISteamScreenshots_AddVRScreenshotToLibrary(IntPtr instancePtr, EVRScreenshotType eType, InteropHelp.UTF8StringHandle pchFilename, InteropHelp.UTF8StringHandle pchVRFilename); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUserUGCRequest")] public static extern ulong ISteamUGC_CreateQueryUserUGCRequest(IntPtr instancePtr, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryAllUGCRequestPage")] public static extern ulong ISteamUGC_CreateQueryAllUGCRequestPage(IntPtr instancePtr, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryAllUGCRequestCursor")] public static extern ulong ISteamUGC_CreateQueryAllUGCRequestCursor(IntPtr instancePtr, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, InteropHelp.UTF8StringHandle pchCursor); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest")] public static extern ulong ISteamUGC_CreateQueryUGCDetailsRequest(IntPtr instancePtr, [In][Out] PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SendQueryUGCRequest")] public static extern ulong ISteamUGC_SendQueryUGCRequest(IntPtr instancePtr, UGCQueryHandle_t handle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCResult")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_GetQueryUGCResult(IntPtr instancePtr, UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCPreviewURL")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_GetQueryUGCPreviewURL(IntPtr instancePtr, UGCQueryHandle_t handle, uint index, IntPtr pchURL, uint cchURLSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCMetadata")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_GetQueryUGCMetadata(IntPtr instancePtr, UGCQueryHandle_t handle, uint index, IntPtr pchMetadata, uint cchMetadatasize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCChildren")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_GetQueryUGCChildren(IntPtr instancePtr, UGCQueryHandle_t handle, uint index, [In][Out] PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCStatistic")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_GetQueryUGCStatistic(IntPtr instancePtr, UGCQueryHandle_t handle, uint index, EItemStatistic eStatType, out ulong pStatValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews")] public static extern uint ISteamUGC_GetQueryUGCNumAdditionalPreviews(IntPtr instancePtr, UGCQueryHandle_t handle, uint index); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_GetQueryUGCAdditionalPreview(IntPtr instancePtr, UGCQueryHandle_t handle, uint index, uint previewIndex, IntPtr pchURLOrVideoID, uint cchURLSize, IntPtr pchOriginalFileName, uint cchOriginalFileNameSize, out EItemPreviewType pPreviewType); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags")] public static extern uint ISteamUGC_GetQueryUGCNumKeyValueTags(IntPtr instancePtr, UGCQueryHandle_t handle, uint index); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_GetQueryUGCKeyValueTag(IntPtr instancePtr, UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, IntPtr pchKey, uint cchKeySize, IntPtr pchValue, uint cchValueSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetQueryFirstUGCKeyValueTag")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_GetQueryFirstUGCKeyValueTag(IntPtr instancePtr, UGCQueryHandle_t handle, uint index, InteropHelp.UTF8StringHandle pchKey, IntPtr pchValue, uint cchValueSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_ReleaseQueryUGCRequest")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_ReleaseQueryUGCRequest(IntPtr instancePtr, UGCQueryHandle_t handle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_AddRequiredTag")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_AddRequiredTag(IntPtr instancePtr, UGCQueryHandle_t handle, InteropHelp.UTF8StringHandle pTagName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_AddRequiredTagGroup")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_AddRequiredTagGroup(IntPtr instancePtr, UGCQueryHandle_t handle, IntPtr pTagGroups); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_AddExcludedTag")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_AddExcludedTag(IntPtr instancePtr, UGCQueryHandle_t handle, InteropHelp.UTF8StringHandle pTagName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetReturnOnlyIDs")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetReturnOnlyIDs(IntPtr instancePtr, UGCQueryHandle_t handle, [MarshalAs(UnmanagedType.I1)] bool bReturnOnlyIDs); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetReturnKeyValueTags")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetReturnKeyValueTags(IntPtr instancePtr, UGCQueryHandle_t handle, [MarshalAs(UnmanagedType.I1)] bool bReturnKeyValueTags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetReturnLongDescription")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetReturnLongDescription(IntPtr instancePtr, UGCQueryHandle_t handle, [MarshalAs(UnmanagedType.I1)] bool bReturnLongDescription); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetReturnMetadata")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetReturnMetadata(IntPtr instancePtr, UGCQueryHandle_t handle, [MarshalAs(UnmanagedType.I1)] bool bReturnMetadata); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetReturnChildren")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetReturnChildren(IntPtr instancePtr, UGCQueryHandle_t handle, [MarshalAs(UnmanagedType.I1)] bool bReturnChildren); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetReturnAdditionalPreviews")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetReturnAdditionalPreviews(IntPtr instancePtr, UGCQueryHandle_t handle, [MarshalAs(UnmanagedType.I1)] bool bReturnAdditionalPreviews); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetReturnTotalOnly")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetReturnTotalOnly(IntPtr instancePtr, UGCQueryHandle_t handle, [MarshalAs(UnmanagedType.I1)] bool bReturnTotalOnly); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetReturnPlaytimeStats")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetReturnPlaytimeStats(IntPtr instancePtr, UGCQueryHandle_t handle, uint unDays); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetLanguage")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetLanguage(IntPtr instancePtr, UGCQueryHandle_t handle, InteropHelp.UTF8StringHandle pchLanguage); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetAllowCachedResponse")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetAllowCachedResponse(IntPtr instancePtr, UGCQueryHandle_t handle, uint unMaxAgeSeconds); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetCloudFileNameFilter")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetCloudFileNameFilter(IntPtr instancePtr, UGCQueryHandle_t handle, InteropHelp.UTF8StringHandle pMatchCloudFileName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetMatchAnyTag")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetMatchAnyTag(IntPtr instancePtr, UGCQueryHandle_t handle, [MarshalAs(UnmanagedType.I1)] bool bMatchAnyTag); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetSearchText")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetSearchText(IntPtr instancePtr, UGCQueryHandle_t handle, InteropHelp.UTF8StringHandle pSearchText); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetRankedByTrendDays")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetRankedByTrendDays(IntPtr instancePtr, UGCQueryHandle_t handle, uint unDays); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_AddRequiredKeyValueTag")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_AddRequiredKeyValueTag(IntPtr instancePtr, UGCQueryHandle_t handle, InteropHelp.UTF8StringHandle pKey, InteropHelp.UTF8StringHandle pValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_RequestUGCDetails")] public static extern ulong ISteamUGC_RequestUGCDetails(IntPtr instancePtr, PublishedFileId_t nPublishedFileID, uint unMaxAgeSeconds); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_CreateItem")] public static extern ulong ISteamUGC_CreateItem(IntPtr instancePtr, AppId_t nConsumerAppId, EWorkshopFileType eFileType); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_StartItemUpdate")] public static extern ulong ISteamUGC_StartItemUpdate(IntPtr instancePtr, AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetItemTitle")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetItemTitle(IntPtr instancePtr, UGCUpdateHandle_t handle, InteropHelp.UTF8StringHandle pchTitle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetItemDescription")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetItemDescription(IntPtr instancePtr, UGCUpdateHandle_t handle, InteropHelp.UTF8StringHandle pchDescription); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetItemUpdateLanguage")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetItemUpdateLanguage(IntPtr instancePtr, UGCUpdateHandle_t handle, InteropHelp.UTF8StringHandle pchLanguage); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetItemMetadata")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetItemMetadata(IntPtr instancePtr, UGCUpdateHandle_t handle, InteropHelp.UTF8StringHandle pchMetaData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetItemVisibility")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetItemVisibility(IntPtr instancePtr, UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetItemTags")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetItemTags(IntPtr instancePtr, UGCUpdateHandle_t updateHandle, IntPtr pTags); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetItemContent")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetItemContent(IntPtr instancePtr, UGCUpdateHandle_t handle, InteropHelp.UTF8StringHandle pszContentFolder); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetItemPreview")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetItemPreview(IntPtr instancePtr, UGCUpdateHandle_t handle, InteropHelp.UTF8StringHandle pszPreviewFile); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetAllowLegacyUpload")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_SetAllowLegacyUpload(IntPtr instancePtr, UGCUpdateHandle_t handle, [MarshalAs(UnmanagedType.I1)] bool bAllowLegacyUpload); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_RemoveAllItemKeyValueTags")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_RemoveAllItemKeyValueTags(IntPtr instancePtr, UGCUpdateHandle_t handle); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_RemoveItemKeyValueTags")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_RemoveItemKeyValueTags(IntPtr instancePtr, UGCUpdateHandle_t handle, InteropHelp.UTF8StringHandle pchKey); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_AddItemKeyValueTag")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_AddItemKeyValueTag(IntPtr instancePtr, UGCUpdateHandle_t handle, InteropHelp.UTF8StringHandle pchKey, InteropHelp.UTF8StringHandle pchValue); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_AddItemPreviewFile")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_AddItemPreviewFile(IntPtr instancePtr, UGCUpdateHandle_t handle, InteropHelp.UTF8StringHandle pszPreviewFile, EItemPreviewType type); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_AddItemPreviewVideo")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_AddItemPreviewVideo(IntPtr instancePtr, UGCUpdateHandle_t handle, InteropHelp.UTF8StringHandle pszVideoID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_UpdateItemPreviewFile")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_UpdateItemPreviewFile(IntPtr instancePtr, UGCUpdateHandle_t handle, uint index, InteropHelp.UTF8StringHandle pszPreviewFile); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_UpdateItemPreviewVideo")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_UpdateItemPreviewVideo(IntPtr instancePtr, UGCUpdateHandle_t handle, uint index, InteropHelp.UTF8StringHandle pszVideoID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_RemoveItemPreview")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_RemoveItemPreview(IntPtr instancePtr, UGCUpdateHandle_t handle, uint index); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SubmitItemUpdate")] public static extern ulong ISteamUGC_SubmitItemUpdate(IntPtr instancePtr, UGCUpdateHandle_t handle, InteropHelp.UTF8StringHandle pchChangeNote); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetItemUpdateProgress")] public static extern EItemUpdateStatus ISteamUGC_GetItemUpdateProgress(IntPtr instancePtr, UGCUpdateHandle_t handle, out ulong punBytesProcessed, out ulong punBytesTotal); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SetUserItemVote")] public static extern ulong ISteamUGC_SetUserItemVote(IntPtr instancePtr, PublishedFileId_t nPublishedFileID, [MarshalAs(UnmanagedType.I1)] bool bVoteUp); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetUserItemVote")] public static extern ulong ISteamUGC_GetUserItemVote(IntPtr instancePtr, PublishedFileId_t nPublishedFileID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_AddItemToFavorites")] public static extern ulong ISteamUGC_AddItemToFavorites(IntPtr instancePtr, AppId_t nAppId, PublishedFileId_t nPublishedFileID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_RemoveItemFromFavorites")] public static extern ulong ISteamUGC_RemoveItemFromFavorites(IntPtr instancePtr, AppId_t nAppId, PublishedFileId_t nPublishedFileID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SubscribeItem")] public static extern ulong ISteamUGC_SubscribeItem(IntPtr instancePtr, PublishedFileId_t nPublishedFileID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_UnsubscribeItem")] public static extern ulong ISteamUGC_UnsubscribeItem(IntPtr instancePtr, PublishedFileId_t nPublishedFileID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetNumSubscribedItems")] public static extern uint ISteamUGC_GetNumSubscribedItems(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetSubscribedItems")] public static extern uint ISteamUGC_GetSubscribedItems(IntPtr instancePtr, [In][Out] PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetItemState")] public static extern uint ISteamUGC_GetItemState(IntPtr instancePtr, PublishedFileId_t nPublishedFileID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetItemInstallInfo")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_GetItemInstallInfo(IntPtr instancePtr, PublishedFileId_t nPublishedFileID, out ulong punSizeOnDisk, IntPtr pchFolder, uint cchFolderSize, out uint punTimeStamp); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetItemDownloadInfo")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_GetItemDownloadInfo(IntPtr instancePtr, PublishedFileId_t nPublishedFileID, out ulong punBytesDownloaded, out ulong punBytesTotal); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_DownloadItem")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_DownloadItem(IntPtr instancePtr, PublishedFileId_t nPublishedFileID, [MarshalAs(UnmanagedType.I1)] bool bHighPriority); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_BInitWorkshopForGameServer")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUGC_BInitWorkshopForGameServer(IntPtr instancePtr, DepotId_t unWorkshopDepotID, InteropHelp.UTF8StringHandle pszFolder); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_SuspendDownloads")] public static extern void ISteamUGC_SuspendDownloads(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bSuspend); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_StartPlaytimeTracking")] public static extern ulong ISteamUGC_StartPlaytimeTracking(IntPtr instancePtr, [In][Out] PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_StopPlaytimeTracking")] public static extern ulong ISteamUGC_StopPlaytimeTracking(IntPtr instancePtr, [In][Out] PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems")] public static extern ulong ISteamUGC_StopPlaytimeTrackingForAllItems(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_AddDependency")] public static extern ulong ISteamUGC_AddDependency(IntPtr instancePtr, PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_RemoveDependency")] public static extern ulong ISteamUGC_RemoveDependency(IntPtr instancePtr, PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_AddAppDependency")] public static extern ulong ISteamUGC_AddAppDependency(IntPtr instancePtr, PublishedFileId_t nPublishedFileID, AppId_t nAppID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_RemoveAppDependency")] public static extern ulong ISteamUGC_RemoveAppDependency(IntPtr instancePtr, PublishedFileId_t nPublishedFileID, AppId_t nAppID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_GetAppDependencies")] public static extern ulong ISteamUGC_GetAppDependencies(IntPtr instancePtr, PublishedFileId_t nPublishedFileID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUGC_DeleteItem")] public static extern ulong ISteamUGC_DeleteItem(IntPtr instancePtr, PublishedFileId_t nPublishedFileID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_GetHSteamUser")] public static extern int ISteamUser_GetHSteamUser(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_BLoggedOn")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUser_BLoggedOn(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_GetSteamID")] public static extern ulong ISteamUser_GetSteamID(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_InitiateGameConnection")] public static extern int ISteamUser_InitiateGameConnection(IntPtr instancePtr, byte[] pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint unIPServer, ushort usPortServer, [MarshalAs(UnmanagedType.I1)] bool bSecure); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_TerminateGameConnection")] public static extern void ISteamUser_TerminateGameConnection(IntPtr instancePtr, uint unIPServer, ushort usPortServer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_TrackAppUsageEvent")] public static extern void ISteamUser_TrackAppUsageEvent(IntPtr instancePtr, CGameID gameID, int eAppUsageEvent, InteropHelp.UTF8StringHandle pchExtraInfo); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_GetUserDataFolder")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUser_GetUserDataFolder(IntPtr instancePtr, IntPtr pchBuffer, int cubBuffer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_StartVoiceRecording")] public static extern void ISteamUser_StartVoiceRecording(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_StopVoiceRecording")] public static extern void ISteamUser_StopVoiceRecording(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_GetAvailableVoice")] public static extern EVoiceResult ISteamUser_GetAvailableVoice(IntPtr instancePtr, out uint pcbCompressed, IntPtr pcbUncompressed_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_GetVoice")] public static extern EVoiceResult ISteamUser_GetVoice(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bWantCompressed, byte[] pDestBuffer, uint cbDestBufferSize, out uint nBytesWritten, [MarshalAs(UnmanagedType.I1)] bool bWantUncompressed_Deprecated, IntPtr pUncompressedDestBuffer_Deprecated, uint cbUncompressedDestBufferSize_Deprecated, IntPtr nUncompressBytesWritten_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_DecompressVoice")] public static extern EVoiceResult ISteamUser_DecompressVoice(IntPtr instancePtr, byte[] pCompressed, uint cbCompressed, byte[] pDestBuffer, uint cbDestBufferSize, out uint nBytesWritten, uint nDesiredSampleRate); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_GetVoiceOptimalSampleRate")] public static extern uint ISteamUser_GetVoiceOptimalSampleRate(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_GetAuthSessionTicket")] public static extern uint ISteamUser_GetAuthSessionTicket(IntPtr instancePtr, byte[] pTicket, int cbMaxTicket, out uint pcbTicket); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_BeginAuthSession")] public static extern EBeginAuthSessionResult ISteamUser_BeginAuthSession(IntPtr instancePtr, byte[] pAuthTicket, int cbAuthTicket, CSteamID steamID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_EndAuthSession")] public static extern void ISteamUser_EndAuthSession(IntPtr instancePtr, CSteamID steamID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_CancelAuthTicket")] public static extern void ISteamUser_CancelAuthTicket(IntPtr instancePtr, HAuthTicket hAuthTicket); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_UserHasLicenseForApp")] public static extern EUserHasLicenseForAppResult ISteamUser_UserHasLicenseForApp(IntPtr instancePtr, CSteamID steamID, AppId_t appID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_BIsBehindNAT")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUser_BIsBehindNAT(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_AdvertiseGame")] public static extern void ISteamUser_AdvertiseGame(IntPtr instancePtr, CSteamID steamIDGameServer, uint unIPServer, ushort usPortServer); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_RequestEncryptedAppTicket")] public static extern ulong ISteamUser_RequestEncryptedAppTicket(IntPtr instancePtr, byte[] pDataToInclude, int cbDataToInclude); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_GetEncryptedAppTicket")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUser_GetEncryptedAppTicket(IntPtr instancePtr, byte[] pTicket, int cbMaxTicket, out uint pcbTicket); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_GetGameBadgeLevel")] public static extern int ISteamUser_GetGameBadgeLevel(IntPtr instancePtr, int nSeries, [MarshalAs(UnmanagedType.I1)] bool bFoil); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_GetPlayerSteamLevel")] public static extern int ISteamUser_GetPlayerSteamLevel(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_RequestStoreAuthURL")] public static extern ulong ISteamUser_RequestStoreAuthURL(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchRedirectURL); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_BIsPhoneVerified")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUser_BIsPhoneVerified(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_BIsTwoFactorEnabled")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUser_BIsTwoFactorEnabled(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_BIsPhoneIdentifying")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUser_BIsPhoneIdentifying(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_BIsPhoneRequiringVerification")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUser_BIsPhoneRequiringVerification(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_GetMarketEligibility")] public static extern ulong ISteamUser_GetMarketEligibility(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUser_GetDurationControl")] public static extern ulong ISteamUser_GetDurationControl(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_RequestCurrentStats")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_RequestCurrentStats(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetStatInt32")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetStatInt32(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName, out int pData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetStatFloat")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetStatFloat(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName, out float pData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_SetStatInt32")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_SetStatInt32(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName, int nData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_SetStatFloat")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_SetStatFloat(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName, float fData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_UpdateAvgRateStat")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_UpdateAvgRateStat(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName, float flCountThisSession, double dSessionLength); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievement")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetAchievement(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName, out bool pbAchieved); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_SetAchievement")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_SetAchievement(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_ClearAchievement")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_ClearAchievement(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetAchievementAndUnlockTime(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName, out bool pbAchieved, out uint punUnlockTime); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_StoreStats")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_StoreStats(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementIcon")] public static extern int ISteamUserStats_GetAchievementIcon(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute")] public static extern IntPtr ISteamUserStats_GetAchievementDisplayAttribute(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName, InteropHelp.UTF8StringHandle pchKey); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_IndicateAchievementProgress")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_IndicateAchievementProgress(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName, uint nCurProgress, uint nMaxProgress); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetNumAchievements")] public static extern uint ISteamUserStats_GetNumAchievements(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementName")] public static extern IntPtr ISteamUserStats_GetAchievementName(IntPtr instancePtr, uint iAchievement); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_RequestUserStats")] public static extern ulong ISteamUserStats_RequestUserStats(IntPtr instancePtr, CSteamID steamIDUser); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetUserStatInt32")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetUserStatInt32(IntPtr instancePtr, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchName, out int pData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetUserStatFloat")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetUserStatFloat(IntPtr instancePtr, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchName, out float pData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetUserAchievement")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetUserAchievement(IntPtr instancePtr, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchName, out bool pbAchieved); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetUserAchievementAndUnlockTime(IntPtr instancePtr, CSteamID steamIDUser, InteropHelp.UTF8StringHandle pchName, out bool pbAchieved, out uint punUnlockTime); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_ResetAllStats")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_ResetAllStats(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bAchievementsToo); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_FindOrCreateLeaderboard")] public static extern ulong ISteamUserStats_FindOrCreateLeaderboard(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_FindLeaderboard")] public static extern ulong ISteamUserStats_FindLeaderboard(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchLeaderboardName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardName")] public static extern IntPtr ISteamUserStats_GetLeaderboardName(IntPtr instancePtr, SteamLeaderboard_t hSteamLeaderboard); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardEntryCount")] public static extern int ISteamUserStats_GetLeaderboardEntryCount(IntPtr instancePtr, SteamLeaderboard_t hSteamLeaderboard); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardSortMethod")] public static extern ELeaderboardSortMethod ISteamUserStats_GetLeaderboardSortMethod(IntPtr instancePtr, SteamLeaderboard_t hSteamLeaderboard); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardDisplayType")] public static extern ELeaderboardDisplayType ISteamUserStats_GetLeaderboardDisplayType(IntPtr instancePtr, SteamLeaderboard_t hSteamLeaderboard); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_DownloadLeaderboardEntries")] public static extern ulong ISteamUserStats_DownloadLeaderboardEntries(IntPtr instancePtr, SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers")] public static extern ulong ISteamUserStats_DownloadLeaderboardEntriesForUsers(IntPtr instancePtr, SteamLeaderboard_t hSteamLeaderboard, [In][Out] CSteamID[] prgUsers, int cUsers); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetDownloadedLeaderboardEntry(IntPtr instancePtr, SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, out LeaderboardEntry_t pLeaderboardEntry, [In][Out] int[] pDetails, int cDetailsMax); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_UploadLeaderboardScore")] public static extern ulong ISteamUserStats_UploadLeaderboardScore(IntPtr instancePtr, SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In][Out] int[] pScoreDetails, int cScoreDetailsCount); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_AttachLeaderboardUGC")] public static extern ulong ISteamUserStats_AttachLeaderboardUGC(IntPtr instancePtr, SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers")] public static extern ulong ISteamUserStats_GetNumberOfCurrentPlayers(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages")] public static extern ulong ISteamUserStats_RequestGlobalAchievementPercentages(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo")] public static extern int ISteamUserStats_GetMostAchievedAchievementInfo(IntPtr instancePtr, IntPtr pchName, uint unNameBufLen, out float pflPercent, out bool pbAchieved); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo")] public static extern int ISteamUserStats_GetNextMostAchievedAchievementInfo(IntPtr instancePtr, int iIteratorPrevious, IntPtr pchName, uint unNameBufLen, out float pflPercent, out bool pbAchieved); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementAchievedPercent")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetAchievementAchievedPercent(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchName, out float pflPercent); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_RequestGlobalStats")] public static extern ulong ISteamUserStats_RequestGlobalStats(IntPtr instancePtr, int nHistoryDays); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatInt64")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetGlobalStatInt64(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchStatName, out long pData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatDouble")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUserStats_GetGlobalStatDouble(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchStatName, out double pData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatHistoryInt64")] public static extern int ISteamUserStats_GetGlobalStatHistoryInt64(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchStatName, [In][Out] long[] pData, uint cubData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatHistoryDouble")] public static extern int ISteamUserStats_GetGlobalStatHistoryDouble(IntPtr instancePtr, InteropHelp.UTF8StringHandle pchStatName, [In][Out] double[] pData, uint cubData); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceAppActive")] public static extern uint ISteamUtils_GetSecondsSinceAppActive(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceComputerActive")] public static extern uint ISteamUtils_GetSecondsSinceComputerActive(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetConnectedUniverse")] public static extern EUniverse ISteamUtils_GetConnectedUniverse(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetServerRealTime")] public static extern uint ISteamUtils_GetServerRealTime(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetIPCountry")] public static extern IntPtr ISteamUtils_GetIPCountry(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetImageSize")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_GetImageSize(IntPtr instancePtr, int iImage, out uint pnWidth, out uint pnHeight); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetImageRGBA")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_GetImageRGBA(IntPtr instancePtr, int iImage, byte[] pubDest, int nDestBufferSize); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetCSERIPPort")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_GetCSERIPPort(IntPtr instancePtr, out uint unIP, out ushort usPort); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetCurrentBatteryPower")] public static extern byte ISteamUtils_GetCurrentBatteryPower(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetAppID")] public static extern uint ISteamUtils_GetAppID(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_SetOverlayNotificationPosition")] public static extern void ISteamUtils_SetOverlayNotificationPosition(IntPtr instancePtr, ENotificationPosition eNotificationPosition); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_IsAPICallCompleted")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_IsAPICallCompleted(IntPtr instancePtr, SteamAPICall_t hSteamAPICall, out bool pbFailed); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetAPICallFailureReason")] public static extern ESteamAPICallFailure ISteamUtils_GetAPICallFailureReason(IntPtr instancePtr, SteamAPICall_t hSteamAPICall); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetAPICallResult")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_GetAPICallResult(IntPtr instancePtr, SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, out bool pbFailed); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetIPCCallCount")] public static extern uint ISteamUtils_GetIPCCallCount(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_SetWarningMessageHook")] public static extern void ISteamUtils_SetWarningMessageHook(IntPtr instancePtr, SteamAPIWarningMessageHook_t pFunction); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_IsOverlayEnabled")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_IsOverlayEnabled(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_BOverlayNeedsPresent")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_BOverlayNeedsPresent(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_CheckFileSignature")] public static extern ulong ISteamUtils_CheckFileSignature(IntPtr instancePtr, InteropHelp.UTF8StringHandle szFileName); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_ShowGamepadTextInput")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_ShowGamepadTextInput(IntPtr instancePtr, EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, InteropHelp.UTF8StringHandle pchDescription, uint unCharMax, InteropHelp.UTF8StringHandle pchExistingText); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetEnteredGamepadTextLength")] public static extern uint ISteamUtils_GetEnteredGamepadTextLength(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetEnteredGamepadTextInput")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_GetEnteredGamepadTextInput(IntPtr instancePtr, IntPtr pchText, uint cchText); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetSteamUILanguage")] public static extern IntPtr ISteamUtils_GetSteamUILanguage(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_IsSteamRunningInVR")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_IsSteamRunningInVR(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_SetOverlayNotificationInset")] public static extern void ISteamUtils_SetOverlayNotificationInset(IntPtr instancePtr, int nHorizontalInset, int nVerticalInset); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_IsSteamInBigPictureMode")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_IsSteamInBigPictureMode(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_StartVRDashboard")] public static extern void ISteamUtils_StartVRDashboard(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_IsVRHeadsetStreamingEnabled(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled")] public static extern void ISteamUtils_SetVRHeadsetStreamingEnabled(IntPtr instancePtr, [MarshalAs(UnmanagedType.I1)] bool bEnabled); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_IsSteamChinaLauncher")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_IsSteamChinaLauncher(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_InitFilterText")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamUtils_InitFilterText(IntPtr instancePtr); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_FilterText")] public static extern int ISteamUtils_FilterText(IntPtr instancePtr, IntPtr pchOutFilteredText, uint nByteSizeOutFilteredText, InteropHelp.UTF8StringHandle pchInputMessage, [MarshalAs(UnmanagedType.I1)] bool bLegalOnly); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamUtils_GetIPv6ConnectivityState")] public static extern ESteamIPv6ConnectivityState ISteamUtils_GetIPv6ConnectivityState(IntPtr instancePtr, ESteamIPv6ConnectivityProtocol eProtocol); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamVideo_GetVideoURL")] public static extern void ISteamVideo_GetVideoURL(IntPtr instancePtr, AppId_t unVideoAppID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamVideo_IsBroadcasting")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamVideo_IsBroadcasting(IntPtr instancePtr, out int pnNumViewers); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamVideo_GetOPFSettings")] public static extern void ISteamVideo_GetOPFSettings(IntPtr instancePtr, AppId_t unVideoAppID); [DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SteamAPI_ISteamVideo_GetOPFStringForApp")] [return: MarshalAs(UnmanagedType.I1)] public static extern bool ISteamVideo_GetOPFStringForApp(IntPtr instancePtr, AppId_t unVideoAppID, IntPtr pchBuffer, ref int pnBufferSize); } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3901)] public struct SteamAppInstalled_t { public const int k_iCallback = 3901; public AppId_t m_nAppID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3902)] public struct SteamAppUninstalled_t { public const int k_iCallback = 3902; public AppId_t m_nAppID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1005)] public struct DlcInstalled_t { public const int k_iCallback = 1005; public AppId_t m_nAppID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1008)] public struct RegisterActivationCodeResponse_t { public const int k_iCallback = 1008; public ERegisterActivationCodeResult m_eResult; public uint m_unPackageRegistered; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(1014)] public struct NewUrlLaunchParameters_t { public const int k_iCallback = 1014; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1021)] public struct AppProofOfPurchaseKeyResponse_t { public const int k_iCallback = 1021; public EResult m_eResult; public uint m_nAppID; public uint m_cchKeyLength; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 240)] public string m_rgchKey; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1023)] public struct FileDetailsResult_t { public const int k_iCallback = 1023; public EResult m_eResult; public ulong m_ulFileSize; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] public byte[] m_FileSHA; public uint m_unFlags; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(304)] public struct PersonaStateChange_t { public const int k_iCallback = 304; public ulong m_ulSteamID; public EPersonaChange m_nChangeFlags; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(331)] public struct GameOverlayActivated_t { public const int k_iCallback = 331; public byte m_bActive; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(332)] public struct GameServerChangeRequested_t { public const int k_iCallback = 332; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string m_rgchServer; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string m_rgchPassword; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(333)] public struct GameLobbyJoinRequested_t { public const int k_iCallback = 333; public CSteamID m_steamIDLobby; public CSteamID m_steamIDFriend; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(334)] public struct AvatarImageLoaded_t { public const int k_iCallback = 334; public CSteamID m_steamID; public int m_iImage; public int m_iWide; public int m_iTall; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(335)] public struct ClanOfficerListResponse_t { public const int k_iCallback = 335; public CSteamID m_steamIDClan; public int m_cOfficers; public byte m_bSuccess; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(336)] public struct FriendRichPresenceUpdate_t { public const int k_iCallback = 336; public CSteamID m_steamIDFriend; public AppId_t m_nAppID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(337)] public struct GameRichPresenceJoinRequested_t { public const int k_iCallback = 337; public CSteamID m_steamIDFriend; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_rgchConnect; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(338)] public struct GameConnectedClanChatMsg_t { public const int k_iCallback = 338; public CSteamID m_steamIDClanChat; public CSteamID m_steamIDUser; public int m_iMessageID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(339)] public struct GameConnectedChatJoin_t { public const int k_iCallback = 339; public CSteamID m_steamIDClanChat; public CSteamID m_steamIDUser; } [StructLayout(LayoutKind.Sequential, Pack = 1)] [CallbackIdentity(340)] public struct GameConnectedChatLeave_t { public const int k_iCallback = 340; public CSteamID m_steamIDClanChat; public CSteamID m_steamIDUser; [MarshalAs(UnmanagedType.I1)] public bool m_bKicked; [MarshalAs(UnmanagedType.I1)] public bool m_bDropped; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(341)] public struct DownloadClanActivityCountsResult_t { public const int k_iCallback = 341; [MarshalAs(UnmanagedType.I1)] public bool m_bSuccess; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(342)] public struct JoinClanChatRoomCompletionResult_t { public const int k_iCallback = 342; public CSteamID m_steamIDClanChat; public EChatRoomEnterResponse m_eChatRoomEnterResponse; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(343)] public struct GameConnectedFriendChatMsg_t { public const int k_iCallback = 343; public CSteamID m_steamIDUser; public int m_iMessageID; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(344)] public struct FriendsGetFollowerCount_t { public const int k_iCallback = 344; public EResult m_eResult; public CSteamID m_steamID; public int m_nCount; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(345)] public struct FriendsIsFollowing_t { public const int k_iCallback = 345; public EResult m_eResult; public CSteamID m_steamID; [MarshalAs(UnmanagedType.I1)] public bool m_bIsFollowing; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(346)] public struct FriendsEnumerateFollowingList_t { public const int k_iCallback = 346; public EResult m_eResult; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)] public CSteamID[] m_rgSteamID; public int m_nResultsReturned; public int m_nTotalResultCount; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(347)] public struct SetPersonaNameResponse_t { public const int k_iCallback = 347; [MarshalAs(UnmanagedType.I1)] public bool m_bSuccess; [MarshalAs(UnmanagedType.I1)] public bool m_bLocalSuccess; public EResult m_result; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(348)] public struct UnreadChatMessagesChanged_t { public const int k_iCallback = 348; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1701)] public struct GCMessageAvailable_t { public const int k_iCallback = 1701; public uint m_nMessageSize; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(1702)] public struct GCMessageFailed_t { public const int k_iCallback = 1702; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(201)] public struct GSClientApprove_t { public const int k_iCallback = 201; public CSteamID m_SteamID; public CSteamID m_OwnerSteamID; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(202)] public struct GSClientDeny_t { public const int k_iCallback = 202; public CSteamID m_SteamID; public EDenyReason m_eDenyReason; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string m_rgchOptionalText; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(203)] public struct GSClientKick_t { public const int k_iCallback = 203; public CSteamID m_SteamID; public EDenyReason m_eDenyReason; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(206)] public struct GSClientAchievementStatus_t { public const int k_iCallback = 206; public ulong m_SteamID; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string m_pchAchievement; [MarshalAs(UnmanagedType.I1)] public bool m_bUnlocked; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(115)] public struct GSPolicyResponse_t { public const int k_iCallback = 115; public byte m_bSecure; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(207)] public struct GSGameplayStats_t { public const int k_iCallback = 207; public EResult m_eResult; public int m_nRank; public uint m_unTotalConnects; public uint m_unTotalMinutesPlayed; } [StructLayout(LayoutKind.Sequential, Pack = 1)] [CallbackIdentity(208)] public struct GSClientGroupStatus_t { public const int k_iCallback = 208; public CSteamID m_SteamIDUser; public CSteamID m_SteamIDGroup; [MarshalAs(UnmanagedType.I1)] public bool m_bMember; [MarshalAs(UnmanagedType.I1)] public bool m_bOfficer; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(209)] public struct GSReputation_t { public const int k_iCallback = 209; public EResult m_eResult; public uint m_unReputationScore; [MarshalAs(UnmanagedType.I1)] public bool m_bBanned; public uint m_unBannedIP; public ushort m_usBannedPort; public ulong m_ulBannedGameID; public uint m_unBanExpires; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(210)] public struct AssociateWithClanResult_t { public const int k_iCallback = 210; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(211)] public struct ComputeNewPlayerCompatibilityResult_t { public const int k_iCallback = 211; public EResult m_eResult; public int m_cPlayersThatDontLikeCandidate; public int m_cPlayersThatCandidateDoesntLike; public int m_cClanPlayersThatDontLikeCandidate; public CSteamID m_SteamIDCandidate; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(1800)] public struct GSStatsReceived_t { public const int k_iCallback = 1800; public EResult m_eResult; public CSteamID m_steamIDUser; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(1801)] public struct GSStatsStored_t { public const int k_iCallback = 1801; public EResult m_eResult; public CSteamID m_steamIDUser; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1108)] public struct GSStatsUnloaded_t { public const int k_iCallback = 1108; public CSteamID m_steamIDUser; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4501)] public struct HTML_BrowserReady_t { public const int k_iCallback = 4501; public HHTMLBrowser unBrowserHandle; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4502)] public struct HTML_NeedsPaint_t { public const int k_iCallback = 4502; public HHTMLBrowser unBrowserHandle; public IntPtr pBGRA; public uint unWide; public uint unTall; public uint unUpdateX; public uint unUpdateY; public uint unUpdateWide; public uint unUpdateTall; public uint unScrollX; public uint unScrollY; public float flPageScale; public uint unPageSerial; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4503)] public struct HTML_StartRequest_t { public const int k_iCallback = 4503; public HHTMLBrowser unBrowserHandle; public string pchURL; public string pchTarget; public string pchPostData; [MarshalAs(UnmanagedType.I1)] public bool bIsRedirect; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4504)] public struct HTML_CloseBrowser_t { public const int k_iCallback = 4504; public HHTMLBrowser unBrowserHandle; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4505)] public struct HTML_URLChanged_t { public const int k_iCallback = 4505; public HHTMLBrowser unBrowserHandle; public string pchURL; public string pchPostData; [MarshalAs(UnmanagedType.I1)] public bool bIsRedirect; public string pchPageTitle; [MarshalAs(UnmanagedType.I1)] public bool bNewNavigation; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4506)] public struct HTML_FinishedRequest_t { public const int k_iCallback = 4506; public HHTMLBrowser unBrowserHandle; public string pchURL; public string pchPageTitle; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4507)] public struct HTML_OpenLinkInNewTab_t { public const int k_iCallback = 4507; public HHTMLBrowser unBrowserHandle; public string pchURL; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4508)] public struct HTML_ChangedTitle_t { public const int k_iCallback = 4508; public HHTMLBrowser unBrowserHandle; public string pchTitle; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4509)] public struct HTML_SearchResults_t { public const int k_iCallback = 4509; public HHTMLBrowser unBrowserHandle; public uint unResults; public uint unCurrentMatch; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4510)] public struct HTML_CanGoBackAndForward_t { public const int k_iCallback = 4510; public HHTMLBrowser unBrowserHandle; [MarshalAs(UnmanagedType.I1)] public bool bCanGoBack; [MarshalAs(UnmanagedType.I1)] public bool bCanGoForward; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4511)] public struct HTML_HorizontalScroll_t { public const int k_iCallback = 4511; public HHTMLBrowser unBrowserHandle; public uint unScrollMax; public uint unScrollCurrent; public float flPageScale; [MarshalAs(UnmanagedType.I1)] public bool bVisible; public uint unPageSize; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4512)] public struct HTML_VerticalScroll_t { public const int k_iCallback = 4512; public HHTMLBrowser unBrowserHandle; public uint unScrollMax; public uint unScrollCurrent; public float flPageScale; [MarshalAs(UnmanagedType.I1)] public bool bVisible; public uint unPageSize; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4513)] public struct HTML_LinkAtPosition_t { public const int k_iCallback = 4513; public HHTMLBrowser unBrowserHandle; public uint x; public uint y; public string pchURL; [MarshalAs(UnmanagedType.I1)] public bool bInput; [MarshalAs(UnmanagedType.I1)] public bool bLiveLink; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4514)] public struct HTML_JSAlert_t { public const int k_iCallback = 4514; public HHTMLBrowser unBrowserHandle; public string pchMessage; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4515)] public struct HTML_JSConfirm_t { public const int k_iCallback = 4515; public HHTMLBrowser unBrowserHandle; public string pchMessage; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4516)] public struct HTML_FileOpenDialog_t { public const int k_iCallback = 4516; public HHTMLBrowser unBrowserHandle; public string pchTitle; public string pchInitialFile; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4521)] public struct HTML_NewWindow_t { public const int k_iCallback = 4521; public HHTMLBrowser unBrowserHandle; public string pchURL; public uint unX; public uint unY; public uint unWide; public uint unTall; public HHTMLBrowser unNewWindow_BrowserHandle_IGNORE; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4522)] public struct HTML_SetCursor_t { public const int k_iCallback = 4522; public HHTMLBrowser unBrowserHandle; public uint eMouseCursor; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4523)] public struct HTML_StatusText_t { public const int k_iCallback = 4523; public HHTMLBrowser unBrowserHandle; public string pchMsg; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4524)] public struct HTML_ShowToolTip_t { public const int k_iCallback = 4524; public HHTMLBrowser unBrowserHandle; public string pchMsg; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4525)] public struct HTML_UpdateToolTip_t { public const int k_iCallback = 4525; public HHTMLBrowser unBrowserHandle; public string pchMsg; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4526)] public struct HTML_HideToolTip_t { public const int k_iCallback = 4526; public HHTMLBrowser unBrowserHandle; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4527)] public struct HTML_BrowserRestarted_t { public const int k_iCallback = 4527; public HHTMLBrowser unBrowserHandle; public HHTMLBrowser unOldBrowserHandle; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(2101)] public struct HTTPRequestCompleted_t { public const int k_iCallback = 2101; public HTTPRequestHandle m_hRequest; public ulong m_ulContextValue; [MarshalAs(UnmanagedType.I1)] public bool m_bRequestSuccessful; public EHTTPStatusCode m_eStatusCode; public uint m_unBodySize; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(2102)] public struct HTTPRequestHeadersReceived_t { public const int k_iCallback = 2102; public HTTPRequestHandle m_hRequest; public ulong m_ulContextValue; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(2103)] public struct HTTPRequestDataReceived_t { public const int k_iCallback = 2103; public HTTPRequestHandle m_hRequest; public ulong m_ulContextValue; public uint m_cOffset; public uint m_cBytesReceived; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4700)] public struct SteamInventoryResultReady_t { public const int k_iCallback = 4700; public SteamInventoryResult_t m_handle; public EResult m_result; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4701)] public struct SteamInventoryFullUpdate_t { public const int k_iCallback = 4701; public SteamInventoryResult_t m_handle; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(4702)] public struct SteamInventoryDefinitionUpdate_t { public const int k_iCallback = 4702; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4703)] public struct SteamInventoryEligiblePromoItemDefIDs_t { public const int k_iCallback = 4703; public EResult m_result; public CSteamID m_steamID; public int m_numEligiblePromoItemDefs; [MarshalAs(UnmanagedType.I1)] public bool m_bCachedData; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4704)] public struct SteamInventoryStartPurchaseResult_t { public const int k_iCallback = 4704; public EResult m_result; public ulong m_ulOrderID; public ulong m_ulTransID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4705)] public struct SteamInventoryRequestPricesResult_t { public const int k_iCallback = 4705; public EResult m_result; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] public string m_rgchCurrency; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(502)] public struct FavoritesListChanged_t { public const int k_iCallback = 502; public uint m_nIP; public uint m_nQueryPort; public uint m_nConnPort; public uint m_nAppID; public uint m_nFlags; [MarshalAs(UnmanagedType.I1)] public bool m_bAdd; public AccountID_t m_unAccountId; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(503)] public struct LobbyInvite_t { public const int k_iCallback = 503; public ulong m_ulSteamIDUser; public ulong m_ulSteamIDLobby; public ulong m_ulGameID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(504)] public struct LobbyEnter_t { public const int k_iCallback = 504; public ulong m_ulSteamIDLobby; public uint m_rgfChatPermissions; [MarshalAs(UnmanagedType.I1)] public bool m_bLocked; public uint m_EChatRoomEnterResponse; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(505)] public struct LobbyDataUpdate_t { public const int k_iCallback = 505; public ulong m_ulSteamIDLobby; public ulong m_ulSteamIDMember; public byte m_bSuccess; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(506)] public struct LobbyChatUpdate_t { public const int k_iCallback = 506; public ulong m_ulSteamIDLobby; public ulong m_ulSteamIDUserChanged; public ulong m_ulSteamIDMakingChange; public uint m_rgfChatMemberStateChange; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(507)] public struct LobbyChatMsg_t { public const int k_iCallback = 507; public ulong m_ulSteamIDLobby; public ulong m_ulSteamIDUser; public byte m_eChatEntryType; public uint m_iChatID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(509)] public struct LobbyGameCreated_t { public const int k_iCallback = 509; public ulong m_ulSteamIDLobby; public ulong m_ulSteamIDGameServer; public uint m_unIP; public ushort m_usPort; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(510)] public struct LobbyMatchList_t { public const int k_iCallback = 510; public uint m_nLobbiesMatching; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(512)] public struct LobbyKicked_t { public const int k_iCallback = 512; public ulong m_ulSteamIDLobby; public ulong m_ulSteamIDAdmin; public byte m_bKickedDueToDisconnect; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(513)] public struct LobbyCreated_t { public const int k_iCallback = 513; public EResult m_eResult; public ulong m_ulSteamIDLobby; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(516)] public struct FavoritesListAccountsUpdated_t { public const int k_iCallback = 516; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(5201)] public struct SearchForGameProgressCallback_t { public const int k_iCallback = 5201; public ulong m_ullSearchID; public EResult m_eResult; public CSteamID m_lobbyID; public CSteamID m_steamIDEndedSearch; public int m_nSecondsRemainingEstimate; public int m_cPlayersSearching; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(5202)] public struct SearchForGameResultCallback_t { public const int k_iCallback = 5202; public ulong m_ullSearchID; public EResult m_eResult; public int m_nCountPlayersInGame; public int m_nCountAcceptedGame; public CSteamID m_steamIDHost; [MarshalAs(UnmanagedType.I1)] public bool m_bFinalCallback; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(5211)] public struct RequestPlayersForGameProgressCallback_t { public const int k_iCallback = 5211; public EResult m_eResult; public ulong m_ullSearchID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(5212)] public struct RequestPlayersForGameResultCallback_t { public const int k_iCallback = 5212; public EResult m_eResult; public ulong m_ullSearchID; public CSteamID m_SteamIDPlayerFound; public CSteamID m_SteamIDLobby; public PlayerAcceptState_t m_ePlayerAcceptState; public int m_nPlayerIndex; public int m_nTotalPlayersFound; public int m_nTotalPlayersAcceptedGame; public int m_nSuggestedTeamIndex; public ulong m_ullUniqueGameID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(5213)] public struct RequestPlayersForGameFinalResultCallback_t { public const int k_iCallback = 5213; public EResult m_eResult; public ulong m_ullSearchID; public ulong m_ullUniqueGameID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(5214)] public struct SubmitPlayerResultResultCallback_t { public const int k_iCallback = 5214; public EResult m_eResult; public ulong ullUniqueGameID; public CSteamID steamIDPlayer; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(5215)] public struct EndGameResultCallback_t { public const int k_iCallback = 5215; public EResult m_eResult; public ulong ullUniqueGameID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(5301)] public struct JoinPartyCallback_t { public const int k_iCallback = 5301; public EResult m_eResult; public PartyBeaconID_t m_ulBeaconID; public CSteamID m_SteamIDBeaconOwner; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_rgchConnectString; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(5302)] public struct CreateBeaconCallback_t { public const int k_iCallback = 5302; public EResult m_eResult; public PartyBeaconID_t m_ulBeaconID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(5303)] public struct ReservationNotificationCallback_t { public const int k_iCallback = 5303; public PartyBeaconID_t m_ulBeaconID; public CSteamID m_steamIDJoiner; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(5304)] public struct ChangeNumOpenSlotsCallback_t { public const int k_iCallback = 5304; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(5305)] public struct AvailableBeaconLocationsUpdated_t { public const int k_iCallback = 5305; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(5306)] public struct ActiveBeaconsUpdated_t { public const int k_iCallback = 5306; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(4001)] public struct PlaybackStatusHasChanged_t { public const int k_iCallback = 4001; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4002)] public struct VolumeHasChanged_t { public const int k_iCallback = 4002; public float m_flNewVolume; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(4101)] public struct MusicPlayerRemoteWillActivate_t { public const int k_iCallback = 4101; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(4102)] public struct MusicPlayerRemoteWillDeactivate_t { public const int k_iCallback = 4102; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(4103)] public struct MusicPlayerRemoteToFront_t { public const int k_iCallback = 4103; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(4104)] public struct MusicPlayerWillQuit_t { public const int k_iCallback = 4104; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(4105)] public struct MusicPlayerWantsPlay_t { public const int k_iCallback = 4105; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(4106)] public struct MusicPlayerWantsPause_t { public const int k_iCallback = 4106; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(4107)] public struct MusicPlayerWantsPlayPrevious_t { public const int k_iCallback = 4107; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(4108)] public struct MusicPlayerWantsPlayNext_t { public const int k_iCallback = 4108; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4109)] public struct MusicPlayerWantsShuffled_t { public const int k_iCallback = 4109; [MarshalAs(UnmanagedType.I1)] public bool m_bShuffled; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4110)] public struct MusicPlayerWantsLooped_t { public const int k_iCallback = 4110; [MarshalAs(UnmanagedType.I1)] public bool m_bLooped; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4011)] public struct MusicPlayerWantsVolume_t { public const int k_iCallback = 4011; public float m_flNewVolume; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4012)] public struct MusicPlayerSelectsQueueEntry_t { public const int k_iCallback = 4012; public int nID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4013)] public struct MusicPlayerSelectsPlaylistEntry_t { public const int k_iCallback = 4013; public int nID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4114)] public struct MusicPlayerWantsPlayingRepeatStatus_t { public const int k_iCallback = 4114; public int m_nPlayingRepeatStatus; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1202)] public struct P2PSessionRequest_t { public const int k_iCallback = 1202; public CSteamID m_steamIDRemote; } [StructLayout(LayoutKind.Sequential, Pack = 1)] [CallbackIdentity(1203)] public struct P2PSessionConnectFail_t { public const int k_iCallback = 1203; public CSteamID m_steamIDRemote; public byte m_eP2PSessionError; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(1201)] public struct SocketStatusCallback_t { public const int k_iCallback = 1201; public SNetSocket_t m_hSocket; public SNetListenSocket_t m_hListenSocket; public CSteamID m_steamIDRemote; public int m_eSNetSocketState; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1221)] public struct SteamNetConnectionStatusChangedCallback_t { public const int k_iCallback = 1221; public HSteamNetConnection m_hConn; public SteamNetConnectionInfo_t m_info; public ESteamNetworkingConnectionState m_eOldState; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1222)] public struct SteamNetAuthenticationStatus_t { public const int k_iCallback = 1222; public ESteamNetworkingAvailability m_eAvail; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_debugMsg; } [CallbackIdentity(1281)] public struct SteamRelayNetworkStatus_t { public const int k_iCallback = 1281; public ESteamNetworkingAvailability m_eAvail; public int m_bPingMeasurementInProgress; public ESteamNetworkingAvailability m_eAvailNetworkConfig; public ESteamNetworkingAvailability m_eAvailAnyRelay; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_debugMsg; } [StructLayout(LayoutKind.Sequential, Size = 1)] [CallbackIdentity(5001)] public struct SteamParentalSettingsChanged_t { public const int k_iCallback = 5001; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(5701)] public struct SteamRemotePlaySessionConnected_t { public const int k_iCallback = 5701; public RemotePlaySessionID_t m_unSessionID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(5702)] public struct SteamRemotePlaySessionDisconnected_t { public const int k_iCallback = 5702; public RemotePlaySessionID_t m_unSessionID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1301)] public struct RemoteStorageAppSyncedClient_t { public const int k_iCallback = 1301; public AppId_t m_nAppID; public EResult m_eResult; public int m_unNumDownloads; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1302)] public struct RemoteStorageAppSyncedServer_t { public const int k_iCallback = 1302; public AppId_t m_nAppID; public EResult m_eResult; public int m_unNumUploads; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1303)] public struct RemoteStorageAppSyncProgress_t { public const int k_iCallback = 1303; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string m_rgchCurrentFile; public AppId_t m_nAppID; public uint m_uBytesTransferredThisChunk; public double m_dAppPercentComplete; [MarshalAs(UnmanagedType.I1)] public bool m_bUploading; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1305)] public struct RemoteStorageAppSyncStatusCheck_t { public const int k_iCallback = 1305; public AppId_t m_nAppID; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1307)] public struct RemoteStorageFileShareResult_t { public const int k_iCallback = 1307; public EResult m_eResult; public UGCHandle_t m_hFile; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string m_rgchFilename; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1309)] public struct RemoteStoragePublishFileResult_t { public const int k_iCallback = 1309; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; [MarshalAs(UnmanagedType.I1)] public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1311)] public struct RemoteStorageDeletePublishedFileResult_t { public const int k_iCallback = 1311; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1312)] public struct RemoteStorageEnumerateUserPublishedFilesResult_t { public const int k_iCallback = 1312; public EResult m_eResult; public int m_nResultsReturned; public int m_nTotalResultCount; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)] public PublishedFileId_t[] m_rgPublishedFileId; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1313)] public struct RemoteStorageSubscribePublishedFileResult_t { public const int k_iCallback = 1313; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1314)] public struct RemoteStorageEnumerateUserSubscribedFilesResult_t { public const int k_iCallback = 1314; public EResult m_eResult; public int m_nResultsReturned; public int m_nTotalResultCount; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)] public PublishedFileId_t[] m_rgPublishedFileId; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)] public uint[] m_rgRTimeSubscribed; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1315)] public struct RemoteStorageUnsubscribePublishedFileResult_t { public const int k_iCallback = 1315; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1316)] public struct RemoteStorageUpdatePublishedFileResult_t { public const int k_iCallback = 1316; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; [MarshalAs(UnmanagedType.I1)] public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1317)] public struct RemoteStorageDownloadUGCResult_t { public const int k_iCallback = 1317; public EResult m_eResult; public UGCHandle_t m_hFile; public AppId_t m_nAppID; public int m_nSizeInBytes; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string m_pchFileName; public ulong m_ulSteamIDOwner; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1318)] public struct RemoteStorageGetPublishedFileDetailsResult_t { public const int k_iCallback = 1318; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nCreatorAppID; public AppId_t m_nConsumerAppID; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 129)] public string m_rgchTitle; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8000)] public string m_rgchDescription; public UGCHandle_t m_hFile; public UGCHandle_t m_hPreviewFile; public ulong m_ulSteamIDOwner; public uint m_rtimeCreated; public uint m_rtimeUpdated; public ERemoteStoragePublishedFileVisibility m_eVisibility; [MarshalAs(UnmanagedType.I1)] public bool m_bBanned; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1025)] public string m_rgchTags; [MarshalAs(UnmanagedType.I1)] public bool m_bTagsTruncated; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string m_pchFileName; public int m_nFileSize; public int m_nPreviewFileSize; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_rgchURL; public EWorkshopFileType m_eFileType; [MarshalAs(UnmanagedType.I1)] public bool m_bAcceptedForUse; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1319)] public struct RemoteStorageEnumerateWorkshopFilesResult_t { public const int k_iCallback = 1319; public EResult m_eResult; public int m_nResultsReturned; public int m_nTotalResultCount; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)] public PublishedFileId_t[] m_rgPublishedFileId; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)] public float[] m_rgScore; public AppId_t m_nAppId; public uint m_unStartIndex; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1320)] public struct RemoteStorageGetPublishedItemVoteDetailsResult_t { public const int k_iCallback = 1320; public EResult m_eResult; public PublishedFileId_t m_unPublishedFileId; public int m_nVotesFor; public int m_nVotesAgainst; public int m_nReports; public float m_fScore; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1321)] public struct RemoteStoragePublishedFileSubscribed_t { public const int k_iCallback = 1321; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1322)] public struct RemoteStoragePublishedFileUnsubscribed_t { public const int k_iCallback = 1322; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1323)] public struct RemoteStoragePublishedFileDeleted_t { public const int k_iCallback = 1323; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1324)] public struct RemoteStorageUpdateUserPublishedItemVoteResult_t { public const int k_iCallback = 1324; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1325)] public struct RemoteStorageUserVoteDetails_t { public const int k_iCallback = 1325; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public EWorkshopVote m_eVote; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1326)] public struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t { public const int k_iCallback = 1326; public EResult m_eResult; public int m_nResultsReturned; public int m_nTotalResultCount; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)] public PublishedFileId_t[] m_rgPublishedFileId; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1327)] public struct RemoteStorageSetUserPublishedFileActionResult_t { public const int k_iCallback = 1327; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public EWorkshopFileAction m_eAction; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1328)] public struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t { public const int k_iCallback = 1328; public EResult m_eResult; public EWorkshopFileAction m_eAction; public int m_nResultsReturned; public int m_nTotalResultCount; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)] public PublishedFileId_t[] m_rgPublishedFileId; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)] public uint[] m_rgRTimeUpdated; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1329)] public struct RemoteStoragePublishFileProgress_t { public const int k_iCallback = 1329; public double m_dPercentFile; [MarshalAs(UnmanagedType.I1)] public bool m_bPreview; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1330)] public struct RemoteStoragePublishedFileUpdated_t { public const int k_iCallback = 1330; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; public ulong m_ulUnused; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1331)] public struct RemoteStorageFileWriteAsyncComplete_t { public const int k_iCallback = 1331; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1332)] public struct RemoteStorageFileReadAsyncComplete_t { public const int k_iCallback = 1332; public SteamAPICall_t m_hFileReadAsync; public EResult m_eResult; public uint m_nOffset; public uint m_cubRead; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(2301)] public struct ScreenshotReady_t { public const int k_iCallback = 2301; public ScreenshotHandle m_hLocal; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(2302)] public struct ScreenshotRequested_t { public const int k_iCallback = 2302; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3401)] public struct SteamUGCQueryCompleted_t { public const int k_iCallback = 3401; public UGCQueryHandle_t m_handle; public EResult m_eResult; public uint m_unNumResultsReturned; public uint m_unTotalMatchingResults; [MarshalAs(UnmanagedType.I1)] public bool m_bCachedData; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_rgchNextCursor; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3402)] public struct SteamUGCRequestUGCDetailsResult_t { public const int k_iCallback = 3402; public SteamUGCDetails_t m_details; [MarshalAs(UnmanagedType.I1)] public bool m_bCachedData; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3403)] public struct CreateItemResult_t { public const int k_iCallback = 3403; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; [MarshalAs(UnmanagedType.I1)] public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3404)] public struct SubmitItemUpdateResult_t { public const int k_iCallback = 3404; public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] public bool m_bUserNeedsToAcceptWorkshopLegalAgreement; public PublishedFileId_t m_nPublishedFileId; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3405)] public struct ItemInstalled_t { public const int k_iCallback = 3405; public AppId_t m_unAppID; public PublishedFileId_t m_nPublishedFileId; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3406)] public struct DownloadItemResult_t { public const int k_iCallback = 3406; public AppId_t m_unAppID; public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3407)] public struct UserFavoriteItemsListChanged_t { public const int k_iCallback = 3407; public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] public bool m_bWasAddRequest; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3408)] public struct SetUserItemVoteResult_t { public const int k_iCallback = 3408; public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] public bool m_bVoteUp; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3409)] public struct GetUserItemVoteResult_t { public const int k_iCallback = 3409; public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] public bool m_bVotedUp; [MarshalAs(UnmanagedType.I1)] public bool m_bVotedDown; [MarshalAs(UnmanagedType.I1)] public bool m_bVoteSkipped; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3410)] public struct StartPlaytimeTrackingResult_t { public const int k_iCallback = 3410; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3411)] public struct StopPlaytimeTrackingResult_t { public const int k_iCallback = 3411; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3412)] public struct AddUGCDependencyResult_t { public const int k_iCallback = 3412; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public PublishedFileId_t m_nChildPublishedFileId; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3413)] public struct RemoveUGCDependencyResult_t { public const int k_iCallback = 3413; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public PublishedFileId_t m_nChildPublishedFileId; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3414)] public struct AddAppDependencyResult_t { public const int k_iCallback = 3414; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3415)] public struct RemoveAppDependencyResult_t { public const int k_iCallback = 3415; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; public AppId_t m_nAppID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3416)] public struct GetAppDependenciesResult_t { public const int k_iCallback = 3416; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public AppId_t[] m_rgAppIDs; public uint m_nNumAppDependencies; public uint m_nTotalNumAppDependencies; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(3417)] public struct DeleteItemResult_t { public const int k_iCallback = 3417; public EResult m_eResult; public PublishedFileId_t m_nPublishedFileId; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(101)] public struct SteamServersConnected_t { public const int k_iCallback = 101; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(102)] public struct SteamServerConnectFailure_t { public const int k_iCallback = 102; public EResult m_eResult; [MarshalAs(UnmanagedType.I1)] public bool m_bStillRetrying; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(103)] public struct SteamServersDisconnected_t { public const int k_iCallback = 103; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(113)] public struct ClientGameServerDeny_t { public const int k_iCallback = 113; public uint m_uAppID; public uint m_unGameServerIP; public ushort m_usGameServerPort; public ushort m_bSecure; public uint m_uReason; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(117)] public struct IPCFailure_t { public const int k_iCallback = 117; public byte m_eFailureType; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(125)] public struct LicensesUpdated_t { public const int k_iCallback = 125; } [StructLayout(LayoutKind.Sequential, Pack = 4)] [CallbackIdentity(143)] public struct ValidateAuthTicketResponse_t { public const int k_iCallback = 143; public CSteamID m_SteamID; public EAuthSessionResponse m_eAuthSessionResponse; public CSteamID m_OwnerSteamID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(152)] public struct MicroTxnAuthorizationResponse_t { public const int k_iCallback = 152; public uint m_unAppID; public ulong m_ulOrderID; public byte m_bAuthorized; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(154)] public struct EncryptedAppTicketResponse_t { public const int k_iCallback = 154; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(163)] public struct GetAuthSessionTicketResponse_t { public const int k_iCallback = 163; public HAuthTicket m_hAuthTicket; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(164)] public struct GameWebCallback_t { public const int k_iCallback = 164; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_szURL; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(165)] public struct StoreAuthURLResponse_t { public const int k_iCallback = 165; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)] public string m_szURL; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(166)] public struct MarketEligibilityResponse_t { public const int k_iCallback = 166; [MarshalAs(UnmanagedType.I1)] public bool m_bAllowed; public EMarketNotAllowedReasonFlags m_eNotAllowedReason; public RTime32 m_rtAllowedAtTime; public int m_cdaySteamGuardRequiredDays; public int m_cdayNewDeviceCooldown; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(167)] public struct DurationControl_t { public const int k_iCallback = 167; public EResult m_eResult; public AppId_t m_appid; [MarshalAs(UnmanagedType.I1)] public bool m_bApplicable; public int m_csecsLast5h; public EDurationControlProgress m_progress; public EDurationControlNotification m_notification; public int m_csecsToday; public int m_csecsRemaining; } [StructLayout(LayoutKind.Explicit, Pack = 8)] [CallbackIdentity(1101)] public struct UserStatsReceived_t { public const int k_iCallback = 1101; [FieldOffset(0)] public ulong m_nGameID; [FieldOffset(8)] public EResult m_eResult; [FieldOffset(12)] public CSteamID m_steamIDUser; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1102)] public struct UserStatsStored_t { public const int k_iCallback = 1102; public ulong m_nGameID; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1103)] public struct UserAchievementStored_t { public const int k_iCallback = 1103; public ulong m_nGameID; [MarshalAs(UnmanagedType.I1)] public bool m_bGroupAchievement; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string m_rgchAchievementName; public uint m_nCurProgress; public uint m_nMaxProgress; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1104)] public struct LeaderboardFindResult_t { public const int k_iCallback = 1104; public SteamLeaderboard_t m_hSteamLeaderboard; public byte m_bLeaderboardFound; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1105)] public struct LeaderboardScoresDownloaded_t { public const int k_iCallback = 1105; public SteamLeaderboard_t m_hSteamLeaderboard; public SteamLeaderboardEntries_t m_hSteamLeaderboardEntries; public int m_cEntryCount; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1106)] public struct LeaderboardScoreUploaded_t { public const int k_iCallback = 1106; public byte m_bSuccess; public SteamLeaderboard_t m_hSteamLeaderboard; public int m_nScore; public byte m_bScoreChanged; public int m_nGlobalRankNew; public int m_nGlobalRankPrevious; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1107)] public struct NumberOfCurrentPlayers_t { public const int k_iCallback = 1107; public byte m_bSuccess; public int m_cPlayers; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1108)] public struct UserStatsUnloaded_t { public const int k_iCallback = 1108; public CSteamID m_steamIDUser; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1109)] public struct UserAchievementIconFetched_t { public const int k_iCallback = 1109; public CGameID m_nGameID; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string m_rgchAchievementName; [MarshalAs(UnmanagedType.I1)] public bool m_bAchieved; public int m_nIconHandle; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1110)] public struct GlobalAchievementPercentagesReady_t { public const int k_iCallback = 1110; public ulong m_nGameID; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1111)] public struct LeaderboardUGCSet_t { public const int k_iCallback = 1111; public EResult m_eResult; public SteamLeaderboard_t m_hSteamLeaderboard; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(1112)] public struct GlobalStatsReceived_t { public const int k_iCallback = 1112; public ulong m_nGameID; public EResult m_eResult; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(701)] public struct IPCountry_t { public const int k_iCallback = 701; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(702)] public struct LowBatteryPower_t { public const int k_iCallback = 702; public byte m_nMinutesBatteryLeft; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(703)] public struct SteamAPICallCompleted_t { public const int k_iCallback = 703; public SteamAPICall_t m_hAsyncCall; public int m_iCallback; public uint m_cubParam; } [StructLayout(LayoutKind.Sequential, Pack = 8, Size = 1)] [CallbackIdentity(704)] public struct SteamShutdown_t { public const int k_iCallback = 704; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(705)] public struct CheckFileSignature_t { public const int k_iCallback = 705; public ECheckFileSignature m_eCheckFileSignature; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(714)] public struct GamepadTextInputDismissed_t { public const int k_iCallback = 714; [MarshalAs(UnmanagedType.I1)] public bool m_bSubmitted; public uint m_unSubmittedText; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4611)] public struct GetVideoURLResult_t { public const int k_iCallback = 4611; public EResult m_eResult; public AppId_t m_unVideoAppID; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_rgchURL; } [StructLayout(LayoutKind.Sequential, Pack = 8)] [CallbackIdentity(4624)] public struct GetOPFSettingsResult_t { public const int k_iCallback = 4624; public EResult m_eResult; public AppId_t m_unVideoAppID; } public static class Constants { public const string STEAMAPPLIST_INTERFACE_VERSION = "STEAMAPPLIST_INTERFACE_VERSION001"; public const string STEAMAPPS_INTERFACE_VERSION = "STEAMAPPS_INTERFACE_VERSION008"; public const string STEAMAPPTICKET_INTERFACE_VERSION = "STEAMAPPTICKET_INTERFACE_VERSION001"; public const string STEAMCLIENT_INTERFACE_VERSION = "SteamClient020"; public const string STEAMCONTROLLER_INTERFACE_VERSION = "SteamController007"; public const string STEAMFRIENDS_INTERFACE_VERSION = "SteamFriends017"; public const string STEAMGAMECOORDINATOR_INTERFACE_VERSION = "SteamGameCoordinator001"; public const string STEAMGAMESERVER_INTERFACE_VERSION = "SteamGameServer013"; public const string STEAMGAMESERVERSTATS_INTERFACE_VERSION = "SteamGameServerStats001"; public const string STEAMHTMLSURFACE_INTERFACE_VERSION = "STEAMHTMLSURFACE_INTERFACE_VERSION_005"; public const string STEAMHTTP_INTERFACE_VERSION = "STEAMHTTP_INTERFACE_VERSION003"; public const string STEAMINPUT_INTERFACE_VERSION = "SteamInput001"; public const string STEAMINVENTORY_INTERFACE_VERSION = "STEAMINVENTORY_INTERFACE_V003"; public const string STEAMMATCHMAKING_INTERFACE_VERSION = "SteamMatchMaking009"; public const string STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION = "SteamMatchMakingServers002"; public const string STEAMGAMESEARCH_INTERFACE_VERSION = "SteamMatchGameSearch001"; public const string STEAMPARTIES_INTERFACE_VERSION = "SteamParties002"; public const string STEAMMUSIC_INTERFACE_VERSION = "STEAMMUSIC_INTERFACE_VERSION001"; public const string STEAMMUSICREMOTE_INTERFACE_VERSION = "STEAMMUSICREMOTE_INTERFACE_VERSION001"; public const string STEAMNETWORKING_INTERFACE_VERSION = "SteamNetworking006"; public const string STEAMNETWORKINGSOCKETS_INTERFACE_VERSION = "SteamNetworkingSockets008"; public const string STEAMNETWORKINGUTILS_INTERFACE_VERSION = "SteamNetworkingUtils003"; public const string STEAMPARENTALSETTINGS_INTERFACE_VERSION = "STEAMPARENTALSETTINGS_INTERFACE_VERSION001"; public const string STEAMREMOTEPLAY_INTERFACE_VERSION = "STEAMREMOTEPLAY_INTERFACE_VERSION001"; public const string STEAMREMOTESTORAGE_INTERFACE_VERSION = "STEAMREMOTESTORAGE_INTERFACE_VERSION014"; public const string STEAMSCREENSHOTS_INTERFACE_VERSION = "STEAMSCREENSHOTS_INTERFACE_VERSION003"; public const string STEAMUGC_INTERFACE_VERSION = "STEAMUGC_INTERFACE_VERSION014"; public const string STEAMUSER_INTERFACE_VERSION = "SteamUser020"; public const string STEAMUSERSTATS_INTERFACE_VERSION = "STEAMUSERSTATS_INTERFACE_VERSION011"; public const string STEAMUTILS_INTERFACE_VERSION = "SteamUtils009"; public const string STEAMVIDEO_INTERFACE_VERSION = "STEAMVIDEO_INTERFACE_V002"; public const int k_cubAppProofOfPurchaseKeyMax = 240; public const int k_cchMaxFriendsGroupName = 64; public const int k_cFriendsGroupLimit = 100; public const int k_cEnumerateFollowersMax = 50; public const int k_cchPersonaNameMax = 128; public const int k_cwchPersonaNameMax = 32; public const int k_cubChatMetadataMax = 8192; public const int k_cchMaxRichPresenceKeys = 30; public const int k_cchMaxRichPresenceKeyLength = 64; public const int k_cchMaxRichPresenceValueLength = 256; public const int k_unServerFlagNone = 0; public const int k_unServerFlagActive = 1; public const int k_unServerFlagSecure = 2; public const int k_unServerFlagDedicated = 4; public const int k_unServerFlagLinux = 8; public const int k_unServerFlagPassworded = 16; public const int k_unServerFlagPrivate = 32; public const int k_unFavoriteFlagNone = 0; public const int k_unFavoriteFlagFavorite = 1; public const int k_unFavoriteFlagHistory = 2; public const int k_unMaxCloudFileChunkSize = 104857600; public const int k_cchPublishedDocumentTitleMax = 129; public const int k_cchPublishedDocumentDescriptionMax = 8000; public const int k_cchPublishedDocumentChangeDescriptionMax = 8000; public const int k_unEnumeratePublishedFilesMaxResults = 50; public const int k_cchTagListMax = 1025; public const int k_cchFilenameMax = 260; public const int k_cchPublishedFileURLMax = 256; public const int k_nScreenshotMaxTaggedUsers = 32; public const int k_nScreenshotMaxTaggedPublishedFiles = 32; public const int k_cubUFSTagTypeMax = 255; public const int k_cubUFSTagValueMax = 255; public const int k_ScreenshotThumbWidth = 200; public const int kNumUGCResultsPerPage = 50; public const int k_cchDeveloperMetadataMax = 5000; public const int k_cchStatNameMax = 128; public const int k_cchLeaderboardNameMax = 128; public const int k_cLeaderboardDetailsMax = 64; public const int k_cbMaxGameServerGameDir = 32; public const int k_cbMaxGameServerMapName = 32; public const int k_cbMaxGameServerGameDescription = 64; public const int k_cbMaxGameServerName = 64; public const int k_cbMaxGameServerTags = 128; public const int k_cbMaxGameServerGameData = 2048; public const int k_iSteamUserCallbacks = 100; public const int k_iSteamGameServerCallbacks = 200; public const int k_iSteamFriendsCallbacks = 300; public const int k_iSteamBillingCallbacks = 400; public const int k_iSteamMatchmakingCallbacks = 500; public const int k_iSteamContentServerCallbacks = 600; public const int k_iSteamUtilsCallbacks = 700; public const int k_iClientFriendsCallbacks = 800; public const int k_iClientUserCallbacks = 900; public const int k_iSteamAppsCallbacks = 1000; public const int k_iSteamUserStatsCallbacks = 1100; public const int k_iSteamNetworkingCallbacks = 1200; public const int k_iSteamNetworkingSocketsCallbacks = 1220; public const int k_iSteamNetworkingMessagesCallbacks = 1250; public const int k_iSteamNetworkingUtilsCallbacks = 1280; public const int k_iClientRemoteStorageCallbacks = 1300; public const int k_iClientDepotBuilderCallbacks = 1400; public const int k_iSteamGameServerItemsCallbacks = 1500; public const int k_iClientUtilsCallbacks = 1600; public const int k_iSteamGameCoordinatorCallbacks = 1700; public const int k_iSteamGameServerStatsCallbacks = 1800; public const int k_iSteam2AsyncCallbacks = 1900; public const int k_iSteamGameStatsCallbacks = 2000; public const int k_iClientHTTPCallbacks = 2100; public const int k_iClientScreenshotsCallbacks = 2200; public const int k_iSteamScreenshotsCallbacks = 2300; public const int k_iClientAudioCallbacks = 2400; public const int k_iClientUnifiedMessagesCallbacks = 2500; public const int k_iSteamStreamLauncherCallbacks = 2600; public const int k_iClientControllerCallbacks = 2700; public const int k_iSteamControllerCallbacks = 2800; public const int k_iClientParentalSettingsCallbacks = 2900; public const int k_iClientDeviceAuthCallbacks = 3000; public const int k_iClientNetworkDeviceManagerCallbacks = 3100; public const int k_iClientMusicCallbacks = 3200; public const int k_iClientRemoteClientManagerCallbacks = 3300; public const int k_iClientUGCCallbacks = 3400; public const int k_iSteamStreamClientCallbacks = 3500; public const int k_IClientProductBuilderCallbacks = 3600; public const int k_iClientShortcutsCallbacks = 3700; public const int k_iClientRemoteControlManagerCallbacks = 3800; public const int k_iSteamAppListCallbacks = 3900; public const int k_iSteamMusicCallbacks = 4000; public const int k_iSteamMusicRemoteCallbacks = 4100; public const int k_iClientVRCallbacks = 4200; public const int k_iClientGameNotificationCallbacks = 4300; public const int k_iSteamGameNotificationCallbacks = 4400; public const int k_iSteamHTMLSurfaceCallbacks = 4500; public const int k_iClientVideoCallbacks = 4600; public const int k_iClientInventoryCallbacks = 4700; public const int k_iClientBluetoothManagerCallbacks = 4800; public const int k_iClientSharedConnectionCallbacks = 4900; public const int k_ISteamParentalSettingsCallbacks = 5000; public const int k_iClientShaderCallbacks = 5100; public const int k_iSteamGameSearchCallbacks = 5200; public const int k_iSteamPartiesCallbacks = 5300; public const int k_iClientPartiesCallbacks = 5400; public const int k_iSteamSTARCallbacks = 5500; public const int k_iClientSTARCallbacks = 5600; public const int k_iSteamRemotePlayCallbacks = 5700; public const int k_iClientCompatCallbacks = 5800; public const int k_unSteamAccountIDMask = -1; public const int k_unSteamAccountInstanceMask = 1048575; public const int k_unSteamUserDefaultInstance = 1; public const int k_cchGameExtraInfoMax = 64; public const int k_cbSteamDatagramMaxSerializedTicket = 512; public const int k_cbMaxSteamDatagramGameCoordinatorServerLoginAppData = 2048; public const int k_cbMaxSteamDatagramGameCoordinatorServerLoginSerialized = 4096; public const int k_nSteamEncryptedAppTicketSymmetricKeyLen = 32; public const int k_cchMaxSteamNetworkingErrMsg = 1024; public const int k_cchSteamNetworkingMaxConnectionCloseReason = 128; public const int k_cchSteamNetworkingMaxConnectionDescription = 128; public const int k_cbMaxSteamNetworkingSocketsMessageSizeSend = 524288; public const int k_nSteamNetworkingSend_Unreliable = 0; public const int k_nSteamNetworkingSend_NoNagle = 1; public const int k_nSteamNetworkingSend_UnreliableNoNagle = 1; public const int k_nSteamNetworkingSend_NoDelay = 4; public const int k_nSteamNetworkingSend_UnreliableNoDelay = 5; public const int k_nSteamNetworkingSend_Reliable = 8; public const int k_nSteamNetworkingSend_ReliableNoNagle = 9; public const int k_nSteamNetworkingSend_UseCurrentThread = 16; public const int k_cchMaxSteamNetworkingPingLocationString = 1024; public const int k_nSteamNetworkingPing_Failed = -1; public const int k_nSteamNetworkingPing_Unknown = -2; public const int k_cubSaltSize = 8; public const ulong k_GIDNil = ulong.MaxValue; public const ulong k_TxnIDNil = ulong.MaxValue; public const ulong k_TxnIDUnknown = 0uL; public const int k_uPackageIdInvalid = -1; public const ulong k_ulAssetClassIdInvalid = 0uL; public const int k_uPhysicalItemIdInvalid = 0; public const int k_uCellIDInvalid = -1; public const int k_uPartnerIdInvalid = 0; public const ulong k_ulPartyBeaconIdInvalid = 0uL; public const int STEAM_CONTROLLER_MAX_COUNT = 16; public const int STEAM_CONTROLLER_MAX_ANALOG_ACTIONS = 16; public const int STEAM_CONTROLLER_MAX_DIGITAL_ACTIONS = 128; public const int STEAM_CONTROLLER_MAX_ORIGINS = 8; public const int STEAM_CONTROLLER_MAX_ACTIVE_LAYERS = 16; public const ulong STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERS = ulong.MaxValue; public const float STEAM_CONTROLLER_MIN_ANALOG_ACTION_DATA = -1f; public const float STEAM_CONTROLLER_MAX_ANALOG_ACTION_DATA = 1f; public const ushort MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE = ushort.MaxValue; public const int INVALID_HTTPREQUEST_HANDLE = 0; public const int STEAM_INPUT_MAX_COUNT = 16; public const int STEAM_INPUT_MAX_ANALOG_ACTIONS = 16; public const int STEAM_INPUT_MAX_DIGITAL_ACTIONS = 128; public const int STEAM_INPUT_MAX_ORIGINS = 8; public const int STEAM_INPUT_MAX_ACTIVE_LAYERS = 16; public const ulong STEAM_INPUT_HANDLE_ALL_CONTROLLERS = ulong.MaxValue; public const float STEAM_INPUT_MIN_ANALOG_ACTION_DATA = -1f; public const float STEAM_INPUT_MAX_ANALOG_ACTION_DATA = 1f; public const byte k_nMaxLobbyKeyLength = byte.MaxValue; public const int k_SteamMusicNameMaxLength = 255; public const int k_SteamMusicPNGMaxLength = 65535; public const int QUERY_PORT_NOT_INITIALIZED = 65535; public const int QUERY_PORT_ERROR = 65534; } public enum ERegisterActivationCodeResult { k_ERegisterActivationCodeResultOK, k_ERegisterActivationCodeResultFail, k_ERegisterActivationCodeResultAlreadyRegistered, k_ERegisterActivationCodeResultTimeout, k_ERegisterActivationCodeAlreadyOwned } public enum EControllerActionOrigin { k_EControllerActionOrigin_None = 0, k_EControllerActionOrigin_A = 1, k_EControllerActionOrigin_B = 2, k_EControllerActionOrigin_X = 3, k_EControllerActionOrigin_Y = 4, k_EControllerActionOrigin_LeftBumper = 5, k_EControllerActionOrigin_RightBumper = 6, k_EControllerActionOrigin_LeftGrip = 7, k_EControllerActionOrigin_RightGrip = 8, k_EControllerActionOrigin_Start = 9, k_EControllerActionOrigin_Back = 10, k_EControllerActionOrigin_LeftPad_Touch = 11, k_EControllerActionOrigin_LeftPad_Swipe = 12, k_EControllerActionOrigin_LeftPad_Click = 13, k_EControllerActionOrigin_LeftPad_DPadNorth = 14, k_EControllerActionOrigin_LeftPad_DPadSouth = 15, k_EControllerActionOrigin_LeftPad_DPadWest = 16, k_EControllerActionOrigin_LeftPad_DPadEast = 17, k_EControllerActionOrigin_RightPad_Touch = 18, k_EControllerActionOrigin_RightPad_Swipe = 19, k_EControllerActionOrigin_RightPad_Click = 20, k_EControllerActionOrigin_RightPad_DPadNorth = 21, k_EControllerActionOrigin_RightPad_DPadSouth = 22, k_EControllerActionOrigin_RightPad_DPadWest = 23, k_EControllerActionOrigin_RightPad_DPadEast = 24, k_EControllerActionOrigin_LeftTrigger_Pull = 25, k_EControllerActionOrigin_LeftTrigger_Click = 26, k_EControllerActionOrigin_RightTrigger_Pull = 27, k_EControllerActionOrigin_RightTrigger_Click = 28, k_EControllerActionOrigin_LeftStick_Move = 29, k_EControllerActionOrigin_LeftStick_Click = 30, k_EControllerActionOrigin_LeftStick_DPadNorth = 31, k_EControllerActionOrigin_LeftStick_DPadSouth = 32, k_EControllerActionOrigin_LeftStick_DPadWest = 33, k_EControllerActionOrigin_LeftStick_DPadEast = 34, k_EControllerActionOrigin_Gyro_Move = 35, k_EControllerActionOrigin_Gyro_Pitch = 36, k_EControllerActionOrigin_Gyro_Yaw = 37, k_EControllerActionOrigin_Gyro_Roll = 38, k_EControllerActionOrigin_PS4_X = 39, k_EControllerActionOrigin_PS4_Circle = 40, k_EControllerActionOrigin_PS4_Triangle = 41, k_EControllerActionOrigin_PS4_Square = 42, k_EControllerActionOrigin_PS4_LeftBumper = 43, k_EControllerActionOrigin_PS4_RightBumper = 44, k_EControllerActionOrigin_PS4_Options = 45, k_EControllerActionOrigin_PS4_Share = 46, k_EControllerActionOrigin_PS4_LeftPad_Touch = 47, k_EControllerActionOrigin_PS4_LeftPad_Swipe = 48, k_EControllerActionOrigin_PS4_LeftPad_Click = 49, k_EControllerActionOrigin_PS4_LeftPad_DPadNorth = 50, k_EControllerActionOrigin_PS4_LeftPad_DPadSouth = 51, k_EControllerActionOrigin_PS4_LeftPad_DPadWest = 52, k_EControllerActionOrigin_PS4_LeftPad_DPadEast = 53, k_EControllerActionOrigin_PS4_RightPad_Touch = 54, k_EControllerActionOrigin_PS4_RightPad_Swipe = 55, k_EControllerActionOrigin_PS4_RightPad_Click = 56, k_EControllerActionOrigin_PS4_RightPad_DPadNorth = 57, k_EControllerActionOrigin_PS4_RightPad_DPadSouth = 58, k_EControllerActionOrigin_PS4_RightPad_DPadWest = 59, k_EControllerActionOrigin_PS4_RightPad_DPadEast = 60, k_EControllerActionOrigin_PS4_CenterPad_Touch = 61, k_EControllerActionOrigin_PS4_CenterPad_Swipe = 62, k_EControllerActionOrigin_PS4_CenterPad_Click = 63, k_EControllerActionOrigin_PS4_CenterPad_DPadNorth = 64, k_EControllerActionOrigin_PS4_CenterPad_DPadSouth = 65, k_EControllerActionOrigin_PS4_CenterPad_DPadWest = 66, k_EControllerActionOrigin_PS4_CenterPad_DPadEast = 67, k_EControllerActionOrigin_PS4_LeftTrigger_Pull = 68, k_EControllerActionOrigin_PS4_LeftTrigger_Click = 69, k_EControllerActionOrigin_PS4_RightTrigger_Pull = 70, k_EControllerActionOrigin_PS4_RightTrigger_Click = 71, k_EControllerActionOrigin_PS4_LeftStick_Move = 72, k_EControllerActionOrigin_PS4_LeftStick_Click = 73, k_EControllerActionOrigin_PS4_LeftStick_DPadNorth = 74, k_EControllerActionOrigin_PS4_LeftStick_DPadSouth = 75, k_EControllerActionOrigin_PS4_LeftStick_DPadWest = 76, k_EControllerActionOrigin_PS4_LeftStick_DPadEast = 77, k_EControllerActionOrigin_PS4_RightStick_Move = 78, k_EControllerActionOrigin_PS4_RightStick_Click = 79, k_EControllerActionOrigin_PS4_RightStick_DPadNorth = 80, k_EControllerActionOrigin_PS4_RightStick_DPadSouth = 81, k_EControllerActionOrigin_PS4_RightStick_DPadWest = 82, k_EControllerActionOrigin_PS4_RightStick_DPadEast = 83, k_EControllerActionOrigin_PS4_DPad_North = 84, k_EControllerActionOrigin_PS4_DPad_South = 85, k_EControllerActionOrigin_PS4_DPad_West = 86, k_EControllerActionOrigin_PS4_DPad_East = 87, k_EControllerActionOrigin_PS4_Gyro_Move = 88, k_EControllerActionOrigin_PS4_Gyro_Pitch = 89, k_EControllerActionOrigin_PS4_Gyro_Yaw = 90, k_EControllerActionOrigin_PS4_Gyro_Roll = 91, k_EControllerActionOrigin_XBoxOne_A = 92, k_EControllerActionOrigin_XBoxOne_B = 93, k_EControllerActionOrigin_XBoxOne_X = 94, k_EControllerActionOrigin_XBoxOne_Y = 95, k_EControllerActionOrigin_XBoxOne_LeftBumper = 96, k_EControllerActionOrigin_XBoxOne_RightBumper = 97, k_EControllerActionOrigin_XBoxOne_Menu = 98, k_EControllerActionOrigin_XBoxOne_View = 99, k_EControllerActionOrigin_XBoxOne_LeftTrigger_Pull = 100, k_EControllerActionOrigin_XBoxOne_LeftTrigger_Click = 101, k_EControllerActionOrigin_XBoxOne_RightTrigger_Pull = 102, k_EControllerActionOrigin_XBoxOne_RightTrigger_Click = 103, k_EControllerActionOrigin_XBoxOne_LeftStick_Move = 104, k_EControllerActionOrigin_XBoxOne_LeftStick_Click = 105, k_EControllerActionOrigin_XBoxOne_LeftStick_DPadNorth = 106, k_EControllerActionOrigin_XBoxOne_LeftStick_DPadSouth = 107, k_EControllerActionOrigin_XBoxOne_LeftStick_DPadWest = 108, k_EControllerActionOrigin_XBoxOne_LeftStick_DPadEast = 109, k_EControllerActionOrigin_XBoxOne_RightStick_Move = 110, k_EControllerActionOrigin_XBoxOne_RightStick_Click = 111, k_EControllerActionOrigin_XBoxOne_RightStick_DPadNorth = 112, k_EControllerActionOrigin_XBoxOne_RightStick_DPadSouth = 113, k_EControllerActionOrigin_XBoxOne_RightStick_DPadWest = 114, k_EControllerActionOrigin_XBoxOne_RightStick_DPadEast = 115, k_EControllerActionOrigin_XBoxOne_DPad_North = 116, k_EControllerActionOrigin_XBoxOne_DPad_South = 117, k_EControllerActionOrigin_XBoxOne_DPad_West = 118, k_EControllerActionOrigin_XBoxOne_DPad_East = 119, k_EControllerActionOrigin_XBox360_A = 120, k_EControllerActionOrigin_XBox360_B = 121, k_EControllerActionOrigin_XBox360_X = 122, k_EControllerActionOrigin_XBox360_Y = 123, k_EControllerActionOrigin_XBox360_LeftBumper = 124, k_EControllerActionOrigin_XBox360_RightBumper = 125, k_EControllerActionOrigin_XBox360_Start = 126, k_EControllerActionOrigin_XBox360_Back = 127, k_EControllerActionOrigin_XBox360_LeftTrigger_Pull = 128, k_EControllerActionOrigin_XBox360_LeftTrigger_Click = 129, k_EControllerActionOrigin_XBox360_RightTrigger_Pull = 130, k_EControllerActionOrigin_XBox360_RightTrigger_Click = 131, k_EControllerActionOrigin_XBox360_LeftStick_Move = 132, k_EControllerActionOrigin_XBox360_LeftStick_Click = 133, k_EControllerActionOrigin_XBox360_LeftStick_DPadNorth = 134, k_EControllerActionOrigin_XBox360_LeftStick_DPadSouth = 135, k_EControllerActionOrigin_XBox360_LeftStick_DPadWest = 136, k_EControllerActionOrigin_XBox360_LeftStick_DPadEast = 137, k_EControllerActionOrigin_XBox360_RightStick_Move = 138, k_EControllerActionOrigin_XBox360_RightStick_Click = 139, k_EControllerActionOrigin_XBox360_RightStick_DPadNorth = 140, k_EControllerActionOrigin_XBox360_RightStick_DPadSouth = 141, k_EControllerActionOrigin_XBox360_RightStick_DPadWest = 142, k_EControllerActionOrigin_XBox360_RightStick_DPadEast = 143, k_EControllerActionOrigin_XBox360_DPad_North = 144, k_EControllerActionOrigin_XBox360_DPad_South = 145, k_EControllerActionOrigin_XBox360_DPad_West = 146, k_EControllerActionOrigin_XBox360_DPad_East = 147, k_EControllerActionOrigin_SteamV2_A = 148, k_EControllerActionOrigin_SteamV2_B = 149, k_EControllerActionOrigin_SteamV2_X = 150, k_EControllerActionOrigin_SteamV2_Y = 151, k_EControllerActionOrigin_SteamV2_LeftBumper = 152, k_EControllerActionOrigin_SteamV2_RightBumper = 153, k_EControllerActionOrigin_SteamV2_LeftGrip_Lower = 154, k_EControllerActionOrigin_SteamV2_LeftGrip_Upper = 155, k_EControllerActionOrigin_SteamV2_RightGrip_Lower = 156, k_EControllerActionOrigin_SteamV2_RightGrip_Upper = 157, k_EControllerActionOrigin_SteamV2_LeftBumper_Pressure = 158, k_EControllerActionOrigin_SteamV2_RightBumper_Pressure = 159, k_EControllerActionOrigin_SteamV2_LeftGrip_Pressure = 160, k_EControllerActionOrigin_SteamV2_RightGrip_Pressure = 161, k_EControllerActionOrigin_SteamV2_LeftGrip_Upper_Pressure = 162, k_EControllerActionOrigin_SteamV2_RightGrip_Upper_Pressure = 163, k_EControllerActionOrigin_SteamV2_Start = 164, k_EControllerActionOrigin_SteamV2_Back = 165, k_EControllerActionOrigin_SteamV2_LeftPad_Touch = 166, k_EControllerActionOrigin_SteamV2_LeftPad_Swipe = 167, k_EControllerActionOrigin_SteamV2_LeftPad_Click = 168, k_EControllerActionOrigin_SteamV2_LeftPad_Pressure = 169, k_EControllerActionOrigin_SteamV2_LeftPad_DPadNorth = 170, k_EControllerActionOrigin_SteamV2_LeftPad_DPadSouth = 171, k_EControllerActionOrigin_SteamV2_LeftPad_DPadWest = 172, k_EControllerActionOrigin_SteamV2_LeftPad_DPadEast = 173, k_EControllerActionOrigin_SteamV2_RightPad_Touch = 174, k_EControllerActionOrigin_SteamV2_RightPad_Swipe = 175, k_EControllerActionOrigin_SteamV2_RightPad_Click = 176, k_EControllerActionOrigin_SteamV2_RightPad_Pressure = 177, k_EControllerActionOrigin_SteamV2_RightPad_DPadNorth = 178, k_EControllerActionOrigin_SteamV2_RightPad_DPadSouth = 179, k_EControllerActionOrigin_SteamV2_RightPad_DPadWest = 180, k_EControllerActionOrigin_SteamV2_RightPad_DPadEast = 181, k_EControllerActionOrigin_SteamV2_LeftTrigger_Pull = 182, k_EControllerActionOrigin_SteamV2_LeftTrigger_Click = 183, k_EControllerActionOrigin_SteamV2_RightTrigger_Pull = 184, k_EControllerActionOrigin_SteamV2_RightTrigger_Click = 185, k_EControllerActionOrigin_SteamV2_LeftStick_Move = 186, k_EControllerActionOrigin_SteamV2_LeftStick_Click = 187, k_EControllerActionOrigin_SteamV2_LeftStick_DPadNorth = 188, k_EControllerActionOrigin_SteamV2_LeftStick_DPadSouth = 189, k_EControllerActionOrigin_SteamV2_LeftStick_DPadWest = 190, k_EControllerActionOrigin_SteamV2_LeftStick_DPadEast = 191, k_EControllerActionOrigin_SteamV2_Gyro_Move = 192, k_EControllerActionOrigin_SteamV2_Gyro_Pitch = 193, k_EControllerActionOrigin_SteamV2_Gyro_Yaw = 194, k_EControllerActionOrigin_SteamV2_Gyro_Roll = 195, k_EControllerActionOrigin_Switch_A = 196, k_EControllerActionOrigin_Switch_B = 197, k_EControllerActionOrigin_Switch_X = 198, k_EControllerActionOrigin_Switch_Y = 199, k_EControllerActionOrigin_Switch_LeftBumper = 200, k_EControllerActionOrigin_Switch_RightBumper = 201, k_EControllerActionOrigin_Switch_Plus = 202, k_EControllerActionOrigin_Switch_Minus = 203, k_EControllerActionOrigin_Switch_Capture = 204, k_EControllerActionOrigin_Switch_LeftTrigger_Pull = 205, k_EControllerActionOrigin_Switch_LeftTrigger_Click = 206, k_EControllerActionOrigin_Switch_RightTrigger_Pull = 207, k_EControllerActionOrigin_Switch_RightTrigger_Click = 208, k_EControllerActionOrigin_Switch_LeftStick_Move = 209, k_EControllerActionOrigin_Switch_LeftStick_Click = 210, k_EControllerActionOrigin_Switch_LeftStick_DPadNorth = 211, k_EControllerActionOrigin_Switch_LeftStick_DPadSouth = 212, k_EControllerActionOrigin_Switch_LeftStick_DPadWest = 213, k_EControllerActionOrigin_Switch_LeftStick_DPadEast = 214, k_EControllerActionOrigin_Switch_RightStick_Move = 215, k_EControllerActionOrigin_Switch_RightStick_Click = 216, k_EControllerActionOrigin_Switch_RightStick_DPadNorth = 217, k_EControllerActionOrigin_Switch_RightStick_DPadSouth = 218, k_EControllerActionOrigin_Switch_RightStick_DPadWest = 219, k_EControllerActionOrigin_Switch_RightStick_DPadEast = 220, k_EControllerActionOrigin_Switch_DPad_North = 221, k_EControllerActionOrigin_Switch_DPad_South = 222, k_EControllerActionOrigin_Switch_DPad_West = 223, k_EControllerActionOrigin_Switch_DPad_East = 224, k_EControllerActionOrigin_Switch_ProGyro_Move = 225, k_EControllerActionOrigin_Switch_ProGyro_Pitch = 226, k_EControllerActionOrigin_Switch_ProGyro_Yaw = 227, k_EControllerActionOrigin_Switch_ProGyro_Roll = 228, k_EControllerActionOrigin_Switch_RightGyro_Move = 229, k_EControllerActionOrigin_Switch_RightGyro_Pitch = 230, k_EControllerActionOrigin_Switch_RightGyro_Yaw = 231, k_EControllerActionOrigin_Switch_RightGyro_Roll = 232, k_EControllerActionOrigin_Switch_LeftGyro_Move = 233, k_EControllerActionOrigin_Switch_LeftGyro_Pitch = 234, k_EControllerActionOrigin_Switch_LeftGyro_Yaw = 235, k_EControllerActionOrigin_Switch_LeftGyro_Roll = 236, k_EControllerActionOrigin_Switch_LeftGrip_Lower = 237, k_EControllerActionOrigin_Switch_LeftGrip_Upper = 238, k_EControllerActionOrigin_Switch_RightGrip_Lower = 239, k_EControllerActionOrigin_Switch_RightGrip_Upper = 240, k_EControllerActionOrigin_PS4_DPad_Move = 241, k_EControllerActionOrigin_XBoxOne_DPad_Move = 242, k_EControllerActionOrigin_XBox360_DPad_Move = 243, k_EControllerActionOrigin_Switch_DPad_Move = 244, k_EControllerActionOrigin_Count = 245, k_EControllerActionOrigin_MaximumPossibleValue = 32767 } public enum ESteamControllerLEDFlag { k_ESteamControllerLEDFlag_SetColor, k_ESteamControllerLEDFlag_RestoreUserDefault } public enum EFriendRelationship { k_EFriendRelationshipNone, k_EFriendRelationshipBlocked, k_EFriendRelationshipRequestRecipient, k_EFriendRelationshipFriend, k_EFriendRelationshipRequestInitiator, k_EFriendRelationshipIgnored, k_EFriendRelationshipIgnoredFriend, k_EFriendRelationshipSuggested_DEPRECATED, k_EFriendRelationshipMax } public enum EPersonaState { k_EPersonaStateOffline, k_EPersonaStateOnline, k_EPersonaStateBusy, k_EPersonaStateAway, k_EPersonaStateSnooze, k_EPersonaStateLookingToTrade, k_EPersonaStateLookingToPlay, k_EPersonaStateInvisible, k_EPersonaStateMax } [Flags] public enum EFriendFlags { k_EFriendFlagNone = 0, k_EFriendFlagBlocked = 1, k_EFriendFlagFriendshipRequested = 2, k_EFriendFlagImmediate = 4, k_EFriendFlagClanMember = 8, k_EFriendFlagOnGameServer = 0x10, k_EFriendFlagRequestingFriendship = 0x80, k_EFriendFlagRequestingInfo = 0x100, k_EFriendFlagIgnored = 0x200, k_EFriendFlagIgnoredFriend = 0x400, k_EFriendFlagChatMember = 0x1000, k_EFriendFlagAll = 0xFFFF } public enum EUserRestriction { k_nUserRestrictionNone = 0, k_nUserRestrictionUnknown = 1, k_nUserRestrictionAnyChat = 2, k_nUserRestrictionVoiceChat = 4, k_nUserRestrictionGroupChat = 8, k_nUserRestrictionRating = 0x10, k_nUserRestrictionGameInvites = 0x20, k_nUserRestrictionTrading = 0x40 } public enum EOverlayToStoreFlag { k_EOverlayToStoreFlag_None, k_EOverlayToStoreFlag_AddToCart, k_EOverlayToStoreFlag_AddToCartAndShow } public enum EActivateGameOverlayToWebPageMode { k_EActivateGameOverlayToWebPageMode_Default, k_EActivateGameOverlayToWebPageMode_Modal } [Flags] public enum EPersonaChange { k_EPersonaChangeName = 1, k_EPersonaChangeStatus = 2, k_EPersonaChangeComeOnline = 4, k_EPersonaChangeGoneOffline = 8, k_EPersonaChangeGamePlayed = 0x10, k_EPersonaChangeGameServer = 0x20, k_EPersonaChangeAvatar = 0x40, k_EPersonaChangeJoinedSource = 0x80, k_EPersonaChangeLeftSource = 0x100, k_EPersonaChangeRelationshipChanged = 0x200, k_EPersonaChangeNameFirstSet = 0x400, k_EPersonaChangeBroadcast = 0x800, k_EPersonaChangeNickname = 0x1000, k_EPersonaChangeSteamLevel = 0x2000, k_EPersonaChangeRichPresence = 0x4000 } public enum EGCResults { k_EGCResultOK, k_EGCResultNoMessage, k_EGCResultBufferTooSmall, k_EGCResultNotLoggedOn, k_EGCResultInvalidMessage } public enum EHTMLMouseButton { eHTMLMouseButton_Left, eHTMLMouseButton_Right, eHTMLMouseButton_Middle } public enum EMouseCursor { dc_user, dc_none, dc_arrow, dc_ibeam, dc_hourglass, dc_waitarrow, dc_crosshair, dc_up, dc_sizenw, dc_sizese, dc_sizene, dc_sizesw, dc_sizew, dc_sizee, dc_sizen, dc_sizes, dc_sizewe, dc_sizens, dc_sizeall, dc_no, dc_hand, dc_blank, dc_middle_pan, dc_north_pan, dc_north_east_pan, dc_east_pan, dc_south_east_pan, dc_south_pan, dc_south_west_pan, dc_west_pan, dc_north_west_pan, dc_alias, dc_cell, dc_colresize, dc_copycur, dc_verticaltext, dc_rowresize, dc_zoomin, dc_zoomout, dc_help, dc_custom, dc_last } [Flags] public enum EHTMLKeyModifiers { k_eHTMLKeyModifier_None = 0, k_eHTMLKeyModifier_AltDown = 1, k_eHTMLKeyModifier_CtrlDown = 2, k_eHTMLKeyModifier_ShiftDown = 4 } public enum EInputSourceMode { k_EInputSourceMode_None, k_EInputSourceMode_Dpad, k_EInputSourceMode_Buttons, k_EInputSourceMode_FourButtons, k_EInputSourceMode_AbsoluteMouse, k_EInputSourceMode_RelativeMouse, k_EInputSourceMode_JoystickMove, k_EInputSourceMode_JoystickMouse, k_EInputSourceMode_JoystickCamera, k_EInputSourceMode_ScrollWheel, k_EInputSourceMode_Trigger, k_EInputSourceMode_TouchMenu, k_EInputSourceMode_MouseJoystick, k_EInputSourceMode_MouseRegion, k_EInputSourceMode_RadialMenu, k_EInputSourceMode_SingleButton, k_EInputSourceMode_Switches } public enum EInputActionOrigin { k_EInputActionOrigin_None = 0, k_EInputActionOrigin_SteamController_A = 1, k_EInputActionOrigin_SteamController_B = 2, k_EInputActionOrigin_SteamController_X = 3, k_EInputActionOrigin_SteamController_Y = 4, k_EInputActionOrigin_SteamController_LeftBumper = 5, k_EInputActionOrigin_SteamController_RightBumper = 6, k_EInputActionOrigin_SteamController_LeftGrip = 7, k_EInputActionOrigin_SteamController_RightGrip = 8, k_EInputActionOrigin_SteamController_Start = 9, k_EInputActionOrigin_SteamController_Back = 10, k_EInputActionOrigin_SteamController_LeftPad_Touch = 11, k_EInputActionOrigin_SteamController_LeftPad_Swipe = 12, k_EInputActionOrigin_SteamController_LeftPad_Click = 13, k_EInputActionOrigin_SteamController_LeftPad_DPadNorth = 14, k_EInputActionOrigin_SteamController_LeftPad_DPadSouth = 15, k_EInputActionOrigin_SteamController_LeftPad_DPadWest = 16, k_EInputActionOrigin_SteamController_LeftPad_DPadEast = 17, k_EInputActionOrigin_SteamController_RightPad_Touch = 18, k_EInputActionOrigin_SteamController_RightPad_Swipe = 19, k_EInputActionOrigin_SteamController_RightPad_Click = 20, k_EInputActionOrigin_SteamController_RightPad_DPadNorth = 21, k_EInputActionOrigin_SteamController_RightPad_DPadSouth = 22, k_EInputActionOrigin_SteamController_RightPad_DPadWest = 23, k_EInputActionOrigin_SteamController_RightPad_DPadEast = 24, k_EInputActionOrigin_SteamController_LeftTrigger_Pull = 25, k_EInputActionOrigin_SteamController_LeftTrigger_Click = 26, k_EInputActionOrigin_SteamController_RightTrigger_Pull = 27, k_EInputActionOrigin_SteamController_RightTrigger_Click = 28, k_EInputActionOrigin_SteamController_LeftStick_Move = 29, k_EInputActionOrigin_SteamController_LeftStick_Click = 30, k_EInputActionOrigin_SteamController_LeftStick_DPadNorth = 31, k_EInputActionOrigin_SteamController_LeftStick_DPadSouth = 32, k_EInputActionOrigin_SteamController_LeftStick_DPadWest = 33, k_EInputActionOrigin_SteamController_LeftStick_DPadEast = 34, k_EInputActionOrigin_SteamController_Gyro_Move = 35, k_EInputActionOrigin_SteamController_Gyro_Pitch = 36, k_EInputActionOrigin_SteamController_Gyro_Yaw = 37, k_EInputActionOrigin_SteamController_Gyro_Roll = 38, k_EInputActionOrigin_SteamController_Reserved0 = 39, k_EInputActionOrigin_SteamController_Reserved1 = 40, k_EInputActionOrigin_SteamController_Reserved2 = 41, k_EInputActionOrigin_SteamController_Reserved3 = 42, k_EInputActionOrigin_SteamController_Reserved4 = 43, k_EInputActionOrigin_SteamController_Reserved5 = 44, k_EInputActionOrigin_SteamController_Reserved6 = 45, k_EInputActionOrigin_SteamController_Reserved7 = 46, k_EInputActionOrigin_SteamController_Reserved8 = 47, k_EInputActionOrigin_SteamController_Reserved9 = 48, k_EInputActionOrigin_SteamController_Reserved10 = 49, k_EInputActionOrigin_PS4_X = 50, k_EInputActionOrigin_PS4_Circle = 51, k_EInputActionOrigin_PS4_Triangle = 52, k_EInputActionOrigin_PS4_Square = 53, k_EInputActionOrigin_PS4_LeftBumper = 54, k_EInputActionOrigin_PS4_RightBumper = 55, k_EInputActionOrigin_PS4_Options = 56, k_EInputActionOrigin_PS4_Share = 57, k_EInputActionOrigin_PS4_LeftPad_Touch = 58, k_EInputActionOrigin_PS4_LeftPad_Swipe = 59, k_EInputActionOrigin_PS4_LeftPad_Click = 60, k_EInputActionOrigin_PS4_LeftPad_DPadNorth = 61, k_EInputActionOrigin_PS4_LeftPad_DPadSouth = 62, k_EInputActionOrigin_PS4_LeftPad_DPadWest = 63, k_EInputActionOrigin_PS4_LeftPad_DPadEast = 64, k_EInputActionOrigin_PS4_RightPad_Touch = 65, k_EInputActionOrigin_PS4_RightPad_Swipe = 66, k_EInputActionOrigin_PS4_RightPad_Click = 67, k_EInputActionOrigin_PS4_RightPad_DPadNorth = 68, k_EInputActionOrigin_PS4_RightPad_DPadSouth = 69, k_EInputActionOrigin_PS4_RightPad_DPadWest = 70, k_EInputActionOrigin_PS4_RightPad_DPadEast = 71, k_EInputActionOrigin_PS4_CenterPad_Touch = 72, k_EInputActionOrigin_PS4_CenterPad_Swipe = 73, k_EInputActionOrigin_PS4_CenterPad_Click = 74, k_EInputActionOrigin_PS4_CenterPad_DPadNorth = 75, k_EInputActionOrigin_PS4_CenterPad_DPadSouth = 76, k_EInputActionOrigin_PS4_CenterPad_DPadWest = 77, k_EInputActionOrigin_PS4_CenterPad_DPadEast = 78, k_EInputActionOrigin_PS4_LeftTrigger_Pull = 79, k_EInputActionOrigin_PS4_LeftTrigger_Click = 80, k_EInputActionOrigin_PS4_RightTrigger_Pull = 81, k_EInputActionOrigin_PS4_RightTrigger_Click = 82, k_EInputActionOrigin_PS4_LeftStick_Move = 83, k_EInputActionOrigin_PS4_LeftStick_Click = 84, k_EInputActionOrigin_PS4_LeftStick_DPadNorth = 85, k_EInputActionOrigin_PS4_LeftStick_DPadSouth = 86, k_EInputActionOrigin_PS4_LeftStick_DPadWest = 87, k_EInputActionOrigin_PS4_LeftStick_DPadEast = 88, k_EInputActionOrigin_PS4_RightStick_Move = 89, k_EInputActionOrigin_PS4_RightStick_Click = 90, k_EInputActionOrigin_PS4_RightStick_DPadNorth = 91, k_EInputActionOrigin_PS4_RightStick_DPadSouth = 92, k_EInputActionOrigin_PS4_RightStick_DPadWest = 93, k_EInputActionOrigin_PS4_RightStick_DPadEast = 94, k_EInputActionOrigin_PS4_DPad_North = 95, k_EInputActionOrigin_PS4_DPad_South = 96, k_EInputActionOrigin_PS4_DPad_West = 97, k_EInputActionOrigin_PS4_DPad_East = 98, k_EInputActionOrigin_PS4_Gyro_Move = 99, k_EInputActionOrigin_PS4_Gyro_Pitch = 100, k_EInputActionOrigin_PS4_Gyro_Yaw = 101, k_EInputActionOrigin_PS4_Gyro_Roll = 102, k_EInputActionOrigin_PS4_DPad_Move = 103, k_EInputActionOrigin_PS4_Reserved1 = 104, k_EInputActionOrigin_PS4_Reserved2 = 105, k_EInputActionOrigin_PS4_Reserved3 = 106, k_EInputActionOrigin_PS4_Reserved4 = 107, k_EInputActionOrigin_PS4_Reserved5 = 108, k_EInputActionOrigin_PS4_Reserved6 = 109, k_EInputActionOrigin_PS4_Reserved7 = 110, k_EInputActionOrigin_PS4_Reserved8 = 111, k_EInputActionOrigin_PS4_Reserved9 = 112, k_EInputActionOrigin_PS4_Reserved10 = 113, k_EInputActionOrigin_XBoxOne_A = 114, k_EInputActionOrigin_XBoxOne_B = 115, k_EInputActionOrigin_XBoxOne_X = 116, k_EInputActionOrigin_XBoxOne_Y = 117, k_EInputActionOrigin_XBoxOne_LeftBumper = 118, k_EInputActionOrigin_XBoxOne_RightBumper = 119, k_EInputActionOrigin_XBoxOne_Menu = 120, k_EInputActionOrigin_XBoxOne_View = 121, k_EInputActionOrigin_XBoxOne_LeftTrigger_Pull = 122, k_EInputActionOrigin_XBoxOne_LeftTrigger_Click = 123, k_EInputActionOrigin_XBoxOne_RightTrigger_Pull = 124, k_EInputActionOrigin_XBoxOne_RightTrigger_Click = 125, k_EInputActionOrigin_XBoxOne_LeftStick_Move = 126, k_EInputActionOrigin_XBoxOne_LeftStick_Click = 127, k_EInputActionOrigin_XBoxOne_LeftStick_DPadNorth = 128, k_EInputActionOrigin_XBoxOne_LeftStick_DPadSouth = 129, k_EInputActionOrigin_XBoxOne_LeftStick_DPadWest = 130, k_EInputActionOrigin_XBoxOne_LeftStick_DPadEast = 131, k_EInputActionOrigin_XBoxOne_RightStick_Move = 132, k_EInputActionOrigin_XBoxOne_RightStick_Click = 133, k_EInputActionOrigin_XBoxOne_RightStick_DPadNorth = 134, k_EInputActionOrigin_XBoxOne_RightStick_DPadSouth = 135, k_EInputActionOrigin_XBoxOne_RightStick_DPadWest = 136, k_EInputActionOrigin_XBoxOne_RightStick_DPadEast = 137, k_EInputActionOrigin_XBoxOne_DPad_North = 138, k_EInputActionOrigin_XBoxOne_DPad_South = 139, k_EInputActionOrigin_XBoxOne_DPad_West = 140, k_EInputActionOrigin_XBoxOne_DPad_East = 141, k_EInputActionOrigin_XBoxOne_DPad_Move = 142, k_EInputActionOrigin_XBoxOne_Reserved1 = 143, k_EInputActionOrigin_XBoxOne_Reserved2 = 144, k_EInputActionOrigin_XBoxOne_Reserved3 = 145, k_EInputActionOrigin_XBoxOne_Reserved4 = 146, k_EInputActionOrigin_XBoxOne_Reserved5 = 147, k_EInputActionOrigin_XBoxOne_Reserved6 = 148, k_EInputActionOrigin_XBoxOne_Reserved7 = 149, k_EInputActionOrigin_XBoxOne_Reserved8 = 150, k_EInputActionOrigin_XBoxOne_Reserved9 = 151, k_EInputActionOrigin_XBoxOne_Reserved10 = 152, k_EInputActionOrigin_XBox360_A = 153, k_EInputActionOrigin_XBox360_B = 154, k_EInputActionOrigin_XBox360_X = 155, k_EInputActionOrigin_XBox360_Y = 156, k_EInputActionOrigin_XBox360_LeftBumper = 157, k_EInputActionOrigin_XBox360_RightBumper = 158, k_EInputActionOrigin_XBox360_Start = 159, k_EInputActionOrigin_XBox360_Back = 160, k_EInputActionOrigin_XBox360_LeftTrigger_Pull = 161, k_EInputActionOrigin_XBox360_LeftTrigger_Click = 162, k_EInputActionOrigin_XBox360_RightTrigger_Pull = 163, k_EInputActionOrigin_XBox360_RightTrigger_Click = 164, k_EInputActionOrigin_XBox360_LeftStick_Move = 165, k_EInputActionOrigin_XBox360_LeftStick_Click = 166, k_EInputActionOrigin_XBox360_LeftStick_DPadNorth = 167, k_EInputActionOrigin_XBox360_LeftStick_DPadSouth = 168, k_EInputActionOrigin_XBox360_LeftStick_DPadWest = 169, k_EInputActionOrigin_XBox360_LeftStick_DPadEast = 170, k_EInputActionOrigin_XBox360_RightStick_Move = 171, k_EInputActionOrigin_XBox360_RightStick_Click = 172, k_EInputActionOrigin_XBox360_RightStick_DPadNorth = 173, k_EInputActionOrigin_XBox360_RightStick_DPadSouth = 174, k_EInputActionOrigin_XBox360_RightStick_DPadWest = 175, k_EInputActionOrigin_XBox360_RightStick_DPadEast = 176, k_EInputActionOrigin_XBox360_DPad_North = 177, k_EInputActionOrigin_XBox360_DPad_South = 178, k_EInputActionOrigin_XBox360_DPad_West = 179, k_EInputActionOrigin_XBox360_DPad_East = 180, k_EInputActionOrigin_XBox360_DPad_Move = 181, k_EInputActionOrigin_XBox360_Reserved1 = 182, k_EInputActionOrigin_XBox360_Reserved2 = 183, k_EInputActionOrigin_XBox360_Reserved3 = 184, k_EInputActionOrigin_XBox360_Reserved4 = 185, k_EInputActionOrigin_XBox360_Reserved5 = 186, k_EInputActionOrigin_XBox360_Reserved6 = 187, k_EInputActionOrigin_XBox360_Reserved7 = 188, k_EInputActionOrigin_XBox360_Reserved8 = 189, k_EInputActionOrigin_XBox360_Reserved9 = 190, k_EInputActionOrigin_XBox360_Reserved10 = 191, k_EInputActionOrigin_Switch_A = 192, k_EInputActionOrigin_Switch_B = 193, k_EInputActionOrigin_Switch_X = 194, k_EInputActionOrigin_Switch_Y = 195, k_EInputActionOrigin_Switch_LeftBumper = 196, k_EInputActionOrigin_Switch_RightBumper = 197, k_EInputActionOrigin_Switch_Plus = 198, k_EInputActionOrigin_Switch_Minus = 199, k_EInputActionOrigin_Switch_Capture = 200, k_EInputActionOrigin_Switch_LeftTrigger_Pull = 201, k_EInputActionOrigin_Switch_LeftTrigger_Click = 202, k_EInputActionOrigin_Switch_RightTrigger_Pull = 203, k_EInputActionOrigin_Switch_RightTrigger_Click = 204, k_EInputActionOrigin_Switch_LeftStick_Move = 205, k_EInputActionOrigin_Switch_LeftStick_Click = 206, k_EInputActionOrigin_Switch_LeftStick_DPadNorth = 207, k_EInputActionOrigin_Switch_LeftStick_DPadSouth = 208, k_EInputActionOrigin_Switch_LeftStick_DPadWest = 209, k_EInputActionOrigin_Switch_LeftStick_DPadEast = 210, k_EInputActionOrigin_Switch_RightStick_Move = 211, k_EInputActionOrigin_Switch_RightStick_Click = 212, k_EInputActionOrigin_Switch_RightStick_DPadNorth = 213, k_EInputActionOrigin_Switch_RightStick_DPadSouth = 214, k_EInputActionOrigin_Switch_RightStick_DPadWest = 215, k_EInputActionOrigin_Switch_RightStick_DPadEast = 216, k_EInputActionOrigin_Switch_DPad_North = 217, k_EInputActionOrigin_Switch_DPad_South = 218, k_EInputActionOrigin_Switch_DPad_West = 219, k_EInputActionOrigin_Switch_DPad_East = 220, k_EInputActionOrigin_Switch_ProGyro_Move = 221, k_EInputActionOrigin_Switch_ProGyro_Pitch = 222, k_EInputActionOrigin_Switch_ProGyro_Yaw = 223, k_EInputActionOrigin_Switch_ProGyro_Roll = 224, k_EInputActionOrigin_Switch_DPad_Move = 225, k_EInputActionOrigin_Switch_Reserved1 = 226, k_EInputActionOrigin_Switch_Reserved2 = 227, k_EInputActionOrigin_Switch_Reserved3 = 228, k_EInputActionOrigin_Switch_Reserved4 = 229, k_EInputActionOrigin_Switch_Reserved5 = 230, k_EInputActionOrigin_Switch_Reserved6 = 231, k_EInputActionOrigin_Switch_Reserved7 = 232, k_EInputActionOrigin_Switch_Reserved8 = 233, k_EInputActionOrigin_Switch_Reserved9 = 234, k_EInputActionOrigin_Switch_Reserved10 = 235, k_EInputActionOrigin_Switch_RightGyro_Move = 236, k_EInputActionOrigin_Switch_RightGyro_Pitch = 237, k_EInputActionOrigin_Switch_RightGyro_Yaw = 238, k_EInputActionOrigin_Switch_RightGyro_Roll = 239, k_EInputActionOrigin_Switch_LeftGyro_Move = 240, k_EInputActionOrigin_Switch_LeftGyro_Pitch = 241, k_EInputActionOrigin_Switch_LeftGyro_Yaw = 242, k_EInputActionOrigin_Switch_LeftGyro_Roll = 243, k_EInputActionOrigin_Switch_LeftGrip_Lower = 244, k_EInputActionOrigin_Switch_LeftGrip_Upper = 245, k_EInputActionOrigin_Switch_RightGrip_Lower = 246, k_EInputActionOrigin_Switch_RightGrip_Upper = 247, k_EInputActionOrigin_Switch_Reserved11 = 248, k_EInputActionOrigin_Switch_Reserved12 = 249, k_EInputActionOrigin_Switch_Reserved13 = 250, k_EInputActionOrigin_Switch_Reserved14 = 251, k_EInputActionOrigin_Switch_Reserved15 = 252, k_EInputActionOrigin_Switch_Reserved16 = 253, k_EInputActionOrigin_Switch_Reserved17 = 254, k_EInputActionOrigin_Switch_Reserved18 = 255, k_EInputActionOrigin_Switch_Reserved19 = 256, k_EInputActionOrigin_Switch_Reserved20 = 257, k_EInputActionOrigin_Count = 258, k_EInputActionOrigin_MaximumPossibleValue = 32767 } public enum EXboxOrigin { k_EXboxOrigin_A, k_EXboxOrigin_B, k_EXboxOrigin_X, k_EXboxOrigin_Y, k_EXboxOrigin_LeftBumper, k_EXboxOrigin_RightBumper, k_EXboxOrigin_Menu, k_EXboxOrigin_View, k_EXboxOrigin_LeftTrigger_Pull, k_EXboxOrigin_LeftTrigger_Click, k_EXboxOrigin_RightTrigger_Pull, k_EXboxOrigin_RightTrigger_Click, k_EXboxOrigin_LeftStick_Move, k_EXboxOrigin_LeftStick_Click, k_EXboxOrigin_LeftStick_DPadNorth, k_EXboxOrigin_LeftStick_DPadSouth, k_EXboxOrigin_LeftStick_DPadWest, k_EXboxOrigin_LeftStick_DPadEast, k_EXboxOrigin_RightStick_Move, k_EXboxOrigin_RightStick_Click, k_EXboxOrigin_RightStick_DPadNorth, k_EXboxOrigin_RightStick_DPadSouth, k_EXboxOrigin_RightStick_DPadWest, k_EXboxOrigin_RightStick_DPadEast, k_EXboxOrigin_DPad_North, k_EXboxOrigin_DPad_South, k_EXboxOrigin_DPad_West, k_EXboxOrigin_DPad_East, k_EXboxOrigin_Count } public enum ESteamControllerPad { k_ESteamControllerPad_Left, k_ESteamControllerPad_Right } public enum ESteamInputType { k_ESteamInputType_Unknown = 0, k_ESteamInputType_SteamController = 1, k_ESteamInputType_XBox360Controller = 2, k_ESteamInputType_XBoxOneController = 3, k_ESteamInputType_GenericGamepad = 4, k_ESteamInputType_PS4Controller = 5, k_ESteamInputType_AppleMFiController = 6, k_ESteamInputType_AndroidController = 7, k_ESteamInputType_SwitchJoyConPair = 8, k_ESteamInputType_SwitchJoyConSingle = 9, k_ESteamInputType_SwitchProController = 10, k_ESteamInputType_MobileTouch = 11, k_ESteamInputType_PS3Controller = 12, k_ESteamInputType_Count = 13, k_ESteamInputType_MaximumPossibleValue = 255 } public enum ESteamInputLEDFlag { k_ESteamInputLEDFlag_SetColor, k_ESteamInputLEDFlag_RestoreUserDefault } [Flags] public enum ESteamItemFlags { k_ESteamItemNoTrade = 1, k_ESteamItemRemoved = 0x100, k_ESteamItemConsumed = 0x200 } public enum ELobbyType { k_ELobbyTypePrivate, k_ELobbyTypeFriendsOnly, k_ELobbyTypePublic, k_ELobbyTypeInvisible, k_ELobbyTypePrivateUnique } public enum ELobbyComparison { k_ELobbyComparisonEqualToOrLessThan = -2, k_ELobbyComparisonLessThan, k_ELobbyComparisonEqual, k_ELobbyComparisonGreaterThan, k_ELobbyComparisonEqualToOrGreaterThan, k_ELobbyComparisonNotEqual } public enum ELobbyDistanceFilter { k_ELobbyDistanceFilterClose, k_ELobbyDistanceFilterDefault, k_ELobbyDistanceFilterFar, k_ELobbyDistanceFilterWorldwide } [Flags] public enum EChatMemberStateChange { k_EChatMemberStateChangeEntered = 1, k_EChatMemberStateChangeLeft = 2, k_EChatMemberStateChangeDisconnected = 4, k_EChatMemberStateChangeKicked = 8, k_EChatMemberStateChangeBanned = 0x10 } public enum ESteamPartyBeaconLocationType { k_ESteamPartyBeaconLocationType_Invalid, k_ESteamPartyBeaconLocationType_ChatGroup, k_ESteamPartyBeaconLocationType_Max } public enum ESteamPartyBeaconLocationData { k_ESteamPartyBeaconLocationDataInvalid, k_ESteamPartyBeaconLocationDataName, k_ESteamPartyBeaconLocationDataIconURLSmall, k_ESteamPartyBeaconLocationDataIconURLMedium, k_ESteamPartyBeaconLocationDataIconURLLarge } public enum PlayerAcceptState_t { k_EStateUnknown, k_EStatePlayerAccepted, k_EStatePlayerDeclined } public enum AudioPlayback_Status { AudioPlayback_Undefined, AudioPlayback_Playing, AudioPlayback_Paused, AudioPlayback_Idle } public enum EP2PSessionError { k_EP2PSessionErrorNone, k_EP2PSessionErrorNotRunningApp, k_EP2PSessionErrorNoRightsToApp, k_EP2PSessionErrorDestinationNotLoggedIn, k_EP2PSessionErrorTimeout, k_EP2PSessionErrorMax } public enum EP2PSend { k_EP2PSendUnreliable, k_EP2PSendUnreliableNoDelay, k_EP2PSendReliable, k_EP2PSendReliableWithBuffering } public enum ESNetSocketState { k_ESNetSocketStateInvalid = 0, k_ESNetSocketStateConnected = 1, k_ESNetSocketStateInitiated = 10, k_ESNetSocketStateLocalCandidatesFound = 11, k_ESNetSocketStateReceivedRemoteCandidates = 12, k_ESNetSocketStateChallengeHandshake = 15, k_ESNetSocketStateDisconnecting = 21, k_ESNetSocketStateLocalDisconnect = 22, k_ESNetSocketStateTimeoutDuringConnect = 23, k_ESNetSocketStateRemoteEndDisconnected = 24, k_ESNetSocketStateConnectionBroken = 25 } public enum ESNetSocketConnectionType { k_ESNetSocketConnectionTypeNotConnected, k_ESNetSocketConnectionTypeUDP, k_ESNetSocketConnectionTypeUDPRelay } public enum EParentalFeature { k_EFeatureInvalid, k_EFeatureStore, k_EFeatureCommunity, k_EFeatureProfile, k_EFeatureFriends, k_EFeatureNews, k_EFeatureTrading, k_EFeatureSettings, k_EFeatureConsole, k_EFeatureBrowser, k_EFeatureParentalSetup, k_EFeatureLibrary, k_EFeatureTest, k_EFeatureSiteLicense, k_EFeatureMax } public enum ESteamDeviceFormFactor { k_ESteamDeviceFormFactorUnknown, k_ESteamDeviceFormFactorPhone, k_ESteamDeviceFormFactorTablet, k_ESteamDeviceFormFactorComputer, k_ESteamDeviceFormFactorTV } [Flags] public enum ERemoteStoragePlatform { k_ERemoteStoragePlatformNone = 0, k_ERemoteStoragePlatformWindows = 1, k_ERemoteStoragePlatformOSX = 2, k_ERemoteStoragePlatformPS3 = 4, k_ERemoteStoragePlatformLinux = 8, k_ERemoteStoragePlatformSwitch = 0x10, k_ERemoteStoragePlatformAndroid = 0x20, k_ERemoteStoragePlatformIOS = 0x40, k_ERemoteStoragePlatformAll = -1 } public enum ERemoteStoragePublishedFileVisibility { k_ERemoteStoragePublishedFileVisibilityPublic, k_ERemoteStoragePublishedFileVisibilityFriendsOnly, k_ERemoteStoragePublishedFileVisibilityPrivate, k_ERemoteStoragePublishedFileVisibilityUnlisted } public enum EWorkshopFileType { k_EWorkshopFileTypeFirst = 0, k_EWorkshopFileTypeCommunity = 0, k_EWorkshopFileTypeMicrotransaction = 1, k_EWorkshopFileTypeCollection = 2, k_EWorkshopFileTypeArt = 3, k_EWorkshopFileTypeVideo = 4, k_EWorkshopFileTypeScreenshot = 5, k_EWorkshopFileTypeGame = 6, k_EWorkshopFileTypeSoftware = 7, k_EWorkshopFileTypeConcept = 8, k_EWorkshopFileTypeWebGuide = 9, k_EWorkshopFileTypeIntegratedGuide = 10, k_EWorkshopFileTypeMerch = 11, k_EWorkshopFileTypeControllerBinding = 12, k_EWorkshopFileTypeSteamworksAccessInvite = 13, k_EWorkshopFileTypeSteamVideo = 14, k_EWorkshopFileTypeGameManagedItem = 15, k_EWorkshopFileTypeMax = 16 } public enum EWorkshopVote { k_EWorkshopVoteUnvoted, k_EWorkshopVoteFor, k_EWorkshopVoteAgainst, k_EWorkshopVoteLater } public enum EWorkshopFileAction { k_EWorkshopFileActionPlayed, k_EWorkshopFileActionCompleted } public enum EWorkshopEnumerationType { k_EWorkshopEnumerationTypeRankedByVote, k_EWorkshopEnumerationTypeRecent, k_EWorkshopEnumerationTypeTrending, k_EWorkshopEnumerationTypeFavoritesOfFriends, k_EWorkshopEnumerationTypeVotedByFriends, k_EWorkshopEnumerationTypeContentByFriends, k_EWorkshopEnumerationTypeRecentFromFollowedUsers } public enum EWorkshopVideoProvider { k_EWorkshopVideoProviderNone, k_EWorkshopVideoProviderYoutube } public enum EUGCReadAction { k_EUGCRead_ContinueReadingUntilFinished, k_EUGCRead_ContinueReading, k_EUGCRead_Close } public enum EVRScreenshotType { k_EVRScreenshotType_None, k_EVRScreenshotType_Mono, k_EVRScreenshotType_Stereo, k_EVRScreenshotType_MonoCubemap, k_EVRScreenshotType_MonoPanorama, k_EVRScreenshotType_StereoPanorama } public enum EUGCMatchingUGCType { k_EUGCMatchingUGCType_Items = 0, k_EUGCMatchingUGCType_Items_Mtx = 1, k_EUGCMatchingUGCType_Items_ReadyToUse = 2, k_EUGCMatchingUGCType_Collections = 3, k_EUGCMatchingUGCType_Artwork = 4, k_EUGCMatchingUGCType_Videos = 5, k_EUGCMatchingUGCType_Screenshots = 6, k_EUGCMatchingUGCType_AllGuides = 7, k_EUGCMatchingUGCType_WebGuides = 8, k_EUGCMatchingUGCType_IntegratedGuides = 9, k_EUGCMatchingUGCType_UsableInGame = 10, k_EUGCMatchingUGCType_ControllerBindings = 11, k_EUGCMatchingUGCType_GameManagedItems = 12, k_EUGCMatchingUGCType_All = -1 } public enum EUserUGCList { k_EUserUGCList_Published, k_EUserUGCList_VotedOn, k_EUserUGCList_VotedUp, k_EUserUGCList_VotedDown, k_EUserUGCList_WillVoteLater, k_EUserUGCList_Favorited, k_EUserUGCList_Subscribed, k_EUserUGCList_UsedOrPlayed, k_EUserUGCList_Followed } public enum EUserUGCListSortOrder { k_EUserUGCListSortOrder_CreationOrderDesc, k_EUserUGCListSortOrder_CreationOrderAsc, k_EUserUGCListSortOrder_TitleAsc, k_EUserUGCListSortOrder_LastUpdatedDesc, k_EUserUGCListSortOrder_SubscriptionDateDesc, k_EUserUGCListSortOrder_VoteScoreDesc, k_EUserUGCListSortOrder_ForModeration } public enum EUGCQuery { k_EUGCQuery_RankedByVote, k_EUGCQuery_RankedByPublicationDate, k_EUGCQuery_AcceptedForGameRankedByAcceptanceDate, k_EUGCQuery_RankedByTrend, k_EUGCQuery_FavoritedByFriendsRankedByPublicationDate, k_EUGCQuery_CreatedByFriendsRankedByPublicationDate, k_EUGCQuery_RankedByNumTimesReported, k_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate, k_EUGCQuery_NotYetRated, k_EUGCQuery_RankedByTotalVotesAsc, k_EUGCQuery_RankedByVotesUp, k_EUGCQuery_RankedByTextSearch, k_EUGCQuery_RankedByTotalUniqueSubscriptions, k_EUGCQuery_RankedByPlaytimeTrend, k_EUGCQuery_RankedByTotalPlaytime, k_EUGCQuery_RankedByAveragePlaytimeTrend, k_EUGCQuery_RankedByLifetimeAveragePlaytime, k_EUGCQuery_RankedByPlaytimeSessionsTrend, k_EUGCQuery_RankedByLifetimePlaytimeSessions } public enum EItemUpdateStatus { k_EItemUpdateStatusInvalid, k_EItemUpdateStatusPreparingConfig, k_EItemUpdateStatusPreparingContent, k_EItemUpdateStatusUploadingContent, k_EItemUpdateStatusUploadingPreviewFile, k_EItemUpdateStatusCommittingChanges } [Flags] public enum EItemState { k_EItemStateNone = 0, k_EItemStateSubscribed = 1, k_EItemStateLegacyItem = 2, k_EItemStateInstalled = 4, k_EItemStateNeedsUpdate = 8, k_EItemStateDownloading = 0x10, k_EItemStateDownloadPending = 0x20 } public enum EItemStatistic { k_EItemStatistic_NumSubscriptions, k_EItemStatistic_NumFavorites, k_EItemStatistic_NumFollowers, k_EItemStatistic_NumUniqueSubscriptions, k_EItemStatistic_NumUniqueFavorites, k_EItemStatistic_NumUniqueFollowers, k_EItemStatistic_NumUniqueWebsiteViews, k_EItemStatistic_ReportScore, k_EItemStatistic_NumSecondsPlayed, k_EItemStatistic_NumPlaytimeSessions, k_EItemStatistic_NumComments, k_EItemStatistic_NumSecondsPlayedDuringTimePeriod, k_EItemStatistic_NumPlaytimeSessionsDuringTimePeriod } public enum EItemPreviewType { k_EItemPreviewType_Image = 0, k_EItemPreviewType_YouTubeVideo = 1, k_EItemPreviewType_Sketchfab = 2, k_EItemPreviewType_EnvironmentMap_HorizontalCross = 3, k_EItemPreviewType_EnvironmentMap_LatLong = 4, k_EItemPreviewType_ReservedMax = 255 } public enum EFailureType { k_EFailureFlushedCallbackQueue, k_EFailurePipeFail } public enum ELeaderboardDataRequest { k_ELeaderboardDataRequestGlobal, k_ELeaderboardDataRequestGlobalAroundUser, k_ELeaderboardDataRequestFriends, k_ELeaderboardDataRequestUsers } public enum ELeaderboardSortMethod { k_ELeaderboardSortMethodNone, k_ELeaderboardSortMethodAscending, k_ELeaderboardSortMethodDescending } public enum ELeaderboardDisplayType { k_ELeaderboardDisplayTypeNone, k_ELeaderboardDisplayTypeNumeric, k_ELeaderboardDisplayTypeTimeSeconds, k_ELeaderboardDisplayTypeTimeMilliSeconds } public enum ELeaderboardUploadScoreMethod { k_ELeaderboardUploadScoreMethodNone, k_ELeaderboardUploadScoreMethodKeepBest, k_ELeaderboardUploadScoreMethodForceUpdate } public enum ESteamAPICallFailure { k_ESteamAPICallFailureNone = -1, k_ESteamAPICallFailureSteamGone, k_ESteamAPICallFailureNetworkFailure, k_ESteamAPICallFailureInvalidHandle, k_ESteamAPICallFailureMismatchedCallback } public enum EGamepadTextInputMode { k_EGamepadTextInputModeNormal, k_EGamepadTextInputModePassword } public enum EGamepadTextInputLineMode { k_EGamepadTextInputLineModeSingleLine, k_EGamepadTextInputLineModeMultipleLines } public enum ECheckFileSignature { k_ECheckFileSignatureInvalidSignature, k_ECheckFileSignatureValidSignature, k_ECheckFileSignatureFileNotFound, k_ECheckFileSignatureNoSignaturesFoundForThisApp, k_ECheckFileSignatureNoSignaturesFoundForThisFile } public enum EMatchMakingServerResponse { eServerResponded, eServerFailedToRespond, eNoServersListedOnMasterServer } public enum EServerMode { eServerModeInvalid, eServerModeNoAuthentication, eServerModeAuthentication, eServerModeAuthenticationAndSecure } public enum EResult { k_EResultNone = 0, k_EResultOK = 1, k_EResultFail = 2, k_EResultNoConnection = 3, k_EResultInvalidPassword = 5, k_EResultLoggedInElsewhere = 6, k_EResultInvalidProtocolVer = 7, k_EResultInvalidParam = 8, k_EResultFileNotFound = 9, k_EResultBusy = 10, k_EResultInvalidState = 11, k_EResultInvalidName = 12, k_EResultInvalidEmail = 13, k_EResultDuplicateName = 14, k_EResultAccessDenied = 15, k_EResultTimeout = 16, k_EResultBanned = 17, k_EResultAccountNotFound = 18, k_EResultInvalidSteamID = 19, k_EResultServiceUnavailable = 20, k_EResultNotLoggedOn = 21, k_EResultPending = 22, k_EResultEncryptionFailure = 23, k_EResultInsufficientPrivilege = 24, k_EResultLimitExceeded = 25, k_EResultRevoked = 26, k_EResultExpired = 27, k_EResultAlreadyRedeemed = 28, k_EResultDuplicateRequest = 29, k_EResultAlreadyOwned = 30, k_EResultIPNotFound = 31, k_EResultPersistFailed = 32, k_EResultLockingFailed = 33, k_EResultLogonSessionReplaced = 34, k_EResultConnectFailed = 35, k_EResultHandshakeFailed = 36, k_EResultIOFailure = 37, k_EResultRemoteDisconnect = 38, k_EResultShoppingCartNotFound = 39, k_EResultBlocked = 40, k_EResultIgnored = 41, k_EResultNoMatch = 42, k_EResultAccountDisabled = 43, k_EResultServiceReadOnly = 44, k_EResultAccountNotFeatured = 45, k_EResultAdministratorOK = 46, k_EResultContentVersion = 47, k_EResultTryAnotherCM = 48, k_EResultPasswordRequiredToKickSession = 49, k_EResultAlreadyLoggedInElsewhere = 50, k_EResultSuspended = 51, k_EResultCancelled = 52, k_EResultDataCorruption = 53, k_EResultDiskFull = 54, k_EResultRemoteCallFailed = 55, k_EResultPasswordUnset = 56, k_EResultExternalAccountUnlinked = 57, k_EResultPSNTicketInvalid = 58, k_EResultExternalAccountAlreadyLinked = 59, k_EResultRemoteFileConflict = 60, k_EResultIllegalPassword = 61, k_EResultSameAsPreviousValue = 62, k_EResultAccountLogonDenied = 63, k_EResultCannotUseOldPassword = 64, k_EResultInvalidLoginAuthCode = 65, k_EResultAccountLogonDeniedNoMail = 66, k_EResultHardwareNotCapableOfIPT = 67, k_EResultIPTInitError = 68, k_EResultParentalControlRestricted = 69, k_EResultFacebookQueryError = 70, k_EResultExpiredLoginAuthCode = 71, k_EResultIPLoginRestrictionFailed = 72, k_EResultAccountLockedDown = 73, k_EResultAccountLogonDeniedVerifiedEmailRequired = 74, k_EResultNoMatchingURL = 75, k_EResultBadResponse = 76, k_EResultRequirePasswordReEntry = 77, k_EResultValueOutOfRange = 78, k_EResultUnexpectedError = 79, k_EResultDisabled = 80, k_EResultInvalidCEGSubmission = 81, k_EResultRestrictedDevice = 82, k_EResultRegionLocked = 83, k_EResultRateLimitExceeded = 84, k_EResultAccountLoginDeniedNeedTwoFactor = 85, k_EResultItemDeleted = 86, k_EResultAccountLoginDeniedThrottle = 87, k_EResultTwoFactorCodeMismatch = 88, k_EResultTwoFactorActivationCodeMismatch = 89, k_EResultAccountAssociatedToMultiplePartners = 90, k_EResultNotModified = 91, k_EResultNoMobileDevice = 92, k_EResultTimeNotSynced = 93, k_EResultSmsCodeFailed = 94, k_EResultAccountLimitExceeded = 95, k_EResultAccountActivityLimitExceeded = 96, k_EResultPhoneActivityLimitExceeded = 97, k_EResultRefundToWallet = 98, k_EResultEmailSendFailure = 99, k_EResultNotSettled = 100, k_EResultNeedCaptcha = 101, k_EResultGSLTDenied = 102, k_EResultGSOwnerDenied = 103, k_EResultInvalidItemType = 104, k_EResultIPBanned = 105, k_EResultGSLTExpired = 106, k_EResultInsufficientFunds = 107, k_EResultTooManyPending = 108, k_EResultNoSiteLicensesFound = 109, k_EResultWGNetworkSendExceeded = 110, k_EResultAccountNotFriends = 111, k_EResultLimitedUserAccount = 112, k_EResultCantRemoveItem = 113, k_EResultAccountDeleted = 114, k_EResultExistingUserCancelledLicense = 115 } public enum EVoiceResult { k_EVoiceResultOK, k_EVoiceResultNotInitialized, k_EVoiceResultNotRecording, k_EVoiceResultNoData, k_EVoiceResultBufferTooSmall, k_EVoiceResultDataCorrupted, k_EVoiceResultRestricted, k_EVoiceResultUnsupportedCodec, k_EVoiceResultReceiverOutOfDate, k_EVoiceResultReceiverDidNotAnswer } public enum EDenyReason { k_EDenyInvalid, k_EDenyInvalidVersion, k_EDenyGeneric, k_EDenyNotLoggedOn, k_EDenyNoLicense, k_EDenyCheater, k_EDenyLoggedInElseWhere, k_EDenyUnknownText, k_EDenyIncompatibleAnticheat, k_EDenyMemoryCorruption, k_EDenyIncompatibleSoftware, k_EDenySteamConnectionLost, k_EDenySteamConnectionError, k_EDenySteamResponseTimedOut, k_EDenySteamValidationStalled, k_EDenySteamOwnerLeftGuestUser } public enum EBeginAuthSessionResult { k_EBeginAuthSessionResultOK, k_EBeginAuthSessionResultInvalidTicket, k_EBeginAuthSessionResultDuplicateRequest, k_EBeginAuthSessionResultInvalidVersion, k_EBeginAuthSessionResultGameMismatch, k_EBeginAuthSessionResultExpiredTicket } public enum EAuthSessionResponse { k_EAuthSessionResponseOK, k_EAuthSessionResponseUserNotConnectedToSteam, k_EAuthSessionResponseNoLicenseOrExpired, k_EAuthSessionResponseVACBanned, k_EAuthSessionResponseLoggedInElseWhere, k_EAuthSessionResponseVACCheckTimedOut, k_EAuthSessionResponseAuthTicketCanceled, k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed, k_EAuthSessionResponseAuthTicketInvalid, k_EAuthSessionResponsePublisherIssuedBan } public enum EUserHasLicenseForAppResult { k_EUserHasLicenseResultHasLicense, k_EUserHasLicenseResultDoesNotHaveLicense, k_EUserHasLicenseResultNoAuth } public enum EAccountType { k_EAccountTypeInvalid, k_EAccountTypeIndividual, k_EAccountTypeMultiseat, k_EAccountTypeGameServer, k_EAccountTypeAnonGameServer, k_EAccountTypePending, k_EAccountTypeContentServer, k_EAccountTypeClan, k_EAccountTypeChat, k_EAccountTypeConsoleUser, k_EAccountTypeAnonUser, k_EAccountTypeMax } public enum EAppReleaseState { k_EAppReleaseState_Unknown, k_EAppReleaseState_Unavailable, k_EAppReleaseState_Prerelease, k_EAppReleaseState_PreloadOnly, k_EAppReleaseState_Released } [Flags] public enum EAppOwnershipFlags { k_EAppOwnershipFlags_None = 0, k_EAppOwnershipFlags_OwnsLicense = 1, k_EAppOwnershipFlags_FreeLicense = 2, k_EAppOwnershipFlags_RegionRestricted = 4, k_EAppOwnershipFlags_LowViolence = 8, k_EAppOwnershipFlags_InvalidPlatform = 0x10, k_EAppOwnershipFlags_SharedLicense = 0x20, k_EAppOwnershipFlags_FreeWeekend = 0x40, k_EAppOwnershipFlags_RetailLicense = 0x80, k_EAppOwnershipFlags_LicenseLocked = 0x100, k_EAppOwnershipFlags_LicensePending = 0x200, k_EAppOwnershipFlags_LicenseExpired = 0x400, k_EAppOwnershipFlags_LicensePermanent = 0x800, k_EAppOwnershipFlags_LicenseRecurring = 0x1000, k_EAppOwnershipFlags_LicenseCanceled = 0x2000, k_EAppOwnershipFlags_AutoGrant = 0x4000, k_EAppOwnershipFlags_PendingGift = 0x8000, k_EAppOwnershipFlags_RentalNotActivated = 0x10000, k_EAppOwnershipFlags_Rental = 0x20000, k_EAppOwnershipFlags_SiteLicense = 0x40000, k_EAppOwnershipFlags_LegacyFreeSub = 0x80000, k_EAppOwnershipFlags_InvalidOSType = 0x100000 } [Flags] public enum EAppType { k_EAppType_Invalid = 0, k_EAppType_Game = 1, k_EAppType_Application = 2, k_EAppType_Tool = 4, k_EAppType_Demo = 8, k_EAppType_Media_DEPRECATED = 0x10, k_EAppType_DLC = 0x20, k_EAppType_Guide = 0x40, k_EAppType_Driver = 0x80, k_EAppType_Config = 0x100, k_EAppType_Hardware = 0x200, k_EAppType_Franchise = 0x400, k_EAppType_Video = 0x800, k_EAppType_Plugin = 0x1000, k_EAppType_MusicAlbum = 0x2000, k_EAppType_Series = 0x4000, k_EAppType_Comic_UNUSED = 0x8000, k_EAppType_Beta = 0x10000, k_EAppType_Shortcut = 0x40000000, k_EAppType_DepotOnly = -2147483647 } public enum ESteamUserStatType { k_ESteamUserStatTypeINVALID, k_ESteamUserStatTypeINT, k_ESteamUserStatTypeFLOAT, k_ESteamUserStatTypeAVGRATE, k_ESteamUserStatTypeACHIEVEMENTS, k_ESteamUserStatTypeGROUPACHIEVEMENTS, k_ESteamUserStatTypeMAX } public enum EChatEntryType { k_EChatEntryTypeInvalid = 0, k_EChatEntryTypeChatMsg = 1, k_EChatEntryTypeTyping = 2, k_EChatEntryTypeInviteGame = 3, k_EChatEntryTypeEmote = 4, k_EChatEntryTypeLeftConversation = 6, k_EChatEntryTypeEntered = 7, k_EChatEntryTypeWasKicked = 8, k_EChatEntryTypeWasBanned = 9, k_EChatEntryTypeDisconnected = 10, k_EChatEntryTypeHistoricalChat = 11, k_EChatEntryTypeLinkBlocked = 14 } public enum EChatRoomEnterResponse { k_EChatRoomEnterResponseSuccess = 1, k_EChatRoomEnterResponseDoesntExist = 2, k_EChatRoomEnterResponseNotAllowed = 3, k_EChatRoomEnterResponseFull = 4, k_EChatRoomEnterResponseError = 5, k_EChatRoomEnterResponseBanned = 6, k_EChatRoomEnterResponseLimited = 7, k_EChatRoomEnterResponseClanDisabled = 8, k_EChatRoomEnterResponseCommunityBan = 9, k_EChatRoomEnterResponseMemberBlockedYou = 10, k_EChatRoomEnterResponseYouBlockedMember = 11, k_EChatRoomEnterResponseRatelimitExceeded = 15 } [Flags] public enum EChatSteamIDInstanceFlags { k_EChatAccountInstanceMask = 0xFFF, k_EChatInstanceFlagClan = 0x80000, k_EChatInstanceFlagLobby = 0x40000, k_EChatInstanceFlagMMSLobby = 0x20000 } [Flags] public enum EMarketingMessageFlags { k_EMarketingMessageFlagsNone = 0, k_EMarketingMessageFlagsHighPriority = 1, k_EMarketingMessageFlagsPlatformWindows = 2, k_EMarketingMessageFlagsPlatformMac = 4, k_EMarketingMessageFlagsPlatformLinux = 8, k_EMarketingMessageFlagsPlatformRestrictions = 0xE } public enum ENotificationPosition { k_EPositionTopLeft, k_EPositionTopRight, k_EPositionBottomLeft, k_EPositionBottomRight } public enum EBroadcastUploadResult { k_EBroadcastUploadResultNone, k_EBroadcastUploadResultOK, k_EBroadcastUploadResultInitFailed, k_EBroadcastUploadResultFrameFailed, k_EBroadcastUploadResultTimeout, k_EBroadcastUploadResultBandwidthExceeded, k_EBroadcastUploadResultLowFPS, k_EBroadcastUploadResultMissingKeyFrames, k_EBroadcastUploadResultNoConnection, k_EBroadcastUploadResultRelayFailed, k_EBroadcastUploadResultSettingsChanged, k_EBroadcastUploadResultMissingAudio, k_EBroadcastUploadResultTooFarBehind, k_EBroadcastUploadResultTranscodeBehind, k_EBroadcastUploadResultNotAllowedToPlay, k_EBroadcastUploadResultBusy, k_EBroadcastUploadResultBanned, k_EBroadcastUploadResultAlreadyActive, k_EBroadcastUploadResultForcedOff, k_EBroadcastUploadResultAudioBehind, k_EBroadcastUploadResultShutdown, k_EBroadcastUploadResultDisconnect, k_EBroadcastUploadResultVideoInitFailed, k_EBroadcastUploadResultAudioInitFailed } public enum ELaunchOptionType { k_ELaunchOptionType_None = 0, k_ELaunchOptionType_Default = 1, k_ELaunchOptionType_SafeMode = 2, k_ELaunchOptionType_Multiplayer = 3, k_ELaunchOptionType_Config = 4, k_ELaunchOptionType_OpenVR = 5, k_ELaunchOptionType_Server = 6, k_ELaunchOptionType_Editor = 7, k_ELaunchOptionType_Manual = 8, k_ELaunchOptionType_Benchmark = 9, k_ELaunchOptionType_Option1 = 10, k_ELaunchOptionType_Option2 = 11, k_ELaunchOptionType_Option3 = 12, k_ELaunchOptionType_OculusVR = 13, k_ELaunchOptionType_OpenVROverlay = 14, k_ELaunchOptionType_OSVR = 15, k_ELaunchOptionType_Dialog = 1000 } public enum EVRHMDType { k_eEVRHMDType_None = -1, k_eEVRHMDType_Unknown = 0, k_eEVRHMDType_HTC_Dev = 1, k_eEVRHMDType_HTC_VivePre = 2, k_eEVRHMDType_HTC_Vive = 3, k_eEVRHMDType_HTC_VivePro = 4, k_eEVRHMDType_HTC_ViveCosmos = 5, k_eEVRHMDType_HTC_Unknown = 20, k_eEVRHMDType_Oculus_DK1 = 21, k_eEVRHMDType_Oculus_DK2 = 22, k_eEVRHMDType_Oculus_Rift = 23, k_eEVRHMDType_Oculus_RiftS = 24, k_eEVRHMDType_Oculus_Quest = 25, k_eEVRHMDType_Oculus_Unknown = 40, k_eEVRHMDType_Acer_Unknown = 50, k_eEVRHMDType_Acer_WindowsMR = 51, k_eEVRHMDType_Dell_Unknown = 60, k_eEVRHMDType_Dell_Visor = 61, k_eEVRHMDType_Lenovo_Unknown = 70, k_eEVRHMDType_Lenovo_Explorer = 71, k_eEVRHMDType_HP_Unknown = 80, k_eEVRHMDType_HP_WindowsMR = 81, k_eEVRHMDType_HP_Reverb = 82, k_eEVRHMDType_Samsung_Unknown = 90, k_eEVRHMDType_Samsung_Odyssey = 91, k_eEVRHMDType_Unannounced_Unknown = 100, k_eEVRHMDType_Unannounced_WindowsMR = 101, k_eEVRHMDType_vridge = 110, k_eEVRHMDType_Huawei_Unknown = 120, k_eEVRHMDType_Huawei_VR2 = 121, k_eEVRHMDType_Huawei_EndOfRange = 129, k_eEVRHmdType_Valve_Unknown = 130, k_eEVRHmdType_Valve_Index = 131 } [Flags] public enum EMarketNotAllowedReasonFlags { k_EMarketNotAllowedReason_None = 0, k_EMarketNotAllowedReason_TemporaryFailure = 1, k_EMarketNotAllowedReason_AccountDisabled = 2, k_EMarketNotAllowedReason_AccountLockedDown = 4, k_EMarketNotAllowedReason_AccountLimited = 8, k_EMarketNotAllowedReason_TradeBanned = 0x10, k_EMarketNotAllowedReason_AccountNotTrusted = 0x20, k_EMarketNotAllowedReason_SteamGuardNotEnabled = 0x40, k_EMarketNotAllowedReason_SteamGuardOnlyRecentlyEnabled = 0x80, k_EMarketNotAllowedReason_RecentPasswordReset = 0x100, k_EMarketNotAllowedReason_NewPaymentMethod = 0x200, k_EMarketNotAllowedReason_InvalidCookie = 0x400, k_EMarketNotAllowedReason_UsingNewDevice = 0x800, k_EMarketNotAllowedReason_RecentSelfRefund = 0x1000, k_EMarketNotAllowedReason_NewPaymentMethodCannotBeVerified = 0x2000, k_EMarketNotAllowedReason_NoRecentPurchases = 0x4000, k_EMarketNotAllowedReason_AcceptedWalletGift = 0x8000 } public enum EDurationControlProgress { k_EDurationControlProgress_Full, k_EDurationControlProgress_Half, k_EDurationControlProgress_None, k_EDurationControl_ExitSoon_3h, k_EDurationControl_ExitSoon_5h, k_EDurationControl_ExitSoon_Night } public enum EDurationControlNotification { k_EDurationControlNotification_None, k_EDurationControlNotification_1Hour, k_EDurationControlNotification_3Hours, k_EDurationControlNotification_HalfProgress, k_EDurationControlNotification_NoProgress, k_EDurationControlNotification_ExitSoon_3h, k_EDurationControlNotification_ExitSoon_5h, k_EDurationControlNotification_ExitSoon_Night } public enum EGameSearchErrorCode_t { k_EGameSearchErrorCode_OK = 1, k_EGameSearchErrorCode_Failed_Search_Already_In_Progress, k_EGameSearchErrorCode_Failed_No_Search_In_Progress, k_EGameSearchErrorCode_Failed_Not_Lobby_Leader, k_EGameSearchErrorCode_Failed_No_Host_Available, k_EGameSearchErrorCode_Failed_Search_Params_Invalid, k_EGameSearchErrorCode_Failed_Offline, k_EGameSearchErrorCode_Failed_NotAuthorized, k_EGameSearchErrorCode_Failed_Unknown_Error } public enum EPlayerResult_t { k_EPlayerResultFailedToConnect = 1, k_EPlayerResultAbandoned, k_EPlayerResultKicked, k_EPlayerResultIncomplete, k_EPlayerResultCompleted } public enum ESteamIPv6ConnectivityProtocol { k_ESteamIPv6ConnectivityProtocol_Invalid, k_ESteamIPv6ConnectivityProtocol_HTTP, k_ESteamIPv6ConnectivityProtocol_UDP } public enum ESteamIPv6ConnectivityState { k_ESteamIPv6ConnectivityState_Unknown, k_ESteamIPv6ConnectivityState_Good, k_ESteamIPv6ConnectivityState_Bad } public enum EHTTPMethod { k_EHTTPMethodInvalid, k_EHTTPMethodGET, k_EHTTPMethodHEAD, k_EHTTPMethodPOST, k_EHTTPMethodPUT, k_EHTTPMethodDELETE, k_EHTTPMethodOPTIONS, k_EHTTPMethodPATCH } public enum EHTTPStatusCode { k_EHTTPStatusCodeInvalid = 0, k_EHTTPStatusCode100Continue = 100, k_EHTTPStatusCode101SwitchingProtocols = 101, k_EHTTPStatusCode200OK = 200, k_EHTTPStatusCode201Created = 201, k_EHTTPStatusCode202Accepted = 202, k_EHTTPStatusCode203NonAuthoritative = 203, k_EHTTPStatusCode204NoContent = 204, k_EHTTPStatusCode205ResetContent = 205, k_EHTTPStatusCode206PartialContent = 206, k_EHTTPStatusCode300MultipleChoices = 300, k_EHTTPStatusCode301MovedPermanently = 301, k_EHTTPStatusCode302Found = 302, k_EHTTPStatusCode303SeeOther = 303, k_EHTTPStatusCode304NotModified = 304, k_EHTTPStatusCode305UseProxy = 305, k_EHTTPStatusCode307TemporaryRedirect = 307, k_EHTTPStatusCode400BadRequest = 400, k_EHTTPStatusCode401Unauthorized = 401, k_EHTTPStatusCode402PaymentRequired = 402, k_EHTTPStatusCode403Forbidden = 403, k_EHTTPStatusCode404NotFound = 404, k_EHTTPStatusCode405MethodNotAllowed = 405, k_EHTTPStatusCode406NotAcceptable = 406, k_EHTTPStatusCode407ProxyAuthRequired = 407, k_EHTTPStatusCode408RequestTimeout = 408, k_EHTTPStatusCode409Conflict = 409, k_EHTTPStatusCode410Gone = 410, k_EHTTPStatusCode411LengthRequired = 411, k_EHTTPStatusCode412PreconditionFailed = 412, k_EHTTPStatusCode413RequestEntityTooLarge = 413, k_EHTTPStatusCode414RequestURITooLong = 414, k_EHTTPStatusCode415UnsupportedMediaType = 415, k_EHTTPStatusCode416RequestedRangeNotSatisfiable = 416, k_EHTTPStatusCode417ExpectationFailed = 417, k_EHTTPStatusCode4xxUnknown = 418, k_EHTTPStatusCode429TooManyRequests = 429, k_EHTTPStatusCode500InternalServerError = 500, k_EHTTPStatusCode501NotImplemented = 501, k_EHTTPStatusCode502BadGateway = 502, k_EHTTPStatusCode503ServiceUnavailable = 503, k_EHTTPStatusCode504GatewayTimeout = 504, k_EHTTPStatusCode505HTTPVersionNotSupported = 505, k_EHTTPStatusCode5xxUnknown = 599 } public enum ESteamNetworkingAvailability { k_ESteamNetworkingAvailability_CannotTry = -102, k_ESteamNetworkingAvailability_Failed = -101, k_ESteamNetworkingAvailability_Previously = -100, k_ESteamNetworkingAvailability_Retrying = -10, k_ESteamNetworkingAvailability_NeverTried = 1, k_ESteamNetworkingAvailability_Waiting = 2, k_ESteamNetworkingAvailability_Attempting = 3, k_ESteamNetworkingAvailability_Current = 100, k_ESteamNetworkingAvailability_Unknown = 0, k_ESteamNetworkingAvailability__Force32bit = int.MaxValue } public enum ESteamNetworkingIdentityType { k_ESteamNetworkingIdentityType_Invalid = 0, k_ESteamNetworkingIdentityType_SteamID = 16, k_ESteamNetworkingIdentityType_IPAddress = 1, k_ESteamNetworkingIdentityType_GenericString = 2, k_ESteamNetworkingIdentityType_GenericBytes = 3, k_ESteamNetworkingIdentityType_UnknownType = 4, k_ESteamNetworkingIdentityType__Force32bit = int.MaxValue } public enum ESteamNetworkingConnectionState { k_ESteamNetworkingConnectionState_None = 0, k_ESteamNetworkingConnectionState_Connecting = 1, k_ESteamNetworkingConnectionState_FindingRoute = 2, k_ESteamNetworkingConnectionState_Connected = 3, k_ESteamNetworkingConnectionState_ClosedByPeer = 4, k_ESteamNetworkingConnectionState_ProblemDetectedLocally = 5, k_ESteamNetworkingConnectionState_FinWait = -1, k_ESteamNetworkingConnectionState_Linger = -2, k_ESteamNetworkingConnectionState_Dead = -3, k_ESteamNetworkingConnectionState__Force32Bit = int.MaxValue } public enum ESteamNetConnectionEnd { k_ESteamNetConnectionEnd_Invalid = 0, k_ESteamNetConnectionEnd_App_Min = 1000, k_ESteamNetConnectionEnd_App_Generic = 1000, k_ESteamNetConnectionEnd_App_Max = 1999, k_ESteamNetConnectionEnd_AppException_Min = 2000, k_ESteamNetConnectionEnd_AppException_Generic = 2000, k_ESteamNetConnectionEnd_AppException_Max = 2999, k_ESteamNetConnectionEnd_Local_Min = 3000, k_ESteamNetConnectionEnd_Local_OfflineMode = 3001, k_ESteamNetConnectionEnd_Local_ManyRelayConnectivity = 3002, k_ESteamNetConnectionEnd_Local_HostedServerPrimaryRelay = 3003, k_ESteamNetConnectionEnd_Local_NetworkConfig = 3004, k_ESteamNetConnectionEnd_Local_Rights = 3005, k_ESteamNetConnectionEnd_Local_Max = 3999, k_ESteamNetConnectionEnd_Remote_Min = 4000, k_ESteamNetConnectionEnd_Remote_Timeout = 4001, k_ESteamNetConnectionEnd_Remote_BadCrypt = 4002, k_ESteamNetConnectionEnd_Remote_BadCert = 4003, k_ESteamNetConnectionEnd_Remote_NotLoggedIn = 4004, k_ESteamNetConnectionEnd_Remote_NotRunningApp = 4005, k_ESteamNetConnectionEnd_Remote_BadProtocolVersion = 4006, k_ESteamNetConnectionEnd_Remote_Max = 4999, k_ESteamNetConnectionEnd_Misc_Min = 5000, k_ESteamNetConnectionEnd_Misc_Generic = 5001, k_ESteamNetConnectionEnd_Misc_InternalError = 5002, k_ESteamNetConnectionEnd_Misc_Timeout = 5003, k_ESteamNetConnectionEnd_Misc_RelayConnectivity = 5004, k_ESteamNetConnectionEnd_Misc_SteamConnectivity = 5005, k_ESteamNetConnectionEnd_Misc_NoRelaySessionsToClient = 5006, k_ESteamNetConnectionEnd_Misc_Max = 5999, k_ESteamNetConnectionEnd__Force32Bit = int.MaxValue } public enum ESteamNetworkingConfigScope { k_ESteamNetworkingConfig_Global = 1, k_ESteamNetworkingConfig_SocketsInterface = 2, k_ESteamNetworkingConfig_ListenSocket = 3, k_ESteamNetworkingConfig_Connection = 4, k_ESteamNetworkingConfigScope__Force32Bit = int.MaxValue } public enum ESteamNetworkingConfigDataType { k_ESteamNetworkingConfig_Int32 = 1, k_ESteamNetworkingConfig_Int64 = 2, k_ESteamNetworkingConfig_Float = 3, k_ESteamNetworkingConfig_String = 4, k_ESteamNetworkingConfig_FunctionPtr = 5, k_ESteamNetworkingConfigDataType__Force32Bit = int.MaxValue } public enum ESteamNetworkingConfigValue { k_ESteamNetworkingConfig_Invalid = 0, k_ESteamNetworkingConfig_FakePacketLoss_Send = 2, k_ESteamNetworkingConfig_FakePacketLoss_Recv = 3, k_ESteamNetworkingConfig_FakePacketLag_Send = 4, k_ESteamNetworkingConfig_FakePacketLag_Recv = 5, k_ESteamNetworkingConfig_FakePacketReorder_Send = 6, k_ESteamNetworkingConfig_FakePacketReorder_Recv = 7, k_ESteamNetworkingConfig_FakePacketReorder_Time = 8, k_ESteamNetworkingConfig_FakePacketDup_Send = 26, k_ESteamNetworkingConfig_FakePacketDup_Recv = 27, k_ESteamNetworkingConfig_FakePacketDup_TimeMax = 28, k_ESteamNetworkingConfig_TimeoutInitial = 24, k_ESteamNetworkingConfig_TimeoutConnected = 25, k_ESteamNetworkingConfig_SendBufferSize = 9, k_ESteamNetworkingConfig_SendRateMin = 10, k_ESteamNetworkingConfig_SendRateMax = 11, k_ESteamNetworkingConfig_NagleTime = 12, k_ESteamNetworkingConfig_IP_AllowWithoutAuth = 23, k_ESteamNetworkingConfig_MTU_PacketSize = 32, k_ESteamNetworkingConfig_MTU_DataSize = 33, k_ESteamNetworkingConfig_Unencrypted = 34, k_ESteamNetworkingConfig_EnumerateDevVars = 35, k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial = 19, k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFail = 20, k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate = 21, k_ESteamNetworkingConfig_SDRClient_SingleSocket = 22, k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster = 29, k_ESteamNetworkingConfig_SDRClient_DebugTicketAddress = 30, k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr = 31, k_ESteamNetworkingConfig_SDRClient_FakeClusterPing = 36, k_ESteamNetworkingConfig_LogLevel_AckRTT = 13, k_ESteamNetworkingConfig_LogLevel_PacketDecode = 14, k_ESteamNetworkingConfig_LogLevel_Message = 15, k_ESteamNetworkingConfig_LogLevel_PacketGaps = 16, k_ESteamNetworkingConfig_LogLevel_P2PRendezvous = 17, k_ESteamNetworkingConfig_LogLevel_SDRRelayPings = 18, k_ESteamNetworkingConfigValue__Force32Bit = int.MaxValue } public enum ESteamNetworkingGetConfigValueResult { k_ESteamNetworkingGetConfigValue_BadValue = -1, k_ESteamNetworkingGetConfigValue_BadScopeObj = -2, k_ESteamNetworkingGetConfigValue_BufferTooSmall = -3, k_ESteamNetworkingGetConfigValue_OK = 1, k_ESteamNetworkingGetConfigValue_OKInherited = 2, k_ESteamNetworkingGetConfigValueResult__Force32Bit = int.MaxValue } public enum ESteamNetworkingSocketsDebugOutputType { k_ESteamNetworkingSocketsDebugOutputType_None = 0, k_ESteamNetworkingSocketsDebugOutputType_Bug = 1, k_ESteamNetworkingSocketsDebugOutputType_Error = 2, k_ESteamNetworkingSocketsDebugOutputType_Important = 3, k_ESteamNetworkingSocketsDebugOutputType_Warning = 4, k_ESteamNetworkingSocketsDebugOutputType_Msg = 5, k_ESteamNetworkingSocketsDebugOutputType_Verbose = 6, k_ESteamNetworkingSocketsDebugOutputType_Debug = 7, k_ESteamNetworkingSocketsDebugOutputType_Everything = 8, k_ESteamNetworkingSocketsDebugOutputType__Force32Bit = int.MaxValue } public enum ESteamIPType { k_ESteamIPTypeIPv4, k_ESteamIPTypeIPv6 } public enum EUniverse { k_EUniverseInvalid, k_EUniversePublic, k_EUniverseBeta, k_EUniverseInternal, k_EUniverseDev, k_EUniverseMax } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct FriendGameInfo_t { public CGameID m_gameID; public uint m_unGameIP; public ushort m_usGamePort; public ushort m_usQueryPort; public CSteamID m_steamIDLobby; } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct FriendSessionStateInfo_t { public uint m_uiOnlineSessionInstances; public byte m_uiPublishedToFriendsSessionInstance; } [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct InputAnalogActionData_t { public EInputSourceMode eMode; public float x; public float y; public byte bActive; } [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct InputDigitalActionData_t { public byte bState; public byte bActive; } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct InputMotionData_t { public float rotQuatX; public float rotQuatY; public float rotQuatZ; public float rotQuatW; public float posAccelX; public float posAccelY; public float posAccelZ; public float rotVelX; public float rotVelY; public float rotVelZ; } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct SteamItemDetails_t { public SteamItemInstanceID_t m_itemId; public SteamItemDef_t m_iDefinition; public ushort m_unQuantity; public ushort m_unFlags; } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct SteamPartyBeaconLocation_t { public ESteamPartyBeaconLocationType m_eType; public ulong m_ulLocationID; } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct P2PSessionState_t { public byte m_bConnectionActive; public byte m_bConnecting; public byte m_eP2PSessionError; public byte m_bUsingRelay; public int m_nBytesQueuedForSend; public int m_nPacketsQueuedForSend; public uint m_nRemoteIP; public ushort m_nRemotePort; } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct SteamParamStringArray_t { public IntPtr m_ppStrings; public int m_nNumStrings; } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct SteamUGCDetails_t { public PublishedFileId_t m_nPublishedFileId; public EResult m_eResult; public EWorkshopFileType m_eFileType; public AppId_t m_nCreatorAppID; public AppId_t m_nConsumerAppID; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 129)] public string m_rgchTitle; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8000)] public string m_rgchDescription; public ulong m_ulSteamIDOwner; public uint m_rtimeCreated; public uint m_rtimeUpdated; public uint m_rtimeAddedToUserList; public ERemoteStoragePublishedFileVisibility m_eVisibility; [MarshalAs(UnmanagedType.I1)] public bool m_bBanned; [MarshalAs(UnmanagedType.I1)] public bool m_bAcceptedForUse; [MarshalAs(UnmanagedType.I1)] public bool m_bTagsTruncated; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1025)] public string m_rgchTags; public UGCHandle_t m_hFile; public UGCHandle_t m_hPreviewFile; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string m_pchFileName; public int m_nFileSize; public int m_nPreviewFileSize; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_rgchURL; public uint m_unVotesUp; public uint m_unVotesDown; public float m_flScore; public uint m_unNumChildren; } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct LeaderboardEntry_t { public CSteamID m_steamIDUser; public int m_nGlobalRank; public int m_nScore; public int m_cDetails; public UGCHandle_t m_hUGC; } public struct MatchMakingKeyValuePair_t { [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_szKey; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_szValue; private MatchMakingKeyValuePair_t(string strKey, string strValue) { m_szKey = strKey; m_szValue = strValue; } } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct CallbackMsg_t { public int m_hSteamUser; public int m_iCallback; public IntPtr m_pubParam; public int m_cubParam; } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct SteamDatagramGameCoordinatorServerLogin { public SteamNetworkingIdentity m_identity; public SteamDatagramHostedAddress m_routing; public AppId_t m_nAppID; public RTime32 m_rtime; public int m_cbAppData; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2048)] public byte[] m_appData; } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct SteamNetConnectionInfo_t { public SteamNetworkingIdentity m_identityRemote; public long m_nUserData; public HSteamListenSocket m_hListenSocket; public SteamNetworkingIPAddr m_addrRemote; public ushort m__pad1; public SteamNetworkingPOPID m_idPOPRemote; public SteamNetworkingPOPID m_idPOPRelay; public ESteamNetworkingConnectionState m_eState; public int m_eEndReason; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string m_szEndDebug; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string m_szConnectionDescription; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public uint[] reserved; } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct SteamNetworkingQuickConnectionStatus { public ESteamNetworkingConnectionState m_eState; public int m_nPing; public float m_flConnectionQualityLocal; public float m_flConnectionQualityRemote; public float m_flOutPacketsPerSec; public float m_flOutBytesPerSec; public float m_flInPacketsPerSec; public float m_flInBytesPerSec; public int m_nSendRateBytesPerSecond; public int m_cbPendingUnreliable; public int m_cbPendingReliable; public int m_cbSentUnackedReliable; public SteamNetworkingMicroseconds m_usecQueueTime; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public uint[] reserved; } [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct SteamNetworkPingLocation_t { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] public byte[] m_data; } public static class CallbackDispatcher { public static void ExceptionHandler(Exception e) { Debug.LogException(e); } } public sealed class Callback : IDisposable { public delegate void DispatchDelegate(T param); private CCallbackBaseVTable m_CallbackBaseVTable; private IntPtr m_pVTable = IntPtr.Zero; private CCallbackBase m_CCallbackBase; private GCHandle m_pCCallbackBase; private bool m_bGameServer; private readonly int m_size = Marshal.SizeOf(typeof(T)); private bool m_bDisposed; private event DispatchDelegate m_Func; public static Callback Create(DispatchDelegate func) { return new Callback(func); } public static Callback CreateGameServer(DispatchDelegate func) { return new Callback(func, bGameServer: true); } public Callback(DispatchDelegate func, bool bGameServer = false) { m_bGameServer = bGameServer; BuildCCallbackBase(); Register(func); } ~Callback() { Dispose(); } public void Dispose() { if (!m_bDisposed) { GC.SuppressFinalize(this); Unregister(); if (m_pVTable != IntPtr.Zero) { Marshal.FreeHGlobal(m_pVTable); } if (m_pCCallbackBase.IsAllocated) { m_pCCallbackBase.Free(); } m_bDisposed = true; } } public void Register(DispatchDelegate func) { if (func == null) { throw new Exception("Callback function must not be null."); } if ((m_CCallbackBase.m_nCallbackFlags & 1) == 1) { Unregister(); } if (m_bGameServer) { SetGameserverFlag(); } this.m_Func = func; NativeMethods.SteamAPI_RegisterCallback(m_pCCallbackBase.AddrOfPinnedObject(), CallbackIdentities.GetCallbackIdentity(typeof(T))); } public void Unregister() { NativeMethods.SteamAPI_UnregisterCallback(m_pCCallbackBase.AddrOfPinnedObject()); } public void SetGameserverFlag() { m_CCallbackBase.m_nCallbackFlags |= 2; } private void OnRunCallback(IntPtr thisptr, IntPtr pvParam) { try { this.m_Func((T)Marshal.PtrToStructure(pvParam, typeof(T))); } catch (Exception e) { CallbackDispatcher.ExceptionHandler(e); } } private void OnRunCallResult(IntPtr thisptr, IntPtr pvParam, bool bFailed, ulong hSteamAPICall) { try { this.m_Func((T)Marshal.PtrToStructure(pvParam, typeof(T))); } catch (Exception e) { CallbackDispatcher.ExceptionHandler(e); } } private int OnGetCallbackSizeBytes(IntPtr thisptr) { return m_size; } private void BuildCCallbackBase() { m_CallbackBaseVTable = new CCallbackBaseVTable { m_RunCallResult = OnRunCallResult, m_RunCallback = OnRunCallback, m_GetCallbackSizeBytes = OnGetCallbackSizeBytes }; m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CCallbackBaseVTable))); Marshal.StructureToPtr(m_CallbackBaseVTable, m_pVTable, fDeleteOld: false); m_CCallbackBase = new CCallbackBase { m_vfptr = m_pVTable, m_nCallbackFlags = 0, m_iCallback = CallbackIdentities.GetCallbackIdentity(typeof(T)) }; m_pCCallbackBase = GCHandle.Alloc(m_CCallbackBase, GCHandleType.Pinned); } } public sealed class CallResult : IDisposable { public delegate void APIDispatchDelegate(T param, bool bIOFailure); private CCallbackBaseVTable m_CallbackBaseVTable; private IntPtr m_pVTable = IntPtr.Zero; private CCallbackBase m_CCallbackBase; private GCHandle m_pCCallbackBase; private SteamAPICall_t m_hAPICall = SteamAPICall_t.Invalid; private readonly int m_size = Marshal.SizeOf(typeof(T)); private bool m_bDisposed; public SteamAPICall_t Handle => m_hAPICall; private event APIDispatchDelegate m_Func; public static CallResult Create(APIDispatchDelegate func = null) { return new CallResult(func); } public CallResult(APIDispatchDelegate func = null) { this.m_Func = func; BuildCCallbackBase(); } ~CallResult() { Dispose(); } public void Dispose() { if (!m_bDisposed) { GC.SuppressFinalize(this); Cancel(); if (m_pVTable != IntPtr.Zero) { Marshal.FreeHGlobal(m_pVTable); } if (m_pCCallbackBase.IsAllocated) { m_pCCallbackBase.Free(); } m_bDisposed = true; } } public void Set(SteamAPICall_t hAPICall, APIDispatchDelegate func = null) { if (func != null) { this.m_Func = func; } if (this.m_Func == null) { throw new Exception("CallResult function was null, you must either set it in the CallResult Constructor or via Set()"); } if (m_hAPICall != SteamAPICall_t.Invalid) { NativeMethods.SteamAPI_UnregisterCallResult(m_pCCallbackBase.AddrOfPinnedObject(), (ulong)m_hAPICall); } m_hAPICall = hAPICall; if (hAPICall != SteamAPICall_t.Invalid) { NativeMethods.SteamAPI_RegisterCallResult(m_pCCallbackBase.AddrOfPinnedObject(), (ulong)hAPICall); } } public bool IsActive() { return m_hAPICall != SteamAPICall_t.Invalid; } public void Cancel() { if (m_hAPICall != SteamAPICall_t.Invalid) { NativeMethods.SteamAPI_UnregisterCallResult(m_pCCallbackBase.AddrOfPinnedObject(), (ulong)m_hAPICall); m_hAPICall = SteamAPICall_t.Invalid; } } public void SetGameserverFlag() { m_CCallbackBase.m_nCallbackFlags |= 2; } private void OnRunCallback(IntPtr thisptr, IntPtr pvParam) { m_hAPICall = SteamAPICall_t.Invalid; try { this.m_Func((T)Marshal.PtrToStructure(pvParam, typeof(T)), bIOFailure: false); } catch (Exception e) { CallbackDispatcher.ExceptionHandler(e); } } private void OnRunCallResult(IntPtr thisptr, IntPtr pvParam, bool bFailed, ulong hSteamAPICall_) { if ((SteamAPICall_t)hSteamAPICall_ == m_hAPICall) { m_hAPICall = SteamAPICall_t.Invalid; try { this.m_Func((T)Marshal.PtrToStructure(pvParam, typeof(T)), bFailed); } catch (Exception e) { CallbackDispatcher.ExceptionHandler(e); } } } private int OnGetCallbackSizeBytes(IntPtr thisptr) { return m_size; } private void BuildCCallbackBase() { m_CallbackBaseVTable = new CCallbackBaseVTable { m_RunCallback = OnRunCallback, m_RunCallResult = OnRunCallResult, m_GetCallbackSizeBytes = OnGetCallbackSizeBytes }; m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CCallbackBaseVTable))); Marshal.StructureToPtr(m_CallbackBaseVTable, m_pVTable, fDeleteOld: false); m_CCallbackBase = new CCallbackBase { m_vfptr = m_pVTable, m_nCallbackFlags = 0, m_iCallback = CallbackIdentities.GetCallbackIdentity(typeof(T)) }; m_pCCallbackBase = GCHandle.Alloc(m_CCallbackBase, GCHandleType.Pinned); } } [StructLayout(LayoutKind.Sequential)] internal class CCallbackBase { public const byte k_ECallbackFlagsRegistered = 1; public const byte k_ECallbackFlagsGameServer = 2; public IntPtr m_vfptr; public byte m_nCallbackFlags; public int m_iCallback; } [StructLayout(LayoutKind.Sequential)] internal class CCallbackBaseVTable { [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void RunCBDel(IntPtr thisptr, IntPtr pvParam); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void RunCRDel(IntPtr thisptr, IntPtr pvParam, [MarshalAs(UnmanagedType.I1)] bool bIOFailure, ulong hSteamAPICall); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int GetCallbackSizeBytesDel(IntPtr thisptr); private const CallingConvention cc = CallingConvention.Cdecl; [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public RunCRDel m_RunCallResult; [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public RunCBDel m_RunCallback; [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public GetCallbackSizeBytesDel m_GetCallbackSizeBytes; } internal class CallbackIdentities { public static int GetCallbackIdentity(Type callbackStruct) { object[] customAttributes = callbackStruct.GetCustomAttributes(typeof(CallbackIdentityAttribute), inherit: false); int num = 0; if (num < customAttributes.Length) { return ((CallbackIdentityAttribute)customAttributes[num]).Identity; } throw new Exception("Callback number not found for struct " + callbackStruct); } } [AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] internal class CallbackIdentityAttribute : Attribute { public int Identity { get; set; } public CallbackIdentityAttribute(int callbackNum) { Identity = callbackNum; } } public class InteropHelp { public class UTF8StringHandle : SafeHandleZeroOrMinusOneIsInvalid { public UTF8StringHandle(string str) : base(ownsHandle: true) { if (str == null) { SetHandle(IntPtr.Zero); return; } byte[] array = new byte[Encoding.UTF8.GetByteCount(str) + 1]; Encoding.UTF8.GetBytes(str, 0, str.Length, array, 0); IntPtr destination = Marshal.AllocHGlobal(array.Length); Marshal.Copy(array, 0, destination, array.Length); SetHandle(destination); } protected override bool ReleaseHandle() { if (!IsInvalid) { Marshal.FreeHGlobal(handle); } return true; } } public class SteamParamStringArray { private IntPtr[] m_Strings; private IntPtr m_ptrStrings; private IntPtr m_pSteamParamStringArray; public SteamParamStringArray(IList strings) { if (strings == null) { m_pSteamParamStringArray = IntPtr.Zero; return; } m_Strings = new IntPtr[strings.Count]; for (int i = 0; i < strings.Count; i++) { byte[] array = new byte[Encoding.UTF8.GetByteCount(strings[i]) + 1]; Encoding.UTF8.GetBytes(strings[i], 0, strings[i].Length, array, 0); m_Strings[i] = Marshal.AllocHGlobal(array.Length); Marshal.Copy(array, 0, m_Strings[i], array.Length); } m_ptrStrings = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)) * m_Strings.Length); SteamParamStringArray_t structure = new SteamParamStringArray_t { m_ppStrings = m_ptrStrings, m_nNumStrings = m_Strings.Length }; Marshal.Copy(m_Strings, 0, structure.m_ppStrings, m_Strings.Length); m_pSteamParamStringArray = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SteamParamStringArray_t))); Marshal.StructureToPtr(structure, m_pSteamParamStringArray, fDeleteOld: false); } ~SteamParamStringArray() { IntPtr[] strings = m_Strings; int i = 0; for (; i < strings.Length; i++) { Marshal.FreeHGlobal(strings[i]); } if (m_ptrStrings != IntPtr.Zero) { Marshal.FreeHGlobal(m_ptrStrings); } if (m_pSteamParamStringArray != IntPtr.Zero) { Marshal.FreeHGlobal(m_pSteamParamStringArray); } } public static implicit operator IntPtr(SteamParamStringArray that) { return that.m_pSteamParamStringArray; } } public static void TestIfPlatformSupported() { } public static void TestIfAvailableClient() { TestIfPlatformSupported(); if (CSteamAPIContext.GetSteamClient() == IntPtr.Zero && !CSteamAPIContext.Init()) { throw new InvalidOperationException("Steamworks is not initialized."); } } public static void TestIfAvailableGameServer() { TestIfPlatformSupported(); if (CSteamGameServerAPIContext.GetSteamClient() == IntPtr.Zero && !CSteamGameServerAPIContext.Init()) { throw new InvalidOperationException("Steamworks GameServer is not initialized."); } } public static string PtrToStringUTF8(IntPtr nativeUtf8) { if (nativeUtf8 == IntPtr.Zero) { return null; } int i; for (i = 0; Marshal.ReadByte(nativeUtf8, i) != 0; i++) { } if (i == 0) { return string.Empty; } byte[] array = new byte[i]; Marshal.Copy(nativeUtf8, array, 0, array.Length); return Encoding.UTF8.GetString(array); } } public class MMKVPMarshaller { private IntPtr m_pNativeArray; private IntPtr m_pArrayEntries; public MMKVPMarshaller(MatchMakingKeyValuePair_t[] filters) { if (filters != null) { int num = Marshal.SizeOf(typeof(MatchMakingKeyValuePair_t)); m_pNativeArray = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)) * filters.Length); m_pArrayEntries = Marshal.AllocHGlobal(num * filters.Length); for (int i = 0; i < filters.Length; i++) { Marshal.StructureToPtr(filters[i], new IntPtr(m_pArrayEntries.ToInt64() + i * num), fDeleteOld: false); } Marshal.WriteIntPtr(m_pNativeArray, m_pArrayEntries); } } ~MMKVPMarshaller() { if (m_pArrayEntries != IntPtr.Zero) { Marshal.FreeHGlobal(m_pArrayEntries); } if (m_pNativeArray != IntPtr.Zero) { Marshal.FreeHGlobal(m_pNativeArray); } } public static implicit operator IntPtr(MMKVPMarshaller that) { return that.m_pNativeArray; } } public class DllCheck { public static bool Test() { return true; } } public class ISteamMatchmakingServerListResponse { public delegate void ServerResponded(HServerListRequest hRequest, int iServer); public delegate void ServerFailedToRespond(HServerListRequest hRequest, int iServer); public delegate void RefreshComplete(HServerListRequest hRequest, EMatchMakingServerResponse response); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] private delegate void InternalServerResponded(IntPtr thisptr, HServerListRequest hRequest, int iServer); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] private delegate void InternalServerFailedToRespond(IntPtr thisptr, HServerListRequest hRequest, int iServer); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] private delegate void InternalRefreshComplete(IntPtr thisptr, HServerListRequest hRequest, EMatchMakingServerResponse response); [StructLayout(LayoutKind.Sequential)] private class VTable { [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public InternalServerResponded m_VTServerResponded; [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public InternalServerFailedToRespond m_VTServerFailedToRespond; [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public InternalRefreshComplete m_VTRefreshComplete; } private VTable m_VTable; private IntPtr m_pVTable; private GCHandle m_pGCHandle; private ServerResponded m_ServerResponded; private ServerFailedToRespond m_ServerFailedToRespond; private RefreshComplete m_RefreshComplete; public ISteamMatchmakingServerListResponse(ServerResponded onServerResponded, ServerFailedToRespond onServerFailedToRespond, RefreshComplete onRefreshComplete) { if (onServerResponded == null || onServerFailedToRespond == null || onRefreshComplete == null) { throw new ArgumentNullException(); } m_ServerResponded = onServerResponded; m_ServerFailedToRespond = onServerFailedToRespond; m_RefreshComplete = onRefreshComplete; m_VTable = new VTable { m_VTServerResponded = InternalOnServerResponded, m_VTServerFailedToRespond = InternalOnServerFailedToRespond, m_VTRefreshComplete = InternalOnRefreshComplete }; m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(VTable))); Marshal.StructureToPtr(m_VTable, m_pVTable, fDeleteOld: false); m_pGCHandle = GCHandle.Alloc(m_pVTable, GCHandleType.Pinned); } ~ISteamMatchmakingServerListResponse() { if (m_pVTable != IntPtr.Zero) { Marshal.FreeHGlobal(m_pVTable); } if (m_pGCHandle.IsAllocated) { m_pGCHandle.Free(); } } private void InternalOnServerResponded(IntPtr thisptr, HServerListRequest hRequest, int iServer) { try { m_ServerResponded(hRequest, iServer); } catch (Exception e) { CallbackDispatcher.ExceptionHandler(e); } } private void InternalOnServerFailedToRespond(IntPtr thisptr, HServerListRequest hRequest, int iServer) { try { m_ServerFailedToRespond(hRequest, iServer); } catch (Exception e) { CallbackDispatcher.ExceptionHandler(e); } } private void InternalOnRefreshComplete(IntPtr thisptr, HServerListRequest hRequest, EMatchMakingServerResponse response) { try { m_RefreshComplete(hRequest, response); } catch (Exception e) { CallbackDispatcher.ExceptionHandler(e); } } public static explicit operator IntPtr(ISteamMatchmakingServerListResponse that) { return that.m_pGCHandle.AddrOfPinnedObject(); } } public class ISteamMatchmakingPingResponse { public delegate void ServerResponded(gameserveritem_t server); public delegate void ServerFailedToRespond(); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] private delegate void InternalServerResponded(IntPtr thisptr, gameserveritem_t server); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] private delegate void InternalServerFailedToRespond(IntPtr thisptr); [StructLayout(LayoutKind.Sequential)] private class VTable { [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public InternalServerResponded m_VTServerResponded; [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public InternalServerFailedToRespond m_VTServerFailedToRespond; } private VTable m_VTable; private IntPtr m_pVTable; private GCHandle m_pGCHandle; private ServerResponded m_ServerResponded; private ServerFailedToRespond m_ServerFailedToRespond; public ISteamMatchmakingPingResponse(ServerResponded onServerResponded, ServerFailedToRespond onServerFailedToRespond) { if (onServerResponded == null || onServerFailedToRespond == null) { throw new ArgumentNullException(); } m_ServerResponded = onServerResponded; m_ServerFailedToRespond = onServerFailedToRespond; m_VTable = new VTable { m_VTServerResponded = InternalOnServerResponded, m_VTServerFailedToRespond = InternalOnServerFailedToRespond }; m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(VTable))); Marshal.StructureToPtr(m_VTable, m_pVTable, fDeleteOld: false); m_pGCHandle = GCHandle.Alloc(m_pVTable, GCHandleType.Pinned); } ~ISteamMatchmakingPingResponse() { if (m_pVTable != IntPtr.Zero) { Marshal.FreeHGlobal(m_pVTable); } if (m_pGCHandle.IsAllocated) { m_pGCHandle.Free(); } } private void InternalOnServerResponded(IntPtr thisptr, gameserveritem_t server) { m_ServerResponded(server); } private void InternalOnServerFailedToRespond(IntPtr thisptr) { m_ServerFailedToRespond(); } public static explicit operator IntPtr(ISteamMatchmakingPingResponse that) { return that.m_pGCHandle.AddrOfPinnedObject(); } } public class ISteamMatchmakingPlayersResponse { public delegate void AddPlayerToList(string pchName, int nScore, float flTimePlayed); public delegate void PlayersFailedToRespond(); public delegate void PlayersRefreshComplete(); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] public delegate void InternalAddPlayerToList(IntPtr thisptr, IntPtr pchName, int nScore, float flTimePlayed); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] public delegate void InternalPlayersFailedToRespond(IntPtr thisptr); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] public delegate void InternalPlayersRefreshComplete(IntPtr thisptr); [StructLayout(LayoutKind.Sequential)] private class VTable { [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public InternalAddPlayerToList m_VTAddPlayerToList; [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public InternalPlayersFailedToRespond m_VTPlayersFailedToRespond; [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public InternalPlayersRefreshComplete m_VTPlayersRefreshComplete; } private VTable m_VTable; private IntPtr m_pVTable; private GCHandle m_pGCHandle; private AddPlayerToList m_AddPlayerToList; private PlayersFailedToRespond m_PlayersFailedToRespond; private PlayersRefreshComplete m_PlayersRefreshComplete; public ISteamMatchmakingPlayersResponse(AddPlayerToList onAddPlayerToList, PlayersFailedToRespond onPlayersFailedToRespond, PlayersRefreshComplete onPlayersRefreshComplete) { if (onAddPlayerToList == null || onPlayersFailedToRespond == null || onPlayersRefreshComplete == null) { throw new ArgumentNullException(); } m_AddPlayerToList = onAddPlayerToList; m_PlayersFailedToRespond = onPlayersFailedToRespond; m_PlayersRefreshComplete = onPlayersRefreshComplete; m_VTable = new VTable { m_VTAddPlayerToList = InternalOnAddPlayerToList, m_VTPlayersFailedToRespond = InternalOnPlayersFailedToRespond, m_VTPlayersRefreshComplete = InternalOnPlayersRefreshComplete }; m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(VTable))); Marshal.StructureToPtr(m_VTable, m_pVTable, fDeleteOld: false); m_pGCHandle = GCHandle.Alloc(m_pVTable, GCHandleType.Pinned); } ~ISteamMatchmakingPlayersResponse() { if (m_pVTable != IntPtr.Zero) { Marshal.FreeHGlobal(m_pVTable); } if (m_pGCHandle.IsAllocated) { m_pGCHandle.Free(); } } private void InternalOnAddPlayerToList(IntPtr thisptr, IntPtr pchName, int nScore, float flTimePlayed) { m_AddPlayerToList(InteropHelp.PtrToStringUTF8(pchName), nScore, flTimePlayed); } private void InternalOnPlayersFailedToRespond(IntPtr thisptr) { m_PlayersFailedToRespond(); } private void InternalOnPlayersRefreshComplete(IntPtr thisptr) { m_PlayersRefreshComplete(); } public static explicit operator IntPtr(ISteamMatchmakingPlayersResponse that) { return that.m_pGCHandle.AddrOfPinnedObject(); } } public class ISteamMatchmakingRulesResponse { public delegate void RulesResponded(string pchRule, string pchValue); public delegate void RulesFailedToRespond(); public delegate void RulesRefreshComplete(); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] public delegate void InternalRulesResponded(IntPtr thisptr, IntPtr pchRule, IntPtr pchValue); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] public delegate void InternalRulesFailedToRespond(IntPtr thisptr); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] public delegate void InternalRulesRefreshComplete(IntPtr thisptr); [StructLayout(LayoutKind.Sequential)] private class VTable { [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public InternalRulesResponded m_VTRulesResponded; [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public InternalRulesFailedToRespond m_VTRulesFailedToRespond; [NonSerialized] [MarshalAs(UnmanagedType.FunctionPtr)] public InternalRulesRefreshComplete m_VTRulesRefreshComplete; } private VTable m_VTable; private IntPtr m_pVTable; private GCHandle m_pGCHandle; private RulesResponded m_RulesResponded; private RulesFailedToRespond m_RulesFailedToRespond; private RulesRefreshComplete m_RulesRefreshComplete; public ISteamMatchmakingRulesResponse(RulesResponded onRulesResponded, RulesFailedToRespond onRulesFailedToRespond, RulesRefreshComplete onRulesRefreshComplete) { if (onRulesResponded == null || onRulesFailedToRespond == null || onRulesRefreshComplete == null) { throw new ArgumentNullException(); } m_RulesResponded = onRulesResponded; m_RulesFailedToRespond = onRulesFailedToRespond; m_RulesRefreshComplete = onRulesRefreshComplete; m_VTable = new VTable { m_VTRulesResponded = InternalOnRulesResponded, m_VTRulesFailedToRespond = InternalOnRulesFailedToRespond, m_VTRulesRefreshComplete = InternalOnRulesRefreshComplete }; m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(VTable))); Marshal.StructureToPtr(m_VTable, m_pVTable, fDeleteOld: false); m_pGCHandle = GCHandle.Alloc(m_pVTable, GCHandleType.Pinned); } ~ISteamMatchmakingRulesResponse() { if (m_pVTable != IntPtr.Zero) { Marshal.FreeHGlobal(m_pVTable); } if (m_pGCHandle.IsAllocated) { m_pGCHandle.Free(); } } private void InternalOnRulesResponded(IntPtr thisptr, IntPtr pchRule, IntPtr pchValue) { m_RulesResponded(InteropHelp.PtrToStringUTF8(pchRule), InteropHelp.PtrToStringUTF8(pchValue)); } private void InternalOnRulesFailedToRespond(IntPtr thisptr) { m_RulesFailedToRespond(); } private void InternalOnRulesRefreshComplete(IntPtr thisptr) { m_RulesRefreshComplete(); } public static explicit operator IntPtr(ISteamMatchmakingRulesResponse that) { return that.m_pGCHandle.AddrOfPinnedObject(); } } public static class Packsize { [StructLayout(LayoutKind.Sequential, Pack = 8)] private struct ValvePackingSentinel_t { private uint m_u32; private ulong m_u64; private ushort m_u16; private double m_d; } public const int value = 8; public static bool Test() { int num = Marshal.SizeOf(typeof(ValvePackingSentinel_t)); int num2 = Marshal.SizeOf(typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t)); if (num != 32 || num2 != 616) { return false; } return true; } } public static class Version { public const string SteamworksNETVersion = "14.0.0"; public const string SteamworksSDKVersion = "1.48"; public const string SteamAPIDLLVersion = "05.69.73.98"; public const int SteamAPIDLLSize = 237856; public const int SteamAPI64DLLSize = 262944; } public static class SteamAPI { public static bool Init() { InteropHelp.TestIfPlatformSupported(); bool flag = NativeMethods.SteamAPI_Init(); if (flag) { flag = CSteamAPIContext.Init(); } return flag; } public static void Shutdown() { InteropHelp.TestIfPlatformSupported(); NativeMethods.SteamAPI_Shutdown(); CSteamAPIContext.Clear(); } public static bool RestartAppIfNecessary(AppId_t unOwnAppID) { InteropHelp.TestIfPlatformSupported(); return NativeMethods.SteamAPI_RestartAppIfNecessary(unOwnAppID); } public static void ReleaseCurrentThreadMemory() { InteropHelp.TestIfPlatformSupported(); NativeMethods.SteamAPI_ReleaseCurrentThreadMemory(); } public static void RunCallbacks() { InteropHelp.TestIfPlatformSupported(); NativeMethods.SteamAPI_RunCallbacks(); } public static bool IsSteamRunning() { InteropHelp.TestIfPlatformSupported(); return NativeMethods.SteamAPI_IsSteamRunning(); } public static HSteamPipe GetHSteamPipe() { InteropHelp.TestIfPlatformSupported(); return (HSteamPipe)NativeMethods.SteamAPI_GetHSteamPipe(); } public static HSteamUser GetHSteamUser() { InteropHelp.TestIfPlatformSupported(); return (HSteamUser)NativeMethods.SteamAPI_GetHSteamUser(); } } public static class GameServer { public static bool Init(uint unIP, ushort usSteamPort, ushort usGamePort, ushort usQueryPort, EServerMode eServerMode, string pchVersionString) { InteropHelp.TestIfPlatformSupported(); bool flag; using (InteropHelp.UTF8StringHandle pchVersionString2 = new InteropHelp.UTF8StringHandle(pchVersionString)) { flag = NativeMethods.SteamGameServer_Init(unIP, usSteamPort, usGamePort, usQueryPort, eServerMode, pchVersionString2); } if (flag) { flag = CSteamGameServerAPIContext.Init(); } return flag; } public static void Shutdown() { InteropHelp.TestIfPlatformSupported(); NativeMethods.SteamGameServer_Shutdown(); CSteamGameServerAPIContext.Clear(); } public static void RunCallbacks() { InteropHelp.TestIfPlatformSupported(); NativeMethods.SteamGameServer_RunCallbacks(); } public static void ReleaseCurrentThreadMemory() { InteropHelp.TestIfPlatformSupported(); NativeMethods.SteamGameServer_ReleaseCurrentThreadMemory(); } public static bool BSecure() { InteropHelp.TestIfPlatformSupported(); return NativeMethods.SteamGameServer_BSecure(); } public static CSteamID GetSteamID() { InteropHelp.TestIfPlatformSupported(); return (CSteamID)NativeMethods.SteamGameServer_GetSteamID(); } public static HSteamPipe GetHSteamPipe() { InteropHelp.TestIfPlatformSupported(); return (HSteamPipe)NativeMethods.SteamGameServer_GetHSteamPipe(); } public static HSteamUser GetHSteamUser() { InteropHelp.TestIfPlatformSupported(); return (HSteamUser)NativeMethods.SteamGameServer_GetHSteamUser(); } } public static class SteamEncryptedAppTicket { public static bool BDecryptTicket(byte[] rgubTicketEncrypted, uint cubTicketEncrypted, byte[] rgubTicketDecrypted, ref uint pcubTicketDecrypted, byte[] rgubKey, int cubKey) { InteropHelp.TestIfPlatformSupported(); return NativeMethods.SteamEncryptedAppTicket_BDecryptTicket(rgubTicketEncrypted, cubTicketEncrypted, rgubTicketDecrypted, ref pcubTicketDecrypted, rgubKey, cubKey); } public static bool BIsTicketForApp(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, AppId_t nAppID) { InteropHelp.TestIfPlatformSupported(); return NativeMethods.SteamEncryptedAppTicket_BIsTicketForApp(rgubTicketDecrypted, cubTicketDecrypted, nAppID); } public static uint GetTicketIssueTime(byte[] rgubTicketDecrypted, uint cubTicketDecrypted) { InteropHelp.TestIfPlatformSupported(); return NativeMethods.SteamEncryptedAppTicket_GetTicketIssueTime(rgubTicketDecrypted, cubTicketDecrypted); } public static void GetTicketSteamID(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, out CSteamID psteamID) { InteropHelp.TestIfPlatformSupported(); NativeMethods.SteamEncryptedAppTicket_GetTicketSteamID(rgubTicketDecrypted, cubTicketDecrypted, out psteamID); } public static uint GetTicketAppID(byte[] rgubTicketDecrypted, uint cubTicketDecrypted) { InteropHelp.TestIfPlatformSupported(); return NativeMethods.SteamEncryptedAppTicket_GetTicketAppID(rgubTicketDecrypted, cubTicketDecrypted); } public static bool BUserOwnsAppInTicket(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, AppId_t nAppID) { InteropHelp.TestIfPlatformSupported(); return NativeMethods.SteamEncryptedAppTicket_BUserOwnsAppInTicket(rgubTicketDecrypted, cubTicketDecrypted, nAppID); } public static bool BUserIsVacBanned(byte[] rgubTicketDecrypted, uint cubTicketDecrypted) { InteropHelp.TestIfPlatformSupported(); return NativeMethods.SteamEncryptedAppTicket_BUserIsVacBanned(rgubTicketDecrypted, cubTicketDecrypted); } public static byte[] GetUserVariableData(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, out uint pcubUserData) { InteropHelp.TestIfPlatformSupported(); IntPtr source = NativeMethods.SteamEncryptedAppTicket_GetUserVariableData(rgubTicketDecrypted, cubTicketDecrypted, out pcubUserData); byte[] array = new byte[pcubUserData]; Marshal.Copy(source, array, 0, (int)pcubUserData); return array; } public static bool BIsTicketSigned(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, byte[] pubRSAKey, uint cubRSAKey) { InteropHelp.TestIfPlatformSupported(); return NativeMethods.SteamEncryptedAppTicket_BIsTicketSigned(rgubTicketDecrypted, cubTicketDecrypted, pubRSAKey, cubRSAKey); } } internal static class CSteamAPIContext { private static IntPtr m_pSteamClient; private static IntPtr m_pSteamUser; private static IntPtr m_pSteamFriends; private static IntPtr m_pSteamUtils; private static IntPtr m_pSteamMatchmaking; private static IntPtr m_pSteamUserStats; private static IntPtr m_pSteamApps; private static IntPtr m_pSteamMatchmakingServers; private static IntPtr m_pSteamNetworking; private static IntPtr m_pSteamRemoteStorage; private static IntPtr m_pSteamScreenshots; private static IntPtr m_pSteamGameSearch; private static IntPtr m_pSteamHTTP; private static IntPtr m_pController; private static IntPtr m_pSteamUGC; private static IntPtr m_pSteamAppList; private static IntPtr m_pSteamMusic; private static IntPtr m_pSteamMusicRemote; private static IntPtr m_pSteamHTMLSurface; private static IntPtr m_pSteamInventory; private static IntPtr m_pSteamVideo; private static IntPtr m_pSteamParentalSettings; private static IntPtr m_pSteamInput; private static IntPtr m_pSteamParties; private static IntPtr m_pSteamRemotePlay; private static IntPtr m_pSteamNetworkingUtils; private static IntPtr m_pSteamNetworkingSockets; internal static void Clear() { m_pSteamClient = IntPtr.Zero; m_pSteamUser = IntPtr.Zero; m_pSteamFriends = IntPtr.Zero; m_pSteamUtils = IntPtr.Zero; m_pSteamMatchmaking = IntPtr.Zero; m_pSteamUserStats = IntPtr.Zero; m_pSteamApps = IntPtr.Zero; m_pSteamMatchmakingServers = IntPtr.Zero; m_pSteamNetworking = IntPtr.Zero; m_pSteamRemoteStorage = IntPtr.Zero; m_pSteamHTTP = IntPtr.Zero; m_pSteamScreenshots = IntPtr.Zero; m_pSteamGameSearch = IntPtr.Zero; m_pSteamMusic = IntPtr.Zero; m_pController = IntPtr.Zero; m_pSteamUGC = IntPtr.Zero; m_pSteamAppList = IntPtr.Zero; m_pSteamMusic = IntPtr.Zero; m_pSteamMusicRemote = IntPtr.Zero; m_pSteamHTMLSurface = IntPtr.Zero; m_pSteamInventory = IntPtr.Zero; m_pSteamVideo = IntPtr.Zero; m_pSteamParentalSettings = IntPtr.Zero; m_pSteamInput = IntPtr.Zero; m_pSteamParties = IntPtr.Zero; m_pSteamRemotePlay = IntPtr.Zero; m_pSteamNetworkingUtils = IntPtr.Zero; m_pSteamNetworkingSockets = IntPtr.Zero; } internal static bool Init() { HSteamUser hSteamUser = SteamAPI.GetHSteamUser(); HSteamPipe hSteamPipe = SteamAPI.GetHSteamPipe(); if (hSteamPipe == (HSteamPipe)0) { return false; } using (InteropHelp.UTF8StringHandle ver = new InteropHelp.UTF8StringHandle("SteamClient020")) { m_pSteamClient = NativeMethods.SteamInternal_CreateInterface(ver); } if (m_pSteamClient == IntPtr.Zero) { return false; } m_pSteamUser = SteamClient.GetISteamUser(hSteamUser, hSteamPipe, "SteamUser020"); if (m_pSteamUser == IntPtr.Zero) { return false; } m_pSteamFriends = SteamClient.GetISteamFriends(hSteamUser, hSteamPipe, "SteamFriends017"); if (m_pSteamFriends == IntPtr.Zero) { return false; } m_pSteamUtils = SteamClient.GetISteamUtils(hSteamPipe, "SteamUtils009"); if (m_pSteamUtils == IntPtr.Zero) { return false; } m_pSteamMatchmaking = SteamClient.GetISteamMatchmaking(hSteamUser, hSteamPipe, "SteamMatchMaking009"); if (m_pSteamMatchmaking == IntPtr.Zero) { return false; } m_pSteamMatchmakingServers = SteamClient.GetISteamMatchmakingServers(hSteamUser, hSteamPipe, "SteamMatchMakingServers002"); if (m_pSteamMatchmakingServers == IntPtr.Zero) { return false; } m_pSteamUserStats = SteamClient.GetISteamUserStats(hSteamUser, hSteamPipe, "STEAMUSERSTATS_INTERFACE_VERSION011"); if (m_pSteamUserStats == IntPtr.Zero) { return false; } m_pSteamApps = SteamClient.GetISteamApps(hSteamUser, hSteamPipe, "STEAMAPPS_INTERFACE_VERSION008"); if (m_pSteamApps == IntPtr.Zero) { return false; } m_pSteamNetworking = SteamClient.GetISteamNetworking(hSteamUser, hSteamPipe, "SteamNetworking006"); if (m_pSteamNetworking == IntPtr.Zero) { return false; } m_pSteamRemoteStorage = SteamClient.GetISteamRemoteStorage(hSteamUser, hSteamPipe, "STEAMREMOTESTORAGE_INTERFACE_VERSION014"); if (m_pSteamRemoteStorage == IntPtr.Zero) { return false; } m_pSteamScreenshots = SteamClient.GetISteamScreenshots(hSteamUser, hSteamPipe, "STEAMSCREENSHOTS_INTERFACE_VERSION003"); if (m_pSteamScreenshots == IntPtr.Zero) { return false; } m_pSteamGameSearch = SteamClient.GetISteamGameSearch(hSteamUser, hSteamPipe, "SteamMatchGameSearch001"); if (m_pSteamGameSearch == IntPtr.Zero) { return false; } m_pSteamHTTP = SteamClient.GetISteamHTTP(hSteamUser, hSteamPipe, "STEAMHTTP_INTERFACE_VERSION003"); if (m_pSteamHTTP == IntPtr.Zero) { return false; } m_pController = SteamClient.GetISteamController(hSteamUser, hSteamPipe, "SteamController007"); if (m_pController == IntPtr.Zero) { return false; } m_pSteamUGC = SteamClient.GetISteamUGC(hSteamUser, hSteamPipe, "STEAMUGC_INTERFACE_VERSION014"); if (m_pSteamUGC == IntPtr.Zero) { return false; } m_pSteamAppList = SteamClient.GetISteamAppList(hSteamUser, hSteamPipe, "STEAMAPPLIST_INTERFACE_VERSION001"); if (m_pSteamAppList == IntPtr.Zero) { return false; } m_pSteamMusic = SteamClient.GetISteamMusic(hSteamUser, hSteamPipe, "STEAMMUSIC_INTERFACE_VERSION001"); if (m_pSteamMusic == IntPtr.Zero) { return false; } m_pSteamMusicRemote = SteamClient.GetISteamMusicRemote(hSteamUser, hSteamPipe, "STEAMMUSICREMOTE_INTERFACE_VERSION001"); if (m_pSteamMusicRemote == IntPtr.Zero) { return false; } m_pSteamHTMLSurface = SteamClient.GetISteamHTMLSurface(hSteamUser, hSteamPipe, "STEAMHTMLSURFACE_INTERFACE_VERSION_005"); if (m_pSteamHTMLSurface == IntPtr.Zero) { return false; } m_pSteamInventory = SteamClient.GetISteamInventory(hSteamUser, hSteamPipe, "STEAMINVENTORY_INTERFACE_V003"); if (m_pSteamInventory == IntPtr.Zero) { return false; } m_pSteamVideo = SteamClient.GetISteamVideo(hSteamUser, hSteamPipe, "STEAMVIDEO_INTERFACE_V002"); if (m_pSteamVideo == IntPtr.Zero) { return false; } m_pSteamParentalSettings = SteamClient.GetISteamParentalSettings(hSteamUser, hSteamPipe, "STEAMPARENTALSETTINGS_INTERFACE_VERSION001"); if (m_pSteamParentalSettings == IntPtr.Zero) { return false; } m_pSteamInput = SteamClient.GetISteamInput(hSteamUser, hSteamPipe, "SteamInput001"); if (m_pSteamInput == IntPtr.Zero) { return false; } m_pSteamParties = SteamClient.GetISteamParties(hSteamUser, hSteamPipe, "SteamParties002"); if (m_pSteamParties == IntPtr.Zero) { return false; } m_pSteamRemotePlay = SteamClient.GetISteamRemotePlay(hSteamUser, hSteamPipe, "STEAMREMOTEPLAY_INTERFACE_VERSION001"); if (m_pSteamRemotePlay == IntPtr.Zero) { return false; } using (InteropHelp.UTF8StringHandle pszVersion = new InteropHelp.UTF8StringHandle("SteamNetworkingUtils003")) { m_pSteamNetworkingUtils = ((NativeMethods.SteamInternal_FindOrCreateUserInterface(hSteamUser, pszVersion) != IntPtr.Zero) ? NativeMethods.SteamInternal_FindOrCreateUserInterface(hSteamUser, pszVersion) : NativeMethods.SteamInternal_FindOrCreateGameServerInterface(hSteamUser, pszVersion)); } if (m_pSteamNetworkingUtils == IntPtr.Zero) { return false; } using (InteropHelp.UTF8StringHandle pszVersion2 = new InteropHelp.UTF8StringHandle("SteamNetworkingSockets008")) { m_pSteamNetworkingSockets = NativeMethods.SteamInternal_FindOrCreateUserInterface(hSteamUser, pszVersion2); } if (m_pSteamNetworkingSockets == IntPtr.Zero) { return false; } return true; } internal static IntPtr GetSteamClient() { return m_pSteamClient; } internal static IntPtr GetSteamUser() { return m_pSteamUser; } internal static IntPtr GetSteamFriends() { return m_pSteamFriends; } internal static IntPtr GetSteamUtils() { return m_pSteamUtils; } internal static IntPtr GetSteamMatchmaking() { return m_pSteamMatchmaking; } internal static IntPtr GetSteamUserStats() { return m_pSteamUserStats; } internal static IntPtr GetSteamApps() { return m_pSteamApps; } internal static IntPtr GetSteamMatchmakingServers() { return m_pSteamMatchmakingServers; } internal static IntPtr GetSteamNetworking() { return m_pSteamNetworking; } internal static IntPtr GetSteamRemoteStorage() { return m_pSteamRemoteStorage; } internal static IntPtr GetSteamScreenshots() { return m_pSteamScreenshots; } internal static IntPtr GetSteamGameSearch() { return m_pSteamGameSearch; } internal static IntPtr GetSteamHTTP() { return m_pSteamHTTP; } internal static IntPtr GetSteamController() { return m_pController; } internal static IntPtr GetSteamUGC() { return m_pSteamUGC; } internal static IntPtr GetSteamAppList() { return m_pSteamAppList; } internal static IntPtr GetSteamMusic() { return m_pSteamMusic; } internal static IntPtr GetSteamMusicRemote() { return m_pSteamMusicRemote; } internal static IntPtr GetSteamHTMLSurface() { return m_pSteamHTMLSurface; } internal static IntPtr GetSteamInventory() { return m_pSteamInventory; } internal static IntPtr GetSteamVideo() { return m_pSteamVideo; } internal static IntPtr GetSteamParentalSettings() { return m_pSteamParentalSettings; } internal static IntPtr GetSteamInput() { return m_pSteamInput; } internal static IntPtr GetSteamParties() { return m_pSteamParties; } internal static IntPtr GetSteamRemotePlay() { return m_pSteamRemotePlay; } internal static IntPtr GetSteamNetworkingUtils() { return m_pSteamNetworkingUtils; } internal static IntPtr GetSteamNetworkingSockets() { return m_pSteamNetworkingSockets; } } internal static class CSteamGameServerAPIContext { private static IntPtr m_pSteamClient; private static IntPtr m_pSteamGameServer; private static IntPtr m_pSteamUtils; private static IntPtr m_pSteamNetworking; private static IntPtr m_pSteamGameServerStats; private static IntPtr m_pSteamHTTP; private static IntPtr m_pSteamInventory; private static IntPtr m_pSteamUGC; private static IntPtr m_pSteamApps; private static IntPtr m_pSteamNetworkingUtils; private static IntPtr m_pSteamNetworkingSockets; internal static void Clear() { m_pSteamClient = IntPtr.Zero; m_pSteamGameServer = IntPtr.Zero; m_pSteamUtils = IntPtr.Zero; m_pSteamNetworking = IntPtr.Zero; m_pSteamGameServerStats = IntPtr.Zero; m_pSteamHTTP = IntPtr.Zero; m_pSteamInventory = IntPtr.Zero; m_pSteamUGC = IntPtr.Zero; m_pSteamApps = IntPtr.Zero; m_pSteamNetworkingUtils = IntPtr.Zero; m_pSteamNetworkingSockets = IntPtr.Zero; } internal static bool Init() { HSteamUser hSteamUser = GameServer.GetHSteamUser(); HSteamPipe hSteamPipe = GameServer.GetHSteamPipe(); if (hSteamPipe == (HSteamPipe)0) { return false; } using (InteropHelp.UTF8StringHandle ver = new InteropHelp.UTF8StringHandle("SteamClient020")) { m_pSteamClient = NativeMethods.SteamInternal_CreateInterface(ver); } if (m_pSteamClient == IntPtr.Zero) { return false; } m_pSteamGameServer = SteamGameServerClient.GetISteamGameServer(hSteamUser, hSteamPipe, "SteamGameServer013"); if (m_pSteamGameServer == IntPtr.Zero) { return false; } m_pSteamUtils = SteamGameServerClient.GetISteamUtils(hSteamPipe, "SteamUtils009"); if (m_pSteamUtils == IntPtr.Zero) { return false; } m_pSteamNetworking = SteamGameServerClient.GetISteamNetworking(hSteamUser, hSteamPipe, "SteamNetworking006"); if (m_pSteamNetworking == IntPtr.Zero) { return false; } m_pSteamGameServerStats = SteamGameServerClient.GetISteamGameServerStats(hSteamUser, hSteamPipe, "SteamGameServerStats001"); if (m_pSteamGameServerStats == IntPtr.Zero) { return false; } m_pSteamHTTP = SteamGameServerClient.GetISteamHTTP(hSteamUser, hSteamPipe, "STEAMHTTP_INTERFACE_VERSION003"); if (m_pSteamHTTP == IntPtr.Zero) { return false; } m_pSteamInventory = SteamGameServerClient.GetISteamInventory(hSteamUser, hSteamPipe, "STEAMINVENTORY_INTERFACE_V003"); if (m_pSteamInventory == IntPtr.Zero) { return false; } m_pSteamUGC = SteamGameServerClient.GetISteamUGC(hSteamUser, hSteamPipe, "STEAMUGC_INTERFACE_VERSION014"); if (m_pSteamUGC == IntPtr.Zero) { return false; } m_pSteamApps = SteamGameServerClient.GetISteamApps(hSteamUser, hSteamPipe, "STEAMAPPS_INTERFACE_VERSION008"); if (m_pSteamApps == IntPtr.Zero) { return false; } using (InteropHelp.UTF8StringHandle pszVersion = new InteropHelp.UTF8StringHandle("SteamNetworkingUtils003")) { m_pSteamNetworkingUtils = ((NativeMethods.SteamInternal_FindOrCreateUserInterface(hSteamUser, pszVersion) != IntPtr.Zero) ? NativeMethods.SteamInternal_FindOrCreateUserInterface(hSteamUser, pszVersion) : NativeMethods.SteamInternal_FindOrCreateGameServerInterface(hSteamUser, pszVersion)); } if (m_pSteamNetworkingUtils == IntPtr.Zero) { return false; } using (InteropHelp.UTF8StringHandle pszVersion2 = new InteropHelp.UTF8StringHandle("SteamNetworkingSockets008")) { m_pSteamNetworkingSockets = NativeMethods.SteamInternal_FindOrCreateGameServerInterface(hSteamUser, pszVersion2); } if (m_pSteamNetworkingSockets == IntPtr.Zero) { return false; } return true; } internal static IntPtr GetSteamClient() { return m_pSteamClient; } internal static IntPtr GetSteamGameServer() { return m_pSteamGameServer; } internal static IntPtr GetSteamUtils() { return m_pSteamUtils; } internal static IntPtr GetSteamNetworking() { return m_pSteamNetworking; } internal static IntPtr GetSteamGameServerStats() { return m_pSteamGameServerStats; } internal static IntPtr GetSteamHTTP() { return m_pSteamHTTP; } internal static IntPtr GetSteamInventory() { return m_pSteamInventory; } internal static IntPtr GetSteamUGC() { return m_pSteamUGC; } internal static IntPtr GetSteamApps() { return m_pSteamApps; } internal static IntPtr GetSteamNetworkingUtils() { return m_pSteamNetworkingUtils; } internal static IntPtr GetSteamNetworkingSockets() { return m_pSteamNetworkingSockets; } } [Serializable] [StructLayout(LayoutKind.Sequential, Pack = 4, Size = 372)] public class gameserveritem_t { public servernetadr_t m_NetAdr; public int m_nPing; [MarshalAs(UnmanagedType.I1)] public bool m_bHadSuccessfulResponse; [MarshalAs(UnmanagedType.I1)] public bool m_bDoNotRefresh; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] private byte[] m_szGameDir; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] private byte[] m_szMap; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] private byte[] m_szGameDescription; public uint m_nAppID; public int m_nPlayers; public int m_nMaxPlayers; public int m_nBotPlayers; [MarshalAs(UnmanagedType.I1)] public bool m_bPassword; [MarshalAs(UnmanagedType.I1)] public bool m_bSecure; public uint m_ulTimeLastPlayed; public int m_nServerVersion; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] private byte[] m_szServerName; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] private byte[] m_szGameTags; public CSteamID m_steamID; public string GetGameDir() { return Encoding.UTF8.GetString(m_szGameDir, 0, Array.IndexOf(m_szGameDir, (byte)0)); } public void SetGameDir(string dir) { m_szGameDir = Encoding.UTF8.GetBytes(dir + "\0"); } public string GetMap() { return Encoding.UTF8.GetString(m_szMap, 0, Array.IndexOf(m_szMap, (byte)0)); } public void SetMap(string map) { m_szMap = Encoding.UTF8.GetBytes(map + "\0"); } public string GetGameDescription() { return Encoding.UTF8.GetString(m_szGameDescription, 0, Array.IndexOf(m_szGameDescription, (byte)0)); } public void SetGameDescription(string desc) { m_szGameDescription = Encoding.UTF8.GetBytes(desc + "\0"); } public string GetServerName() { if (m_szServerName[0] == 0) { return m_NetAdr.GetConnectionAddressString(); } return Encoding.UTF8.GetString(m_szServerName, 0, Array.IndexOf(m_szServerName, (byte)0)); } public void SetServerName(string name) { m_szServerName = Encoding.UTF8.GetBytes(name + "\0"); } public string GetGameTags() { return Encoding.UTF8.GetString(m_szGameTags, 0, Array.IndexOf(m_szGameTags, (byte)0)); } public void SetGameTags(string tags) { m_szGameTags = Encoding.UTF8.GetBytes(tags + "\0"); } } [Serializable] public struct servernetadr_t { private ushort m_usConnectionPort; private ushort m_usQueryPort; private uint m_unIP; public void Init(uint ip, ushort usQueryPort, ushort usConnectionPort) { m_unIP = ip; m_usQueryPort = usQueryPort; m_usConnectionPort = usConnectionPort; } public ushort GetQueryPort() { return m_usQueryPort; } public void SetQueryPort(ushort usPort) { m_usQueryPort = usPort; } public ushort GetConnectionPort() { return m_usConnectionPort; } public void SetConnectionPort(ushort usPort) { m_usConnectionPort = usPort; } public uint GetIP() { return m_unIP; } public void SetIP(uint unIP) { m_unIP = unIP; } public string GetConnectionAddressString() { return ToString(m_unIP, m_usConnectionPort); } public string GetQueryAddressString() { return ToString(m_unIP, m_usQueryPort); } public static string ToString(uint unIP, ushort usPort) { return $"{(ulong)(unIP >> 24) & 0xFFuL}.{(ulong)(unIP >> 16) & 0xFFuL}.{(ulong)(unIP >> 8) & 0xFFuL}.{(ulong)unIP & 0xFFuL}:{usPort}"; } public static bool operator <(servernetadr_t x, servernetadr_t y) { if (x.m_unIP >= y.m_unIP) { if (x.m_unIP == y.m_unIP) { return x.m_usQueryPort < y.m_usQueryPort; } return false; } return true; } public static bool operator >(servernetadr_t x, servernetadr_t y) { if (x.m_unIP <= y.m_unIP) { if (x.m_unIP == y.m_unIP) { return x.m_usQueryPort > y.m_usQueryPort; } return false; } return true; } public override bool Equals(object other) { if (other is servernetadr_t) { return this == (servernetadr_t)other; } return false; } public override int GetHashCode() { return m_unIP.GetHashCode() + m_usQueryPort.GetHashCode() + m_usConnectionPort.GetHashCode(); } public static bool operator ==(servernetadr_t x, servernetadr_t y) { if (x.m_unIP == y.m_unIP && x.m_usQueryPort == y.m_usQueryPort) { return x.m_usConnectionPort == y.m_usConnectionPort; } return false; } public static bool operator !=(servernetadr_t x, servernetadr_t y) { return !(x == y); } public bool Equals(servernetadr_t other) { if (m_unIP == other.m_unIP && m_usQueryPort == other.m_usQueryPort) { return m_usConnectionPort == other.m_usConnectionPort; } return false; } public int CompareTo(servernetadr_t other) { return m_unIP.CompareTo(other.m_unIP) + m_usQueryPort.CompareTo(other.m_usQueryPort) + m_usConnectionPort.CompareTo(other.m_usConnectionPort); } } [Serializable] public struct HSteamPipe : IEquatable, IComparable { public int m_HSteamPipe; public HSteamPipe(int value) { m_HSteamPipe = value; } public override string ToString() { return m_HSteamPipe.ToString(); } public override bool Equals(object other) { if (other is HSteamPipe) { return this == (HSteamPipe)other; } return false; } public override int GetHashCode() { return m_HSteamPipe.GetHashCode(); } public static bool operator ==(HSteamPipe x, HSteamPipe y) { return x.m_HSteamPipe == y.m_HSteamPipe; } public static bool operator !=(HSteamPipe x, HSteamPipe y) { return !(x == y); } public static explicit operator HSteamPipe(int value) { return new HSteamPipe(value); } public static explicit operator int(HSteamPipe that) { return that.m_HSteamPipe; } public bool Equals(HSteamPipe other) { return m_HSteamPipe == other.m_HSteamPipe; } public int CompareTo(HSteamPipe other) { return m_HSteamPipe.CompareTo(other.m_HSteamPipe); } } [Serializable] public struct HSteamUser : IEquatable, IComparable { public int m_HSteamUser; public HSteamUser(int value) { m_HSteamUser = value; } public override string ToString() { return m_HSteamUser.ToString(); } public override bool Equals(object other) { if (other is HSteamUser) { return this == (HSteamUser)other; } return false; } public override int GetHashCode() { return m_HSteamUser.GetHashCode(); } public static bool operator ==(HSteamUser x, HSteamUser y) { return x.m_HSteamUser == y.m_HSteamUser; } public static bool operator !=(HSteamUser x, HSteamUser y) { return !(x == y); } public static explicit operator HSteamUser(int value) { return new HSteamUser(value); } public static explicit operator int(HSteamUser that) { return that.m_HSteamUser; } public bool Equals(HSteamUser other) { return m_HSteamUser == other.m_HSteamUser; } public int CompareTo(HSteamUser other) { return m_HSteamUser.CompareTo(other.m_HSteamUser); } } [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate void SteamAPI_CheckCallbackRegistered_t(int iCallbackNum); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void SteamAPIWarningMessageHook_t(int nSeverity, StringBuilder pchDebugText); [Serializable] public struct CGameID : IEquatable, IComparable { public enum EGameIDType { k_EGameIDTypeApp, k_EGameIDTypeGameMod, k_EGameIDTypeShortcut, k_EGameIDTypeP2P } public ulong m_GameID; public CGameID(ulong GameID) { m_GameID = GameID; } public CGameID(AppId_t nAppID) { m_GameID = 0uL; SetAppID(nAppID); } public CGameID(AppId_t nAppID, uint nModID) { m_GameID = 0uL; SetAppID(nAppID); SetType(EGameIDType.k_EGameIDTypeGameMod); SetModID(nModID); } public bool IsSteamApp() { return Type() == EGameIDType.k_EGameIDTypeApp; } public bool IsMod() { return Type() == EGameIDType.k_EGameIDTypeGameMod; } public bool IsShortcut() { return Type() == EGameIDType.k_EGameIDTypeShortcut; } public bool IsP2PFile() { return Type() == EGameIDType.k_EGameIDTypeP2P; } public AppId_t AppID() { return new AppId_t((uint)(m_GameID & 0xFFFFFF)); } public EGameIDType Type() { return (EGameIDType)((m_GameID >> 24) & 0xFF); } public uint ModID() { return (uint)((m_GameID >> 32) & 0xFFFFFFFFu); } public bool IsValid() { switch (Type()) { case EGameIDType.k_EGameIDTypeApp: return AppID() != AppId_t.Invalid; case EGameIDType.k_EGameIDTypeGameMod: if (AppID() != AppId_t.Invalid) { return (ModID() & 0x80000000u) != 0; } return false; case EGameIDType.k_EGameIDTypeShortcut: return (ModID() & 0x80000000u) != 0; case EGameIDType.k_EGameIDTypeP2P: if (AppID() == AppId_t.Invalid) { return (ModID() & 0x80000000u) != 0; } return false; default: return false; } } public void Reset() { m_GameID = 0uL; } public void Set(ulong GameID) { m_GameID = GameID; } private void SetAppID(AppId_t other) { m_GameID = (m_GameID & 0xFFFFFFFFFF000000uL) | ((ulong)(uint)other & 0xFFFFFFuL); } private void SetType(EGameIDType other) { m_GameID = (m_GameID & 0xFFFFFFFF00FFFFFFuL) | (((ulong)other & 0xFFuL) << 24); } private void SetModID(uint other) { m_GameID = (m_GameID & 0xFFFFFFFFu) | (((ulong)other & 0xFFFFFFFFuL) << 32); } public override string ToString() { return m_GameID.ToString(); } public override bool Equals(object other) { if (other is CGameID) { return this == (CGameID)other; } return false; } public override int GetHashCode() { return m_GameID.GetHashCode(); } public static bool operator ==(CGameID x, CGameID y) { return x.m_GameID == y.m_GameID; } public static bool operator !=(CGameID x, CGameID y) { return !(x == y); } public static explicit operator CGameID(ulong value) { return new CGameID(value); } public static explicit operator ulong(CGameID that) { return that.m_GameID; } public bool Equals(CGameID other) { return m_GameID == other.m_GameID; } public int CompareTo(CGameID other) { return m_GameID.CompareTo(other.m_GameID); } } [Serializable] [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct CSteamID : IEquatable, IComparable { public static readonly CSteamID Nil = default(CSteamID); public static readonly CSteamID OutofDateGS = new CSteamID(new AccountID_t(0u), 0u, EUniverse.k_EUniverseInvalid, EAccountType.k_EAccountTypeInvalid); public static readonly CSteamID LanModeGS = new CSteamID(new AccountID_t(0u), 0u, EUniverse.k_EUniversePublic, EAccountType.k_EAccountTypeInvalid); public static readonly CSteamID NotInitYetGS = new CSteamID(new AccountID_t(1u), 0u, EUniverse.k_EUniverseInvalid, EAccountType.k_EAccountTypeInvalid); public static readonly CSteamID NonSteamGS = new CSteamID(new AccountID_t(2u), 0u, EUniverse.k_EUniverseInvalid, EAccountType.k_EAccountTypeInvalid); public ulong m_SteamID; public CSteamID(AccountID_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) { m_SteamID = 0uL; Set(unAccountID, eUniverse, eAccountType); } public CSteamID(AccountID_t unAccountID, uint unAccountInstance, EUniverse eUniverse, EAccountType eAccountType) { m_SteamID = 0uL; InstancedSet(unAccountID, unAccountInstance, eUniverse, eAccountType); } public CSteamID(ulong ulSteamID) { m_SteamID = ulSteamID; } public void Set(AccountID_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) { SetAccountID(unAccountID); SetEUniverse(eUniverse); SetEAccountType(eAccountType); if (eAccountType == EAccountType.k_EAccountTypeClan || eAccountType == EAccountType.k_EAccountTypeGameServer) { SetAccountInstance(0u); } else { SetAccountInstance(1u); } } public void InstancedSet(AccountID_t unAccountID, uint unInstance, EUniverse eUniverse, EAccountType eAccountType) { SetAccountID(unAccountID); SetEUniverse(eUniverse); SetEAccountType(eAccountType); SetAccountInstance(unInstance); } public void Clear() { m_SteamID = 0uL; } public void CreateBlankAnonLogon(EUniverse eUniverse) { SetAccountID(new AccountID_t(0u)); SetEUniverse(eUniverse); SetEAccountType(EAccountType.k_EAccountTypeAnonGameServer); SetAccountInstance(0u); } public void CreateBlankAnonUserLogon(EUniverse eUniverse) { SetAccountID(new AccountID_t(0u)); SetEUniverse(eUniverse); SetEAccountType(EAccountType.k_EAccountTypeAnonUser); SetAccountInstance(0u); } public bool BBlankAnonAccount() { if (GetAccountID() == new AccountID_t(0u) && BAnonAccount()) { return GetUnAccountInstance() == 0; } return false; } public bool BGameServerAccount() { if (GetEAccountType() != EAccountType.k_EAccountTypeGameServer) { return GetEAccountType() == EAccountType.k_EAccountTypeAnonGameServer; } return true; } public bool BPersistentGameServerAccount() { return GetEAccountType() == EAccountType.k_EAccountTypeGameServer; } public bool BAnonGameServerAccount() { return GetEAccountType() == EAccountType.k_EAccountTypeAnonGameServer; } public bool BContentServerAccount() { return GetEAccountType() == EAccountType.k_EAccountTypeContentServer; } public bool BClanAccount() { return GetEAccountType() == EAccountType.k_EAccountTypeClan; } public bool BChatAccount() { return GetEAccountType() == EAccountType.k_EAccountTypeChat; } public bool IsLobby() { if (GetEAccountType() == EAccountType.k_EAccountTypeChat) { return (GetUnAccountInstance() & 0x40000) != 0; } return false; } public bool BIndividualAccount() { if (GetEAccountType() != EAccountType.k_EAccountTypeIndividual) { return GetEAccountType() == EAccountType.k_EAccountTypeConsoleUser; } return true; } public bool BAnonAccount() { if (GetEAccountType() != EAccountType.k_EAccountTypeAnonUser) { return GetEAccountType() == EAccountType.k_EAccountTypeAnonGameServer; } return true; } public bool BAnonUserAccount() { return GetEAccountType() == EAccountType.k_EAccountTypeAnonUser; } public bool BConsoleUserAccount() { return GetEAccountType() == EAccountType.k_EAccountTypeConsoleUser; } public void SetAccountID(AccountID_t other) { m_SteamID = (m_SteamID & 0xFFFFFFFF00000000uL) | ((ulong)(uint)other & 0xFFFFFFFFuL); } public void SetAccountInstance(uint other) { m_SteamID = (m_SteamID & 0xFFF00000FFFFFFFFuL) | (((ulong)other & 0xFFFFFuL) << 32); } public void SetEAccountType(EAccountType other) { m_SteamID = (m_SteamID & 0xFF0FFFFFFFFFFFFFuL) | (((ulong)other & 0xFuL) << 52); } public void SetEUniverse(EUniverse other) { m_SteamID = (m_SteamID & 0xFFFFFFFFFFFFFFuL) | (((ulong)other & 0xFFuL) << 56); } public AccountID_t GetAccountID() { return new AccountID_t((uint)(m_SteamID & 0xFFFFFFFFu)); } public uint GetUnAccountInstance() { return (uint)((m_SteamID >> 32) & 0xFFFFF); } public EAccountType GetEAccountType() { return (EAccountType)((m_SteamID >> 52) & 0xF); } public EUniverse GetEUniverse() { return (EUniverse)((m_SteamID >> 56) & 0xFF); } public bool IsValid() { if (GetEAccountType() <= EAccountType.k_EAccountTypeInvalid || GetEAccountType() >= EAccountType.k_EAccountTypeMax) { return false; } if (GetEUniverse() <= EUniverse.k_EUniverseInvalid || GetEUniverse() >= EUniverse.k_EUniverseMax) { return false; } if (GetEAccountType() == EAccountType.k_EAccountTypeIndividual && (GetAccountID() == new AccountID_t(0u) || GetUnAccountInstance() > 1)) { return false; } if (GetEAccountType() == EAccountType.k_EAccountTypeClan && (GetAccountID() == new AccountID_t(0u) || GetUnAccountInstance() != 0)) { return false; } if (GetEAccountType() == EAccountType.k_EAccountTypeGameServer && GetAccountID() == new AccountID_t(0u)) { return false; } return true; } public override string ToString() { return m_SteamID.ToString(); } public override bool Equals(object other) { if (other is CSteamID) { return this == (CSteamID)other; } return false; } public override int GetHashCode() { return m_SteamID.GetHashCode(); } public static bool operator ==(CSteamID x, CSteamID y) { return x.m_SteamID == y.m_SteamID; } public static bool operator !=(CSteamID x, CSteamID y) { return !(x == y); } public static explicit operator CSteamID(ulong value) { return new CSteamID(value); } public static explicit operator ulong(CSteamID that) { return that.m_SteamID; } public bool Equals(CSteamID other) { return m_SteamID == other.m_SteamID; } public int CompareTo(CSteamID other) { return m_SteamID.CompareTo(other.m_SteamID); } } [Serializable] public struct HAuthTicket : IEquatable, IComparable { public static readonly HAuthTicket Invalid = new HAuthTicket(0u); public uint m_HAuthTicket; public HAuthTicket(uint value) { m_HAuthTicket = value; } public override string ToString() { return m_HAuthTicket.ToString(); } public override bool Equals(object other) { if (other is HAuthTicket) { return this == (HAuthTicket)other; } return false; } public override int GetHashCode() { return m_HAuthTicket.GetHashCode(); } public static bool operator ==(HAuthTicket x, HAuthTicket y) { return x.m_HAuthTicket == y.m_HAuthTicket; } public static bool operator !=(HAuthTicket x, HAuthTicket y) { return !(x == y); } public static explicit operator HAuthTicket(uint value) { return new HAuthTicket(value); } public static explicit operator uint(HAuthTicket that) { return that.m_HAuthTicket; } public bool Equals(HAuthTicket other) { return m_HAuthTicket == other.m_HAuthTicket; } public int CompareTo(HAuthTicket other) { return m_HAuthTicket.CompareTo(other.m_HAuthTicket); } } [Serializable] public struct ControllerActionSetHandle_t : IEquatable, IComparable { public ulong m_ControllerActionSetHandle; public ControllerActionSetHandle_t(ulong value) { m_ControllerActionSetHandle = value; } public override string ToString() { return m_ControllerActionSetHandle.ToString(); } public override bool Equals(object other) { if (other is ControllerActionSetHandle_t) { return this == (ControllerActionSetHandle_t)other; } return false; } public override int GetHashCode() { return m_ControllerActionSetHandle.GetHashCode(); } public static bool operator ==(ControllerActionSetHandle_t x, ControllerActionSetHandle_t y) { return x.m_ControllerActionSetHandle == y.m_ControllerActionSetHandle; } public static bool operator !=(ControllerActionSetHandle_t x, ControllerActionSetHandle_t y) { return !(x == y); } public static explicit operator ControllerActionSetHandle_t(ulong value) { return new ControllerActionSetHandle_t(value); } public static explicit operator ulong(ControllerActionSetHandle_t that) { return that.m_ControllerActionSetHandle; } public bool Equals(ControllerActionSetHandle_t other) { return m_ControllerActionSetHandle == other.m_ControllerActionSetHandle; } public int CompareTo(ControllerActionSetHandle_t other) { return m_ControllerActionSetHandle.CompareTo(other.m_ControllerActionSetHandle); } } [Serializable] public struct ControllerAnalogActionHandle_t : IEquatable, IComparable { public ulong m_ControllerAnalogActionHandle; public ControllerAnalogActionHandle_t(ulong value) { m_ControllerAnalogActionHandle = value; } public override string ToString() { return m_ControllerAnalogActionHandle.ToString(); } public override bool Equals(object other) { if (other is ControllerAnalogActionHandle_t) { return this == (ControllerAnalogActionHandle_t)other; } return false; } public override int GetHashCode() { return m_ControllerAnalogActionHandle.GetHashCode(); } public static bool operator ==(ControllerAnalogActionHandle_t x, ControllerAnalogActionHandle_t y) { return x.m_ControllerAnalogActionHandle == y.m_ControllerAnalogActionHandle; } public static bool operator !=(ControllerAnalogActionHandle_t x, ControllerAnalogActionHandle_t y) { return !(x == y); } public static explicit operator ControllerAnalogActionHandle_t(ulong value) { return new ControllerAnalogActionHandle_t(value); } public static explicit operator ulong(ControllerAnalogActionHandle_t that) { return that.m_ControllerAnalogActionHandle; } public bool Equals(ControllerAnalogActionHandle_t other) { return m_ControllerAnalogActionHandle == other.m_ControllerAnalogActionHandle; } public int CompareTo(ControllerAnalogActionHandle_t other) { return m_ControllerAnalogActionHandle.CompareTo(other.m_ControllerAnalogActionHandle); } } [Serializable] public struct ControllerDigitalActionHandle_t : IEquatable, IComparable { public ulong m_ControllerDigitalActionHandle; public ControllerDigitalActionHandle_t(ulong value) { m_ControllerDigitalActionHandle = value; } public override string ToString() { return m_ControllerDigitalActionHandle.ToString(); } public override bool Equals(object other) { if (other is ControllerDigitalActionHandle_t) { return this == (ControllerDigitalActionHandle_t)other; } return false; } public override int GetHashCode() { return m_ControllerDigitalActionHandle.GetHashCode(); } public static bool operator ==(ControllerDigitalActionHandle_t x, ControllerDigitalActionHandle_t y) { return x.m_ControllerDigitalActionHandle == y.m_ControllerDigitalActionHandle; } public static bool operator !=(ControllerDigitalActionHandle_t x, ControllerDigitalActionHandle_t y) { return !(x == y); } public static explicit operator ControllerDigitalActionHandle_t(ulong value) { return new ControllerDigitalActionHandle_t(value); } public static explicit operator ulong(ControllerDigitalActionHandle_t that) { return that.m_ControllerDigitalActionHandle; } public bool Equals(ControllerDigitalActionHandle_t other) { return m_ControllerDigitalActionHandle == other.m_ControllerDigitalActionHandle; } public int CompareTo(ControllerDigitalActionHandle_t other) { return m_ControllerDigitalActionHandle.CompareTo(other.m_ControllerDigitalActionHandle); } } [Serializable] public struct ControllerHandle_t : IEquatable, IComparable { public ulong m_ControllerHandle; public ControllerHandle_t(ulong value) { m_ControllerHandle = value; } public override string ToString() { return m_ControllerHandle.ToString(); } public override bool Equals(object other) { if (other is ControllerHandle_t) { return this == (ControllerHandle_t)other; } return false; } public override int GetHashCode() { return m_ControllerHandle.GetHashCode(); } public static bool operator ==(ControllerHandle_t x, ControllerHandle_t y) { return x.m_ControllerHandle == y.m_ControllerHandle; } public static bool operator !=(ControllerHandle_t x, ControllerHandle_t y) { return !(x == y); } public static explicit operator ControllerHandle_t(ulong value) { return new ControllerHandle_t(value); } public static explicit operator ulong(ControllerHandle_t that) { return that.m_ControllerHandle; } public bool Equals(ControllerHandle_t other) { return m_ControllerHandle == other.m_ControllerHandle; } public int CompareTo(ControllerHandle_t other) { return m_ControllerHandle.CompareTo(other.m_ControllerHandle); } } [Serializable] [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct SteamDatagramHostedAddress { public int m_cbSize; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] public byte[] m_data; public void Clear() { m_cbSize = 0; m_data = new byte[128]; } } [Serializable] [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct SteamDatagramRelayAuthTicket { [StructLayout(LayoutKind.Sequential, Pack = 8)] private struct ExtraField { private enum EType { k_EType_String, k_EType_Int, k_EType_Fixed64 } [StructLayout(LayoutKind.Explicit)] private struct OptionValue { [FieldOffset(0)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] private byte[] m_szStringValue; [FieldOffset(0)] private long m_nIntValue; [FieldOffset(0)] private ulong m_nFixed64Value; } private EType m_eType; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)] private byte[] m_szName; private OptionValue m_val; } private SteamNetworkingIdentity m_identityGameserver; private SteamNetworkingIdentity m_identityAuthorizedClient; private uint m_unPublicIP; private RTime32 m_rtimeTicketExpiry; private SteamDatagramHostedAddress m_routing; private uint m_nAppID; private int m_nRestrictToVirtualPort; private const int k_nMaxExtraFields = 16; private int m_nExtraFields; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] private ExtraField[] m_vecExtraFields; public void Clear() { } } [Serializable] public struct FriendsGroupID_t : IEquatable, IComparable { public static readonly FriendsGroupID_t Invalid = new FriendsGroupID_t(-1); public short m_FriendsGroupID; public FriendsGroupID_t(short value) { m_FriendsGroupID = value; } public override string ToString() { return m_FriendsGroupID.ToString(); } public override bool Equals(object other) { if (other is FriendsGroupID_t) { return this == (FriendsGroupID_t)other; } return false; } public override int GetHashCode() { return m_FriendsGroupID.GetHashCode(); } public static bool operator ==(FriendsGroupID_t x, FriendsGroupID_t y) { return x.m_FriendsGroupID == y.m_FriendsGroupID; } public static bool operator !=(FriendsGroupID_t x, FriendsGroupID_t y) { return !(x == y); } public static explicit operator FriendsGroupID_t(short value) { return new FriendsGroupID_t(value); } public static explicit operator short(FriendsGroupID_t that) { return that.m_FriendsGroupID; } public bool Equals(FriendsGroupID_t other) { return m_FriendsGroupID == other.m_FriendsGroupID; } public int CompareTo(FriendsGroupID_t other) { return m_FriendsGroupID.CompareTo(other.m_FriendsGroupID); } } [Serializable] public struct HHTMLBrowser : IEquatable, IComparable { public static readonly HHTMLBrowser Invalid = new HHTMLBrowser(0u); public uint m_HHTMLBrowser; public HHTMLBrowser(uint value) { m_HHTMLBrowser = value; } public override string ToString() { return m_HHTMLBrowser.ToString(); } public override bool Equals(object other) { if (other is HHTMLBrowser) { return this == (HHTMLBrowser)other; } return false; } public override int GetHashCode() { return m_HHTMLBrowser.GetHashCode(); } public static bool operator ==(HHTMLBrowser x, HHTMLBrowser y) { return x.m_HHTMLBrowser == y.m_HHTMLBrowser; } public static bool operator !=(HHTMLBrowser x, HHTMLBrowser y) { return !(x == y); } public static explicit operator HHTMLBrowser(uint value) { return new HHTMLBrowser(value); } public static explicit operator uint(HHTMLBrowser that) { return that.m_HHTMLBrowser; } public bool Equals(HHTMLBrowser other) { return m_HHTMLBrowser == other.m_HHTMLBrowser; } public int CompareTo(HHTMLBrowser other) { return m_HHTMLBrowser.CompareTo(other.m_HHTMLBrowser); } } [Serializable] public struct HTTPCookieContainerHandle : IEquatable, IComparable { public static readonly HTTPCookieContainerHandle Invalid = new HTTPCookieContainerHandle(0u); public uint m_HTTPCookieContainerHandle; public HTTPCookieContainerHandle(uint value) { m_HTTPCookieContainerHandle = value; } public override string ToString() { return m_HTTPCookieContainerHandle.ToString(); } public override bool Equals(object other) { if (other is HTTPCookieContainerHandle) { return this == (HTTPCookieContainerHandle)other; } return false; } public override int GetHashCode() { return m_HTTPCookieContainerHandle.GetHashCode(); } public static bool operator ==(HTTPCookieContainerHandle x, HTTPCookieContainerHandle y) { return x.m_HTTPCookieContainerHandle == y.m_HTTPCookieContainerHandle; } public static bool operator !=(HTTPCookieContainerHandle x, HTTPCookieContainerHandle y) { return !(x == y); } public static explicit operator HTTPCookieContainerHandle(uint value) { return new HTTPCookieContainerHandle(value); } public static explicit operator uint(HTTPCookieContainerHandle that) { return that.m_HTTPCookieContainerHandle; } public bool Equals(HTTPCookieContainerHandle other) { return m_HTTPCookieContainerHandle == other.m_HTTPCookieContainerHandle; } public int CompareTo(HTTPCookieContainerHandle other) { return m_HTTPCookieContainerHandle.CompareTo(other.m_HTTPCookieContainerHandle); } } [Serializable] public struct HTTPRequestHandle : IEquatable, IComparable { public static readonly HTTPRequestHandle Invalid = new HTTPRequestHandle(0u); public uint m_HTTPRequestHandle; public HTTPRequestHandle(uint value) { m_HTTPRequestHandle = value; } public override string ToString() { return m_HTTPRequestHandle.ToString(); } public override bool Equals(object other) { if (other is HTTPRequestHandle) { return this == (HTTPRequestHandle)other; } return false; } public override int GetHashCode() { return m_HTTPRequestHandle.GetHashCode(); } public static bool operator ==(HTTPRequestHandle x, HTTPRequestHandle y) { return x.m_HTTPRequestHandle == y.m_HTTPRequestHandle; } public static bool operator !=(HTTPRequestHandle x, HTTPRequestHandle y) { return !(x == y); } public static explicit operator HTTPRequestHandle(uint value) { return new HTTPRequestHandle(value); } public static explicit operator uint(HTTPRequestHandle that) { return that.m_HTTPRequestHandle; } public bool Equals(HTTPRequestHandle other) { return m_HTTPRequestHandle == other.m_HTTPRequestHandle; } public int CompareTo(HTTPRequestHandle other) { return m_HTTPRequestHandle.CompareTo(other.m_HTTPRequestHandle); } } [Serializable] public struct InputActionSetHandle_t : IEquatable, IComparable { public ulong m_InputActionSetHandle; public InputActionSetHandle_t(ulong value) { m_InputActionSetHandle = value; } public override string ToString() { return m_InputActionSetHandle.ToString(); } public override bool Equals(object other) { if (other is InputActionSetHandle_t) { return this == (InputActionSetHandle_t)other; } return false; } public override int GetHashCode() { return m_InputActionSetHandle.GetHashCode(); } public static bool operator ==(InputActionSetHandle_t x, InputActionSetHandle_t y) { return x.m_InputActionSetHandle == y.m_InputActionSetHandle; } public static bool operator !=(InputActionSetHandle_t x, InputActionSetHandle_t y) { return !(x == y); } public static explicit operator InputActionSetHandle_t(ulong value) { return new InputActionSetHandle_t(value); } public static explicit operator ulong(InputActionSetHandle_t that) { return that.m_InputActionSetHandle; } public bool Equals(InputActionSetHandle_t other) { return m_InputActionSetHandle == other.m_InputActionSetHandle; } public int CompareTo(InputActionSetHandle_t other) { return m_InputActionSetHandle.CompareTo(other.m_InputActionSetHandle); } } [Serializable] public struct InputAnalogActionHandle_t : IEquatable, IComparable { public ulong m_InputAnalogActionHandle; public InputAnalogActionHandle_t(ulong value) { m_InputAnalogActionHandle = value; } public override string ToString() { return m_InputAnalogActionHandle.ToString(); } public override bool Equals(object other) { if (other is InputAnalogActionHandle_t) { return this == (InputAnalogActionHandle_t)other; } return false; } public override int GetHashCode() { return m_InputAnalogActionHandle.GetHashCode(); } public static bool operator ==(InputAnalogActionHandle_t x, InputAnalogActionHandle_t y) { return x.m_InputAnalogActionHandle == y.m_InputAnalogActionHandle; } public static bool operator !=(InputAnalogActionHandle_t x, InputAnalogActionHandle_t y) { return !(x == y); } public static explicit operator InputAnalogActionHandle_t(ulong value) { return new InputAnalogActionHandle_t(value); } public static explicit operator ulong(InputAnalogActionHandle_t that) { return that.m_InputAnalogActionHandle; } public bool Equals(InputAnalogActionHandle_t other) { return m_InputAnalogActionHandle == other.m_InputAnalogActionHandle; } public int CompareTo(InputAnalogActionHandle_t other) { return m_InputAnalogActionHandle.CompareTo(other.m_InputAnalogActionHandle); } } [Serializable] public struct InputDigitalActionHandle_t : IEquatable, IComparable { public ulong m_InputDigitalActionHandle; public InputDigitalActionHandle_t(ulong value) { m_InputDigitalActionHandle = value; } public override string ToString() { return m_InputDigitalActionHandle.ToString(); } public override bool Equals(object other) { if (other is InputDigitalActionHandle_t) { return this == (InputDigitalActionHandle_t)other; } return false; } public override int GetHashCode() { return m_InputDigitalActionHandle.GetHashCode(); } public static bool operator ==(InputDigitalActionHandle_t x, InputDigitalActionHandle_t y) { return x.m_InputDigitalActionHandle == y.m_InputDigitalActionHandle; } public static bool operator !=(InputDigitalActionHandle_t x, InputDigitalActionHandle_t y) { return !(x == y); } public static explicit operator InputDigitalActionHandle_t(ulong value) { return new InputDigitalActionHandle_t(value); } public static explicit operator ulong(InputDigitalActionHandle_t that) { return that.m_InputDigitalActionHandle; } public bool Equals(InputDigitalActionHandle_t other) { return m_InputDigitalActionHandle == other.m_InputDigitalActionHandle; } public int CompareTo(InputDigitalActionHandle_t other) { return m_InputDigitalActionHandle.CompareTo(other.m_InputDigitalActionHandle); } } [Serializable] public struct InputHandle_t : IEquatable, IComparable { public ulong m_InputHandle; public InputHandle_t(ulong value) { m_InputHandle = value; } public override string ToString() { return m_InputHandle.ToString(); } public override bool Equals(object other) { if (other is InputHandle_t) { return this == (InputHandle_t)other; } return false; } public override int GetHashCode() { return m_InputHandle.GetHashCode(); } public static bool operator ==(InputHandle_t x, InputHandle_t y) { return x.m_InputHandle == y.m_InputHandle; } public static bool operator !=(InputHandle_t x, InputHandle_t y) { return !(x == y); } public static explicit operator InputHandle_t(ulong value) { return new InputHandle_t(value); } public static explicit operator ulong(InputHandle_t that) { return that.m_InputHandle; } public bool Equals(InputHandle_t other) { return m_InputHandle == other.m_InputHandle; } public int CompareTo(InputHandle_t other) { return m_InputHandle.CompareTo(other.m_InputHandle); } } [Serializable] public struct SteamInventoryResult_t : IEquatable, IComparable { public static readonly SteamInventoryResult_t Invalid = new SteamInventoryResult_t(-1); public int m_SteamInventoryResult; public SteamInventoryResult_t(int value) { m_SteamInventoryResult = value; } public override string ToString() { return m_SteamInventoryResult.ToString(); } public override bool Equals(object other) { if (other is SteamInventoryResult_t) { return this == (SteamInventoryResult_t)other; } return false; } public override int GetHashCode() { return m_SteamInventoryResult.GetHashCode(); } public static bool operator ==(SteamInventoryResult_t x, SteamInventoryResult_t y) { return x.m_SteamInventoryResult == y.m_SteamInventoryResult; } public static bool operator !=(SteamInventoryResult_t x, SteamInventoryResult_t y) { return !(x == y); } public static explicit operator SteamInventoryResult_t(int value) { return new SteamInventoryResult_t(value); } public static explicit operator int(SteamInventoryResult_t that) { return that.m_SteamInventoryResult; } public bool Equals(SteamInventoryResult_t other) { return m_SteamInventoryResult == other.m_SteamInventoryResult; } public int CompareTo(SteamInventoryResult_t other) { return m_SteamInventoryResult.CompareTo(other.m_SteamInventoryResult); } } [Serializable] public struct SteamInventoryUpdateHandle_t : IEquatable, IComparable { public static readonly SteamInventoryUpdateHandle_t Invalid = new SteamInventoryUpdateHandle_t(ulong.MaxValue); public ulong m_SteamInventoryUpdateHandle; public SteamInventoryUpdateHandle_t(ulong value) { m_SteamInventoryUpdateHandle = value; } public override string ToString() { return m_SteamInventoryUpdateHandle.ToString(); } public override bool Equals(object other) { if (other is SteamInventoryUpdateHandle_t) { return this == (SteamInventoryUpdateHandle_t)other; } return false; } public override int GetHashCode() { return m_SteamInventoryUpdateHandle.GetHashCode(); } public static bool operator ==(SteamInventoryUpdateHandle_t x, SteamInventoryUpdateHandle_t y) { return x.m_SteamInventoryUpdateHandle == y.m_SteamInventoryUpdateHandle; } public static bool operator !=(SteamInventoryUpdateHandle_t x, SteamInventoryUpdateHandle_t y) { return !(x == y); } public static explicit operator SteamInventoryUpdateHandle_t(ulong value) { return new SteamInventoryUpdateHandle_t(value); } public static explicit operator ulong(SteamInventoryUpdateHandle_t that) { return that.m_SteamInventoryUpdateHandle; } public bool Equals(SteamInventoryUpdateHandle_t other) { return m_SteamInventoryUpdateHandle == other.m_SteamInventoryUpdateHandle; } public int CompareTo(SteamInventoryUpdateHandle_t other) { return m_SteamInventoryUpdateHandle.CompareTo(other.m_SteamInventoryUpdateHandle); } } [Serializable] public struct SteamItemDef_t : IEquatable, IComparable { public int m_SteamItemDef; public SteamItemDef_t(int value) { m_SteamItemDef = value; } public override string ToString() { return m_SteamItemDef.ToString(); } public override bool Equals(object other) { if (other is SteamItemDef_t) { return this == (SteamItemDef_t)other; } return false; } public override int GetHashCode() { return m_SteamItemDef.GetHashCode(); } public static bool operator ==(SteamItemDef_t x, SteamItemDef_t y) { return x.m_SteamItemDef == y.m_SteamItemDef; } public static bool operator !=(SteamItemDef_t x, SteamItemDef_t y) { return !(x == y); } public static explicit operator SteamItemDef_t(int value) { return new SteamItemDef_t(value); } public static explicit operator int(SteamItemDef_t that) { return that.m_SteamItemDef; } public bool Equals(SteamItemDef_t other) { return m_SteamItemDef == other.m_SteamItemDef; } public int CompareTo(SteamItemDef_t other) { return m_SteamItemDef.CompareTo(other.m_SteamItemDef); } } [Serializable] public struct SteamItemInstanceID_t : IEquatable, IComparable { public static readonly SteamItemInstanceID_t Invalid = new SteamItemInstanceID_t(ulong.MaxValue); public ulong m_SteamItemInstanceID; public SteamItemInstanceID_t(ulong value) { m_SteamItemInstanceID = value; } public override string ToString() { return m_SteamItemInstanceID.ToString(); } public override bool Equals(object other) { if (other is SteamItemInstanceID_t) { return this == (SteamItemInstanceID_t)other; } return false; } public override int GetHashCode() { return m_SteamItemInstanceID.GetHashCode(); } public static bool operator ==(SteamItemInstanceID_t x, SteamItemInstanceID_t y) { return x.m_SteamItemInstanceID == y.m_SteamItemInstanceID; } public static bool operator !=(SteamItemInstanceID_t x, SteamItemInstanceID_t y) { return !(x == y); } public static explicit operator SteamItemInstanceID_t(ulong value) { return new SteamItemInstanceID_t(value); } public static explicit operator ulong(SteamItemInstanceID_t that) { return that.m_SteamItemInstanceID; } public bool Equals(SteamItemInstanceID_t other) { return m_SteamItemInstanceID == other.m_SteamItemInstanceID; } public int CompareTo(SteamItemInstanceID_t other) { return m_SteamItemInstanceID.CompareTo(other.m_SteamItemInstanceID); } } [Serializable] public struct HServerListRequest : IEquatable { public static readonly HServerListRequest Invalid = new HServerListRequest(IntPtr.Zero); public IntPtr m_HServerListRequest; public HServerListRequest(IntPtr value) { m_HServerListRequest = value; } public override string ToString() { return m_HServerListRequest.ToString(); } public override bool Equals(object other) { if (other is HServerListRequest) { return this == (HServerListRequest)other; } return false; } public override int GetHashCode() { return m_HServerListRequest.GetHashCode(); } public static bool operator ==(HServerListRequest x, HServerListRequest y) { return x.m_HServerListRequest == y.m_HServerListRequest; } public static bool operator !=(HServerListRequest x, HServerListRequest y) { return !(x == y); } public static explicit operator HServerListRequest(IntPtr value) { return new HServerListRequest(value); } public static explicit operator IntPtr(HServerListRequest that) { return that.m_HServerListRequest; } public bool Equals(HServerListRequest other) { return m_HServerListRequest == other.m_HServerListRequest; } } [Serializable] public struct HServerQuery : IEquatable, IComparable { public static readonly HServerQuery Invalid = new HServerQuery(-1); public int m_HServerQuery; public HServerQuery(int value) { m_HServerQuery = value; } public override string ToString() { return m_HServerQuery.ToString(); } public override bool Equals(object other) { if (other is HServerQuery) { return this == (HServerQuery)other; } return false; } public override int GetHashCode() { return m_HServerQuery.GetHashCode(); } public static bool operator ==(HServerQuery x, HServerQuery y) { return x.m_HServerQuery == y.m_HServerQuery; } public static bool operator !=(HServerQuery x, HServerQuery y) { return !(x == y); } public static explicit operator HServerQuery(int value) { return new HServerQuery(value); } public static explicit operator int(HServerQuery that) { return that.m_HServerQuery; } public bool Equals(HServerQuery other) { return m_HServerQuery == other.m_HServerQuery; } public int CompareTo(HServerQuery other) { return m_HServerQuery.CompareTo(other.m_HServerQuery); } } [Serializable] public struct SNetListenSocket_t : IEquatable, IComparable { public uint m_SNetListenSocket; public SNetListenSocket_t(uint value) { m_SNetListenSocket = value; } public override string ToString() { return m_SNetListenSocket.ToString(); } public override bool Equals(object other) { if (other is SNetListenSocket_t) { return this == (SNetListenSocket_t)other; } return false; } public override int GetHashCode() { return m_SNetListenSocket.GetHashCode(); } public static bool operator ==(SNetListenSocket_t x, SNetListenSocket_t y) { return x.m_SNetListenSocket == y.m_SNetListenSocket; } public static bool operator !=(SNetListenSocket_t x, SNetListenSocket_t y) { return !(x == y); } public static explicit operator SNetListenSocket_t(uint value) { return new SNetListenSocket_t(value); } public static explicit operator uint(SNetListenSocket_t that) { return that.m_SNetListenSocket; } public bool Equals(SNetListenSocket_t other) { return m_SNetListenSocket == other.m_SNetListenSocket; } public int CompareTo(SNetListenSocket_t other) { return m_SNetListenSocket.CompareTo(other.m_SNetListenSocket); } } [Serializable] public struct SNetSocket_t : IEquatable, IComparable { public uint m_SNetSocket; public SNetSocket_t(uint value) { m_SNetSocket = value; } public override string ToString() { return m_SNetSocket.ToString(); } public override bool Equals(object other) { if (other is SNetSocket_t) { return this == (SNetSocket_t)other; } return false; } public override int GetHashCode() { return m_SNetSocket.GetHashCode(); } public static bool operator ==(SNetSocket_t x, SNetSocket_t y) { return x.m_SNetSocket == y.m_SNetSocket; } public static bool operator !=(SNetSocket_t x, SNetSocket_t y) { return !(x == y); } public static explicit operator SNetSocket_t(uint value) { return new SNetSocket_t(value); } public static explicit operator uint(SNetSocket_t that) { return that.m_SNetSocket; } public bool Equals(SNetSocket_t other) { return m_SNetSocket == other.m_SNetSocket; } public int CompareTo(SNetSocket_t other) { return m_SNetSocket.CompareTo(other.m_SNetSocket); } } [Serializable] public struct ISteamNetworkingConnectionCustomSignaling { public bool SendSignal(HSteamNetConnection hConn, ref SteamNetConnectionInfo_t info, IntPtr pMsg, int cbMsg) { return NativeMethods.SteamAPI_ISteamNetworkingConnectionCustomSignaling_SendSignal(ref this, hConn, ref info, pMsg, cbMsg); } public void Release() { NativeMethods.SteamAPI_ISteamNetworkingConnectionCustomSignaling_Release(ref this); } } [Serializable] public struct ISteamNetworkingCustomSignalingRecvContext { public IntPtr OnConnectRequest(HSteamNetConnection hConn, ref SteamNetworkingIdentity identityPeer) { return NativeMethods.SteamAPI_ISteamNetworkingCustomSignalingRecvContext_OnConnectRequest(ref this, hConn, ref identityPeer); } public void SendRejectionSignal(ref SteamNetworkingIdentity identityPeer, IntPtr pMsg, int cbMsg) { NativeMethods.SteamAPI_ISteamNetworkingCustomSignalingRecvContext_SendRejectionSignal(ref this, ref identityPeer, pMsg, cbMsg); } } [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void FSteamNetworkingSocketsDebugOutput(ESteamNetworkingSocketsDebugOutputType nType, StringBuilder pszMsg); [Serializable] public struct HSteamListenSocket : IEquatable, IComparable { public static readonly HSteamListenSocket Invalid = new HSteamListenSocket(0u); public uint m_HSteamListenSocket; public HSteamListenSocket(uint value) { m_HSteamListenSocket = value; } public override string ToString() { return m_HSteamListenSocket.ToString(); } public override bool Equals(object other) { if (other is HSteamListenSocket) { return this == (HSteamListenSocket)other; } return false; } public override int GetHashCode() { return m_HSteamListenSocket.GetHashCode(); } public static bool operator ==(HSteamListenSocket x, HSteamListenSocket y) { return x.m_HSteamListenSocket == y.m_HSteamListenSocket; } public static bool operator !=(HSteamListenSocket x, HSteamListenSocket y) { return !(x == y); } public static explicit operator HSteamListenSocket(uint value) { return new HSteamListenSocket(value); } public static explicit operator uint(HSteamListenSocket that) { return that.m_HSteamListenSocket; } public bool Equals(HSteamListenSocket other) { return m_HSteamListenSocket == other.m_HSteamListenSocket; } public int CompareTo(HSteamListenSocket other) { return m_HSteamListenSocket.CompareTo(other.m_HSteamListenSocket); } } [Serializable] public struct HSteamNetConnection : IEquatable, IComparable { public static readonly HSteamNetConnection Invalid = new HSteamNetConnection(0u); public uint m_HSteamNetConnection; public HSteamNetConnection(uint value) { m_HSteamNetConnection = value; } public override string ToString() { return m_HSteamNetConnection.ToString(); } public override bool Equals(object other) { if (other is HSteamNetConnection) { return this == (HSteamNetConnection)other; } return false; } public override int GetHashCode() { return m_HSteamNetConnection.GetHashCode(); } public static bool operator ==(HSteamNetConnection x, HSteamNetConnection y) { return x.m_HSteamNetConnection == y.m_HSteamNetConnection; } public static bool operator !=(HSteamNetConnection x, HSteamNetConnection y) { return !(x == y); } public static explicit operator HSteamNetConnection(uint value) { return new HSteamNetConnection(value); } public static explicit operator uint(HSteamNetConnection that) { return that.m_HSteamNetConnection; } public bool Equals(HSteamNetConnection other) { return m_HSteamNetConnection == other.m_HSteamNetConnection; } public int CompareTo(HSteamNetConnection other) { return m_HSteamNetConnection.CompareTo(other.m_HSteamNetConnection); } } [Serializable] public struct HSteamNetPollGroup : IEquatable, IComparable { public static readonly HSteamNetPollGroup Invalid = new HSteamNetPollGroup(0u); public uint m_HSteamNetPollGroup; public HSteamNetPollGroup(uint value) { m_HSteamNetPollGroup = value; } public override string ToString() { return m_HSteamNetPollGroup.ToString(); } public override bool Equals(object other) { if (other is HSteamNetPollGroup) { return this == (HSteamNetPollGroup)other; } return false; } public override int GetHashCode() { return m_HSteamNetPollGroup.GetHashCode(); } public static bool operator ==(HSteamNetPollGroup x, HSteamNetPollGroup y) { return x.m_HSteamNetPollGroup == y.m_HSteamNetPollGroup; } public static bool operator !=(HSteamNetPollGroup x, HSteamNetPollGroup y) { return !(x == y); } public static explicit operator HSteamNetPollGroup(uint value) { return new HSteamNetPollGroup(value); } public static explicit operator uint(HSteamNetPollGroup that) { return that.m_HSteamNetPollGroup; } public bool Equals(HSteamNetPollGroup other) { return m_HSteamNetPollGroup == other.m_HSteamNetPollGroup; } public int CompareTo(HSteamNetPollGroup other) { return m_HSteamNetPollGroup.CompareTo(other.m_HSteamNetPollGroup); } } [Serializable] public struct SteamNetworkingConfigValue_t { [StructLayout(LayoutKind.Explicit)] public struct OptionValue { [FieldOffset(0)] public int m_int32; [FieldOffset(0)] public long m_int64; [FieldOffset(0)] public float m_float; [FieldOffset(0)] public IntPtr m_string; [FieldOffset(0)] public IntPtr m_functionPtr; } public ESteamNetworkingConfigValue m_eValue; public ESteamNetworkingConfigDataType m_eDataType; public OptionValue m_val; } [Serializable] public struct SteamNetworkingErrMsg { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] public byte[] m_SteamNetworkingErrMsg; } [Serializable] [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct SteamNetworkingIdentity : IEquatable { public ESteamNetworkingIdentityType m_eType; private int m_cbSize; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] private uint[] m_reserved; public const int k_cchMaxString = 128; public const int k_cchMaxGenericString = 32; public const int k_cbMaxGenericBytes = 32; public void Clear() { NativeMethods.SteamAPI_SteamNetworkingIdentity_Clear(ref this); } public bool IsInvalid() { return NativeMethods.SteamAPI_SteamNetworkingIdentity_IsInvalid(ref this); } public void SetSteamID(CSteamID steamID) { NativeMethods.SteamAPI_SteamNetworkingIdentity_SetSteamID(ref this, (ulong)steamID); } public CSteamID GetSteamID() { return (CSteamID)NativeMethods.SteamAPI_SteamNetworkingIdentity_GetSteamID(ref this); } public void SetSteamID64(ulong steamID) { NativeMethods.SteamAPI_SteamNetworkingIdentity_SetSteamID64(ref this, steamID); } public ulong GetSteamID64() { return NativeMethods.SteamAPI_SteamNetworkingIdentity_GetSteamID64(ref this); } public void SetIPAddr(SteamNetworkingIPAddr addr) { NativeMethods.SteamAPI_SteamNetworkingIdentity_SetIPAddr(ref this, ref addr); } public SteamNetworkingIPAddr GetIPAddr() { throw new NotImplementedException(); } public void SetLocalHost() { NativeMethods.SteamAPI_SteamNetworkingIdentity_SetLocalHost(ref this); } public bool IsLocalHost() { return NativeMethods.SteamAPI_SteamNetworkingIdentity_IsLocalHost(ref this); } public bool SetGenericString(string pszString) { using InteropHelp.UTF8StringHandle pszString2 = new InteropHelp.UTF8StringHandle(pszString); return NativeMethods.SteamAPI_SteamNetworkingIdentity_SetGenericString(ref this, pszString2); } public string GetGenericString() { return InteropHelp.PtrToStringUTF8(NativeMethods.SteamAPI_SteamNetworkingIdentity_GetGenericString(ref this)); } public bool SetGenericBytes(byte[] data, uint cbLen) { return NativeMethods.SteamAPI_SteamNetworkingIdentity_SetGenericBytes(ref this, data, cbLen); } public byte[] GetGenericBytes(out int cbLen) { throw new NotImplementedException(); } public bool Equals(SteamNetworkingIdentity x) { return NativeMethods.SteamAPI_SteamNetworkingIdentity_IsEqualTo(ref this, ref x); } public void ToString(out string buf) { IntPtr intPtr = Marshal.AllocHGlobal(128); NativeMethods.SteamAPI_SteamNetworkingIdentity_ToString(ref this, intPtr, 128u); buf = InteropHelp.PtrToStringUTF8(intPtr); Marshal.FreeHGlobal(intPtr); } public bool ParseString(string pszStr) { using InteropHelp.UTF8StringHandle pszStr2 = new InteropHelp.UTF8StringHandle(pszStr); return NativeMethods.SteamAPI_SteamNetworkingIdentity_ParseString(ref this, pszStr2); } } [Serializable] [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct SteamNetworkingIPAddr : IEquatable { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] m_ipv6; public ushort m_port; public const int k_cchMaxString = 48; public void Clear() { NativeMethods.SteamAPI_SteamNetworkingIPAddr_Clear(ref this); } public bool IsIPv6AllZeros() { return NativeMethods.SteamAPI_SteamNetworkingIPAddr_IsIPv6AllZeros(ref this); } public void SetIPv6(byte[] ipv6, ushort nPort) { NativeMethods.SteamAPI_SteamNetworkingIPAddr_SetIPv6(ref this, ipv6, nPort); } public void SetIPv4(uint nIP, ushort nPort) { NativeMethods.SteamAPI_SteamNetworkingIPAddr_SetIPv4(ref this, nIP, nPort); } public bool IsIPv4() { return NativeMethods.SteamAPI_SteamNetworkingIPAddr_IsIPv4(ref this); } public uint GetIPv4() { return NativeMethods.SteamAPI_SteamNetworkingIPAddr_GetIPv4(ref this); } public void SetIPv6LocalHost(ushort nPort = 0) { NativeMethods.SteamAPI_SteamNetworkingIPAddr_SetIPv6LocalHost(ref this, nPort); } public bool IsLocalHost() { return NativeMethods.SteamAPI_SteamNetworkingIPAddr_IsLocalHost(ref this); } public void ToString(out string buf, bool bWithPort) { IntPtr intPtr = Marshal.AllocHGlobal(48); NativeMethods.SteamAPI_SteamNetworkingIPAddr_ToString(ref this, intPtr, 48u, bWithPort); buf = InteropHelp.PtrToStringUTF8(intPtr); Marshal.FreeHGlobal(intPtr); } public bool ParseString(string pszStr) { using InteropHelp.UTF8StringHandle pszStr2 = new InteropHelp.UTF8StringHandle(pszStr); return NativeMethods.SteamAPI_SteamNetworkingIPAddr_ParseString(ref this, pszStr2); } public bool Equals(SteamNetworkingIPAddr x) { return NativeMethods.SteamAPI_SteamNetworkingIPAddr_IsEqualTo(ref this, ref x); } } [Serializable] public struct SteamNetworkingMessage_t { public IntPtr m_pData; public int m_cbSize; public HSteamNetConnection m_conn; public SteamNetworkingIdentity m_identityPeer; public long m_nConnUserData; public SteamNetworkingMicroseconds m_usecTimeReceived; public long m_nMessageNumber; internal IntPtr m_pfnFreeData; internal IntPtr m_pfnRelease; public int m_nChannel; public int m_nFlags; public long m_nUserData; public void Release() { NativeMethods.SteamAPI_SteamNetworkingMessage_t_Release(m_pfnRelease); } } [Serializable] public struct SteamNetworkingMicroseconds : IEquatable, IComparable { public long m_SteamNetworkingMicroseconds; public SteamNetworkingMicroseconds(long value) { m_SteamNetworkingMicroseconds = value; } public override string ToString() { return m_SteamNetworkingMicroseconds.ToString(); } public override bool Equals(object other) { if (other is SteamNetworkingMicroseconds) { return this == (SteamNetworkingMicroseconds)other; } return false; } public override int GetHashCode() { return m_SteamNetworkingMicroseconds.GetHashCode(); } public static bool operator ==(SteamNetworkingMicroseconds x, SteamNetworkingMicroseconds y) { return x.m_SteamNetworkingMicroseconds == y.m_SteamNetworkingMicroseconds; } public static bool operator !=(SteamNetworkingMicroseconds x, SteamNetworkingMicroseconds y) { return !(x == y); } public static explicit operator SteamNetworkingMicroseconds(long value) { return new SteamNetworkingMicroseconds(value); } public static explicit operator long(SteamNetworkingMicroseconds that) { return that.m_SteamNetworkingMicroseconds; } public bool Equals(SteamNetworkingMicroseconds other) { return m_SteamNetworkingMicroseconds == other.m_SteamNetworkingMicroseconds; } public int CompareTo(SteamNetworkingMicroseconds other) { return m_SteamNetworkingMicroseconds.CompareTo(other.m_SteamNetworkingMicroseconds); } } [Serializable] public struct SteamNetworkingPOPID : IEquatable, IComparable { public uint m_SteamNetworkingPOPID; public SteamNetworkingPOPID(uint value) { m_SteamNetworkingPOPID = value; } public override string ToString() { return m_SteamNetworkingPOPID.ToString(); } public override bool Equals(object other) { if (other is SteamNetworkingPOPID) { return this == (SteamNetworkingPOPID)other; } return false; } public override int GetHashCode() { return m_SteamNetworkingPOPID.GetHashCode(); } public static bool operator ==(SteamNetworkingPOPID x, SteamNetworkingPOPID y) { return x.m_SteamNetworkingPOPID == y.m_SteamNetworkingPOPID; } public static bool operator !=(SteamNetworkingPOPID x, SteamNetworkingPOPID y) { return !(x == y); } public static explicit operator SteamNetworkingPOPID(uint value) { return new SteamNetworkingPOPID(value); } public static explicit operator uint(SteamNetworkingPOPID that) { return that.m_SteamNetworkingPOPID; } public bool Equals(SteamNetworkingPOPID other) { return m_SteamNetworkingPOPID == other.m_SteamNetworkingPOPID; } public int CompareTo(SteamNetworkingPOPID other) { return m_SteamNetworkingPOPID.CompareTo(other.m_SteamNetworkingPOPID); } } [Serializable] public struct RemotePlaySessionID_t : IEquatable, IComparable { public uint m_RemotePlaySessionID; public RemotePlaySessionID_t(uint value) { m_RemotePlaySessionID = value; } public override string ToString() { return m_RemotePlaySessionID.ToString(); } public override bool Equals(object other) { if (other is RemotePlaySessionID_t) { return this == (RemotePlaySessionID_t)other; } return false; } public override int GetHashCode() { return m_RemotePlaySessionID.GetHashCode(); } public static bool operator ==(RemotePlaySessionID_t x, RemotePlaySessionID_t y) { return x.m_RemotePlaySessionID == y.m_RemotePlaySessionID; } public static bool operator !=(RemotePlaySessionID_t x, RemotePlaySessionID_t y) { return !(x == y); } public static explicit operator RemotePlaySessionID_t(uint value) { return new RemotePlaySessionID_t(value); } public static explicit operator uint(RemotePlaySessionID_t that) { return that.m_RemotePlaySessionID; } public bool Equals(RemotePlaySessionID_t other) { return m_RemotePlaySessionID == other.m_RemotePlaySessionID; } public int CompareTo(RemotePlaySessionID_t other) { return m_RemotePlaySessionID.CompareTo(other.m_RemotePlaySessionID); } } [Serializable] public struct PublishedFileId_t : IEquatable, IComparable { public static readonly PublishedFileId_t Invalid = new PublishedFileId_t(0uL); public ulong m_PublishedFileId; public PublishedFileId_t(ulong value) { m_PublishedFileId = value; } public override string ToString() { return m_PublishedFileId.ToString(); } public override bool Equals(object other) { if (other is PublishedFileId_t) { return this == (PublishedFileId_t)other; } return false; } public override int GetHashCode() { return m_PublishedFileId.GetHashCode(); } public static bool operator ==(PublishedFileId_t x, PublishedFileId_t y) { return x.m_PublishedFileId == y.m_PublishedFileId; } public static bool operator !=(PublishedFileId_t x, PublishedFileId_t y) { return !(x == y); } public static explicit operator PublishedFileId_t(ulong value) { return new PublishedFileId_t(value); } public static explicit operator ulong(PublishedFileId_t that) { return that.m_PublishedFileId; } public bool Equals(PublishedFileId_t other) { return m_PublishedFileId == other.m_PublishedFileId; } public int CompareTo(PublishedFileId_t other) { return m_PublishedFileId.CompareTo(other.m_PublishedFileId); } } [Serializable] public struct PublishedFileUpdateHandle_t : IEquatable, IComparable { public static readonly PublishedFileUpdateHandle_t Invalid = new PublishedFileUpdateHandle_t(ulong.MaxValue); public ulong m_PublishedFileUpdateHandle; public PublishedFileUpdateHandle_t(ulong value) { m_PublishedFileUpdateHandle = value; } public override string ToString() { return m_PublishedFileUpdateHandle.ToString(); } public override bool Equals(object other) { if (other is PublishedFileUpdateHandle_t) { return this == (PublishedFileUpdateHandle_t)other; } return false; } public override int GetHashCode() { return m_PublishedFileUpdateHandle.GetHashCode(); } public static bool operator ==(PublishedFileUpdateHandle_t x, PublishedFileUpdateHandle_t y) { return x.m_PublishedFileUpdateHandle == y.m_PublishedFileUpdateHandle; } public static bool operator !=(PublishedFileUpdateHandle_t x, PublishedFileUpdateHandle_t y) { return !(x == y); } public static explicit operator PublishedFileUpdateHandle_t(ulong value) { return new PublishedFileUpdateHandle_t(value); } public static explicit operator ulong(PublishedFileUpdateHandle_t that) { return that.m_PublishedFileUpdateHandle; } public bool Equals(PublishedFileUpdateHandle_t other) { return m_PublishedFileUpdateHandle == other.m_PublishedFileUpdateHandle; } public int CompareTo(PublishedFileUpdateHandle_t other) { return m_PublishedFileUpdateHandle.CompareTo(other.m_PublishedFileUpdateHandle); } } [Serializable] public struct UGCFileWriteStreamHandle_t : IEquatable, IComparable { public static readonly UGCFileWriteStreamHandle_t Invalid = new UGCFileWriteStreamHandle_t(ulong.MaxValue); public ulong m_UGCFileWriteStreamHandle; public UGCFileWriteStreamHandle_t(ulong value) { m_UGCFileWriteStreamHandle = value; } public override string ToString() { return m_UGCFileWriteStreamHandle.ToString(); } public override bool Equals(object other) { if (other is UGCFileWriteStreamHandle_t) { return this == (UGCFileWriteStreamHandle_t)other; } return false; } public override int GetHashCode() { return m_UGCFileWriteStreamHandle.GetHashCode(); } public static bool operator ==(UGCFileWriteStreamHandle_t x, UGCFileWriteStreamHandle_t y) { return x.m_UGCFileWriteStreamHandle == y.m_UGCFileWriteStreamHandle; } public static bool operator !=(UGCFileWriteStreamHandle_t x, UGCFileWriteStreamHandle_t y) { return !(x == y); } public static explicit operator UGCFileWriteStreamHandle_t(ulong value) { return new UGCFileWriteStreamHandle_t(value); } public static explicit operator ulong(UGCFileWriteStreamHandle_t that) { return that.m_UGCFileWriteStreamHandle; } public bool Equals(UGCFileWriteStreamHandle_t other) { return m_UGCFileWriteStreamHandle == other.m_UGCFileWriteStreamHandle; } public int CompareTo(UGCFileWriteStreamHandle_t other) { return m_UGCFileWriteStreamHandle.CompareTo(other.m_UGCFileWriteStreamHandle); } } [Serializable] public struct UGCHandle_t : IEquatable, IComparable { public static readonly UGCHandle_t Invalid = new UGCHandle_t(ulong.MaxValue); public ulong m_UGCHandle; public UGCHandle_t(ulong value) { m_UGCHandle = value; } public override string ToString() { return m_UGCHandle.ToString(); } public override bool Equals(object other) { if (other is UGCHandle_t) { return this == (UGCHandle_t)other; } return false; } public override int GetHashCode() { return m_UGCHandle.GetHashCode(); } public static bool operator ==(UGCHandle_t x, UGCHandle_t y) { return x.m_UGCHandle == y.m_UGCHandle; } public static bool operator !=(UGCHandle_t x, UGCHandle_t y) { return !(x == y); } public static explicit operator UGCHandle_t(ulong value) { return new UGCHandle_t(value); } public static explicit operator ulong(UGCHandle_t that) { return that.m_UGCHandle; } public bool Equals(UGCHandle_t other) { return m_UGCHandle == other.m_UGCHandle; } public int CompareTo(UGCHandle_t other) { return m_UGCHandle.CompareTo(other.m_UGCHandle); } } [Serializable] public struct ScreenshotHandle : IEquatable, IComparable { public static readonly ScreenshotHandle Invalid = new ScreenshotHandle(0u); public uint m_ScreenshotHandle; public ScreenshotHandle(uint value) { m_ScreenshotHandle = value; } public override string ToString() { return m_ScreenshotHandle.ToString(); } public override bool Equals(object other) { if (other is ScreenshotHandle) { return this == (ScreenshotHandle)other; } return false; } public override int GetHashCode() { return m_ScreenshotHandle.GetHashCode(); } public static bool operator ==(ScreenshotHandle x, ScreenshotHandle y) { return x.m_ScreenshotHandle == y.m_ScreenshotHandle; } public static bool operator !=(ScreenshotHandle x, ScreenshotHandle y) { return !(x == y); } public static explicit operator ScreenshotHandle(uint value) { return new ScreenshotHandle(value); } public static explicit operator uint(ScreenshotHandle that) { return that.m_ScreenshotHandle; } public bool Equals(ScreenshotHandle other) { return m_ScreenshotHandle == other.m_ScreenshotHandle; } public int CompareTo(ScreenshotHandle other) { return m_ScreenshotHandle.CompareTo(other.m_ScreenshotHandle); } } [Serializable] public struct AccountID_t : IEquatable, IComparable { public uint m_AccountID; public AccountID_t(uint value) { m_AccountID = value; } public override string ToString() { return m_AccountID.ToString(); } public override bool Equals(object other) { if (other is AccountID_t) { return this == (AccountID_t)other; } return false; } public override int GetHashCode() { return m_AccountID.GetHashCode(); } public static bool operator ==(AccountID_t x, AccountID_t y) { return x.m_AccountID == y.m_AccountID; } public static bool operator !=(AccountID_t x, AccountID_t y) { return !(x == y); } public static explicit operator AccountID_t(uint value) { return new AccountID_t(value); } public static explicit operator uint(AccountID_t that) { return that.m_AccountID; } public bool Equals(AccountID_t other) { return m_AccountID == other.m_AccountID; } public int CompareTo(AccountID_t other) { return m_AccountID.CompareTo(other.m_AccountID); } } [Serializable] public struct AppId_t : IEquatable, IComparable { public static readonly AppId_t Invalid = new AppId_t(0u); public uint m_AppId; public AppId_t(uint value) { m_AppId = value; } public override string ToString() { return m_AppId.ToString(); } public override bool Equals(object other) { if (other is AppId_t) { return this == (AppId_t)other; } return false; } public override int GetHashCode() { return m_AppId.GetHashCode(); } public static bool operator ==(AppId_t x, AppId_t y) { return x.m_AppId == y.m_AppId; } public static bool operator !=(AppId_t x, AppId_t y) { return !(x == y); } public static explicit operator AppId_t(uint value) { return new AppId_t(value); } public static explicit operator uint(AppId_t that) { return that.m_AppId; } public bool Equals(AppId_t other) { return m_AppId == other.m_AppId; } public int CompareTo(AppId_t other) { return m_AppId.CompareTo(other.m_AppId); } } [Serializable] public struct DepotId_t : IEquatable, IComparable { public static readonly DepotId_t Invalid = new DepotId_t(0u); public uint m_DepotId; public DepotId_t(uint value) { m_DepotId = value; } public override string ToString() { return m_DepotId.ToString(); } public override bool Equals(object other) { if (other is DepotId_t) { return this == (DepotId_t)other; } return false; } public override int GetHashCode() { return m_DepotId.GetHashCode(); } public static bool operator ==(DepotId_t x, DepotId_t y) { return x.m_DepotId == y.m_DepotId; } public static bool operator !=(DepotId_t x, DepotId_t y) { return !(x == y); } public static explicit operator DepotId_t(uint value) { return new DepotId_t(value); } public static explicit operator uint(DepotId_t that) { return that.m_DepotId; } public bool Equals(DepotId_t other) { return m_DepotId == other.m_DepotId; } public int CompareTo(DepotId_t other) { return m_DepotId.CompareTo(other.m_DepotId); } } [Serializable] public struct ManifestId_t : IEquatable, IComparable { public static readonly ManifestId_t Invalid = new ManifestId_t(0uL); public ulong m_ManifestId; public ManifestId_t(ulong value) { m_ManifestId = value; } public override string ToString() { return m_ManifestId.ToString(); } public override bool Equals(object other) { if (other is ManifestId_t) { return this == (ManifestId_t)other; } return false; } public override int GetHashCode() { return m_ManifestId.GetHashCode(); } public static bool operator ==(ManifestId_t x, ManifestId_t y) { return x.m_ManifestId == y.m_ManifestId; } public static bool operator !=(ManifestId_t x, ManifestId_t y) { return !(x == y); } public static explicit operator ManifestId_t(ulong value) { return new ManifestId_t(value); } public static explicit operator ulong(ManifestId_t that) { return that.m_ManifestId; } public bool Equals(ManifestId_t other) { return m_ManifestId == other.m_ManifestId; } public int CompareTo(ManifestId_t other) { return m_ManifestId.CompareTo(other.m_ManifestId); } } [Serializable] public struct PartyBeaconID_t : IEquatable, IComparable { public static readonly PartyBeaconID_t Invalid = new PartyBeaconID_t(0uL); public ulong m_PartyBeaconID; public PartyBeaconID_t(ulong value) { m_PartyBeaconID = value; } public override string ToString() { return m_PartyBeaconID.ToString(); } public override bool Equals(object other) { if (other is PartyBeaconID_t) { return this == (PartyBeaconID_t)other; } return false; } public override int GetHashCode() { return m_PartyBeaconID.GetHashCode(); } public static bool operator ==(PartyBeaconID_t x, PartyBeaconID_t y) { return x.m_PartyBeaconID == y.m_PartyBeaconID; } public static bool operator !=(PartyBeaconID_t x, PartyBeaconID_t y) { return !(x == y); } public static explicit operator PartyBeaconID_t(ulong value) { return new PartyBeaconID_t(value); } public static explicit operator ulong(PartyBeaconID_t that) { return that.m_PartyBeaconID; } public bool Equals(PartyBeaconID_t other) { return m_PartyBeaconID == other.m_PartyBeaconID; } public int CompareTo(PartyBeaconID_t other) { return m_PartyBeaconID.CompareTo(other.m_PartyBeaconID); } } [Serializable] public struct RTime32 : IEquatable, IComparable { public uint m_RTime32; public RTime32(uint value) { m_RTime32 = value; } public override string ToString() { return m_RTime32.ToString(); } public override bool Equals(object other) { if (other is RTime32) { return this == (RTime32)other; } return false; } public override int GetHashCode() { return m_RTime32.GetHashCode(); } public static bool operator ==(RTime32 x, RTime32 y) { return x.m_RTime32 == y.m_RTime32; } public static bool operator !=(RTime32 x, RTime32 y) { return !(x == y); } public static explicit operator RTime32(uint value) { return new RTime32(value); } public static explicit operator uint(RTime32 that) { return that.m_RTime32; } public bool Equals(RTime32 other) { return m_RTime32 == other.m_RTime32; } public int CompareTo(RTime32 other) { return m_RTime32.CompareTo(other.m_RTime32); } } [Serializable] public struct SiteId_t : IEquatable, IComparable { public static readonly SiteId_t Invalid = new SiteId_t(0uL); public ulong m_SiteId; public SiteId_t(ulong value) { m_SiteId = value; } public override string ToString() { return m_SiteId.ToString(); } public override bool Equals(object other) { if (other is SiteId_t) { return this == (SiteId_t)other; } return false; } public override int GetHashCode() { return m_SiteId.GetHashCode(); } public static bool operator ==(SiteId_t x, SiteId_t y) { return x.m_SiteId == y.m_SiteId; } public static bool operator !=(SiteId_t x, SiteId_t y) { return !(x == y); } public static explicit operator SiteId_t(ulong value) { return new SiteId_t(value); } public static explicit operator ulong(SiteId_t that) { return that.m_SiteId; } public bool Equals(SiteId_t other) { return m_SiteId == other.m_SiteId; } public int CompareTo(SiteId_t other) { return m_SiteId.CompareTo(other.m_SiteId); } } [Serializable] public struct SteamAPICall_t : IEquatable, IComparable { public static readonly SteamAPICall_t Invalid = new SteamAPICall_t(0uL); public ulong m_SteamAPICall; public SteamAPICall_t(ulong value) { m_SteamAPICall = value; } public override string ToString() { return m_SteamAPICall.ToString(); } public override bool Equals(object other) { if (other is SteamAPICall_t) { return this == (SteamAPICall_t)other; } return false; } public override int GetHashCode() { return m_SteamAPICall.GetHashCode(); } public static bool operator ==(SteamAPICall_t x, SteamAPICall_t y) { return x.m_SteamAPICall == y.m_SteamAPICall; } public static bool operator !=(SteamAPICall_t x, SteamAPICall_t y) { return !(x == y); } public static explicit operator SteamAPICall_t(ulong value) { return new SteamAPICall_t(value); } public static explicit operator ulong(SteamAPICall_t that) { return that.m_SteamAPICall; } public bool Equals(SteamAPICall_t other) { return m_SteamAPICall == other.m_SteamAPICall; } public int CompareTo(SteamAPICall_t other) { return m_SteamAPICall.CompareTo(other.m_SteamAPICall); } } [Serializable] [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct SteamIPAddress_t { private long m_ip0; private long m_ip1; private ESteamIPType m_eType; public SteamIPAddress_t(IPAddress iPAddress) { byte[] addressBytes = iPAddress.GetAddressBytes(); switch (iPAddress.AddressFamily) { case AddressFamily.InterNetwork: if (addressBytes.Length != 4) { throw new TypeInitializationException("SteamIPAddress_t: Unexpected byte length for Ipv4." + addressBytes.Length, null); } m_ip0 = (addressBytes[0] << 24) | (addressBytes[1] << 16) | (addressBytes[2] << 8) | addressBytes[3]; m_ip1 = 0L; m_eType = ESteamIPType.k_ESteamIPTypeIPv4; break; case AddressFamily.InterNetworkV6: if (addressBytes.Length != 16) { throw new TypeInitializationException("SteamIPAddress_t: Unexpected byte length for Ipv6: " + addressBytes.Length, null); } m_ip0 = (addressBytes[1] << 24) | (addressBytes[0] << 16) | (addressBytes[3] << 8) | addressBytes[2] | (addressBytes[5] << 24) | (addressBytes[4] << 16) | (addressBytes[7] << 8) | addressBytes[6]; m_ip1 = (addressBytes[9] << 24) | (addressBytes[8] << 16) | (addressBytes[11] << 8) | addressBytes[10] | (addressBytes[13] << 24) | (addressBytes[12] << 16) | (addressBytes[15] << 8) | addressBytes[14]; m_eType = ESteamIPType.k_ESteamIPTypeIPv6; break; default: throw new TypeInitializationException("SteamIPAddress_t: Unexpected address family " + iPAddress.AddressFamily, null); } } public IPAddress ToIPAddress() { if (m_eType == ESteamIPType.k_ESteamIPTypeIPv4) { byte[] bytes = BitConverter.GetBytes(m_ip0); return new IPAddress(new byte[4] { bytes[3], bytes[2], bytes[1], bytes[0] }); } byte[] array = new byte[16]; BitConverter.GetBytes(m_ip0).CopyTo(array, 0); BitConverter.GetBytes(m_ip1).CopyTo(array, 8); return new IPAddress(array); } public override string ToString() { return ToIPAddress().ToString(); } public ESteamIPType GetIPType() { return m_eType; } public bool IsSet() { if (m_ip0 == 0L) { return m_ip1 != 0; } return true; } } [Serializable] public struct UGCQueryHandle_t : IEquatable, IComparable { public static readonly UGCQueryHandle_t Invalid = new UGCQueryHandle_t(ulong.MaxValue); public ulong m_UGCQueryHandle; public UGCQueryHandle_t(ulong value) { m_UGCQueryHandle = value; } public override string ToString() { return m_UGCQueryHandle.ToString(); } public override bool Equals(object other) { if (other is UGCQueryHandle_t) { return this == (UGCQueryHandle_t)other; } return false; } public override int GetHashCode() { return m_UGCQueryHandle.GetHashCode(); } public static bool operator ==(UGCQueryHandle_t x, UGCQueryHandle_t y) { return x.m_UGCQueryHandle == y.m_UGCQueryHandle; } public static bool operator !=(UGCQueryHandle_t x, UGCQueryHandle_t y) { return !(x == y); } public static explicit operator UGCQueryHandle_t(ulong value) { return new UGCQueryHandle_t(value); } public static explicit operator ulong(UGCQueryHandle_t that) { return that.m_UGCQueryHandle; } public bool Equals(UGCQueryHandle_t other) { return m_UGCQueryHandle == other.m_UGCQueryHandle; } public int CompareTo(UGCQueryHandle_t other) { return m_UGCQueryHandle.CompareTo(other.m_UGCQueryHandle); } } [Serializable] public struct UGCUpdateHandle_t : IEquatable, IComparable { public static readonly UGCUpdateHandle_t Invalid = new UGCUpdateHandle_t(ulong.MaxValue); public ulong m_UGCUpdateHandle; public UGCUpdateHandle_t(ulong value) { m_UGCUpdateHandle = value; } public override string ToString() { return m_UGCUpdateHandle.ToString(); } public override bool Equals(object other) { if (other is UGCUpdateHandle_t) { return this == (UGCUpdateHandle_t)other; } return false; } public override int GetHashCode() { return m_UGCUpdateHandle.GetHashCode(); } public static bool operator ==(UGCUpdateHandle_t x, UGCUpdateHandle_t y) { return x.m_UGCUpdateHandle == y.m_UGCUpdateHandle; } public static bool operator !=(UGCUpdateHandle_t x, UGCUpdateHandle_t y) { return !(x == y); } public static explicit operator UGCUpdateHandle_t(ulong value) { return new UGCUpdateHandle_t(value); } public static explicit operator ulong(UGCUpdateHandle_t that) { return that.m_UGCUpdateHandle; } public bool Equals(UGCUpdateHandle_t other) { return m_UGCUpdateHandle == other.m_UGCUpdateHandle; } public int CompareTo(UGCUpdateHandle_t other) { return m_UGCUpdateHandle.CompareTo(other.m_UGCUpdateHandle); } } [Serializable] public struct SteamLeaderboard_t : IEquatable, IComparable { public ulong m_SteamLeaderboard; public SteamLeaderboard_t(ulong value) { m_SteamLeaderboard = value; } public override string ToString() { return m_SteamLeaderboard.ToString(); } public override bool Equals(object other) { if (other is SteamLeaderboard_t) { return this == (SteamLeaderboard_t)other; } return false; } public override int GetHashCode() { return m_SteamLeaderboard.GetHashCode(); } public static bool operator ==(SteamLeaderboard_t x, SteamLeaderboard_t y) { return x.m_SteamLeaderboard == y.m_SteamLeaderboard; } public static bool operator !=(SteamLeaderboard_t x, SteamLeaderboard_t y) { return !(x == y); } public static explicit operator SteamLeaderboard_t(ulong value) { return new SteamLeaderboard_t(value); } public static explicit operator ulong(SteamLeaderboard_t that) { return that.m_SteamLeaderboard; } public bool Equals(SteamLeaderboard_t other) { return m_SteamLeaderboard == other.m_SteamLeaderboard; } public int CompareTo(SteamLeaderboard_t other) { return m_SteamLeaderboard.CompareTo(other.m_SteamLeaderboard); } } [Serializable] public struct SteamLeaderboardEntries_t : IEquatable, IComparable { public ulong m_SteamLeaderboardEntries; public SteamLeaderboardEntries_t(ulong value) { m_SteamLeaderboardEntries = value; } public override string ToString() { return m_SteamLeaderboardEntries.ToString(); } public override bool Equals(object other) { if (other is SteamLeaderboardEntries_t) { return this == (SteamLeaderboardEntries_t)other; } return false; } public override int GetHashCode() { return m_SteamLeaderboardEntries.GetHashCode(); } public static bool operator ==(SteamLeaderboardEntries_t x, SteamLeaderboardEntries_t y) { return x.m_SteamLeaderboardEntries == y.m_SteamLeaderboardEntries; } public static bool operator !=(SteamLeaderboardEntries_t x, SteamLeaderboardEntries_t y) { return !(x == y); } public static explicit operator SteamLeaderboardEntries_t(ulong value) { return new SteamLeaderboardEntries_t(value); } public static explicit operator ulong(SteamLeaderboardEntries_t that) { return that.m_SteamLeaderboardEntries; } public bool Equals(SteamLeaderboardEntries_t other) { return m_SteamLeaderboardEntries == other.m_SteamLeaderboardEntries; } public int CompareTo(SteamLeaderboardEntries_t other) { return m_SteamLeaderboardEntries.CompareTo(other.m_SteamLeaderboardEntries); } } } namespace RootMotion { [HelpURL("http://www.root-motion.com/finalikdox/html/page3.html")] [AddComponentMenu("Scripts/RootMotion/Baker")] public abstract class Baker : MonoBehaviour { [Serializable] public enum Mode { AnimationClips, AnimationStates, PlayableDirector, Realtime } [Tooltip("In AnimationClips, AnimationStates or PlayableDirector mode - the frame rate at which the animation clip will be sampled. In Realtime mode - the frame rate at which the pose will be sampled. With the latter, the frame rate is not guaranteed if the player is not able to reach it.")] [Range(1f, 90f)] public int frameRate = 30; [Tooltip("Maximum allowed error for keyframe reduction.")] [Range(0f, 0.1f)] public float keyReductionError = 0.01f; [Tooltip("AnimationClips mode can be used to bake a batch of AnimationClips directly without the need of setting up an AnimatorController. AnimationStates mode is useful for when you need to set up a more complex rig with layers and AvatarMasks in Mecanim. PlayableDirector mode bakes a Timeline. Realtime mode is for continuous baking of gameplay, ragdoll phsysics or PuppetMaster dynamics.")] public Mode mode; [Tooltip("AnimationClips to bake.")] public AnimationClip[] animationClips = (AnimationClip[])(object)new AnimationClip[0]; [Tooltip("The name of the AnimationStates to bake (must be on the base layer) in the Animator above (Right-click on this component header and select 'Find Animation States' to have Baker fill those in automatically, required that state names match with the names of the clips used in them).")] public string[] animationStates = new string[0]; [Tooltip("Sets the baked animation clip to loop time and matches the last frame keys with the first. Note that when overwriting a previously baked clip, AnimationClipSettings will be copied from the existing clip.")] public bool loop = true; [Tooltip("The folder to save the baked AnimationClips to.")] public string saveToFolder = "Assets"; [Tooltip("String that will be added to each clip or animation state name for the saved clip. For example if your animation state/clip names were 'Idle' and 'Walk', then with '_Baked' as Append Name, the Baker will create 'Idle_Baked' and 'Walk_Baked' animation clips.")] public string appendName = "_Baked"; [Tooltip("Name of the created AnimationClip file.")] public string saveName = "Baked Clip"; [HideInInspector] public Animator animator; [HideInInspector] public PlayableDirector director; public bool isBaking { get; private set; } public float bakingProgress { get; private set; } protected float clipLength { get; private set; } [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page3.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_baker.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } protected abstract Transform GetCharacterRoot(); protected abstract void OnStartBaking(); protected abstract void OnSetLoopFrame(float time); protected abstract void OnSetCurves(ref AnimationClip clip); protected abstract void OnSetKeyframes(float time, bool lastFrame); public void BakeClip() { } public void StartBaking() { } public void StopBaking() { } } public class GenericBaker : Baker { [Tooltip("If true, produced AnimationClips will be marked as Legacy and usable with the Legacy animation system.")] public bool markAsLegacy; [Tooltip("Root Transform of the hierarchy to bake.")] public Transform root; [Tooltip("Root Node used for root motion.")] public Transform rootNode; [Tooltip("List of Transforms to ignore, rotation curves will not be baked for these Transforms.")] public Transform[] ignoreList; [Tooltip("LocalPosition curves will be baked for these Transforms only. If you are baking a character, the pelvis bone should be added to this array.")] public Transform[] bakePositionList; private BakerTransform[] children = new BakerTransform[0]; private BakerTransform rootChild; private int rootChildIndex = -1; private void Awake() { Transform[] componentsInChildren = ((Component)root).GetComponentsInChildren(); children = new BakerTransform[0]; for (int i = 0; i < componentsInChildren.Length; i++) { if (!IsIgnored(componentsInChildren[i])) { Array.Resize(ref children, children.Length + 1); bool flag = (Object)(object)componentsInChildren[i] == (Object)(object)rootNode; if (flag) { rootChildIndex = children.Length - 1; } children[children.Length - 1] = new BakerTransform(componentsInChildren[i], root, BakePosition(componentsInChildren[i]), flag); } } } protected override Transform GetCharacterRoot() { return root; } protected override void OnStartBaking() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < children.Length; i++) { children[i].Reset(); if (i == rootChildIndex) { children[i].SetRelativeSpace(root.position, root.rotation); } } } protected override void OnSetLoopFrame(float time) { for (int i = 0; i < children.Length; i++) { children[i].AddLoopFrame(time); } } protected override void OnSetCurves(ref AnimationClip clip) { for (int i = 0; i < children.Length; i++) { children[i].SetCurves(ref clip); } } protected override void OnSetKeyframes(float time, bool lastFrame) { for (int i = 0; i < children.Length; i++) { children[i].SetKeyframes(time); } } private bool IsIgnored(Transform t) { for (int i = 0; i < ignoreList.Length; i++) { if ((Object)(object)t == (Object)(object)ignoreList[i]) { return true; } } return false; } private bool BakePosition(Transform t) { for (int i = 0; i < bakePositionList.Length; i++) { if ((Object)(object)t == (Object)(object)bakePositionList[i]) { return true; } } return false; } } public class TQ { public Vector3 t; public Quaternion q; public TQ(Vector3 translation, Quaternion rotation) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) t = translation; q = rotation; } } public class AvatarUtility { public static Quaternion GetPostRotation(Avatar avatar, AvatarIKGoal avatarIKGoal) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected I4, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) int num = (int)HumanIDFromAvatarIKGoal(avatarIKGoal); if (num == 55) { throw new InvalidOperationException("Invalid human id."); } MethodInfo? method = typeof(Avatar).GetMethod("GetPostRotation", BindingFlags.Instance | BindingFlags.NonPublic); if (method == null) { throw new InvalidOperationException("Cannot find GetPostRotation method."); } return (Quaternion)method.Invoke(avatar, new object[1] { num }); } public static TQ GetIKGoalTQ(Avatar avatar, float humanScale, AvatarIKGoal avatarIKGoal, TQ bodyPositionRotation, TQ boneTQ) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected I4, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Invalid comparison between Unknown and I4 //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) int num = (int)HumanIDFromAvatarIKGoal(avatarIKGoal); if (num == 55) { throw new InvalidOperationException("Invalid human id."); } MethodInfo method = typeof(Avatar).GetMethod("GetAxisLength", BindingFlags.Instance | BindingFlags.NonPublic); if (method == null) { throw new InvalidOperationException("Cannot find GetAxisLength method."); } MethodInfo? method2 = typeof(Avatar).GetMethod("GetPostRotation", BindingFlags.Instance | BindingFlags.NonPublic); if (method2 == null) { throw new InvalidOperationException("Cannot find GetPostRotation method."); } Quaternion val = (Quaternion)method2.Invoke(avatar, new object[1] { num }); TQ tQ = new TQ(boneTQ.t, boneTQ.q * val); if ((int)avatarIKGoal == 0 || (int)avatarIKGoal == 1) { float num2 = (float)method.Invoke(avatar, new object[1] { num }); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(num2, 0f, 0f); tQ.t += tQ.q * val2; } Quaternion val3 = Quaternion.Inverse(bodyPositionRotation.q); tQ.t = val3 * (tQ.t - bodyPositionRotation.t); tQ.q = val3 * tQ.q; tQ.t /= humanScale; tQ.q = Quaternion.LookRotation(tQ.q * Vector3.forward, tQ.q * Vector3.up); return tQ; } public static HumanBodyBones HumanIDFromAvatarIKGoal(AvatarIKGoal avatarIKGoal) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected I4, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) HumanBodyBones result = (HumanBodyBones)55; switch ((int)avatarIKGoal) { case 0: result = (HumanBodyBones)5; break; case 1: result = (HumanBodyBones)6; break; case 2: result = (HumanBodyBones)17; break; case 3: result = (HumanBodyBones)18; break; } return result; } } public static class BakerUtilities { public static void ReduceKeyframes(AnimationCurve curve, float maxError) { if (!(maxError <= 0f)) { curve.keys = GetReducedKeyframes(curve, maxError); } } public static Keyframe[] GetReducedKeyframes(AnimationCurve curve, float maxError) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) Keyframe[] array = curve.keys; int num = 1; while (num < array.Length - 1 && array.Length > 2) { Keyframe[] array2 = (Keyframe[])(object)new Keyframe[array.Length - 1]; int num2 = 0; for (int i = 0; i < array.Length; i++) { if (num != i) { array2[num2] = new Keyframe(((Keyframe)(ref array[i])).time, ((Keyframe)(ref array[i])).value, ((Keyframe)(ref array[i])).inTangent, ((Keyframe)(ref array[i])).outTangent); num2++; } } AnimationCurve val = new AnimationCurve { keys = array2 }; float num3 = Mathf.Abs(val.Evaluate(((Keyframe)(ref array[num])).time) - ((Keyframe)(ref array[num])).value); float num4 = ((Keyframe)(ref array[num])).time + (((Keyframe)(ref array[num - 1])).time - ((Keyframe)(ref array[num])).time) * 0.5f; float num5 = ((Keyframe)(ref array[num])).time + (((Keyframe)(ref array[num + 1])).time - ((Keyframe)(ref array[num])).time) * 0.5f; float num6 = Mathf.Abs(val.Evaluate(num4) - curve.Evaluate(num4)); float num7 = Mathf.Abs(val.Evaluate(num5) - curve.Evaluate(num5)); if (num3 < maxError && num6 < maxError && num7 < maxError) { array = array2; } else { num++; } } return array; } public static void SetLoopFrame(float time, AnimationCurve curve) { Keyframe[] keys = curve.keys; ((Keyframe)(ref keys[^1])).value = ((Keyframe)(ref keys[0])).value; float inTangent = Mathf.Lerp(((Keyframe)(ref keys[0])).inTangent, ((Keyframe)(ref keys[^1])).inTangent, 0.5f); ((Keyframe)(ref keys[0])).inTangent = inTangent; ((Keyframe)(ref keys[^1])).inTangent = inTangent; float outTangent = Mathf.Lerp(((Keyframe)(ref keys[0])).outTangent, ((Keyframe)(ref keys[^1])).outTangent, 0.5f); ((Keyframe)(ref keys[0])).outTangent = outTangent; ((Keyframe)(ref keys[^1])).outTangent = outTangent; ((Keyframe)(ref keys[^1])).time = time; curve.keys = keys; } public static void SetTangentMode(AnimationCurve curve) { } public static Quaternion EnsureQuaternionContinuity(Quaternion lastQ, Quaternion q) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) Quaternion val = default(Quaternion); ((Quaternion)(ref val))..ctor(0f - q.x, 0f - q.y, 0f - q.z, 0f - q.w); Quaternion val2 = default(Quaternion); ((Quaternion)(ref val2))..ctor(Mathf.Lerp(lastQ.x, q.x, 0.5f), Mathf.Lerp(lastQ.y, q.y, 0.5f), Mathf.Lerp(lastQ.z, q.z, 0.5f), Mathf.Lerp(lastQ.w, q.w, 0.5f)); Quaternion val3 = default(Quaternion); ((Quaternion)(ref val3))..ctor(Mathf.Lerp(lastQ.x, val.x, 0.5f), Mathf.Lerp(lastQ.y, val.y, 0.5f), Mathf.Lerp(lastQ.z, val.z, 0.5f), Mathf.Lerp(lastQ.w, val.w, 0.5f)); float num = Quaternion.Angle(lastQ, val2); if (!(Quaternion.Angle(lastQ, val3) < num)) { return q; } return val; } } [Serializable] public class BakerHumanoidQT { private Transform transform; private string Qx; private string Qy; private string Qz; private string Qw; private string Tx; private string Ty; private string Tz; public AnimationCurve rotX; public AnimationCurve rotY; public AnimationCurve rotZ; public AnimationCurve rotW; public AnimationCurve posX; public AnimationCurve posY; public AnimationCurve posZ; private AvatarIKGoal goal; private Quaternion lastQ; private bool lastQSet; public BakerHumanoidQT(string name) { Qx = name + "Q.x"; Qy = name + "Q.y"; Qz = name + "Q.z"; Qw = name + "Q.w"; Tx = name + "T.x"; Ty = name + "T.y"; Tz = name + "T.z"; Reset(); } public BakerHumanoidQT(Transform transform, AvatarIKGoal goal, string name) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) this.transform = transform; this.goal = goal; Qx = name + "Q.x"; Qy = name + "Q.y"; Qz = name + "Q.z"; Qw = name + "Q.w"; Tx = name + "T.x"; Ty = name + "T.y"; Tz = name + "T.z"; Reset(); } public void Reset() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) rotX = new AnimationCurve(); rotY = new AnimationCurve(); rotZ = new AnimationCurve(); rotW = new AnimationCurve(); posX = new AnimationCurve(); posY = new AnimationCurve(); posZ = new AnimationCurve(); lastQ = Quaternion.identity; lastQSet = false; } public void SetIKKeyframes(float time, Avatar avatar, Transform root, float humanScale, Vector3 bodyPosition, Quaternion bodyRotation) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) Vector3 val = transform.position; Quaternion val2 = transform.rotation; if ((Object)(object)root.parent != (Object)null) { val = root.parent.InverseTransformPoint(val); val2 = Quaternion.Inverse(root.parent.rotation) * val2; } TQ iKGoalTQ = AvatarUtility.GetIKGoalTQ(avatar, humanScale, goal, new TQ(bodyPosition, bodyRotation), new TQ(val, val2)); Quaternion val3 = iKGoalTQ.q; if (lastQSet) { val3 = BakerUtilities.EnsureQuaternionContinuity(lastQ, iKGoalTQ.q); } lastQ = val3; lastQSet = true; rotX.AddKey(time, val3.x); rotY.AddKey(time, val3.y); rotZ.AddKey(time, val3.z); rotW.AddKey(time, val3.w); Vector3 t = iKGoalTQ.t; posX.AddKey(time, t.x); posY.AddKey(time, t.y); posZ.AddKey(time, t.z); } public void SetKeyframes(float time, Vector3 pos, Quaternion rot) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) rotX.AddKey(time, rot.x); rotY.AddKey(time, rot.y); rotZ.AddKey(time, rot.z); rotW.AddKey(time, rot.w); posX.AddKey(time, pos.x); posY.AddKey(time, pos.y); posZ.AddKey(time, pos.z); } public void MoveLastKeyframes(float time) { MoveLastKeyframe(time, rotX); MoveLastKeyframe(time, rotY); MoveLastKeyframe(time, rotZ); MoveLastKeyframe(time, rotW); MoveLastKeyframe(time, posX); MoveLastKeyframe(time, posY); MoveLastKeyframe(time, posZ); } public void SetLoopFrame(float time) { BakerUtilities.SetLoopFrame(time, rotX); BakerUtilities.SetLoopFrame(time, rotY); BakerUtilities.SetLoopFrame(time, rotZ); BakerUtilities.SetLoopFrame(time, rotW); BakerUtilities.SetLoopFrame(time, posX); BakerUtilities.SetLoopFrame(time, posY); BakerUtilities.SetLoopFrame(time, posZ); } private void MoveLastKeyframe(float time, AnimationCurve curve) { Keyframe[] keys = curve.keys; ((Keyframe)(ref keys[^1])).time = time; curve.keys = keys; } public void MultiplyLength(AnimationCurve curve, float mlp) { Keyframe[] keys = curve.keys; for (int i = 0; i < keys.Length; i++) { ref Keyframe reference = ref keys[i]; ((Keyframe)(ref reference)).time = ((Keyframe)(ref reference)).time * mlp; } curve.keys = keys; } public void SetCurves(ref AnimationClip clip, float maxError, float lengthMlp) { MultiplyLength(rotX, lengthMlp); MultiplyLength(rotY, lengthMlp); MultiplyLength(rotZ, lengthMlp); MultiplyLength(rotW, lengthMlp); MultiplyLength(posX, lengthMlp); MultiplyLength(posY, lengthMlp); MultiplyLength(posZ, lengthMlp); BakerUtilities.ReduceKeyframes(rotX, maxError); BakerUtilities.ReduceKeyframes(rotY, maxError); BakerUtilities.ReduceKeyframes(rotZ, maxError); BakerUtilities.ReduceKeyframes(rotW, maxError); BakerUtilities.ReduceKeyframes(posX, maxError); BakerUtilities.ReduceKeyframes(posY, maxError); BakerUtilities.ReduceKeyframes(posZ, maxError); BakerUtilities.SetTangentMode(rotX); BakerUtilities.SetTangentMode(rotY); BakerUtilities.SetTangentMode(rotZ); BakerUtilities.SetTangentMode(rotW); clip.SetCurve(string.Empty, typeof(Animator), Qx, rotX); clip.SetCurve(string.Empty, typeof(Animator), Qy, rotY); clip.SetCurve(string.Empty, typeof(Animator), Qz, rotZ); clip.SetCurve(string.Empty, typeof(Animator), Qw, rotW); clip.SetCurve(string.Empty, typeof(Animator), Tx, posX); clip.SetCurve(string.Empty, typeof(Animator), Ty, posY); clip.SetCurve(string.Empty, typeof(Animator), Tz, posZ); } } [Serializable] public class BakerMuscle { public AnimationCurve curve; private int muscleIndex = -1; private string propertyName; public BakerMuscle(int muscleIndex) { this.muscleIndex = muscleIndex; propertyName = MuscleNameToPropertyName(HumanTrait.MuscleName[muscleIndex]); Reset(); } private string MuscleNameToPropertyName(string n) { return n switch { "Left Index 1 Stretched" => "LeftHand.Index.1 Stretched", "Left Index 2 Stretched" => "LeftHand.Index.2 Stretched", "Left Index 3 Stretched" => "LeftHand.Index.3 Stretched", "Left Middle 1 Stretched" => "LeftHand.Middle.1 Stretched", "Left Middle 2 Stretched" => "LeftHand.Middle.2 Stretched", "Left Middle 3 Stretched" => "LeftHand.Middle.3 Stretched", "Left Ring 1 Stretched" => "LeftHand.Ring.1 Stretched", "Left Ring 2 Stretched" => "LeftHand.Ring.2 Stretched", "Left Ring 3 Stretched" => "LeftHand.Ring.3 Stretched", "Left Little 1 Stretched" => "LeftHand.Little.1 Stretched", "Left Little 2 Stretched" => "LeftHand.Little.2 Stretched", "Left Little 3 Stretched" => "LeftHand.Little.3 Stretched", "Left Thumb 1 Stretched" => "LeftHand.Thumb.1 Stretched", "Left Thumb 2 Stretched" => "LeftHand.Thumb.2 Stretched", "Left Thumb 3 Stretched" => "LeftHand.Thumb.3 Stretched", "Left Index Spread" => "LeftHand.Index.Spread", "Left Middle Spread" => "LeftHand.Middle.Spread", "Left Ring Spread" => "LeftHand.Ring.Spread", "Left Little Spread" => "LeftHand.Little.Spread", "Left Thumb Spread" => "LeftHand.Thumb.Spread", "Right Index 1 Stretched" => "RightHand.Index.1 Stretched", "Right Index 2 Stretched" => "RightHand.Index.2 Stretched", "Right Index 3 Stretched" => "RightHand.Index.3 Stretched", "Right Middle 1 Stretched" => "RightHand.Middle.1 Stretched", "Right Middle 2 Stretched" => "RightHand.Middle.2 Stretched", "Right Middle 3 Stretched" => "RightHand.Middle.3 Stretched", "Right Ring 1 Stretched" => "RightHand.Ring.1 Stretched", "Right Ring 2 Stretched" => "RightHand.Ring.2 Stretched", "Right Ring 3 Stretched" => "RightHand.Ring.3 Stretched", "Right Little 1 Stretched" => "RightHand.Little.1 Stretched", "Right Little 2 Stretched" => "RightHand.Little.2 Stretched", "Right Little 3 Stretched" => "RightHand.Little.3 Stretched", "Right Thumb 1 Stretched" => "RightHand.Thumb.1 Stretched", "Right Thumb 2 Stretched" => "RightHand.Thumb.2 Stretched", "Right Thumb 3 Stretched" => "RightHand.Thumb.3 Stretched", "Right Index Spread" => "RightHand.Index.Spread", "Right Middle Spread" => "RightHand.Middle.Spread", "Right Ring Spread" => "RightHand.Ring.Spread", "Right Little Spread" => "RightHand.Little.Spread", "Right Thumb Spread" => "RightHand.Thumb.Spread", _ => n, }; } public void MultiplyLength(AnimationCurve curve, float mlp) { Keyframe[] keys = curve.keys; for (int i = 0; i < keys.Length; i++) { ref Keyframe reference = ref keys[i]; ((Keyframe)(ref reference)).time = ((Keyframe)(ref reference)).time * mlp; } curve.keys = keys; } public void SetCurves(ref AnimationClip clip, float maxError, float lengthMlp) { MultiplyLength(curve, lengthMlp); BakerUtilities.ReduceKeyframes(curve, maxError); clip.SetCurve(string.Empty, typeof(Animator), propertyName, curve); } public void Reset() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown curve = new AnimationCurve(); } public void SetKeyframe(float time, float[] muscles) { curve.AddKey(time, muscles[muscleIndex]); } public void SetLoopFrame(float time) { BakerUtilities.SetLoopFrame(time, curve); } } [Serializable] public class BakerTransform { public Transform transform; public AnimationCurve posX; public AnimationCurve posY; public AnimationCurve posZ; public AnimationCurve rotX; public AnimationCurve rotY; public AnimationCurve rotZ; public AnimationCurve rotW; private string relativePath; private bool recordPosition; private Vector3 relativePosition; private bool isRootNode; private Quaternion relativeRotation; public BakerTransform(Transform transform, Transform root, bool recordPosition, bool isRootNode) { this.transform = transform; this.recordPosition = recordPosition || isRootNode; this.isRootNode = isRootNode; relativePath = string.Empty; Reset(); } public void SetRelativeSpace(Vector3 position, Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) relativePosition = position; relativeRotation = rotation; } public void SetCurves(ref AnimationClip clip) { if (recordPosition) { clip.SetCurve(relativePath, typeof(Transform), "localPosition.x", posX); clip.SetCurve(relativePath, typeof(Transform), "localPosition.y", posY); clip.SetCurve(relativePath, typeof(Transform), "localPosition.z", posZ); } clip.SetCurve(relativePath, typeof(Transform), "localRotation.x", rotX); clip.SetCurve(relativePath, typeof(Transform), "localRotation.y", rotY); clip.SetCurve(relativePath, typeof(Transform), "localRotation.z", rotZ); clip.SetCurve(relativePath, typeof(Transform), "localRotation.w", rotW); if (isRootNode) { AddRootMotionCurves(ref clip); } clip.EnsureQuaternionContinuity(); } private void AddRootMotionCurves(ref AnimationClip clip) { if (recordPosition) { clip.SetCurve("", typeof(Animator), "MotionT.x", posX); clip.SetCurve("", typeof(Animator), "MotionT.y", posY); clip.SetCurve("", typeof(Animator), "MotionT.z", posZ); } clip.SetCurve("", typeof(Animator), "MotionQ.x", rotX); clip.SetCurve("", typeof(Animator), "MotionQ.y", rotY); clip.SetCurve("", typeof(Animator), "MotionQ.z", rotZ); clip.SetCurve("", typeof(Animator), "MotionQ.w", rotW); } public void Reset() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown posX = new AnimationCurve(); posY = new AnimationCurve(); posZ = new AnimationCurve(); rotX = new AnimationCurve(); rotY = new AnimationCurve(); rotZ = new AnimationCurve(); rotW = new AnimationCurve(); } public void ReduceKeyframes(float maxError) { BakerUtilities.ReduceKeyframes(rotX, maxError); BakerUtilities.ReduceKeyframes(rotY, maxError); BakerUtilities.ReduceKeyframes(rotZ, maxError); BakerUtilities.ReduceKeyframes(rotW, maxError); BakerUtilities.ReduceKeyframes(posX, maxError); BakerUtilities.ReduceKeyframes(posY, maxError); BakerUtilities.ReduceKeyframes(posZ, maxError); } public void SetKeyframes(float time) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (recordPosition) { Vector3 val = transform.localPosition; if (isRootNode) { val = transform.position - relativePosition; } posX.AddKey(time, val.x); posY.AddKey(time, val.y); posZ.AddKey(time, val.z); } Quaternion val2 = transform.localRotation; if (isRootNode) { val2 = Quaternion.Inverse(relativeRotation) * transform.rotation; } rotX.AddKey(time, val2.x); rotY.AddKey(time, val2.y); rotZ.AddKey(time, val2.z); rotW.AddKey(time, val2.w); } public void AddLoopFrame(float time) { if (recordPosition && !isRootNode) { posX.AddKey(time, ((Keyframe)(ref posX.keys[0])).value); posY.AddKey(time, ((Keyframe)(ref posY.keys[0])).value); posZ.AddKey(time, ((Keyframe)(ref posZ.keys[0])).value); } rotX.AddKey(time, ((Keyframe)(ref rotX.keys[0])).value); rotY.AddKey(time, ((Keyframe)(ref rotY.keys[0])).value); rotZ.AddKey(time, ((Keyframe)(ref rotZ.keys[0])).value); rotW.AddKey(time, ((Keyframe)(ref rotW.keys[0])).value); } } public class HumanoidBaker : Baker { [Tooltip("Should the hand IK curves be added to the animation? Disable this if the original hand positions are not important when using the clip on another character via Humanoid retargeting.")] public bool bakeHandIK = true; [Tooltip("Max keyframe reduction error for the Root.Q/T, LeftFoot IK and RightFoot IK channels. Having a larger error value for 'Key Reduction Error' and a smaller one for this enables you to optimize clip data size without the floating feet effect by enabling 'Foot IK' in the Animator.")] [Range(0f, 0.1f)] public float IKKeyReductionError; [Tooltip("Frame rate divider for the muscle curves. If you have 'Frame Rate' set to 30, and this value set to 3, the muscle curves will be baked at 10 fps. Only the Root Q/T and Hand and Foot IK curves will be baked at 30. This enables you to optimize clip data size without the floating feet effect by enabling 'Foot IK' in the Animator.")] [Range(1f, 9f)] public int muscleFrameRateDiv = 1; private BakerMuscle[] bakerMuscles; private BakerHumanoidQT rootQT; private BakerHumanoidQT leftFootQT; private BakerHumanoidQT rightFootQT; private BakerHumanoidQT leftHandQT; private BakerHumanoidQT rightHandQT; private float[] muscles = new float[0]; private HumanPose pose; private HumanPoseHandler handler; private Vector3 bodyPosition; private Quaternion bodyRotation = Quaternion.identity; private int mN; private Quaternion lastBodyRotation = Quaternion.identity; private void Awake() { //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown animator = ((Component)this).GetComponent(); director = ((Component)this).GetComponent(); if (mode == Mode.AnimationStates || mode == Mode.AnimationClips) { if ((Object)(object)animator == (Object)null || !animator.isHuman) { Debug.LogError((object)"HumanoidBaker GameObject does not have a Humanoid Animator component, can not bake."); ((Behaviour)this).enabled = false; return; } animator.cullingMode = (AnimatorCullingMode)0; } else if (mode == Mode.PlayableDirector && (Object)(object)director == (Object)null) { Debug.LogError((object)"HumanoidBaker GameObject does not have a PlayableDirector component, can not bake."); } muscles = new float[HumanTrait.MuscleCount]; bakerMuscles = new BakerMuscle[HumanTrait.MuscleCount]; for (int i = 0; i < bakerMuscles.Length; i++) { bakerMuscles[i] = new BakerMuscle(i); } rootQT = new BakerHumanoidQT("Root"); leftFootQT = new BakerHumanoidQT(animator.GetBoneTransform((HumanBodyBones)5), (AvatarIKGoal)0, "LeftFoot"); rightFootQT = new BakerHumanoidQT(animator.GetBoneTransform((HumanBodyBones)6), (AvatarIKGoal)1, "RightFoot"); leftHandQT = new BakerHumanoidQT(animator.GetBoneTransform((HumanBodyBones)17), (AvatarIKGoal)2, "LeftHand"); rightHandQT = new BakerHumanoidQT(animator.GetBoneTransform((HumanBodyBones)18), (AvatarIKGoal)3, "RightHand"); handler = new HumanPoseHandler(animator.avatar, ((Component)animator).transform); } protected override Transform GetCharacterRoot() { return ((Component)animator).transform; } protected override void OnStartBaking() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) rootQT.Reset(); leftFootQT.Reset(); rightFootQT.Reset(); leftHandQT.Reset(); rightHandQT.Reset(); for (int i = 0; i < bakerMuscles.Length; i++) { bakerMuscles[i].Reset(); } mN = muscleFrameRateDiv; lastBodyRotation = Quaternion.identity; } protected override void OnSetLoopFrame(float time) { for (int i = 0; i < bakerMuscles.Length; i++) { bakerMuscles[i].SetLoopFrame(time); } rootQT.MoveLastKeyframes(time); leftFootQT.SetLoopFrame(time); rightFootQT.SetLoopFrame(time); leftHandQT.SetLoopFrame(time); rightHandQT.SetLoopFrame(time); } protected override void OnSetCurves(ref AnimationClip clip) { float time = ((Keyframe)(ref bakerMuscles[0].curve.keys[bakerMuscles[0].curve.keys.Length - 1])).time; float lengthMlp = ((mode != Mode.Realtime) ? (base.clipLength / time) : 1f); for (int i = 0; i < bakerMuscles.Length; i++) { bakerMuscles[i].SetCurves(ref clip, keyReductionError, lengthMlp); } rootQT.SetCurves(ref clip, IKKeyReductionError, lengthMlp); leftFootQT.SetCurves(ref clip, IKKeyReductionError, lengthMlp); rightFootQT.SetCurves(ref clip, IKKeyReductionError, lengthMlp); if (bakeHandIK) { leftHandQT.SetCurves(ref clip, IKKeyReductionError, lengthMlp); rightHandQT.SetCurves(ref clip, IKKeyReductionError, lengthMlp); } } protected override void OnSetKeyframes(float time, bool lastFrame) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) mN++; bool flag = true; if (mN < muscleFrameRateDiv && !lastFrame) { flag = false; } if (mN >= muscleFrameRateDiv) { mN = 0; } UpdateHumanPose(); if (flag) { for (int i = 0; i < bakerMuscles.Length; i++) { bakerMuscles[i].SetKeyframe(time, muscles); } } rootQT.SetKeyframes(time, bodyPosition, bodyRotation); Vector3 val = bodyPosition * animator.humanScale; leftFootQT.SetIKKeyframes(time, animator.avatar, ((Component)animator).transform, animator.humanScale, val, bodyRotation); rightFootQT.SetIKKeyframes(time, animator.avatar, ((Component)animator).transform, animator.humanScale, val, bodyRotation); leftHandQT.SetIKKeyframes(time, animator.avatar, ((Component)animator).transform, animator.humanScale, val, bodyRotation); rightHandQT.SetIKKeyframes(time, animator.avatar, ((Component)animator).transform, animator.humanScale, val, bodyRotation); } private void UpdateHumanPose() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) handler.GetHumanPose(ref pose); bodyPosition = pose.bodyPosition; bodyRotation = pose.bodyRotation; bodyRotation = BakerUtilities.EnsureQuaternionContinuity(lastBodyRotation, bodyRotation); lastBodyRotation = bodyRotation; for (int i = 0; i < pose.muscles.Length; i++) { muscles[i] = pose.muscles[i]; } } } [Serializable] public enum Axis { X, Y, Z } public class AxisTools { public static Vector3 ToVector3(Axis axis) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return (Vector3)(axis switch { Axis.X => Vector3.right, Axis.Y => Vector3.up, _ => Vector3.forward, }); } public static Axis ToAxis(Vector3 v) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Abs(v.x); float num2 = Mathf.Abs(v.y); float num3 = Mathf.Abs(v.z); Axis result = Axis.X; if (num2 > num && num2 > num3) { result = Axis.Y; } if (num3 > num && num3 > num2) { result = Axis.Z; } return result; } public static Axis GetAxisToPoint(Transform t, Vector3 worldPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) Vector3 axisVectorToPoint = GetAxisVectorToPoint(t, worldPosition); if (axisVectorToPoint == Vector3.right) { return Axis.X; } if (axisVectorToPoint == Vector3.up) { return Axis.Y; } return Axis.Z; } public static Axis GetAxisToDirection(Transform t, Vector3 direction) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) Vector3 axisVectorToDirection = GetAxisVectorToDirection(t, direction); if (axisVectorToDirection == Vector3.right) { return Axis.X; } if (axisVectorToDirection == Vector3.up) { return Axis.Y; } return Axis.Z; } public static Vector3 GetAxisVectorToPoint(Transform t, Vector3 worldPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return GetAxisVectorToDirection(t, worldPosition - t.position); } public static Vector3 GetAxisVectorToDirection(Transform t, Vector3 direction) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return GetAxisVectorToDirection(t.rotation, direction); } public static Vector3 GetAxisVectorToDirection(Quaternion r, Vector3 direction) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) direction = ((Vector3)(ref direction)).normalized; Vector3 result = Vector3.right; float num = Mathf.Abs(Vector3.Dot(Vector3.Normalize(r * Vector3.right), direction)); float num2 = Mathf.Abs(Vector3.Dot(Vector3.Normalize(r * Vector3.up), direction)); if (num2 > num) { result = Vector3.up; } float num3 = Mathf.Abs(Vector3.Dot(Vector3.Normalize(r * Vector3.forward), direction)); if (num3 > num && num3 > num2) { result = Vector3.forward; } return result; } } [Serializable] public class BipedLimbOrientations { [Serializable] public class LimbOrientation { public Vector3 upperBoneForwardAxis; public Vector3 lowerBoneForwardAxis; public Vector3 lastBoneLeftAxis; public LimbOrientation(Vector3 upperBoneForwardAxis, Vector3 lowerBoneForwardAxis, Vector3 lastBoneLeftAxis) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) this.upperBoneForwardAxis = upperBoneForwardAxis; this.lowerBoneForwardAxis = lowerBoneForwardAxis; this.lastBoneLeftAxis = lastBoneLeftAxis; } } public LimbOrientation leftArm; public LimbOrientation rightArm; public LimbOrientation leftLeg; public LimbOrientation rightLeg; public static BipedLimbOrientations UMA => new BipedLimbOrientations(new LimbOrientation(Vector3.forward, Vector3.forward, Vector3.forward), new LimbOrientation(Vector3.forward, Vector3.forward, Vector3.back), new LimbOrientation(Vector3.forward, Vector3.forward, Vector3.down), new LimbOrientation(Vector3.forward, Vector3.forward, Vector3.down)); public static BipedLimbOrientations MaxBiped => new BipedLimbOrientations(new LimbOrientation(Vector3.down, Vector3.down, Vector3.down), new LimbOrientation(Vector3.down, Vector3.down, Vector3.up), new LimbOrientation(Vector3.up, Vector3.up, Vector3.back), new LimbOrientation(Vector3.up, Vector3.up, Vector3.back)); public BipedLimbOrientations(LimbOrientation leftArm, LimbOrientation rightArm, LimbOrientation leftLeg, LimbOrientation rightLeg) { this.leftArm = leftArm; this.rightArm = rightArm; this.leftLeg = leftLeg; this.rightLeg = rightLeg; } } public static class BipedNaming { [Serializable] public enum BoneType { Unassigned, Spine, Head, Arm, Leg, Tail, Eye } [Serializable] public enum BoneSide { Center, Left, Right } public static string[] typeLeft = new string[9] { " L ", "_L_", "-L-", " l ", "_l_", "-l-", "Left", "left", "CATRigL" }; public static string[] typeRight = new string[9] { " R ", "_R_", "-R-", " r ", "_r_", "-r-", "Right", "right", "CATRigR" }; public static string[] typeSpine = new string[16] { "Spine", "spine", "Pelvis", "pelvis", "Root", "root", "Torso", "torso", "Body", "body", "Hips", "hips", "Neck", "neck", "Chest", "chest" }; public static string[] typeHead = new string[2] { "Head", "head" }; public static string[] typeArm = new string[10] { "Arm", "arm", "Hand", "hand", "Wrist", "Wrist", "Elbow", "elbow", "Palm", "palm" }; public static string[] typeLeg = new string[16] { "Leg", "leg", "Thigh", "thigh", "Calf", "calf", "Femur", "femur", "Knee", "knee", "Foot", "foot", "Ankle", "ankle", "Hip", "hip" }; public static string[] typeTail = new string[2] { "Tail", "tail" }; public static string[] typeEye = new string[2] { "Eye", "eye" }; public static string[] typeExclude = new string[6] { "Nub", "Dummy", "dummy", "Tip", "IK", "Mesh" }; public static string[] typeExcludeSpine = new string[2] { "Head", "head" }; public static string[] typeExcludeHead = new string[2] { "Top", "End" }; public static string[] typeExcludeArm = new string[19] { "Collar", "collar", "Clavicle", "clavicle", "Finger", "finger", "Index", "index", "Mid", "mid", "Pinky", "pinky", "Ring", "Thumb", "thumb", "Adjust", "adjust", "Twist", "twist" }; public static string[] typeExcludeLeg = new string[7] { "Toe", "toe", "Platform", "Adjust", "adjust", "Twist", "twist" }; public static string[] typeExcludeTail = new string[0]; public static string[] typeExcludeEye = new string[6] { "Lid", "lid", "Brow", "brow", "Lash", "lash" }; public static string[] pelvis = new string[4] { "Pelvis", "pelvis", "Hip", "hip" }; public static string[] hand = new string[6] { "Hand", "hand", "Wrist", "wrist", "Palm", "palm" }; public static string[] foot = new string[4] { "Foot", "foot", "Ankle", "ankle" }; public static Transform[] GetBonesOfType(BoneType boneType, Transform[] bones) { Transform[] array = (Transform[])(object)new Transform[0]; foreach (Transform val in bones) { if ((Object)(object)val != (Object)null && GetBoneType(((Object)val).name) == boneType) { Array.Resize(ref array, array.Length + 1); array[^1] = val; } } return array; } public static Transform[] GetBonesOfSide(BoneSide boneSide, Transform[] bones) { Transform[] array = (Transform[])(object)new Transform[0]; foreach (Transform val in bones) { if ((Object)(object)val != (Object)null && GetBoneSide(((Object)val).name) == boneSide) { Array.Resize(ref array, array.Length + 1); array[^1] = val; } } return array; } public static Transform[] GetBonesOfTypeAndSide(BoneType boneType, BoneSide boneSide, Transform[] bones) { Transform[] bonesOfType = GetBonesOfType(boneType, bones); return GetBonesOfSide(boneSide, bonesOfType); } public static Transform GetFirstBoneOfTypeAndSide(BoneType boneType, BoneSide boneSide, Transform[] bones) { Transform[] bonesOfTypeAndSide = GetBonesOfTypeAndSide(boneType, boneSide, bones); if (bonesOfTypeAndSide.Length == 0) { return null; } return bonesOfTypeAndSide[0]; } public static Transform GetNamingMatch(Transform[] transforms, params string[][] namings) { foreach (Transform val in transforms) { bool flag = true; foreach (string[] namingConvention in namings) { if (!matchesNaming(((Object)val).name, namingConvention)) { flag = false; break; } } if (flag) { return val; } } return null; } public static BoneType GetBoneType(string boneName) { if (isSpine(boneName)) { return BoneType.Spine; } if (isHead(boneName)) { return BoneType.Head; } if (isArm(boneName)) { return BoneType.Arm; } if (isLeg(boneName)) { return BoneType.Leg; } if (isTail(boneName)) { return BoneType.Tail; } if (isEye(boneName)) { return BoneType.Eye; } return BoneType.Unassigned; } public static BoneSide GetBoneSide(string boneName) { if (isLeft(boneName)) { return BoneSide.Left; } if (isRight(boneName)) { return BoneSide.Right; } return BoneSide.Center; } public static Transform GetBone(Transform[] transforms, BoneType boneType, BoneSide boneSide = BoneSide.Center, params string[][] namings) { return GetNamingMatch(GetBonesOfTypeAndSide(boneType, boneSide, transforms), namings); } private static bool isLeft(string boneName) { if (!matchesNaming(boneName, typeLeft) && !(lastLetter(boneName) == "L")) { return firstLetter(boneName) == "L"; } return true; } private static bool isRight(string boneName) { if (!matchesNaming(boneName, typeRight) && !(lastLetter(boneName) == "R")) { return firstLetter(boneName) == "R"; } return true; } private static bool isSpine(string boneName) { if (matchesNaming(boneName, typeSpine)) { return !excludesNaming(boneName, typeExcludeSpine); } return false; } private static bool isHead(string boneName) { if (matchesNaming(boneName, typeHead)) { return !excludesNaming(boneName, typeExcludeHead); } return false; } private static bool isArm(string boneName) { if (matchesNaming(boneName, typeArm)) { return !excludesNaming(boneName, typeExcludeArm); } return false; } private static bool isLeg(string boneName) { if (matchesNaming(boneName, typeLeg)) { return !excludesNaming(boneName, typeExcludeLeg); } return false; } private static bool isTail(string boneName) { if (matchesNaming(boneName, typeTail)) { return !excludesNaming(boneName, typeExcludeTail); } return false; } private static bool isEye(string boneName) { if (matchesNaming(boneName, typeEye)) { return !excludesNaming(boneName, typeExcludeEye); } return false; } private static bool isTypeExclude(string boneName) { return matchesNaming(boneName, typeExclude); } private static bool matchesNaming(string boneName, string[] namingConvention) { if (excludesNaming(boneName, typeExclude)) { return false; } foreach (string value in namingConvention) { if (boneName.Contains(value)) { return true; } } return false; } private static bool excludesNaming(string boneName, string[] namingConvention) { foreach (string value in namingConvention) { if (boneName.Contains(value)) { return true; } } return false; } private static bool matchesLastLetter(string boneName, string[] namingConvention) { foreach (string letter in namingConvention) { if (LastLetterIs(boneName, letter)) { return true; } } return false; } private static bool LastLetterIs(string boneName, string letter) { return boneName.Substring(boneName.Length - 1, 1) == letter; } private static string firstLetter(string boneName) { if (boneName.Length > 0) { return boneName.Substring(0, 1); } return ""; } private static string lastLetter(string boneName) { if (boneName.Length > 0) { return boneName.Substring(boneName.Length - 1, 1); } return ""; } } [Serializable] public class BipedReferences { public struct AutoDetectParams { public bool legsParentInSpine; public bool includeEyes; public static AutoDetectParams Default => new AutoDetectParams(legsParentInSpine: true, includeEyes: true); public AutoDetectParams(bool legsParentInSpine, bool includeEyes) { this.legsParentInSpine = legsParentInSpine; this.includeEyes = includeEyes; } } public Transform root; public Transform pelvis; public Transform leftThigh; public Transform leftCalf; public Transform leftFoot; public Transform rightThigh; public Transform rightCalf; public Transform rightFoot; public Transform leftUpperArm; public Transform leftForearm; public Transform leftHand; public Transform rightUpperArm; public Transform rightForearm; public Transform rightHand; public Transform head; public Transform[] spine = (Transform[])(object)new Transform[0]; public Transform[] eyes = (Transform[])(object)new Transform[0]; public virtual bool isFilled { get { if ((Object)(object)root == (Object)null) { return false; } if ((Object)(object)pelvis == (Object)null) { return false; } if ((Object)(object)leftThigh == (Object)null || (Object)(object)leftCalf == (Object)null || (Object)(object)leftFoot == (Object)null) { return false; } if ((Object)(object)rightThigh == (Object)null || (Object)(object)rightCalf == (Object)null || (Object)(object)rightFoot == (Object)null) { return false; } if ((Object)(object)leftUpperArm == (Object)null || (Object)(object)leftForearm == (Object)null || (Object)(object)leftHand == (Object)null) { return false; } if ((Object)(object)rightUpperArm == (Object)null || (Object)(object)rightForearm == (Object)null || (Object)(object)rightHand == (Object)null) { return false; } Transform[] array = spine; for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] == (Object)null) { return false; } } array = eyes; for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] == (Object)null) { return false; } } return true; } } public bool isEmpty => IsEmpty(includeRoot: true); public virtual bool IsEmpty(bool includeRoot) { if (includeRoot && (Object)(object)root != (Object)null) { return false; } if ((Object)(object)pelvis != (Object)null || (Object)(object)head != (Object)null) { return false; } if ((Object)(object)leftThigh != (Object)null || (Object)(object)leftCalf != (Object)null || (Object)(object)leftFoot != (Object)null) { return false; } if ((Object)(object)rightThigh != (Object)null || (Object)(object)rightCalf != (Object)null || (Object)(object)rightFoot != (Object)null) { return false; } if ((Object)(object)leftUpperArm != (Object)null || (Object)(object)leftForearm != (Object)null || (Object)(object)leftHand != (Object)null) { return false; } if ((Object)(object)rightUpperArm != (Object)null || (Object)(object)rightForearm != (Object)null || (Object)(object)rightHand != (Object)null) { return false; } Transform[] array = spine; for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] != (Object)null) { return false; } } array = eyes; for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] != (Object)null) { return false; } } return true; } public virtual bool Contains(Transform t, bool ignoreRoot = false) { if (!ignoreRoot && (Object)(object)root == (Object)(object)t) { return true; } if ((Object)(object)pelvis == (Object)(object)t) { return true; } if ((Object)(object)leftThigh == (Object)(object)t) { return true; } if ((Object)(object)leftCalf == (Object)(object)t) { return true; } if ((Object)(object)leftFoot == (Object)(object)t) { return true; } if ((Object)(object)rightThigh == (Object)(object)t) { return true; } if ((Object)(object)rightCalf == (Object)(object)t) { return true; } if ((Object)(object)rightFoot == (Object)(object)t) { return true; } if ((Object)(object)leftUpperArm == (Object)(object)t) { return true; } if ((Object)(object)leftForearm == (Object)(object)t) { return true; } if ((Object)(object)leftHand == (Object)(object)t) { return true; } if ((Object)(object)rightUpperArm == (Object)(object)t) { return true; } if ((Object)(object)rightForearm == (Object)(object)t) { return true; } if ((Object)(object)rightHand == (Object)(object)t) { return true; } if ((Object)(object)head == (Object)(object)t) { return true; } Transform[] array = spine; for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] == (Object)(object)t) { return true; } } array = eyes; for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] == (Object)(object)t) { return true; } } return false; } public static bool AutoDetectReferences(ref BipedReferences references, Transform root, AutoDetectParams autoDetectParams) { if (references == null) { references = new BipedReferences(); } references.root = root; Animator component = ((Component)root).GetComponent(); if ((Object)(object)component != (Object)null && component.isHuman) { AssignHumanoidReferences(ref references, component, autoDetectParams); return true; } DetectReferencesByNaming(ref references, root, autoDetectParams); Warning.logged = false; if (!references.isFilled) { Warning.Log("BipedReferences contains one or more missing Transforms.", root, logInEditMode: true); return false; } string errorMessage = ""; if (SetupError(references, ref errorMessage)) { Warning.Log(errorMessage, references.root, logInEditMode: true); return false; } if (SetupWarning(references, ref errorMessage)) { Warning.Log(errorMessage, references.root, logInEditMode: true); } return true; } public static void DetectReferencesByNaming(ref BipedReferences references, Transform root, AutoDetectParams autoDetectParams) { if (references == null) { references = new BipedReferences(); } Transform[] componentsInChildren = ((Component)root).GetComponentsInChildren(); DetectLimb(BipedNaming.BoneType.Arm, BipedNaming.BoneSide.Left, ref references.leftUpperArm, ref references.leftForearm, ref references.leftHand, componentsInChildren); DetectLimb(BipedNaming.BoneType.Arm, BipedNaming.BoneSide.Right, ref references.rightUpperArm, ref references.rightForearm, ref references.rightHand, componentsInChildren); DetectLimb(BipedNaming.BoneType.Leg, BipedNaming.BoneSide.Left, ref references.leftThigh, ref references.leftCalf, ref references.leftFoot, componentsInChildren); DetectLimb(BipedNaming.BoneType.Leg, BipedNaming.BoneSide.Right, ref references.rightThigh, ref references.rightCalf, ref references.rightFoot, componentsInChildren); references.head = BipedNaming.GetBone(componentsInChildren, BipedNaming.BoneType.Head, BipedNaming.BoneSide.Center); references.pelvis = BipedNaming.GetNamingMatch(componentsInChildren, BipedNaming.pelvis); if (((Object)(object)references.pelvis == (Object)null || !Hierarchy.IsAncestor(references.leftThigh, references.pelvis)) && (Object)(object)references.leftThigh != (Object)null) { references.pelvis = references.leftThigh.parent; } if ((Object)(object)references.leftUpperArm != (Object)null && (Object)(object)references.rightUpperArm != (Object)null && (Object)(object)references.pelvis != (Object)null && (Object)(object)references.leftThigh != (Object)null) { Transform firstCommonAncestor = Hierarchy.GetFirstCommonAncestor(references.leftUpperArm, references.rightUpperArm); if ((Object)(object)firstCommonAncestor != (Object)null) { Transform[] array = (Transform[])(object)new Transform[1] { firstCommonAncestor }; Hierarchy.AddAncestors(array[0], references.pelvis, ref array); references.spine = (Transform[])(object)new Transform[0]; for (int num = array.Length - 1; num > -1; num--) { if (AddBoneToSpine(array[num], ref references, autoDetectParams)) { Array.Resize(ref references.spine, references.spine.Length + 1); references.spine[references.spine.Length - 1] = array[num]; } } if ((Object)(object)references.head == (Object)null) { for (int i = 0; i < firstCommonAncestor.childCount; i++) { Transform child = firstCommonAncestor.GetChild(i); if (!Hierarchy.ContainsChild(child, references.leftUpperArm) && !Hierarchy.ContainsChild(child, references.rightUpperArm)) { references.head = child; break; } } } } } Transform[] bonesOfType = BipedNaming.GetBonesOfType(BipedNaming.BoneType.Eye, componentsInChildren); references.eyes = (Transform[])(object)new Transform[0]; if (!autoDetectParams.includeEyes) { return; } for (int j = 0; j < bonesOfType.Length; j++) { if (AddBoneToEyes(bonesOfType[j], ref references, autoDetectParams)) { Array.Resize(ref references.eyes, references.eyes.Length + 1); references.eyes[references.eyes.Length - 1] = bonesOfType[j]; } } } public static void AssignHumanoidReferences(ref BipedReferences references, Animator animator, AutoDetectParams autoDetectParams) { if (references == null) { references = new BipedReferences(); } if (!((Object)(object)animator == (Object)null) && animator.isHuman) { references.spine = (Transform[])(object)new Transform[0]; references.eyes = (Transform[])(object)new Transform[0]; references.head = animator.GetBoneTransform((HumanBodyBones)10); references.leftThigh = animator.GetBoneTransform((HumanBodyBones)1); references.leftCalf = animator.GetBoneTransform((HumanBodyBones)3); references.leftFoot = animator.GetBoneTransform((HumanBodyBones)5); references.rightThigh = animator.GetBoneTransform((HumanBodyBones)2); references.rightCalf = animator.GetBoneTransform((HumanBodyBones)4); references.rightFoot = animator.GetBoneTransform((HumanBodyBones)6); references.leftUpperArm = animator.GetBoneTransform((HumanBodyBones)13); references.leftForearm = animator.GetBoneTransform((HumanBodyBones)15); references.leftHand = animator.GetBoneTransform((HumanBodyBones)17); references.rightUpperArm = animator.GetBoneTransform((HumanBodyBones)14); references.rightForearm = animator.GetBoneTransform((HumanBodyBones)16); references.rightHand = animator.GetBoneTransform((HumanBodyBones)18); references.pelvis = animator.GetBoneTransform((HumanBodyBones)0); AddBoneToHierarchy(ref references.spine, animator.GetBoneTransform((HumanBodyBones)7)); AddBoneToHierarchy(ref references.spine, animator.GetBoneTransform((HumanBodyBones)8)); if ((Object)(object)references.leftUpperArm != (Object)null && !IsNeckBone(animator.GetBoneTransform((HumanBodyBones)9), references.leftUpperArm)) { AddBoneToHierarchy(ref references.spine, animator.GetBoneTransform((HumanBodyBones)9)); } if (autoDetectParams.includeEyes) { AddBoneToHierarchy(ref references.eyes, animator.GetBoneTransform((HumanBodyBones)21)); AddBoneToHierarchy(ref references.eyes, animator.GetBoneTransform((HumanBodyBones)22)); } } } public static bool SetupError(BipedReferences references, ref string errorMessage) { if (!references.isFilled) { errorMessage = "BipedReferences contains one or more missing Transforms."; return true; } if (LimbError(references.leftThigh, references.leftCalf, references.leftFoot, ref errorMessage)) { return true; } if (LimbError(references.rightThigh, references.rightCalf, references.rightFoot, ref errorMessage)) { return true; } if (LimbError(references.leftUpperArm, references.leftForearm, references.leftHand, ref errorMessage)) { return true; } if (LimbError(references.rightUpperArm, references.rightForearm, references.rightHand, ref errorMessage)) { return true; } if (SpineError(references, ref errorMessage)) { return true; } if (EyesError(references, ref errorMessage)) { return true; } return false; } public static bool SetupWarning(BipedReferences references, ref string warningMessage) { if (LimbWarning(references.leftThigh, references.leftCalf, references.leftFoot, ref warningMessage)) { return true; } if (LimbWarning(references.rightThigh, references.rightCalf, references.rightFoot, ref warningMessage)) { return true; } if (LimbWarning(references.leftUpperArm, references.leftForearm, references.leftHand, ref warningMessage)) { return true; } if (LimbWarning(references.rightUpperArm, references.rightForearm, references.rightHand, ref warningMessage)) { return true; } if (SpineWarning(references, ref warningMessage)) { return true; } if (EyesWarning(references, ref warningMessage)) { return true; } if (RootHeightWarning(references, ref warningMessage)) { return true; } if (FacingAxisWarning(references, ref warningMessage)) { return true; } return false; } private static bool IsNeckBone(Transform bone, Transform leftUpperArm) { if ((Object)(object)leftUpperArm.parent != (Object)null && (Object)(object)leftUpperArm.parent == (Object)(object)bone) { return false; } if (Hierarchy.IsAncestor(leftUpperArm, bone)) { return false; } return true; } private static bool AddBoneToEyes(Transform bone, ref BipedReferences references, AutoDetectParams autoDetectParams) { if ((Object)(object)references.head != (Object)null && !Hierarchy.IsAncestor(bone, references.head)) { return false; } if ((Object)(object)((Component)bone).GetComponent() != (Object)null) { return false; } return true; } private static bool AddBoneToSpine(Transform bone, ref BipedReferences references, AutoDetectParams autoDetectParams) { if ((Object)(object)bone == (Object)(object)references.root) { return false; } if ((Object)(object)bone == (Object)(object)references.leftThigh.parent && !autoDetectParams.legsParentInSpine) { return false; } if ((Object)(object)references.pelvis != (Object)null) { if ((Object)(object)bone == (Object)(object)references.pelvis) { return false; } if (Hierarchy.IsAncestor(references.pelvis, bone)) { return false; } } return true; } private static void DetectLimb(BipedNaming.BoneType boneType, BipedNaming.BoneSide boneSide, ref Transform firstBone, ref Transform secondBone, ref Transform lastBone, Transform[] transforms) { Transform[] bonesOfTypeAndSide = BipedNaming.GetBonesOfTypeAndSide(boneType, boneSide, transforms); if (bonesOfTypeAndSide.Length >= 3) { if (bonesOfTypeAndSide.Length == 3) { firstBone = bonesOfTypeAndSide[0]; secondBone = bonesOfTypeAndSide[1]; lastBone = bonesOfTypeAndSide[2]; } if (bonesOfTypeAndSide.Length > 3) { firstBone = bonesOfTypeAndSide[0]; secondBone = bonesOfTypeAndSide[2]; lastBone = bonesOfTypeAndSide[^1]; } } } private static void AddBoneToHierarchy(ref Transform[] bones, Transform transform) { if (!((Object)(object)transform == (Object)null)) { Array.Resize(ref bones, bones.Length + 1); bones[bones.Length - 1] = transform; } } private static bool LimbError(Transform bone1, Transform bone2, Transform bone3, ref string errorMessage) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bone1 == (Object)null) { errorMessage = "Bone 1 of a BipedReferences limb is null."; return true; } if ((Object)(object)bone2 == (Object)null) { errorMessage = "Bone 2 of a BipedReferences limb is null."; return true; } if ((Object)(object)bone3 == (Object)null) { errorMessage = "Bone 3 of a BipedReferences limb is null."; return true; } Object[] objects = (Object[])(object)new Transform[3] { bone1, bone2, bone3 }; Transform val = (Transform)Hierarchy.ContainsDuplicate(objects); if ((Object)(object)val != (Object)null) { errorMessage = ((Object)val).name + " is represented multiple times in the same BipedReferences limb."; return true; } if (bone2.position == bone1.position) { errorMessage = "Second bone's position equals first bone's position in the biped's limb."; return true; } if (bone3.position == bone2.position) { errorMessage = "Third bone's position equals second bone's position in the biped's limb."; return true; } if (!Hierarchy.HierarchyIsValid((Transform[])(object)new Transform[3] { bone1, bone2, bone3 })) { errorMessage = "BipedReferences limb hierarchy is invalid. Bone transforms in a limb do not belong to the same ancestry. Please make sure the bones are parented to each other. Bones: " + ((Object)bone1).name + ", " + ((Object)bone2).name + ", " + ((Object)bone3).name; return true; } return false; } private static bool LimbWarning(Transform bone1, Transform bone2, Transform bone3, ref string warningMessage) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Cross(bone2.position - bone1.position, bone3.position - bone1.position) == Vector3.zero) { warningMessage = "BipedReferences limb is completely stretched out in the initial pose. IK solver can not calculate the default bend plane for the limb. Please make sure you character's limbs are at least slightly bent in the initial pose. First bone: " + ((Object)bone1).name + ", second bone: " + ((Object)bone2).name + "."; return true; } return false; } private static bool SpineError(BipedReferences references, ref string errorMessage) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) if (references.spine.Length == 0) { return false; } for (int i = 0; i < references.spine.Length; i++) { if ((Object)(object)references.spine[i] == (Object)null) { errorMessage = "BipedReferences spine bone at index " + i + " is null."; return true; } } Object[] objects = (Object[])(object)references.spine; Transform val = (Transform)Hierarchy.ContainsDuplicate(objects); if ((Object)(object)val != (Object)null) { errorMessage = ((Object)val).name + " is represented multiple times in BipedReferences spine."; return true; } if (!Hierarchy.HierarchyIsValid(references.spine)) { errorMessage = "BipedReferences spine hierarchy is invalid. Bone transforms in the spine do not belong to the same ancestry. Please make sure the bones are parented to each other."; return true; } for (int j = 0; j < references.spine.Length; j++) { bool flag = false; if (j == 0 && references.spine[j].position == references.pelvis.position) { flag = true; } if (j != 0 && references.spine.Length > 1 && references.spine[j].position == references.spine[j - 1].position) { flag = true; } if (flag) { errorMessage = "Biped's spine bone nr " + j + " position is the same as it's parent spine/pelvis bone's position. Please remove this bone from the spine."; return true; } } return false; } private static bool SpineWarning(BipedReferences references, ref string warningMessage) { return false; } private static bool EyesError(BipedReferences references, ref string errorMessage) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown if (references.eyes.Length == 0) { return false; } for (int i = 0; i < references.eyes.Length; i++) { if ((Object)(object)references.eyes[i] == (Object)null) { errorMessage = "BipedReferences eye bone at index " + i + " is null."; return true; } } Object[] objects = (Object[])(object)references.eyes; Transform val = (Transform)Hierarchy.ContainsDuplicate(objects); if ((Object)(object)val != (Object)null) { errorMessage = ((Object)val).name + " is represented multiple times in BipedReferences eyes."; return true; } return false; } private static bool EyesWarning(BipedReferences references, ref string warningMessage) { return false; } private static bool RootHeightWarning(BipedReferences references, ref string warningMessage) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)references.head == (Object)null) { return false; } float verticalOffset = GetVerticalOffset(references.head.position, references.leftFoot.position, references.root.rotation); if (GetVerticalOffset(references.root.position, references.leftFoot.position, references.root.rotation) / verticalOffset > 0.2f) { warningMessage = "Biped's root Transform's position should be at ground level relative to the character (at the character's feet not at it's pelvis)."; return true; } return false; } private static bool FacingAxisWarning(BipedReferences references, ref string warningMessage) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = references.rightHand.position - references.leftHand.position; Vector3 val2 = references.rightFoot.position - references.leftFoot.position; float num = Vector3.Dot(((Vector3)(ref val)).normalized, references.root.right); float num2 = Vector3.Dot(((Vector3)(ref val2)).normalized, references.root.right); if (num < 0f || num2 < 0f) { warningMessage = "Biped does not seem to be facing it's forward axis. Please make sure that in the initial pose the character is facing towards the positive Z axis of the Biped root gameobject."; return true; } return false; } private static float GetVerticalOffset(Vector3 p1, Vector3 p2, Quaternion rotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return (Quaternion.Inverse(rotation) * (p1 - p2)).y; } } public class Comments : MonoBehaviour { [Multiline] public string text; } public class DemoGUIMessage : MonoBehaviour { public string text; public Color color = Color.white; private void OnGUI() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) GUI.color = color; GUILayout.Label(text, Array.Empty()); GUI.color = Color.white; } } public class Hierarchy { public static bool HierarchyIsValid(Transform[] bones) { for (int i = 1; i < bones.Length; i++) { if (!IsAncestor(bones[i], bones[i - 1])) { return false; } } return true; } public static Object ContainsDuplicate(Object[] objects) { for (int i = 0; i < objects.Length; i++) { for (int j = 0; j < objects.Length; j++) { if (i != j && objects[i] == objects[j]) { return objects[i]; } } } return null; } public static bool IsAncestor(Transform transform, Transform ancestor) { if ((Object)(object)transform == (Object)null) { return true; } if ((Object)(object)ancestor == (Object)null) { return true; } if ((Object)(object)transform.parent == (Object)null) { return false; } if ((Object)(object)transform.parent == (Object)(object)ancestor) { return true; } return IsAncestor(transform.parent, ancestor); } public static bool ContainsChild(Transform transform, Transform child) { if ((Object)(object)transform == (Object)(object)child) { return true; } Transform[] componentsInChildren = ((Component)transform).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { if ((Object)(object)componentsInChildren[i] == (Object)(object)child) { return true; } } return false; } public static void AddAncestors(Transform transform, Transform blocker, ref Transform[] array) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)transform.parent != (Object)null && (Object)(object)transform.parent != (Object)(object)blocker) { if (transform.parent.position != transform.position && transform.parent.position != blocker.position) { Array.Resize(ref array, array.Length + 1); array[array.Length - 1] = transform.parent; } AddAncestors(transform.parent, blocker, ref array); } } public static Transform GetAncestor(Transform transform, int minChildCount) { if ((Object)(object)transform == (Object)null) { return null; } if ((Object)(object)transform.parent != (Object)null) { if (transform.parent.childCount >= minChildCount) { return transform.parent; } return GetAncestor(transform.parent, minChildCount); } return null; } public static Transform GetFirstCommonAncestor(Transform t1, Transform t2) { if ((Object)(object)t1 == (Object)null) { return null; } if ((Object)(object)t2 == (Object)null) { return null; } if ((Object)(object)t1.parent == (Object)null) { return null; } if ((Object)(object)t2.parent == (Object)null) { return null; } if (IsAncestor(t2, t1.parent)) { return t1.parent; } return GetFirstCommonAncestor(t1.parent, t2); } public static Transform GetFirstCommonAncestor(Transform[] transforms) { if (transforms == null) { Debug.LogWarning((object)"Transforms is null."); return null; } if (transforms.Length == 0) { Debug.LogWarning((object)"Transforms.Length is 0."); return null; } for (int i = 0; i < transforms.Length; i++) { if ((Object)(object)transforms[i] == (Object)null) { return null; } if (IsCommonAncestor(transforms[i], transforms)) { return transforms[i]; } } return GetFirstCommonAncestorRecursive(transforms[0], transforms); } public static Transform GetFirstCommonAncestorRecursive(Transform transform, Transform[] transforms) { if ((Object)(object)transform == (Object)null) { Debug.LogWarning((object)"Transform is null."); return null; } if (transforms == null) { Debug.LogWarning((object)"Transforms is null."); return null; } if (transforms.Length == 0) { Debug.LogWarning((object)"Transforms.Length is 0."); return null; } if (IsCommonAncestor(transform, transforms)) { return transform; } if ((Object)(object)transform.parent == (Object)null) { return null; } return GetFirstCommonAncestorRecursive(transform.parent, transforms); } public static bool IsCommonAncestor(Transform transform, Transform[] transforms) { if ((Object)(object)transform == (Object)null) { Debug.LogWarning((object)"Transform is null."); return false; } for (int i = 0; i < transforms.Length; i++) { if ((Object)(object)transforms[i] == (Object)null) { Debug.Log((object)("Transforms[" + i + "] is null.")); return false; } if (!IsAncestor(transforms[i], transform) && (Object)(object)transforms[i] != (Object)(object)transform) { return false; } } return true; } } public class InspectorComment : PropertyAttribute { public string name; public string color = "white"; public InspectorComment(string name) { this.name = name; color = "white"; } public InspectorComment(string name, string color) { this.name = name; this.color = color; } } [Serializable] public enum InterpolationMode { None, InOutCubic, InOutQuintic, InOutSine, InQuintic, InQuartic, InCubic, InQuadratic, InElastic, InElasticSmall, InElasticBig, InSine, InBack, OutQuintic, OutQuartic, OutCubic, OutInCubic, OutInQuartic, OutElastic, OutElasticSmall, OutElasticBig, OutSine, OutBack, OutBackCubic, OutBackQuartic, BackInCubic, BackInQuartic } public class Interp { public static float Float(float t, InterpolationMode mode) { float num = 0f; return mode switch { InterpolationMode.None => None(t, 0f, 1f), InterpolationMode.InOutCubic => InOutCubic(t, 0f, 1f), InterpolationMode.InOutQuintic => InOutQuintic(t, 0f, 1f), InterpolationMode.InQuintic => InQuintic(t, 0f, 1f), InterpolationMode.InQuartic => InQuartic(t, 0f, 1f), InterpolationMode.InCubic => InCubic(t, 0f, 1f), InterpolationMode.InQuadratic => InQuadratic(t, 0f, 1f), InterpolationMode.OutQuintic => OutQuintic(t, 0f, 1f), InterpolationMode.OutQuartic => OutQuartic(t, 0f, 1f), InterpolationMode.OutCubic => OutCubic(t, 0f, 1f), InterpolationMode.OutInCubic => OutInCubic(t, 0f, 1f), InterpolationMode.OutInQuartic => OutInCubic(t, 0f, 1f), InterpolationMode.BackInCubic => BackInCubic(t, 0f, 1f), InterpolationMode.BackInQuartic => BackInQuartic(t, 0f, 1f), InterpolationMode.OutBackCubic => OutBackCubic(t, 0f, 1f), InterpolationMode.OutBackQuartic => OutBackQuartic(t, 0f, 1f), InterpolationMode.OutElasticSmall => OutElasticSmall(t, 0f, 1f), InterpolationMode.OutElasticBig => OutElasticBig(t, 0f, 1f), InterpolationMode.InElasticSmall => InElasticSmall(t, 0f, 1f), InterpolationMode.InElasticBig => InElasticBig(t, 0f, 1f), InterpolationMode.InSine => InSine(t, 0f, 1f), InterpolationMode.OutSine => OutSine(t, 0f, 1f), InterpolationMode.InOutSine => InOutSine(t, 0f, 1f), InterpolationMode.InElastic => OutElastic(t, 0f, 1f), InterpolationMode.OutElastic => OutElastic(t, 0f, 1f), InterpolationMode.InBack => InBack(t, 0f, 1f), InterpolationMode.OutBack => OutBack(t, 0f, 1f), _ => 0f, }; } public static Vector3 V3(Vector3 v1, Vector3 v2, float t, InterpolationMode mode) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) float num = Float(t, mode); return (1f - num) * v1 + num * v2; } public static float LerpValue(float value, float target, float increaseSpeed, float decreaseSpeed) { if (value == target) { return target; } if (value < target) { return Mathf.Clamp(value + Time.deltaTime * increaseSpeed, float.NegativeInfinity, target); } return Mathf.Clamp(value - Time.deltaTime * decreaseSpeed, target, float.PositiveInfinity); } private static float None(float t, float b, float c) { return b + c * t; } private static float InOutCubic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (-2f * num2 + 3f * num); } private static float InOutQuintic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (6f * num2 * num + -15f * num * num + 10f * num2); } private static float InQuintic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (num2 * num); } private static float InQuartic(float t, float b, float c) { float num = t * t; return b + c * (num * num); } private static float InCubic(float t, float b, float c) { float num = t * t * t; return b + c * num; } private static float InQuadratic(float t, float b, float c) { float num = t * t; return b + c * num; } private static float OutQuintic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (num2 * num + -5f * num * num + 10f * num2 + -10f * num + 5f * t); } private static float OutQuartic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (-1f * num * num + 4f * num2 + -6f * num + 4f * t); } private static float OutCubic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (num2 + -3f * num + 3f * t); } private static float OutInCubic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (4f * num2 + -6f * num + 3f * t); } private static float OutInQuartic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (6f * num2 + -9f * num + 4f * t); } private static float BackInCubic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (4f * num2 + -3f * num); } private static float BackInQuartic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (2f * num * num + 2f * num2 + -3f * num); } private static float OutBackCubic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (4f * num2 + -9f * num + 6f * t); } private static float OutBackQuartic(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (-2f * num * num + 10f * num2 + -15f * num + 8f * t); } private static float OutElasticSmall(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (33f * num2 * num + -106f * num * num + 126f * num2 + -67f * num + 15f * t); } private static float OutElasticBig(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (56f * num2 * num + -175f * num * num + 200f * num2 + -100f * num + 20f * t); } private static float InElasticSmall(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (33f * num2 * num + -59f * num * num + 32f * num2 + -5f * num); } private static float InElasticBig(float t, float b, float c) { float num = t * t; float num2 = num * t; return b + c * (56f * num2 * num + -105f * num * num + 60f * num2 + -10f * num); } private static float InSine(float t, float b, float c) { c -= b; return (0f - c) * Mathf.Cos(t / 1f * (MathF.PI / 2f)) + c + b; } private static float OutSine(float t, float b, float c) { c -= b; return c * Mathf.Sin(t / 1f * (MathF.PI / 2f)) + b; } private static float InOutSine(float t, float b, float c) { c -= b; return (0f - c) / 2f * (Mathf.Cos(MathF.PI * t / 1f) - 1f) + b; } private static float InElastic(float t, float b, float c) { c -= b; float num = 1f; float num2 = num * 0.3f; float num3 = 0f; float num4 = 0f; if (t == 0f) { return b; } if ((t /= num) == 1f) { return b + c; } if (num4 == 0f || num4 < Mathf.Abs(c)) { num4 = c; num3 = num2 / 4f; } else { num3 = num2 / (MathF.PI * 2f) * Mathf.Asin(c / num4); } return 0f - num4 * Mathf.Pow(2f, 10f * (t -= 1f)) * Mathf.Sin((t * num - num3) * (MathF.PI * 2f) / num2) + b; } private static float OutElastic(float t, float b, float c) { c -= b; float num = 1f; float num2 = num * 0.3f; float num3 = 0f; float num4 = 0f; if (t == 0f) { return b; } if ((t /= num) == 1f) { return b + c; } if (num4 == 0f || num4 < Mathf.Abs(c)) { num4 = c; num3 = num2 / 4f; } else { num3 = num2 / (MathF.PI * 2f) * Mathf.Asin(c / num4); } return num4 * Mathf.Pow(2f, -10f * t) * Mathf.Sin((t * num - num3) * (MathF.PI * 2f) / num2) + c + b; } private static float InBack(float t, float b, float c) { c -= b; t /= 1f; float num = 1.70158f; return c * t * t * ((num + 1f) * t - num) + b; } private static float OutBack(float t, float b, float c) { float num = 1.70158f; c -= b; t = t / 1f - 1f; return c * (t * t * ((num + 1f) * t + num) + 1f) + b; } } public class LargeHeader : PropertyAttribute { public string name; public string color = "white"; public LargeHeader(string name) { this.name = name; color = "white"; } public LargeHeader(string name, string color) { this.name = name; this.color = color; } } public static class LayerMaskExtensions { public static bool Contains(LayerMask mask, int layer) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return LayerMask.op_Implicit(mask) == (LayerMask.op_Implicit(mask) | (1 << layer)); } public static LayerMask Create(params string[] layerNames) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return NamesToMask(layerNames); } public static LayerMask Create(params int[] layerNumbers) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return LayerNumbersToMask(layerNumbers); } public static LayerMask NamesToMask(params string[] layerNames) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) LayerMask val = LayerMask.op_Implicit(0); foreach (string text in layerNames) { val = LayerMask.op_Implicit(LayerMask.op_Implicit(val) | (1 << LayerMask.NameToLayer(text))); } return val; } public static LayerMask LayerNumbersToMask(params int[] layerNumbers) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) LayerMask val = LayerMask.op_Implicit(0); foreach (int num in layerNumbers) { val = LayerMask.op_Implicit(LayerMask.op_Implicit(val) | (1 << num)); } return val; } public static LayerMask Inverse(this LayerMask original) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return LayerMask.op_Implicit(~LayerMask.op_Implicit(original)); } public static LayerMask AddToMask(this LayerMask original, params string[] layerNames) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return LayerMask.op_Implicit(LayerMask.op_Implicit(original) | LayerMask.op_Implicit(NamesToMask(layerNames))); } public static LayerMask RemoveFromMask(this LayerMask original, params string[] layerNames) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) return LayerMask.op_Implicit(~(LayerMask.op_Implicit(LayerMask.op_Implicit(~LayerMask.op_Implicit(original))) | LayerMask.op_Implicit(NamesToMask(layerNames)))); } public static string[] MaskToNames(this LayerMask original) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i < 32; i++) { int num = 1 << i; if ((LayerMask.op_Implicit(original) & num) == num) { string text = LayerMask.LayerToName(i); if (!string.IsNullOrEmpty(text)) { list.Add(text); } } } return list.ToArray(); } public static int[] MaskToNumbers(this LayerMask original) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i < 32; i++) { int num = 1 << i; if ((LayerMask.op_Implicit(original) & num) == num) { list.Add(i); } } return list.ToArray(); } public static string MaskToString(this LayerMask original) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return original.MaskToString(", "); } public static string MaskToString(this LayerMask original, string delimiter) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return string.Join(delimiter, original.MaskToNames()); } } public static class QuaTools { public static float GetYaw(Quaternion space, Vector3 forward) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Quaternion.Inverse(space) * forward; return Mathf.Atan2(val.x, val.z) * 57.29578f; } public static float GetPitch(Quaternion space, Vector3 forward) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) forward = ((Vector3)(ref forward)).normalized; return (0f - Mathf.Asin((Quaternion.Inverse(space) * forward).y)) * 57.29578f; } public static float GetBank(Quaternion space, Vector3 forward, Vector3 up) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = space * Vector3.up; Quaternion val2 = Quaternion.Inverse(space); forward = val2 * forward; up = val2 * up; up = Quaternion.Inverse(Quaternion.LookRotation(val, forward)) * up; return Mathf.Atan2(up.x, up.z) * 57.29578f; } public static float GetYaw(Quaternion space, Quaternion rotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Quaternion.Inverse(space) * (rotation * Vector3.forward); return Mathf.Atan2(val.x, val.z) * 57.29578f; } public static float GetPitch(Quaternion space, Quaternion rotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) return (0f - Mathf.Asin((Quaternion.Inverse(space) * (rotation * Vector3.forward)).y)) * 57.29578f; } public static float GetBank(Quaternion space, Quaternion rotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = space * Vector3.up; Quaternion val2 = Quaternion.Inverse(space); Vector3 val3 = val2 * (rotation * Vector3.forward); Vector3 val4 = val2 * (rotation * Vector3.up); val4 = Quaternion.Inverse(Quaternion.LookRotation(val, val3)) * val4; return Mathf.Atan2(val4.x, val4.z) * 57.29578f; } public static Quaternion Lerp(Quaternion fromRotation, Quaternion toRotation, float weight) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return fromRotation; } if (weight >= 1f) { return toRotation; } return Quaternion.Lerp(fromRotation, toRotation, weight); } public static Quaternion Slerp(Quaternion fromRotation, Quaternion toRotation, float weight) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return fromRotation; } if (weight >= 1f) { return toRotation; } return Quaternion.Slerp(fromRotation, toRotation, weight); } public static Quaternion LinearBlend(Quaternion q, float weight) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return Quaternion.identity; } if (weight >= 1f) { return q; } return Quaternion.Lerp(Quaternion.identity, q, weight); } public static Quaternion SphericalBlend(Quaternion q, float weight) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return Quaternion.identity; } if (weight >= 1f) { return q; } return Quaternion.Slerp(Quaternion.identity, q, weight); } public static Quaternion FromToAroundAxis(Vector3 fromDirection, Vector3 toDirection, Vector3 axis) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.FromToRotation(fromDirection, toDirection); float num = 0f; Vector3 zero = Vector3.zero; ((Quaternion)(ref val)).ToAngleAxis(ref num, ref zero); if (Vector3.Dot(zero, axis) < 0f) { num = 0f - num; } return Quaternion.AngleAxis(num, axis); } public static Quaternion RotationToLocalSpace(Quaternion space, Quaternion rotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return Quaternion.Inverse(Quaternion.Inverse(space) * rotation); } public static Quaternion FromToRotation(Quaternion from, Quaternion to) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (to == from) { return Quaternion.identity; } return to * Quaternion.Inverse(from); } public static Vector3 GetAxis(Vector3 v) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.right; bool flag = false; float num = Vector3.Dot(v, Vector3.right); float num2 = Mathf.Abs(num); if (num < 0f) { flag = true; } float num3 = Vector3.Dot(v, Vector3.up); float num4 = Mathf.Abs(num3); if (num4 > num2) { num2 = num4; val = Vector3.up; flag = num3 < 0f; } float num5 = Vector3.Dot(v, Vector3.forward); num4 = Mathf.Abs(num5); if (num4 > num2) { val = Vector3.forward; flag = num5 < 0f; } if (flag) { val = -val; } return val; } public static Quaternion ClampRotation(Quaternion rotation, float clampWeight, int clampSmoothing) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) if (clampWeight >= 1f) { return Quaternion.identity; } if (clampWeight <= 0f) { return rotation; } float num = Quaternion.Angle(Quaternion.identity, rotation); float num2 = 1f - num / 180f; float num3 = Mathf.Clamp(1f - (clampWeight - num2) / (1f - num2), 0f, 1f); float num4 = Mathf.Clamp(num2 / clampWeight, 0f, 1f); for (int i = 0; i < clampSmoothing; i++) { num4 = Mathf.Sin(num4 * MathF.PI * 0.5f); } return Quaternion.Slerp(Quaternion.identity, rotation, num4 * num3); } public static float ClampAngle(float angle, float clampWeight, int clampSmoothing) { if (clampWeight >= 1f) { return 0f; } if (clampWeight <= 0f) { return angle; } float num = 1f - Mathf.Abs(angle) / 180f; float num2 = Mathf.Clamp(1f - (clampWeight - num) / (1f - num), 0f, 1f); float num3 = Mathf.Clamp(num / clampWeight, 0f, 1f); for (int i = 0; i < clampSmoothing; i++) { num3 = Mathf.Sin(num3 * MathF.PI * 0.5f); } return Mathf.Lerp(0f, angle, num3 * num2); } public static Quaternion MatchRotation(Quaternion targetRotation, Vector3 targetforwardAxis, Vector3 targetUpAxis, Vector3 forwardAxis, Vector3 upAxis) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.LookRotation(forwardAxis, upAxis); Quaternion val2 = Quaternion.LookRotation(targetforwardAxis, targetUpAxis); return targetRotation * val2 * Quaternion.Inverse(val); } public static Vector3 ToBiPolar(Vector3 euler) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) return new Vector3(ToBiPolar(euler.x), ToBiPolar(euler.y), ToBiPolar(euler.z)); } public static float ToBiPolar(float angle) { angle %= 360f; if (angle >= 180f) { return angle - 360f; } if (angle <= -180f) { return angle + 360f; } return angle; } } public abstract class Singleton : MonoBehaviour where T : Singleton { private static T sInstance; public static T instance => sInstance; protected virtual void Awake() { if ((Object)(object)sInstance != (Object)null) { Debug.LogError((object)(((Object)this).name + "error: already initialized"), (Object)(object)this); } sInstance = (T)this; } } public class SolverManager : MonoBehaviour { [Tooltip("If true, will fix all the Transforms used by the solver to their initial state in each Update. This prevents potential problems with unanimated bones and animator culling with a small cost of performance. Not recommended for CCD and FABRIK solvers.")] public bool fixTransforms = true; private Animator animator; private Animation legacy; private bool updateFrame; private bool componentInitiated; private bool skipSolverUpdate; private bool animatePhysics { get { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if ((Object)(object)animator != (Object)null) { return (int)animator.updateMode == 1; } if ((Object)(object)legacy != (Object)null) { return legacy.animatePhysics; } return false; } } private bool isAnimated { get { if (!((Object)(object)animator != (Object)null)) { return (Object)(object)legacy != (Object)null; } return true; } } public void Disable() { Debug.Log((object)"IK.Disable() is deprecated. Use enabled = false instead", (Object)(object)((Component)this).transform); ((Behaviour)this).enabled = false; } protected virtual void InitiateSolver() { } protected virtual void UpdateSolver() { } protected virtual void FixTransforms() { } private void OnDisable() { if (Application.isPlaying) { Initiate(); } } private void Start() { Initiate(); } private void Initiate() { if (!componentInitiated) { FindAnimatorRecursive(((Component)this).transform, findInChildren: true); InitiateSolver(); componentInitiated = true; } } private void Update() { if (!skipSolverUpdate && !animatePhysics && fixTransforms) { FixTransforms(); } } private void FindAnimatorRecursive(Transform t, bool findInChildren) { if (isAnimated) { return; } animator = ((Component)t).GetComponent(); legacy = ((Component)t).GetComponent(); if (!isAnimated) { if ((Object)(object)animator == (Object)null && findInChildren) { animator = ((Component)t).GetComponentInChildren(); } if ((Object)(object)legacy == (Object)null && findInChildren) { legacy = ((Component)t).GetComponentInChildren(); } if (!isAnimated && (Object)(object)t.parent != (Object)null) { FindAnimatorRecursive(t.parent, findInChildren: false); } } } private void FixedUpdate() { if (skipSolverUpdate) { skipSolverUpdate = false; } updateFrame = true; if (animatePhysics && fixTransforms) { FixTransforms(); } } private void LateUpdate() { if (!skipSolverUpdate) { if (!animatePhysics) { updateFrame = true; } if (updateFrame) { updateFrame = false; UpdateSolver(); } } } public void UpdateSolverExternal() { if (((Behaviour)this).enabled) { skipSolverUpdate = true; UpdateSolver(); } } } public class TriggerEventBroadcaster : MonoBehaviour { public GameObject target; private void OnTriggerEnter(Collider collider) { if ((Object)(object)target != (Object)null) { target.SendMessage("OnTriggerEnter", (object)collider, (SendMessageOptions)1); } } private void OnTriggerStay(Collider collider) { if ((Object)(object)target != (Object)null) { target.SendMessage("OnTriggerStay", (object)collider, (SendMessageOptions)1); } } private void OnTriggerExit(Collider collider) { if ((Object)(object)target != (Object)null) { target.SendMessage("OnTriggerExit", (object)collider, (SendMessageOptions)1); } } } public static class V2Tools { public static Vector2 XZ(Vector3 v) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return new Vector2(v.x, v.z); } public static float DeltaAngle(Vector2 dir1, Vector2 dir2) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Atan2(dir1.x, dir1.y) * 57.29578f; float num2 = Mathf.Atan2(dir2.x, dir2.y) * 57.29578f; return Mathf.DeltaAngle(num, num2); } public static float DeltaAngleXZ(Vector3 dir1, Vector3 dir2) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Atan2(dir1.x, dir1.z) * 57.29578f; float num2 = Mathf.Atan2(dir2.x, dir2.z) * 57.29578f; return Mathf.DeltaAngle(num, num2); } public static bool LineCircleIntersect(Vector2 p1, Vector2 p2, Vector2 c, float r) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) Vector2 val = p2 - p1; Vector2 val2 = c - p1; float num = Vector2.Dot(val, val); float num2 = 2f * Vector2.Dot(val2, val); float num3 = Vector2.Dot(val2, val2) - r * r; float num4 = num2 * num2 - 4f * num * num3; if (num4 < 0f) { return false; } num4 = Mathf.Sqrt(num4); float num5 = 2f * num; float num6 = (num2 - num4) / num5; float num7 = (num2 + num4) / num5; if (num6 >= 0f && num6 <= 1f) { return true; } if (num7 >= 0f && num7 <= 1f) { return true; } return false; } public static bool RayCircleIntersect(Vector2 p1, Vector2 dir, Vector2 c, float r) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) Vector2 val = p1 + dir; p1 -= c; val -= c; float num = val.x - p1.x; float num2 = val.y - p1.y; float num3 = Mathf.Sqrt(Mathf.Pow(num, 2f) + Mathf.Pow(num2, 2f)); float num4 = p1.x * val.y - val.x * p1.y; return Mathf.Pow(r, 2f) * Mathf.Pow(num3, 2f) - Mathf.Pow(num4, 2f) >= 0f; } } public static class V3Tools { public static float GetYaw(Vector3 forward) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return Mathf.Atan2(forward.x, forward.z) * 57.29578f; } public static float GetPitch(Vector3 forward) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) forward = ((Vector3)(ref forward)).normalized; return (0f - Mathf.Asin(forward.y)) * 57.29578f; } public static float GetBank(Vector3 forward, Vector3 up) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) up = Quaternion.Inverse(Quaternion.LookRotation(Vector3.up, forward)) * up; return Mathf.Atan2(up.x, up.z) * 57.29578f; } public static float GetYaw(Vector3 spaceForward, Vector3 spaceUp, Vector3 forward) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Quaternion.Inverse(Quaternion.LookRotation(spaceForward, spaceUp)) * forward; return Mathf.Atan2(val.x, val.z) * 57.29578f; } public static float GetPitch(Vector3 spaceForward, Vector3 spaceUp, Vector3 forward) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return (0f - Mathf.Asin((Quaternion.Inverse(Quaternion.LookRotation(spaceForward, spaceUp)) * forward).y)) * 57.29578f; } public static float GetBank(Vector3 spaceForward, Vector3 spaceUp, Vector3 forward, Vector3 up) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.Inverse(Quaternion.LookRotation(spaceForward, spaceUp)); forward = val * forward; up = val * up; up = Quaternion.Inverse(Quaternion.LookRotation(spaceUp, forward)) * up; return Mathf.Atan2(up.x, up.z) * 57.29578f; } public static Vector3 Lerp(Vector3 fromVector, Vector3 toVector, float weight) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return fromVector; } if (weight >= 1f) { return toVector; } return Vector3.Lerp(fromVector, toVector, weight); } public static Vector3 Slerp(Vector3 fromVector, Vector3 toVector, float weight) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return fromVector; } if (weight >= 1f) { return toVector; } return Vector3.Slerp(fromVector, toVector, weight); } public static Vector3 ExtractVertical(Vector3 v, Vector3 verticalAxis, float weight) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (weight == 0f) { return Vector3.zero; } return Vector3.Project(v, verticalAxis) * weight; } public static Vector3 ExtractHorizontal(Vector3 v, Vector3 normal, float weight) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (weight == 0f) { return Vector3.zero; } Vector3 val = v; Vector3.OrthoNormalize(ref normal, ref val); return Vector3.Project(v, val) * weight; } public static Vector3 ClampDirection(Vector3 direction, Vector3 normalDirection, float clampWeight, int clampSmoothing) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) if (clampWeight <= 0f) { return direction; } if (clampWeight >= 1f) { return normalDirection; } float num = Vector3.Angle(normalDirection, direction); float num2 = 1f - num / 180f; if (num2 > clampWeight) { return direction; } float num3 = ((clampWeight > 0f) ? Mathf.Clamp(1f - (clampWeight - num2) / (1f - num2), 0f, 1f) : 1f); float num4 = ((clampWeight > 0f) ? Mathf.Clamp(num2 / clampWeight, 0f, 1f) : 1f); for (int i = 0; i < clampSmoothing; i++) { num4 = Mathf.Sin(num4 * MathF.PI * 0.5f); } return Vector3.Slerp(normalDirection, direction, num4 * num3); } public static Vector3 ClampDirection(Vector3 direction, Vector3 normalDirection, float clampWeight, int clampSmoothing, out bool changed) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) changed = false; if (clampWeight <= 0f) { return direction; } if (clampWeight >= 1f) { changed = true; return normalDirection; } float num = Vector3.Angle(normalDirection, direction); float num2 = 1f - num / 180f; if (num2 > clampWeight) { return direction; } changed = true; float num3 = ((clampWeight > 0f) ? Mathf.Clamp(1f - (clampWeight - num2) / (1f - num2), 0f, 1f) : 1f); float num4 = ((clampWeight > 0f) ? Mathf.Clamp(num2 / clampWeight, 0f, 1f) : 1f); for (int i = 0; i < clampSmoothing; i++) { num4 = Mathf.Sin(num4 * MathF.PI * 0.5f); } return Vector3.Slerp(normalDirection, direction, num4 * num3); } public static Vector3 ClampDirection(Vector3 direction, Vector3 normalDirection, float clampWeight, int clampSmoothing, out float clampValue) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) clampValue = 1f; if (clampWeight <= 0f) { return direction; } if (clampWeight >= 1f) { return normalDirection; } float num = Vector3.Angle(normalDirection, direction); float num2 = 1f - num / 180f; if (num2 > clampWeight) { clampValue = 0f; return direction; } float num3 = ((clampWeight > 0f) ? Mathf.Clamp(1f - (clampWeight - num2) / (1f - num2), 0f, 1f) : 1f); float num4 = ((clampWeight > 0f) ? Mathf.Clamp(num2 / clampWeight, 0f, 1f) : 1f); for (int i = 0; i < clampSmoothing; i++) { num4 = Mathf.Sin(num4 * MathF.PI * 0.5f); } float num5 = num4 * num3; clampValue = 1f - num5; return Vector3.Slerp(normalDirection, direction, num5); } public static Vector3 LineToPlane(Vector3 origin, Vector3 direction, Vector3 planeNormal, Vector3 planePoint) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Dot(planePoint - origin, planeNormal); float num2 = Vector3.Dot(direction, planeNormal); if (num2 == 0f) { return Vector3.zero; } float num3 = num / num2; return origin + ((Vector3)(ref direction)).normalized * num3; } public static Vector3 PointToPlane(Vector3 point, Vector3 planePosition, Vector3 planeNormal) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (planeNormal == Vector3.up) { return new Vector3(point.x, planePosition.y, point.z); } Vector3 val = point - planePosition; Vector3 val2 = planeNormal; Vector3.OrthoNormalize(ref val2, ref val); return planePosition + Vector3.Project(point - planePosition, val); } public static Vector3 TransformPointUnscaled(Transform t, Vector3 point) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return t.position + t.rotation * point; } public static Vector3 InverseTransformPointUnscaled(Transform t, Vector3 point) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) return Quaternion.Inverse(t.rotation) * (point - t.position); } public static Vector3 InverseTransformPoint(Vector3 tPos, Quaternion tRot, Vector3 tScale, Vector3 point) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return Div(Quaternion.Inverse(tRot) * (point - tPos), tScale); } public static Vector3 TransformPoint(Vector3 tPos, Quaternion tRot, Vector3 tScale, Vector3 point) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return tPos + Vector3.Scale(tRot * point, tScale); } public static Vector3 Div(Vector3 v1, Vector3 v2) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) return new Vector3(v1.x / v2.x, v1.y / v2.y, v1.z / v2.z); } } public static class Warning { public delegate void Logger(string message); public static bool logged; public static void Log(string message, Logger logger, bool logInEditMode = false) { if ((logInEditMode || Application.isPlaying) && !logged) { logger?.Invoke(message); logged = true; } } public static void Log(string message, Transform context, bool logInEditMode = false) { if ((logInEditMode || Application.isPlaying) && !logged) { Debug.LogWarning((object)message, (Object)(object)context); logged = true; } } } } namespace RootMotion.Demos { [Serializable] public class Navigator { public enum State { Idle, Seeking, OnPath } [Tooltip("Should this Navigator be actively seeking a path.")] public bool activeTargetSeeking; [Tooltip("Increase this value if the character starts running in a circle, not able to reach the corner because of a too large turning radius.")] public float cornerRadius = 0.5f; [Tooltip("Recalculate path if target position has moved by this distance from the position it was at when the path was originally calculated")] public float recalculateOnPathDistance = 1f; [Tooltip("Sample within this distance from sourcePosition.")] public float maxSampleDistance = 5f; [Tooltip("Interval of updating the path")] public float nextPathInterval = 3f; private Transform transform; private int cornerIndex; private Vector3[] corners = (Vector3[])(object)new Vector3[0]; private NavMeshPath path; private Vector3 lastTargetPosition; private bool initiated; private float nextPathTime; public Vector3 normalizedDeltaPosition { get; private set; } public State state { get; private set; } public void Initiate(Transform transform) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) this.transform = transform; path = new NavMeshPath(); initiated = true; cornerIndex = 0; corners = (Vector3[])(object)new Vector3[0]; state = State.Idle; lastTargetPosition = new Vector3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity); } public void Update(Vector3 targetPosition) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Invalid comparison between Unknown and I4 //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Invalid comparison between Unknown and I4 //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { Debug.LogError((object)"Trying to update an uninitiated Navigator."); return; } switch (state) { case State.Seeking: normalizedDeltaPosition = Vector3.zero; if ((int)path.status == 0) { corners = path.corners; cornerIndex = 0; if (corners.Length == 0) { Debug.LogWarning((object)"Zero Corner Path", (Object)(object)transform); Stop(); } else { state = State.OnPath; } } if ((int)path.status == 1) { Debug.LogWarning((object)"Path Partial", (Object)(object)transform); } if ((int)path.status == 2) { Debug.LogWarning((object)"Path Invalid", (Object)(object)transform); } break; case State.OnPath: if (activeTargetSeeking && Time.time > nextPathTime && HorDistance(targetPosition, lastTargetPosition) > recalculateOnPathDistance) { CalculatePath(targetPosition); } else { if (cornerIndex >= corners.Length) { break; } Vector3 val = corners[cornerIndex] - transform.position; val.y = 0f; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude > 0f) { normalizedDeltaPosition = val / ((Vector3)(ref val)).magnitude; } else { normalizedDeltaPosition = Vector3.zero; } if (magnitude < cornerRadius) { cornerIndex++; if (cornerIndex >= corners.Length) { Stop(); } } } break; case State.Idle: if (activeTargetSeeking && Time.time > nextPathTime) { CalculatePath(targetPosition); } break; } } private void CalculatePath(Vector3 targetPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (Find(targetPosition)) { lastTargetPosition = targetPosition; state = State.Seeking; } else { Stop(); } nextPathTime = Time.time + nextPathInterval; } private bool Find(Vector3 targetPosition) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (HorDistance(transform.position, targetPosition) < cornerRadius * 2f) { return false; } if (NavMesh.CalculatePath(transform.position, targetPosition, -1, path)) { return true; } NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(targetPosition, ref val, maxSampleDistance, -1) && NavMesh.CalculatePath(transform.position, ((NavMeshHit)(ref val)).position, -1, path)) { return true; } return false; } private void Stop() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) state = State.Idle; normalizedDeltaPosition = Vector3.zero; } private float HorDistance(Vector3 p1, Vector3 p2) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) return Vector2.Distance(new Vector2(p1.x, p1.z), new Vector2(p2.x, p2.z)); } public void Visualize() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) if (state == State.Idle) { Gizmos.color = Color.gray; } if (state == State.Seeking) { Gizmos.color = Color.red; } if (state == State.OnPath) { Gizmos.color = Color.green; } if (corners.Length != 0 && state == State.OnPath && cornerIndex == 0) { Gizmos.DrawLine(transform.position, corners[0]); } for (int i = 0; i < corners.Length; i++) { Gizmos.DrawSphere(corners[i], 0.1f); } if (corners.Length > 1) { for (int j = 0; j < corners.Length - 1; j++) { Gizmos.DrawLine(corners[j], corners[j + 1]); } } Gizmos.color = Color.white; } } } namespace RootMotion.FinalIK { [HelpURL("http://www.root-motion.com/finalikdox/html/page4.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Biped IK")] public class BipedIK : SolverManager { public BipedReferences references = new BipedReferences(); public BipedIKSolvers solvers = new BipedIKSolvers(); [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page4.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_biped_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public float GetIKPositionWeight(AvatarIKGoal goal) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return GetGoalIK(goal).GetIKPositionWeight(); } public float GetIKRotationWeight(AvatarIKGoal goal) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return GetGoalIK(goal).GetIKRotationWeight(); } public void SetIKPositionWeight(AvatarIKGoal goal, float weight) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) GetGoalIK(goal).SetIKPositionWeight(weight); } public void SetIKRotationWeight(AvatarIKGoal goal, float weight) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) GetGoalIK(goal).SetIKRotationWeight(weight); } public void SetIKPosition(AvatarIKGoal goal, Vector3 IKPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) GetGoalIK(goal).SetIKPosition(IKPosition); } public void SetIKRotation(AvatarIKGoal goal, Quaternion IKRotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) GetGoalIK(goal).SetIKRotation(IKRotation); } public Vector3 GetIKPosition(AvatarIKGoal goal) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return GetGoalIK(goal).GetIKPosition(); } public Quaternion GetIKRotation(AvatarIKGoal goal) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return GetGoalIK(goal).GetIKRotation(); } public void SetLookAtWeight(float weight, float bodyWeight, float headWeight, float eyesWeight, float clampWeight, float clampWeightHead, float clampWeightEyes) { solvers.lookAt.SetLookAtWeight(weight, bodyWeight, headWeight, eyesWeight, clampWeight, clampWeightHead, clampWeightEyes); } public void SetLookAtPosition(Vector3 lookAtPosition) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) solvers.lookAt.SetIKPosition(lookAtPosition); } public void SetSpinePosition(Vector3 spinePosition) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) solvers.spine.SetIKPosition(spinePosition); } public void SetSpineWeight(float weight) { solvers.spine.SetIKPositionWeight(weight); } public IKSolverLimb GetGoalIK(AvatarIKGoal goal) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected I4, but got Unknown return (int)goal switch { 0 => solvers.leftFoot, 1 => solvers.rightFoot, 2 => solvers.leftHand, 3 => solvers.rightHand, _ => null, }; } public void InitiateBipedIK() { InitiateSolver(); } public void UpdateBipedIK() { UpdateSolver(); } public void SetToDefaults() { IKSolverLimb[] limbs = solvers.limbs; foreach (IKSolverLimb obj in limbs) { obj.SetIKPositionWeight(0f); obj.SetIKRotationWeight(0f); obj.bendModifier = IKSolverLimb.BendModifier.Animation; obj.bendModifierWeight = 1f; } solvers.leftHand.maintainRotationWeight = 0f; solvers.rightHand.maintainRotationWeight = 0f; solvers.spine.SetIKPositionWeight(0f); solvers.spine.tolerance = 0f; solvers.spine.maxIterations = 2; solvers.spine.useRotationLimits = false; solvers.aim.SetIKPositionWeight(0f); solvers.aim.tolerance = 0f; solvers.aim.maxIterations = 2; SetLookAtWeight(0f, 0.5f, 1f, 1f, 0.5f, 0.7f, 0.5f); } protected override void FixTransforms() { solvers.lookAt.FixTransforms(); for (int i = 0; i < solvers.limbs.Length; i++) { solvers.limbs[i].FixTransforms(); } } protected override void InitiateSolver() { string errorMessage = ""; if (BipedReferences.SetupError(references, ref errorMessage)) { Warning.Log(errorMessage, references.root); return; } solvers.AssignReferences(references); if (solvers.spine.bones.Length > 1) { solvers.spine.Initiate(((Component)this).transform); } solvers.lookAt.Initiate(((Component)this).transform); solvers.aim.Initiate(((Component)this).transform); IKSolverLimb[] limbs = solvers.limbs; for (int i = 0; i < limbs.Length; i++) { limbs[i].Initiate(((Component)this).transform); } solvers.pelvis.Initiate(references.pelvis); } protected override void UpdateSolver() { for (int i = 0; i < solvers.limbs.Length; i++) { solvers.limbs[i].MaintainBend(); solvers.limbs[i].MaintainRotation(); } solvers.pelvis.Update(); if (solvers.spine.bones.Length > 1) { solvers.spine.Update(); } solvers.aim.Update(); solvers.lookAt.Update(); for (int j = 0; j < solvers.limbs.Length; j++) { solvers.limbs[j].Update(); } } public void LogWarning(string message) { Warning.Log(message, ((Component)this).transform); } } [Serializable] public class BipedIKSolvers { public IKSolverLimb leftFoot = new IKSolverLimb((AvatarIKGoal)0); public IKSolverLimb rightFoot = new IKSolverLimb((AvatarIKGoal)1); public IKSolverLimb leftHand = new IKSolverLimb((AvatarIKGoal)2); public IKSolverLimb rightHand = new IKSolverLimb((AvatarIKGoal)3); public IKSolverFABRIK spine = new IKSolverFABRIK(); public IKSolverLookAt lookAt = new IKSolverLookAt(); public IKSolverAim aim = new IKSolverAim(); public Constraints pelvis = new Constraints(); private IKSolverLimb[] _limbs; private IKSolver[] _ikSolvers; public IKSolverLimb[] limbs { get { if (_limbs == null || (_limbs != null && _limbs.Length != 4)) { _limbs = new IKSolverLimb[4] { leftFoot, rightFoot, leftHand, rightHand }; } return _limbs; } } public IKSolver[] ikSolvers { get { if (_ikSolvers == null || (_ikSolvers != null && _ikSolvers.Length != 7)) { _ikSolvers = new IKSolver[7] { leftFoot, rightFoot, leftHand, rightHand, spine, lookAt, aim }; } return _ikSolvers; } } public void AssignReferences(BipedReferences references) { //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) leftHand.SetChain(references.leftUpperArm, references.leftForearm, references.leftHand, references.root); rightHand.SetChain(references.rightUpperArm, references.rightForearm, references.rightHand, references.root); leftFoot.SetChain(references.leftThigh, references.leftCalf, references.leftFoot, references.root); rightFoot.SetChain(references.rightThigh, references.rightCalf, references.rightFoot, references.root); spine.SetChain(references.spine, references.root); lookAt.SetChain(references.spine, references.head, references.eyes, references.root); aim.SetChain(references.spine, references.root); leftFoot.goal = (AvatarIKGoal)0; rightFoot.goal = (AvatarIKGoal)1; leftHand.goal = (AvatarIKGoal)2; rightHand.goal = (AvatarIKGoal)3; } } [Serializable] public abstract class Constraint { public Transform transform; public float weight; public bool isValid => (Object)(object)transform != (Object)null; public abstract void UpdateConstraint(); } [Serializable] public class ConstraintPosition : Constraint { public Vector3 position; public override void UpdateConstraint() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f) && base.isValid) { transform.position = Vector3.Lerp(transform.position, position, weight); } } public ConstraintPosition() { } public ConstraintPosition(Transform transform) { base.transform = transform; } } [Serializable] public class ConstraintPositionOffset : Constraint { public Vector3 offset; private Vector3 defaultLocalPosition; private Vector3 lastLocalPosition; private bool initiated; private bool positionChanged => transform.localPosition != lastLocalPosition; public override void UpdateConstraint() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f) && base.isValid) { if (!initiated) { defaultLocalPosition = transform.localPosition; lastLocalPosition = transform.localPosition; initiated = true; } if (positionChanged) { defaultLocalPosition = transform.localPosition; } transform.localPosition = defaultLocalPosition; Transform obj = transform; obj.position += offset * weight; lastLocalPosition = transform.localPosition; } } public ConstraintPositionOffset() { } public ConstraintPositionOffset(Transform transform) { base.transform = transform; } } [Serializable] public class ConstraintRotation : Constraint { public Quaternion rotation; public override void UpdateConstraint() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f) && base.isValid) { transform.rotation = Quaternion.Slerp(transform.rotation, rotation, weight); } } public ConstraintRotation() { } public ConstraintRotation(Transform transform) { base.transform = transform; } } [Serializable] public class ConstraintRotationOffset : Constraint { public Quaternion offset; private Quaternion defaultRotation; private Quaternion defaultLocalRotation; private Quaternion lastLocalRotation; private Quaternion defaultTargetLocalRotation; private bool initiated; private bool rotationChanged => transform.localRotation != lastLocalRotation; public override void UpdateConstraint() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f) && base.isValid) { if (!initiated) { defaultLocalRotation = transform.localRotation; lastLocalRotation = transform.localRotation; initiated = true; } if (rotationChanged) { defaultLocalRotation = transform.localRotation; } transform.localRotation = defaultLocalRotation; transform.rotation = Quaternion.Slerp(transform.rotation, offset, weight); lastLocalRotation = transform.localRotation; } } public ConstraintRotationOffset() { } public ConstraintRotationOffset(Transform transform) { base.transform = transform; } } [Serializable] public class Constraints { public Transform transform; public Transform target; public Vector3 positionOffset; public Vector3 position; [Range(0f, 1f)] public float positionWeight; public Vector3 rotationOffset; public Vector3 rotation; [Range(0f, 1f)] public float rotationWeight; public bool IsValid() { return (Object)(object)transform != (Object)null; } public void Initiate(Transform transform) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) this.transform = transform; position = transform.position; rotation = transform.eulerAngles; } public void Update() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) if (IsValid()) { if ((Object)(object)target != (Object)null) { position = target.position; } Transform obj = transform; obj.position += positionOffset; if (positionWeight > 0f) { transform.position = Vector3.Lerp(transform.position, position, positionWeight); } if ((Object)(object)target != (Object)null) { rotation = target.eulerAngles; } transform.rotation = Quaternion.Euler(rotationOffset) * transform.rotation; if (rotationWeight > 0f) { transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.Euler(rotation), rotationWeight); } } } } [Serializable] public class Finger { [Serializable] public enum DOF { One, Three } [Tooltip("Master Weight for the finger.")] [Range(0f, 1f)] public float weight = 1f; [Tooltip("The weight of rotating the finger tip and bending the finger to the target.")] [Range(0f, 1f)] public float rotationWeight = 1f; [Tooltip("Rotational degrees of freedom. When set to 'One' the fingers will be able to be rotated only around a single axis. When 3, all 3 axes are free to rotate around.")] public DOF rotationDOF; [Tooltip("If enabled, keeps bone1 twist angle fixed relative to bone2.")] public bool fixBone1Twist; [Tooltip("The first bone of the finger.")] public Transform bone1; [Tooltip("The second bone of the finger.")] public Transform bone2; [Tooltip("The (optional) third bone of the finger. This can be ignored for thumbs.")] public Transform bone3; [Tooltip("The fingertip object. If your character doesn't have tip bones, you can create an empty GameObject and parent it to the last bone in the finger. Place it to the tip of the finger.")] public Transform tip; [Tooltip("The IK target (optional, can use IKPosition and IKRotation directly).")] public Transform target; private IKSolverLimb solver; private Quaternion bone3RelativeToTarget; private Vector3 bone3DefaultLocalPosition; private Quaternion bone3DefaultLocalRotation; private Vector3 bone1Axis; private Vector3 tipAxis; private Vector3 bone1TwistAxis; private Vector3 defaultBendNormal; public bool initiated { get; private set; } public Vector3 IKPosition { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return solver.IKPosition; } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) solver.IKPosition = value; } } public Quaternion IKRotation { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return solver.IKRotation; } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) solver.IKRotation = value; } } public bool IsValid(ref string errorMessage) { if ((Object)(object)bone1 == (Object)null || (Object)(object)bone2 == (Object)null || (Object)(object)tip == (Object)null) { errorMessage = "One of the bones in the Finger Rig is null, can not initiate solvers."; return false; } return true; } public void Initiate(Transform hand, int index) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) initiated = false; string errorMessage = string.Empty; if (!IsValid(ref errorMessage)) { Warning.Log(errorMessage, hand); return; } solver = new IKSolverLimb(); solver.IKPositionWeight = weight; solver.bendModifier = IKSolverLimb.BendModifier.Target; solver.bendModifierWeight = 1f; Vector3 val = Vector3.Cross(tip.position - bone1.position, bone2.position - bone1.position); defaultBendNormal = -((Vector3)(ref val)).normalized; solver.bendNormal = defaultBendNormal; Vector3 val2 = Vector3.Cross(bone2.position - bone1.position, tip.position - bone1.position); bone1Axis = Quaternion.Inverse(bone1.rotation) * val2; tipAxis = Quaternion.Inverse(tip.rotation) * val2; Vector3 val3 = bone2.position - bone1.position; Vector3 val4 = -Vector3.Cross(tip.position - bone1.position, bone2.position - bone1.position); Vector3.OrthoNormalize(ref val3, ref val4); bone1TwistAxis = Quaternion.Inverse(bone1.rotation) * val4; IKPosition = tip.position; IKRotation = tip.rotation; if ((Object)(object)bone3 != (Object)null) { bone3RelativeToTarget = Quaternion.Inverse(IKRotation) * bone3.rotation; bone3DefaultLocalPosition = bone3.localPosition; bone3DefaultLocalRotation = bone3.localRotation; } solver.SetChain(bone1, bone2, tip, hand); solver.Initiate(hand); initiated = true; } public void FixTransforms() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (initiated && !(weight <= 0f)) { solver.FixTransforms(); if ((Object)(object)bone3 != (Object)null) { bone3.localPosition = bone3DefaultLocalPosition; bone3.localRotation = bone3DefaultLocalRotation; } } } public void StoreDefaultLocalState() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (initiated) { solver.StoreDefaultLocalState(); if ((Object)(object)bone3 != (Object)null) { bone3DefaultLocalPosition = bone3.localPosition; bone3DefaultLocalRotation = bone3.localRotation; } } } public void Update(float masterWeight) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return; } float num = weight * masterWeight; if (num <= 0f) { return; } solver.target = target; if ((Object)(object)target != (Object)null) { IKPosition = target.position; IKRotation = target.rotation; } if (rotationDOF == DOF.One) { Quaternion val = Quaternion.FromToRotation(IKRotation * tipAxis, bone1.rotation * bone1Axis); IKRotation = val * IKRotation; } if ((Object)(object)bone3 != (Object)null) { if (num * rotationWeight >= 1f) { bone3.rotation = IKRotation * bone3RelativeToTarget; } else { bone3.rotation = Quaternion.Lerp(bone3.rotation, IKRotation * bone3RelativeToTarget, num * rotationWeight); } } solver.IKPositionWeight = num; solver.IKRotationWeight = rotationWeight; solver.Update(); if (fixBone1Twist) { Quaternion rotation = bone2.rotation; Vector3 val2 = Quaternion.Inverse(Quaternion.LookRotation(bone1.rotation * bone1TwistAxis, bone2.position - bone1.position)) * solver.bendNormal; float num2 = Mathf.Atan2(val2.x, val2.z) * 57.29578f; bone1.rotation = Quaternion.AngleAxis(num2, bone2.position - bone1.position) * bone1.rotation; bone2.rotation = rotation; } } } public class FingerRig : SolverManager { [Tooltip("The master weight for all fingers.")] [Range(0f, 1f)] public float weight = 1f; public Finger[] fingers = new Finger[0]; public bool initiated { get; private set; } public bool IsValid(ref string errorMessage) { Finger[] array = fingers; for (int i = 0; i < array.Length; i++) { if (!array[i].IsValid(ref errorMessage)) { return false; } } return true; } [ContextMenu("Auto-detect")] public void AutoDetect() { fingers = new Finger[0]; for (int i = 0; i < ((Component)this).transform.childCount; i++) { Transform[] array = (Transform[])(object)new Transform[0]; AddChildrenRecursive(((Component)this).transform.GetChild(i), ref array); if (array.Length == 3 || array.Length == 4) { Finger finger = new Finger(); finger.bone1 = array[0]; finger.bone2 = array[1]; if (array.Length == 3) { finger.tip = array[2]; } else { finger.bone3 = array[2]; finger.tip = array[3]; } finger.weight = 1f; Array.Resize(ref fingers, fingers.Length + 1); fingers[fingers.Length - 1] = finger; } } } public void AddFinger(Transform bone1, Transform bone2, Transform bone3, Transform tip, Transform target = null) { Finger finger = new Finger(); finger.bone1 = bone1; finger.bone2 = bone2; finger.bone3 = bone3; finger.tip = tip; finger.target = target; Array.Resize(ref fingers, fingers.Length + 1); fingers[fingers.Length - 1] = finger; initiated = false; finger.Initiate(((Component)this).transform, fingers.Length - 1); if (fingers[fingers.Length - 1].initiated) { initiated = true; } } public void RemoveFinger(int index) { if ((float)index < 0f || index >= fingers.Length) { Warning.Log("RemoveFinger index out of bounds.", ((Component)this).transform); return; } if (fingers.Length == 1) { fingers = new Finger[0]; return; } Finger[] array = new Finger[fingers.Length - 1]; int num = 0; for (int i = 0; i < fingers.Length; i++) { if (i != index) { array[num] = fingers[i]; num++; } } fingers = array; } private void AddChildrenRecursive(Transform parent, ref Transform[] array) { Array.Resize(ref array, array.Length + 1); array[array.Length - 1] = parent; if (parent.childCount == 1) { AddChildrenRecursive(parent.GetChild(0), ref array); } } protected override void InitiateSolver() { initiated = true; for (int i = 0; i < fingers.Length; i++) { fingers[i].Initiate(((Component)this).transform, i); if (!fingers[i].initiated) { initiated = false; } } } public void UpdateFingerSolvers() { Finger[] array = fingers; for (int i = 0; i < array.Length; i++) { array[i].Update(weight); } } public void FixFingerTransforms() { if (!(weight <= 0f)) { Finger[] array = fingers; for (int i = 0; i < array.Length; i++) { array[i].FixTransforms(); } } } public void StoreDefaultLocalState() { Finger[] array = fingers; for (int i = 0; i < array.Length; i++) { array[i].StoreDefaultLocalState(); } } protected override void UpdateSolver() { UpdateFingerSolvers(); } protected override void FixTransforms() { if (!(weight <= 0f)) { FixFingerTransforms(); } } } public abstract class Grounder : MonoBehaviour { public delegate void GrounderDelegate(); [Tooltip("The master weight. Use this to fade in/out the grounding effect.")] [Range(0f, 1f)] public float weight = 1f; [Tooltip("The Grounding solver. Not to confuse with IK solvers.")] public Grounding solver = new Grounding(); public GrounderDelegate OnPreGrounder; public GrounderDelegate OnPostGrounder; public bool initiated { get; protected set; } public abstract void ResetPosition(); protected Vector3 GetSpineOffsetTarget() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; for (int i = 0; i < solver.legs.Length; i++) { val += GetLegSpineBendVector(solver.legs[i]); } return val; } protected void LogWarning(string message) { Warning.Log(message, ((Component)this).transform); } private Vector3 GetLegSpineBendVector(Grounding.Leg leg) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) Vector3 legSpineTangent = GetLegSpineTangent(leg); float num = (Vector3.Dot(solver.root.forward, ((Vector3)(ref legSpineTangent)).normalized) + 1f) * 0.5f; Vector3 val = leg.IKPosition - leg.transform.position; float magnitude = ((Vector3)(ref val)).magnitude; return legSpineTangent * magnitude * num; } private Vector3 GetLegSpineTangent(Grounding.Leg leg) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = leg.transform.position - solver.root.position; if (!solver.rotateSolver || solver.root.up == Vector3.up) { return new Vector3(val.x, 0f, val.z); } Vector3 up = solver.root.up; Vector3.OrthoNormalize(ref up, ref val); return val; } protected abstract void OpenUserManual(); protected abstract void OpenScriptReference(); } [HelpURL("http://www.root-motion.com/finalikdox/html/page9.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Grounder/Grounder Biped")] public class GrounderBipedIK : Grounder { [Tooltip("The BipedIK componet.")] public BipedIK ik; [Tooltip("The amount of spine bending towards upward slopes.")] public float spineBend = 7f; [Tooltip("The interpolation speed of spine bending.")] public float spineSpeed = 3f; private Transform[] feet = (Transform[])(object)new Transform[2]; private Quaternion[] footRotations = (Quaternion[])(object)new Quaternion[2]; private Vector3 animatedPelvisLocalPosition; private Vector3 solvedPelvisLocalPosition; private Vector3 spineOffset; private float lastWeight; [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page9.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_grounder_biped_i_k.html"); } public override void ResetPosition() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) solver.Reset(); spineOffset = Vector3.zero; } private bool IsReadyToInitiate() { if ((Object)(object)ik == (Object)null) { return false; } if (!ik.solvers.leftFoot.initiated) { return false; } if (!ik.solvers.rightFoot.initiated) { return false; } return true; } private void Update() { weight = Mathf.Clamp(weight, 0f, 1f); if (!(weight <= 0f) && !base.initiated && IsReadyToInitiate()) { Initiate(); } } private void Initiate() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) feet = (Transform[])(object)new Transform[2]; footRotations = (Quaternion[])(object)new Quaternion[2]; feet[0] = ik.references.leftFoot; feet[1] = ik.references.rightFoot; footRotations[0] = Quaternion.identity; footRotations[1] = Quaternion.identity; IKSolverFABRIK spine = ik.solvers.spine; spine.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(spine.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolverLimb rightFoot = ik.solvers.rightFoot; rightFoot.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(rightFoot.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); animatedPelvisLocalPosition = ik.references.pelvis.localPosition; solver.Initiate(ik.references.root, feet); base.initiated = true; } private void OnDisable() { if (base.initiated) { ik.solvers.leftFoot.IKPositionWeight = 0f; ik.solvers.rightFoot.IKPositionWeight = 0f; } } private void OnSolverUpdate() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled) { return; } if (weight <= 0f) { if (lastWeight <= 0f) { return; } OnDisable(); } lastWeight = weight; if (OnPreGrounder != null) { OnPreGrounder(); } if (ik.references.pelvis.localPosition != solvedPelvisLocalPosition) { animatedPelvisLocalPosition = ik.references.pelvis.localPosition; } else { ik.references.pelvis.localPosition = animatedPelvisLocalPosition; } solver.Update(); Transform pelvis = ik.references.pelvis; pelvis.position += solver.pelvis.IKOffset * weight; SetLegIK(ik.solvers.leftFoot, 0); SetLegIK(ik.solvers.rightFoot, 1); if (spineBend != 0f && ik.references.spine.Length != 0) { spineSpeed = Mathf.Clamp(spineSpeed, 0f, spineSpeed); Vector3 val = GetSpineOffsetTarget() * weight; spineOffset = Vector3.Lerp(spineOffset, val * spineBend, Time.deltaTime * spineSpeed); Quaternion rotation = ik.references.leftUpperArm.rotation; Quaternion rotation2 = ik.references.rightUpperArm.rotation; Vector3 up = solver.up; Quaternion val2 = Quaternion.FromToRotation(up, up + spineOffset); ik.references.spine[0].rotation = val2 * ik.references.spine[0].rotation; ik.references.leftUpperArm.rotation = rotation; ik.references.rightUpperArm.rotation = rotation2; ik.solvers.lookAt.SetDirty(); } if (OnPostGrounder != null) { OnPostGrounder(); } } private void SetLegIK(IKSolverLimb limb, int index) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) footRotations[index] = feet[index].rotation; limb.IKPosition = solver.legs[index].IKPosition; limb.IKPositionWeight = weight; } private void OnPostSolverUpdate() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f) && ((Behaviour)this).enabled) { for (int i = 0; i < feet.Length; i++) { feet[i].rotation = Quaternion.Slerp(Quaternion.identity, solver.legs[i].rotationOffset, weight) * footRotations[i]; } solvedPelvisLocalPosition = ik.references.pelvis.localPosition; } } private void OnDestroy() { if (base.initiated && (Object)(object)ik != (Object)null) { IKSolverFABRIK spine = ik.solvers.spine; spine.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(spine.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolverLimb rightFoot = ik.solvers.rightFoot; rightFoot.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(rightFoot.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); } } } [HelpURL("https://www.youtube.com/watch?v=9MiZiaJorws&index=6&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Grounder/Grounder Full Body Biped")] public class GrounderFBBIK : Grounder { [Serializable] public class SpineEffector { [Tooltip("The type of the effector.")] public FullBodyBipedEffector effectorType; [Tooltip("The weight of horizontal bend offset towards the slope.")] public float horizontalWeight = 1f; [Tooltip("The vertical bend offset weight.")] public float verticalWeight; public SpineEffector() { } public SpineEffector(FullBodyBipedEffector effectorType, float horizontalWeight, float verticalWeight) { this.effectorType = effectorType; this.horizontalWeight = horizontalWeight; this.verticalWeight = verticalWeight; } } [Tooltip("Reference to the FBBIK componet.")] public FullBodyBipedIK ik; [Tooltip("The amount of spine bending towards upward slopes.")] public float spineBend = 2f; [Tooltip("The interpolation speed of spine bending.")] public float spineSpeed = 3f; public SpineEffector[] spine = new SpineEffector[0]; private Transform[] feet = (Transform[])(object)new Transform[2]; private Vector3 spineOffset; private bool firstSolve; [ContextMenu("TUTORIAL VIDEO")] private void OpenTutorial() { Application.OpenURL("https://www.youtube.com/watch?v=9MiZiaJorws&index=6&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page9.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_grounder_f_b_b_i_k.html"); } public override void ResetPosition() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) solver.Reset(); spineOffset = Vector3.zero; } private bool IsReadyToInitiate() { if ((Object)(object)ik == (Object)null) { return false; } if (!ik.solver.initiated) { return false; } return true; } private void Update() { firstSolve = true; weight = Mathf.Clamp(weight, 0f, 1f); if (!(weight <= 0f) && !base.initiated && IsReadyToInitiate()) { Initiate(); } } private void FixedUpdate() { firstSolve = true; } private void LateUpdate() { firstSolve = true; } private void Initiate() { ik.solver.leftLegMapping.maintainRotationWeight = 1f; ik.solver.rightLegMapping.maintainRotationWeight = 1f; feet = (Transform[])(object)new Transform[2]; feet[0] = ik.solver.leftFootEffector.bone; feet[1] = ik.solver.rightFootEffector.bone; IKSolverFullBodyBiped iKSolverFullBodyBiped = ik.solver; iKSolverFullBodyBiped.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolverFullBodyBiped.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); solver.Initiate(ik.references.root, feet); base.initiated = true; } private void OnSolverUpdate() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) if (!firstSolve) { return; } firstSolve = false; if (!((Behaviour)this).enabled || weight <= 0f) { return; } if (OnPreGrounder != null) { OnPreGrounder(); } solver.Update(); Transform pelvis = ik.references.pelvis; pelvis.position += solver.pelvis.IKOffset * weight; SetLegIK(ik.solver.leftFootEffector, solver.legs[0]); SetLegIK(ik.solver.rightFootEffector, solver.legs[1]); if (spineBend != 0f) { spineSpeed = Mathf.Clamp(spineSpeed, 0f, spineSpeed); Vector3 val = GetSpineOffsetTarget() * weight; spineOffset = Vector3.Lerp(spineOffset, val * spineBend, Time.deltaTime * spineSpeed); Vector3 val2 = ik.references.root.up * ((Vector3)(ref spineOffset)).magnitude; for (int i = 0; i < spine.Length; i++) { IKEffector effector = ik.solver.GetEffector(spine[i].effectorType); effector.positionOffset += spineOffset * spine[i].horizontalWeight + val2 * spine[i].verticalWeight; } } if (OnPostGrounder != null) { OnPostGrounder(); } } private void SetLegIK(IKEffector effector, Grounding.Leg leg) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) effector.positionOffset += (leg.IKPosition - effector.bone.position) * weight; effector.bone.rotation = Quaternion.Slerp(Quaternion.identity, leg.rotationOffset, weight) * effector.bone.rotation; } private void OnDrawGizmosSelected() { if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponent(); } if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponentInParent(); } if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponentInChildren(); } } private void OnDestroy() { if (base.initiated && (Object)(object)ik != (Object)null) { IKSolverFullBodyBiped iKSolverFullBodyBiped = ik.solver; iKSolverFullBodyBiped.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolverFullBodyBiped.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); } } } [HelpURL("http://www.root-motion.com/finalikdox/html/page9.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Grounder/Grounder IK")] public class GrounderIK : Grounder { public IK[] legs; [Tooltip("The pelvis transform. Common ancestor of all the legs.")] public Transform pelvis; [Tooltip("The root Transform of the character, with the rigidbody and the collider.")] public Transform characterRoot; [Tooltip("The weight of rotating the character root to the ground normal (range: 0 - 1).")] [Range(0f, 1f)] public float rootRotationWeight; [Tooltip("The speed of rotating the character root to the ground normal (range: 0 - inf).")] public float rootRotationSpeed = 5f; [Tooltip("The maximum angle of root rotation (range: 0 - 90).")] public float maxRootRotationAngle = 45f; private Transform[] feet = (Transform[])(object)new Transform[0]; private Quaternion[] footRotations = (Quaternion[])(object)new Quaternion[0]; private Vector3 animatedPelvisLocalPosition; private Vector3 solvedPelvisLocalPosition; private int solvedFeet; private bool solved; private float lastWeight; private Rigidbody characterRootRigidbody; [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page9.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_grounder_i_k.html"); } public override void ResetPosition() { solver.Reset(); } private bool IsReadyToInitiate() { if ((Object)(object)pelvis == (Object)null) { return false; } if (legs.Length == 0) { return false; } IK[] array = legs; foreach (IK iK in array) { if ((Object)(object)iK == (Object)null) { return false; } if (iK is FullBodyBipedIK) { LogWarning("GrounderIK does not support FullBodyBipedIK, use CCDIK, FABRIK, LimbIK or TrigonometricIK instead. If you want to use FullBodyBipedIK, use the GrounderFBBIK component."); return false; } if (iK is FABRIKRoot) { LogWarning("GrounderIK does not support FABRIKRoot, use CCDIK, FABRIK, LimbIK or TrigonometricIK instead."); return false; } if (iK is AimIK) { LogWarning("GrounderIK does not support AimIK, use CCDIK, FABRIK, LimbIK or TrigonometricIK instead."); return false; } } return true; } private void OnDisable() { if (!base.initiated) { return; } for (int i = 0; i < legs.Length; i++) { if ((Object)(object)legs[i] != (Object)null) { legs[i].GetIKSolver().IKPositionWeight = 0f; } } } private void Update() { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) weight = Mathf.Clamp(weight, 0f, 1f); if (weight <= 0f) { return; } solved = false; if (base.initiated) { rootRotationWeight = Mathf.Clamp(rootRotationWeight, 0f, 1f); rootRotationSpeed = Mathf.Clamp(rootRotationSpeed, 0f, rootRotationSpeed); if ((Object)(object)characterRoot != (Object)null && rootRotationSpeed > 0f && rootRotationWeight > 0f && solver.isGrounded) { Vector3 val = solver.GetLegsPlaneNormal(); if (rootRotationWeight < 1f) { val = Vector3.Slerp(Vector3.up, val, rootRotationWeight); } Quaternion val2 = Quaternion.RotateTowards(Quaternion.FromToRotation(((Component)this).transform.up, Vector3.up) * characterRoot.rotation, Quaternion.FromToRotation(((Component)this).transform.up, val) * characterRoot.rotation, maxRootRotationAngle); if ((Object)(object)characterRootRigidbody == (Object)null) { characterRoot.rotation = Quaternion.Lerp(characterRoot.rotation, val2, Time.deltaTime * rootRotationSpeed); } else { characterRootRigidbody.MoveRotation(Quaternion.Lerp(characterRoot.rotation, val2, Time.deltaTime * rootRotationSpeed)); } } } else if (IsReadyToInitiate()) { Initiate(); } } private void Initiate() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) feet = (Transform[])(object)new Transform[legs.Length]; footRotations = (Quaternion[])(object)new Quaternion[legs.Length]; for (int i = 0; i < feet.Length; i++) { footRotations[i] = Quaternion.identity; } for (int j = 0; j < legs.Length; j++) { IKSolver.Point[] points = legs[j].GetIKSolver().GetPoints(); feet[j] = points[^1].transform; IKSolver iKSolver = legs[j].GetIKSolver(); iKSolver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolver.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolver iKSolver2 = legs[j].GetIKSolver(); iKSolver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolver2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); } animatedPelvisLocalPosition = pelvis.localPosition; solver.Initiate(((Component)this).transform, feet); for (int k = 0; k < legs.Length; k++) { if (legs[k] is LegIK) { solver.legs[k].invertFootCenter = true; } } characterRootRigidbody = ((Component)characterRoot).GetComponent(); base.initiated = true; } private void OnSolverUpdate() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled) { return; } if (weight <= 0f) { if (lastWeight <= 0f) { return; } OnDisable(); } lastWeight = weight; if (!solved) { if (OnPreGrounder != null) { OnPreGrounder(); } if (pelvis.localPosition != solvedPelvisLocalPosition) { animatedPelvisLocalPosition = pelvis.localPosition; } else { pelvis.localPosition = animatedPelvisLocalPosition; } solver.Update(); for (int i = 0; i < legs.Length; i++) { SetLegIK(i); } Transform obj = pelvis; obj.position += solver.pelvis.IKOffset * weight; solved = true; solvedFeet = 0; if (OnPostGrounder != null) { OnPostGrounder(); } } } private void SetLegIK(int index) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) footRotations[index] = feet[index].rotation; if (legs[index] is LegIK) { (legs[index].GetIKSolver() as IKSolverLeg).IKRotation = Quaternion.Slerp(Quaternion.identity, solver.legs[index].rotationOffset, weight) * footRotations[index]; (legs[index].GetIKSolver() as IKSolverLeg).IKRotationWeight = 1f; } legs[index].GetIKSolver().IKPosition = solver.legs[index].IKPosition; legs[index].GetIKSolver().IKPositionWeight = weight; } private void OnPostSolverUpdate() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f || !((Behaviour)this).enabled) { return; } solvedFeet++; if (solvedFeet >= feet.Length) { solved = false; for (int i = 0; i < feet.Length; i++) { feet[i].rotation = Quaternion.Slerp(Quaternion.identity, solver.legs[i].rotationOffset, weight) * footRotations[i]; } solvedPelvisLocalPosition = pelvis.localPosition; } } private void OnDestroy() { if (!base.initiated) { return; } IK[] array = legs; foreach (IK iK in array) { if ((Object)(object)iK != (Object)null) { IKSolver iKSolver = iK.GetIKSolver(); iKSolver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolver.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolver iKSolver2 = iK.GetIKSolver(); iKSolver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolver2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); } } } } [HelpURL("http://www.root-motion.com/finalikdox/html/page9.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Grounder/Grounder Quadruped")] public class GrounderQuadruped : Grounder { public struct Foot { public IKSolver solver; public Transform transform; public Quaternion rotation; public Grounding.Leg leg; public Foot(IKSolver solver, Transform transform) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) this.solver = solver; this.transform = transform; leg = null; rotation = transform.rotation; } } [Tooltip("The Grounding solver for the forelegs.")] public Grounding forelegSolver = new Grounding(); [Tooltip("The weight of rotating the character root to the ground angle (range: 0 - 1).")] [Range(0f, 1f)] public float rootRotationWeight = 0.5f; [Tooltip("The maximum angle of rotating the quadruped downwards (going downhill, range: -90 - 0).")] [Range(-90f, 0f)] public float minRootRotation = -25f; [Tooltip("The maximum angle of rotating the quadruped upwards (going uphill, range: 0 - 90).")] [Range(0f, 90f)] public float maxRootRotation = 45f; [Tooltip("The speed of interpolating the character root rotation (range: 0 - inf).")] public float rootRotationSpeed = 5f; [Tooltip("The maximum IK offset for the legs (range: 0 - inf).")] public float maxLegOffset = 0.5f; [Tooltip("The maximum IK offset for the forelegs (range: 0 - inf).")] public float maxForeLegOffset = 0.5f; [Tooltip("The weight of maintaining the head's rotation as it was before solving the Grounding (range: 0 - 1).")] [Range(0f, 1f)] public float maintainHeadRotationWeight = 0.5f; [Tooltip("The root Transform of the character, with the rigidbody and the collider.")] public Transform characterRoot; [Tooltip("The pelvis transform. Common ancestor of both legs and the spine.")] public Transform pelvis; [Tooltip("The last bone in the spine that is the common parent for both forelegs.")] public Transform lastSpineBone; [Tooltip("The head (optional, if you intend to maintain it's rotation).")] public Transform head; public IK[] legs; public IK[] forelegs; [HideInInspector] public Vector3 gravity = Vector3.down; private Foot[] feet = new Foot[0]; private Vector3 animatedPelvisLocalPosition; private Quaternion animatedPelvisLocalRotation; private Quaternion animatedHeadLocalRotation; private Vector3 solvedPelvisLocalPosition; private Quaternion solvedPelvisLocalRotation; private Quaternion solvedHeadLocalRotation; private int solvedFeet; private bool solved; private float angle; private Transform forefeetRoot; private Quaternion headRotation; private float lastWeight; private Rigidbody characterRootRigidbody; [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page9.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_grounder_quadruped.html"); } public override void ResetPosition() { solver.Reset(); forelegSolver.Reset(); } private bool IsReadyToInitiate() { if ((Object)(object)pelvis == (Object)null) { return false; } if ((Object)(object)lastSpineBone == (Object)null) { return false; } if (legs.Length == 0) { return false; } if (forelegs.Length == 0) { return false; } if ((Object)(object)characterRoot == (Object)null) { return false; } if (!IsReadyToInitiateLegs(legs)) { return false; } if (!IsReadyToInitiateLegs(forelegs)) { return false; } return true; } private bool IsReadyToInitiateLegs(IK[] ikComponents) { foreach (IK iK in ikComponents) { if ((Object)(object)iK == (Object)null) { return false; } if (iK is FullBodyBipedIK) { LogWarning("GrounderIK does not support FullBodyBipedIK, use CCDIK, FABRIK, LimbIK or TrigonometricIK instead. If you want to use FullBodyBipedIK, use the GrounderFBBIK component."); return false; } if (iK is FABRIKRoot) { LogWarning("GrounderIK does not support FABRIKRoot, use CCDIK, FABRIK, LimbIK or TrigonometricIK instead."); return false; } if (iK is AimIK) { LogWarning("GrounderIK does not support AimIK, use CCDIK, FABRIK, LimbIK or TrigonometricIK instead."); return false; } } return true; } private void OnDisable() { if (!base.initiated) { return; } for (int i = 0; i < feet.Length; i++) { if (feet[i].solver != null) { feet[i].solver.IKPositionWeight = 0f; } } } private void Update() { weight = Mathf.Clamp(weight, 0f, 1f); if (!(weight <= 0f)) { solved = false; if (!base.initiated && IsReadyToInitiate()) { Initiate(); } } } private void Initiate() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) feet = new Foot[legs.Length + forelegs.Length]; Transform[] array = InitiateFeet(legs, ref feet, 0); Transform[] array2 = InitiateFeet(forelegs, ref feet, legs.Length); animatedPelvisLocalPosition = pelvis.localPosition; animatedPelvisLocalRotation = pelvis.localRotation; if ((Object)(object)head != (Object)null) { animatedHeadLocalRotation = head.localRotation; } forefeetRoot = new GameObject().transform; forefeetRoot.parent = ((Component)this).transform; ((Object)forefeetRoot).name = "Forefeet Root"; solver.Initiate(((Component)this).transform, array); forelegSolver.Initiate(forefeetRoot, array2); for (int i = 0; i < array.Length; i++) { feet[i].leg = solver.legs[i]; } for (int j = 0; j < array2.Length; j++) { feet[j + legs.Length].leg = forelegSolver.legs[j]; } characterRootRigidbody = ((Component)characterRoot).GetComponent(); base.initiated = true; } private Transform[] InitiateFeet(IK[] ikComponents, ref Foot[] f, int indexOffset) { Transform[] array = (Transform[])(object)new Transform[ikComponents.Length]; for (int i = 0; i < ikComponents.Length; i++) { IKSolver.Point[] points = ikComponents[i].GetIKSolver().GetPoints(); f[i + indexOffset] = new Foot(ikComponents[i].GetIKSolver(), points[^1].transform); array[i] = f[i + indexOffset].transform; IKSolver iKSolver = f[i + indexOffset].solver; iKSolver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolver.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolver iKSolver2 = f[i + indexOffset].solver; iKSolver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolver2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); } return array; } private void LateUpdate() { if (!(weight <= 0f)) { rootRotationWeight = Mathf.Clamp(rootRotationWeight, 0f, 1f); minRootRotation = Mathf.Clamp(minRootRotation, -90f, maxRootRotation); maxRootRotation = Mathf.Clamp(maxRootRotation, minRootRotation, 90f); rootRotationSpeed = Mathf.Clamp(rootRotationSpeed, 0f, rootRotationSpeed); maxLegOffset = Mathf.Clamp(maxLegOffset, 0f, maxLegOffset); maxForeLegOffset = Mathf.Clamp(maxForeLegOffset, 0f, maxForeLegOffset); maintainHeadRotationWeight = Mathf.Clamp(maintainHeadRotationWeight, 0f, 1f); RootRotation(); } } private void RootRotation() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) if (!(rootRotationWeight <= 0f) && !(rootRotationSpeed <= 0f)) { solver.rotateSolver = true; forelegSolver.rotateSolver = true; Vector3 forward = characterRoot.forward; Vector3 val = -gravity; Vector3.OrthoNormalize(ref val, ref forward); Quaternion val2 = Quaternion.LookRotation(forward, -gravity); RaycastHit rootHit = forelegSolver.rootHit; Vector3 point = ((RaycastHit)(ref rootHit)).point; rootHit = solver.rootHit; Vector3 val3 = point - ((RaycastHit)(ref rootHit)).point; Vector3 val4 = Quaternion.Inverse(val2) * val3; float num = Mathf.Atan2(val4.y, val4.z) * 57.29578f; num = Mathf.Clamp(num * rootRotationWeight, minRootRotation, maxRootRotation); angle = Mathf.Lerp(angle, num, Time.deltaTime * rootRotationSpeed); if ((Object)(object)characterRootRigidbody == (Object)null) { characterRoot.rotation = Quaternion.Slerp(characterRoot.rotation, Quaternion.AngleAxis(0f - angle, characterRoot.right) * val2, weight); } else { characterRootRigidbody.MoveRotation(Quaternion.Slerp(characterRoot.rotation, Quaternion.AngleAxis(0f - angle, characterRoot.right) * val2, weight)); } } } private void OnSolverUpdate() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled) { return; } if (weight <= 0f) { if (lastWeight <= 0f) { return; } OnDisable(); } lastWeight = weight; if (solved) { return; } if (OnPreGrounder != null) { OnPreGrounder(); } if (pelvis.localPosition != solvedPelvisLocalPosition) { animatedPelvisLocalPosition = pelvis.localPosition; } else { pelvis.localPosition = animatedPelvisLocalPosition; } if (pelvis.localRotation != solvedPelvisLocalRotation) { animatedPelvisLocalRotation = pelvis.localRotation; } else { pelvis.localRotation = animatedPelvisLocalRotation; } if ((Object)(object)head != (Object)null) { if (head.localRotation != solvedHeadLocalRotation) { animatedHeadLocalRotation = head.localRotation; } else { head.localRotation = animatedHeadLocalRotation; } } for (int i = 0; i < feet.Length; i++) { feet[i].rotation = feet[i].transform.rotation; } if ((Object)(object)head != (Object)null) { headRotation = head.rotation; } UpdateForefeetRoot(); solver.Update(); forelegSolver.Update(); Transform obj = pelvis; obj.position += solver.pelvis.IKOffset * weight; Vector3 val = lastSpineBone.position - pelvis.position; Vector3 val2 = lastSpineBone.position + forelegSolver.root.up * Mathf.Clamp(forelegSolver.pelvis.heightOffset, float.NegativeInfinity, 0f) - solver.root.up * solver.pelvis.heightOffset - pelvis.position; Quaternion val3 = Quaternion.FromToRotation(val, val2); pelvis.rotation = Quaternion.Slerp(Quaternion.identity, val3, weight) * pelvis.rotation; for (int j = 0; j < feet.Length; j++) { SetFootIK(feet[j], (j < 2) ? maxLegOffset : maxForeLegOffset); } solved = true; solvedFeet = 0; if (OnPostGrounder != null) { OnPostGrounder(); } } private void UpdateForefeetRoot() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; for (int i = 0; i < forelegSolver.legs.Length; i++) { val += forelegSolver.legs[i].transform.position; } val /= (float)forelegs.Length; Vector3 val2 = val - ((Component)this).transform.position; Vector3 up = ((Component)this).transform.up; Vector3 val3 = val2; Vector3.OrthoNormalize(ref up, ref val3); forefeetRoot.position = ((Component)this).transform.position + ((Vector3)(ref val3)).normalized * ((Vector3)(ref val2)).magnitude; } private void SetFootIK(Foot foot, float maxOffset) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) Vector3 val = foot.leg.IKPosition - foot.transform.position; foot.solver.IKPosition = foot.transform.position + Vector3.ClampMagnitude(val, maxOffset); foot.solver.IKPositionWeight = weight; } private void OnPostSolverUpdate() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f || !((Behaviour)this).enabled) { return; } solvedFeet++; if (solvedFeet >= feet.Length) { for (int i = 0; i < feet.Length; i++) { feet[i].transform.rotation = Quaternion.Slerp(Quaternion.identity, feet[i].leg.rotationOffset, weight) * feet[i].rotation; } if ((Object)(object)head != (Object)null) { head.rotation = Quaternion.Lerp(head.rotation, headRotation, maintainHeadRotationWeight * weight); } solvedPelvisLocalPosition = pelvis.localPosition; solvedPelvisLocalRotation = pelvis.localRotation; if ((Object)(object)head != (Object)null) { solvedHeadLocalRotation = head.localRotation; } } } private void OnDestroy() { if (base.initiated) { DestroyLegs(legs); DestroyLegs(forelegs); } } private void DestroyLegs(IK[] ikComponents) { foreach (IK iK in ikComponents) { if ((Object)(object)iK != (Object)null) { IKSolver iKSolver = iK.GetIKSolver(); iKSolver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolver.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolver iKSolver2 = iK.GetIKSolver(); iKSolver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolver2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); } } } } [HelpURL("https://www.youtube.com/watch?v=9MiZiaJorws&index=6&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Grounder/Grounder VRIK")] public class GrounderVRIK : Grounder { [Tooltip("Reference to the VRIK componet.")] public VRIK ik; private Transform[] feet = (Transform[])(object)new Transform[2]; [ContextMenu("TUTORIAL VIDEO")] private void OpenTutorial() { Application.OpenURL("https://www.youtube.com/watch?v=9MiZiaJorws&index=6&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page9.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_grounder_v_r_i_k.html"); } public override void ResetPosition() { solver.Reset(); } private bool IsReadyToInitiate() { if ((Object)(object)ik == (Object)null) { return false; } if (!ik.solver.initiated) { return false; } return true; } private void Update() { weight = Mathf.Clamp(weight, 0f, 1f); if (!(weight <= 0f) && !base.initiated && IsReadyToInitiate()) { Initiate(); } } private void Initiate() { feet = (Transform[])(object)new Transform[2]; feet[0] = ik.references.leftFoot; feet[1] = ik.references.rightFoot; IKSolverVR iKSolverVR = ik.solver; iKSolverVR.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolverVR.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolverVR iKSolverVR2 = ik.solver; iKSolverVR2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolverVR2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); solver.Initiate(ik.references.root, feet); base.initiated = true; } private void OnSolverUpdate() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled && !(weight <= 0f)) { if (OnPreGrounder != null) { OnPreGrounder(); } solver.Update(); Transform pelvis = ik.references.pelvis; pelvis.position += solver.pelvis.IKOffset * weight; ik.solver.AddPositionOffset(IKSolverVR.PositionOffset.LeftFoot, (solver.legs[0].IKPosition - ik.references.leftFoot.position) * weight); ik.solver.AddPositionOffset(IKSolverVR.PositionOffset.RightFoot, (solver.legs[1].IKPosition - ik.references.rightFoot.position) * weight); if (OnPostGrounder != null) { OnPostGrounder(); } } } private void SetLegIK(IKSolverVR.PositionOffset positionOffset, Transform bone, Grounding.Leg leg) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) ik.solver.AddPositionOffset(positionOffset, (leg.IKPosition - bone.position) * weight); } private void OnPostSolverUpdate() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) ik.references.leftFoot.rotation = Quaternion.Slerp(Quaternion.identity, solver.legs[0].rotationOffset, weight) * ik.references.leftFoot.rotation; ik.references.rightFoot.rotation = Quaternion.Slerp(Quaternion.identity, solver.legs[1].rotationOffset, weight) * ik.references.rightFoot.rotation; } private void OnDrawGizmosSelected() { if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponent(); } if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponentInParent(); } if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponentInChildren(); } } private void OnDestroy() { if (base.initiated && (Object)(object)ik != (Object)null) { IKSolverVR iKSolverVR = ik.solver; iKSolverVR.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolverVR.OnPreUpdate, new IKSolver.UpdateDelegate(OnSolverUpdate)); IKSolverVR iKSolverVR2 = ik.solver; iKSolverVR2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolverVR2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostSolverUpdate)); } } } [Serializable] public class Grounding { [Serializable] public enum Quality { Fastest, Simple, Best } public class Leg { public Quaternion rotationOffset = Quaternion.identity; public bool invertFootCenter; private Grounding grounding; private float lastTime; private float deltaTime; private Vector3 lastPosition; private Quaternion toHitNormal; private Quaternion r; private Vector3 up = Vector3.up; private bool doOverrideFootPosition; private Vector3 overrideFootPosition; private Vector3 transformPosition; public bool isGrounded { get; private set; } public Vector3 IKPosition { get; private set; } public bool initiated { get; private set; } public float heightFromGround { get; private set; } public Vector3 velocity { get; private set; } public Transform transform { get; private set; } public float IKOffset { get; private set; } public RaycastHit heelHit { get; private set; } public RaycastHit capsuleHit { get; private set; } public RaycastHit GetHitPoint { get { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (grounding.quality == Quality.Best) { return capsuleHit; } return heelHit; } } public float stepHeightFromGround => Mathf.Clamp(heightFromGround, 0f - grounding.maxStep, grounding.maxStep); private float rootYOffset => grounding.GetVerticalOffset(transformPosition, grounding.root.position - up * grounding.heightOffset); public void SetFootPosition(Vector3 position) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) doOverrideFootPosition = true; overrideFootPosition = position; } public void Initiate(Grounding grounding, Transform transform) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) initiated = false; this.grounding = grounding; this.transform = transform; up = Vector3.up; IKPosition = transform.position; rotationOffset = Quaternion.identity; initiated = true; OnEnable(); } public void OnEnable() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (initiated) { lastPosition = transform.position; lastTime = Time.deltaTime; } } public void Reset() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) lastPosition = transform.position; lastTime = Time.deltaTime; IKOffset = 0f; IKPosition = transform.position; rotationOffset = Quaternion.identity; } public void Process() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) if (!initiated || grounding.maxStep <= 0f) { return; } transformPosition = (doOverrideFootPosition ? overrideFootPosition : transform.position); doOverrideFootPosition = false; deltaTime = Time.time - lastTime; lastTime = Time.time; if (deltaTime == 0f) { return; } up = grounding.up; heightFromGround = float.PositiveInfinity; velocity = (transformPosition - lastPosition) / deltaTime; lastPosition = transformPosition; Vector3 val = velocity * grounding.prediction; if (grounding.footRadius <= 0f) { grounding.quality = Quality.Fastest; } isGrounded = false; RaycastHit val2; Vector3 normal; Vector3 point4; switch (grounding.quality) { case Quality.Fastest: { RaycastHit raycastHit3 = GetRaycastHit(val); SetFootToPoint(((RaycastHit)(ref raycastHit3)).normal, ((RaycastHit)(ref raycastHit3)).point); if ((Object)(object)((RaycastHit)(ref raycastHit3)).collider != (Object)null) { isGrounded = true; } break; } case Quality.Simple: { heelHit = GetRaycastHit(Vector3.zero); Vector3 val3 = grounding.GetFootCenterOffset(); if (invertFootCenter) { val3 = -val3; } RaycastHit raycastHit = GetRaycastHit(val3 + val); RaycastHit raycastHit2 = GetRaycastHit(grounding.root.right * grounding.footRadius * 0.5f); val2 = heelHit; if ((Object)(object)((RaycastHit)(ref val2)).collider != (Object)null || (Object)(object)((RaycastHit)(ref raycastHit)).collider != (Object)null || (Object)(object)((RaycastHit)(ref raycastHit2)).collider != (Object)null) { isGrounded = true; } Vector3 point = ((RaycastHit)(ref raycastHit)).point; val2 = heelHit; Vector3 val4 = point - ((RaycastHit)(ref val2)).point; Vector3 point2 = ((RaycastHit)(ref raycastHit2)).point; val2 = heelHit; Vector3 val5 = Vector3.Cross(val4, point2 - ((RaycastHit)(ref val2)).point); Vector3 val6 = ((Vector3)(ref val5)).normalized; if (Vector3.Dot(val6, up) < 0f) { val6 = -val6; } Vector3 planeNormal = val6; val2 = heelHit; Vector3 point3 = ((RaycastHit)(ref val2)).point; val2 = heelHit; SetFootToPlane(planeNormal, point3, ((RaycastHit)(ref val2)).point); break; } case Quality.Best: { heelHit = GetRaycastHit(invertFootCenter ? (-grounding.GetFootCenterOffset()) : Vector3.zero); capsuleHit = GetCapsuleHit(val); val2 = heelHit; if (!((Object)(object)((RaycastHit)(ref val2)).collider != (Object)null)) { val2 = capsuleHit; if (!((Object)(object)((RaycastHit)(ref val2)).collider != (Object)null)) { goto IL_02fd; } } isGrounded = true; goto IL_02fd; } IL_02fd: val2 = capsuleHit; normal = ((RaycastHit)(ref val2)).normal; val2 = capsuleHit; point4 = ((RaycastHit)(ref val2)).point; val2 = heelHit; SetFootToPlane(normal, point4, ((RaycastHit)(ref val2)).point); break; } float num = stepHeightFromGround; if (!grounding.rootGrounded) { num = 0f; } IKOffset = Interp.LerpValue(IKOffset, num, grounding.footSpeed, grounding.footSpeed); IKOffset = Mathf.Lerp(IKOffset, num, deltaTime * grounding.footSpeed); float verticalOffset = grounding.GetVerticalOffset(transformPosition, grounding.root.position); float num2 = Mathf.Clamp(grounding.maxStep - verticalOffset, 0f, grounding.maxStep); IKOffset = Mathf.Clamp(IKOffset, 0f - num2, IKOffset); RotateFoot(); IKPosition = transformPosition - up * IKOffset; float footRotationWeight = grounding.footRotationWeight; rotationOffset = ((footRotationWeight >= 1f) ? r : Quaternion.Slerp(Quaternion.identity, r, footRotationWeight)); } private RaycastHit GetCapsuleHit(Vector3 offsetFromHeel) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) RaycastHit result = default(RaycastHit); Vector3 val = grounding.GetFootCenterOffset(); if (invertFootCenter) { val = -val; } Vector3 val2 = transformPosition + val; if (grounding.overstepFallsDown) { ((RaycastHit)(ref result)).point = val2 - up * grounding.maxStep; } else { ((RaycastHit)(ref result)).point = new Vector3(val2.x, grounding.root.position.y, val2.z); } ((RaycastHit)(ref result)).normal = up; Vector3 val3 = val2 + grounding.maxStep * up; Vector3 val4 = val3 + offsetFromHeel; if (Physics.CapsuleCast(val3, val4, grounding.footRadius, -up, ref result, grounding.maxStep * 2f, LayerMask.op_Implicit(grounding.layers), (QueryTriggerInteraction)1) && float.IsNaN(((RaycastHit)(ref result)).point.x)) { ((RaycastHit)(ref result)).point = val2 - up * grounding.maxStep * 2f; ((RaycastHit)(ref result)).normal = up; } if (((RaycastHit)(ref result)).point == Vector3.zero && ((RaycastHit)(ref result)).normal == Vector3.zero) { if (grounding.overstepFallsDown) { ((RaycastHit)(ref result)).point = val2 - up * grounding.maxStep; } else { ((RaycastHit)(ref result)).point = new Vector3(val2.x, grounding.root.position.y, val2.z); } } return result; } private RaycastHit GetRaycastHit(Vector3 offsetFromHeel) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) RaycastHit result = default(RaycastHit); Vector3 val = transformPosition + offsetFromHeel; if (grounding.overstepFallsDown) { ((RaycastHit)(ref result)).point = val - up * grounding.maxStep; } else { ((RaycastHit)(ref result)).point = new Vector3(val.x, grounding.root.position.y, val.z); } ((RaycastHit)(ref result)).normal = up; if (grounding.maxStep <= 0f) { return result; } Physics.Raycast(val + grounding.maxStep * up, -up, ref result, grounding.maxStep * 2f, LayerMask.op_Implicit(grounding.layers), (QueryTriggerInteraction)1); if (((RaycastHit)(ref result)).point == Vector3.zero && ((RaycastHit)(ref result)).normal == Vector3.zero) { if (grounding.overstepFallsDown) { ((RaycastHit)(ref result)).point = val - up * grounding.maxStep; } else { ((RaycastHit)(ref result)).point = new Vector3(val.x, grounding.root.position.y, val.z); } } return result; } private Vector3 RotateNormal(Vector3 normal) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (grounding.quality == Quality.Best) { return normal; } return Vector3.RotateTowards(up, normal, grounding.maxFootRotationAngle * (MathF.PI / 180f), deltaTime); } private void SetFootToPoint(Vector3 normal, Vector3 point) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) toHitNormal = Quaternion.FromToRotation(up, RotateNormal(normal)); heightFromGround = GetHeightFromGround(point); } private void SetFootToPlane(Vector3 planeNormal, Vector3 planePoint, Vector3 heelHitPoint) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) planeNormal = RotateNormal(planeNormal); toHitNormal = Quaternion.FromToRotation(up, planeNormal); Vector3 hitPoint = V3Tools.LineToPlane(transformPosition + up * grounding.maxStep, -up, planeNormal, planePoint); heightFromGround = GetHeightFromGround(hitPoint); float num = GetHeightFromGround(heelHitPoint); heightFromGround = Mathf.Clamp(heightFromGround, float.NegativeInfinity, num); } private float GetHeightFromGround(Vector3 hitPoint) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return grounding.GetVerticalOffset(transformPosition, hitPoint) - rootYOffset; } private void RotateFoot() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Quaternion rotationOffsetTarget = GetRotationOffsetTarget(); r = Quaternion.Slerp(r, rotationOffsetTarget, deltaTime * grounding.footRotationSpeed); } private Quaternion GetRotationOffsetTarget() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (grounding.maxFootRotationAngle <= 0f) { return Quaternion.identity; } if (grounding.maxFootRotationAngle >= 180f) { return toHitNormal; } return Quaternion.RotateTowards(Quaternion.identity, toHitNormal, grounding.maxFootRotationAngle); } } public class Pelvis { private Grounding grounding; private Vector3 lastRootPosition; private float damperF; private bool initiated; private float lastTime; public Vector3 IKOffset { get; private set; } public float heightOffset { get; private set; } public void Initiate(Grounding grounding) { this.grounding = grounding; initiated = true; OnEnable(); } public void Reset() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) lastRootPosition = ((Component)grounding.root).transform.position; lastTime = Time.deltaTime; IKOffset = Vector3.zero; heightOffset = 0f; } public void OnEnable() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (initiated) { lastRootPosition = ((Component)grounding.root).transform.position; lastTime = Time.time; } } public void Process(float lowestOffset, float highestOffset, bool isGrounded) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return; } float num = Time.time - lastTime; lastTime = Time.time; if (!(num <= 0f)) { float num2 = lowestOffset + highestOffset; if (!grounding.rootGrounded) { num2 = 0f; } heightOffset = Mathf.Lerp(heightOffset, num2, num * grounding.pelvisSpeed); Vector3 p = grounding.root.position - lastRootPosition; lastRootPosition = grounding.root.position; damperF = Interp.LerpValue(damperF, isGrounded ? 1f : 0f, 1f, 10f); heightOffset -= grounding.GetVerticalOffset(p, Vector3.zero) * grounding.pelvisDamper * damperF; IKOffset = grounding.up * heightOffset; } } } [Tooltip("Layers to ground the character to. Make sure to exclude the layer of the character controller.")] public LayerMask layers; [Tooltip("Max step height. Maximum vertical distance of Grounding from the root of the character.")] public float maxStep = 0.5f; [Tooltip("The height offset of the root.")] public float heightOffset; [Tooltip("The speed of moving the feet up/down.")] public float footSpeed = 2.5f; [Tooltip("CapsuleCast radius. Should match approximately with the size of the feet.")] public float footRadius = 0.15f; [Tooltip("Offset of the foot center along character forward axis.")] [HideInInspector] public float footCenterOffset; [Tooltip("Amount of velocity based prediction of the foot positions.")] public float prediction = 0.05f; [Tooltip("Weight of rotating the feet to the ground normal offset.")] [Range(0f, 1f)] public float footRotationWeight = 1f; [Tooltip("Speed of slerping the feet to their grounded rotations.")] public float footRotationSpeed = 7f; [Tooltip("Max Foot Rotation Angle. Max angular offset from the foot's rotation.")] [Range(0f, 90f)] public float maxFootRotationAngle = 45f; [Tooltip("If true, solver will rotate with the character root so the character can be grounded for example to spherical planets. For performance reasons leave this off unless needed.")] public bool rotateSolver; [Tooltip("The speed of moving the character up/down.")] public float pelvisSpeed = 5f; [Tooltip("Used for smoothing out vertical pelvis movement (range 0 - 1).")] [Range(0f, 1f)] public float pelvisDamper; [Tooltip("The weight of lowering the pelvis to the lowest foot.")] public float lowerPelvisWeight = 1f; [Tooltip("The weight of lifting the pelvis to the highest foot. This is useful when you don't want the feet to go too high relative to the body when crouching.")] public float liftPelvisWeight; [Tooltip("The radius of the spherecast from the root that determines whether the character root is grounded.")] public float rootSphereCastRadius = 0.1f; [Tooltip("If false, keeps the foot that is over a ledge at the root level. If true, lowers the overstepping foot and body by the 'Max Step' value.")] public bool overstepFallsDown = true; [Tooltip("The raycasting quality. Fastest is a single raycast per foot, Simple is three raycasts, Best is one raycast and a capsule cast per foot.")] public Quality quality = Quality.Best; private bool initiated; public Leg[] legs { get; private set; } public Pelvis pelvis { get; private set; } public bool isGrounded { get; private set; } public Transform root { get; private set; } public RaycastHit rootHit { get; private set; } public bool rootGrounded { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = rootHit; return ((RaycastHit)(ref val)).distance < maxStep * 2f; } } public Vector3 up { get { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (!useRootRotation) { return Vector3.up; } return root.up; } } private bool useRootRotation { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (!rotateSolver) { return false; } if (root.up == Vector3.up) { return false; } return true; } } public RaycastHit GetRootHit(float maxDistanceMlp = 10f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) RaycastHit result = default(RaycastHit); Vector3 val = up; Vector3 val2 = Vector3.zero; Leg[] array = legs; foreach (Leg leg in array) { val2 += leg.transform.position; } val2 /= (float)legs.Length; ((RaycastHit)(ref result)).point = val2 - val * maxStep * 10f; float num = maxDistanceMlp + 1f; ((RaycastHit)(ref result)).distance = maxStep * num; if (maxStep <= 0f) { return result; } if (quality != Quality.Best) { Physics.Raycast(val2 + val * maxStep, -val, ref result, maxStep * num, LayerMask.op_Implicit(layers), (QueryTriggerInteraction)1); } else { Physics.SphereCast(val2 + val * maxStep, rootSphereCastRadius, -up, ref result, maxStep * num, LayerMask.op_Implicit(layers), (QueryTriggerInteraction)1); } return result; } public bool IsValid(ref string errorMessage) { if ((Object)(object)root == (Object)null) { errorMessage = "Root transform is null. Can't initiate Grounding."; return false; } if (legs == null) { errorMessage = "Grounding legs is null. Can't initiate Grounding."; return false; } if (pelvis == null) { errorMessage = "Grounding pelvis is null. Can't initiate Grounding."; return false; } if (legs.Length == 0) { errorMessage = "Grounding has 0 legs. Can't initiate Grounding."; return false; } return true; } public void Initiate(Transform root, Transform[] feet) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) this.root = root; initiated = false; rootHit = default(RaycastHit); if (legs == null) { legs = new Leg[feet.Length]; } if (legs.Length != feet.Length) { legs = new Leg[feet.Length]; } for (int i = 0; i < feet.Length; i++) { if (legs[i] == null) { legs[i] = new Leg(); } } if (pelvis == null) { pelvis = new Pelvis(); } string errorMessage = string.Empty; if (!IsValid(ref errorMessage)) { Warning.Log(errorMessage, root); } else if (Application.isPlaying) { for (int j = 0; j < feet.Length; j++) { legs[j].Initiate(this, feet[j]); } pelvis.Initiate(this); initiated = true; } } public void Update() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return; } if (LayerMask.op_Implicit(layers) == 0) { LogWarning("Grounding layers are set to nothing. Please add a ground layer."); } maxStep = Mathf.Clamp(maxStep, 0f, maxStep); footRadius = Mathf.Clamp(footRadius, 0.0001f, maxStep); pelvisDamper = Mathf.Clamp(pelvisDamper, 0f, 1f); rootSphereCastRadius = Mathf.Clamp(rootSphereCastRadius, 0.0001f, rootSphereCastRadius); maxFootRotationAngle = Mathf.Clamp(maxFootRotationAngle, 0f, 90f); prediction = Mathf.Clamp(prediction, 0f, prediction); footSpeed = Mathf.Clamp(footSpeed, 0f, footSpeed); rootHit = GetRootHit(); float num = float.NegativeInfinity; float num2 = float.PositiveInfinity; isGrounded = false; Leg[] array = legs; foreach (Leg leg in array) { leg.Process(); if (leg.IKOffset > num) { num = leg.IKOffset; } if (leg.IKOffset < num2) { num2 = leg.IKOffset; } if (leg.isGrounded) { isGrounded = true; } } num = Mathf.Max(num, 0f); num2 = Mathf.Min(num2, 0f); pelvis.Process((0f - num) * lowerPelvisWeight, (0f - num2) * liftPelvisWeight, isGrounded); } public Vector3 GetLegsPlaneNormal() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return Vector3.up; } Vector3 val = up; Vector3 val2 = val; for (int i = 0; i < legs.Length; i++) { Vector3 val3 = legs[i].IKPosition - root.position; Vector3 val4 = val; Vector3 val5 = val3; Vector3.OrthoNormalize(ref val4, ref val5); val2 = Quaternion.FromToRotation(val5, val3) * val2; } return val2; } public void Reset() { if (Application.isPlaying) { pelvis.Reset(); Leg[] array = legs; for (int i = 0; i < array.Length; i++) { array[i].Reset(); } } } public void LogWarning(string message) { Warning.Log(message, root); } public float GetVerticalOffset(Vector3 p1, Vector3 p2) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (useRootRotation) { return (Quaternion.Inverse(root.rotation) * (p1 - p2)).y; } return p1.y - p2.y; } public Vector3 Flatten(Vector3 v) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (useRootRotation) { Vector3 val = v; Vector3 val2 = root.up; Vector3.OrthoNormalize(ref val2, ref val); return Vector3.Project(v, val); } v.y = 0f; return v; } public Vector3 GetFootCenterOffset() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) return root.forward * footRadius + root.forward * footCenterOffset; } } [HelpURL("https://www.youtube.com/watch?v=wT8fViZpLmQ&index=3&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Aim IK")] public class AimIK : IK { public IKSolverAim solver = new IKSolverAim(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page1.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_aim_i_k.html"); } [ContextMenu("TUTORIAL VIDEO")] private void OpenSetupTutorial() { Application.OpenURL("https://www.youtube.com/watch?v=wT8fViZpLmQ"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page2.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Arm IK")] public class ArmIK : IK { public IKSolverArm solver = new IKSolverArm(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page2.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_arm_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page5.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/CCD IK")] public class CCDIK : IK { public IKSolverCCD solver = new IKSolverCCD(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page5.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_c_c_d_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page6.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/FABRIK")] public class FABRIK : IK { public IKSolverFABRIK solver = new IKSolverFABRIK(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page6.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_f_a_b_r_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page7.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/FABRIK Root")] public class FABRIKRoot : IK { public IKSolverFABRIKRoot solver = new IKSolverFABRIKRoot(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page7.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_f_a_b_r_i_k_root.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("https://www.youtube.com/watch?v=7__IafZGwvI&index=1&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Full Body Biped IK")] public class FullBodyBipedIK : IK { public BipedReferences references = new BipedReferences(); public IKSolverFullBodyBiped solver = new IKSolverFullBodyBiped(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page8.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_full_body_biped_i_k.html"); } [ContextMenu("TUTORIAL VIDEO (SETUP)")] private void OpenSetupTutorial() { Application.OpenURL("https://www.youtube.com/watch?v=7__IafZGwvI"); } [ContextMenu("TUTORIAL VIDEO (INSPECTOR)")] private void OpenInspectorTutorial() { Application.OpenURL("https://www.youtube.com/watch?v=tgRMsTphjJo"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public void SetReferences(BipedReferences references, Transform rootNode) { this.references = references; solver.SetToReferences(this.references, rootNode); } public override IKSolver GetIKSolver() { return solver; } public bool ReferencesError(ref string errorMessage) { if (BipedReferences.SetupError(references, ref errorMessage)) { return true; } if (references.spine.Length == 0) { errorMessage = "References has no spine bones assigned, can not initiate the solver."; return true; } if ((Object)(object)solver.rootNode == (Object)null) { errorMessage = "Root Node bone is null, can not initiate the solver."; return true; } if ((Object)(object)solver.rootNode != (Object)(object)references.pelvis) { bool flag = false; for (int i = 0; i < references.spine.Length; i++) { if ((Object)(object)solver.rootNode == (Object)(object)references.spine[i]) { flag = true; break; } } if (!flag) { errorMessage = "The Root Node has to be one of the bones in the Spine or the Pelvis, can not initiate the solver."; return true; } } return false; } public bool ReferencesWarning(ref string warningMessage) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) if (BipedReferences.SetupWarning(references, ref warningMessage)) { return true; } Vector3 val = references.rightUpperArm.position - references.leftUpperArm.position; Vector3 val2 = solver.rootNode.position - references.leftUpperArm.position; if (Vector3.Dot(((Vector3)(ref val)).normalized, ((Vector3)(ref val2)).normalized) > 0.95f) { warningMessage = "The root node, the left upper arm and the right upper arm bones should ideally form a triangle that is as close to equilateral as possible. Currently the root node bone seems to be very close to the line between the left upper arm and the right upper arm bones. This might cause unwanted behaviour like the spine turning upside down when pulled by a hand effector.Please set the root node bone to be one of the lower bones in the spine."; return true; } Vector3 val3 = references.rightThigh.position - references.leftThigh.position; Vector3 val4 = solver.rootNode.position - references.leftThigh.position; if (Vector3.Dot(((Vector3)(ref val3)).normalized, ((Vector3)(ref val4)).normalized) > 0.95f) { warningMessage = "The root node, the left thigh and the right thigh bones should ideally form a triangle that is as close to equilateral as possible. Currently the root node bone seems to be very close to the line between the left thigh and the right thigh bones. This might cause unwanted behaviour like the hip turning upside down when pulled by an effector.Please set the root node bone to be one of the higher bones in the spine."; return true; } return false; } [ContextMenu("Reinitiate")] private void Reinitiate() { SetReferences(references, solver.rootNode); } [ContextMenu("Auto-detect References")] private void AutoDetectReferences() { references = new BipedReferences(); BipedReferences.AutoDetectReferences(ref references, ((Component)this).transform, new BipedReferences.AutoDetectParams(legsParentInSpine: true, includeEyes: false)); solver.rootNode = IKSolverFullBodyBiped.DetectRootNodeBone(references); solver.SetToReferences(references, solver.rootNode); } } public abstract class IK : SolverManager { public abstract IKSolver GetIKSolver(); protected override void UpdateSolver() { if (!GetIKSolver().initiated) { InitiateSolver(); } if (GetIKSolver().initiated) { GetIKSolver().Update(); } } protected override void InitiateSolver() { if (!GetIKSolver().initiated) { GetIKSolver().Initiate(((Component)this).transform); } } protected override void FixTransforms() { if (GetIKSolver().initiated) { GetIKSolver().FixTransforms(); } } protected abstract void OpenUserManual(); protected abstract void OpenScriptReference(); } public class IKExecutionOrder : MonoBehaviour { [Tooltip("The IK components, assign in the order in which you wish to update them.")] public IK[] IKComponents; [Tooltip("Optional. Assign it if you are using 'Animate Physics' as the Update Mode.")] public Animator animator; private bool fixedFrame; private bool animatePhysics { get { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 if ((Object)(object)animator == (Object)null) { return false; } return (int)animator.updateMode == 1; } } private void Start() { for (int i = 0; i < IKComponents.Length; i++) { ((Behaviour)IKComponents[i]).enabled = false; } } private void Update() { if (!animatePhysics) { FixTransforms(); } } private void FixedUpdate() { fixedFrame = true; if (animatePhysics) { FixTransforms(); } } private void LateUpdate() { if (!animatePhysics || fixedFrame) { for (int i = 0; i < IKComponents.Length; i++) { IKComponents[i].GetIKSolver().Update(); } fixedFrame = false; } } private void FixTransforms() { for (int i = 0; i < IKComponents.Length; i++) { if (IKComponents[i].fixTransforms) { IKComponents[i].GetIKSolver().FixTransforms(); } } } } [HelpURL("http://www.root-motion.com/finalikdox/html/page11.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Leg IK")] public class LegIK : IK { public IKSolverLeg solver = new IKSolverLeg(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page11.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_leg_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page12.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Limb IK")] public class LimbIK : IK { public IKSolverLimb solver = new IKSolverLimb(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page12.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_limb_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page13.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Look At IK")] public class LookAtIK : IK { public IKSolverLookAt solver = new IKSolverLookAt(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page13.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_look_at_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page15.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Trigonometric IK")] public class TrigonometricIK : IK { public IKSolverTrigonometric solver = new IKSolverTrigonometric(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page15.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_trigonometric_i_k.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public override IKSolver GetIKSolver() { return solver; } } [AddComponentMenu("Scripts/RootMotion.FinalIK/IK/VR IK")] public class VRIK : IK { [Serializable] public class References { public Transform root; public Transform pelvis; public Transform spine; [Tooltip("Optional")] public Transform chest; [Tooltip("Optional")] public Transform neck; public Transform head; [Tooltip("Optional")] public Transform leftShoulder; public Transform leftUpperArm; public Transform leftForearm; public Transform leftHand; [Tooltip("Optional")] public Transform rightShoulder; public Transform rightUpperArm; public Transform rightForearm; public Transform rightHand; [Tooltip("VRIK also supports legless characters.If you do not wish to use legs, leave all leg references empty.")] public Transform leftThigh; [Tooltip("VRIK also supports legless characters.If you do not wish to use legs, leave all leg references empty.")] public Transform leftCalf; [Tooltip("VRIK also supports legless characters.If you do not wish to use legs, leave all leg references empty.")] public Transform leftFoot; [Tooltip("Optional")] public Transform leftToes; [Tooltip("VRIK also supports legless characters.If you do not wish to use legs, leave all leg references empty.")] public Transform rightThigh; [Tooltip("VRIK also supports legless characters.If you do not wish to use legs, leave all leg references empty.")] public Transform rightCalf; [Tooltip("VRIK also supports legless characters.If you do not wish to use legs, leave all leg references empty.")] public Transform rightFoot; [Tooltip("Optional")] public Transform rightToes; public bool isFilled { get { if ((Object)(object)root == (Object)null || (Object)(object)pelvis == (Object)null || (Object)(object)spine == (Object)null || (Object)(object)head == (Object)null || (Object)(object)leftUpperArm == (Object)null || (Object)(object)leftForearm == (Object)null || (Object)(object)leftHand == (Object)null || (Object)(object)rightUpperArm == (Object)null || (Object)(object)rightForearm == (Object)null || (Object)(object)rightHand == (Object)null) { return false; } if ((Object)(object)leftThigh == (Object)null && (Object)(object)leftCalf == (Object)null && (Object)(object)leftFoot == (Object)null && (Object)(object)rightThigh == (Object)null && (Object)(object)rightCalf == (Object)null && (Object)(object)rightFoot == (Object)null) { return true; } if ((Object)(object)leftThigh == (Object)null || (Object)(object)leftCalf == (Object)null || (Object)(object)leftFoot == (Object)null || (Object)(object)rightThigh == (Object)null || (Object)(object)rightCalf == (Object)null || (Object)(object)rightFoot == (Object)null) { return false; } return true; } } public bool isEmpty { get { if ((Object)(object)root != (Object)null || (Object)(object)pelvis != (Object)null || (Object)(object)spine != (Object)null || (Object)(object)chest != (Object)null || (Object)(object)neck != (Object)null || (Object)(object)head != (Object)null || (Object)(object)leftShoulder != (Object)null || (Object)(object)leftUpperArm != (Object)null || (Object)(object)leftForearm != (Object)null || (Object)(object)leftHand != (Object)null || (Object)(object)rightShoulder != (Object)null || (Object)(object)rightUpperArm != (Object)null || (Object)(object)rightForearm != (Object)null || (Object)(object)rightHand != (Object)null || (Object)(object)leftThigh != (Object)null || (Object)(object)leftCalf != (Object)null || (Object)(object)leftFoot != (Object)null || (Object)(object)leftToes != (Object)null || (Object)(object)rightThigh != (Object)null || (Object)(object)rightCalf != (Object)null || (Object)(object)rightFoot != (Object)null || (Object)(object)rightToes != (Object)null) { return false; } return true; } } public Transform[] GetTransforms() { return (Transform[])(object)new Transform[22] { root, pelvis, spine, chest, neck, head, leftShoulder, leftUpperArm, leftForearm, leftHand, rightShoulder, rightUpperArm, rightForearm, rightHand, leftThigh, leftCalf, leftFoot, leftToes, rightThigh, rightCalf, rightFoot, rightToes }; } public static bool AutoDetectReferences(Transform root, out References references) { references = new References(); Animator componentInChildren = ((Component)root).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null || !componentInChildren.isHuman) { Debug.LogWarning((object)"VRIK needs a Humanoid Animator to auto-detect biped references. Please assign references manually."); return false; } references.root = root; references.pelvis = componentInChildren.GetBoneTransform((HumanBodyBones)0); references.spine = componentInChildren.GetBoneTransform((HumanBodyBones)7); references.chest = componentInChildren.GetBoneTransform((HumanBodyBones)8); references.neck = componentInChildren.GetBoneTransform((HumanBodyBones)9); references.head = componentInChildren.GetBoneTransform((HumanBodyBones)10); references.leftShoulder = componentInChildren.GetBoneTransform((HumanBodyBones)11); references.leftUpperArm = componentInChildren.GetBoneTransform((HumanBodyBones)13); references.leftForearm = componentInChildren.GetBoneTransform((HumanBodyBones)15); references.leftHand = componentInChildren.GetBoneTransform((HumanBodyBones)17); references.rightShoulder = componentInChildren.GetBoneTransform((HumanBodyBones)12); references.rightUpperArm = componentInChildren.GetBoneTransform((HumanBodyBones)14); references.rightForearm = componentInChildren.GetBoneTransform((HumanBodyBones)16); references.rightHand = componentInChildren.GetBoneTransform((HumanBodyBones)18); references.leftThigh = componentInChildren.GetBoneTransform((HumanBodyBones)1); references.leftCalf = componentInChildren.GetBoneTransform((HumanBodyBones)3); references.leftFoot = componentInChildren.GetBoneTransform((HumanBodyBones)5); references.leftToes = componentInChildren.GetBoneTransform((HumanBodyBones)19); references.rightThigh = componentInChildren.GetBoneTransform((HumanBodyBones)2); references.rightCalf = componentInChildren.GetBoneTransform((HumanBodyBones)4); references.rightFoot = componentInChildren.GetBoneTransform((HumanBodyBones)6); references.rightToes = componentInChildren.GetBoneTransform((HumanBodyBones)20); return true; } } [ContextMenuItem("Auto-detect References", "AutoDetectReferences")] [Tooltip("Bone mapping. Right-click on the component header and select 'Auto-detect References' of fill in manually if not a Humanoid character. Chest, neck, shoulder and toe bones are optional. VRIK also supports legless characters. If you do not wish to use legs, leave all leg references empty.")] public References references = new References(); [Tooltip("The VRIK solver.")] public IKSolverVR solver = new IKSolverVR(); [ContextMenu("User Manual")] protected override void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page16.html"); } [ContextMenu("Scrpt Reference")] protected override void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_v_r_i_k.html"); } [ContextMenu("TUTORIAL VIDEO (STEAMVR SETUP)")] private void OpenSetupTutorial() { Application.OpenURL("https://www.youtube.com/watch?v=6Pfx7lYQiIA&feature=youtu.be"); } [ContextMenu("Auto-detect References")] public void AutoDetectReferences() { References.AutoDetectReferences(((Component)this).transform, out references); } [ContextMenu("Guess Hand Orientations")] public void GuessHandOrientations() { solver.GuessHandOrientations(references, onlyIfZero: false); } public override IKSolver GetIKSolver() { return solver; } protected override void InitiateSolver() { if (references.isEmpty) { AutoDetectReferences(); } if (references.isFilled) { solver.SetToReferences(references); } base.InitiateSolver(); } protected override void UpdateSolver() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)references.root != (Object)null && references.root.localScale == Vector3.zero) { Debug.LogError((object)"VRIK Root Transform's scale is zero, can not update VRIK. Make sure you have not calibrated the character to a zero scale.", (Object)(object)((Component)this).transform); ((Behaviour)this).enabled = false; } else { base.UpdateSolver(); } } } [RequireComponent(typeof(Animator))] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK Jobs/Aim IKJ")] public class AimIKJ : MonoBehaviour { [Tooltip("The target Transform of this solver.")] public Transform target; [Tooltip("Optional secondary target for another axis of the 'Aim Transform'. Needs 'Pole Weight' to be greater than 0 to have any effect.")] public Transform poleTarget; [Tooltip("The transform that you want to be aimed at the target. Needs to be a lineal descendant of the bone hierarchy. For example, if you wish to aim a gun, it should be the gun, one of it's children or the hand bone.")] public Transform aimTransform; [Space(5f)] [Tooltip("The X value of the local axis of the 'Aim Transform' that you want to be aimed at IKPosition.")] public float axisX; [Tooltip("The Y value of the local axis of the 'Aim Transform' that you want to be aimed at IKPosition.")] public float axisY; [Tooltip("The Z value of the local axis of the 'Aim Transform' that you want to be aimed at IKPosition.")] public float axisZ = 1f; [Space(5f)] [Tooltip("The X value of the local axis of the 'Aim Transform' that you want oriented towards the 'Pole Target'.")] public float poleAxisX; [Tooltip("The Y value of the local axis of the 'Aim Transform' that you want oriented towards the 'Pole Target'.")] public float poleAxisY = 1f; [Tooltip("The Z value of the local axis of the 'Aim Transform' that you want oriented towards the 'Pole Target'.")] public float poleAxisZ; [Space(5f)] [Tooltip("The master weight of this solver.")] [Range(0f, 1f)] public float weight = 1f; [Tooltip("The weight of the 'Pole Target'")] [Range(0f, 1f)] public float poleWeight; [Tooltip("Minimum angular offset from last reached angle. Will stop solving if offset is less than tolerance.If tolerance is zero, will iterate until maxIterations.")] public float tolerance; [Tooltip("Max solver iterations per frame. If target position offset is less than 'Tolerance', will stop solving.")] public int maxIterations = 4; [Tooltip("Clamping rotation of the solver. 0 is free rotation, 1 is completely clamped to animated rotation.")] [Range(0f, 1f)] public float clampWeight = 0.1f; [Tooltip("Number of sine smoothing iterations applied on clamping to make the clamping point smoother.")] [Range(0f, 2f)] public int clampSmoothing = 2; [Tooltip("If true, rotation limits (if existing) will be applied on each iteration. Only RotationLimitAngle and RotationLimitHinge can be used with this solver.")] public bool useRotationLimits = true; [Tooltip("Useful for 2D games. If true, will solve only in the XY plane.")] public bool XY; [Space(5f)] [Tooltip("The list of bones used by the solver. Must be assigned in order of hierarchy. All bones must be in the same hierarchy branch.")] public Transform[] bones = (Transform[])(object)new Transform[0]; private Animator animator; private PlayableGraph graph; private AnimationScriptPlayable IKPlayable; private AimIKJob job; public bool initiated { get; private set; } public Vector3 axis { get { //IL_0012: Unknown result type (might be due to invalid IL or missing references) return new Vector3(axisX, axisY, axisZ); } set { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) axisX = value.x; axisY = value.y; axisZ = value.z; } } public Vector3 poleAxis { get { //IL_0012: Unknown result type (might be due to invalid IL or missing references) return new Vector3(poleAxisX, poleAxisY, poleAxisZ); } set { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) poleAxisX = value.x; poleAxisY = value.y; poleAxisZ = value.z; } } private void OnEnable() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) if (bones.Length >= 1 && !(axis == Vector3.zero) && (!(poleAxis == Vector3.zero) || !(poleWeight > 0f))) { animator = ((Component)this).GetComponent(); if ((Object)(object)aimTransform == (Object)null) { aimTransform = bones[bones.Length - 1]; } if ((Object)(object)target == (Object)null) { target = new GameObject("AimIKJ Target (" + ((Object)this).name + ")").transform; target.position = bones[bones.Length - 1].position + aimTransform.rotation * axis * 3f; } if ((Object)(object)poleTarget == (Object)null) { poleTarget = new GameObject("AimIKJ Pole Target (" + ((Object)this).name + ")").transform; poleTarget.position = bones[bones.Length - 1].position + aimTransform.rotation * poleAxis * 3f; } graph = PlayableGraph.Create("AimIKJ"); AnimationPlayableOutput val = AnimationPlayableOutput.Create(graph, "ouput", ((Component)this).GetComponent()); job = default(AimIKJob); job.Setup(((Component)this).GetComponent(), bones, target, poleTarget, aimTransform); IKPlayable = AnimationScriptPlayable.Create(graph, job, 0); AnimatorControllerPlayable val2 = AnimatorControllerPlayable.Create(graph, animator.runtimeAnimatorController); PlayableExtensions.AddInput(IKPlayable, val2, 0, 1f); PlayableOutputExtensions.SetSourcePlayable(val, IKPlayable); ((PlayableGraph)(ref graph)).Play(); initiated = true; } } private void Update() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { if (bones.Length < 1) { Debug.LogError((object)"AimIKJ needs at least 1 bone to run.", (Object)(object)((Component)this).transform); ((Behaviour)this).enabled = false; } else if (new Vector3(axisX, axisY, axisZ) == Vector3.zero) { Debug.Log((object)"AimIKJ 'Axis' must not be zero.", (Object)(object)((Component)this).transform); } else if (new Vector3(poleAxisX, poleAxisY, poleAxisZ) == Vector3.zero && poleWeight > 0f) { Debug.Log((object)"AimIKJ 'Pole Axis' must not be zero when 'Pole Weight' is greater than 0.", (Object)(object)((Component)this).transform); } else { OnEnable(); } } else if (initiated) { if ((Object)(object)target == (Object)null) { Debug.LogError((object)"AimIKJ 'Target' has gone missing, destroying AimIKJ.", (Object)(object)((Component)this).transform); Object.Destroy((Object)(object)this); } else if ((Object)(object)poleTarget == (Object)null) { Debug.LogError((object)"AimIKJ 'Pole Target' has gone missing, destroying AimIKJ.", (Object)(object)((Component)this).transform); Object.Destroy((Object)(object)this); } else if ((Object)(object)aimTransform == (Object)null) { Debug.LogError((object)"AimIKJ 'Aim transform' has gone missing, destroying AimIKJ.", (Object)(object)((Component)this).transform); Object.Destroy((Object)(object)this); } } } private void OnDisable() { if (initiated) { job.Dispose(); ((PlayableGraph)(ref graph)).Destroy(); Object.Destroy((Object)(object)target); } } } public struct AimIKJob : IAnimationJob { public TransformSceneHandle _target; public TransformSceneHandle _poleTarget; public TransformStreamHandle _transform; public PropertySceneHandle _IKPositionWeight; public PropertySceneHandle _poleWeight; public PropertySceneHandle _axisX; public PropertySceneHandle _axisY; public PropertySceneHandle _axisZ; public PropertySceneHandle _poleAxisX; public PropertySceneHandle _poleAxisY; public PropertySceneHandle _poleAxisZ; public PropertySceneHandle _clampWeight; public PropertySceneHandle _clampSmoothing; public PropertySceneHandle _maxIterations; public PropertySceneHandle _tolerance; public PropertySceneHandle _XY; public PropertySceneHandle _useRotationLimits; private NativeArray bones; private NativeArray boneWeights; private Vector3 lastLocalDirection; private float step; private NativeArray limitDefaultLocalRotationArray; private NativeArray limitAxisArray; private NativeArray hingeFlags; private NativeArray hingeMinArray; private NativeArray hingeMaxArray; private NativeArray hingeUseLimitsArray; private NativeArray hingeLastRotations; private NativeArray hingeLastAngles; private NativeArray angleFlags; private NativeArray angleSecondaryAxisArray; private NativeArray angleLimitArray; private NativeArray angleTwistLimitArray; public void Setup(Animator animator, Transform[] bones, Transform target, Transform poleTarget, Transform aimTransform) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) this.bones = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); boneWeights = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); for (int i = 0; i < this.bones.Length; i++) { this.bones[i] = AnimatorJobExtensions.BindStreamTransform(animator, bones[i]); } for (int j = 0; j < this.bones.Length; j++) { if ((Object)(object)((Component)bones[j]).gameObject.GetComponent() == (Object)null) { ((Component)bones[j]).gameObject.AddComponent(); } boneWeights[j] = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)bones[j]).transform, typeof(IKJBoneParams), "weight"); } SetUpRotationLimits(animator, bones); _target = AnimatorJobExtensions.BindSceneTransform(animator, target); _poleTarget = AnimatorJobExtensions.BindSceneTransform(animator, poleTarget); _transform = AnimatorJobExtensions.BindStreamTransform(animator, aimTransform); _IKPositionWeight = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "weight"); _poleWeight = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "poleWeight"); _axisX = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "axisX"); _axisY = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "axisY"); _axisZ = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "axisZ"); _poleAxisX = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "poleAxisX"); _poleAxisY = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "poleAxisY"); _poleAxisZ = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "poleAxisZ"); _clampWeight = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "clampWeight"); _clampSmoothing = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "clampSmoothing"); _maxIterations = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "maxIterations"); _tolerance = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "tolerance"); _XY = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "XY"); _useRotationLimits = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(AimIKJ), "useRotationLimits"); step = 1f / (float)bones.Length; } private void SetUpRotationLimits(Animator animator, Transform[] bones) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) limitDefaultLocalRotationArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); limitAxisArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); hingeFlags = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); hingeMinArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); hingeMaxArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); hingeUseLimitsArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); hingeLastRotations = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); hingeLastAngles = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); angleFlags = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); angleSecondaryAxisArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); angleLimitArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); angleTwistLimitArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); for (int i = 0; i < bones.Length - 1; i++) { hingeFlags[i] = 0; angleFlags[i] = 0; RotationLimit component = ((Component)bones[i]).GetComponent(); if ((Object)(object)component != (Object)null) { limitDefaultLocalRotationArray[i] = bones[i].localRotation; limitAxisArray[i] = component.axis; component.Disable(); if (component is RotationLimitHinge) { hingeFlags[i] = 1; hingeMinArray[i] = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)bones[i]).transform, typeof(RotationLimitHinge), "min"); hingeMaxArray[i] = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)bones[i]).transform, typeof(RotationLimitHinge), "max"); hingeUseLimitsArray[i] = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)bones[i]).transform, typeof(RotationLimitHinge), "useLimits"); hingeLastRotations[i] = bones[i].localRotation; hingeLastAngles[i] = 0f; } if (component is RotationLimitAngle) { RotationLimitAngle rotationLimitAngle = component as RotationLimitAngle; angleFlags[i] = 1; angleSecondaryAxisArray[i] = rotationLimitAngle.secondaryAxis; angleLimitArray[i] = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)bones[i]).transform, typeof(RotationLimitAngle), "limit"); angleTwistLimitArray[i] = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)bones[i]).transform, typeof(RotationLimitAngle), "twistLimit"); } } } } private void DisposeRotationLimits() { limitDefaultLocalRotationArray.Dispose(); limitAxisArray.Dispose(); hingeFlags.Dispose(); hingeMinArray.Dispose(); hingeMaxArray.Dispose(); hingeUseLimitsArray.Dispose(); hingeLastRotations.Dispose(); hingeLastAngles.Dispose(); angleFlags.Dispose(); angleSecondaryAxisArray.Dispose(); angleLimitArray.Dispose(); angleTwistLimitArray.Dispose(); } public void ProcessRootMotion(AnimationStream stream) { } public void ProcessAnimation(AnimationStream stream) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Update(stream); } private void Update(AnimationStream s) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) if (!((TransformSceneHandle)(ref _target)).IsValid(s) || !((TransformSceneHandle)(ref _poleTarget)).IsValid(s) || !((TransformStreamHandle)(ref _transform)).IsValid(s)) { return; } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(((PropertySceneHandle)(ref _axisX)).GetFloat(s), ((PropertySceneHandle)(ref _axisY)).GetFloat(s), ((PropertySceneHandle)(ref _axisZ)).GetFloat(s)); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(((PropertySceneHandle)(ref _poleAxisX)).GetFloat(s), ((PropertySceneHandle)(ref _poleAxisY)).GetFloat(s), ((PropertySceneHandle)(ref _poleAxisZ)).GetFloat(s)); float @float = ((PropertySceneHandle)(ref _poleWeight)).GetFloat(s); @float = Mathf.Clamp(@float, 0f, 1f); if (val == Vector3.zero || (val2 == Vector3.zero && @float > 0f)) { return; } float float2 = ((PropertySceneHandle)(ref _IKPositionWeight)).GetFloat(s); if (float2 <= 0f) { return; } float2 = Mathf.Min(float2, 1f); bool @bool = ((PropertySceneHandle)(ref _XY)).GetBool(s); float num = ((PropertySceneHandle)(ref _maxIterations)).GetInt(s); float float3 = ((PropertySceneHandle)(ref _tolerance)).GetFloat(s); bool bool2 = ((PropertySceneHandle)(ref _useRotationLimits)).GetBool(s); Vector3 position = ((TransformSceneHandle)(ref _target)).GetPosition(s); if (@bool) { TransformStreamHandle val3 = bones[0]; position.z = ((TransformStreamHandle)(ref val3)).GetPosition(s).z; } Vector3 position2 = ((TransformSceneHandle)(ref _poleTarget)).GetPosition(s); if (@bool) { position2.z = position.z; } float float4 = ((PropertySceneHandle)(ref _clampWeight)).GetFloat(s); float4 = Mathf.Clamp(float4, 0f, 1f); int @int = ((PropertySceneHandle)(ref _clampSmoothing)).GetInt(s); @int = Mathf.Clamp(@int, 0, 2); Vector3 position3 = ((TransformStreamHandle)(ref _transform)).GetPosition(s); Vector3 val4 = ((TransformStreamHandle)(ref _transform)).GetRotation(s) * val; Vector3 clampedIKPosition = GetClampedIKPosition(s, float4, @int, position, position3, val4); Vector3 val5 = clampedIKPosition - position3; val5 = Vector3.Slerp(val4 * ((Vector3)(ref val5)).magnitude, val5, float2); clampedIKPosition = position3 + val5; for (int i = 0; (float)i < num && (i < 0 || !(float3 > 0f) || !(GetAngle(s, val, position) < float3)); i++) { lastLocalDirection = GetLocalDirection(s, ((TransformStreamHandle)(ref _transform)).GetRotation(s) * val); PropertySceneHandle val6; for (int j = 0; j < bones.Length - 1; j++) { Vector3 targetPosition = clampedIKPosition; Vector3 polePosition = position2; int i2 = j; float num2 = step * (float)(j + 1) * float2; val6 = boneWeights[j]; RotateToTarget(s, targetPosition, polePosition, i2, num2 * ((PropertySceneHandle)(ref val6)).GetFloat(s), @float, @bool, bool2, val, val2); } Vector3 targetPosition2 = clampedIKPosition; Vector3 polePosition2 = position2; int i3 = bones.Length - 1; float num3 = float2; val6 = boneWeights[bones.Length - 1]; RotateToTarget(s, targetPosition2, polePosition2, i3, num3 * ((PropertySceneHandle)(ref val6)).GetFloat(s), @float, @bool, bool2, val, val2); } lastLocalDirection = GetLocalDirection(s, ((TransformStreamHandle)(ref _transform)).GetRotation(s) * val); } private void RotateToTarget(AnimationStream s, Vector3 targetPosition, Vector3 polePosition, int i, float weight, float poleWeight, bool XY, bool useRotationLimits, Vector3 axis, Vector3 poleAxis) { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) TransformStreamHandle val3; TransformStreamHandle val5; if (XY) { if (weight >= 0f) { Vector3 val = ((TransformStreamHandle)(ref _transform)).GetRotation(s) * axis; Vector3 val2 = targetPosition - ((TransformStreamHandle)(ref _transform)).GetPosition(s); float num = Mathf.Atan2(val.x, val.y) * 57.29578f; float num2 = Mathf.Atan2(val2.x, val2.y) * 57.29578f; val3 = bones[i]; Quaternion val4 = Quaternion.AngleAxis(Mathf.DeltaAngle(num, num2), Vector3.back); val5 = bones[i]; ((TransformStreamHandle)(ref val3)).SetRotation(s, val4 * ((TransformStreamHandle)(ref val5)).GetRotation(s)); } } else { if (weight >= 0f) { Quaternion val6 = Quaternion.FromToRotation(((TransformStreamHandle)(ref _transform)).GetRotation(s) * axis, targetPosition - ((TransformStreamHandle)(ref _transform)).GetPosition(s)); if (weight >= 1f) { val3 = bones[i]; val5 = bones[i]; ((TransformStreamHandle)(ref val3)).SetRotation(s, val6 * ((TransformStreamHandle)(ref val5)).GetRotation(s)); } else { val3 = bones[i]; Quaternion val7 = Quaternion.Lerp(Quaternion.identity, val6, weight); val5 = bones[i]; ((TransformStreamHandle)(ref val3)).SetRotation(s, val7 * ((TransformStreamHandle)(ref val5)).GetRotation(s)); } } if (poleWeight > 0f) { Vector3 val8 = polePosition - ((TransformStreamHandle)(ref _transform)).GetPosition(s); Vector3 val9 = ((TransformStreamHandle)(ref _transform)).GetRotation(s) * axis; Vector3.OrthoNormalize(ref val9, ref val8); Quaternion val10 = Quaternion.FromToRotation(((TransformStreamHandle)(ref _transform)).GetRotation(s) * poleAxis, val8); val3 = bones[i]; Quaternion val11 = Quaternion.Lerp(Quaternion.identity, val10, weight * poleWeight); val5 = bones[i]; ((TransformStreamHandle)(ref val3)).SetRotation(s, val11 * ((TransformStreamHandle)(ref val5)).GetRotation(s)); } } if (useRotationLimits) { PropertySceneHandle val13; if (hingeFlags[i] == 1) { Quaternion val12 = Quaternion.Inverse(limitDefaultLocalRotationArray[i]); val3 = bones[i]; Quaternion rotation = val12 * ((TransformStreamHandle)(ref val3)).GetLocalRotation(s); Quaternion lastRotation = hingeLastRotations[i]; float lastAngle = hingeLastAngles[i]; val13 = hingeMinArray[i]; float @float = ((PropertySceneHandle)(ref val13)).GetFloat(s); val13 = hingeMaxArray[i]; float float2 = ((PropertySceneHandle)(ref val13)).GetFloat(s); val13 = hingeUseLimitsArray[i]; Quaternion val14 = RotationLimitUtilities.LimitHinge(rotation, @float, float2, ((PropertySceneHandle)(ref val13)).GetBool(s), limitAxisArray[i], ref lastRotation, ref lastAngle); hingeLastRotations[i] = lastRotation; hingeLastAngles[i] = lastAngle; val3 = bones[i]; ((TransformStreamHandle)(ref val3)).SetLocalRotation(s, limitDefaultLocalRotationArray[i] * val14); } else if (angleFlags[i] == 1) { Quaternion val15 = Quaternion.Inverse(limitDefaultLocalRotationArray[i]); val3 = bones[i]; Quaternion rotation2 = val15 * ((TransformStreamHandle)(ref val3)).GetLocalRotation(s); Vector3 axis2 = limitAxisArray[i]; Vector3 secondaryAxis = angleSecondaryAxisArray[i]; val13 = angleLimitArray[i]; float float3 = ((PropertySceneHandle)(ref val13)).GetFloat(s); val13 = angleTwistLimitArray[i]; Quaternion val16 = RotationLimitUtilities.LimitAngle(rotation2, axis2, secondaryAxis, float3, ((PropertySceneHandle)(ref val13)).GetFloat(s)); val3 = bones[i]; ((TransformStreamHandle)(ref val3)).SetLocalRotation(s, limitDefaultLocalRotationArray[i] * val16); } } } public float GetAngle(AnimationStream s, Vector3 axis, Vector3 IKPosition) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) return Vector3.Angle(((TransformStreamHandle)(ref _transform)).GetRotation(s) * axis, IKPosition - ((TransformStreamHandle)(ref _transform)).GetPosition(s)); } private Vector3 GetClampedIKPosition(AnimationStream s, float clampWeight, int clampSmoothing, Vector3 IKPosition, Vector3 transformPosition, Vector3 transformAxis) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) if (clampWeight <= 0f) { return IKPosition; } if (clampWeight >= 1f) { Vector3 val = IKPosition - transformPosition; return transformPosition + transformAxis * ((Vector3)(ref val)).magnitude; } float num = Vector3.Angle(transformAxis, IKPosition - transformPosition); float num2 = 1f - num / 180f; float num3 = ((clampWeight > 0f) ? Mathf.Clamp(1f - (clampWeight - num2) / (1f - num2), 0f, 1f) : 1f); float num4 = ((clampWeight > 0f) ? Mathf.Clamp(num2 / clampWeight, 0f, 1f) : 1f); for (int i = 0; i < clampSmoothing; i++) { num4 = Mathf.Sin(num4 * MathF.PI * 0.5f); } return transformPosition + Vector3.Slerp(transformAxis * 10f, IKPosition - transformPosition, num4 * num3); } private Vector3 GetLocalDirection(AnimationStream s, Vector3 transformAxis) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) TransformStreamHandle val = bones[0]; return Quaternion.Inverse(((TransformStreamHandle)(ref val)).GetRotation(s)) * transformAxis; } private float GetPositionOffset(AnimationStream s, Vector3 localDirection) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return Vector3.SqrMagnitude(localDirection - lastLocalDirection); } public void Dispose() { bones.Dispose(); boneWeights.Dispose(); DisposeRotationLimits(); } } [RequireComponent(typeof(Animator))] [AddComponentMenu("Scripts/RootMotion.FinalIK/IK Jobs/CCD IKJ")] public class CCDIKJ : MonoBehaviour { [Tooltip("The target Transform of this solver.")] public Transform target; [Tooltip("The master weight of this solver.")] [Range(0f, 1f)] public float weight = 1f; [Tooltip("Minimum offset from last reached position. Will stop solving if offset is less than tolerance.If tolerance is zero, will iterate until maxIterations.")] public float tolerance; [Tooltip("Max solver iterations per frame. If target position offset is less than 'Tolerance', will stop solving.")] public int maxIterations = 4; [Tooltip("If true, rotation limits (if existing) will be applied on each iteration. Only RotationLimitAngle and RotationLimitHinge can be used with this solver.")] public bool useRotationLimits = true; [Tooltip("Useful for 2D games. If true, will solve only in the XY plane.")] public bool XY; [Tooltip("The list of bones used by the solver. Must be assigned in order of hierarchy. All bones must be in the same hierarchy branch.")] public Transform[] bones = (Transform[])(object)new Transform[0]; private Animator animator; private PlayableGraph graph; private AnimationScriptPlayable IKPlayable; private CCDIKJob job; public bool initiated { get; private set; } private void OnEnable() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (bones.Length >= 3) { animator = ((Component)this).GetComponent(); if ((Object)(object)target == (Object)null) { target = new GameObject("CCDIKJ Target (" + ((Object)this).name + ")").transform; target.position = bones[bones.Length - 1].position; target.rotation = bones[bones.Length - 1].rotation; } graph = PlayableGraph.Create("CCDIKJ"); AnimationPlayableOutput val = AnimationPlayableOutput.Create(graph, "ouput", ((Component)this).GetComponent()); job = default(CCDIKJob); job.Setup(((Component)this).GetComponent(), bones, target); IKPlayable = AnimationScriptPlayable.Create(graph, job, 0); AnimatorControllerPlayable val2 = AnimatorControllerPlayable.Create(graph, animator.runtimeAnimatorController); PlayableExtensions.AddInput(IKPlayable, val2, 0, 1f); PlayableOutputExtensions.SetSourcePlayable(val, IKPlayable); ((PlayableGraph)(ref graph)).Play(); initiated = true; } } private void Update() { if (!initiated) { if (bones.Length < 3) { Debug.LogError((object)"CCDIKJ needs at least 3 bones to run.", (Object)(object)((Component)this).transform); ((Behaviour)this).enabled = false; } else { OnEnable(); } } else if (initiated && (Object)(object)target == (Object)null) { Debug.LogError((object)"CCDIKJ 'Target' has gone missing. Destroying CCDIKJ.", (Object)(object)((Component)this).transform); Object.Destroy((Object)(object)this); } } private void OnDisable() { if (initiated) { job.Dispose(); ((PlayableGraph)(ref graph)).Destroy(); Object.Destroy((Object)(object)target); } } } public struct CCDIKJob : IAnimationJob { public TransformSceneHandle _target; public PropertySceneHandle _IKPositionWeight; public PropertySceneHandle _maxIterations; public PropertySceneHandle _tolerance; public PropertySceneHandle _XY; public PropertySceneHandle _useRotationLimits; private NativeArray bones; private NativeArray boneWeights; private NativeArray boneSqrMags; private float chainSqrMag; private Vector3 lastLocalDirection; private NativeArray limitDefaultLocalRotationArray; private NativeArray limitAxisArray; private NativeArray hingeFlags; private NativeArray hingeMinArray; private NativeArray hingeMaxArray; private NativeArray hingeUseLimitsArray; private NativeArray hingeLastRotations; private NativeArray hingeLastAngles; private NativeArray angleFlags; private NativeArray angleSecondaryAxisArray; private NativeArray angleLimitArray; private NativeArray angleTwistLimitArray; public void Setup(Animator animator, Transform[] bones, Transform target) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) this.bones = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); boneWeights = new NativeArray(bones.Length - 1, (Allocator)4, (NativeArrayOptions)1); boneSqrMags = new NativeArray(bones.Length - 1, (Allocator)4, (NativeArrayOptions)1); for (int i = 0; i < this.bones.Length; i++) { this.bones[i] = AnimatorJobExtensions.BindStreamTransform(animator, bones[i]); } for (int j = 0; j < this.bones.Length - 1; j++) { if ((Object)(object)((Component)bones[j]).gameObject.GetComponent() == (Object)null) { ((Component)bones[j]).gameObject.AddComponent(); } boneWeights[j] = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)bones[j]).transform, typeof(IKJBoneParams), "weight"); } SetUpRotationLimits(animator, bones); _target = AnimatorJobExtensions.BindSceneTransform(animator, target); _IKPositionWeight = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(CCDIKJ), "weight"); _maxIterations = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(CCDIKJ), "maxIterations"); _tolerance = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(CCDIKJ), "tolerance"); _XY = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(CCDIKJ), "XY"); _useRotationLimits = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)animator).transform, typeof(CCDIKJ), "useRotationLimits"); } private void SetUpRotationLimits(Animator animator, Transform[] bones) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) limitDefaultLocalRotationArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); limitAxisArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); hingeFlags = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); hingeMinArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); hingeMaxArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); hingeUseLimitsArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); hingeLastRotations = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); hingeLastAngles = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); angleFlags = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); angleSecondaryAxisArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); angleLimitArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); angleTwistLimitArray = new NativeArray(bones.Length, (Allocator)4, (NativeArrayOptions)1); for (int i = 0; i < bones.Length - 1; i++) { hingeFlags[i] = 0; angleFlags[i] = 0; RotationLimit component = ((Component)bones[i]).GetComponent(); if ((Object)(object)component != (Object)null) { limitDefaultLocalRotationArray[i] = bones[i].localRotation; limitAxisArray[i] = component.axis; component.Disable(); if (component is RotationLimitHinge) { hingeFlags[i] = 1; hingeMinArray[i] = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)bones[i]).transform, typeof(RotationLimitHinge), "min"); hingeMaxArray[i] = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)bones[i]).transform, typeof(RotationLimitHinge), "max"); hingeUseLimitsArray[i] = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)bones[i]).transform, typeof(RotationLimitHinge), "useLimits"); hingeLastRotations[i] = bones[i].localRotation; hingeLastAngles[i] = 0f; } if (component is RotationLimitAngle) { RotationLimitAngle rotationLimitAngle = component as RotationLimitAngle; angleFlags[i] = 1; angleSecondaryAxisArray[i] = rotationLimitAngle.secondaryAxis; angleLimitArray[i] = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)bones[i]).transform, typeof(RotationLimitAngle), "limit"); angleTwistLimitArray[i] = AnimatorJobExtensions.BindSceneProperty(animator, ((Component)bones[i]).transform, typeof(RotationLimitAngle), "twistLimit"); } } } } private void DisposeRotationLimits() { limitDefaultLocalRotationArray.Dispose(); limitAxisArray.Dispose(); hingeFlags.Dispose(); hingeMinArray.Dispose(); hingeMaxArray.Dispose(); hingeUseLimitsArray.Dispose(); hingeLastRotations.Dispose(); hingeLastAngles.Dispose(); angleFlags.Dispose(); angleSecondaryAxisArray.Dispose(); angleLimitArray.Dispose(); angleTwistLimitArray.Dispose(); } public void ProcessRootMotion(AnimationStream stream) { } public void ProcessAnimation(AnimationStream stream) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Update(stream); } private void Update(AnimationStream s) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) if (!((TransformSceneHandle)(ref _target)).IsValid(s)) { return; } float @float = ((PropertySceneHandle)(ref _IKPositionWeight)).GetFloat(s); if (@float <= 0f) { return; } @float = Mathf.Min(@float, 1f); Read(s); bool @bool = ((PropertySceneHandle)(ref _XY)).GetBool(s); float num = ((PropertySceneHandle)(ref _maxIterations)).GetInt(s); float float2 = ((PropertySceneHandle)(ref _tolerance)).GetFloat(s); bool bool2 = ((PropertySceneHandle)(ref _useRotationLimits)).GetBool(s); Vector3 position = ((TransformSceneHandle)(ref _target)).GetPosition(s); if (@bool) { TransformStreamHandle val = bones[0]; position.z = ((TransformStreamHandle)(ref val)).GetPosition(s).z; } Vector3 val2 = ((num > 1f) ? GetSingularityOffset(s, position, bool2) : Vector3.zero); int num2 = 1; for (int i = 0; (float)i < num; i++) { Vector3 localDirection = GetLocalDirection(s); if (val2 == Vector3.zero && i >= 1 && float2 > 0f && GetPositionOffset(s, localDirection) < float2 * float2) { break; } lastLocalDirection = localDirection; Solve(s, position + ((i == 0) ? val2 : Vector3.zero), @bool, @float, num2, bool2); num2++; if (num2 >= bones.Length - 1) { num2 -= bones.Length - 2; } } lastLocalDirection = GetLocalDirection(s); } private void Read(AnimationStream s) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) chainSqrMag = 0f; for (int i = 0; i < bones.Length; i++) { if (i < bones.Length - 1) { ref NativeArray reference = ref boneSqrMags; int num = i; TransformStreamHandle val = bones[i]; Vector3 position = ((TransformStreamHandle)(ref val)).GetPosition(s); val = bones[i + 1]; Vector3 val2 = position - ((TransformStreamHandle)(ref val)).GetPosition(s); reference[num] = ((Vector3)(ref val2)).sqrMagnitude; chainSqrMag += boneSqrMags[i]; } } } private void Solve(AnimationStream s, Vector3 targetPosition, bool XY, float weight, int it, bool useRotationLimits) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) for (int num = bones.Length - 2; num > -1; num--) { PropertySceneHandle val = boneWeights[num]; float num2 = weight * ((PropertySceneHandle)(ref val)).GetFloat(s); TransformStreamHandle val2; if (num2 > 0f) { val2 = bones[num]; Vector3 position = ((TransformStreamHandle)(ref val2)).GetPosition(s); val2 = bones[bones.Length - 1]; Vector3 val3 = ((TransformStreamHandle)(ref val2)).GetPosition(s) - position; Vector3 val4 = targetPosition - position; if (XY) { float num3 = Mathf.Atan2(val3.x, val3.y) * 57.29578f; float num4 = Mathf.Atan2(val4.x, val4.y) * 57.29578f; val2 = bones[num]; Quaternion val5 = Quaternion.AngleAxis(Mathf.DeltaAngle(num3, num4) * num2, Vector3.back); TransformStreamHandle val6 = bones[num]; ((TransformStreamHandle)(ref val2)).SetRotation(s, val5 * ((TransformStreamHandle)(ref val6)).GetRotation(s)); } else { val2 = bones[num]; Quaternion rotation = ((TransformStreamHandle)(ref val2)).GetRotation(s); Quaternion val7 = Quaternion.FromToRotation(val3, val4) * rotation; if (num2 >= 1f) { val2 = bones[num]; ((TransformStreamHandle)(ref val2)).SetRotation(s, val7); } else { val2 = bones[num]; ((TransformStreamHandle)(ref val2)).SetRotation(s, Quaternion.Lerp(rotation, val7, num2)); } } } if (useRotationLimits) { if (hingeFlags[num] == 1) { Quaternion val8 = Quaternion.Inverse(limitDefaultLocalRotationArray[num]); val2 = bones[num]; Quaternion rotation2 = val8 * ((TransformStreamHandle)(ref val2)).GetLocalRotation(s); Quaternion lastRotation = hingeLastRotations[num]; float lastAngle = hingeLastAngles[num]; val = hingeMinArray[num]; float @float = ((PropertySceneHandle)(ref val)).GetFloat(s); val = hingeMaxArray[num]; float float2 = ((PropertySceneHandle)(ref val)).GetFloat(s); val = hingeUseLimitsArray[num]; Quaternion val9 = RotationLimitUtilities.LimitHinge(rotation2, @float, float2, ((PropertySceneHandle)(ref val)).GetBool(s), limitAxisArray[num], ref lastRotation, ref lastAngle); hingeLastRotations[num] = lastRotation; hingeLastAngles[num] = lastAngle; val2 = bones[num]; ((TransformStreamHandle)(ref val2)).SetLocalRotation(s, limitDefaultLocalRotationArray[num] * val9); } else if (angleFlags[num] == 1) { Quaternion val10 = Quaternion.Inverse(limitDefaultLocalRotationArray[num]); val2 = bones[num]; Quaternion rotation3 = val10 * ((TransformStreamHandle)(ref val2)).GetLocalRotation(s); Vector3 axis = limitAxisArray[num]; Vector3 secondaryAxis = angleSecondaryAxisArray[num]; val = angleLimitArray[num]; float float3 = ((PropertySceneHandle)(ref val)).GetFloat(s); val = angleTwistLimitArray[num]; Quaternion val11 = RotationLimitUtilities.LimitAngle(rotation3, axis, secondaryAxis, float3, ((PropertySceneHandle)(ref val)).GetFloat(s)); val2 = bones[num]; ((TransformStreamHandle)(ref val2)).SetLocalRotation(s, limitDefaultLocalRotationArray[num] * val11); } } } } private Vector3 GetLocalDirection(AnimationStream s) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) TransformStreamHandle val = bones[0]; Quaternion val2 = Quaternion.Inverse(((TransformStreamHandle)(ref val)).GetRotation(s)); val = bones[bones.Length - 1]; Vector3 position = ((TransformStreamHandle)(ref val)).GetPosition(s); val = bones[0]; return val2 * (position - ((TransformStreamHandle)(ref val)).GetPosition(s)); } private float GetPositionOffset(AnimationStream s, Vector3 localDirection) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return Vector3.SqrMagnitude(localDirection - lastLocalDirection); } private Vector3 GetSingularityOffset(AnimationStream s, Vector3 IKPosition, bool useRotationLimits) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) if (!SingularityDetected(s, IKPosition)) { return Vector3.zero; } TransformStreamHandle val = bones[0]; Vector3 val2 = IKPosition - ((TransformStreamHandle)(ref val)).GetPosition(s); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(normalized.y, normalized.z, normalized.x); if (useRotationLimits && hingeFlags[bones.Length - 2] == 1) { val = bones[bones.Length - 2]; val3 = ((TransformStreamHandle)(ref val)).GetRotation(s) * limitAxisArray[bones.Length - 2]; } return Vector3.Cross(normalized, val3) * Mathf.Sqrt(boneSqrMags[bones.Length - 2]) * 0.5f; } private bool SingularityDetected(AnimationStream s, Vector3 IKPosition) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) TransformStreamHandle val = bones[0]; Vector3 position = ((TransformStreamHandle)(ref val)).GetPosition(s); val = bones[bones.Length - 1]; Vector3 val2 = ((TransformStreamHandle)(ref val)).GetPosition(s) - position; Vector3 val3 = IKPosition - position; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; float sqrMagnitude2 = ((Vector3)(ref val3)).sqrMagnitude; if (sqrMagnitude < sqrMagnitude2) { return false; } if (sqrMagnitude < chainSqrMag - boneSqrMags[bones.Length - 2] * 0.1f) { return false; } if (sqrMagnitude == 0f) { return false; } if (sqrMagnitude2 == 0f) { return false; } if (Vector3.Dot(val2, val3) < 0.999f) { return false; } return true; } public void Dispose() { bones.Dispose(); boneWeights.Dispose(); boneSqrMags.Dispose(); DisposeRotationLimits(); } } public class IKJBoneParams : MonoBehaviour { [Range(0f, 1f)] public float weight = 1f; } public static class RotationLimitUtilities { public static Quaternion LimitHinge(Quaternion rotation, float min, float max, bool useLimits, Vector3 axis, ref Quaternion lastRotation, ref float lastAngle) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if (min == 0f && max == 0f && useLimits) { return Quaternion.AngleAxis(0f, axis); } Quaternion val = Limit1DOF(rotation, axis); if (!useLimits) { return val; } Quaternion val2 = val * Quaternion.Inverse(lastRotation); float num = Quaternion.Angle(Quaternion.identity, val2); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(axis.z, axis.x, axis.y); Vector3 val4 = Vector3.Cross(val3, axis); if (Vector3.Dot(val2 * val3, val4) > 0f) { num = 0f - num; } lastAngle = Mathf.Clamp(lastAngle + num, min, max); lastRotation = Quaternion.AngleAxis(lastAngle, axis); return lastRotation; } public static Quaternion Limit1DOF(Quaternion rotation, Vector3 axis) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return Quaternion.FromToRotation(rotation * axis, axis) * rotation; } public static Quaternion LimitAngle(Quaternion rotation, Vector3 axis, Vector3 secondaryAxis, float limit, float twistLimit) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return LimitTwist(LimitSwing(rotation, axis, limit), axis, secondaryAxis, twistLimit); } public static Quaternion LimitSwing(Quaternion rotation, Vector3 axis, float limit) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (axis == Vector3.zero) { return rotation; } if (rotation == Quaternion.identity) { return rotation; } if (limit >= 180f) { return rotation; } Vector3 val = rotation * axis; Quaternion val2 = Quaternion.FromToRotation(axis, val); Quaternion val3 = Quaternion.RotateTowards(Quaternion.identity, val2, limit); return Quaternion.FromToRotation(val, val3 * axis) * rotation; } public static Quaternion LimitTwist(Quaternion rotation, Vector3 axis, Vector3 orthoAxis, float twistLimit) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) twistLimit = Mathf.Clamp(twistLimit, 0f, 180f); if (twistLimit >= 180f) { return rotation; } Vector3 val = rotation * axis; Vector3 val2 = orthoAxis; Vector3.OrthoNormalize(ref val, ref val2); Vector3 val3 = rotation * orthoAxis; Vector3.OrthoNormalize(ref val, ref val3); Quaternion val4 = Quaternion.FromToRotation(val3, val2) * rotation; if (twistLimit <= 0f) { return val4; } return Quaternion.RotateTowards(val4, rotation, twistLimit); } } [Serializable] public class FABRIKChain { public FABRIK ik; [Range(0f, 1f)] public float pull = 1f; [Range(0f, 1f)] public float pin = 1f; public int[] children = new int[0]; public bool IsValid(ref string message) { if ((Object)(object)ik == (Object)null) { message = "IK unassigned in FABRIKChain."; return false; } if (!ik.solver.IsValid(ref message)) { return false; } return true; } public void Initiate() { ((Behaviour)ik).enabled = false; } public void Stage1(FABRIKChain[] chain) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < children.Length; i++) { chain[children[i]].Stage1(chain); } if (children.Length == 0) { ik.solver.SolveForward(ik.solver.GetIKPosition()); } else { ik.solver.SolveForward(GetCentroid(chain)); } } public void Stage2(Vector3 rootPosition, FABRIKChain[] chain) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) ik.solver.SolveBackward(rootPosition); for (int i = 0; i < children.Length; i++) { chain[children[i]].Stage2(ik.solver.bones[ik.solver.bones.Length - 1].transform.position, chain); } } private Vector3 GetCentroid(FABRIKChain[] chain) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) Vector3 iKPosition = ik.solver.GetIKPosition(); if (pin >= 1f) { return iKPosition; } float num = 0f; for (int i = 0; i < children.Length; i++) { num += chain[children[i]].pull; } if (num <= 0f) { return iKPosition; } if (num < 1f) { num = 1f; } Vector3 val = iKPosition; for (int j = 0; j < children.Length; j++) { Vector3 val2 = chain[children[j]].ik.solver.bones[0].solverPosition - iKPosition; float num2 = chain[children[j]].pull / num; val += val2 * num2; } if (pin <= 0f) { return val; } return val + (iKPosition - val) * pin; } } public class FBBIKArmBending : MonoBehaviour { public FullBodyBipedIK ik; public Vector3 bendDirectionOffsetLeft; public Vector3 bendDirectionOffsetRight; public Vector3 characterSpaceBendOffsetLeft; public Vector3 characterSpaceBendOffsetRight; private Quaternion leftHandTargetRotation; private Quaternion rightHandTargetRotation; private bool initiated; private void LateUpdate() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ik == (Object)null)) { if (!initiated) { IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostFBBIK)); initiated = true; } if ((Object)(object)ik.solver.leftHandEffector.target != (Object)null) { Vector3 left = Vector3.left; ik.solver.leftArmChain.bendConstraint.direction = ik.solver.leftHandEffector.target.rotation * left + ik.solver.leftHandEffector.target.rotation * bendDirectionOffsetLeft + ((Component)ik).transform.rotation * characterSpaceBendOffsetLeft; ik.solver.leftArmChain.bendConstraint.weight = 1f; } if ((Object)(object)ik.solver.rightHandEffector.target != (Object)null) { Vector3 right = Vector3.right; ik.solver.rightArmChain.bendConstraint.direction = ik.solver.rightHandEffector.target.rotation * right + ik.solver.rightHandEffector.target.rotation * bendDirectionOffsetRight + ((Component)ik).transform.rotation * characterSpaceBendOffsetRight; ik.solver.rightArmChain.bendConstraint.weight = 1f; } } } private void OnPostFBBIK() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ik == (Object)null)) { if ((Object)(object)ik.solver.leftHandEffector.target != (Object)null) { ik.references.leftHand.rotation = ik.solver.leftHandEffector.target.rotation; } if ((Object)(object)ik.solver.rightHandEffector.target != (Object)null) { ik.references.rightHand.rotation = ik.solver.rightHandEffector.target.rotation; } } } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostFBBIK)); } } } public class FBBIKHeadEffector : MonoBehaviour { [Serializable] public class BendBone { [Tooltip("Assign spine and/or neck bones.")] public Transform transform; [Tooltip("The weight of rotating this bone.")] [Range(0f, 1f)] public float weight = 0.5f; private Quaternion defaultLocalRotation = Quaternion.identity; public BendBone() { }//IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) public BendBone(Transform transform, float weight) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) this.transform = transform; this.weight = weight; } public void StoreDefaultLocalState() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) defaultLocalRotation = transform.localRotation; } public void FixTransforms() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) transform.localRotation = defaultLocalRotation; } } [Tooltip("Reference to the FBBIK component.")] public FullBodyBipedIK ik; [LargeHeader("Position")] [Tooltip("Master weight for positioning the head.")] [Range(0f, 1f)] public float positionWeight = 1f; [Tooltip("The weight of moving the body along with the head")] [Range(0f, 1f)] public float bodyWeight = 0.8f; [Tooltip("The weight of moving the thighs along with the head")] [Range(0f, 1f)] public float thighWeight = 0.8f; [Tooltip("If false, hands will not pull the head away if they are too far. Disabling this will improve performance significantly.")] public bool handsPullBody = true; [LargeHeader("Rotation")] [Tooltip("The weight of rotating the head bone after solving")] [Range(0f, 1f)] public float rotationWeight; [Tooltip("Clamping the rotation of the body")] [Range(0f, 1f)] public float bodyClampWeight = 0.5f; [Tooltip("Clamping the rotation of the head")] [Range(0f, 1f)] public float headClampWeight = 0.5f; [Tooltip("The master weight of bending/twisting the spine to the rotation of the head effector. This is similar to CCD, but uses the rotation of the head effector not the position.")] [Range(0f, 1f)] public float bendWeight = 1f; [Tooltip("The bones to use for bending.")] public BendBone[] bendBones = new BendBone[0]; [LargeHeader("CCD")] [Tooltip("Optional. The master weight of the CCD (Cyclic Coordinate Descent) IK effect that bends the spine towards the head effector before FBBIK solves.")] [Range(0f, 1f)] public float CCDWeight = 1f; [Tooltip("The weight of rolling the bones in towards the target")] [Range(0f, 1f)] public float roll; [Tooltip("Smoothing the CCD effect.")] [Range(0f, 1000f)] public float damper = 500f; [Tooltip("Bones to use for the CCD pass. Assign spine and/or neck bones.")] public Transform[] CCDBones = (Transform[])(object)new Transform[0]; [LargeHeader("Stretching")] [Tooltip("Stretching the spine/neck to help reach the target. This is useful for making sure the head stays locked relative to the VR headset. NB! Stretching is done after FBBIK has solved so if you have the hand effectors pinned and spine bones included in the 'Stretch Bones', the hands might become offset from their target positions.")] [Range(0f, 1f)] public float postStretchWeight = 1f; [Tooltip("Stretch magnitude limit.")] public float maxStretch = 0.1f; [Tooltip("If > 0, dampers the stretching effect.")] public float stretchDamper; [Tooltip("If true, will fix head position to this Transform no matter what. Good for making sure the head will not budge away from the VR headset")] public bool fixHead; [Tooltip("Bones to use for stretching. The more bones you add, the less noticable the effect.")] public Transform[] stretchBones = (Transform[])(object)new Transform[0]; [LargeHeader("Chest Direction")] public Vector3 chestDirection = Vector3.forward; [Range(0f, 1f)] public float chestDirectionWeight = 1f; public Transform[] chestBones = (Transform[])(object)new Transform[0]; public IKSolver.UpdateDelegate OnPostHeadEffectorFK; private Vector3 offset; private Vector3 headToBody; private Vector3 shoulderCenterToHead; private Vector3 headToLeftThigh; private Vector3 headToRightThigh; private Vector3 leftShoulderPos; private Vector3 rightShoulderPos; private float shoulderDist; private float leftShoulderDist; private float rightShoulderDist; private Quaternion chestRotation; private Quaternion headRotationRelativeToRoot; private Quaternion[] ccdDefaultLocalRotations = (Quaternion[])(object)new Quaternion[0]; private Vector3 headLocalPosition; private Quaternion headLocalRotation; private Vector3[] stretchLocalPositions = (Vector3[])(object)new Vector3[0]; private Quaternion[] stretchLocalRotations = (Quaternion[])(object)new Quaternion[0]; private Vector3[] chestLocalPositions = (Vector3[])(object)new Vector3[0]; private Quaternion[] chestLocalRotations = (Quaternion[])(object)new Quaternion[0]; private int bendBonesCount; private int ccdBonesCount; private int stretchBonesCount; private int chestBonesCount; private void Start() { //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) IKSolverFullBodyBiped solver = ik.solver; solver.OnPreRead = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPreRead, new IKSolver.UpdateDelegate(OnPreRead)); IKSolverFullBodyBiped solver2 = ik.solver; solver2.OnPreIteration = (IKSolver.IterationDelegate)Delegate.Combine(solver2.OnPreIteration, new IKSolver.IterationDelegate(Iterate)); IKSolverFullBodyBiped solver3 = ik.solver; solver3.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver3.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostUpdate)); IKSolverFullBodyBiped solver4 = ik.solver; solver4.OnStoreDefaultLocalState = (IKSolver.UpdateDelegate)Delegate.Combine(solver4.OnStoreDefaultLocalState, new IKSolver.UpdateDelegate(OnStoreDefaultLocalState)); IKSolverFullBodyBiped solver5 = ik.solver; solver5.OnFixTransforms = (IKSolver.UpdateDelegate)Delegate.Combine(solver5.OnFixTransforms, new IKSolver.UpdateDelegate(OnFixTransforms)); OnStoreDefaultLocalState(); headRotationRelativeToRoot = Quaternion.Inverse(ik.references.root.rotation) * ik.references.head.rotation; } private void OnStoreDefaultLocalState() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) BendBone[] array = bendBones; for (int i = 0; i < array.Length; i++) { array[i]?.StoreDefaultLocalState(); } ccdDefaultLocalRotations = (Quaternion[])(object)new Quaternion[CCDBones.Length]; for (int j = 0; j < CCDBones.Length; j++) { if ((Object)(object)CCDBones[j] != (Object)null) { ccdDefaultLocalRotations[j] = CCDBones[j].localRotation; } } headLocalPosition = ik.references.head.localPosition; headLocalRotation = ik.references.head.localRotation; stretchLocalPositions = (Vector3[])(object)new Vector3[stretchBones.Length]; stretchLocalRotations = (Quaternion[])(object)new Quaternion[stretchBones.Length]; for (int k = 0; k < stretchBones.Length; k++) { if ((Object)(object)stretchBones[k] != (Object)null) { stretchLocalPositions[k] = stretchBones[k].localPosition; stretchLocalRotations[k] = stretchBones[k].localRotation; } } chestLocalPositions = (Vector3[])(object)new Vector3[chestBones.Length]; chestLocalRotations = (Quaternion[])(object)new Quaternion[chestBones.Length]; for (int l = 0; l < chestBones.Length; l++) { if ((Object)(object)chestBones[l] != (Object)null) { chestLocalPositions[l] = chestBones[l].localPosition; chestLocalRotations[l] = chestBones[l].localRotation; } } bendBonesCount = bendBones.Length; ccdBonesCount = CCDBones.Length; stretchBonesCount = stretchBones.Length; chestBonesCount = chestBones.Length; } private void OnFixTransforms() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled) { return; } BendBone[] array = bendBones; for (int i = 0; i < array.Length; i++) { array[i]?.FixTransforms(); } for (int j = 0; j < CCDBones.Length; j++) { if ((Object)(object)CCDBones[j] != (Object)null) { CCDBones[j].localRotation = ccdDefaultLocalRotations[j]; } } ik.references.head.localPosition = headLocalPosition; ik.references.head.localRotation = headLocalRotation; for (int k = 0; k < stretchBones.Length; k++) { if ((Object)(object)stretchBones[k] != (Object)null) { stretchBones[k].localPosition = stretchLocalPositions[k]; stretchBones[k].localRotation = stretchLocalRotations[k]; } } for (int l = 0; l < chestBones.Length; l++) { if ((Object)(object)chestBones[l] != (Object)null) { chestBones[l].localPosition = chestLocalPositions[l]; chestBones[l].localRotation = chestLocalRotations[l]; } } } private void OnPreRead() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled && ((Component)this).gameObject.activeInHierarchy && ik.solver.iterations != 0) { ik.solver.FABRIKPass = handsPullBody; if (bendBonesCount != bendBones.Length || ccdBonesCount != CCDBones.Length || stretchBonesCount != stretchBones.Length || chestBonesCount != chestBones.Length) { OnStoreDefaultLocalState(); } ChestDirection(); SpineBend(); CCDPass(); offset = ((Component)this).transform.position - ik.references.head.position; shoulderDist = Vector3.Distance(ik.references.leftUpperArm.position, ik.references.rightUpperArm.position); leftShoulderDist = Vector3.Distance(ik.references.head.position, ik.references.leftUpperArm.position); rightShoulderDist = Vector3.Distance(ik.references.head.position, ik.references.rightUpperArm.position); headToBody = ik.solver.rootNode.position - ik.references.head.position; headToLeftThigh = ik.references.leftThigh.position - ik.references.head.position; headToRightThigh = ik.references.rightThigh.position - ik.references.head.position; leftShoulderPos = ik.references.leftUpperArm.position + offset * bodyWeight; rightShoulderPos = ik.references.rightUpperArm.position + offset * bodyWeight; chestRotation = Quaternion.LookRotation(ik.references.head.position - ik.references.leftUpperArm.position, ik.references.rightUpperArm.position - ik.references.leftUpperArm.position); if (OnPostHeadEffectorFK != null) { OnPostHeadEffectorFK(); } } } private void SpineBend() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) float num = bendWeight * ik.solver.IKPositionWeight; if (num <= 0f || bendBones.Length == 0) { return; } Quaternion rotation = ((Component)this).transform.rotation * Quaternion.Inverse(ik.references.root.rotation * headRotationRelativeToRoot); rotation = QuaTools.ClampRotation(rotation, bodyClampWeight, 2); float num2 = 1f / (float)bendBones.Length; for (int i = 0; i < bendBones.Length; i++) { if ((Object)(object)bendBones[i].transform != (Object)null) { bendBones[i].transform.rotation = Quaternion.Lerp(Quaternion.identity, rotation, num2 * bendBones[i].weight * num) * bendBones[i].transform.rotation; } } } private void CCDPass() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) float num = CCDWeight * ik.solver.IKPositionWeight; if (!(num <= 0f)) { for (int num2 = CCDBones.Length - 1; num2 > -1; num2--) { Quaternion val = Quaternion.FromToRotation(ik.references.head.position - CCDBones[num2].position, ((Component)this).transform.position - CCDBones[num2].position) * CCDBones[num2].rotation; float num3 = Mathf.Lerp((float)((CCDBones.Length - num2) / CCDBones.Length), 1f, roll); float num4 = Quaternion.Angle(Quaternion.identity, val); num4 = Mathf.Lerp(0f, num4, (damper - num4) / damper); CCDBones[num2].rotation = Quaternion.RotateTowards(CCDBones[num2].rotation, val, num4 * num * num3); } } } private void Iterate(int iteration) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled && ((Component)this).gameObject.activeInHierarchy && ik.solver.iterations != 0) { Vector3 position = ((Component)this).transform.position; Vector3 val = leftShoulderPos - ((Component)this).transform.position; leftShoulderPos = position + ((Vector3)(ref val)).normalized * leftShoulderDist; Vector3 position2 = ((Component)this).transform.position; val = rightShoulderPos - ((Component)this).transform.position; rightShoulderPos = position2 + ((Vector3)(ref val)).normalized * rightShoulderDist; Solve(ref leftShoulderPos, ref rightShoulderPos, shoulderDist); LerpSolverPosition(ik.solver.leftShoulderEffector, leftShoulderPos, positionWeight * ik.solver.IKPositionWeight, ik.solver.leftShoulderEffector.positionOffset); LerpSolverPosition(ik.solver.rightShoulderEffector, rightShoulderPos, positionWeight * ik.solver.IKPositionWeight, ik.solver.rightShoulderEffector.positionOffset); Quaternion to = Quaternion.LookRotation(((Component)this).transform.position - leftShoulderPos, rightShoulderPos - leftShoulderPos); Quaternion val2 = QuaTools.FromToRotation(chestRotation, to); Vector3 val3 = val2 * headToBody; LerpSolverPosition(ik.solver.bodyEffector, ((Component)this).transform.position + val3, positionWeight * ik.solver.IKPositionWeight, ik.solver.bodyEffector.positionOffset - ik.solver.pullBodyOffset); Quaternion val4 = Quaternion.Lerp(Quaternion.identity, val2, thighWeight); Vector3 val5 = val4 * headToLeftThigh; Vector3 val6 = val4 * headToRightThigh; LerpSolverPosition(ik.solver.leftThighEffector, ((Component)this).transform.position + val5, positionWeight * ik.solver.IKPositionWeight, ik.solver.bodyEffector.positionOffset - ik.solver.pullBodyOffset + ik.solver.leftThighEffector.positionOffset); LerpSolverPosition(ik.solver.rightThighEffector, ((Component)this).transform.position + val6, positionWeight * ik.solver.IKPositionWeight, ik.solver.bodyEffector.positionOffset - ik.solver.pullBodyOffset + ik.solver.rightThighEffector.positionOffset); } } private void OnPostUpdate() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled && ((Component)this).gameObject.activeInHierarchy) { PostStretching(); Quaternion rotation = QuaTools.FromToRotation(ik.references.head.rotation, ((Component)this).transform.rotation); rotation = QuaTools.ClampRotation(rotation, headClampWeight, 2); ik.references.head.rotation = Quaternion.Lerp(Quaternion.identity, rotation, rotationWeight * ik.solver.IKPositionWeight) * ik.references.head.rotation; } } private void ChestDirection() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) float num = chestDirectionWeight * ik.solver.IKPositionWeight; if (num <= 0f) { return; } bool changed = false; chestDirection = V3Tools.ClampDirection(chestDirection, ik.references.root.forward, 0.45f, 2, out changed); if (!(chestDirection == Vector3.zero)) { Quaternion val = Quaternion.FromToRotation(ik.references.root.forward, chestDirection); val = Quaternion.Lerp(Quaternion.identity, val, num * (1f / (float)chestBones.Length)); Transform[] array = chestBones; foreach (Transform val2 in array) { val2.rotation = val * val2.rotation; } } } private void PostStretching() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) float num = postStretchWeight * ik.solver.IKPositionWeight; if (num > 0f) { Vector3 val = Vector3.ClampMagnitude(((Component)this).transform.position - ik.references.head.position, maxStretch); val *= num; stretchDamper = Mathf.Max(stretchDamper, 0f); if (stretchDamper > 0f) { val /= (1f + ((Vector3)(ref val)).magnitude) * (1f + stretchDamper); } for (int i = 0; i < stretchBones.Length; i++) { if ((Object)(object)stretchBones[i] != (Object)null) { Transform obj = stretchBones[i]; obj.position += val / (float)stretchBones.Length; } } } if (fixHead && ik.solver.IKPositionWeight > 0f) { ik.references.head.position = ((Component)this).transform.position; } } private void LerpSolverPosition(IKEffector effector, Vector3 position, float weight, Vector3 offset) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) effector.GetNode(ik.solver).solverPosition = Vector3.Lerp(effector.GetNode(ik.solver).solverPosition, position + offset, weight); } private void Solve(ref Vector3 pos1, ref Vector3 pos2, float nominalDistance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pos2 - pos1; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude != nominalDistance && magnitude != 0f) { float num = 1f; num *= 1f - nominalDistance / magnitude; Vector3 val2 = val * num * 0.5f; pos1 += val2; pos2 -= val2; } } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverFullBodyBiped solver = ik.solver; solver.OnPreRead = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPreRead, new IKSolver.UpdateDelegate(OnPreRead)); IKSolverFullBodyBiped solver2 = ik.solver; solver2.OnPreIteration = (IKSolver.IterationDelegate)Delegate.Remove(solver2.OnPreIteration, new IKSolver.IterationDelegate(Iterate)); IKSolverFullBodyBiped solver3 = ik.solver; solver3.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver3.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostUpdate)); IKSolverFullBodyBiped solver4 = ik.solver; solver4.OnStoreDefaultLocalState = (IKSolver.UpdateDelegate)Delegate.Remove(solver4.OnStoreDefaultLocalState, new IKSolver.UpdateDelegate(OnStoreDefaultLocalState)); IKSolverFullBodyBiped solver5 = ik.solver; solver5.OnFixTransforms = (IKSolver.UpdateDelegate)Delegate.Remove(solver5.OnFixTransforms, new IKSolver.UpdateDelegate(OnFixTransforms)); } } } [Serializable] public class FBIKChain { [Serializable] public class ChildConstraint { public float pushElasticity; public float pullElasticity; [SerializeField] private Transform bone1; [SerializeField] private Transform bone2; private float crossFade; private float inverseCrossFade; private int chain1Index; private int chain2Index; public float nominalDistance { get; private set; } public bool isRigid { get; private set; } public ChildConstraint(Transform bone1, Transform bone2, float pushElasticity = 0f, float pullElasticity = 0f) { this.bone1 = bone1; this.bone2 = bone2; this.pushElasticity = pushElasticity; this.pullElasticity = pullElasticity; } public void Initiate(IKSolverFullBody solver) { chain1Index = solver.GetChainIndex(bone1); chain2Index = solver.GetChainIndex(bone2); OnPreSolve(solver); } public void OnPreSolve(IKSolverFullBody solver) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) nominalDistance = Vector3.Distance(solver.chain[chain1Index].nodes[0].transform.position, solver.chain[chain2Index].nodes[0].transform.position); isRigid = pushElasticity <= 0f && pullElasticity <= 0f; if (isRigid) { float num = solver.chain[chain1Index].pull - solver.chain[chain2Index].pull; crossFade = 1f - (0.5f + num * 0.5f); } else { crossFade = 0.5f; } inverseCrossFade = 1f - crossFade; } public void Solve(IKSolverFullBody solver) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) if (pushElasticity >= 1f && pullElasticity >= 1f) { return; } Vector3 val = solver.chain[chain2Index].nodes[0].solverPosition - solver.chain[chain1Index].nodes[0].solverPosition; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude != nominalDistance && magnitude != 0f) { float num = 1f; if (!isRigid) { float num2 = ((magnitude > nominalDistance) ? pullElasticity : pushElasticity); num = 1f - num2; } num *= 1f - nominalDistance / magnitude; Vector3 val2 = val * num; IKSolver.Node obj = solver.chain[chain1Index].nodes[0]; obj.solverPosition += val2 * crossFade; IKSolver.Node obj2 = solver.chain[chain2Index].nodes[0]; obj2.solverPosition -= val2 * inverseCrossFade; } } } [Serializable] public enum Smoothing { None, Exponential, Cubic } [Range(0f, 1f)] public float pin; [Range(0f, 1f)] public float pull = 1f; [Range(0f, 1f)] public float push; [Range(-1f, 1f)] public float pushParent; [Range(0f, 1f)] public float reach = 0.1f; public Smoothing reachSmoothing = Smoothing.Exponential; public Smoothing pushSmoothing = Smoothing.Exponential; public IKSolver.Node[] nodes = new IKSolver.Node[0]; public int[] children = new int[0]; public ChildConstraint[] childConstraints = new ChildConstraint[0]; public IKConstraintBend bendConstraint = new IKConstraintBend(); private float rootLength; private bool initiated; private float length; private float distance; private IKSolver.Point p; private float reachForce; private float pullParentSum; private float[] crossFades; private float sqrMag1; private float sqrMag2; private float sqrMagDif; private const float maxLimbLength = 0.99999f; public FBIKChain() { } public FBIKChain(float pin, float pull, params Transform[] nodeTransforms) { this.pin = pin; this.pull = pull; SetNodes(nodeTransforms); children = new int[0]; } public void SetNodes(params Transform[] boneTransforms) { nodes = new IKSolver.Node[boneTransforms.Length]; for (int i = 0; i < boneTransforms.Length; i++) { nodes[i] = new IKSolver.Node(boneTransforms[i]); } } public int GetNodeIndex(Transform boneTransform) { for (int i = 0; i < nodes.Length; i++) { if ((Object)(object)nodes[i].transform == (Object)(object)boneTransform) { return i; } } return -1; } public bool IsValid(ref string message) { if (nodes.Length == 0) { message = "FBIK chain contains no nodes."; return false; } IKSolver.Node[] array = nodes; for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i].transform == (Object)null) { message = "Node transform is null in FBIK chain."; return false; } } return true; } public void Initiate(IKSolverFullBody solver) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) initiated = false; IKSolver.Node[] array = nodes; foreach (IKSolver.Node obj in array) { obj.solverPosition = obj.transform.position; } CalculateBoneLengths(solver); ChildConstraint[] array2 = childConstraints; for (int i = 0; i < array2.Length; i++) { array2[i].Initiate(solver); } if (nodes.Length == 3) { bendConstraint.SetBones(nodes[0].transform, nodes[1].transform, nodes[2].transform); bendConstraint.Initiate(solver); } crossFades = new float[children.Length]; initiated = true; } public void ReadPose(IKSolverFullBody solver, bool fullBody) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return; } for (int i = 0; i < nodes.Length; i++) { nodes[i].solverPosition = nodes[i].transform.position + nodes[i].offset; } CalculateBoneLengths(solver); if (!fullBody) { return; } for (int j = 0; j < childConstraints.Length; j++) { childConstraints[j].OnPreSolve(solver); } if (children.Length != 0) { float num = nodes[nodes.Length - 1].effectorPositionWeight; for (int k = 0; k < children.Length; k++) { num += solver.chain[children[k]].nodes[0].effectorPositionWeight * solver.chain[children[k]].pull; } num = Mathf.Clamp(num, 1f, float.PositiveInfinity); for (int l = 0; l < children.Length; l++) { crossFades[l] = solver.chain[children[l]].nodes[0].effectorPositionWeight * solver.chain[children[l]].pull / num; } } pullParentSum = 0f; for (int m = 0; m < children.Length; m++) { pullParentSum += solver.chain[children[m]].pull; } pullParentSum = Mathf.Clamp(pullParentSum, 1f, float.PositiveInfinity); if (nodes.Length == 3) { reachForce = reach * Mathf.Clamp(nodes[2].effectorPositionWeight, 0f, 1f); } else { reachForce = 0f; } if (push > 0f && nodes.Length > 1) { distance = Vector3.Distance(nodes[0].transform.position, nodes[nodes.Length - 1].transform.position); } } private void CalculateBoneLengths(IKSolverFullBody solver) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) length = 0f; for (int i = 0; i < nodes.Length - 1; i++) { nodes[i].length = Vector3.Distance(nodes[i].transform.position, nodes[i + 1].transform.position); length += nodes[i].length; if (nodes[i].length == 0f) { Warning.Log("Bone " + ((Object)nodes[i].transform).name + " - " + ((Object)nodes[i + 1].transform).name + " length is zero, can not solve.", nodes[i].transform); return; } } for (int j = 0; j < children.Length; j++) { FBIKChain obj = solver.chain[children[j]]; Vector3 val = solver.chain[children[j]].nodes[0].transform.position - nodes[nodes.Length - 1].transform.position; obj.rootLength = ((Vector3)(ref val)).magnitude; if (solver.chain[children[j]].rootLength == 0f) { return; } } if (nodes.Length == 3) { sqrMag1 = nodes[0].length * nodes[0].length; sqrMag2 = nodes[1].length * nodes[1].length; sqrMagDif = sqrMag1 - sqrMag2; } } public void Reach(IKSolverFullBody solver) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return; } for (int i = 0; i < children.Length; i++) { solver.chain[children[i]].Reach(solver); } if (reachForce <= 0f) { return; } Vector3 val = nodes[2].solverPosition - nodes[0].solverPosition; if (!(val == Vector3.zero)) { float magnitude = ((Vector3)(ref val)).magnitude; Vector3 val2 = val / magnitude * length; float num = Mathf.Clamp(magnitude / length, 1f - reachForce, 1f + reachForce) - 1f; num = Mathf.Clamp(num + reachForce, -1f, 1f); switch (reachSmoothing) { case Smoothing.Exponential: num *= num; break; case Smoothing.Cubic: num *= num * num; break; } Vector3 val3 = val2 * Mathf.Clamp(num, 0f, magnitude); IKSolver.Node obj = nodes[0]; obj.solverPosition += val3 * (1f - nodes[0].effectorPositionWeight); IKSolver.Node obj2 = nodes[2]; obj2.solverPosition += val3; } } public Vector3 Push(IKSolverFullBody solver) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; for (int i = 0; i < children.Length; i++) { val += solver.chain[children[i]].Push(solver) * solver.chain[children[i]].pushParent; } IKSolver.Node obj = nodes[nodes.Length - 1]; obj.solverPosition += val; if (nodes.Length < 2) { return Vector3.zero; } if (push <= 0f) { return Vector3.zero; } Vector3 val2 = nodes[2].solverPosition - nodes[0].solverPosition; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude == 0f) { return Vector3.zero; } float num = 1f - magnitude / distance; if (num <= 0f) { return Vector3.zero; } switch (pushSmoothing) { case Smoothing.Exponential: num *= num; break; case Smoothing.Cubic: num *= num * num; break; } Vector3 val3 = -val2 * num * push; IKSolver.Node obj2 = nodes[0]; obj2.solverPosition += val3; return val3; } public void SolveTrigonometric(IKSolverFullBody solver, bool calculateBendDirection = false) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return; } for (int i = 0; i < children.Length; i++) { solver.chain[children[i]].SolveTrigonometric(solver, calculateBendDirection); } if (nodes.Length == 3) { Vector3 val = nodes[2].solverPosition - nodes[0].solverPosition; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude != 0f) { float num = Mathf.Clamp(magnitude, 0f, length * 0.99999f); Vector3 direction = val / magnitude * num; Vector3 bendDirection = ((calculateBendDirection && bendConstraint.initiated) ? bendConstraint.GetDir(solver) : (nodes[1].solverPosition - nodes[0].solverPosition)); Vector3 dirToBendPoint = GetDirToBendPoint(direction, bendDirection, num); nodes[1].solverPosition = nodes[0].solverPosition + dirToBendPoint; } } } public void Stage1(IKSolverFullBody solver) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < children.Length; i++) { solver.chain[children[i]].Stage1(solver); } if (children.Length == 0) { ForwardReach(nodes[nodes.Length - 1].solverPosition); return; } Vector3 val = nodes[nodes.Length - 1].solverPosition; SolveChildConstraints(solver); for (int j = 0; j < children.Length; j++) { Vector3 val2 = solver.chain[children[j]].nodes[0].solverPosition; if (solver.chain[children[j]].rootLength > 0f) { val2 = SolveFABRIKJoint(nodes[nodes.Length - 1].solverPosition, solver.chain[children[j]].nodes[0].solverPosition, solver.chain[children[j]].rootLength); } if (pullParentSum > 0f) { val += (val2 - nodes[nodes.Length - 1].solverPosition) * (solver.chain[children[j]].pull / pullParentSum); } } ForwardReach(Vector3.Lerp(val, nodes[nodes.Length - 1].solverPosition, pin)); } public void Stage2(IKSolverFullBody solver, Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) BackwardReach(position); int num = Mathf.Clamp(solver.iterations, 2, 4); if (childConstraints.Length != 0) { for (int i = 0; i < num; i++) { SolveConstraintSystems(solver); } } for (int j = 0; j < children.Length; j++) { solver.chain[children[j]].Stage2(solver, nodes[nodes.Length - 1].solverPosition); } } public void SolveConstraintSystems(IKSolverFullBody solver) { SolveChildConstraints(solver); for (int i = 0; i < children.Length; i++) { SolveLinearConstraint(nodes[nodes.Length - 1], solver.chain[children[i]].nodes[0], crossFades[i], solver.chain[children[i]].rootLength); } } private Vector3 SolveFABRIKJoint(Vector3 pos1, Vector3 pos2, float length) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pos1 - pos2; return pos2 + ((Vector3)(ref val)).normalized * length; } protected Vector3 GetDirToBendPoint(Vector3 direction, Vector3 bendDirection, float directionMagnitude) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) float num = (directionMagnitude * directionMagnitude + sqrMagDif) / 2f / directionMagnitude; float num2 = (float)Math.Sqrt(Mathf.Clamp(sqrMag1 - num * num, 0f, float.PositiveInfinity)); if (direction == Vector3.zero) { return Vector3.zero; } return Quaternion.LookRotation(direction, bendDirection) * new Vector3(0f, num2, num); } private void SolveChildConstraints(IKSolverFullBody solver) { for (int i = 0; i < childConstraints.Length; i++) { childConstraints[i].Solve(solver); } } private void SolveLinearConstraint(IKSolver.Node node1, IKSolver.Node node2, float crossFade, float distance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = node2.solverPosition - node1.solverPosition; float magnitude = ((Vector3)(ref val)).magnitude; if (distance != magnitude && magnitude != 0f) { Vector3 val2 = val * (1f - distance / magnitude); node1.solverPosition += val2 * crossFade; node2.solverPosition -= val2 * (1f - crossFade); } } public void ForwardReach(Vector3 position) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) nodes[nodes.Length - 1].solverPosition = position; for (int num = nodes.Length - 2; num > -1; num--) { nodes[num].solverPosition = SolveFABRIKJoint(nodes[num].solverPosition, nodes[num + 1].solverPosition, nodes[num].length); } } private void BackwardReach(Vector3 position) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) if (rootLength > 0f) { position = SolveFABRIKJoint(nodes[0].solverPosition, position, rootLength); } nodes[0].solverPosition = position; for (int i = 1; i < nodes.Length; i++) { nodes[i].solverPosition = SolveFABRIKJoint(nodes[i].solverPosition, nodes[i - 1].solverPosition, nodes[i - 1].length); } } } [Serializable] public class IKConstraintBend { public Transform bone1; public Transform bone2; public Transform bone3; public Transform bendGoal; public Vector3 direction = Vector3.right; public Quaternion rotationOffset; [Range(0f, 1f)] public float weight; public Vector3 defaultLocalDirection; public Vector3 defaultChildDirection; [NonSerialized] public float clampF = 0.505f; private int chainIndex1; private int nodeIndex1; private int chainIndex2; private int nodeIndex2; private int chainIndex3; private int nodeIndex3; private bool limbOrientationsSet; public bool initiated { get; private set; } public bool IsValid(IKSolverFullBody solver, Warning.Logger logger) { if ((Object)(object)bone1 == (Object)null || (Object)(object)bone2 == (Object)null || (Object)(object)bone3 == (Object)null) { logger?.Invoke("Bend Constraint contains a null reference."); return false; } if (solver.GetPoint(bone1) == null) { logger?.Invoke("Bend Constraint is referencing to a bone '" + ((Object)bone1).name + "' that does not excist in the Node Chain."); return false; } if (solver.GetPoint(bone2) == null) { logger?.Invoke("Bend Constraint is referencing to a bone '" + ((Object)bone2).name + "' that does not excist in the Node Chain."); return false; } if (solver.GetPoint(bone3) == null) { logger?.Invoke("Bend Constraint is referencing to a bone '" + ((Object)bone3).name + "' that does not excist in the Node Chain."); return false; } return true; } public IKConstraintBend() { }//IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) public IKConstraintBend(Transform bone1, Transform bone2, Transform bone3) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) SetBones(bone1, bone2, bone3); } public void SetBones(Transform bone1, Transform bone2, Transform bone3) { this.bone1 = bone1; this.bone2 = bone2; this.bone3 = bone3; } public void Initiate(IKSolverFullBody solver) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) solver.GetChainAndNodeIndexes(bone1, out chainIndex1, out nodeIndex1); solver.GetChainAndNodeIndexes(bone2, out chainIndex2, out nodeIndex2); solver.GetChainAndNodeIndexes(bone3, out chainIndex3, out nodeIndex3); direction = OrthoToBone1(solver, OrthoToLimb(solver, bone2.position - bone1.position)); if (!limbOrientationsSet) { defaultLocalDirection = Quaternion.Inverse(bone1.rotation) * direction; Vector3 val = bone3.position - bone1.position; Vector3 val2 = Vector3.Cross(((Vector3)(ref val)).normalized, direction); defaultChildDirection = Quaternion.Inverse(bone3.rotation) * val2; } initiated = true; } public void SetLimbOrientation(Vector3 upper, Vector3 lower, Vector3 last) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (upper == Vector3.zero) { Debug.LogError((object)"Attempting to set limb orientation to Vector3.zero axis"); } if (lower == Vector3.zero) { Debug.LogError((object)"Attempting to set limb orientation to Vector3.zero axis"); } if (last == Vector3.zero) { Debug.LogError((object)"Attempting to set limb orientation to Vector3.zero axis"); } defaultLocalDirection = ((Vector3)(ref upper)).normalized; defaultChildDirection = ((Vector3)(ref last)).normalized; limbOrientationsSet = true; } public void LimitBend(float solverWeight, float positionWeight) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (initiated) { Vector3 val = bone1.rotation * -defaultLocalDirection; Vector3 val2 = bone3.position - bone2.position; bool changed = false; Vector3 val3 = V3Tools.ClampDirection(val2, val, clampF * solverWeight, 0, out changed); Quaternion rotation = bone3.rotation; if (changed) { Quaternion val4 = Quaternion.FromToRotation(val2, val3); bone2.rotation = val4 * bone2.rotation; } if (positionWeight > 0f) { Vector3 val5 = bone2.position - bone1.position; Vector3 val6 = bone3.position - bone2.position; Vector3.OrthoNormalize(ref val5, ref val6); Quaternion val7 = Quaternion.FromToRotation(val6, val); bone2.rotation = Quaternion.Lerp(bone2.rotation, val7 * bone2.rotation, positionWeight * solverWeight); } if (changed || positionWeight > 0f) { bone3.rotation = rotation; } } } public Vector3 GetDir(IKSolverFullBody solver) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { return Vector3.zero; } float num = weight * solver.IKPositionWeight; if ((Object)(object)bendGoal != (Object)null) { Vector3 val = bendGoal.position - solver.GetNode(chainIndex1, nodeIndex1).solverPosition; if (val != Vector3.zero) { direction = val; } } if (num >= 1f) { return ((Vector3)(ref direction)).normalized; } Vector3 val2 = solver.GetNode(chainIndex3, nodeIndex3).solverPosition - solver.GetNode(chainIndex1, nodeIndex1).solverPosition; Vector3 val3 = Quaternion.FromToRotation(bone3.position - bone1.position, val2) * (bone2.position - bone1.position); if (solver.GetNode(chainIndex3, nodeIndex3).effectorRotationWeight > 0f) { Vector3 val4 = -Vector3.Cross(val2, solver.GetNode(chainIndex3, nodeIndex3).solverRotation * defaultChildDirection); val3 = Vector3.Lerp(val3, val4, solver.GetNode(chainIndex3, nodeIndex3).effectorRotationWeight); } if (rotationOffset != Quaternion.identity) { val3 = Quaternion.FromToRotation(rotationOffset * val2, val2) * rotationOffset * val3; } if (num <= 0f) { return val3; } return Vector3.Lerp(val3, ((Vector3)(ref direction)).normalized, num); } private Vector3 OrthoToLimb(IKSolverFullBody solver, Vector3 tangent) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = solver.GetNode(chainIndex3, nodeIndex3).solverPosition - solver.GetNode(chainIndex1, nodeIndex1).solverPosition; Vector3.OrthoNormalize(ref val, ref tangent); return tangent; } private Vector3 OrthoToBone1(IKSolverFullBody solver, Vector3 tangent) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = solver.GetNode(chainIndex2, nodeIndex2).solverPosition - solver.GetNode(chainIndex1, nodeIndex1).solverPosition; Vector3.OrthoNormalize(ref val, ref tangent); return tangent; } } [Serializable] public class IKEffector { public Transform bone; public Transform target; [Range(0f, 1f)] public float positionWeight; [Range(0f, 1f)] public float rotationWeight; public Vector3 position = Vector3.zero; public Quaternion rotation = Quaternion.identity; public Vector3 positionOffset; public bool effectChildNodes = true; [Range(0f, 1f)] public float maintainRelativePositionWeight; public Transform[] childBones = (Transform[])(object)new Transform[0]; public Transform planeBone1; public Transform planeBone2; public Transform planeBone3; public Quaternion planeRotationOffset = Quaternion.identity; private float posW; private float rotW; private Vector3[] localPositions = (Vector3[])(object)new Vector3[0]; private bool usePlaneNodes; private Quaternion animatedPlaneRotation = Quaternion.identity; private Vector3 animatedPosition; private bool firstUpdate; private int chainIndex = -1; private int nodeIndex = -1; private int plane1ChainIndex; private int plane1NodeIndex = -1; private int plane2ChainIndex = -1; private int plane2NodeIndex = -1; private int plane3ChainIndex = -1; private int plane3NodeIndex = -1; private int[] childChainIndexes = new int[0]; private int[] childNodeIndexes = new int[0]; public bool isEndEffector { get; private set; } public IKSolver.Node GetNode(IKSolverFullBody solver) { return solver.chain[chainIndex].nodes[nodeIndex]; } public void PinToBone(float positionWeight, float rotationWeight) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) position = bone.position; this.positionWeight = Mathf.Clamp(positionWeight, 0f, 1f); rotation = bone.rotation; this.rotationWeight = Mathf.Clamp(rotationWeight, 0f, 1f); } public IKEffector() { }//IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) public IKEffector(Transform bone, Transform[] childBones) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) this.bone = bone; this.childBones = childBones; } public bool IsValid(IKSolver solver, ref string message) { if ((Object)(object)bone == (Object)null) { message = "IK Effector bone is null."; return false; } if (solver.GetPoint(bone) == null) { message = "IK Effector is referencing to a bone '" + ((Object)bone).name + "' that does not excist in the Node Chain."; return false; } Transform[] array = childBones; for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] == (Object)null) { message = "IK Effector contains a null reference."; return false; } } array = childBones; foreach (Transform val in array) { if (solver.GetPoint(val) == null) { message = "IK Effector is referencing to a bone '" + ((Object)val).name + "' that does not excist in the Node Chain."; return false; } } if ((Object)(object)planeBone1 != (Object)null && solver.GetPoint(planeBone1) == null) { message = "IK Effector is referencing to a bone '" + ((Object)planeBone1).name + "' that does not excist in the Node Chain."; return false; } if ((Object)(object)planeBone2 != (Object)null && solver.GetPoint(planeBone2) == null) { message = "IK Effector is referencing to a bone '" + ((Object)planeBone2).name + "' that does not excist in the Node Chain."; return false; } if ((Object)(object)planeBone3 != (Object)null && solver.GetPoint(planeBone3) == null) { message = "IK Effector is referencing to a bone '" + ((Object)planeBone3).name + "' that does not excist in the Node Chain."; return false; } return true; } public void Initiate(IKSolverFullBody solver) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) position = bone.position; rotation = bone.rotation; animatedPlaneRotation = Quaternion.identity; solver.GetChainAndNodeIndexes(bone, out chainIndex, out nodeIndex); childChainIndexes = new int[childBones.Length]; childNodeIndexes = new int[childBones.Length]; for (int i = 0; i < childBones.Length; i++) { solver.GetChainAndNodeIndexes(childBones[i], out childChainIndexes[i], out childNodeIndexes[i]); } localPositions = (Vector3[])(object)new Vector3[childBones.Length]; usePlaneNodes = false; if ((Object)(object)planeBone1 != (Object)null) { solver.GetChainAndNodeIndexes(planeBone1, out plane1ChainIndex, out plane1NodeIndex); if ((Object)(object)planeBone2 != (Object)null) { solver.GetChainAndNodeIndexes(planeBone2, out plane2ChainIndex, out plane2NodeIndex); if ((Object)(object)planeBone3 != (Object)null) { solver.GetChainAndNodeIndexes(planeBone3, out plane3ChainIndex, out plane3NodeIndex); usePlaneNodes = true; } } isEndEffector = true; } else { isEndEffector = false; } } public void ResetOffset(IKSolverFullBody solver) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) solver.GetNode(chainIndex, nodeIndex).offset = Vector3.zero; for (int i = 0; i < childChainIndexes.Length; i++) { solver.GetNode(childChainIndexes[i], childNodeIndexes[i]).offset = Vector3.zero; } } public void SetToTarget() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)target == (Object)null)) { position = target.position; rotation = target.rotation; } } public void OnPreSolve(IKSolverFullBody solver) { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) positionWeight = Mathf.Clamp(positionWeight, 0f, 1f); rotationWeight = Mathf.Clamp(rotationWeight, 0f, 1f); maintainRelativePositionWeight = Mathf.Clamp(maintainRelativePositionWeight, 0f, 1f); posW = positionWeight * solver.IKPositionWeight; rotW = rotationWeight * solver.IKPositionWeight; solver.GetNode(chainIndex, nodeIndex).effectorPositionWeight = posW; solver.GetNode(chainIndex, nodeIndex).effectorRotationWeight = rotW; solver.GetNode(chainIndex, nodeIndex).solverRotation = rotation; if (float.IsInfinity(positionOffset.x) || float.IsInfinity(positionOffset.y) || float.IsInfinity(positionOffset.z)) { Debug.LogError((object)"Invalid IKEffector.positionOffset (contains Infinity)! Please make sure not to set IKEffector.positionOffset to infinite values.", (Object)(object)bone); } if (float.IsNaN(positionOffset.x) || float.IsNaN(positionOffset.y) || float.IsNaN(positionOffset.z)) { Debug.LogError((object)"Invalid IKEffector.positionOffset (contains NaN)! Please make sure not to set IKEffector.positionOffset to NaN values.", (Object)(object)bone); } if (((Vector3)(ref positionOffset)).sqrMagnitude > 1E+10f) { Debug.LogError((object)"Additive effector positionOffset detected in Full Body IK (extremely large value). Make sure you are not circularily adding to effector positionOffset each frame.", (Object)(object)bone); } if (float.IsInfinity(position.x) || float.IsInfinity(position.y) || float.IsInfinity(position.z)) { Debug.LogError((object)"Invalid IKEffector.position (contains Infinity)!"); } IKSolver.Node node = solver.GetNode(chainIndex, nodeIndex); node.offset += positionOffset * solver.IKPositionWeight; if (effectChildNodes && solver.iterations > 0) { for (int i = 0; i < childBones.Length; i++) { localPositions[i] = ((Component)childBones[i]).transform.position - ((Component)bone).transform.position; IKSolver.Node node2 = solver.GetNode(childChainIndexes[i], childNodeIndexes[i]); node2.offset += positionOffset * solver.IKPositionWeight; } } if (usePlaneNodes && maintainRelativePositionWeight > 0f) { animatedPlaneRotation = Quaternion.LookRotation(planeBone2.position - planeBone1.position, planeBone3.position - planeBone1.position); } firstUpdate = true; } public void OnPostWrite() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) positionOffset = Vector3.zero; } private Quaternion GetPlaneRotation(IKSolverFullBody solver) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Vector3 solverPosition = solver.GetNode(plane1ChainIndex, plane1NodeIndex).solverPosition; Vector3 solverPosition2 = solver.GetNode(plane2ChainIndex, plane2NodeIndex).solverPosition; Vector3 solverPosition3 = solver.GetNode(plane3ChainIndex, plane3NodeIndex).solverPosition; Vector3 val = solverPosition2 - solverPosition; Vector3 val2 = solverPosition3 - solverPosition; if (val == Vector3.zero) { Warning.Log("Make sure you are not placing 2 or more FBBIK effectors of the same chain to exactly the same position.", bone); return Quaternion.identity; } return Quaternion.LookRotation(val, val2); } public void Update(IKSolverFullBody solver) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) if (firstUpdate) { animatedPosition = bone.position + solver.GetNode(chainIndex, nodeIndex).offset; firstUpdate = false; } solver.GetNode(chainIndex, nodeIndex).solverPosition = Vector3.Lerp(GetPosition(solver, out planeRotationOffset), position, posW); if (effectChildNodes) { for (int i = 0; i < childBones.Length; i++) { solver.GetNode(childChainIndexes[i], childNodeIndexes[i]).solverPosition = Vector3.Lerp(solver.GetNode(childChainIndexes[i], childNodeIndexes[i]).solverPosition, solver.GetNode(chainIndex, nodeIndex).solverPosition + localPositions[i], posW); } } } private Vector3 GetPosition(IKSolverFullBody solver, out Quaternion planeRotationOffset) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) planeRotationOffset = Quaternion.identity; if (!isEndEffector) { return solver.GetNode(chainIndex, nodeIndex).solverPosition; } if (maintainRelativePositionWeight <= 0f) { return animatedPosition; } Vector3 val = bone.position; Vector3 val2 = val - planeBone1.position; planeRotationOffset = GetPlaneRotation(solver) * Quaternion.Inverse(animatedPlaneRotation); val = solver.GetNode(plane1ChainIndex, plane1NodeIndex).solverPosition + planeRotationOffset * val2; planeRotationOffset = Quaternion.Lerp(Quaternion.identity, planeRotationOffset, maintainRelativePositionWeight); return Vector3.Lerp(animatedPosition, val + solver.GetNode(chainIndex, nodeIndex).offset, maintainRelativePositionWeight); } } [Serializable] public class IKMapping { [Serializable] public class BoneMap { public Transform transform; public int chainIndex = -1; public int nodeIndex = -1; public Vector3 defaultLocalPosition; public Quaternion defaultLocalRotation; public Vector3 localSwingAxis; public Vector3 localTwistAxis; public Vector3 planePosition; public Vector3 ikPosition; public Quaternion defaultLocalTargetRotation; private Quaternion maintainRotation; public float length; public Quaternion animatedRotation; private Transform planeBone1; private Transform planeBone2; private Transform planeBone3; private int plane1ChainIndex = -1; private int plane1NodeIndex = -1; private int plane2ChainIndex = -1; private int plane2NodeIndex = -1; private int plane3ChainIndex = -1; private int plane3NodeIndex = -1; public Vector3 swingDirection => transform.rotation * localSwingAxis; public bool isNodeBone => nodeIndex != -1; private Quaternion lastAnimatedTargetRotation { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (planeBone1.position == planeBone3.position) { return Quaternion.identity; } return Quaternion.LookRotation(planeBone2.position - planeBone1.position, planeBone3.position - planeBone1.position); } } public void Initiate(Transform transform, IKSolverFullBody solver) { this.transform = transform; solver.GetChainAndNodeIndexes(transform, out chainIndex, out nodeIndex); } public void StoreDefaultLocalState() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) defaultLocalPosition = transform.localPosition; defaultLocalRotation = transform.localRotation; } public void FixTransform(bool position) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (position) { transform.localPosition = defaultLocalPosition; } transform.localRotation = defaultLocalRotation; } public void SetLength(BoneMap nextBone) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) length = Vector3.Distance(transform.position, nextBone.transform.position); } public void SetLocalSwingAxis(BoneMap swingTarget) { SetLocalSwingAxis(swingTarget, this); } public void SetLocalSwingAxis(BoneMap bone1, BoneMap bone2) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) localSwingAxis = Quaternion.Inverse(transform.rotation) * (bone1.transform.position - bone2.transform.position); } public void SetLocalTwistAxis(Vector3 twistDirection, Vector3 normalDirection) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector3.OrthoNormalize(ref normalDirection, ref twistDirection); localTwistAxis = Quaternion.Inverse(transform.rotation) * twistDirection; } public void SetPlane(IKSolverFullBody solver, Transform planeBone1, Transform planeBone2, Transform planeBone3) { this.planeBone1 = planeBone1; this.planeBone2 = planeBone2; this.planeBone3 = planeBone3; solver.GetChainAndNodeIndexes(planeBone1, out plane1ChainIndex, out plane1NodeIndex); solver.GetChainAndNodeIndexes(planeBone2, out plane2ChainIndex, out plane2NodeIndex); solver.GetChainAndNodeIndexes(planeBone3, out plane3ChainIndex, out plane3NodeIndex); UpdatePlane(rotation: true, position: true); } public void UpdatePlane(bool rotation, bool position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) Quaternion val = lastAnimatedTargetRotation; if (rotation) { defaultLocalTargetRotation = QuaTools.RotationToLocalSpace(transform.rotation, val); } if (position) { planePosition = Quaternion.Inverse(val) * (transform.position - planeBone1.position); } } public void SetIKPosition() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) ikPosition = transform.position; } public void MaintainRotation() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) maintainRotation = transform.rotation; } public void SetToIKPosition() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) transform.position = ikPosition; } public void FixToNode(IKSolverFullBody solver, float weight, IKSolver.Node fixNode = null) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (fixNode == null) { fixNode = solver.GetNode(chainIndex, nodeIndex); } if (weight >= 1f) { transform.position = fixNode.solverPosition; } else { transform.position = Vector3.Lerp(transform.position, fixNode.solverPosition, weight); } } public Vector3 GetPlanePosition(IKSolverFullBody solver) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) return solver.GetNode(plane1ChainIndex, plane1NodeIndex).solverPosition + GetTargetRotation(solver) * planePosition; } public void PositionToPlane(IKSolverFullBody solver) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) transform.position = GetPlanePosition(solver); } public void RotateToPlane(IKSolverFullBody solver, float weight) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) Quaternion val = GetTargetRotation(solver) * defaultLocalTargetRotation; if (weight >= 1f) { transform.rotation = val; } else { transform.rotation = Quaternion.Lerp(transform.rotation, val, weight); } } public void Swing(Vector3 swingTarget, float weight) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Swing(swingTarget, transform.position, weight); } public void Swing(Vector3 pos1, Vector3 pos2, float weight) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.FromToRotation(transform.rotation * localSwingAxis, pos1 - pos2) * transform.rotation; if (weight >= 1f) { transform.rotation = val; } else { transform.rotation = Quaternion.Lerp(transform.rotation, val, weight); } } public void Twist(Vector3 twistDirection, Vector3 normalDirection, float weight) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) Vector3.OrthoNormalize(ref normalDirection, ref twistDirection); Quaternion val = Quaternion.FromToRotation(transform.rotation * localTwistAxis, twistDirection) * transform.rotation; if (weight >= 1f) { transform.rotation = val; } else { transform.rotation = Quaternion.Lerp(transform.rotation, val, weight); } } public void RotateToMaintain(float weight) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { transform.rotation = Quaternion.Lerp(transform.rotation, maintainRotation, weight); } } public void RotateToEffector(IKSolverFullBody solver, float weight) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (!isNodeBone) { return; } float num = weight * solver.GetNode(chainIndex, nodeIndex).effectorRotationWeight; if (!(num <= 0f)) { if (num >= 1f) { transform.rotation = solver.GetNode(chainIndex, nodeIndex).solverRotation; } else { transform.rotation = Quaternion.Lerp(transform.rotation, solver.GetNode(chainIndex, nodeIndex).solverRotation, num); } } } private Quaternion GetTargetRotation(IKSolverFullBody solver) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) Vector3 solverPosition = solver.GetNode(plane1ChainIndex, plane1NodeIndex).solverPosition; Vector3 solverPosition2 = solver.GetNode(plane2ChainIndex, plane2NodeIndex).solverPosition; Vector3 solverPosition3 = solver.GetNode(plane3ChainIndex, plane3NodeIndex).solverPosition; if (solverPosition == solverPosition3) { return Quaternion.identity; } return Quaternion.LookRotation(solverPosition2 - solverPosition, solverPosition3 - solverPosition); } } public virtual bool IsValid(IKSolver solver, ref string message) { return true; } public virtual void Initiate(IKSolverFullBody solver) { } protected bool BoneIsValid(Transform bone, IKSolver solver, ref string message, Warning.Logger logger = null) { if ((Object)(object)bone == (Object)null) { message = "IKMappingLimb contains a null reference."; logger?.Invoke(message); return false; } if (solver.GetPoint(bone) == null) { message = "IKMappingLimb is referencing to a bone '" + ((Object)bone).name + "' that does not excist in the Node Chain."; logger?.Invoke(message); return false; } return true; } protected Vector3 SolveFABRIKJoint(Vector3 pos1, Vector3 pos2, float length) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pos1 - pos2; return pos2 + ((Vector3)(ref val)).normalized * length; } } [Serializable] public class IKMappingBone : IKMapping { public Transform bone; [Range(0f, 1f)] public float maintainRotationWeight = 1f; private BoneMap boneMap = new BoneMap(); public override bool IsValid(IKSolver solver, ref string message) { if (!base.IsValid(solver, ref message)) { return false; } if ((Object)(object)bone == (Object)null) { message = "IKMappingBone's bone is null."; return false; } return true; } public IKMappingBone() { } public IKMappingBone(Transform bone) { this.bone = bone; } public void StoreDefaultLocalState() { boneMap.StoreDefaultLocalState(); } public void FixTransforms() { boneMap.FixTransform(position: false); } public override void Initiate(IKSolverFullBody solver) { if (boneMap == null) { boneMap = new BoneMap(); } boneMap.Initiate(bone, solver); } public void ReadPose() { boneMap.MaintainRotation(); } public void WritePose(float solverWeight) { boneMap.RotateToMaintain(solverWeight * maintainRotationWeight); } } [Serializable] public class IKMappingLimb : IKMapping { [Serializable] public enum BoneMapType { Parent, Bone1, Bone2, Bone3 } public Transform parentBone; public Transform bone1; public Transform bone2; public Transform bone3; [Range(0f, 1f)] public float maintainRotationWeight; [Range(0f, 1f)] public float weight = 1f; [NonSerialized] public bool updatePlaneRotations = true; private BoneMap boneMapParent = new BoneMap(); private BoneMap boneMap1 = new BoneMap(); private BoneMap boneMap2 = new BoneMap(); private BoneMap boneMap3 = new BoneMap(); public override bool IsValid(IKSolver solver, ref string message) { if (!base.IsValid(solver, ref message)) { return false; } if (!BoneIsValid(bone1, solver, ref message)) { return false; } if (!BoneIsValid(bone2, solver, ref message)) { return false; } if (!BoneIsValid(bone3, solver, ref message)) { return false; } return true; } public BoneMap GetBoneMap(BoneMapType boneMap) { switch (boneMap) { case BoneMapType.Parent: if ((Object)(object)parentBone == (Object)null) { Warning.Log("This limb does not have a parent (shoulder) bone", bone1); } return boneMapParent; case BoneMapType.Bone1: return boneMap1; case BoneMapType.Bone2: return boneMap2; default: return boneMap3; } } public void SetLimbOrientation(Vector3 upper, Vector3 lower) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) boneMap1.defaultLocalTargetRotation = Quaternion.Inverse(Quaternion.Inverse(bone1.rotation) * Quaternion.LookRotation(bone2.position - bone1.position, bone1.rotation * -upper)); boneMap2.defaultLocalTargetRotation = Quaternion.Inverse(Quaternion.Inverse(bone2.rotation) * Quaternion.LookRotation(bone3.position - bone2.position, bone2.rotation * -lower)); } public IKMappingLimb() { } public IKMappingLimb(Transform bone1, Transform bone2, Transform bone3, Transform parentBone = null) { SetBones(bone1, bone2, bone3, parentBone); } public void SetBones(Transform bone1, Transform bone2, Transform bone3, Transform parentBone = null) { this.bone1 = bone1; this.bone2 = bone2; this.bone3 = bone3; this.parentBone = parentBone; } public void StoreDefaultLocalState() { if ((Object)(object)parentBone != (Object)null) { boneMapParent.StoreDefaultLocalState(); } boneMap1.StoreDefaultLocalState(); boneMap2.StoreDefaultLocalState(); boneMap3.StoreDefaultLocalState(); } public void FixTransforms() { if ((Object)(object)parentBone != (Object)null) { boneMapParent.FixTransform(position: false); } boneMap1.FixTransform(position: true); boneMap2.FixTransform(position: false); boneMap3.FixTransform(position: false); } public override void Initiate(IKSolverFullBody solver) { if (boneMapParent == null) { boneMapParent = new BoneMap(); } if (boneMap1 == null) { boneMap1 = new BoneMap(); } if (boneMap2 == null) { boneMap2 = new BoneMap(); } if (boneMap3 == null) { boneMap3 = new BoneMap(); } if ((Object)(object)parentBone != (Object)null) { boneMapParent.Initiate(parentBone, solver); } boneMap1.Initiate(bone1, solver); boneMap2.Initiate(bone2, solver); boneMap3.Initiate(bone3, solver); boneMap1.SetPlane(solver, boneMap1.transform, boneMap2.transform, boneMap3.transform); boneMap2.SetPlane(solver, boneMap2.transform, boneMap3.transform, boneMap1.transform); if ((Object)(object)parentBone != (Object)null) { boneMapParent.SetLocalSwingAxis(boneMap1); } } public void ReadPose() { boneMap1.UpdatePlane(updatePlaneRotations, position: true); boneMap2.UpdatePlane(updatePlaneRotations, position: false); weight = Mathf.Clamp(weight, 0f, 1f); boneMap3.MaintainRotation(); } public void WritePose(IKSolverFullBody solver, bool fullBody) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } if (fullBody) { if ((Object)(object)parentBone != (Object)null) { boneMapParent.Swing(solver.GetNode(boneMap1.chainIndex, boneMap1.nodeIndex).solverPosition, weight); } boneMap1.FixToNode(solver, weight); } boneMap1.RotateToPlane(solver, weight); boneMap2.RotateToPlane(solver, weight); boneMap3.RotateToMaintain(maintainRotationWeight * weight * solver.IKPositionWeight); boneMap3.RotateToEffector(solver, weight); } } [Serializable] public class IKMappingSpine : IKMapping { public Transform[] spineBones; public Transform leftUpperArmBone; public Transform rightUpperArmBone; public Transform leftThighBone; public Transform rightThighBone; [Range(1f, 3f)] public int iterations = 3; [Range(0f, 1f)] public float twistWeight = 1f; private int rootNodeIndex; private BoneMap[] spine = new BoneMap[0]; private BoneMap leftUpperArm = new BoneMap(); private BoneMap rightUpperArm = new BoneMap(); private BoneMap leftThigh = new BoneMap(); private BoneMap rightThigh = new BoneMap(); private bool useFABRIK; public override bool IsValid(IKSolver solver, ref string message) { if (!base.IsValid(solver, ref message)) { return false; } Transform[] array = spineBones; for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] == (Object)null) { message = "Spine bones contains a null reference."; return false; } } int num = 0; for (int j = 0; j < spineBones.Length; j++) { if (solver.GetPoint(spineBones[j]) != null) { num++; } } if (num == 0) { message = "IKMappingSpine does not contain any nodes."; return false; } if ((Object)(object)leftUpperArmBone == (Object)null) { message = "IKMappingSpine is missing the left upper arm bone."; return false; } if ((Object)(object)rightUpperArmBone == (Object)null) { message = "IKMappingSpine is missing the right upper arm bone."; return false; } if ((Object)(object)leftThighBone == (Object)null) { message = "IKMappingSpine is missing the left thigh bone."; return false; } if ((Object)(object)rightThighBone == (Object)null) { message = "IKMappingSpine is missing the right thigh bone."; return false; } if (solver.GetPoint(leftUpperArmBone) == null) { message = "Full Body IK is missing the left upper arm node."; return false; } if (solver.GetPoint(rightUpperArmBone) == null) { message = "Full Body IK is missing the right upper arm node."; return false; } if (solver.GetPoint(leftThighBone) == null) { message = "Full Body IK is missing the left thigh node."; return false; } if (solver.GetPoint(rightThighBone) == null) { message = "Full Body IK is missing the right thigh node."; return false; } return true; } public IKMappingSpine() { } public IKMappingSpine(Transform[] spineBones, Transform leftUpperArmBone, Transform rightUpperArmBone, Transform leftThighBone, Transform rightThighBone) { SetBones(spineBones, leftUpperArmBone, rightUpperArmBone, leftThighBone, rightThighBone); } public void SetBones(Transform[] spineBones, Transform leftUpperArmBone, Transform rightUpperArmBone, Transform leftThighBone, Transform rightThighBone) { this.spineBones = spineBones; this.leftUpperArmBone = leftUpperArmBone; this.rightUpperArmBone = rightUpperArmBone; this.leftThighBone = leftThighBone; this.rightThighBone = rightThighBone; } public void StoreDefaultLocalState() { for (int i = 0; i < spine.Length; i++) { spine[i].StoreDefaultLocalState(); } } public void FixTransforms() { for (int i = 0; i < spine.Length; i++) { spine[i].FixTransform(i == 0 || i == spine.Length - 1); } } public override void Initiate(IKSolverFullBody solver) { //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) if (iterations <= 0) { iterations = 3; } if (spine == null || spine.Length != spineBones.Length) { spine = new BoneMap[spineBones.Length]; } rootNodeIndex = -1; for (int i = 0; i < spineBones.Length; i++) { if (spine[i] == null) { spine[i] = new BoneMap(); } spine[i].Initiate(spineBones[i], solver); if (spine[i].isNodeBone) { rootNodeIndex = i; } } if (leftUpperArm == null) { leftUpperArm = new BoneMap(); } if (rightUpperArm == null) { rightUpperArm = new BoneMap(); } if (leftThigh == null) { leftThigh = new BoneMap(); } if (rightThigh == null) { rightThigh = new BoneMap(); } leftUpperArm.Initiate(leftUpperArmBone, solver); rightUpperArm.Initiate(rightUpperArmBone, solver); leftThigh.Initiate(leftThighBone, solver); rightThigh.Initiate(rightThighBone, solver); for (int j = 0; j < spine.Length; j++) { spine[j].SetIKPosition(); } spine[0].SetPlane(solver, spine[rootNodeIndex].transform, leftThigh.transform, rightThigh.transform); for (int k = 0; k < spine.Length - 1; k++) { spine[k].SetLength(spine[k + 1]); spine[k].SetLocalSwingAxis(spine[k + 1]); spine[k].SetLocalTwistAxis(leftUpperArm.transform.position - rightUpperArm.transform.position, spine[k + 1].transform.position - spine[k].transform.position); } spine[spine.Length - 1].SetPlane(solver, spine[rootNodeIndex].transform, leftUpperArm.transform, rightUpperArm.transform); spine[spine.Length - 1].SetLocalSwingAxis(leftUpperArm, rightUpperArm); useFABRIK = UseFABRIK(); } private bool UseFABRIK() { if (spine.Length > 3) { return true; } if (rootNodeIndex != 1) { return true; } return false; } public void ReadPose() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) spine[0].UpdatePlane(rotation: true, position: true); for (int i = 0; i < spine.Length - 1; i++) { spine[i].SetLength(spine[i + 1]); spine[i].SetLocalSwingAxis(spine[i + 1]); spine[i].SetLocalTwistAxis(leftUpperArm.transform.position - rightUpperArm.transform.position, spine[i + 1].transform.position - spine[i].transform.position); } spine[spine.Length - 1].UpdatePlane(rotation: true, position: true); spine[spine.Length - 1].SetLocalSwingAxis(leftUpperArm, rightUpperArm); } public void WritePose(IKSolverFullBody solver) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) Vector3 planePosition = spine[0].GetPlanePosition(solver); Vector3 solverPosition = solver.GetNode(spine[rootNodeIndex].chainIndex, spine[rootNodeIndex].nodeIndex).solverPosition; Vector3 planePosition2 = spine[spine.Length - 1].GetPlanePosition(solver); if (useFABRIK) { Vector3 val = solver.GetNode(spine[rootNodeIndex].chainIndex, spine[rootNodeIndex].nodeIndex).solverPosition - spine[rootNodeIndex].transform.position; for (int i = 0; i < spine.Length; i++) { spine[i].ikPosition = spine[i].transform.position + val; } for (int j = 0; j < iterations; j++) { ForwardReach(planePosition2); BackwardReach(planePosition); spine[rootNodeIndex].ikPosition = solverPosition; } } else { spine[0].ikPosition = planePosition; spine[rootNodeIndex].ikPosition = solverPosition; } spine[spine.Length - 1].ikPosition = planePosition2; MapToSolverPositions(solver); } public void ForwardReach(Vector3 position) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) spine[spineBones.Length - 1].ikPosition = position; for (int num = spine.Length - 2; num > -1; num--) { spine[num].ikPosition = SolveFABRIKJoint(spine[num].ikPosition, spine[num + 1].ikPosition, spine[num].length); } } private void BackwardReach(Vector3 position) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) spine[0].ikPosition = position; for (int i = 1; i < spine.Length; i++) { spine[i].ikPosition = SolveFABRIKJoint(spine[i].ikPosition, spine[i - 1].ikPosition, spine[i - 1].length); } } private void MapToSolverPositions(IKSolverFullBody solver) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) spine[0].SetToIKPosition(); spine[0].RotateToPlane(solver, 1f); for (int i = 1; i < spine.Length - 1; i++) { spine[i].Swing(spine[i + 1].ikPosition, 1f); if (twistWeight > 0f) { float num = (float)i / ((float)spine.Length - 2f); Vector3 solverPosition = solver.GetNode(leftUpperArm.chainIndex, leftUpperArm.nodeIndex).solverPosition; Vector3 solverPosition2 = solver.GetNode(rightUpperArm.chainIndex, rightUpperArm.nodeIndex).solverPosition; spine[i].Twist(solverPosition - solverPosition2, spine[i + 1].ikPosition - spine[i].transform.position, num * twistWeight); } } spine[spine.Length - 1].SetToIKPosition(); spine[spine.Length - 1].RotateToPlane(solver, 1f); } } [Serializable] public abstract class IKSolver { [Serializable] public class Point { public Transform transform; [Range(0f, 1f)] public float weight = 1f; public Vector3 solverPosition; public Quaternion solverRotation = Quaternion.identity; public Vector3 defaultLocalPosition; public Quaternion defaultLocalRotation; public void StoreDefaultLocalState() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) defaultLocalPosition = transform.localPosition; defaultLocalRotation = transform.localRotation; } public void FixTransform() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (transform.localPosition != defaultLocalPosition) { transform.localPosition = defaultLocalPosition; } if (transform.localRotation != defaultLocalRotation) { transform.localRotation = defaultLocalRotation; } } public void UpdateSolverPosition() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) solverPosition = transform.position; } public void UpdateSolverLocalPosition() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) solverPosition = transform.localPosition; } public void UpdateSolverState() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) solverPosition = transform.position; solverRotation = transform.rotation; } public void UpdateSolverLocalState() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) solverPosition = transform.localPosition; solverRotation = transform.localRotation; } } [Serializable] public class Bone : Point { public float length; public float sqrMag; public Vector3 axis = -Vector3.right; private RotationLimit _rotationLimit; private bool isLimited = true; public RotationLimit rotationLimit { get { if (!isLimited) { return null; } if ((Object)(object)_rotationLimit == (Object)null) { _rotationLimit = ((Component)transform).GetComponent(); } isLimited = (Object)(object)_rotationLimit != (Object)null; return _rotationLimit; } set { _rotationLimit = value; isLimited = (Object)(object)value != (Object)null; } } public void Swing(Vector3 swingTarget, float weight = 1f) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { Quaternion val = Quaternion.FromToRotation(transform.rotation * axis, swingTarget - transform.position); if (weight >= 1f) { transform.rotation = val * transform.rotation; } else { transform.rotation = Quaternion.Lerp(Quaternion.identity, val, weight) * transform.rotation; } } } public static void SolverSwing(Bone[] bones, int index, Vector3 swingTarget, float weight = 1f) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } Quaternion val = Quaternion.FromToRotation(bones[index].solverRotation * bones[index].axis, swingTarget - bones[index].solverPosition); if (weight >= 1f) { for (int i = index; i < bones.Length; i++) { bones[i].solverRotation = val * bones[i].solverRotation; } } else { for (int j = index; j < bones.Length; j++) { bones[j].solverRotation = Quaternion.Lerp(Quaternion.identity, val, weight) * bones[j].solverRotation; } } } public void Swing2D(Vector3 swingTarget, float weight = 1f) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { Vector3 val = transform.rotation * axis; Vector3 val2 = swingTarget - transform.position; float num = Mathf.Atan2(val.x, val.y) * 57.29578f; float num2 = Mathf.Atan2(val2.x, val2.y) * 57.29578f; transform.rotation = Quaternion.AngleAxis(Mathf.DeltaAngle(num, num2) * weight, Vector3.back) * transform.rotation; } } public void SetToSolverPosition() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) transform.position = solverPosition; } public Bone() { }//IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) public Bone(Transform transform) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) base.transform = transform; } public Bone(Transform transform, float weight) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) base.transform = transform; base.weight = weight; } } [Serializable] public class Node : Point { public float length; public float effectorPositionWeight; public float effectorRotationWeight; public Vector3 offset; public Node() { } public Node(Transform transform) { base.transform = transform; } public Node(Transform transform, float weight) { base.transform = transform; base.weight = weight; } } public delegate void UpdateDelegate(); public delegate void IterationDelegate(int i); [HideInInspector] public bool executedInEditor; [HideInInspector] public Vector3 IKPosition; [Tooltip("The positional or the master weight of the solver.")] [Range(0f, 1f)] public float IKPositionWeight = 1f; public UpdateDelegate OnPreInitiate; public UpdateDelegate OnPostInitiate; public UpdateDelegate OnPreUpdate; public UpdateDelegate OnPostUpdate; protected bool firstInitiation = true; [SerializeField] [HideInInspector] protected Transform root; public bool initiated { get; private set; } public bool IsValid() { string message = string.Empty; return IsValid(ref message); } public abstract bool IsValid(ref string message); public void Initiate(Transform root) { if (executedInEditor) { return; } if (OnPreInitiate != null) { OnPreInitiate(); } if ((Object)(object)root == (Object)null) { Debug.LogError((object)"Initiating IKSolver with null root Transform."); } this.root = root; initiated = false; string message = string.Empty; if (!IsValid(ref message)) { Warning.Log(message, root); return; } OnInitiate(); StoreDefaultLocalState(); initiated = true; firstInitiation = false; if (OnPostInitiate != null) { OnPostInitiate(); } } public void Update() { if (OnPreUpdate != null) { OnPreUpdate(); } if (firstInitiation) { Initiate(root); } if (initiated) { OnUpdate(); if (OnPostUpdate != null) { OnPostUpdate(); } } } public virtual Vector3 GetIKPosition() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return IKPosition; } public void SetIKPosition(Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) IKPosition = position; } public float GetIKPositionWeight() { return IKPositionWeight; } public void SetIKPositionWeight(float weight) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); } public Transform GetRoot() { return root; } public abstract Point[] GetPoints(); public abstract Point GetPoint(Transform transform); public abstract void FixTransforms(); public abstract void StoreDefaultLocalState(); protected abstract void OnInitiate(); protected abstract void OnUpdate(); protected void LogWarning(string message) { Warning.Log(message, root, logInEditMode: true); } public static Transform ContainsDuplicateBone(Bone[] bones) { for (int i = 0; i < bones.Length; i++) { for (int j = 0; j < bones.Length; j++) { if (i != j && (Object)(object)bones[i].transform == (Object)(object)bones[j].transform) { return bones[i].transform; } } } return null; } public static bool HierarchyIsValid(Bone[] bones) { for (int i = 1; i < bones.Length; i++) { if (!Hierarchy.IsAncestor(bones[i].transform, bones[i - 1].transform)) { return false; } } return true; } protected static float PreSolveBones(ref Bone[] bones) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) float num = 0f; for (int i = 0; i < bones.Length; i++) { bones[i].solverPosition = bones[i].transform.position; bones[i].solverRotation = bones[i].transform.rotation; } for (int j = 0; j < bones.Length; j++) { if (j < bones.Length - 1) { Bone obj = bones[j]; Vector3 val = bones[j + 1].solverPosition - bones[j].solverPosition; obj.sqrMag = ((Vector3)(ref val)).sqrMagnitude; bones[j].length = Mathf.Sqrt(bones[j].sqrMag); num += bones[j].length; bones[j].axis = Quaternion.Inverse(bones[j].solverRotation) * (bones[j + 1].solverPosition - bones[j].solverPosition); } else { bones[j].sqrMag = 0f; bones[j].length = 0f; } } return num; } } [Serializable] public class IKSolverAim : IKSolverHeuristic { public Transform transform; public Vector3 axis = Vector3.forward; public Vector3 poleAxis = Vector3.up; public Vector3 polePosition; [Range(0f, 1f)] public float poleWeight; public Transform poleTarget; [Range(0f, 1f)] public float clampWeight = 0.1f; [Range(0f, 2f)] public int clampSmoothing = 2; public IterationDelegate OnPreIteration; private float step; private Vector3 clampedIKPosition; private RotationLimit transformLimit; private Transform lastTransform; public Vector3 transformAxis => transform.rotation * axis; public Vector3 transformPoleAxis => transform.rotation * poleAxis; protected override int minBones => 1; protected override Vector3 localDirection => bones[0].transform.InverseTransformDirection(bones[bones.Length - 1].transform.forward); public float GetAngle() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) return Vector3.Angle(transformAxis, IKPosition - transform.position); } protected override void OnInitiate() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) if ((firstInitiation || !Application.isPlaying) && (Object)(object)transform != (Object)null) { IKPosition = transform.position + transformAxis * 3f; polePosition = transform.position + transformPoleAxis * 3f; } for (int i = 0; i < bones.Length; i++) { if ((Object)(object)bones[i].rotationLimit != (Object)null) { bones[i].rotationLimit.Disable(); } } step = 1f / (float)bones.Length; if (Application.isPlaying) { axis = ((Vector3)(ref axis)).normalized; } } protected override void OnUpdate() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) if (axis == Vector3.zero) { if (!Warning.logged) { LogWarning("IKSolverAim axis is Vector3.zero."); } return; } if (poleAxis == Vector3.zero && poleWeight > 0f) { if (!Warning.logged) { LogWarning("IKSolverAim poleAxis is Vector3.zero."); } return; } if ((Object)(object)target != (Object)null) { IKPosition = target.position; } if ((Object)(object)poleTarget != (Object)null) { polePosition = poleTarget.position; } if (XY) { IKPosition.z = bones[0].transform.position.z; } if (IKPositionWeight <= 0f) { return; } IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); if ((Object)(object)transform != (Object)(object)lastTransform) { transformLimit = ((Component)transform).GetComponent(); if ((Object)(object)transformLimit != (Object)null) { ((Behaviour)transformLimit).enabled = false; } lastTransform = transform; } if ((Object)(object)transformLimit != (Object)null) { transformLimit.Apply(); } if ((Object)(object)transform == (Object)null) { if (!Warning.logged) { LogWarning("Aim Transform unassigned in Aim IK solver. Please Assign a Transform (lineal descendant to the last bone in the spine) that you want to be aimed at IKPosition"); } return; } clampWeight = Mathf.Clamp(clampWeight, 0f, 1f); clampedIKPosition = GetClampedIKPosition(); Vector3 val = clampedIKPosition - transform.position; val = Vector3.Slerp(transformAxis * ((Vector3)(ref val)).magnitude, val, IKPositionWeight); clampedIKPosition = transform.position + val; for (int i = 0; i < maxIterations && (i < 1 || !(tolerance > 0f) || !(GetAngle() < tolerance)); i++) { lastLocalDirection = localDirection; if (OnPreIteration != null) { OnPreIteration(i); } Solve(); } lastLocalDirection = localDirection; } private void Solve() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < bones.Length - 1; i++) { RotateToTarget(clampedIKPosition, bones[i], step * (float)(i + 1) * IKPositionWeight * bones[i].weight); } RotateToTarget(clampedIKPosition, bones[bones.Length - 1], IKPositionWeight * bones[bones.Length - 1].weight); } private Vector3 GetClampedIKPosition() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) if (clampWeight <= 0f) { return IKPosition; } if (clampWeight >= 1f) { Vector3 position = transform.position; Vector3 val = transformAxis; Vector3 val2 = IKPosition - transform.position; return position + val * ((Vector3)(ref val2)).magnitude; } float num = Vector3.Angle(transformAxis, IKPosition - transform.position); float num2 = 1f - num / 180f; float num3 = ((clampWeight > 0f) ? Mathf.Clamp(1f - (clampWeight - num2) / (1f - num2), 0f, 1f) : 1f); float num4 = ((clampWeight > 0f) ? Mathf.Clamp(num2 / clampWeight, 0f, 1f) : 1f); for (int i = 0; i < clampSmoothing; i++) { num4 = Mathf.Sin(num4 * MathF.PI * 0.5f); } return transform.position + Vector3.Slerp(transformAxis * 10f, IKPosition - transform.position, num4 * num3); } private void RotateToTarget(Vector3 targetPosition, Bone bone, float weight) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) if (XY) { if (weight >= 0f) { Vector3 val = transformAxis; Vector3 val2 = targetPosition - transform.position; float num = Mathf.Atan2(val.x, val.y) * 57.29578f; float num2 = Mathf.Atan2(val2.x, val2.y) * 57.29578f; bone.transform.rotation = Quaternion.AngleAxis(Mathf.DeltaAngle(num, num2), Vector3.back) * bone.transform.rotation; } } else { if (weight >= 0f) { Quaternion val3 = Quaternion.FromToRotation(transformAxis, targetPosition - transform.position); if (weight >= 1f) { bone.transform.rotation = val3 * bone.transform.rotation; } else { bone.transform.rotation = Quaternion.Lerp(Quaternion.identity, val3, weight) * bone.transform.rotation; } } if (poleWeight > 0f) { Vector3 val4 = polePosition - transform.position; Vector3 val5 = transformAxis; Vector3.OrthoNormalize(ref val5, ref val4); Quaternion val6 = Quaternion.FromToRotation(transformPoleAxis, val4); bone.transform.rotation = Quaternion.Lerp(Quaternion.identity, val6, weight * poleWeight) * bone.transform.rotation; } } if (useRotationLimits && (Object)(object)bone.rotationLimit != (Object)null) { bone.rotationLimit.Apply(); } } } [Serializable] public class IKSolverArm : IKSolver { [Range(0f, 1f)] public float IKRotationWeight = 1f; public Quaternion IKRotation = Quaternion.identity; public Point chest = new Point(); public Point shoulder = new Point(); public Point upperArm = new Point(); public Point forearm = new Point(); public Point hand = new Point(); public bool isLeft; public IKSolverVR.Arm arm = new IKSolverVR.Arm(); private Vector3[] positions = (Vector3[])(object)new Vector3[6]; private Quaternion[] rotations = (Quaternion[])(object)new Quaternion[6]; public override bool IsValid(ref string message) { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown if ((Object)(object)chest.transform == (Object)null || (Object)(object)shoulder.transform == (Object)null || (Object)(object)upperArm.transform == (Object)null || (Object)(object)forearm.transform == (Object)null || (Object)(object)hand.transform == (Object)null) { message = "Please assign all bone slots of the Arm IK solver."; return false; } Object[] objects = (Object[])(object)new Transform[5] { chest.transform, shoulder.transform, upperArm.transform, forearm.transform, hand.transform }; Transform val = (Transform)Hierarchy.ContainsDuplicate(objects); if ((Object)(object)val != (Object)null) { message = ((Object)val).name + " is represented multiple times in the ArmIK."; return false; } return true; } public bool SetChain(Transform chest, Transform shoulder, Transform upperArm, Transform forearm, Transform hand, Transform root) { this.chest.transform = chest; this.shoulder.transform = shoulder; this.upperArm.transform = upperArm; this.forearm.transform = forearm; this.hand.transform = hand; Initiate(root); return base.initiated; } public override Point[] GetPoints() { return new Point[5] { chest, shoulder, upperArm, forearm, hand }; } public override Point GetPoint(Transform transform) { if ((Object)(object)chest.transform == (Object)(object)transform) { return chest; } if ((Object)(object)shoulder.transform == (Object)(object)transform) { return shoulder; } if ((Object)(object)upperArm.transform == (Object)(object)transform) { return upperArm; } if ((Object)(object)forearm.transform == (Object)(object)transform) { return forearm; } if ((Object)(object)hand.transform == (Object)(object)transform) { return hand; } return null; } public override void StoreDefaultLocalState() { shoulder.StoreDefaultLocalState(); upperArm.StoreDefaultLocalState(); forearm.StoreDefaultLocalState(); hand.StoreDefaultLocalState(); } public override void FixTransforms() { if (base.initiated) { shoulder.FixTransform(); upperArm.FixTransform(); forearm.FixTransform(); hand.FixTransform(); } } protected override void OnInitiate() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) IKPosition = hand.transform.position; IKRotation = hand.transform.rotation; Read(); } protected override void OnUpdate() { Read(); Solve(); Write(); } private void Solve() { arm.PreSolve(); arm.ApplyOffsets(1f); arm.Solve(isLeft); arm.ResetOffsets(); } private void Read() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) arm.IKPosition = IKPosition; arm.positionWeight = IKPositionWeight; arm.IKRotation = IKRotation; arm.rotationWeight = IKRotationWeight; positions[0] = root.position; positions[1] = chest.transform.position; positions[2] = shoulder.transform.position; positions[3] = upperArm.transform.position; positions[4] = forearm.transform.position; positions[5] = hand.transform.position; rotations[0] = root.rotation; rotations[1] = chest.transform.rotation; rotations[2] = shoulder.transform.rotation; rotations[3] = upperArm.transform.rotation; rotations[4] = forearm.transform.rotation; rotations[5] = hand.transform.rotation; arm.Read(positions, rotations, hasChest: false, hasNeck: false, hasShoulders: true, hasToes: false, hasLegs: false, 1, 2); } private void Write() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) arm.Write(ref positions, ref rotations); shoulder.transform.rotation = rotations[2]; upperArm.transform.rotation = rotations[3]; forearm.transform.rotation = rotations[4]; hand.transform.rotation = rotations[5]; forearm.transform.position = positions[4]; hand.transform.position = positions[5]; } } [Serializable] public class IKSolverCCD : IKSolverHeuristic { public IterationDelegate OnPreIteration; public void FadeOutBoneWeights() { if (bones.Length >= 2) { bones[0].weight = 1f; float num = 1f / (float)(bones.Length - 1); for (int i = 1; i < bones.Length; i++) { bones[i].weight = num * (float)(bones.Length - 1 - i); } } } protected override void OnInitiate() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (firstInitiation || !Application.isPlaying) { IKPosition = bones[bones.Length - 1].transform.position; } InitiateBones(); } protected override void OnUpdate() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight <= 0f) { return; } IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); if ((Object)(object)target != (Object)null) { IKPosition = target.position; } if (XY) { IKPosition.z = bones[0].transform.position.z; } Vector3 val = ((maxIterations > 1) ? GetSingularityOffset() : Vector3.zero); for (int i = 0; i < maxIterations && (!(val == Vector3.zero) || i < 1 || !(tolerance > 0f) || !(base.positionOffset < tolerance * tolerance)); i++) { lastLocalDirection = localDirection; if (OnPreIteration != null) { OnPreIteration(i); } Solve(IKPosition + ((i == 0) ? val : Vector3.zero)); } lastLocalDirection = localDirection; } protected void Solve(Vector3 targetPosition) { //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) if (XY) { for (int num = bones.Length - 2; num > -1; num--) { float num2 = bones[num].weight * IKPositionWeight; if (num2 > 0f) { Vector3 val = bones[bones.Length - 1].transform.position - bones[num].transform.position; Vector3 val2 = targetPosition - bones[num].transform.position; float num3 = Mathf.Atan2(val.x, val.y) * 57.29578f; float num4 = Mathf.Atan2(val2.x, val2.y) * 57.29578f; bones[num].transform.rotation = Quaternion.AngleAxis(Mathf.DeltaAngle(num3, num4) * num2, Vector3.back) * bones[num].transform.rotation; } if (useRotationLimits && (Object)(object)bones[num].rotationLimit != (Object)null) { bones[num].rotationLimit.Apply(); } } return; } for (int num5 = bones.Length - 2; num5 > -1; num5--) { float num6 = bones[num5].weight * IKPositionWeight; if (num6 > 0f) { Vector3 val3 = bones[bones.Length - 1].transform.position - bones[num5].transform.position; Vector3 val4 = targetPosition - bones[num5].transform.position; Quaternion val5 = Quaternion.FromToRotation(val3, val4) * bones[num5].transform.rotation; if (num6 >= 1f) { bones[num5].transform.rotation = val5; } else { bones[num5].transform.rotation = Quaternion.Lerp(bones[num5].transform.rotation, val5, num6); } } if (useRotationLimits && (Object)(object)bones[num5].rotationLimit != (Object)null) { bones[num5].rotationLimit.Apply(); } } } } [Serializable] public class IKSolverFABRIK : IKSolverHeuristic { public IterationDelegate OnPreIteration; private bool[] limitedBones = new bool[0]; private Vector3[] solverLocalPositions = (Vector3[])(object)new Vector3[0]; protected override bool boneLengthCanBeZero => false; public void SolveForward(Vector3 position) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (!base.initiated) { if (!Warning.logged) { LogWarning("Trying to solve uninitiated FABRIK chain."); } } else { OnPreSolve(); ForwardReach(position); } } public void SolveBackward(Vector3 position) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!base.initiated) { if (!Warning.logged) { LogWarning("Trying to solve uninitiated FABRIK chain."); } } else { BackwardReach(position); OnPostSolve(); } } public override Vector3 GetIKPosition() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target != (Object)null) { return target.position; } return IKPosition; } protected override void OnInitiate() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) if (firstInitiation || !Application.isPlaying) { IKPosition = bones[bones.Length - 1].transform.position; } for (int i = 0; i < bones.Length; i++) { bones[i].solverPosition = bones[i].transform.position; bones[i].solverRotation = bones[i].transform.rotation; } limitedBones = new bool[bones.Length]; solverLocalPositions = (Vector3[])(object)new Vector3[bones.Length]; InitiateBones(); for (int j = 0; j < bones.Length; j++) { solverLocalPositions[j] = Quaternion.Inverse(GetParentSolverRotation(j)) * (bones[j].transform.position - GetParentSolverPosition(j)); } } protected override void OnUpdate() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight <= 0f) { return; } IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); OnPreSolve(); if ((Object)(object)target != (Object)null) { IKPosition = target.position; } if (XY) { IKPosition.z = bones[0].transform.position.z; } Vector3 val = ((maxIterations > 1) ? GetSingularityOffset() : Vector3.zero); for (int i = 0; i < maxIterations && (!(val == Vector3.zero) || i < 1 || !(tolerance > 0f) || !(base.positionOffset < tolerance * tolerance)); i++) { lastLocalDirection = localDirection; if (OnPreIteration != null) { OnPreIteration(i); } Solve(IKPosition + ((i == 0) ? val : Vector3.zero)); } OnPostSolve(); } private Vector3 SolveJoint(Vector3 pos1, Vector3 pos2, float length) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (XY) { pos1.z = pos2.z; } Vector3 val = pos1 - pos2; return pos2 + ((Vector3)(ref val)).normalized * length; } private void OnPreSolve() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) chainLength = 0f; for (int i = 0; i < bones.Length; i++) { bones[i].solverPosition = bones[i].transform.position; bones[i].solverRotation = bones[i].transform.rotation; if (i < bones.Length - 1) { Bone obj = bones[i]; Vector3 val = bones[i].transform.position - bones[i + 1].transform.position; obj.length = ((Vector3)(ref val)).magnitude; bones[i].axis = Quaternion.Inverse(bones[i].transform.rotation) * (bones[i + 1].transform.position - bones[i].transform.position); chainLength += bones[i].length; } if (useRotationLimits) { solverLocalPositions[i] = Quaternion.Inverse(GetParentSolverRotation(i)) * (bones[i].transform.position - GetParentSolverPosition(i)); } } } private void OnPostSolve() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!useRotationLimits) { MapToSolverPositions(); } else { MapToSolverPositionsLimited(); } lastLocalDirection = localDirection; } private void Solve(Vector3 targetPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) ForwardReach(targetPosition); BackwardReach(bones[0].transform.position); } private void ForwardReach(Vector3 position) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) bones[bones.Length - 1].solverPosition = Vector3.Lerp(bones[bones.Length - 1].solverPosition, position, IKPositionWeight); for (int i = 0; i < limitedBones.Length; i++) { limitedBones[i] = false; } for (int num = bones.Length - 2; num > -1; num--) { bones[num].solverPosition = SolveJoint(bones[num].solverPosition, bones[num + 1].solverPosition, bones[num].length); LimitForward(num, num + 1); } LimitForward(0, 0); } private void SolverMove(int index, Vector3 offset) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) for (int i = index; i < bones.Length; i++) { Bone obj = bones[i]; obj.solverPosition += offset; } } private void SolverRotate(int index, Quaternion rotation, bool recursive) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) for (int i = index; i < bones.Length; i++) { bones[i].solverRotation = rotation * bones[i].solverRotation; if (!recursive) { break; } } } private void SolverRotateChildren(int index, Quaternion rotation) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) for (int i = index + 1; i < bones.Length; i++) { bones[i].solverRotation = rotation * bones[i].solverRotation; } } private void SolverMoveChildrenAroundPoint(int index, Quaternion rotation) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) for (int i = index + 1; i < bones.Length; i++) { Vector3 val = bones[i].solverPosition - bones[index].solverPosition; bones[i].solverPosition = bones[index].solverPosition + rotation * val; } } private Quaternion GetParentSolverRotation(int index) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (index > 0) { return bones[index - 1].solverRotation; } if ((Object)(object)bones[0].transform.parent == (Object)null) { return Quaternion.identity; } return bones[0].transform.parent.rotation; } private Vector3 GetParentSolverPosition(int index) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (index > 0) { return bones[index - 1].solverPosition; } if ((Object)(object)bones[0].transform.parent == (Object)null) { return Vector3.zero; } return bones[0].transform.parent.position; } private Quaternion GetLimitedRotation(int index, Quaternion q, out bool changed) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) changed = false; Quaternion parentSolverRotation = GetParentSolverRotation(index); Quaternion localRotation = Quaternion.Inverse(parentSolverRotation) * q; Quaternion limitedLocalRotation = bones[index].rotationLimit.GetLimitedLocalRotation(localRotation, out changed); if (!changed) { return q; } return parentSolverRotation * limitedLocalRotation; } private void LimitForward(int rotateBone, int limitBone) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) if (!useRotationLimits || (Object)(object)bones[limitBone].rotationLimit == (Object)null) { return; } Vector3 solverPosition = bones[bones.Length - 1].solverPosition; for (int i = rotateBone; i < bones.Length - 1 && !limitedBones[i]; i++) { Quaternion rotation = Quaternion.FromToRotation(bones[i].solverRotation * bones[i].axis, bones[i + 1].solverPosition - bones[i].solverPosition); SolverRotate(i, rotation, recursive: false); } bool changed = false; Quaternion limitedRotation = GetLimitedRotation(limitBone, bones[limitBone].solverRotation, out changed); if (changed) { if (limitBone < bones.Length - 1) { Quaternion rotation2 = QuaTools.FromToRotation(bones[limitBone].solverRotation, limitedRotation); bones[limitBone].solverRotation = limitedRotation; SolverRotateChildren(limitBone, rotation2); SolverMoveChildrenAroundPoint(limitBone, rotation2); Quaternion rotation3 = Quaternion.FromToRotation(bones[bones.Length - 1].solverPosition - bones[rotateBone].solverPosition, solverPosition - bones[rotateBone].solverPosition); SolverRotate(rotateBone, rotation3, recursive: true); SolverMoveChildrenAroundPoint(rotateBone, rotation3); SolverMove(rotateBone, solverPosition - bones[bones.Length - 1].solverPosition); } else { bones[limitBone].solverRotation = limitedRotation; } } limitedBones[limitBone] = true; } private void BackwardReach(Vector3 position) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (useRotationLimits) { BackwardReachLimited(position); } else { BackwardReachUnlimited(position); } } private void BackwardReachUnlimited(Vector3 position) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) bones[0].solverPosition = position; for (int i = 1; i < bones.Length; i++) { bones[i].solverPosition = SolveJoint(bones[i].solverPosition, bones[i - 1].solverPosition, bones[i - 1].length); } } private void BackwardReachLimited(Vector3 position) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) bones[0].solverPosition = position; for (int i = 0; i < bones.Length - 1; i++) { Vector3 val = SolveJoint(bones[i + 1].solverPosition, bones[i].solverPosition, bones[i].length); Quaternion val2 = Quaternion.FromToRotation(bones[i].solverRotation * bones[i].axis, val - bones[i].solverPosition) * bones[i].solverRotation; if ((Object)(object)bones[i].rotationLimit != (Object)null) { bool changed = false; val2 = GetLimitedRotation(i, val2, out changed); } Quaternion rotation = QuaTools.FromToRotation(bones[i].solverRotation, val2); bones[i].solverRotation = val2; SolverRotateChildren(i, rotation); bones[i + 1].solverPosition = bones[i].solverPosition + bones[i].solverRotation * solverLocalPositions[i + 1]; } for (int j = 0; j < bones.Length; j++) { bones[j].solverRotation = Quaternion.LookRotation(bones[j].solverRotation * Vector3.forward, bones[j].solverRotation * Vector3.up); } } private void MapToSolverPositions() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) bones[0].transform.position = bones[0].solverPosition; for (int i = 0; i < bones.Length - 1; i++) { if (XY) { bones[i].Swing2D(bones[i + 1].solverPosition); } else { bones[i].Swing(bones[i + 1].solverPosition); } } } private void MapToSolverPositionsLimited() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) bones[0].transform.position = bones[0].solverPosition; for (int i = 0; i < bones.Length; i++) { if (i < bones.Length - 1) { bones[i].transform.rotation = bones[i].solverRotation; } } } } [Serializable] public class IKSolverFABRIKRoot : IKSolver { public int iterations = 4; [Range(0f, 1f)] public float rootPin; public FABRIKChain[] chains = new FABRIKChain[0]; private bool zeroWeightApplied; private bool[] isRoot; private Vector3 rootDefaultPosition; public override bool IsValid(ref string message) { if (chains.Length == 0) { message = "IKSolverFABRIKRoot contains no chains."; return false; } FABRIKChain[] array = chains; for (int i = 0; i < array.Length; i++) { if (!array[i].IsValid(ref message)) { return false; } } for (int j = 0; j < chains.Length; j++) { for (int k = 0; k < chains.Length; k++) { if (j != k && (Object)(object)chains[j].ik == (Object)(object)chains[k].ik) { message = ((Object)chains[j].ik).name + " is represented more than once in IKSolverFABRIKRoot chain."; return false; } } } for (int l = 0; l < chains.Length; l++) { for (int m = 0; m < chains[l].children.Length; m++) { int num = chains[l].children[m]; if (num < 0) { message = ((Object)chains[l].ik).name + "IKSolverFABRIKRoot chain at index " + l + " has invalid children array. Child index is < 0."; return false; } if (num == l) { message = ((Object)chains[l].ik).name + "IKSolverFABRIKRoot chain at index " + l + " has invalid children array. Child index is referencing to itself."; return false; } if (num >= chains.Length) { message = ((Object)chains[l].ik).name + "IKSolverFABRIKRoot chain at index " + l + " has invalid children array. Child index > number of chains"; return false; } for (int n = 0; n < chains.Length; n++) { if (num != n) { continue; } for (int num2 = 0; num2 < chains[n].children.Length; num2++) { if (chains[n].children[num2] == l) { message = "Circular parenting. " + ((Object)chains[n].ik).name + " already has " + ((Object)chains[l].ik).name + " listed as it's child."; return false; } } } for (int num3 = 0; num3 < chains[l].children.Length; num3++) { if (m != num3 && chains[l].children[num3] == num) { message = "Chain number " + num + " is represented more than once in the children of " + ((Object)chains[l].ik).name; return false; } } } } return true; } public override void StoreDefaultLocalState() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) rootDefaultPosition = root.localPosition; for (int i = 0; i < chains.Length; i++) { chains[i].ik.solver.StoreDefaultLocalState(); } } public override void FixTransforms() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (base.initiated) { root.localPosition = rootDefaultPosition; for (int i = 0; i < chains.Length; i++) { chains[i].ik.solver.FixTransforms(); } } } protected override void OnInitiate() { for (int i = 0; i < chains.Length; i++) { chains[i].Initiate(); } isRoot = new bool[chains.Length]; for (int j = 0; j < chains.Length; j++) { isRoot[j] = IsRoot(j); } } private bool IsRoot(int index) { for (int i = 0; i < chains.Length; i++) { for (int j = 0; j < chains[i].children.Length; j++) { if (chains[i].children[j] == index) { return false; } } } return true; } protected override void OnUpdate() { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight <= 0f && zeroWeightApplied) { return; } IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); for (int i = 0; i < chains.Length; i++) { chains[i].ik.solver.IKPositionWeight = IKPositionWeight; } if (IKPositionWeight <= 0f) { zeroWeightApplied = true; return; } zeroWeightApplied = false; for (int j = 0; j < iterations; j++) { for (int k = 0; k < chains.Length; k++) { if (isRoot[k]) { chains[k].Stage1(chains); } } Vector3 centroid = GetCentroid(); root.position = centroid; for (int l = 0; l < chains.Length; l++) { if (isRoot[l]) { chains[l].Stage2(centroid, chains); } } } } public override Point[] GetPoints() { Point[] array = new Point[0]; for (int i = 0; i < chains.Length; i++) { AddPointsToArray(ref array, chains[i]); } return array; } public override Point GetPoint(Transform transform) { Point point = null; for (int i = 0; i < chains.Length; i++) { point = chains[i].ik.solver.GetPoint(transform); if (point != null) { return point; } } return null; } private void AddPointsToArray(ref Point[] array, FABRIKChain chain) { Point[] points = chain.ik.solver.GetPoints(); Array.Resize(ref array, array.Length + points.Length); int num = 0; for (int i = array.Length - points.Length; i < array.Length; i++) { array[i] = points[num]; num++; } } private Vector3 GetCentroid() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) Vector3 val = root.position; if (rootPin >= 1f) { return val; } float num = 0f; for (int i = 0; i < chains.Length; i++) { if (isRoot[i]) { num += chains[i].pull; } } for (int j = 0; j < chains.Length; j++) { if (isRoot[j] && num > 0f) { val += (chains[j].ik.solver.bones[0].solverPosition - root.position) * (chains[j].pull / Mathf.Clamp(num, 1f, num)); } } return Vector3.Lerp(val, root.position, rootPin); } } [Serializable] public class IKSolverFullBody : IKSolver { [Range(0f, 10f)] public int iterations = 4; public FBIKChain[] chain = new FBIKChain[0]; public IKEffector[] effectors = new IKEffector[0]; public IKMappingSpine spineMapping = new IKMappingSpine(); public IKMappingBone[] boneMappings = new IKMappingBone[0]; public IKMappingLimb[] limbMappings = new IKMappingLimb[0]; public bool FABRIKPass = true; public UpdateDelegate OnPreRead; public UpdateDelegate OnPreSolve; public IterationDelegate OnPreIteration; public IterationDelegate OnPostIteration; public UpdateDelegate OnPreBend; public UpdateDelegate OnPostSolve; public UpdateDelegate OnStoreDefaultLocalState; public UpdateDelegate OnFixTransforms; public IKEffector GetEffector(Transform t) { for (int i = 0; i < effectors.Length; i++) { if ((Object)(object)effectors[i].bone == (Object)(object)t) { return effectors[i]; } } return null; } public FBIKChain GetChain(Transform transform) { int chainIndex = GetChainIndex(transform); if (chainIndex == -1) { return null; } return chain[chainIndex]; } public int GetChainIndex(Transform transform) { for (int i = 0; i < chain.Length; i++) { for (int j = 0; j < chain[i].nodes.Length; j++) { if ((Object)(object)chain[i].nodes[j].transform == (Object)(object)transform) { return i; } } } return -1; } public Node GetNode(int chainIndex, int nodeIndex) { return chain[chainIndex].nodes[nodeIndex]; } public void GetChainAndNodeIndexes(Transform transform, out int chainIndex, out int nodeIndex) { chainIndex = GetChainIndex(transform); if (chainIndex == -1) { nodeIndex = -1; } else { nodeIndex = chain[chainIndex].GetNodeIndex(transform); } } public override Point[] GetPoints() { int num = 0; for (int i = 0; i < chain.Length; i++) { num += chain[i].nodes.Length; } Point[] array = new Point[num]; int num2 = 0; for (int j = 0; j < chain.Length; j++) { for (int k = 0; k < chain[j].nodes.Length; k++) { array[num2] = chain[j].nodes[k]; num2++; } } return array; } public override Point GetPoint(Transform transform) { for (int i = 0; i < chain.Length; i++) { for (int j = 0; j < chain[i].nodes.Length; j++) { if ((Object)(object)chain[i].nodes[j].transform == (Object)(object)transform) { return chain[i].nodes[j]; } } } return null; } public override bool IsValid(ref string message) { if (chain == null) { message = "FBIK chain is null, can't initiate solver."; return false; } if (chain.Length == 0) { message = "FBIK chain length is 0, can't initiate solver."; return false; } for (int i = 0; i < chain.Length; i++) { if (!chain[i].IsValid(ref message)) { return false; } } IKEffector[] array = effectors; for (int j = 0; j < array.Length; j++) { if (!array[j].IsValid(this, ref message)) { return false; } } if (!spineMapping.IsValid(this, ref message)) { return false; } IKMappingLimb[] array2 = limbMappings; for (int j = 0; j < array2.Length; j++) { if (!array2[j].IsValid(this, ref message)) { return false; } } IKMappingBone[] array3 = boneMappings; for (int j = 0; j < array3.Length; j++) { if (!array3[j].IsValid(this, ref message)) { return false; } } return true; } public override void StoreDefaultLocalState() { spineMapping.StoreDefaultLocalState(); for (int i = 0; i < limbMappings.Length; i++) { limbMappings[i].StoreDefaultLocalState(); } for (int j = 0; j < boneMappings.Length; j++) { boneMappings[j].StoreDefaultLocalState(); } if (OnStoreDefaultLocalState != null) { OnStoreDefaultLocalState(); } } public override void FixTransforms() { if (base.initiated && !(IKPositionWeight <= 0f)) { spineMapping.FixTransforms(); for (int i = 0; i < limbMappings.Length; i++) { limbMappings[i].FixTransforms(); } for (int j = 0; j < boneMappings.Length; j++) { boneMappings[j].FixTransforms(); } if (OnFixTransforms != null) { OnFixTransforms(); } } } protected override void OnInitiate() { for (int i = 0; i < chain.Length; i++) { chain[i].Initiate(this); } IKEffector[] array = effectors; for (int j = 0; j < array.Length; j++) { array[j].Initiate(this); } spineMapping.Initiate(this); IKMappingBone[] array2 = boneMappings; for (int j = 0; j < array2.Length; j++) { array2[j].Initiate(this); } IKMappingLimb[] array3 = limbMappings; for (int j = 0; j < array3.Length; j++) { array3[j].Initiate(this); } } protected override void OnUpdate() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight <= 0f) { for (int i = 0; i < effectors.Length; i++) { effectors[i].positionOffset = Vector3.zero; } } else if (chain.Length != 0) { IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); if (OnPreRead != null) { OnPreRead(); } ReadPose(); if (OnPreSolve != null) { OnPreSolve(); } Solve(); if (OnPostSolve != null) { OnPostSolve(); } WritePose(); for (int j = 0; j < effectors.Length; j++) { effectors[j].OnPostWrite(); } } } protected virtual void ReadPose() { for (int i = 0; i < chain.Length; i++) { if (chain[i].bendConstraint.initiated) { chain[i].bendConstraint.LimitBend(IKPositionWeight, GetEffector(chain[i].nodes[2].transform).positionWeight); } } for (int j = 0; j < effectors.Length; j++) { effectors[j].ResetOffset(this); } for (int k = 0; k < effectors.Length; k++) { effectors[k].OnPreSolve(this); } for (int l = 0; l < chain.Length; l++) { chain[l].ReadPose(this, iterations > 0); } if (iterations > 0) { spineMapping.ReadPose(); for (int m = 0; m < boneMappings.Length; m++) { boneMappings[m].ReadPose(); } } for (int n = 0; n < limbMappings.Length; n++) { limbMappings[n].ReadPose(); } } protected virtual void Solve() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) if (iterations > 0) { for (int i = 0; i < ((!FABRIKPass) ? 1 : iterations); i++) { if (OnPreIteration != null) { OnPreIteration(i); } for (int j = 0; j < effectors.Length; j++) { if (effectors[j].isEndEffector) { effectors[j].Update(this); } } if (FABRIKPass) { chain[0].Push(this); if (FABRIKPass) { chain[0].Reach(this); } for (int k = 0; k < effectors.Length; k++) { if (!effectors[k].isEndEffector) { effectors[k].Update(this); } } } chain[0].SolveTrigonometric(this); if (FABRIKPass) { chain[0].Stage1(this); for (int l = 0; l < effectors.Length; l++) { if (!effectors[l].isEndEffector) { effectors[l].Update(this); } } chain[0].Stage2(this, chain[0].nodes[0].solverPosition); } if (OnPostIteration != null) { OnPostIteration(i); } } } if (OnPreBend != null) { OnPreBend(); } for (int m = 0; m < effectors.Length; m++) { if (effectors[m].isEndEffector) { effectors[m].Update(this); } } ApplyBendConstraints(); } protected virtual void ApplyBendConstraints() { chain[0].SolveTrigonometric(this, calculateBendDirection: true); } protected virtual void WritePose() { if (IKPositionWeight <= 0f) { return; } if (iterations > 0) { spineMapping.WritePose(this); for (int i = 0; i < boneMappings.Length; i++) { boneMappings[i].WritePose(IKPositionWeight); } } for (int j = 0; j < limbMappings.Length; j++) { limbMappings[j].WritePose(this, iterations > 0); } } } [Serializable] public enum FullBodyBipedEffector { Body, LeftShoulder, RightShoulder, LeftThigh, RightThigh, LeftHand, RightHand, LeftFoot, RightFoot } [Serializable] public enum FullBodyBipedChain { LeftArm, RightArm, LeftLeg, RightLeg } [Serializable] public class IKSolverFullBodyBiped : IKSolverFullBody { public Transform rootNode; [Range(0f, 1f)] public float spineStiffness = 0.5f; [Range(-1f, 1f)] public float pullBodyVertical = 0.5f; [Range(-1f, 1f)] public float pullBodyHorizontal; private Vector3 offset; public IKEffector bodyEffector => GetEffector(FullBodyBipedEffector.Body); public IKEffector leftShoulderEffector => GetEffector(FullBodyBipedEffector.LeftShoulder); public IKEffector rightShoulderEffector => GetEffector(FullBodyBipedEffector.RightShoulder); public IKEffector leftThighEffector => GetEffector(FullBodyBipedEffector.LeftThigh); public IKEffector rightThighEffector => GetEffector(FullBodyBipedEffector.RightThigh); public IKEffector leftHandEffector => GetEffector(FullBodyBipedEffector.LeftHand); public IKEffector rightHandEffector => GetEffector(FullBodyBipedEffector.RightHand); public IKEffector leftFootEffector => GetEffector(FullBodyBipedEffector.LeftFoot); public IKEffector rightFootEffector => GetEffector(FullBodyBipedEffector.RightFoot); public FBIKChain leftArmChain => chain[1]; public FBIKChain rightArmChain => chain[2]; public FBIKChain leftLegChain => chain[3]; public FBIKChain rightLegChain => chain[4]; public IKMappingLimb leftArmMapping => limbMappings[0]; public IKMappingLimb rightArmMapping => limbMappings[1]; public IKMappingLimb leftLegMapping => limbMappings[2]; public IKMappingLimb rightLegMapping => limbMappings[3]; public IKMappingBone headMapping => boneMappings[0]; public Vector3 pullBodyOffset { get; private set; } public void SetChainWeights(FullBodyBipedChain c, float pull, float reach = 0f) { GetChain(c).pull = pull; GetChain(c).reach = reach; } public void SetEffectorWeights(FullBodyBipedEffector effector, float positionWeight, float rotationWeight) { GetEffector(effector).positionWeight = Mathf.Clamp(positionWeight, 0f, 1f); GetEffector(effector).rotationWeight = Mathf.Clamp(rotationWeight, 0f, 1f); } public FBIKChain GetChain(FullBodyBipedChain c) { return c switch { FullBodyBipedChain.LeftArm => chain[1], FullBodyBipedChain.RightArm => chain[2], FullBodyBipedChain.LeftLeg => chain[3], FullBodyBipedChain.RightLeg => chain[4], _ => null, }; } public FBIKChain GetChain(FullBodyBipedEffector effector) { return effector switch { FullBodyBipedEffector.Body => chain[0], FullBodyBipedEffector.LeftShoulder => chain[1], FullBodyBipedEffector.RightShoulder => chain[2], FullBodyBipedEffector.LeftThigh => chain[3], FullBodyBipedEffector.RightThigh => chain[4], FullBodyBipedEffector.LeftHand => chain[1], FullBodyBipedEffector.RightHand => chain[2], FullBodyBipedEffector.LeftFoot => chain[3], FullBodyBipedEffector.RightFoot => chain[4], _ => null, }; } public IKEffector GetEffector(FullBodyBipedEffector effector) { return effector switch { FullBodyBipedEffector.Body => effectors[0], FullBodyBipedEffector.LeftShoulder => effectors[1], FullBodyBipedEffector.RightShoulder => effectors[2], FullBodyBipedEffector.LeftThigh => effectors[3], FullBodyBipedEffector.RightThigh => effectors[4], FullBodyBipedEffector.LeftHand => effectors[5], FullBodyBipedEffector.RightHand => effectors[6], FullBodyBipedEffector.LeftFoot => effectors[7], FullBodyBipedEffector.RightFoot => effectors[8], _ => null, }; } public IKEffector GetEndEffector(FullBodyBipedChain c) { return c switch { FullBodyBipedChain.LeftArm => effectors[5], FullBodyBipedChain.RightArm => effectors[6], FullBodyBipedChain.LeftLeg => effectors[7], FullBodyBipedChain.RightLeg => effectors[8], _ => null, }; } public IKMappingLimb GetLimbMapping(FullBodyBipedChain chain) { return chain switch { FullBodyBipedChain.LeftArm => limbMappings[0], FullBodyBipedChain.RightArm => limbMappings[1], FullBodyBipedChain.LeftLeg => limbMappings[2], FullBodyBipedChain.RightLeg => limbMappings[3], _ => null, }; } public IKMappingLimb GetLimbMapping(FullBodyBipedEffector effector) { return effector switch { FullBodyBipedEffector.LeftShoulder => limbMappings[0], FullBodyBipedEffector.RightShoulder => limbMappings[1], FullBodyBipedEffector.LeftThigh => limbMappings[2], FullBodyBipedEffector.RightThigh => limbMappings[3], FullBodyBipedEffector.LeftHand => limbMappings[0], FullBodyBipedEffector.RightHand => limbMappings[1], FullBodyBipedEffector.LeftFoot => limbMappings[2], FullBodyBipedEffector.RightFoot => limbMappings[3], _ => null, }; } public IKMappingSpine GetSpineMapping() { return spineMapping; } public IKMappingBone GetHeadMapping() { return boneMappings[0]; } public IKConstraintBend GetBendConstraint(FullBodyBipedChain limb) { return limb switch { FullBodyBipedChain.LeftArm => chain[1].bendConstraint, FullBodyBipedChain.RightArm => chain[2].bendConstraint, FullBodyBipedChain.LeftLeg => chain[3].bendConstraint, FullBodyBipedChain.RightLeg => chain[4].bendConstraint, _ => null, }; } public override bool IsValid(ref string message) { if (!base.IsValid(ref message)) { return false; } if ((Object)(object)rootNode == (Object)null) { message = "Root Node bone is null. FBBIK will not initiate."; return false; } if (chain.Length != 5 || chain[0].nodes.Length != 1 || chain[1].nodes.Length != 3 || chain[2].nodes.Length != 3 || chain[3].nodes.Length != 3 || chain[4].nodes.Length != 3 || effectors.Length != 9 || limbMappings.Length != 4) { message = "Invalid FBBIK setup. Please right-click on the component header and select 'Reinitiate'."; return false; } return true; } public void SetToReferences(BipedReferences references, Transform rootNode = null) { root = references.root; if ((Object)(object)rootNode == (Object)null) { rootNode = DetectRootNodeBone(references); } this.rootNode = rootNode; if (chain == null || chain.Length != 5) { chain = new FBIKChain[5]; } for (int i = 0; i < chain.Length; i++) { if (chain[i] == null) { chain[i] = new FBIKChain(); } } chain[0].pin = 0f; chain[0].SetNodes(rootNode); chain[0].children = new int[4] { 1, 2, 3, 4 }; chain[1].SetNodes(references.leftUpperArm, references.leftForearm, references.leftHand); chain[2].SetNodes(references.rightUpperArm, references.rightForearm, references.rightHand); chain[3].SetNodes(references.leftThigh, references.leftCalf, references.leftFoot); chain[4].SetNodes(references.rightThigh, references.rightCalf, references.rightFoot); if (effectors.Length != 9) { effectors = new IKEffector[9] { new IKEffector(), new IKEffector(), new IKEffector(), new IKEffector(), new IKEffector(), new IKEffector(), new IKEffector(), new IKEffector(), new IKEffector() }; } effectors[0].bone = rootNode; effectors[0].childBones = (Transform[])(object)new Transform[2] { references.leftThigh, references.rightThigh }; effectors[1].bone = references.leftUpperArm; effectors[2].bone = references.rightUpperArm; effectors[3].bone = references.leftThigh; effectors[4].bone = references.rightThigh; effectors[5].bone = references.leftHand; effectors[6].bone = references.rightHand; effectors[7].bone = references.leftFoot; effectors[8].bone = references.rightFoot; effectors[5].planeBone1 = references.leftUpperArm; effectors[5].planeBone2 = references.rightUpperArm; effectors[5].planeBone3 = rootNode; effectors[6].planeBone1 = references.rightUpperArm; effectors[6].planeBone2 = references.leftUpperArm; effectors[6].planeBone3 = rootNode; effectors[7].planeBone1 = references.leftThigh; effectors[7].planeBone2 = references.rightThigh; effectors[7].planeBone3 = rootNode; effectors[8].planeBone1 = references.rightThigh; effectors[8].planeBone2 = references.leftThigh; effectors[8].planeBone3 = rootNode; chain[0].childConstraints = new FBIKChain.ChildConstraint[4] { new FBIKChain.ChildConstraint(references.leftUpperArm, references.rightThigh, 0f, 1f), new FBIKChain.ChildConstraint(references.rightUpperArm, references.leftThigh, 0f, 1f), new FBIKChain.ChildConstraint(references.leftUpperArm, references.rightUpperArm), new FBIKChain.ChildConstraint(references.leftThigh, references.rightThigh) }; Transform[] array = (Transform[])(object)new Transform[references.spine.Length + 1]; array[0] = references.pelvis; for (int j = 0; j < references.spine.Length; j++) { array[j + 1] = references.spine[j]; } if (spineMapping == null) { spineMapping = new IKMappingSpine(); spineMapping.iterations = 3; } spineMapping.SetBones(array, references.leftUpperArm, references.rightUpperArm, references.leftThigh, references.rightThigh); int num = (((Object)(object)references.head != (Object)null) ? 1 : 0); if (boneMappings.Length != num) { boneMappings = new IKMappingBone[num]; for (int k = 0; k < boneMappings.Length; k++) { boneMappings[k] = new IKMappingBone(); } if (num == 1) { boneMappings[0].maintainRotationWeight = 0f; } } if (boneMappings.Length != 0) { boneMappings[0].bone = references.head; } if (limbMappings.Length != 4) { limbMappings = new IKMappingLimb[4] { new IKMappingLimb(), new IKMappingLimb(), new IKMappingLimb(), new IKMappingLimb() }; limbMappings[2].maintainRotationWeight = 1f; limbMappings[3].maintainRotationWeight = 1f; } limbMappings[0].SetBones(references.leftUpperArm, references.leftForearm, references.leftHand, GetLeftClavicle(references)); limbMappings[1].SetBones(references.rightUpperArm, references.rightForearm, references.rightHand, GetRightClavicle(references)); limbMappings[2].SetBones(references.leftThigh, references.leftCalf, references.leftFoot); limbMappings[3].SetBones(references.rightThigh, references.rightCalf, references.rightFoot); if (Application.isPlaying) { Initiate(references.root); } } public static Transform DetectRootNodeBone(BipedReferences references) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) if (!references.isFilled) { return null; } if (references.spine.Length < 1) { return null; } int num = references.spine.Length; if (num == 1) { return references.spine[0]; } Vector3 val = Vector3.Lerp(references.leftThigh.position, references.rightThigh.position, 0.5f); Vector3 val2 = Vector3.Lerp(references.leftUpperArm.position, references.rightUpperArm.position, 0.5f) - val; float magnitude = ((Vector3)(ref val2)).magnitude; if (references.spine.Length < 2) { return references.spine[0]; } int num2 = 0; for (int i = 1; i < num; i++) { Vector3 val3 = Vector3.Project(references.spine[i].position - val, val2); if (Vector3.Dot(((Vector3)(ref val3)).normalized, ((Vector3)(ref val2)).normalized) > 0f && ((Vector3)(ref val3)).magnitude / magnitude < 0.5f) { num2 = i; } } return references.spine[num2]; } public void SetLimbOrientations(BipedLimbOrientations o) { SetLimbOrientation(FullBodyBipedChain.LeftArm, o.leftArm); SetLimbOrientation(FullBodyBipedChain.RightArm, o.rightArm); SetLimbOrientation(FullBodyBipedChain.LeftLeg, o.leftLeg); SetLimbOrientation(FullBodyBipedChain.RightLeg, o.rightLeg); } private void SetLimbOrientation(FullBodyBipedChain chain, BipedLimbOrientations.LimbOrientation limbOrientation) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (chain == FullBodyBipedChain.LeftArm || chain == FullBodyBipedChain.RightArm) { GetBendConstraint(chain).SetLimbOrientation(-limbOrientation.upperBoneForwardAxis, -limbOrientation.lowerBoneForwardAxis, -limbOrientation.lastBoneLeftAxis); GetLimbMapping(chain).SetLimbOrientation(-limbOrientation.upperBoneForwardAxis, -limbOrientation.lowerBoneForwardAxis); } else { GetBendConstraint(chain).SetLimbOrientation(limbOrientation.upperBoneForwardAxis, limbOrientation.lowerBoneForwardAxis, limbOrientation.lastBoneLeftAxis); GetLimbMapping(chain).SetLimbOrientation(limbOrientation.upperBoneForwardAxis, limbOrientation.lowerBoneForwardAxis); } } private static Transform GetLeftClavicle(BipedReferences references) { if ((Object)(object)references.leftUpperArm == (Object)null) { return null; } if (!Contains(references.spine, references.leftUpperArm.parent)) { return references.leftUpperArm.parent; } return null; } private static Transform GetRightClavicle(BipedReferences references) { if ((Object)(object)references.rightUpperArm == (Object)null) { return null; } if (!Contains(references.spine, references.rightUpperArm.parent)) { return references.rightUpperArm.parent; } return null; } private static bool Contains(Transform[] array, Transform transform) { for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] == (Object)(object)transform) { return true; } } return false; } protected override void ReadPose() { for (int i = 0; i < effectors.Length; i++) { effectors[i].SetToTarget(); } PullBody(); float pushElasticity = Mathf.Clamp(1f - spineStiffness, 0f, 1f); chain[0].childConstraints[0].pushElasticity = pushElasticity; chain[0].childConstraints[1].pushElasticity = pushElasticity; base.ReadPose(); } private void PullBody() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) if (iterations >= 1 && (pullBodyVertical != 0f || pullBodyHorizontal != 0f)) { Vector3 bodyOffset = GetBodyOffset(); pullBodyOffset = V3Tools.ExtractVertical(bodyOffset, root.up, pullBodyVertical) + V3Tools.ExtractHorizontal(bodyOffset, root.up, pullBodyHorizontal); IKEffector iKEffector = bodyEffector; iKEffector.positionOffset += pullBodyOffset; } } private Vector3 GetBodyOffset() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero + GetHandBodyPull(leftHandEffector, leftArmChain, Vector3.zero) * Mathf.Clamp(leftHandEffector.positionWeight, 0f, 1f); return val + GetHandBodyPull(rightHandEffector, rightArmChain, val) * Mathf.Clamp(rightHandEffector.positionWeight, 0f, 1f); } private Vector3 GetHandBodyPull(IKEffector effector, FBIKChain arm, Vector3 offset) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = effector.position - (arm.nodes[0].transform.position + offset); float num = arm.nodes[0].length + arm.nodes[1].length; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < num) { return Vector3.zero; } float num2 = magnitude - num; return val / magnitude * num2; } protected override void ApplyBendConstraints() { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) if (iterations > 0) { chain[1].bendConstraint.rotationOffset = leftHandEffector.planeRotationOffset; chain[2].bendConstraint.rotationOffset = rightHandEffector.planeRotationOffset; chain[3].bendConstraint.rotationOffset = leftFootEffector.planeRotationOffset; chain[4].bendConstraint.rotationOffset = rightFootEffector.planeRotationOffset; } else { offset = Vector3.Lerp(effectors[0].positionOffset, effectors[0].position - (effectors[0].bone.position + effectors[0].positionOffset), effectors[0].positionWeight); for (int i = 0; i < 5; i++) { Node node = effectors[i].GetNode(this); node.solverPosition += offset; } } base.ApplyBendConstraints(); } protected override void WritePose() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (iterations == 0) { Transform obj = spineMapping.spineBones[0]; obj.position += offset; } base.WritePose(); } } [Serializable] public class IKSolverHeuristic : IKSolver { public Transform target; public float tolerance; public int maxIterations = 4; public bool useRotationLimits = true; public bool XY; public Bone[] bones = new Bone[0]; protected Vector3 lastLocalDirection; protected float chainLength; protected virtual int minBones => 2; protected virtual bool boneLengthCanBeZero => true; protected virtual bool allowCommonParent => false; protected virtual Vector3 localDirection => bones[0].transform.InverseTransformDirection(bones[bones.Length - 1].transform.position - bones[0].transform.position); protected float positionOffset => Vector3.SqrMagnitude(localDirection - lastLocalDirection); public bool SetChain(Transform[] hierarchy, Transform root) { if (bones == null || bones.Length != hierarchy.Length) { bones = new Bone[hierarchy.Length]; } for (int i = 0; i < hierarchy.Length; i++) { if (bones[i] == null) { bones[i] = new Bone(); } bones[i].transform = hierarchy[i]; } Initiate(root); return base.initiated; } public void AddBone(Transform bone) { Transform[] array = (Transform[])(object)new Transform[bones.Length + 1]; for (int i = 0; i < bones.Length; i++) { array[i] = bones[i].transform; } array[^1] = bone; SetChain(array, root); } public override void StoreDefaultLocalState() { for (int i = 0; i < bones.Length; i++) { bones[i].StoreDefaultLocalState(); } } public override void FixTransforms() { if (base.initiated && !(IKPositionWeight <= 0f)) { for (int i = 0; i < bones.Length; i++) { bones[i].FixTransform(); } } } public override bool IsValid(ref string message) { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) if (bones.Length == 0) { message = "IK chain has no Bones."; return false; } if (bones.Length < minBones) { message = "IK chain has less than " + minBones + " Bones."; return false; } Bone[] array = bones; for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i].transform == (Object)null) { message = "One of the Bones is null."; return false; } } Transform val = IKSolver.ContainsDuplicateBone(bones); if ((Object)(object)val != (Object)null) { message = ((Object)val).name + " is represented multiple times in the Bones."; return false; } if (!allowCommonParent && !IKSolver.HierarchyIsValid(bones)) { message = "Invalid bone hierarchy detected. IK requires for it's bones to be parented to each other in descending order."; return false; } if (!boneLengthCanBeZero) { for (int j = 0; j < bones.Length - 1; j++) { Vector3 val2 = bones[j].transform.position - bones[j + 1].transform.position; if (((Vector3)(ref val2)).magnitude == 0f) { message = "Bone " + j + " length is zero."; return false; } } } return true; } public override Point[] GetPoints() { return bones; } public override Point GetPoint(Transform transform) { for (int i = 0; i < bones.Length; i++) { if ((Object)(object)bones[i].transform == (Object)(object)transform) { return bones[i]; } } return null; } protected override void OnInitiate() { } protected override void OnUpdate() { } protected void InitiateBones() { //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) chainLength = 0f; for (int i = 0; i < bones.Length; i++) { if (i < bones.Length - 1) { Bone obj = bones[i]; Vector3 val = bones[i].transform.position - bones[i + 1].transform.position; obj.length = ((Vector3)(ref val)).magnitude; chainLength += bones[i].length; Vector3 position = bones[i + 1].transform.position; bones[i].axis = Quaternion.Inverse(bones[i].transform.rotation) * (position - bones[i].transform.position); if ((Object)(object)bones[i].rotationLimit != (Object)null) { if (XY && !(bones[i].rotationLimit is RotationLimitHinge)) { Warning.Log("Only Hinge Rotation Limits should be used on 2D IK solvers.", bones[i].transform); } bones[i].rotationLimit.Disable(); } } else { bones[i].axis = Quaternion.Inverse(bones[i].transform.rotation) * (bones[bones.Length - 1].transform.position - bones[0].transform.position); } } } protected Vector3 GetSingularityOffset() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) if (!SingularityDetected()) { return Vector3.zero; } Vector3 val = IKPosition - bones[0].transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(normalized.y, normalized.z, normalized.x); if (useRotationLimits && (Object)(object)bones[bones.Length - 2].rotationLimit != (Object)null && bones[bones.Length - 2].rotationLimit is RotationLimitHinge) { val2 = bones[bones.Length - 2].transform.rotation * bones[bones.Length - 2].rotationLimit.axis; } return Vector3.Cross(normalized, val2) * bones[bones.Length - 2].length * 0.5f; } private bool SingularityDetected() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) if (!base.initiated) { return false; } Vector3 val = bones[bones.Length - 1].transform.position - bones[0].transform.position; Vector3 val2 = IKPosition - bones[0].transform.position; float magnitude = ((Vector3)(ref val)).magnitude; float magnitude2 = ((Vector3)(ref val2)).magnitude; if (magnitude < magnitude2) { return false; } if (magnitude < chainLength - bones[bones.Length - 2].length * 0.1f) { return false; } if (magnitude == 0f) { return false; } if (magnitude2 == 0f) { return false; } if (magnitude2 > magnitude) { return false; } if (Vector3.Dot(val / magnitude, val2 / magnitude2) < 0.999f) { return false; } return true; } } [Serializable] public class IKSolverLeg : IKSolver { [Range(0f, 1f)] public float IKRotationWeight = 1f; public Quaternion IKRotation = Quaternion.identity; public Point pelvis = new Point(); public Point thigh = new Point(); public Point calf = new Point(); public Point foot = new Point(); public Point toe = new Point(); public IKSolverVR.Leg leg = new IKSolverVR.Leg(); public Vector3 heelOffset; private Vector3[] positions = (Vector3[])(object)new Vector3[6]; private Quaternion[] rotations = (Quaternion[])(object)new Quaternion[6]; public override bool IsValid(ref string message) { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown if ((Object)(object)pelvis.transform == (Object)null || (Object)(object)thigh.transform == (Object)null || (Object)(object)calf.transform == (Object)null || (Object)(object)foot.transform == (Object)null || (Object)(object)toe.transform == (Object)null) { message = "Please assign all bone slots of the Leg IK solver."; return false; } Object[] objects = (Object[])(object)new Transform[5] { pelvis.transform, thigh.transform, calf.transform, foot.transform, toe.transform }; Transform val = (Transform)Hierarchy.ContainsDuplicate(objects); if ((Object)(object)val != (Object)null) { message = ((Object)val).name + " is represented multiple times in the LegIK."; return false; } return true; } public bool SetChain(Transform pelvis, Transform thigh, Transform calf, Transform foot, Transform toe, Transform root) { this.pelvis.transform = pelvis; this.thigh.transform = thigh; this.calf.transform = calf; this.foot.transform = foot; this.toe.transform = toe; Initiate(root); return base.initiated; } public override Point[] GetPoints() { return new Point[5] { pelvis, thigh, calf, foot, toe }; } public override Point GetPoint(Transform transform) { if ((Object)(object)pelvis.transform == (Object)(object)transform) { return pelvis; } if ((Object)(object)thigh.transform == (Object)(object)transform) { return thigh; } if ((Object)(object)calf.transform == (Object)(object)transform) { return calf; } if ((Object)(object)foot.transform == (Object)(object)transform) { return foot; } if ((Object)(object)toe.transform == (Object)(object)transform) { return toe; } return null; } public override void StoreDefaultLocalState() { thigh.StoreDefaultLocalState(); calf.StoreDefaultLocalState(); foot.StoreDefaultLocalState(); toe.StoreDefaultLocalState(); } public override void FixTransforms() { if (base.initiated) { thigh.FixTransform(); calf.FixTransform(); foot.FixTransform(); toe.FixTransform(); } } protected override void OnInitiate() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) IKPosition = toe.transform.position; IKRotation = toe.transform.rotation; Read(); } protected override void OnUpdate() { Read(); Solve(); Write(); } private void Solve() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) IKSolverVR.Leg obj = leg; obj.heelPositionOffset += heelOffset; leg.PreSolve(); leg.ApplyOffsets(1f); leg.Solve(stretch: true); leg.ResetOffsets(); } private void Read() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) leg.IKPosition = IKPosition; leg.positionWeight = IKPositionWeight; leg.IKRotation = IKRotation; leg.rotationWeight = IKRotationWeight; positions[0] = root.position; positions[1] = pelvis.transform.position; positions[2] = thigh.transform.position; positions[3] = calf.transform.position; positions[4] = foot.transform.position; positions[5] = toe.transform.position; rotations[0] = root.rotation; rotations[1] = pelvis.transform.rotation; rotations[2] = thigh.transform.rotation; rotations[3] = calf.transform.rotation; rotations[4] = foot.transform.rotation; rotations[5] = toe.transform.rotation; leg.Read(positions, rotations, hasChest: false, hasNeck: false, hasShoulders: false, hasToes: true, hasLegs: true, 1, 2); } private void Write() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) leg.Write(ref positions, ref rotations); thigh.transform.rotation = rotations[2]; calf.transform.rotation = rotations[3]; foot.transform.rotation = rotations[4]; toe.transform.rotation = rotations[5]; calf.transform.position = positions[3]; foot.transform.position = positions[4]; } } [Serializable] public class IKSolverLimb : IKSolverTrigonometric { [Serializable] public enum BendModifier { Animation, Target, Parent, Arm, Goal } [Serializable] public struct AxisDirection { public Vector3 direction; public Vector3 axis; public float dot; public AxisDirection(Vector3 direction, Vector3 axis) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) this.direction = ((Vector3)(ref direction)).normalized; this.axis = ((Vector3)(ref axis)).normalized; dot = 0f; } } public AvatarIKGoal goal; public BendModifier bendModifier; [Range(0f, 1f)] public float maintainRotationWeight; [Range(0f, 1f)] public float bendModifierWeight = 1f; public Transform bendGoal; private bool maintainBendFor1Frame; private bool maintainRotationFor1Frame; private Quaternion defaultRootRotation; private Quaternion parentDefaultRotation; private Quaternion bone3RotationBeforeSolve; private Quaternion maintainRotation; private Quaternion bone3DefaultRotation; private Vector3 _bendNormal; private Vector3 animationNormal; private AxisDirection[] axisDirectionsLeft = new AxisDirection[4]; private AxisDirection[] axisDirectionsRight = new AxisDirection[4]; private AxisDirection[] axisDirections { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)goal == 2) { return axisDirectionsLeft; } return axisDirectionsRight; } } public void MaintainRotation() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (base.initiated) { maintainRotation = bone3.transform.rotation; maintainRotationFor1Frame = true; } } public void MaintainBend() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (base.initiated) { animationNormal = bone1.GetBendNormalFromCurrentRotation(); maintainBendFor1Frame = true; } } protected override void OnInitiateVirtual() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) defaultRootRotation = root.rotation; if ((Object)(object)bone1.transform.parent != (Object)null) { parentDefaultRotation = Quaternion.Inverse(defaultRootRotation) * bone1.transform.parent.rotation; } if ((Object)(object)bone3.rotationLimit != (Object)null) { bone3.rotationLimit.Disable(); } bone3DefaultRotation = bone3.transform.rotation; Vector3 val = Vector3.Cross(bone2.transform.position - bone1.transform.position, bone3.transform.position - bone2.transform.position); if (val != Vector3.zero) { bendNormal = val; } animationNormal = bendNormal; StoreAxisDirections(ref axisDirectionsLeft); StoreAxisDirections(ref axisDirectionsRight); } protected override void OnUpdateVirtual() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight > 0f) { bendModifierWeight = Mathf.Clamp(bendModifierWeight, 0f, 1f); maintainRotationWeight = Mathf.Clamp(maintainRotationWeight, 0f, 1f); _bendNormal = bendNormal; bendNormal = GetModifiedBendNormal(); } if (maintainRotationWeight * IKPositionWeight > 0f) { bone3RotationBeforeSolve = (maintainRotationFor1Frame ? maintainRotation : bone3.transform.rotation); maintainRotationFor1Frame = false; } } protected override void OnPostSolveVirtual() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight > 0f) { bendNormal = _bendNormal; } if (maintainRotationWeight * IKPositionWeight > 0f) { bone3.transform.rotation = Quaternion.Slerp(bone3.transform.rotation, bone3RotationBeforeSolve, maintainRotationWeight * IKPositionWeight); } } public IKSolverLimb() { } public IKSolverLimb(AvatarIKGoal goal) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) this.goal = goal; } private void StoreAxisDirections(ref AxisDirection[] axisDirections) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) axisDirections[0] = new AxisDirection(Vector3.zero, new Vector3(-1f, 0f, 0f)); axisDirections[1] = new AxisDirection(new Vector3(0.5f, 0f, -0.2f), new Vector3(-0.5f, -1f, 1f)); axisDirections[2] = new AxisDirection(new Vector3(-0.5f, -1f, -0.2f), new Vector3(0f, 0.5f, -1f)); axisDirections[3] = new AxisDirection(new Vector3(-0.5f, -0.5f, 1f), new Vector3(-1f, -1f, -1f)); } private Vector3 GetModifiedBendNormal() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Invalid comparison between Unknown and I4 //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Invalid comparison between Unknown and I4 //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Invalid comparison between Unknown and I4 //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) float num = bendModifierWeight; if (num <= 0f) { return bendNormal; } switch (bendModifier) { case BendModifier.Animation: if (!maintainBendFor1Frame) { MaintainBend(); } maintainBendFor1Frame = false; return Vector3.Lerp(bendNormal, animationNormal, num); case BendModifier.Parent: { if ((Object)(object)bone1.transform.parent == (Object)null) { return bendNormal; } Quaternion val6 = bone1.transform.parent.rotation * Quaternion.Inverse(parentDefaultRotation); return Quaternion.Slerp(Quaternion.identity, val6 * Quaternion.Inverse(defaultRootRotation), num) * bendNormal; } case BendModifier.Target: { Quaternion val5 = IKRotation * Quaternion.Inverse(bone3DefaultRotation); return Quaternion.Slerp(Quaternion.identity, val5, num) * bendNormal; } case BendModifier.Arm: { if ((Object)(object)bone1.transform.parent == (Object)null) { return bendNormal; } if ((int)goal == 0 || (int)goal == 1) { if (!Warning.logged) { LogWarning("Trying to use the 'Arm' bend modifier on a leg."); } return bendNormal; } Vector3 val2 = IKPosition - bone1.transform.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; normalized = Quaternion.Inverse(bone1.transform.parent.rotation * Quaternion.Inverse(parentDefaultRotation)) * normalized; if ((int)goal == 2) { normalized.x = 0f - normalized.x; } for (int i = 1; i < axisDirections.Length; i++) { axisDirections[i].dot = Mathf.Clamp(Vector3.Dot(axisDirections[i].direction, normalized), 0f, 1f); axisDirections[i].dot = Interp.Float(axisDirections[i].dot, InterpolationMode.InOutQuintic); } Vector3 val3 = axisDirections[0].axis; for (int j = 1; j < axisDirections.Length; j++) { val3 = Vector3.Slerp(val3, axisDirections[j].axis, axisDirections[j].dot); } if ((int)goal == 2) { val3.x = 0f - val3.x; val3 = -val3; } Vector3 val4 = bone1.transform.parent.rotation * Quaternion.Inverse(parentDefaultRotation) * val3; if (num >= 1f) { return val4; } return Vector3.Lerp(bendNormal, val4, num); } case BendModifier.Goal: { if ((Object)(object)bendGoal == (Object)null) { if (!Warning.logged) { LogWarning("Trying to use the 'Goal' Bend Modifier, but the Bend Goal is unassigned."); } return bendNormal; } Vector3 val = Vector3.Cross(bendGoal.position - bone1.transform.position, IKPosition - bone1.transform.position); if (val == Vector3.zero) { return bendNormal; } if (num >= 1f) { return val; } return Vector3.Lerp(bendNormal, val, num); } default: return bendNormal; } } } [Serializable] public class IKSolverLookAt : IKSolver { [Serializable] public class LookAtBone : Bone { public Vector3 baseForwardOffsetEuler; public Vector3 forward => transform.rotation * axis; public LookAtBone() { } public LookAtBone(Transform transform) { base.transform = transform; } public void Initiate(Transform root) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)transform == (Object)null)) { axis = Quaternion.Inverse(transform.rotation) * root.forward; } } public void LookAt(Vector3 direction, float weight) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.FromToRotation(forward, direction); Quaternion rotation = transform.rotation; transform.rotation = Quaternion.Lerp(rotation, val * rotation, weight); } } public Transform target; public LookAtBone[] spine = new LookAtBone[0]; public LookAtBone head = new LookAtBone(); public LookAtBone[] eyes = new LookAtBone[0]; [Range(0f, 1f)] public float bodyWeight = 0.5f; [Range(0f, 1f)] public float headWeight = 0.5f; [Range(0f, 1f)] public float eyesWeight = 1f; [Range(0f, 1f)] public float clampWeight = 0.5f; [Range(0f, 1f)] public float clampWeightHead = 0.5f; [Range(0f, 1f)] public float clampWeightEyes = 0.5f; [Range(0f, 2f)] public int clampSmoothing = 2; public AnimationCurve spineWeightCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 0.3f), new Keyframe(1f, 1f) }); public Vector3 spineTargetOffset; protected Vector3[] spineForwards = (Vector3[])(object)new Vector3[0]; protected Vector3[] headForwards = (Vector3[])(object)new Vector3[1]; protected Vector3[] eyeForward = (Vector3[])(object)new Vector3[1]; private bool isDirty; protected bool spineIsValid { get { if (spine == null) { return false; } if (spine.Length == 0) { return true; } for (int i = 0; i < spine.Length; i++) { if (spine[i] == null || (Object)(object)spine[i].transform == (Object)null) { return false; } } return true; } } protected bool spineIsEmpty => spine.Length == 0; protected bool headIsValid { get { if (head == null) { return false; } return true; } } protected bool headIsEmpty => (Object)(object)head.transform == (Object)null; protected bool eyesIsValid { get { if (eyes == null) { return false; } if (eyes.Length == 0) { return true; } for (int i = 0; i < eyes.Length; i++) { if (eyes[i] == null || (Object)(object)eyes[i].transform == (Object)null) { return false; } } return true; } } protected bool eyesIsEmpty => eyes.Length == 0; public void SetLookAtWeight(float weight) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); } public void SetLookAtWeight(float weight, float bodyWeight) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); this.bodyWeight = Mathf.Clamp(bodyWeight, 0f, 1f); } public void SetLookAtWeight(float weight, float bodyWeight, float headWeight) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); this.bodyWeight = Mathf.Clamp(bodyWeight, 0f, 1f); this.headWeight = Mathf.Clamp(headWeight, 0f, 1f); } public void SetLookAtWeight(float weight, float bodyWeight, float headWeight, float eyesWeight) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); this.bodyWeight = Mathf.Clamp(bodyWeight, 0f, 1f); this.headWeight = Mathf.Clamp(headWeight, 0f, 1f); this.eyesWeight = Mathf.Clamp(eyesWeight, 0f, 1f); } public void SetLookAtWeight(float weight, float bodyWeight, float headWeight, float eyesWeight, float clampWeight) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); this.bodyWeight = Mathf.Clamp(bodyWeight, 0f, 1f); this.headWeight = Mathf.Clamp(headWeight, 0f, 1f); this.eyesWeight = Mathf.Clamp(eyesWeight, 0f, 1f); this.clampWeight = Mathf.Clamp(clampWeight, 0f, 1f); clampWeightHead = this.clampWeight; clampWeightEyes = this.clampWeight; } public void SetLookAtWeight(float weight, float bodyWeight = 0f, float headWeight = 1f, float eyesWeight = 0.5f, float clampWeight = 0.5f, float clampWeightHead = 0.5f, float clampWeightEyes = 0.3f) { IKPositionWeight = Mathf.Clamp(weight, 0f, 1f); this.bodyWeight = Mathf.Clamp(bodyWeight, 0f, 1f); this.headWeight = Mathf.Clamp(headWeight, 0f, 1f); this.eyesWeight = Mathf.Clamp(eyesWeight, 0f, 1f); this.clampWeight = Mathf.Clamp(clampWeight, 0f, 1f); this.clampWeightHead = Mathf.Clamp(clampWeightHead, 0f, 1f); this.clampWeightEyes = Mathf.Clamp(clampWeightEyes, 0f, 1f); } public override void StoreDefaultLocalState() { for (int i = 0; i < spine.Length; i++) { spine[i].StoreDefaultLocalState(); } for (int j = 0; j < eyes.Length; j++) { eyes[j].StoreDefaultLocalState(); } if (head != null && (Object)(object)head.transform != (Object)null) { head.StoreDefaultLocalState(); } } public void SetDirty() { isDirty = true; } public override void FixTransforms() { if (base.initiated && (!(IKPositionWeight <= 0f) || isDirty)) { for (int i = 0; i < spine.Length; i++) { spine[i].FixTransform(); } for (int j = 0; j < eyes.Length; j++) { eyes[j].FixTransform(); } if (head != null && (Object)(object)head.transform != (Object)null) { head.FixTransform(); } isDirty = false; } } public override bool IsValid(ref string message) { if (!spineIsValid) { message = "IKSolverLookAt spine setup is invalid. Can't initiate solver."; return false; } if (!headIsValid) { message = "IKSolverLookAt head transform is null. Can't initiate solver."; return false; } if (!eyesIsValid) { message = "IKSolverLookAt eyes setup is invalid. Can't initiate solver."; return false; } if (spineIsEmpty && headIsEmpty && eyesIsEmpty) { message = "IKSolverLookAt eyes setup is invalid. Can't initiate solver."; return false; } Bone[] bones = spine; Transform val = IKSolver.ContainsDuplicateBone(bones); if ((Object)(object)val != (Object)null) { message = ((Object)val).name + " is represented multiple times in a single IK chain. Can't initiate solver."; return false; } bones = eyes; Transform val2 = IKSolver.ContainsDuplicateBone(bones); if ((Object)(object)val2 != (Object)null) { message = ((Object)val2).name + " is represented multiple times in a single IK chain. Can't initiate solver."; return false; } return true; } public override Point[] GetPoints() { Point[] array = new Point[spine.Length + eyes.Length + (((Object)(object)head.transform != (Object)null) ? 1 : 0)]; for (int i = 0; i < spine.Length; i++) { array[i] = spine[i]; } int num = 0; for (int j = spine.Length; j < spine.Length + eyes.Length; j++) { array[j] = eyes[num]; num++; } if ((Object)(object)head.transform != (Object)null) { array[^1] = head; } return array; } public override Point GetPoint(Transform transform) { LookAtBone[] array = spine; foreach (LookAtBone lookAtBone in array) { if ((Object)(object)lookAtBone.transform == (Object)(object)transform) { return lookAtBone; } } array = eyes; foreach (LookAtBone lookAtBone2 in array) { if ((Object)(object)lookAtBone2.transform == (Object)(object)transform) { return lookAtBone2; } } if ((Object)(object)head.transform == (Object)(object)transform) { return head; } return null; } public bool SetChain(Transform[] spine, Transform head, Transform[] eyes, Transform root) { SetBones(spine, ref this.spine); this.head = new LookAtBone(head); SetBones(eyes, ref this.eyes); Initiate(root); return base.initiated; } protected override void OnInitiate() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) if (firstInitiation || !Application.isPlaying) { if (spine.Length != 0) { IKPosition = spine[spine.Length - 1].transform.position + root.forward * 3f; } else if ((Object)(object)head.transform != (Object)null) { IKPosition = head.transform.position + root.forward * 3f; } else if (eyes.Length != 0 && (Object)(object)eyes[0].transform != (Object)null) { IKPosition = eyes[0].transform.position + root.forward * 3f; } } LookAtBone[] array = spine; for (int i = 0; i < array.Length; i++) { array[i].Initiate(root); } if (head != null) { head.Initiate(root); } array = eyes; for (int i = 0; i < array.Length; i++) { array[i].Initiate(root); } if (spineForwards == null || spineForwards.Length != spine.Length) { spineForwards = (Vector3[])(object)new Vector3[spine.Length]; } if (headForwards == null) { headForwards = (Vector3[])(object)new Vector3[1]; } if (eyeForward == null) { eyeForward = (Vector3[])(object)new Vector3[1]; } } protected override void OnUpdate() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!(IKPositionWeight <= 0f)) { IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); if ((Object)(object)target != (Object)null) { IKPosition = target.position; } SolveSpine(); SolveHead(); SolveEyes(); } } protected void SolveSpine() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) if (!(bodyWeight <= 0f) && !spineIsEmpty) { Vector3 val = IKPosition + spineTargetOffset - spine[spine.Length - 1].transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; GetForwards(ref spineForwards, spine[0].forward, normalized, spine.Length, clampWeight); for (int i = 0; i < spine.Length; i++) { spine[i].LookAt(spineForwards[i], bodyWeight * IKPositionWeight); } } } protected void SolveHead() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!(headWeight <= 0f) && !headIsEmpty) { Vector3 val = ((spine.Length != 0 && (Object)(object)spine[spine.Length - 1].transform != (Object)null) ? spine[spine.Length - 1].forward : head.forward); Vector3 val2 = IKPosition - head.transform.position; val2 = Vector3.Lerp(val, ((Vector3)(ref val2)).normalized, headWeight * IKPositionWeight); Vector3 normalized = ((Vector3)(ref val2)).normalized; GetForwards(ref headForwards, val, normalized, 1, clampWeightHead); head.LookAt(headForwards[0], headWeight * IKPositionWeight); } } protected void SolveEyes() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) if (eyesWeight <= 0f || eyesIsEmpty) { return; } for (int i = 0; i < eyes.Length; i++) { Quaternion val = (((Object)(object)head.transform != (Object)null) ? head.transform.rotation : ((spine.Length != 0) ? spine[spine.Length - 1].transform.rotation : root.rotation)); Vector3 val2 = (((Object)(object)head.transform != (Object)null) ? head.axis : ((spine.Length != 0) ? spine[spine.Length - 1].axis : root.forward)); if (eyes[i].baseForwardOffsetEuler != Vector3.zero) { val *= Quaternion.Euler(eyes[i].baseForwardOffsetEuler); } Vector3 baseForward = val * val2; ref Vector3[] forwards = ref eyeForward; Vector3 val3 = IKPosition - eyes[i].transform.position; GetForwards(ref forwards, baseForward, ((Vector3)(ref val3)).normalized, 1, clampWeightEyes); eyes[i].LookAt(eyeForward[0], eyesWeight * IKPositionWeight); } } protected Vector3[] GetForwards(ref Vector3[] forwards, Vector3 baseForward, Vector3 targetForward, int bones, float clamp) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) if (clamp >= 1f || IKPositionWeight <= 0f) { for (int i = 0; i < forwards.Length; i++) { forwards[i] = baseForward; } return forwards; } float num = Vector3.Angle(baseForward, targetForward); float num2 = 1f - num / 180f; float num3 = ((clamp > 0f) ? Mathf.Clamp(1f - (clamp - num2) / (1f - num2), 0f, 1f) : 1f); float num4 = ((clamp > 0f) ? Mathf.Clamp(num2 / clamp, 0f, 1f) : 1f); for (int j = 0; j < clampSmoothing; j++) { num4 = Mathf.Sin(num4 * MathF.PI * 0.5f); } if (forwards.Length == 1) { forwards[0] = Vector3.Slerp(baseForward, targetForward, num4 * num3); } else { float num5 = 1f / (float)(forwards.Length - 1); for (int k = 0; k < forwards.Length; k++) { forwards[k] = Vector3.Slerp(baseForward, targetForward, spineWeightCurve.Evaluate(num5 * (float)k) * num4 * num3); } } return forwards; } protected void SetBones(Transform[] array, ref LookAtBone[] bones) { if (array == null) { bones = new LookAtBone[0]; return; } if (bones.Length != array.Length) { bones = new LookAtBone[array.Length]; } for (int i = 0; i < array.Length; i++) { if (bones[i] == null) { bones[i] = new LookAtBone(array[i]); } else { bones[i].transform = array[i]; } } } } [Serializable] public class IKSolverTrigonometric : IKSolver { [Serializable] public class TrigonometricBone : Bone { private Quaternion targetToLocalSpace; private Vector3 defaultLocalBendNormal; public void Initiate(Vector3 childPosition, Vector3 bendNormal) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = Quaternion.LookRotation(childPosition - transform.position, bendNormal); targetToLocalSpace = QuaTools.RotationToLocalSpace(transform.rotation, rotation); defaultLocalBendNormal = Quaternion.Inverse(transform.rotation) * bendNormal; } public Quaternion GetRotation(Vector3 direction, Vector3 bendNormal) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return Quaternion.LookRotation(direction, bendNormal) * targetToLocalSpace; } public Vector3 GetBendNormalFromCurrentRotation() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) return transform.rotation * defaultLocalBendNormal; } } public Transform target; [Range(0f, 1f)] public float IKRotationWeight = 1f; public Quaternion IKRotation = Quaternion.identity; public Vector3 bendNormal = Vector3.right; public TrigonometricBone bone1 = new TrigonometricBone(); public TrigonometricBone bone2 = new TrigonometricBone(); public TrigonometricBone bone3 = new TrigonometricBone(); protected Vector3 weightIKPosition; protected bool directHierarchy = true; public void SetBendGoalPosition(Vector3 goalPosition, float weight) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (!base.initiated || weight <= 0f) { return; } Vector3 val = Vector3.Cross(goalPosition - bone1.transform.position, IKPosition - bone1.transform.position); if (val != Vector3.zero) { if (weight >= 1f) { bendNormal = val; } else { bendNormal = Vector3.Lerp(bendNormal, val, weight); } } } public void SetBendPlaneToCurrent() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (base.initiated) { Vector3 val = Vector3.Cross(bone2.transform.position - bone1.transform.position, bone3.transform.position - bone2.transform.position); if (val != Vector3.zero) { bendNormal = val; } } } public void SetIKRotation(Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) IKRotation = rotation; } public void SetIKRotationWeight(float weight) { IKRotationWeight = Mathf.Clamp(weight, 0f, 1f); } public Quaternion GetIKRotation() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return IKRotation; } public float GetIKRotationWeight() { return IKRotationWeight; } public override Point[] GetPoints() { return new Point[3] { bone1, bone2, bone3 }; } public override Point GetPoint(Transform transform) { if ((Object)(object)bone1.transform == (Object)(object)transform) { return bone1; } if ((Object)(object)bone2.transform == (Object)(object)transform) { return bone2; } if ((Object)(object)bone3.transform == (Object)(object)transform) { return bone3; } return null; } public override void StoreDefaultLocalState() { bone1.StoreDefaultLocalState(); bone2.StoreDefaultLocalState(); bone3.StoreDefaultLocalState(); } public override void FixTransforms() { if (base.initiated) { bone1.FixTransform(); bone2.FixTransform(); bone3.FixTransform(); } } public override bool IsValid(ref string message) { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bone1.transform == (Object)null || (Object)(object)bone2.transform == (Object)null || (Object)(object)bone3.transform == (Object)null) { message = "Please assign all Bones to the IK solver."; return false; } Object[] objects = (Object[])(object)new Transform[3] { bone1.transform, bone2.transform, bone3.transform }; Transform val = (Transform)Hierarchy.ContainsDuplicate(objects); if ((Object)(object)val != (Object)null) { message = ((Object)val).name + " is represented multiple times in the Bones."; return false; } if (bone1.transform.position == bone2.transform.position) { message = "first bone position is the same as second bone position."; return false; } if (bone2.transform.position == bone3.transform.position) { message = "second bone position is the same as third bone position."; return false; } return true; } public bool SetChain(Transform bone1, Transform bone2, Transform bone3, Transform root) { this.bone1.transform = bone1; this.bone2.transform = bone2; this.bone3.transform = bone3; Initiate(root); return base.initiated; } public static void Solve(Transform bone1, Transform bone2, Transform bone3, Vector3 targetPosition, Vector3 bendNormal, float weight) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } targetPosition = Vector3.Lerp(bone3.position, targetPosition, weight); Vector3 val = targetPosition - bone1.position; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude != 0f) { Vector3 val2 = bone2.position - bone1.position; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; val2 = bone3.position - bone2.position; float sqrMagnitude2 = ((Vector3)(ref val2)).sqrMagnitude; Vector3 bendDirection = Vector3.Cross(val, bendNormal); Vector3 directionToBendPoint = GetDirectionToBendPoint(val, magnitude, bendDirection, sqrMagnitude, sqrMagnitude2); Quaternion val3 = Quaternion.FromToRotation(bone2.position - bone1.position, directionToBendPoint); if (weight < 1f) { val3 = Quaternion.Lerp(Quaternion.identity, val3, weight); } bone1.rotation = val3 * bone1.rotation; Quaternion val4 = Quaternion.FromToRotation(bone3.position - bone2.position, targetPosition - bone2.position); if (weight < 1f) { val4 = Quaternion.Lerp(Quaternion.identity, val4, weight); } bone2.rotation = val4 * bone2.rotation; } } private static Vector3 GetDirectionToBendPoint(Vector3 direction, float directionMag, Vector3 bendDirection, float sqrMag1, float sqrMag2) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) float num = (directionMag * directionMag + (sqrMag1 - sqrMag2)) / 2f / directionMag; float num2 = (float)Math.Sqrt(Mathf.Clamp(sqrMag1 - num * num, 0f, float.PositiveInfinity)); if (direction == Vector3.zero) { return Vector3.zero; } return Quaternion.LookRotation(direction, bendDirection) * new Vector3(0f, num2, num); } protected override void OnInitiate() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (bendNormal == Vector3.zero) { bendNormal = Vector3.right; } OnInitiateVirtual(); IKPosition = bone3.transform.position; IKRotation = bone3.transform.rotation; InitiateBones(); directHierarchy = IsDirectHierarchy(); } private bool IsDirectHierarchy() { if ((Object)(object)bone3.transform.parent != (Object)(object)bone2.transform) { return false; } if ((Object)(object)bone2.transform.parent != (Object)(object)bone1.transform) { return false; } return true; } private void InitiateBones() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) bone1.Initiate(bone2.transform.position, bendNormal); bone2.Initiate(bone3.transform.position, bendNormal); SetBendPlaneToCurrent(); } protected override void OnUpdate() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) IKPositionWeight = Mathf.Clamp(IKPositionWeight, 0f, 1f); IKRotationWeight = Mathf.Clamp(IKRotationWeight, 0f, 1f); if ((Object)(object)target != (Object)null) { IKPosition = target.position; IKRotation = target.rotation; } OnUpdateVirtual(); if (IKPositionWeight > 0f) { if (!directHierarchy) { bone1.Initiate(bone2.transform.position, bendNormal); bone2.Initiate(bone3.transform.position, bendNormal); } TrigonometricBone trigonometricBone = bone1; Vector3 val = bone2.transform.position - bone1.transform.position; trigonometricBone.sqrMag = ((Vector3)(ref val)).sqrMagnitude; TrigonometricBone trigonometricBone2 = bone2; val = bone3.transform.position - bone2.transform.position; trigonometricBone2.sqrMag = ((Vector3)(ref val)).sqrMagnitude; if (bendNormal == Vector3.zero && !Warning.logged) { LogWarning("IKSolverTrigonometric Bend Normal is Vector3.zero."); } weightIKPosition = Vector3.Lerp(bone3.transform.position, IKPosition, IKPositionWeight); Vector3 val2 = Vector3.Lerp(bone1.GetBendNormalFromCurrentRotation(), bendNormal, IKPositionWeight); Vector3 val3 = Vector3.Lerp(bone2.transform.position - bone1.transform.position, GetBendDirection(weightIKPosition, val2), IKPositionWeight); if (val3 == Vector3.zero) { val3 = bone2.transform.position - bone1.transform.position; } bone1.transform.rotation = bone1.GetRotation(val3, val2); bone2.transform.rotation = bone2.GetRotation(weightIKPosition - bone2.transform.position, bone2.GetBendNormalFromCurrentRotation()); } if (IKRotationWeight > 0f) { bone3.transform.rotation = Quaternion.Slerp(bone3.transform.rotation, IKRotation, IKRotationWeight); } OnPostSolveVirtual(); } protected virtual void OnInitiateVirtual() { } protected virtual void OnUpdateVirtual() { } protected virtual void OnPostSolveVirtual() { } protected Vector3 GetBendDirection(Vector3 IKPosition, Vector3 bendNormal) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Vector3 val = IKPosition - bone1.transform.position; if (val == Vector3.zero) { return Vector3.zero; } float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; float num = (float)Math.Sqrt(sqrMagnitude); float num2 = (sqrMagnitude + bone1.sqrMag - bone2.sqrMag) / 2f / num; float num3 = (float)Math.Sqrt(Mathf.Clamp(bone1.sqrMag - num2 * num2, 0f, float.PositiveInfinity)); Vector3 val2 = Vector3.Cross(val / num, bendNormal); return Quaternion.LookRotation(val, val2) * new Vector3(0f, num3, num2); } } [Serializable] public class IKSolverVR : IKSolver { [Serializable] public class Arm : BodyPart { [Serializable] public enum ShoulderRotationMode { YawPitch, FromTo } [Tooltip("The hand target. This should not be the hand controller itself, but a child GameObject parented to it so you could adjust it's position/rotation to match the orientation of the hand bone. The best practice for setup would be to move the hand controller to the avatar's hand as it it was held by the avatar, duplicate the avatar's hand bone and parent it to the hand controller. Then assign the duplicate to this slot.")] public Transform target; [Tooltip("The elbow will be bent towards this Transform if 'Bend Goal Weight' > 0.")] public Transform bendGoal; [Tooltip("Positional weight of the hand target. Note that if you have nulled the target, the hand will still be pulled to the last position of the target until you set this value to 0.")] [Range(0f, 1f)] public float positionWeight = 1f; [Tooltip("Rotational weight of the hand target. Note that if you have nulled the target, the hand will still be rotated to the last rotation of the target until you set this value to 0.")] [Range(0f, 1f)] public float rotationWeight = 1f; [Tooltip("Different techniques for shoulder bone rotation.")] public ShoulderRotationMode shoulderRotationMode; [Tooltip("The weight of shoulder rotation")] [Range(0f, 1f)] public float shoulderRotationWeight = 1f; [Tooltip("The weight of twisting the shoulders backwards when arms are lifted up.")] [Range(0f, 1f)] public float shoulderTwistWeight = 1f; [Tooltip("If greater than 0, will bend the elbow towards the 'Bend Goal' Transform.")] [Range(0f, 1f)] public float bendGoalWeight; [Tooltip("Angular offset of the elbow bending direction.")] [Range(-180f, 180f)] public float swivelOffset; [Tooltip("Local axis of the hand bone that points from the wrist towards the palm. Used for defining hand bone orientation. If you have copied VRIK component from another avatar that has different bone orientations, right-click on VRIK header and select 'Guess Hand Orientations' from the context menu.")] public Vector3 wristToPalmAxis = Vector3.zero; [Tooltip("Local axis of the hand bone that points from the palm towards the thumb. Used for defining hand bone orientation. If you have copied VRIK component from another avatar that has different bone orientations, right-click on VRIK header and select 'Guess Hand Orientations' from the context menu.")] public Vector3 palmToThumbAxis = Vector3.zero; [Tooltip("Use this to make the arm shorter/longer. Works by displacement of hand and forearm localPosition.")] [Range(0.01f, 2f)] public float armLengthMlp = 1f; [Tooltip("Evaluates stretching of the arm by target distance relative to arm length. Value at time 1 represents stretching amount at the point where distance to the target is equal to arm length. Value at time 2 represents stretching amount at the point where distance to the target is double the arm length. Value represents the amount of stretching. Linear stretching would be achieved with a linear curve going up by 45 degrees. Increase the range of stretching by moving the last key up and right at the same amount. Smoothing in the curve can help reduce elbow snapping (start stretching the arm slightly before target distance reaches arm length). To get a good optimal value for this curve, please go to the 'VRIK (Basic)' demo scene and copy the stretch curve over from the Pilot character.")] public AnimationCurve stretchCurve = new AnimationCurve(); [NonSerialized] [HideInInspector] public Vector3 IKPosition; [NonSerialized] [HideInInspector] public Quaternion IKRotation = Quaternion.identity; [NonSerialized] [HideInInspector] public Vector3 bendDirection = Vector3.back; [NonSerialized] [HideInInspector] public Vector3 handPositionOffset; private bool hasShoulder; private Vector3 chestForwardAxis; private Vector3 chestUpAxis; private Quaternion chestRotation = Quaternion.identity; private Vector3 chestForward; private Vector3 chestUp; private Quaternion forearmRelToUpperArm = Quaternion.identity; private Vector3 upperArmBendAxis; private const float yawOffsetAngle = 45f; private const float pitchOffsetAngle = -30f; public Vector3 position { get; private set; } public Quaternion rotation { get; private set; } private VirtualBone shoulder => bones[0]; private VirtualBone upperArm => bones[hasShoulder ? 1 : 0]; private VirtualBone forearm => bones[(!hasShoulder) ? 1 : 2]; private VirtualBone hand => bones[hasShoulder ? 3 : 2]; protected override void OnRead(Vector3[] positions, Quaternion[] rotations, bool hasChest, bool hasNeck, bool hasShoulders, bool hasToes, bool hasLegs, int rootIndex, int index) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) Vector3 val = positions[index]; Quaternion val2 = rotations[index]; Vector3 val3 = positions[index + 1]; Quaternion val4 = rotations[index + 1]; Vector3 val5 = positions[index + 2]; Quaternion val6 = rotations[index + 2]; Vector3 iKPosition = positions[index + 3]; Quaternion iKRotation = rotations[index + 3]; if (!initiated) { IKPosition = iKPosition; IKRotation = iKRotation; rotation = IKRotation; hasShoulder = hasShoulders; bones = new VirtualBone[hasShoulder ? 4 : 3]; if (hasShoulder) { bones[0] = new VirtualBone(val, val2); bones[1] = new VirtualBone(val3, val4); bones[2] = new VirtualBone(val5, val6); bones[3] = new VirtualBone(iKPosition, iKRotation); } else { bones[0] = new VirtualBone(val3, val4); bones[1] = new VirtualBone(val5, val6); bones[2] = new VirtualBone(iKPosition, iKRotation); } Vector3 val7 = rotations[0] * Vector3.forward; chestForwardAxis = Quaternion.Inverse(rootRotation) * val7; chestUpAxis = Quaternion.Inverse(rootRotation) * (rotations[0] * Vector3.up); Vector3 val8 = AxisTools.GetAxisVectorToDirection(val4, val7); if (Vector3.Dot(val4 * val8, val7) < 0f) { val8 = -val8; } upperArmBendAxis = Vector3.Cross(Quaternion.Inverse(val4) * (val5 - val3), val8); if (upperArmBendAxis == Vector3.zero) { Debug.LogWarning((object)"VRIK can not calculate which way to bend the arms because the arms are perfectly straight. Please rotate the elbow bones slightly in their natural bending direction in the Editor."); } } if (hasShoulder) { bones[0].Read(val, val2); bones[1].Read(val3, val4); bones[2].Read(val5, val6); bones[3].Read(iKPosition, iKRotation); } else { bones[0].Read(val3, val4); bones[1].Read(val5, val6); bones[2].Read(iKPosition, iKRotation); } } public override void PreSolve() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target != (Object)null) { IKPosition = target.position; IKRotation = target.rotation; } position = V3Tools.Lerp(hand.solverPosition, IKPosition, positionWeight); rotation = QuaTools.Lerp(hand.solverRotation, IKRotation, rotationWeight); shoulder.axis = ((Vector3)(ref shoulder.axis)).normalized; forearmRelToUpperArm = Quaternion.Inverse(upperArm.solverRotation) * forearm.solverRotation; } public override void ApplyOffsets(float scale) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) position += handPositionOffset; } private void Stretching() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) float num = upperArm.length + forearm.length; Vector3 zero = Vector3.zero; Vector3 zero2 = Vector3.zero; if (armLengthMlp != 1f) { num *= armLengthMlp; zero = (forearm.solverPosition - upperArm.solverPosition) * (armLengthMlp - 1f); zero2 = (hand.solverPosition - forearm.solverPosition) * (armLengthMlp - 1f); VirtualBone virtualBone = forearm; virtualBone.solverPosition += zero; VirtualBone virtualBone2 = hand; virtualBone2.solverPosition += zero + zero2; } float num2 = Vector3.Distance(upperArm.solverPosition, position) / num; float num3 = stretchCurve.Evaluate(num2); num3 *= positionWeight; zero = (forearm.solverPosition - upperArm.solverPosition) * num3; zero2 = (hand.solverPosition - forearm.solverPosition) * num3; VirtualBone virtualBone3 = forearm; virtualBone3.solverPosition += zero; VirtualBone virtualBone4 = hand; virtualBone4.solverPosition += zero + zero2; } public void Solve(bool isLeft) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_06ad: Unknown result type (might be due to invalid IL or missing references) //IL_06b8: Unknown result type (might be due to invalid IL or missing references) //IL_06bd: Unknown result type (might be due to invalid IL or missing references) //IL_06c2: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06f7: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06df: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_0841: Unknown result type (might be due to invalid IL or missing references) //IL_0846: Unknown result type (might be due to invalid IL or missing references) //IL_072a: Unknown result type (might be due to invalid IL or missing references) //IL_0730: Unknown result type (might be due to invalid IL or missing references) //IL_0735: Unknown result type (might be due to invalid IL or missing references) //IL_0740: Unknown result type (might be due to invalid IL or missing references) //IL_074b: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Unknown result type (might be due to invalid IL or missing references) //IL_0755: Unknown result type (might be due to invalid IL or missing references) //IL_075a: Unknown result type (might be due to invalid IL or missing references) //IL_075f: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_0765: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0797: Unknown result type (might be due to invalid IL or missing references) //IL_07a2: Unknown result type (might be due to invalid IL or missing references) //IL_07a7: Unknown result type (might be due to invalid IL or missing references) //IL_07ac: Unknown result type (might be due to invalid IL or missing references) //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07cc: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_07e6: Unknown result type (might be due to invalid IL or missing references) //IL_07eb: Unknown result type (might be due to invalid IL or missing references) //IL_07f6: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_0806: Unknown result type (might be due to invalid IL or missing references) //IL_080b: Unknown result type (might be due to invalid IL or missing references) //IL_0810: Unknown result type (might be due to invalid IL or missing references) //IL_0819: Unknown result type (might be due to invalid IL or missing references) //IL_081b: Unknown result type (might be due to invalid IL or missing references) //IL_081d: Unknown result type (might be due to invalid IL or missing references) //IL_0604: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_086b: Unknown result type (might be due to invalid IL or missing references) //IL_0876: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Unknown result type (might be due to invalid IL or missing references) //IL_062e: Unknown result type (might be due to invalid IL or missing references) //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_0664: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Unknown result type (might be due to invalid IL or missing references) //IL_0695: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) chestRotation = Quaternion.LookRotation(rootRotation * chestForwardAxis, rootRotation * chestUpAxis); chestForward = chestRotation * Vector3.forward; chestUp = chestRotation * Vector3.up; Vector3 val = Vector3.zero; if (hasShoulder && shoulderRotationWeight > 0f && LOD < 1) { switch (shoulderRotationMode) { case ShoulderRotationMode.YawPitch: { Vector3 val7 = position - shoulder.solverPosition; val7 = ((Vector3)(ref val7)).normalized; float num4 = (isLeft ? 45f : (-45f)); Quaternion val8 = Quaternion.AngleAxis((isLeft ? (-90f) : 90f) + num4, chestUp) * chestRotation; Vector3 val9 = Quaternion.Inverse(val8) * val7; float num5 = Mathf.Atan2(val9.x, val9.z) * 57.29578f; float num6 = Vector3.Dot(val9, Vector3.up); num6 = 1f - Mathf.Abs(num6); num5 *= num6; num5 -= num4; float num7 = (isLeft ? (-20f) : (-50f)); float num8 = (isLeft ? 50f : 20f); num5 = DamperValue(num5, num7 - num4, num8 - num4, 0.7f); Vector3 val10 = shoulder.solverRotation * shoulder.axis; Vector3 val11 = val8 * (Quaternion.AngleAxis(num5, Vector3.up) * Vector3.forward); Quaternion val12 = Quaternion.FromToRotation(val10, val11); val8 = Quaternion.AngleAxis(isLeft ? (-90f) : 90f, chestUp) * chestRotation; val8 = Quaternion.AngleAxis(isLeft ? (-30f) : 30f, chestForward) * val8; val7 = position - (shoulder.solverPosition + chestRotation * (isLeft ? Vector3.right : Vector3.left) * base.mag); val9 = Quaternion.Inverse(val8) * val7; float num9 = Mathf.Atan2(val9.y, val9.z) * 57.29578f; num9 -= -30f; num9 = DamperValue(num9, -15f, 75f); Quaternion val13 = Quaternion.AngleAxis(0f - num9, val8 * Vector3.right) * val12; if (shoulderRotationWeight * positionWeight < 1f) { val13 = Quaternion.Lerp(Quaternion.identity, val13, shoulderRotationWeight * positionWeight); } VirtualBone.RotateBy(bones, val13); Stretching(); val = GetBendNormal(position - upperArm.solverPosition); VirtualBone.SolveTrigonometric(bones, 1, 2, 3, position, val, positionWeight); float num10 = Mathf.Clamp(num9 * positionWeight * shoulderRotationWeight * shoulderTwistWeight * 2f, 0f, 180f); shoulder.solverRotation = Quaternion.AngleAxis(num10, shoulder.solverRotation * (isLeft ? shoulder.axis : (-shoulder.axis))) * shoulder.solverRotation; upperArm.solverRotation = Quaternion.AngleAxis(num10, upperArm.solverRotation * (isLeft ? upperArm.axis : (-upperArm.axis))) * upperArm.solverRotation; break; } case ShoulderRotationMode.FromTo: { Quaternion solverRotation = shoulder.solverRotation; Vector3 val2 = upperArm.solverPosition - shoulder.solverPosition; Quaternion val3 = Quaternion.FromToRotation(((Vector3)(ref val2)).normalized + chestForward, position - shoulder.solverPosition); val3 = Quaternion.Slerp(Quaternion.identity, val3, 0.5f * shoulderRotationWeight * positionWeight); VirtualBone.RotateBy(bones, val3); Stretching(); VirtualBone.SolveTrigonometric(bones, 0, 2, 3, position, Vector3.Cross(forearm.solverPosition - shoulder.solverPosition, hand.solverPosition - shoulder.solverPosition), 0.5f * shoulderRotationWeight * positionWeight); val = GetBendNormal(position - upperArm.solverPosition); VirtualBone.SolveTrigonometric(bones, 1, 2, 3, position, val, positionWeight); Quaternion val4 = Quaternion.Inverse(Quaternion.LookRotation(chestUp, chestForward)); Vector3 val5 = val4 * (solverRotation * shoulder.axis); Vector3 val6 = val4 * (shoulder.solverRotation * shoulder.axis); float num = Mathf.Atan2(val5.x, val5.z) * 57.29578f; float num2 = Mathf.Atan2(val6.x, val6.z) * 57.29578f; float num3 = Mathf.DeltaAngle(num, num2); if (isLeft) { num3 = 0f - num3; } num3 = Mathf.Clamp(num3 * shoulderRotationWeight * shoulderTwistWeight * 2f * positionWeight, 0f, 180f); shoulder.solverRotation = Quaternion.AngleAxis(num3, shoulder.solverRotation * (isLeft ? shoulder.axis : (-shoulder.axis))) * shoulder.solverRotation; upperArm.solverRotation = Quaternion.AngleAxis(num3, upperArm.solverRotation * (isLeft ? upperArm.axis : (-upperArm.axis))) * upperArm.solverRotation; break; } } } else { if (LOD < 1) { Stretching(); } val = GetBendNormal(position - upperArm.solverPosition); if (hasShoulder) { VirtualBone.SolveTrigonometric(bones, 1, 2, 3, position, val, positionWeight); } else { VirtualBone.SolveTrigonometric(bones, 0, 1, 2, position, val, positionWeight); } } if (LOD < 1 && positionWeight > 0f) { Vector3 val14 = Quaternion.Inverse(Quaternion.LookRotation(upperArm.solverRotation * upperArmBendAxis, forearm.solverPosition - upperArm.solverPosition)) * val; float num11 = Mathf.Atan2(val14.x, val14.z) * 57.29578f; upperArm.solverRotation = Quaternion.AngleAxis(num11 * positionWeight, forearm.solverPosition - upperArm.solverPosition) * upperArm.solverRotation; Quaternion val15 = upperArm.solverRotation * forearmRelToUpperArm; Quaternion val16 = Quaternion.FromToRotation(val15 * forearm.axis, hand.solverPosition - forearm.solverPosition); RotateTo(forearm, val16 * val15, positionWeight); } if (rotationWeight >= 1f) { hand.solverRotation = rotation; } else if (rotationWeight > 0f) { hand.solverRotation = Quaternion.Lerp(hand.solverRotation, rotation, rotationWeight); } } public override void ResetOffsets() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) handPositionOffset = Vector3.zero; } public override void Write(ref Vector3[] solvedPositions, ref Quaternion[] solvedRotations) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (hasShoulder) { solvedPositions[index] = shoulder.solverPosition; solvedRotations[index] = shoulder.solverRotation; } solvedPositions[index + 1] = upperArm.solverPosition; solvedPositions[index + 2] = forearm.solverPosition; solvedPositions[index + 3] = hand.solverPosition; solvedRotations[index + 1] = upperArm.solverRotation; solvedRotations[index + 2] = forearm.solverRotation; solvedRotations[index + 3] = hand.solverRotation; } private float DamperValue(float value, float min, float max, float weight = 1f) { float num = max - min; if (weight < 1f) { float num2 = max - num * 0.5f; float num3 = value - num2; num3 *= 0.5f; value = num2 + num3; } value -= min; float num4 = Interp.Float(Mathf.Clamp(value / num, 0f, 1f), InterpolationMode.InOutQuintic); return Mathf.Lerp(min, max, num4); } private Vector3 GetBendNormal(Vector3 dir) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bendGoal != (Object)null) { bendDirection = bendGoal.position - bones[1].solverPosition; } Vector3 val = bones[0].solverRotation * bones[0].axis; Vector3 down = Vector3.down; Vector3 val2 = Quaternion.Inverse(chestRotation) * ((Vector3)(ref dir)).normalized + Vector3.forward; Vector3 val3 = Quaternion.FromToRotation(down, val2) * Vector3.back; Vector3 val4 = Quaternion.Inverse(chestRotation) * val; val2 = Quaternion.Inverse(chestRotation) * dir; val3 = Quaternion.FromToRotation(val4, val2) * val3; val3 = chestRotation * val3; val3 += val; val3 -= rotation * wristToPalmAxis; val3 -= rotation * palmToThumbAxis * 0.5f; if (bendGoalWeight > 0f) { val3 = Vector3.Slerp(val3, bendDirection, bendGoalWeight); } if (swivelOffset != 0f) { val3 = Quaternion.AngleAxis(swivelOffset, -dir) * val3; } return Vector3.Cross(val3, dir); } private void Visualize(VirtualBone bone1, VirtualBone bone2, VirtualBone bone3, Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) Debug.DrawLine(bone1.solverPosition, bone2.solverPosition, color); Debug.DrawLine(bone2.solverPosition, bone3.solverPosition, color); } } [Serializable] public abstract class BodyPart { [HideInInspector] public VirtualBone[] bones = new VirtualBone[0]; protected bool initiated; protected Vector3 rootPosition; protected Quaternion rootRotation = Quaternion.identity; protected int index = -1; protected int LOD; public float sqrMag { get; private set; } public float mag { get; private set; } protected abstract void OnRead(Vector3[] positions, Quaternion[] rotations, bool hasChest, bool hasNeck, bool hasShoulders, bool hasToes, bool hasLegs, int rootIndex, int index); public abstract void PreSolve(); public abstract void Write(ref Vector3[] solvedPositions, ref Quaternion[] solvedRotations); public abstract void ApplyOffsets(float scale); public abstract void ResetOffsets(); public void SetLOD(int LOD) { this.LOD = LOD; } public void Read(Vector3[] positions, Quaternion[] rotations, bool hasChest, bool hasNeck, bool hasShoulders, bool hasToes, bool hasLegs, int rootIndex, int index) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) this.index = index; rootPosition = positions[rootIndex]; rootRotation = rotations[rootIndex]; OnRead(positions, rotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs, rootIndex, index); mag = VirtualBone.PreSolve(ref bones); sqrMag = mag * mag; initiated = true; } public void MovePosition(Vector3 position) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = position - bones[0].solverPosition; VirtualBone[] array = bones; foreach (VirtualBone obj in array) { obj.solverPosition += val; } } public void MoveRotation(Quaternion rotation) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation2 = QuaTools.FromToRotation(bones[0].solverRotation, rotation); VirtualBone.RotateAroundPoint(bones, 0, bones[0].solverPosition, rotation2); } public void Translate(Vector3 position, Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) MovePosition(position); MoveRotation(rotation); } public void TranslateRoot(Vector3 newRootPos, Quaternion newRootRot) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) Vector3 val = newRootPos - rootPosition; rootPosition = newRootPos; VirtualBone[] array = bones; foreach (VirtualBone obj in array) { obj.solverPosition += val; } Quaternion rotation = QuaTools.FromToRotation(rootRotation, newRootRot); rootRotation = newRootRot; VirtualBone.RotateAroundPoint(bones, 0, newRootPos, rotation); } public void RotateTo(VirtualBone bone, Quaternion rotation, float weight = 1f) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } Quaternion val = QuaTools.FromToRotation(bone.solverRotation, rotation); if (weight < 1f) { val = Quaternion.Slerp(Quaternion.identity, val, weight); } for (int i = 0; i < bones.Length; i++) { if (bones[i] == bone) { VirtualBone.RotateAroundPoint(bones, i, bones[i].solverPosition, val); break; } } } public void Visualize(Color color) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < bones.Length - 1; i++) { Debug.DrawLine(bones[i].solverPosition, bones[i + 1].solverPosition, color); } } public void Visualize() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Visualize(Color.white); } } [Serializable] public class Footstep { public float stepSpeed = 3f; public Vector3 characterSpaceOffset; public Vector3 position; public Quaternion rotation = Quaternion.identity; public Quaternion stepToRootRot = Quaternion.identity; public bool isSupportLeg; public bool relaxFlag; public Vector3 stepFrom; public Vector3 stepTo; public Quaternion stepFromRot = Quaternion.identity; public Quaternion stepToRot = Quaternion.identity; private Quaternion footRelativeToRoot = Quaternion.identity; private float supportLegW; private float supportLegWV; public bool isStepping => stepProgress < 1f; public float stepProgress { get; private set; } public Footstep(Quaternion rootRotation, Vector3 footPosition, Quaternion footRotation, Vector3 characterSpaceOffset) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) this.characterSpaceOffset = characterSpaceOffset; Reset(rootRotation, footPosition, footRotation); footRelativeToRoot = Quaternion.Inverse(rootRotation) * rotation; } public void Reset(Quaternion rootRotation, Vector3 footPosition, Quaternion footRotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) position = footPosition; rotation = footRotation; stepFrom = position; stepTo = position; stepFromRot = rotation; stepToRot = rotation; stepToRootRot = rootRotation; stepProgress = 1f; } public void StepTo(Vector3 p, Quaternion rootRotation, float stepThreshold) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (relaxFlag) { stepThreshold = 0f; relaxFlag = false; } if (!(Vector3.Magnitude(p - stepTo) < stepThreshold) || !(Quaternion.Angle(rootRotation, stepToRootRot) < 25f)) { stepFrom = position; stepTo = p; stepFromRot = rotation; stepToRootRot = rootRotation; stepToRot = rootRotation * footRelativeToRoot; stepProgress = 0f; } } public void UpdateStepping(Vector3 p, Quaternion rootRotation, float speed) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) stepTo = Vector3.Lerp(stepTo, p, Time.deltaTime * speed); stepToRot = Quaternion.Lerp(stepToRot, rootRotation * footRelativeToRoot, Time.deltaTime * speed); stepToRootRot = stepToRot * Quaternion.Inverse(footRelativeToRoot); } public void UpdateStanding(Quaternion rootRotation, float minAngle, float speed) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (!(speed <= 0f) && !(minAngle >= 180f)) { Quaternion val = rootRotation * footRelativeToRoot; float num = Quaternion.Angle(rotation, val); if (num > minAngle) { rotation = Quaternion.RotateTowards(rotation, val, Mathf.Min(Time.deltaTime * speed * (1f - supportLegW), num - minAngle)); } } } public void Update(InterpolationMode interpolation, UnityEvent onStep) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) float num = (isSupportLeg ? 1f : 0f); supportLegW = Mathf.SmoothDamp(supportLegW, num, ref supportLegWV, 0.2f); if (isStepping) { stepProgress = Mathf.MoveTowards(stepProgress, 1f, Time.deltaTime * stepSpeed); if (stepProgress >= 1f) { onStep.Invoke(); } float num2 = Interp.Float(stepProgress, interpolation); position = Vector3.Lerp(stepFrom, stepTo, num2); rotation = Quaternion.Lerp(stepFromRot, stepToRot, num2); } } } [Serializable] public class Leg : BodyPart { [Tooltip("The foot/toe target. This should not be the foot tracker itself, but a child GameObject parented to it so you could adjust it's position/rotation to match the orientation of the foot/toe bone. If a toe bone is assigned in the References, the solver will match the toe bone to this target. If no toe bone assigned, foot bone will be used instead.")] public Transform target; [Tooltip("The knee will be bent towards this Transform if 'Bend Goal Weight' > 0.")] public Transform bendGoal; [Tooltip("Positional weight of the toe/foot target. Note that if you have nulled the target, the foot will still be pulled to the last position of the target until you set this value to 0.")] [Range(0f, 1f)] public float positionWeight; [Tooltip("Rotational weight of the toe/foot target. Note that if you have nulled the target, the foot will still be rotated to the last rotation of the target until you set this value to 0.")] [Range(0f, 1f)] public float rotationWeight; [Tooltip("If greater than 0, will bend the knee towards the 'Bend Goal' Transform.")] [Range(0f, 1f)] public float bendGoalWeight; [Tooltip("Angular offset of knee bending direction.")] [Range(-180f, 180f)] public float swivelOffset; [Tooltip("If 0, the bend plane will be locked to the rotation of the pelvis and rotating the foot will have no effect on the knee direction. If 1, to the target rotation of the leg so that the knee will bend towards the forward axis of the foot. Values in between will be slerped between the two.")] [Range(0f, 1f)] public float bendToTargetWeight = 0.5f; [Tooltip("Use this to make the leg shorter/longer. Works by displacement of foot and calf localPosition.")] [Range(0.01f, 2f)] public float legLengthMlp = 1f; [Tooltip("Evaluates stretching of the leg by target distance relative to leg length. Value at time 1 represents stretching amount at the point where distance to the target is equal to leg length. Value at time 1 represents stretching amount at the point where distance to the target is double the leg length. Value represents the amount of stretching. Linear stretching would be achieved with a linear curve going up by 45 degrees. Increase the range of stretching by moving the last key up and right at the same amount. Smoothing in the curve can help reduce knee snapping (start stretching the arm slightly before target distance reaches leg length). To get a good optimal value for this curve, please go to the 'VRIK (Basic)' demo scene and copy the stretch curve over from the Pilot character.")] public AnimationCurve stretchCurve = new AnimationCurve(); [NonSerialized] [HideInInspector] public Vector3 IKPosition; [NonSerialized] [HideInInspector] public Quaternion IKRotation = Quaternion.identity; [NonSerialized] [HideInInspector] public Vector3 footPositionOffset; [NonSerialized] [HideInInspector] public Vector3 heelPositionOffset; [NonSerialized] [HideInInspector] public Quaternion footRotationOffset = Quaternion.identity; [NonSerialized] [HideInInspector] public float currentMag; [HideInInspector] public bool useAnimatedBendNormal; private Vector3 footPosition; private Quaternion footRotation = Quaternion.identity; private Vector3 bendNormal; private Quaternion calfRelToThigh = Quaternion.identity; private Quaternion thighRelToFoot = Quaternion.identity; private Vector3 bendNormalRelToPelvis; private Vector3 bendNormalRelToTarget; public Vector3 position { get; private set; } public Quaternion rotation { get; private set; } public bool hasToes { get; private set; } public VirtualBone thigh => bones[0]; private VirtualBone calf => bones[1]; private VirtualBone foot => bones[2]; private VirtualBone toes => bones[3]; public VirtualBone lastBone => bones[bones.Length - 1]; public Vector3 thighRelativeToPelvis { get; private set; } protected override void OnRead(Vector3[] positions, Quaternion[] rotations, bool hasChest, bool hasNeck, bool hasShoulders, bool hasToes, bool hasLegs, int rootIndex, int index) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) Vector3 val = positions[index]; Quaternion val2 = rotations[index]; Vector3 val3 = positions[index + 1]; Quaternion val4 = rotations[index + 1]; Vector3 val5 = positions[index + 2]; Quaternion iKRotation = rotations[index + 2]; Vector3 iKPosition = positions[index + 3]; Quaternion iKRotation2 = rotations[index + 3]; if (!initiated) { this.hasToes = hasToes; bones = new VirtualBone[hasToes ? 4 : 3]; if (hasToes) { bones[0] = new VirtualBone(val, val2); bones[1] = new VirtualBone(val3, val4); bones[2] = new VirtualBone(val5, iKRotation); bones[3] = new VirtualBone(iKPosition, iKRotation2); IKPosition = iKPosition; IKRotation = iKRotation2; } else { bones[0] = new VirtualBone(val, val2); bones[1] = new VirtualBone(val3, val4); bones[2] = new VirtualBone(val5, iKRotation); IKPosition = val5; IKRotation = iKRotation; } bendNormal = Vector3.Cross(val3 - val, val5 - val3); bendNormalRelToPelvis = Quaternion.Inverse(rootRotation) * bendNormal; bendNormalRelToTarget = Quaternion.Inverse(IKRotation) * bendNormal; rotation = IKRotation; } if (hasToes) { bones[0].Read(val, val2); bones[1].Read(val3, val4); bones[2].Read(val5, iKRotation); bones[3].Read(iKPosition, iKRotation2); } else { bones[0].Read(val, val2); bones[1].Read(val3, val4); bones[2].Read(val5, iKRotation); } } public override void PreSolve() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target != (Object)null) { IKPosition = target.position; IKRotation = target.rotation; } footPosition = foot.solverPosition; footRotation = foot.solverRotation; position = lastBone.solverPosition; rotation = lastBone.solverRotation; if (rotationWeight > 0f) { ApplyRotationOffset(QuaTools.FromToRotation(rotation, IKRotation), rotationWeight); } if (positionWeight > 0f) { ApplyPositionOffset(IKPosition - position, positionWeight); } thighRelativeToPelvis = Quaternion.Inverse(rootRotation) * (thigh.solverPosition - rootPosition); calfRelToThigh = Quaternion.Inverse(thigh.solverRotation) * calf.solverRotation; thighRelToFoot = Quaternion.Inverse(lastBone.solverRotation) * thigh.solverRotation; if (useAnimatedBendNormal) { bendNormal = Vector3.Cross(calf.solverPosition - thigh.solverPosition, foot.solverPosition - calf.solverPosition); } else if (bendToTargetWeight <= 0f) { bendNormal = rootRotation * bendNormalRelToPelvis; } else if (bendToTargetWeight >= 1f) { bendNormal = rotation * bendNormalRelToTarget; } else { bendNormal = Vector3.Slerp(rootRotation * bendNormalRelToPelvis, rotation * bendNormalRelToTarget, bendToTargetWeight); } bendNormal = ((Vector3)(ref bendNormal)).normalized; } public override void ApplyOffsets(float scale) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) ApplyPositionOffset(footPositionOffset, 1f); ApplyRotationOffset(footRotationOffset, 1f); Quaternion val = Quaternion.FromToRotation(footPosition - position, footPosition + heelPositionOffset - position); footPosition = position + val * (footPosition - position); footRotation = val * footRotation; float num = 0f; if ((Object)(object)bendGoal != (Object)null && bendGoalWeight > 0f) { Vector3 val2 = Vector3.Cross(bendGoal.position - thigh.solverPosition, position - thigh.solverPosition); Vector3 val3 = Quaternion.Inverse(Quaternion.LookRotation(bendNormal, thigh.solverPosition - foot.solverPosition)) * val2; num = Mathf.Atan2(val3.x, val3.z) * 57.29578f * bendGoalWeight; } float num2 = swivelOffset + num; if (num2 != 0f) { bendNormal = Quaternion.AngleAxis(num2, thigh.solverPosition - lastBone.solverPosition) * bendNormal; thigh.solverRotation = Quaternion.AngleAxis(0f - num2, thigh.solverRotation * thigh.axis) * thigh.solverRotation; } } private void ApplyPositionOffset(Vector3 offset, float weight) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { offset *= weight; footPosition += offset; position += offset; } } private void ApplyRotationOffset(Quaternion offset, float weight) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { if (weight < 1f) { offset = Quaternion.Lerp(Quaternion.identity, offset, weight); } footRotation = offset * footRotation; rotation = offset * rotation; bendNormal = offset * bendNormal; footPosition = position + offset * (footPosition - position); } } public void Solve(bool stretch) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) if (stretch && LOD < 1) { Stretching(); } VirtualBone.SolveTrigonometric(bones, 0, 1, 2, footPosition, bendNormal, 1f); RotateTo(foot, footRotation); if (!hasToes) { FixTwistRotations(); return; } Vector3 val = Vector3.Cross(foot.solverPosition - thigh.solverPosition, toes.solverPosition - foot.solverPosition); Vector3 normalized = ((Vector3)(ref val)).normalized; VirtualBone.SolveTrigonometric(bones, 0, 2, 3, position, normalized, 1f); FixTwistRotations(); toes.solverRotation = rotation; } private void FixTwistRotations() { //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) if (LOD >= 1) { return; } if (bendToTargetWeight > 0f) { Quaternion val = rotation * thighRelToFoot; Quaternion val2 = Quaternion.FromToRotation(val * thigh.axis, calf.solverPosition - thigh.solverPosition); if (bendToTargetWeight < 1f) { thigh.solverRotation = Quaternion.Slerp(thigh.solverRotation, val2 * val, bendToTargetWeight); } else { thigh.solverRotation = val2 * val; } } Quaternion val3 = thigh.solverRotation * calfRelToThigh; Quaternion val4 = Quaternion.FromToRotation(val3 * calf.axis, foot.solverPosition - calf.solverPosition); calf.solverRotation = val4 * val3; } private void Stretching() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) float num = thigh.length + calf.length; Vector3 zero = Vector3.zero; Vector3 zero2 = Vector3.zero; if (legLengthMlp != 1f) { num *= legLengthMlp; zero = (calf.solverPosition - thigh.solverPosition) * (legLengthMlp - 1f) * positionWeight; zero2 = (foot.solverPosition - calf.solverPosition) * (legLengthMlp - 1f) * positionWeight; VirtualBone virtualBone = calf; virtualBone.solverPosition += zero; VirtualBone virtualBone2 = foot; virtualBone2.solverPosition += zero + zero2; if (hasToes) { VirtualBone virtualBone3 = toes; virtualBone3.solverPosition += zero + zero2; } } float num2 = Vector3.Distance(thigh.solverPosition, footPosition) / num; float num3 = stretchCurve.Evaluate(num2) * positionWeight; zero = (calf.solverPosition - thigh.solverPosition) * num3; zero2 = (foot.solverPosition - calf.solverPosition) * num3; VirtualBone virtualBone4 = calf; virtualBone4.solverPosition += zero; VirtualBone virtualBone5 = foot; virtualBone5.solverPosition += zero + zero2; if (hasToes) { VirtualBone virtualBone6 = toes; virtualBone6.solverPosition += zero + zero2; } } public override void Write(ref Vector3[] solvedPositions, ref Quaternion[] solvedRotations) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) solvedRotations[index] = thigh.solverRotation; solvedRotations[index + 1] = calf.solverRotation; solvedRotations[index + 2] = foot.solverRotation; solvedPositions[index] = thigh.solverPosition; solvedPositions[index + 1] = calf.solverPosition; solvedPositions[index + 2] = foot.solverPosition; if (hasToes) { solvedRotations[index + 3] = toes.solverRotation; solvedPositions[index + 3] = toes.solverPosition; } } public override void ResetOffsets() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) footPositionOffset = Vector3.zero; footRotationOffset = Quaternion.identity; heelPositionOffset = Vector3.zero; } } [Serializable] public class Locomotion { [Tooltip("Used for blending in/out of procedural locomotion.")] [Range(0f, 1f)] public float weight = 1f; [Tooltip("Tries to maintain this distance between the legs.")] public float footDistance = 0.3f; [Tooltip("Makes a step only if step target position is at least this far from the current footstep or the foot does not reach the current footstep anymore or footstep angle is past the 'Angle Threshold'.")] public float stepThreshold = 0.4f; [Tooltip("Makes a step only if step target position is at least 'Step Threshold' far from the current footstep or the foot does not reach the current footstep anymore or footstep angle is past this value.")] public float angleThreshold = 60f; [Tooltip("Multiplies angle of the center of mass - center of pressure vector. Larger value makes the character step sooner if losing balance.")] public float comAngleMlp = 1f; [Tooltip("Maximum magnitude of head/hand target velocity used in prediction.")] public float maxVelocity = 0.4f; [Tooltip("The amount of head/hand target velocity prediction.")] public float velocityFactor = 0.4f; [Tooltip("How much can a leg be extended before it is forced to step to another position? 1 means fully stretched.")] [Range(0.9f, 1f)] public float maxLegStretch = 1f; [Tooltip("The speed of lerping the root of the character towards the horizontal mid-point of the footsteps.")] public float rootSpeed = 20f; [Tooltip("The speed of moving a foot to the next position.")] public float stepSpeed = 3f; [Tooltip("The height of the foot by normalized step progress (0 - 1).")] public AnimationCurve stepHeight; [Tooltip("Reduce this value if locomotion makes the head bob too much.")] public float maxBodyYOffset = 0.05f; [Tooltip("The height offset of the heel by normalized step progress (0 - 1).")] public AnimationCurve heelHeight; [Tooltip("Rotates the foot while the leg is not stepping to relax the twist rotation of the leg if ideal rotation is past this angle.")] [Range(0f, 180f)] public float relaxLegTwistMinAngle = 20f; [Tooltip("The speed of rotating the foot while the leg is not stepping to relax the twist rotation of the leg.")] public float relaxLegTwistSpeed = 400f; [Tooltip("Interpolation mode of the step.")] public InterpolationMode stepInterpolation = InterpolationMode.InOutSine; [Tooltip("Offset for the approximated center of mass.")] public Vector3 offset; [HideInInspector] public bool blockingEnabled; [HideInInspector] public LayerMask blockingLayers; [HideInInspector] public float raycastRadius = 0.2f; [HideInInspector] public float raycastHeight = 0.2f; [Tooltip("Called when the left foot has finished a step.")] public UnityEvent onLeftFootstep = new UnityEvent(); [Tooltip("Called when the right foot has finished a step")] public UnityEvent onRightFootstep = new UnityEvent(); private Footstep[] footsteps = new Footstep[0]; private Vector3 lastComPosition; private Vector3 comVelocity; private int leftFootIndex; private int rightFootIndex; public Vector3 centerOfMass { get; private set; } public Vector3 leftFootstepPosition => footsteps[0].position; public Vector3 rightFootstepPosition => footsteps[1].position; public Quaternion leftFootstepRotation => footsteps[0].rotation; public Quaternion rightFootstepRotation => footsteps[1].rotation; public void Initiate(Vector3[] positions, Quaternion[] rotations, bool hasToes, float scale) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) leftFootIndex = (hasToes ? 17 : 16); rightFootIndex = (hasToes ? 21 : 20); footsteps = new Footstep[2] { new Footstep(rotations[0], positions[leftFootIndex], rotations[leftFootIndex], footDistance * scale * Vector3.left), new Footstep(rotations[0], positions[rightFootIndex], rotations[rightFootIndex], footDistance * scale * Vector3.right) }; } public void Reset(Vector3[] positions, Quaternion[] rotations) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) lastComPosition = Vector3.Lerp(positions[1], positions[5], 0.25f) + rotations[0] * offset; comVelocity = Vector3.zero; footsteps[0].Reset(rotations[0], positions[leftFootIndex], rotations[leftFootIndex]); footsteps[1].Reset(rotations[0], positions[rightFootIndex], rotations[rightFootIndex]); } public void Relax() { footsteps[0].relaxFlag = true; footsteps[1].relaxFlag = true; } public void AddDeltaRotation(Quaternion delta, Vector3 pivot) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) Vector3 val = lastComPosition - pivot; lastComPosition = pivot + delta * val; Footstep[] array = footsteps; foreach (Footstep footstep in array) { footstep.rotation = delta * footstep.rotation; footstep.stepFromRot = delta * footstep.stepFromRot; footstep.stepToRot = delta * footstep.stepToRot; footstep.stepToRootRot = delta * footstep.stepToRootRot; Vector3 val2 = footstep.position - pivot; footstep.position = pivot + delta * val2; Vector3 val3 = footstep.stepFrom - pivot; footstep.stepFrom = pivot + delta * val3; Vector3 val4 = footstep.stepTo - pivot; footstep.stepTo = pivot + delta * val4; } } public void AddDeltaPosition(Vector3 delta) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) lastComPosition += delta; Footstep[] array = footsteps; foreach (Footstep obj in array) { obj.position += delta; obj.stepFrom += delta; obj.stepTo += delta; } } public void Solve(VirtualBone rootBone, Spine spine, Leg leftLeg, Leg rightLeg, Arm leftArm, Arm rightArm, int supportLegIndex, out Vector3 leftFootPosition, out Vector3 rightFootPosition, out Quaternion leftFootRotation, out Quaternion rightFootRotation, out float leftFootOffset, out float rightFootOffset, out float leftHeelOffset, out float rightHeelOffset, float scale) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_071b: Unknown result type (might be due to invalid IL or missing references) //IL_0720: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_0734: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Unknown result type (might be due to invalid IL or missing references) //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_073f: Unknown result type (might be due to invalid IL or missing references) //IL_0748: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Unknown result type (might be due to invalid IL or missing references) //IL_0759: Unknown result type (might be due to invalid IL or missing references) //IL_075a: Unknown result type (might be due to invalid IL or missing references) //IL_075f: Unknown result type (might be due to invalid IL or missing references) //IL_07e6: Unknown result type (might be due to invalid IL or missing references) //IL_07eb: Unknown result type (might be due to invalid IL or missing references) //IL_07fa: Unknown result type (might be due to invalid IL or missing references) //IL_07ff: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_066c: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_0537: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { leftFootPosition = Vector3.zero; rightFootPosition = Vector3.zero; leftFootRotation = Quaternion.identity; rightFootRotation = Quaternion.identity; leftFootOffset = 0f; rightFootOffset = 0f; leftHeelOffset = 0f; rightHeelOffset = 0f; return; } Vector3 val = rootBone.solverRotation * Vector3.up; Vector3 val2 = spine.pelvis.solverPosition + spine.pelvis.solverRotation * leftLeg.thighRelativeToPelvis; Vector3 val3 = spine.pelvis.solverPosition + spine.pelvis.solverRotation * rightLeg.thighRelativeToPelvis; footsteps[0].characterSpaceOffset = footDistance * Vector3.left * scale; footsteps[1].characterSpaceOffset = footDistance * Vector3.right * scale; Vector3 faceDirection = spine.faceDirection; Vector3 val4 = V3Tools.ExtractVertical(faceDirection, val, 1f); Quaternion val5 = Quaternion.LookRotation(faceDirection - val4, val); if (spine.rootHeadingOffset != 0f) { val5 = Quaternion.AngleAxis(spine.rootHeadingOffset, val) * val5; } float num = 1f; float num2 = 1f; float num3 = 0.2f; float num4 = num + num2 + 2f * num3; centerOfMass = Vector3.zero; centerOfMass += spine.pelvis.solverPosition * num; centerOfMass += spine.head.solverPosition * num2; centerOfMass += leftArm.position * num3; centerOfMass += rightArm.position * num3; centerOfMass /= num4; centerOfMass += rootBone.solverRotation * offset; comVelocity = ((Time.deltaTime > 0f) ? ((centerOfMass - lastComPosition) / Time.deltaTime) : Vector3.zero); lastComPosition = centerOfMass; comVelocity = Vector3.ClampMagnitude(comVelocity, maxVelocity) * velocityFactor * scale; Vector3 val6 = centerOfMass + comVelocity; Vector3 val7 = V3Tools.PointToPlane(spine.pelvis.solverPosition, rootBone.solverPosition, val); Vector3 val8 = V3Tools.PointToPlane(val6, rootBone.solverPosition, val); Vector3 val9 = Vector3.Lerp(footsteps[0].position, footsteps[1].position, 0.5f); float num5 = Vector3.Angle(val6 - val9, rootBone.solverRotation * Vector3.up) * comAngleMlp; for (int i = 0; i < footsteps.Length; i++) { footsteps[i].isSupportLeg = supportLegIndex == i; } for (int j = 0; j < footsteps.Length; j++) { if (footsteps[j].isStepping) { Vector3 val10 = val8 + rootBone.solverRotation * footsteps[j].characterSpaceOffset; if (!StepBlocked(footsteps[j].stepFrom, val10, rootBone.solverPosition)) { footsteps[j].UpdateStepping(val10, val5, 10f); } } else { footsteps[j].UpdateStanding(val5, relaxLegTwistMinAngle, relaxLegTwistSpeed); } } if (CanStep()) { int num6 = -1; float num7 = float.NegativeInfinity; for (int k = 0; k < footsteps.Length; k++) { if (footsteps[k].isStepping) { continue; } Vector3 val11 = val8 + rootBone.solverRotation * footsteps[k].characterSpaceOffset; float num8 = ((k == 0) ? leftLeg.mag : rightLeg.mag); Vector3 val12 = ((k == 0) ? val2 : val3); float num9 = Vector3.Distance(footsteps[k].position, val12); bool flag = false; if (num9 >= num8 * maxLegStretch) { val11 = val7 + rootBone.solverRotation * footsteps[k].characterSpaceOffset; flag = true; } bool flag2 = false; for (int l = 0; l < footsteps.Length; l++) { if (l == k || flag) { continue; } if (Vector3.Distance(footsteps[k].position, footsteps[l].position) < 0.25f * scale) { Vector3 val13 = footsteps[k].position - val11; float sqrMagnitude = ((Vector3)(ref val13)).sqrMagnitude; val13 = footsteps[l].position - val11; if (sqrMagnitude < ((Vector3)(ref val13)).sqrMagnitude) { goto IL_0556; } } flag2 = GetLineSphereCollision(footsteps[k].position, val11, footsteps[l].position, 0.25f * scale); goto IL_0556; IL_0556: if (flag2) { break; } } float num10 = Quaternion.Angle(val5, footsteps[k].stepToRootRot); if (flag2 && !(num10 > angleThreshold)) { continue; } float num11 = Vector3.Distance(footsteps[k].position, val11); float num12 = stepThreshold * scale; if (footsteps[k].relaxFlag) { num12 = 0f; } float num13 = Mathf.Lerp(num12, num12 * 0.1f, num5 * 0.015f); if (flag) { num13 *= 0.5f; } if (k == 0) { num13 *= 0.9f; } if (!StepBlocked(footsteps[k].position, val11, rootBone.solverPosition) && (num11 > num13 || num10 > angleThreshold)) { float num14 = 0f; num14 -= num11; if (num14 > num7) { num6 = k; num7 = num14; } } } if (num6 != -1) { Vector3 p = val8 + rootBone.solverRotation * footsteps[num6].characterSpaceOffset; footsteps[num6].stepSpeed = Random.Range(stepSpeed, stepSpeed * 1.5f); footsteps[num6].StepTo(p, val5, stepThreshold * scale); } } footsteps[0].Update(stepInterpolation, onLeftFootstep); footsteps[1].Update(stepInterpolation, onRightFootstep); leftFootPosition = footsteps[0].position; rightFootPosition = footsteps[1].position; leftFootPosition = V3Tools.PointToPlane(leftFootPosition, leftLeg.lastBone.readPosition, val); rightFootPosition = V3Tools.PointToPlane(rightFootPosition, rightLeg.lastBone.readPosition, val); leftFootOffset = stepHeight.Evaluate(footsteps[0].stepProgress) * scale; rightFootOffset = stepHeight.Evaluate(footsteps[1].stepProgress) * scale; leftHeelOffset = heelHeight.Evaluate(footsteps[0].stepProgress) * scale; rightHeelOffset = heelHeight.Evaluate(footsteps[1].stepProgress) * scale; leftFootRotation = footsteps[0].rotation; rightFootRotation = footsteps[1].rotation; } private bool StepBlocked(Vector3 fromPosition, Vector3 toPosition, Vector3 rootPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (LayerMask.op_Implicit(blockingLayers) == -1 || !blockingEnabled) { return false; } Vector3 val = fromPosition; val.y = rootPosition.y + raycastHeight + raycastRadius; Vector3 val2 = toPosition - val; val2.y = 0f; RaycastHit val3 = default(RaycastHit); if (raycastRadius <= 0f) { return Physics.Raycast(val, val2, ref val3, ((Vector3)(ref val2)).magnitude, LayerMask.op_Implicit(blockingLayers)); } return Physics.SphereCast(val, raycastRadius, val2, ref val3, ((Vector3)(ref val2)).magnitude, LayerMask.op_Implicit(blockingLayers)); } private bool CanStep() { Footstep[] array = footsteps; foreach (Footstep footstep in array) { if (footstep.isStepping && footstep.stepProgress < 0.8f) { return false; } } return true; } private static bool GetLineSphereCollision(Vector3 lineStart, Vector3 lineEnd, Vector3 sphereCenter, float sphereRadius) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = lineEnd - lineStart; Vector3 val2 = sphereCenter - lineStart; float num = ((Vector3)(ref val2)).magnitude - sphereRadius; if (num > ((Vector3)(ref val)).magnitude) { return false; } Vector3 val3 = Quaternion.Inverse(Quaternion.LookRotation(val, val2)) * val2; if (val3.z < 0f) { return num < 0f; } return val3.y - sphereRadius < 0f; } } [Serializable] public class Spine : BodyPart { [Tooltip("The head target. This should not be the camera Transform itself, but a child GameObject parented to it so you could adjust it's position/rotation to match the orientation of the head bone. The best practice for setup would be to move the camera to the avatar's eyes, duplicate the avatar's head bone and parent it to the camera. Then assign the duplicate to this slot.")] public Transform headTarget; [Tooltip("The pelvis target (optional), useful for seated rigs or if you had an additional tracker on the backpack or belt are. The best practice for setup would be to duplicate the avatar's pelvis bone and parenting it to the pelvis tracker. Then assign the duplicate to this slot.")] public Transform pelvisTarget; [Tooltip("Positional weight of the head target. Note that if you have nulled the headTarget, the head will still be pulled to the last position of the headTarget until you set this value to 0.")] [Range(0f, 1f)] public float positionWeight = 1f; [Tooltip("Rotational weight of the head target. Note that if you have nulled the headTarget, the head will still be rotated to the last rotation of the headTarget until you set this value to 0.")] [Range(0f, 1f)] public float rotationWeight = 1f; [Tooltip("Positional weight of the pelvis target. Note that if you have nulled the pelvisTarget, the pelvis will still be pulled to the last position of the pelvisTarget until you set this value to 0.")] [Range(0f, 1f)] public float pelvisPositionWeight; [Tooltip("Rotational weight of the pelvis target. Note that if you have nulled the pelvisTarget, the pelvis will still be rotated to the last rotation of the pelvisTarget until you set this value to 0.")] [Range(0f, 1f)] public float pelvisRotationWeight; [Tooltip("If 'Chest Goal Weight' is greater than 0, the chest will be turned towards this Transform.")] public Transform chestGoal; [Tooltip("Weight of turning the chest towards the 'Chest Goal'.")] [Range(0f, 1f)] public float chestGoalWeight; [Tooltip("Minimum height of the head from the root of the character.")] public float minHeadHeight = 0.8f; [Tooltip("Determines how much the body will follow the position of the head.")] [Range(0f, 1f)] public float bodyPosStiffness = 0.55f; [Tooltip("Determines how much the body will follow the rotation of the head.")] [Range(0f, 1f)] public float bodyRotStiffness = 0.1f; [Tooltip("Determines how much the chest will rotate to the rotation of the head.")] [FormerlySerializedAs("chestRotationWeight")] [Range(0f, 1f)] public float neckStiffness = 0.2f; [Tooltip("The amount of rotation applied to the chest based on hand positions.")] [Range(0f, 1f)] public float rotateChestByHands = 1f; [Tooltip("Clamps chest rotation. Value of 0.5 allows 90 degrees of rotation for the chest relative to the head. Value of 0 allows 180 degrees and value of 1 means the chest will be locked relative to the head.")] [Range(0f, 1f)] public float chestClampWeight = 0.5f; [Tooltip("Clamps head rotation. Value of 0.5 allows 90 degrees of rotation for the head relative to the headTarget. Value of 0 allows 180 degrees and value of 1 means head rotation will be locked to the target.")] [Range(0f, 1f)] public float headClampWeight = 0.6f; [Tooltip("Moves the body horizontally along -character.forward axis by that value when the player is crouching.")] public float moveBodyBackWhenCrouching = 0.5f; [Tooltip("How much will the pelvis maintain it's animated position?")] [Range(0f, 1f)] public float maintainPelvisPosition = 0.2f; [Tooltip("Will automatically rotate the root of the character if the head target has turned past this angle.")] [Range(0f, 180f)] public float maxRootAngle = 25f; [Tooltip("Angular offset for root heading. Adjust this value to turn the root relative to the HMD around the vertical axis. Usefulf for fighting or shooting games where you would sometimes want the avatar to stand at an angled stance.")] [Range(-180f, 180f)] public float rootHeadingOffset; [NonSerialized] [HideInInspector] public Vector3 IKPositionHead; [NonSerialized] [HideInInspector] public Quaternion IKRotationHead = Quaternion.identity; [NonSerialized] [HideInInspector] public Vector3 IKPositionPelvis; [NonSerialized] [HideInInspector] public Quaternion IKRotationPelvis = Quaternion.identity; [NonSerialized] [HideInInspector] public Vector3 goalPositionChest; [NonSerialized] [HideInInspector] public Vector3 pelvisPositionOffset; [NonSerialized] [HideInInspector] public Vector3 chestPositionOffset; [NonSerialized] [HideInInspector] public Vector3 headPositionOffset; [NonSerialized] [HideInInspector] public Quaternion pelvisRotationOffset = Quaternion.identity; [NonSerialized] [HideInInspector] public Quaternion chestRotationOffset = Quaternion.identity; [NonSerialized] [HideInInspector] public Quaternion headRotationOffset = Quaternion.identity; [NonSerialized] [HideInInspector] public Vector3 faceDirection; [NonSerialized] [HideInInspector] public Vector3 locomotionHeadPositionOffset; [NonSerialized] [HideInInspector] public Vector3 headPosition; private Quaternion headRotation = Quaternion.identity; private Quaternion pelvisRotation = Quaternion.identity; private Quaternion anchorRelativeToPelvis = Quaternion.identity; private Quaternion pelvisRelativeRotation = Quaternion.identity; private Quaternion chestRelativeRotation = Quaternion.identity; private Vector3 headDeltaPosition; private Quaternion pelvisDeltaRotation = Quaternion.identity; private Quaternion chestTargetRotation = Quaternion.identity; private int pelvisIndex; private int spineIndex = 1; private int chestIndex = -1; private int neckIndex = -1; private int headIndex = -1; private float length; private bool hasChest; private bool hasNeck; private bool hasLegs; private float headHeight; private float sizeMlp; private Vector3 chestForward; public VirtualBone pelvis => bones[pelvisIndex]; public VirtualBone firstSpineBone => bones[spineIndex]; public VirtualBone chest { get { if (hasChest) { return bones[chestIndex]; } return bones[spineIndex]; } } private VirtualBone neck => bones[neckIndex]; public VirtualBone head => bones[headIndex]; public Quaternion anchorRotation { get; private set; } public Quaternion anchorRelativeToHead { get; private set; } protected override void OnRead(Vector3[] positions, Quaternion[] rotations, bool hasChest, bool hasNeck, bool hasShoulders, bool hasToes, bool hasLegs, int rootIndex, int index) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) Vector3 val = positions[index]; Quaternion val2 = rotations[index]; Vector3 val3 = positions[index + 1]; Quaternion val4 = rotations[index + 1]; Vector3 val5 = positions[index + 2]; Quaternion val6 = rotations[index + 2]; Vector3 position = positions[index + 3]; Quaternion rotation = rotations[index + 3]; Vector3 val7 = positions[index + 4]; Quaternion val8 = rotations[index + 4]; this.hasLegs = hasLegs; if (!hasChest) { val5 = val3; val6 = val4; } if (!initiated) { this.hasChest = hasChest; this.hasNeck = hasNeck; Vector3 val9 = V3Tools.ExtractVertical(val7 - positions[0], rotations[0] * Vector3.up, 1f); headHeight = ((Vector3)(ref val9)).magnitude; int num = 3; if (hasChest) { num++; } if (hasNeck) { num++; } bones = new VirtualBone[num]; chestIndex = ((!hasChest) ? 1 : 2); neckIndex = 1; if (hasChest) { neckIndex++; } if (hasNeck) { neckIndex++; } headIndex = 2; if (hasChest) { headIndex++; } if (hasNeck) { headIndex++; } bones[0] = new VirtualBone(val, val2); bones[1] = new VirtualBone(val3, val4); if (hasChest) { bones[chestIndex] = new VirtualBone(val5, val6); } if (hasNeck) { bones[neckIndex] = new VirtualBone(position, rotation); } bones[headIndex] = new VirtualBone(val7, val8); pelvisRotationOffset = Quaternion.identity; chestRotationOffset = Quaternion.identity; headRotationOffset = Quaternion.identity; anchorRelativeToHead = Quaternion.Inverse(val8) * rotations[0]; anchorRelativeToPelvis = Quaternion.Inverse(val2) * rotations[0]; faceDirection = rotations[0] * Vector3.forward; IKPositionHead = val7; IKRotationHead = val8; IKPositionPelvis = val; IKRotationPelvis = val2; goalPositionChest = val5 + rotations[0] * Vector3.forward; } pelvisRelativeRotation = Quaternion.Inverse(val8) * val2; chestRelativeRotation = Quaternion.Inverse(val8) * val6; chestForward = Quaternion.Inverse(val6) * (rotations[0] * Vector3.forward); bones[0].Read(val, val2); bones[1].Read(val3, val4); if (hasChest) { bones[chestIndex].Read(val5, val6); } if (hasNeck) { bones[neckIndex].Read(position, rotation); } bones[headIndex].Read(val7, val8); float num2 = Vector3.Distance(val, val7); sizeMlp = num2 / 0.7f; } public override void PreSolve() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)headTarget != (Object)null) { IKPositionHead = headTarget.position; IKRotationHead = headTarget.rotation; } if ((Object)(object)chestGoal != (Object)null) { goalPositionChest = chestGoal.position; } if ((Object)(object)pelvisTarget != (Object)null) { IKPositionPelvis = pelvisTarget.position; IKRotationPelvis = pelvisTarget.rotation; } headPosition = V3Tools.Lerp(head.solverPosition, IKPositionHead, positionWeight); headRotation = QuaTools.Lerp(head.solverRotation, IKRotationHead, rotationWeight); pelvisRotation = QuaTools.Lerp(pelvis.solverRotation, IKRotationPelvis, rotationWeight); } public override void ApplyOffsets(float scale) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) headPosition += headPositionOffset; float num = minHeadHeight * scale; Vector3 val = rootRotation * Vector3.up; if (val == Vector3.up) { headPosition.y = Math.Max(rootPosition.y + num, headPosition.y); } else { Vector3 val2 = headPosition - rootPosition; Vector3 val3 = V3Tools.ExtractHorizontal(val2, val, 1f); Vector3 val4 = val2 - val3; if (Vector3.Dot(val4, val) > 0f) { if (((Vector3)(ref val4)).magnitude < num) { val4 = ((Vector3)(ref val4)).normalized * num; } } else { val4 = -((Vector3)(ref val4)).normalized * num; } headPosition = rootPosition + val3 + val4; } headRotation = headRotationOffset * headRotation; headDeltaPosition = headPosition - head.solverPosition; pelvisDeltaRotation = QuaTools.FromToRotation(pelvis.solverRotation, headRotation * pelvisRelativeRotation); if (pelvisRotationWeight <= 0f) { anchorRotation = headRotation * anchorRelativeToHead; } else if (pelvisRotationWeight > 0f && pelvisRotationWeight < 1f) { anchorRotation = Quaternion.Lerp(headRotation * anchorRelativeToHead, pelvisRotation * anchorRelativeToPelvis, pelvisRotationWeight); } else if (pelvisRotationWeight >= 1f) { anchorRotation = pelvisRotation * anchorRelativeToPelvis; } } private void CalculateChestTargetRotation(VirtualBone rootBone, Arm[] arms) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) chestTargetRotation = headRotation * chestRelativeRotation; AdjustChestByHands(ref chestTargetRotation, arms); faceDirection = Vector3.Cross(anchorRotation * Vector3.right, rootBone.readRotation * Vector3.up) + anchorRotation * Vector3.forward; } public void Solve(VirtualBone rootBone, Leg[] legs, Arm[] arms, float scale) { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) CalculateChestTargetRotation(rootBone, arms); if (maxRootAngle < 180f) { Vector3 val = faceDirection; if (rootHeadingOffset != 0f) { val = Quaternion.AngleAxis(rootHeadingOffset, Vector3.up) * val; } Vector3 val2 = Quaternion.Inverse(rootBone.solverRotation) * val; float num = Mathf.Atan2(val2.x, val2.z) * 57.29578f; float num2 = 0f; float num3 = maxRootAngle; if (num > num3) { num2 = num - num3; } if (num < 0f - num3) { num2 = num + num3; } rootBone.solverRotation = Quaternion.AngleAxis(num2, rootBone.readRotation * Vector3.up) * rootBone.solverRotation; } Vector3 solverPosition = pelvis.solverPosition; Vector3 rootUp = rootBone.solverRotation * Vector3.up; TranslatePelvis(legs, headDeltaPosition, pelvisDeltaRotation, scale); FABRIKPass(solverPosition, rootUp, positionWeight); Bend(bones, pelvisIndex, chestIndex, chestTargetRotation, chestRotationOffset, chestClampWeight, uniformWeight: false, neckStiffness * rotationWeight); if (LOD < 1 && chestGoalWeight > 0f) { Quaternion targetRotation = Quaternion.FromToRotation(bones[chestIndex].solverRotation * chestForward, goalPositionChest - bones[chestIndex].solverPosition) * bones[chestIndex].solverRotation; Bend(bones, pelvisIndex, chestIndex, targetRotation, chestRotationOffset, chestClampWeight, uniformWeight: false, chestGoalWeight * rotationWeight); } InverseTranslateToHead(legs, limited: false, useCurrentLegMag: false, Vector3.zero, positionWeight); if (LOD < 1) { FABRIKPass(solverPosition, rootUp, positionWeight); } Bend(bones, neckIndex, headIndex, headRotation, headClampWeight, uniformWeight: true, rotationWeight); SolvePelvis(); } private void FABRIKPass(Vector3 animatedPelvisPos, Vector3 rootUp, float weight) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Vector3 startPosition = Vector3.Lerp(pelvis.solverPosition, animatedPelvisPos, maintainPelvisPosition) + pelvisPositionOffset; Vector3 targetPosition = headPosition - chestPositionOffset; Vector3 zero = Vector3.zero; float num = Vector3.Distance(bones[0].solverPosition, bones[bones.Length - 1].solverPosition); VirtualBone.SolveFABRIK(bones, startPosition, targetPosition, weight, 1f, 1, num, zero); } private void SolvePelvis() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) if (pelvisPositionWeight > 0f) { Quaternion solverRotation = head.solverRotation; Vector3 val = (IKPositionPelvis + pelvisPositionOffset - pelvis.solverPosition) * pelvisPositionWeight; VirtualBone[] array = bones; foreach (VirtualBone obj in array) { obj.solverPosition += val; } Vector3 bendNormal = anchorRotation * Vector3.right; if (hasChest && hasNeck) { VirtualBone.SolveTrigonometric(bones, spineIndex, chestIndex, headIndex, headPosition, bendNormal, pelvisPositionWeight * 0.9f); VirtualBone.SolveTrigonometric(bones, chestIndex, neckIndex, headIndex, headPosition, bendNormal, pelvisPositionWeight); } else if (hasChest && !hasNeck) { VirtualBone.SolveTrigonometric(bones, spineIndex, chestIndex, headIndex, headPosition, bendNormal, pelvisPositionWeight); } else if (!hasChest && hasNeck) { VirtualBone.SolveTrigonometric(bones, spineIndex, neckIndex, headIndex, headPosition, bendNormal, pelvisPositionWeight); } else if (!hasNeck && !hasChest) { VirtualBone.SolveTrigonometric(bones, pelvisIndex, spineIndex, headIndex, headPosition, bendNormal, pelvisPositionWeight); } head.solverRotation = solverRotation; } } public override void Write(ref Vector3[] solvedPositions, ref Quaternion[] solvedRotations) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) solvedPositions[index] = bones[0].solverPosition; solvedRotations[index] = bones[0].solverRotation; solvedRotations[index + 1] = bones[1].solverRotation; if (hasChest) { solvedRotations[index + 2] = bones[chestIndex].solverRotation; } if (hasNeck) { solvedRotations[index + 3] = bones[neckIndex].solverRotation; } solvedRotations[index + 4] = bones[headIndex].solverRotation; } public override void ResetOffsets() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) pelvisPositionOffset = Vector3.zero; chestPositionOffset = Vector3.zero; headPositionOffset = locomotionHeadPositionOffset; pelvisRotationOffset = Quaternion.identity; chestRotationOffset = Quaternion.identity; headRotationOffset = Quaternion.identity; } private void AdjustChestByHands(ref Quaternion chestTargetRotation, Arm[] arms) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) if (LOD <= 0) { Quaternion val = Quaternion.Inverse(anchorRotation); Vector3 val2 = val * (arms[0].position - headPosition) / sizeMlp; Vector3 val3 = val * (arms[1].position - headPosition) / sizeMlp; Vector3 forward = Vector3.forward; forward.x += val2.x * Mathf.Abs(val2.x); forward.x += val2.z * Mathf.Abs(val2.z); forward.x += val3.x * Mathf.Abs(val3.x); forward.x -= val3.z * Mathf.Abs(val3.z); forward.x *= 5f * rotateChestByHands; Quaternion val4 = Quaternion.AngleAxis(Mathf.Atan2(forward.x, forward.z) * 57.29578f, rootRotation * Vector3.up); chestTargetRotation = val4 * chestTargetRotation; Vector3 up = Vector3.up; up.x += val2.y; up.x -= val3.y; up.x *= 0.5f * rotateChestByHands; val4 = Quaternion.AngleAxis(Mathf.Atan2(up.x, up.y) * 57.29578f, rootRotation * Vector3.back); chestTargetRotation = val4 * chestTargetRotation; } } public void InverseTranslateToHead(Leg[] legs, bool limited, bool useCurrentLegMag, Vector3 offset, float w) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (headPosition + offset - head.solverPosition) * w; Vector3 val2 = pelvis.solverPosition + val; MovePosition(limited ? LimitPelvisPosition(legs, val2, useCurrentLegMag) : val2); } private void TranslatePelvis(Leg[] legs, Vector3 deltaPosition, Quaternion deltaRotation, float scale) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) Vector3 solverPosition = head.solverPosition; deltaRotation = QuaTools.ClampRotation(deltaRotation, chestClampWeight, 2); Quaternion val = Quaternion.Slerp(Quaternion.identity, deltaRotation, bodyRotStiffness * rotationWeight); val = Quaternion.Slerp(val, QuaTools.FromToRotation(pelvis.solverRotation, IKRotationPelvis), pelvisRotationWeight); VirtualBone.RotateAroundPoint(bones, 0, pelvis.solverPosition, pelvisRotationOffset * val); deltaPosition -= head.solverPosition - solverPosition; Vector3 val2 = rootRotation * Vector3.forward; Vector3 val3 = V3Tools.ExtractVertical(deltaPosition, rootRotation * Vector3.up, 1f); float num = ((Vector3)(ref val3)).magnitude; if (scale > 0f) { num /= scale; } float num2 = num * (0f - moveBodyBackWhenCrouching) * headHeight; deltaPosition += val2 * num2; MovePosition(LimitPelvisPosition(legs, pelvis.solverPosition + deltaPosition * bodyPosStiffness * positionWeight, useCurrentLegMag: false)); } private Vector3 LimitPelvisPosition(Leg[] legs, Vector3 pelvisPosition, bool useCurrentLegMag, int it = 2) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) if (!hasLegs) { return pelvisPosition; } if (useCurrentLegMag) { Leg[] array = legs; foreach (Leg leg in array) { leg.currentMag = Vector3.Distance(leg.thigh.solverPosition, leg.lastBone.solverPosition); } } for (int j = 0; j < it; j++) { Leg[] array = legs; foreach (Leg leg2 in array) { Vector3 val = pelvisPosition - pelvis.solverPosition; Vector3 val2 = leg2.thigh.solverPosition + val; Vector3 val3 = val2 - leg2.position; float num = (useCurrentLegMag ? leg2.currentMag : leg2.mag); Vector3 val4 = leg2.position + Vector3.ClampMagnitude(val3, num); pelvisPosition += val4 - val2; } } return pelvisPosition; } private void Bend(VirtualBone[] bones, int firstIndex, int lastIndex, Quaternion targetRotation, float clampWeight, bool uniformWeight, float w) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) if (w <= 0f || bones.Length == 0) { return; } int num = lastIndex + 1 - firstIndex; if (num < 1) { return; } Quaternion rotation = QuaTools.FromToRotation(bones[lastIndex].solverRotation, targetRotation); rotation = QuaTools.ClampRotation(rotation, clampWeight, 2); float num2 = (uniformWeight ? (1f / (float)num) : 0f); for (int i = firstIndex; i < lastIndex + 1; i++) { if (!uniformWeight) { num2 = Mathf.Clamp((float)((i - firstIndex + 1) / num), 0f, 1f); } VirtualBone.RotateAroundPoint(bones, i, bones[i].solverPosition, Quaternion.Slerp(Quaternion.identity, rotation, num2 * w)); } } private void Bend(VirtualBone[] bones, int firstIndex, int lastIndex, Quaternion targetRotation, Quaternion rotationOffset, float clampWeight, bool uniformWeight, float w) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if (w <= 0f || bones.Length == 0) { return; } int num = lastIndex + 1 - firstIndex; if (num < 1) { return; } Quaternion rotation = QuaTools.FromToRotation(bones[lastIndex].solverRotation, targetRotation); rotation = QuaTools.ClampRotation(rotation, clampWeight, 2); float num2 = (uniformWeight ? (1f / (float)num) : 0f); for (int i = firstIndex; i < lastIndex + 1; i++) { if (!uniformWeight) { if (num == 1) { num2 = 1f; } else if (num == 2) { num2 = ((i == 0) ? 0.2f : 0.8f); } else if (num == 3) { num2 = i switch { 0 => 0.15f, 1 => 0.4f, _ => 0.45f, }; } else if (num > 3) { num2 = 1f / (float)num; } } VirtualBone.RotateAroundPoint(bones, i, bones[i].solverPosition, Quaternion.Slerp(Quaternion.Slerp(Quaternion.identity, rotationOffset, num2), rotation, num2 * w)); } } } [Serializable] public enum PositionOffset { Pelvis, Chest, Head, LeftHand, RightHand, LeftFoot, RightFoot, LeftHeel, RightHeel } [Serializable] public enum RotationOffset { Pelvis, Chest, Head } [Serializable] public class VirtualBone { public Vector3 readPosition; public Quaternion readRotation; public Vector3 solverPosition; public Quaternion solverRotation; public float length; public float sqrMag; public Vector3 axis; public VirtualBone(Vector3 position, Quaternion rotation) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) Read(position, rotation); } public void Read(Vector3 position, Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) readPosition = position; readRotation = rotation; solverPosition = position; solverRotation = rotation; } public static void SwingRotation(VirtualBone[] bones, int index, Vector3 swingTarget, float weight = 1f) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { Quaternion val = Quaternion.FromToRotation(bones[index].solverRotation * bones[index].axis, swingTarget - bones[index].solverPosition); if (weight < 1f) { val = Quaternion.Lerp(Quaternion.identity, val, weight); } for (int i = index; i < bones.Length; i++) { bones[i].solverRotation = val * bones[i].solverRotation; } } } public static float PreSolve(ref VirtualBone[] bones) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) float num = 0f; for (int i = 0; i < bones.Length; i++) { if (i < bones.Length - 1) { VirtualBone obj = bones[i]; Vector3 val = bones[i + 1].solverPosition - bones[i].solverPosition; obj.sqrMag = ((Vector3)(ref val)).sqrMagnitude; bones[i].length = Mathf.Sqrt(bones[i].sqrMag); num += bones[i].length; bones[i].axis = Quaternion.Inverse(bones[i].solverRotation) * (bones[i + 1].solverPosition - bones[i].solverPosition); } else { bones[i].sqrMag = 0f; bones[i].length = 0f; } } return num; } public static void RotateAroundPoint(VirtualBone[] bones, int index, Vector3 point, Quaternion rotation) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) for (int i = index; i < bones.Length; i++) { if (bones[i] != null) { Vector3 val = bones[i].solverPosition - point; bones[i].solverPosition = point + rotation * val; bones[i].solverRotation = rotation * bones[i].solverRotation; } } } public static void RotateBy(VirtualBone[] bones, int index, Quaternion rotation) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) for (int i = index; i < bones.Length; i++) { if (bones[i] != null) { Vector3 val = bones[i].solverPosition - bones[index].solverPosition; bones[i].solverPosition = bones[index].solverPosition + rotation * val; bones[i].solverRotation = rotation * bones[i].solverRotation; } } } public static void RotateBy(VirtualBone[] bones, Quaternion rotation) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < bones.Length; i++) { if (bones[i] != null) { if (i > 0) { Vector3 val = bones[i].solverPosition - bones[0].solverPosition; bones[i].solverPosition = bones[0].solverPosition + rotation * val; } bones[i].solverRotation = rotation * bones[i].solverRotation; } } } public static void RotateTo(VirtualBone[] bones, int index, Quaternion rotation) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation2 = QuaTools.FromToRotation(bones[index].solverRotation, rotation); RotateAroundPoint(bones, index, bones[index].solverPosition, rotation2); } public static void SolveTrigonometric(VirtualBone[] bones, int first, int second, int third, Vector3 targetPosition, Vector3 bendNormal, float weight) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } targetPosition = Vector3.Lerp(bones[third].solverPosition, targetPosition, weight); Vector3 val = targetPosition - bones[first].solverPosition; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude != 0f) { float directionMag = Mathf.Sqrt(sqrMagnitude); Vector3 val2 = bones[second].solverPosition - bones[first].solverPosition; float sqrMagnitude2 = ((Vector3)(ref val2)).sqrMagnitude; val2 = bones[third].solverPosition - bones[second].solverPosition; float sqrMagnitude3 = ((Vector3)(ref val2)).sqrMagnitude; Vector3 bendDirection = Vector3.Cross(val, bendNormal); Vector3 directionToBendPoint = GetDirectionToBendPoint(val, directionMag, bendDirection, sqrMagnitude2, sqrMagnitude3); Quaternion val3 = Quaternion.FromToRotation(bones[second].solverPosition - bones[first].solverPosition, directionToBendPoint); if (weight < 1f) { val3 = Quaternion.Lerp(Quaternion.identity, val3, weight); } RotateAroundPoint(bones, first, bones[first].solverPosition, val3); Quaternion val4 = Quaternion.FromToRotation(bones[third].solverPosition - bones[second].solverPosition, targetPosition - bones[second].solverPosition); if (weight < 1f) { val4 = Quaternion.Lerp(Quaternion.identity, val4, weight); } RotateAroundPoint(bones, second, bones[second].solverPosition, val4); } } private static Vector3 GetDirectionToBendPoint(Vector3 direction, float directionMag, Vector3 bendDirection, float sqrMag1, float sqrMag2) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) float num = (directionMag * directionMag + (sqrMag1 - sqrMag2)) / 2f / directionMag; float num2 = (float)Math.Sqrt(Mathf.Clamp(sqrMag1 - num * num, 0f, float.PositiveInfinity)); if (direction == Vector3.zero) { return Vector3.zero; } return Quaternion.LookRotation(direction, bendDirection) * new Vector3(0f, num2, num); } public static void SolveFABRIK(VirtualBone[] bones, Vector3 startPosition, Vector3 targetPosition, float weight, float minNormalizedTargetDistance, int iterations, float length, Vector3 startOffset) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } if (minNormalizedTargetDistance > 0f) { Vector3 val = targetPosition - startPosition; float magnitude = ((Vector3)(ref val)).magnitude; Vector3 val2 = startPosition + val / magnitude * Mathf.Max(length * minNormalizedTargetDistance, magnitude); targetPosition = Vector3.Lerp(targetPosition, val2, weight); } for (int i = 0; i < iterations; i++) { bones[^1].solverPosition = Vector3.Lerp(bones[^1].solverPosition, targetPosition, weight); for (int num = bones.Length - 2; num > -1; num--) { bones[num].solverPosition = SolveFABRIKJoint(bones[num].solverPosition, bones[num + 1].solverPosition, bones[num].length); } if (i == 0) { foreach (VirtualBone obj in bones) { obj.solverPosition += startOffset; } } bones[0].solverPosition = startPosition; for (int k = 1; k < bones.Length; k++) { bones[k].solverPosition = SolveFABRIKJoint(bones[k].solverPosition, bones[k - 1].solverPosition, bones[k - 1].length); } } for (int l = 0; l < bones.Length - 1; l++) { SwingRotation(bones, l, bones[l + 1].solverPosition); } } private static Vector3 SolveFABRIKJoint(Vector3 pos1, Vector3 pos2, float length) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pos1 - pos2; return pos2 + ((Vector3)(ref val)).normalized * length; } public static void SolveCCD(VirtualBone[] bones, Vector3 targetPosition, float weight, int iterations) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f) { return; } for (int i = 0; i < iterations; i++) { for (int num = bones.Length - 2; num > -1; num--) { Vector3 val = bones[^1].solverPosition - bones[num].solverPosition; Vector3 val2 = targetPosition - bones[num].solverPosition; Quaternion val3 = Quaternion.FromToRotation(val, val2); if (weight >= 1f) { RotateBy(bones, num, val3); } else { RotateBy(bones, num, Quaternion.Lerp(Quaternion.identity, val3, weight)); } } } } } private Transform[] solverTransforms = (Transform[])(object)new Transform[0]; private bool hasChest; private bool hasNeck; private bool hasShoulders; private bool hasToes; private bool hasLegs; private Vector3[] readPositions = (Vector3[])(object)new Vector3[0]; private Quaternion[] readRotations = (Quaternion[])(object)new Quaternion[0]; private Vector3[] solvedPositions = (Vector3[])(object)new Vector3[22]; private Quaternion[] solvedRotations = (Quaternion[])(object)new Quaternion[22]; private Quaternion[] defaultLocalRotations = (Quaternion[])(object)new Quaternion[21]; private Vector3[] defaultLocalPositions = (Vector3[])(object)new Vector3[21]; private Vector3 rootV; private Vector3 rootVelocity; private Vector3 bodyOffset; private int supportLegIndex; private int lastLOD; [Tooltip("LOD 0: Full quality solving. LOD 1: Shoulder solving, stretching plant feet disabled, spine solving quality reduced. This provides about 30% of performance gain. LOD 2: Culled, but updating root position and rotation if locomotion is enabled.")] [Range(0f, 2f)] public int LOD; [Tooltip("Scale of the character. Value of 1 means normal adult human size.")] public float scale = 1f; [Tooltip("If true, will keep the toes planted even if head target is out of reach, so this can cause the camera to exit the head if it is too high for the model to reach. Enabling this increases the cost of the solver as the legs will have to be solved multiple times.")] public bool plantFeet = true; [Tooltip("The spine solver.")] public Spine spine = new Spine(); [Tooltip("The left arm solver.")] public Arm leftArm = new Arm(); [Tooltip("The right arm solver.")] public Arm rightArm = new Arm(); [Tooltip("The left leg solver.")] public Leg leftLeg = new Leg(); [Tooltip("The right leg solver.")] public Leg rightLeg = new Leg(); [Tooltip("Procedural leg shuffling for stationary VR games. Not designed for roomscale and thumbstick locomotion. For those it would be better to use a strafing locomotion blend tree to make the character follow the horizontal direction towards the HMD by root motion or script.")] public Locomotion locomotion = new Locomotion(); private Leg[] legs = new Leg[2]; private Arm[] arms = new Arm[2]; private Vector3 headPosition; private Vector3 headDeltaPosition; private Vector3 raycastOriginPelvis; private Vector3 lastOffset; private Vector3 debugPos1; private Vector3 debugPos2; private Vector3 debugPos3; private Vector3 debugPos4; [HideInInspector] public VirtualBone rootBone { get; private set; } public void SetToReferences(VRIK.References references) { if (!references.isFilled) { Debug.LogError((object)"Invalid references, one or more Transforms are missing."); return; } solverTransforms = references.GetTransforms(); hasChest = (Object)(object)solverTransforms[3] != (Object)null; hasNeck = (Object)(object)solverTransforms[4] != (Object)null; hasShoulders = (Object)(object)solverTransforms[6] != (Object)null && (Object)(object)solverTransforms[10] != (Object)null; hasToes = (Object)(object)solverTransforms[17] != (Object)null && (Object)(object)solverTransforms[21] != (Object)null; hasLegs = (Object)(object)solverTransforms[14] != (Object)null; readPositions = (Vector3[])(object)new Vector3[solverTransforms.Length]; readRotations = (Quaternion[])(object)new Quaternion[solverTransforms.Length]; DefaultAnimationCurves(); GuessHandOrientations(references, onlyIfZero: true); } public void GuessHandOrientations(VRIK.References references, bool onlyIfZero) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) if (!references.isFilled) { Debug.LogWarning((object)"VRIK References are not filled in, can not guess hand orientations. Right-click on VRIK header and slect 'Guess Hand Orientations' when you have filled in the References.", (Object)(object)references.root); return; } if (leftArm.wristToPalmAxis == Vector3.zero || !onlyIfZero) { leftArm.wristToPalmAxis = VRIKCalibrator.GuessWristToPalmAxis(references.leftHand, references.leftForearm); } if (leftArm.palmToThumbAxis == Vector3.zero || !onlyIfZero) { leftArm.palmToThumbAxis = VRIKCalibrator.GuessPalmToThumbAxis(references.leftHand, references.leftForearm); } if (rightArm.wristToPalmAxis == Vector3.zero || !onlyIfZero) { rightArm.wristToPalmAxis = VRIKCalibrator.GuessWristToPalmAxis(references.rightHand, references.rightForearm); } if (rightArm.palmToThumbAxis == Vector3.zero || !onlyIfZero) { rightArm.palmToThumbAxis = VRIKCalibrator.GuessPalmToThumbAxis(references.rightHand, references.rightForearm); } } public void DefaultAnimationCurves() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown if (locomotion.stepHeight == null) { locomotion.stepHeight = new AnimationCurve(); } if (locomotion.heelHeight == null) { locomotion.heelHeight = new AnimationCurve(); } if (locomotion.stepHeight.keys.Length == 0) { locomotion.stepHeight.keys = GetSineKeyframes(0.03f); } if (locomotion.heelHeight.keys.Length == 0) { locomotion.heelHeight.keys = GetSineKeyframes(0.03f); } } public void AddPositionOffset(PositionOffset positionOffset, Vector3 value) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) switch (positionOffset) { case PositionOffset.Pelvis: { Spine obj3 = spine; obj3.pelvisPositionOffset += value; break; } case PositionOffset.Chest: { Spine obj2 = spine; obj2.chestPositionOffset += value; break; } case PositionOffset.Head: { Spine obj = spine; obj.headPositionOffset += value; break; } case PositionOffset.LeftHand: { Arm arm2 = leftArm; arm2.handPositionOffset += value; break; } case PositionOffset.RightHand: { Arm arm = rightArm; arm.handPositionOffset += value; break; } case PositionOffset.LeftFoot: { Leg leg4 = leftLeg; leg4.footPositionOffset += value; break; } case PositionOffset.RightFoot: { Leg leg3 = rightLeg; leg3.footPositionOffset += value; break; } case PositionOffset.LeftHeel: { Leg leg2 = leftLeg; leg2.heelPositionOffset += value; break; } case PositionOffset.RightHeel: { Leg leg = rightLeg; leg.heelPositionOffset += value; break; } } } public void AddRotationOffset(RotationOffset rotationOffset, Vector3 value) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) AddRotationOffset(rotationOffset, Quaternion.Euler(value)); } public void AddRotationOffset(RotationOffset rotationOffset, Quaternion value) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) switch (rotationOffset) { case RotationOffset.Pelvis: spine.pelvisRotationOffset = value * spine.pelvisRotationOffset; break; case RotationOffset.Chest: spine.chestRotationOffset = value * spine.chestRotationOffset; break; case RotationOffset.Head: spine.headRotationOffset = value * spine.headRotationOffset; break; } } public void AddPlatformMotion(Vector3 deltaPosition, Quaternion deltaRotation, Vector3 platformPivot) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) locomotion.AddDeltaPosition(deltaPosition); raycastOriginPelvis += deltaPosition; locomotion.AddDeltaRotation(deltaRotation, platformPivot); spine.faceDirection = deltaRotation * spine.faceDirection; } public void Reset() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) if (base.initiated) { UpdateSolverTransforms(); Read(readPositions, readRotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs); spine.faceDirection = rootBone.readRotation * Vector3.forward; if (hasLegs) { locomotion.Reset(readPositions, readRotations); raycastOriginPelvis = spine.pelvis.readPosition; } } } public override void StoreDefaultLocalState() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) for (int i = 1; i < solverTransforms.Length; i++) { if ((Object)(object)solverTransforms[i] != (Object)null) { defaultLocalPositions[i - 1] = solverTransforms[i].localPosition; defaultLocalRotations[i - 1] = solverTransforms[i].localRotation; } } } public override void FixTransforms() { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) if (!base.initiated || LOD >= 2) { return; } for (int i = 1; i < solverTransforms.Length; i++) { if ((Object)(object)solverTransforms[i] != (Object)null) { bool num = i == 1; bool flag = i == 8 || i == 9 || i == 12 || i == 13; bool flag2 = (i >= 15 && i <= 17) || (i >= 19 && i <= 21); if (num || flag || flag2) { solverTransforms[i].localPosition = defaultLocalPositions[i - 1]; } solverTransforms[i].localRotation = defaultLocalRotations[i - 1]; } } } public override Point[] GetPoints() { Debug.LogError((object)"GetPoints() is not applicable to IKSolverVR."); return null; } public override Point GetPoint(Transform transform) { Debug.LogError((object)"GetPoint is not applicable to IKSolverVR."); return null; } public override bool IsValid(ref string message) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (solverTransforms == null || solverTransforms.Length == 0) { message = "Trying to initiate IKSolverVR with invalid bone references."; return false; } if (leftArm.wristToPalmAxis == Vector3.zero) { message = "Left arm 'Wrist To Palm Axis' needs to be set in VRIK. Please select the hand bone, set it to the axis that points from the wrist towards the palm. If the arrow points away from the palm, axis must be negative."; return false; } if (rightArm.wristToPalmAxis == Vector3.zero) { message = "Right arm 'Wrist To Palm Axis' needs to be set in VRIK. Please select the hand bone, set it to the axis that points from the wrist towards the palm. If the arrow points away from the palm, axis must be negative."; return false; } if (leftArm.palmToThumbAxis == Vector3.zero) { message = "Left arm 'Palm To Thumb Axis' needs to be set in VRIK. Please select the hand bone, set it to the axis that points from the palm towards the thumb. If the arrow points away from the thumb, axis must be negative."; return false; } if (rightArm.palmToThumbAxis == Vector3.zero) { message = "Right arm 'Palm To Thumb Axis' needs to be set in VRIK. Please select the hand bone, set it to the axis that points from the palm towards the thumb. If the arrow points away from the thumb, axis must be negative."; return false; } return true; } private Vector3 GetNormal(Transform[] transforms) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; Vector3 val2 = Vector3.zero; for (int i = 0; i < transforms.Length; i++) { val2 += transforms[i].position; } val2 /= (float)transforms.Length; for (int j = 0; j < transforms.Length - 1; j++) { Vector3 val3 = val; Vector3 val4 = Vector3.Cross(transforms[j].position - val2, transforms[j + 1].position - val2); val = val3 + ((Vector3)(ref val4)).normalized; } return val; } private static Keyframe[] GetSineKeyframes(float mag) { Keyframe[] array = new Keyframe[3]; ((Keyframe)(ref array[0])).time = 0f; ((Keyframe)(ref array[0])).value = 0f; ((Keyframe)(ref array[1])).time = 0.5f; ((Keyframe)(ref array[1])).value = mag; ((Keyframe)(ref array[2])).time = 1f; ((Keyframe)(ref array[2])).value = 0f; return (Keyframe[])(object)array; } private void UpdateSolverTransforms() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < solverTransforms.Length; i++) { if ((Object)(object)solverTransforms[i] != (Object)null) { readPositions[i] = solverTransforms[i].position; readRotations[i] = solverTransforms[i].rotation; } } } protected override void OnInitiate() { UpdateSolverTransforms(); Read(readPositions, readRotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs); } protected override void OnUpdate() { //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) if (IKPositionWeight > 0f) { if (LOD < 2) { bool flag = false; if (lastLOD != LOD && lastLOD == 2) { spine.faceDirection = rootBone.readRotation * Vector3.forward; if (hasLegs) { if (locomotion.weight > 0f) { root.position = new Vector3(spine.headTarget.position.x, root.position.y, spine.headTarget.position.z); Vector3 faceDirection = spine.faceDirection; faceDirection.y = 0f; root.rotation = Quaternion.LookRotation(faceDirection, root.up); UpdateSolverTransforms(); Read(readPositions, readRotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs); flag = true; locomotion.Reset(readPositions, readRotations); } raycastOriginPelvis = spine.pelvis.readPosition; } } if (!flag) { UpdateSolverTransforms(); Read(readPositions, readRotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs); } Solve(); Write(); WriteTransforms(); } else if (locomotion.weight > 0f) { root.position = new Vector3(spine.headTarget.position.x, root.position.y, spine.headTarget.position.z); Vector3 val = spine.headTarget.rotation * spine.anchorRelativeToHead * Vector3.forward; val.y = 0f; root.rotation = Quaternion.LookRotation(val, root.up); } } lastLOD = LOD; } private void WriteTransforms() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < solverTransforms.Length; i++) { if (!((Object)(object)solverTransforms[i] != (Object)null)) { continue; } bool num = i < 2; bool flag = i == 8 || i == 9 || i == 12 || i == 13; bool flag2 = (i >= 15 && i <= 17) || (i >= 19 && i <= 21); if (LOD > 0) { flag = false; flag2 = false; } if (num) { solverTransforms[i].position = V3Tools.Lerp(solverTransforms[i].position, GetPosition(i), IKPositionWeight); } if (flag || flag2) { if (IKPositionWeight < 1f) { Vector3 localPosition = solverTransforms[i].localPosition; solverTransforms[i].position = V3Tools.Lerp(solverTransforms[i].position, GetPosition(i), IKPositionWeight); solverTransforms[i].localPosition = Vector3.Project(solverTransforms[i].localPosition, localPosition); } else { solverTransforms[i].position = V3Tools.Lerp(solverTransforms[i].position, GetPosition(i), IKPositionWeight); } } solverTransforms[i].rotation = QuaTools.Lerp(solverTransforms[i].rotation, GetRotation(i), IKPositionWeight); } } private void Read(Vector3[] positions, Quaternion[] rotations, bool hasChest, bool hasNeck, bool hasShoulders, bool hasToes, bool hasLegs) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) if (rootBone == null) { rootBone = new VirtualBone(positions[0], rotations[0]); } else { rootBone.Read(positions[0], rotations[0]); } spine.Read(positions, rotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs, 0, 1); leftArm.Read(positions, rotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs, hasChest ? 3 : 2, 6); rightArm.Read(positions, rotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs, hasChest ? 3 : 2, 10); if (hasLegs) { leftLeg.Read(positions, rotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs, 1, 14); rightLeg.Read(positions, rotations, hasChest, hasNeck, hasShoulders, hasToes, hasLegs, 1, 18); } for (int i = 0; i < rotations.Length; i++) { solvedPositions[i] = positions[i]; solvedRotations[i] = rotations[i]; } if (!base.initiated) { if (hasLegs) { legs = new Leg[2] { leftLeg, rightLeg }; } arms = new Arm[2] { leftArm, rightArm }; if (hasLegs) { locomotion.Initiate(positions, rotations, hasToes, scale); } raycastOriginPelvis = spine.pelvis.readPosition; spine.faceDirection = readRotations[0] * Vector3.forward; } } private void Solve() { //IL_0726: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e2: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_075e: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06d1: Unknown result type (might be due to invalid IL or missing references) //IL_0800: Unknown result type (might be due to invalid IL or missing references) //IL_0806: Unknown result type (might be due to invalid IL or missing references) //IL_080b: Unknown result type (might be due to invalid IL or missing references) //IL_0810: Unknown result type (might be due to invalid IL or missing references) //IL_081c: Unknown result type (might be due to invalid IL or missing references) //IL_0827: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0831: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_087a: Unknown result type (might be due to invalid IL or missing references) //IL_087f: Unknown result type (might be due to invalid IL or missing references) if (scale <= 0f) { Debug.LogError((object)"VRIK solver scale <= 0, can not solve!"); return; } spine.SetLOD(LOD); Arm[] array = arms; for (int i = 0; i < array.Length; i++) { array[i].SetLOD(LOD); } if (hasLegs) { Leg[] array2 = legs; for (int i = 0; i < array2.Length; i++) { array2[i].SetLOD(LOD); } } spine.PreSolve(); array = arms; for (int i = 0; i < array.Length; i++) { array[i].PreSolve(); } if (hasLegs) { Leg[] array2 = legs; for (int i = 0; i < array2.Length; i++) { array2[i].PreSolve(); } } array = arms; for (int i = 0; i < array.Length; i++) { array[i].ApplyOffsets(scale); } spine.ApplyOffsets(scale); spine.Solve(rootBone, legs, arms, scale); if (hasLegs && spine.pelvisPositionWeight > 0f && plantFeet) { Warning.Log("If VRIK 'Pelvis Position Weight' is > 0, 'Plant Feet' should be disabled to improve performance and stability.", root); } if (hasLegs && locomotion.weight > 0f) { Vector3 leftFootPosition = Vector3.zero; Vector3 rightFootPosition = Vector3.zero; Quaternion leftFootRotation = Quaternion.identity; Quaternion rightFootRotation = Quaternion.identity; float leftFootOffset = 0f; float rightFootOffset = 0f; float leftHeelOffset = 0f; float rightHeelOffset = 0f; locomotion.Solve(rootBone, spine, leftLeg, rightLeg, leftArm, rightArm, supportLegIndex, out leftFootPosition, out rightFootPosition, out leftFootRotation, out rightFootRotation, out leftFootOffset, out rightFootOffset, out leftHeelOffset, out rightHeelOffset, scale); leftFootPosition += root.up * leftFootOffset; rightFootPosition += root.up * rightFootOffset; Leg leg = leftLeg; leg.footPositionOffset += (leftFootPosition - leftLeg.lastBone.solverPosition) * IKPositionWeight * (1f - leftLeg.positionWeight) * locomotion.weight; Leg leg2 = rightLeg; leg2.footPositionOffset += (rightFootPosition - rightLeg.lastBone.solverPosition) * IKPositionWeight * (1f - rightLeg.positionWeight) * locomotion.weight; Leg leg3 = leftLeg; leg3.heelPositionOffset += root.up * leftHeelOffset * locomotion.weight; Leg leg4 = rightLeg; leg4.heelPositionOffset += root.up * rightHeelOffset * locomotion.weight; Quaternion val = QuaTools.FromToRotation(leftLeg.lastBone.solverRotation, leftFootRotation); Quaternion val2 = QuaTools.FromToRotation(rightLeg.lastBone.solverRotation, rightFootRotation); val = Quaternion.Lerp(Quaternion.identity, val, IKPositionWeight * (1f - leftLeg.rotationWeight) * locomotion.weight); val2 = Quaternion.Lerp(Quaternion.identity, val2, IKPositionWeight * (1f - rightLeg.rotationWeight) * locomotion.weight); leftLeg.footRotationOffset = val * leftLeg.footRotationOffset; rightLeg.footRotationOffset = val2 * rightLeg.footRotationOffset; Vector3 point = Vector3.Lerp(leftLeg.position + leftLeg.footPositionOffset, rightLeg.position + rightLeg.footPositionOffset, 0.5f); point = V3Tools.PointToPlane(point, rootBone.solverPosition, root.up); Vector3 val3 = rootBone.solverPosition + rootVelocity * Time.deltaTime * 2f * locomotion.weight; val3 = Vector3.Lerp(val3, point, Time.deltaTime * locomotion.rootSpeed * locomotion.weight); rootBone.solverPosition = val3; rootVelocity += (point - rootBone.solverPosition) * Time.deltaTime * 10f; Vector3 val4 = V3Tools.ExtractVertical(rootVelocity, root.up, 1f); rootVelocity -= val4; float num = Mathf.Min(leftFootOffset + rightFootOffset, locomotion.maxBodyYOffset * scale); bodyOffset = Vector3.Lerp(bodyOffset, root.up * num, Time.deltaTime * 3f); bodyOffset = Vector3.Lerp(Vector3.zero, bodyOffset, locomotion.weight); } if (hasLegs) { Leg[] array2 = legs; for (int i = 0; i < array2.Length; i++) { array2[i].ApplyOffsets(scale); } if (!plantFeet || LOD > 0) { spine.InverseTranslateToHead(legs, limited: false, useCurrentLegMag: false, bodyOffset, 1f); array2 = legs; for (int i = 0; i < array2.Length; i++) { array2[i].TranslateRoot(spine.pelvis.solverPosition, spine.pelvis.solverRotation); } array2 = legs; for (int i = 0; i < array2.Length; i++) { array2[i].Solve(stretch: true); } } else { for (int j = 0; j < 2; j++) { spine.InverseTranslateToHead(legs, limited: true, useCurrentLegMag: true, bodyOffset, 1f); array2 = legs; for (int i = 0; i < array2.Length; i++) { array2[i].TranslateRoot(spine.pelvis.solverPosition, spine.pelvis.solverRotation); } array2 = legs; for (int i = 0; i < array2.Length; i++) { array2[i].Solve(j == 0); } } } } else { spine.InverseTranslateToHead(legs, limited: false, useCurrentLegMag: false, bodyOffset, 1f); } for (int k = 0; k < arms.Length; k++) { arms[k].TranslateRoot(spine.chest.solverPosition, spine.chest.solverRotation); } for (int l = 0; l < arms.Length; l++) { arms[l].Solve(l == 0); } spine.ResetOffsets(); if (hasLegs) { Leg[] array2 = legs; for (int i = 0; i < array2.Length; i++) { array2[i].ResetOffsets(); } } array = arms; for (int i = 0; i < array.Length; i++) { array[i].ResetOffsets(); } if (hasLegs) { Spine obj = spine; obj.pelvisPositionOffset += GetPelvisOffset(); Spine obj2 = spine; obj2.chestPositionOffset += spine.pelvisPositionOffset; } Write(); if (!hasLegs) { return; } supportLegIndex = -1; float num2 = float.PositiveInfinity; for (int m = 0; m < legs.Length; m++) { float num3 = Vector3.SqrMagnitude(legs[m].lastBone.solverPosition - legs[m].bones[0].solverPosition); if (num3 < num2) { supportLegIndex = m; num2 = num3; } } } private Vector3 GetPosition(int index) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return solvedPositions[index]; } private Quaternion GetRotation(int index) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return solvedRotations[index]; } private void Write() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) solvedPositions[0] = rootBone.solverPosition; solvedRotations[0] = rootBone.solverRotation; spine.Write(ref solvedPositions, ref solvedRotations); if (hasLegs) { Leg[] array = legs; for (int i = 0; i < array.Length; i++) { array[i].Write(ref solvedPositions, ref solvedRotations); } } Arm[] array2 = arms; for (int i = 0; i < array2.Length; i++) { array2[i].Write(ref solvedPositions, ref solvedRotations); } } private Vector3 GetPelvisOffset() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) if (locomotion.weight <= 0f) { return Vector3.zero; } if (LayerMask.op_Implicit(locomotion.blockingLayers) == -1) { return Vector3.zero; } Vector3 val = raycastOriginPelvis; val.y = spine.pelvis.solverPosition.y; Vector3 val2 = spine.pelvis.readPosition; val2.y = spine.pelvis.solverPosition.y; Vector3 val3 = val2 - val; RaycastHit val4 = default(RaycastHit); if (locomotion.raycastRadius <= 0f) { if (Physics.Raycast(val, val3, ref val4, ((Vector3)(ref val3)).magnitude * 1.1f, LayerMask.op_Implicit(locomotion.blockingLayers))) { val2 = ((RaycastHit)(ref val4)).point; } } else if (Physics.SphereCast(val, locomotion.raycastRadius * 1.1f, val3, ref val4, ((Vector3)(ref val3)).magnitude, LayerMask.op_Implicit(locomotion.blockingLayers))) { val2 = val + ((Vector3)(ref val3)).normalized * ((RaycastHit)(ref val4)).distance / 1.1f; } Vector3 val5 = spine.pelvis.solverPosition; val3 = val5 - val2; if (locomotion.raycastRadius <= 0f) { if (Physics.Raycast(val2, val3, ref val4, ((Vector3)(ref val3)).magnitude, LayerMask.op_Implicit(locomotion.blockingLayers))) { val5 = ((RaycastHit)(ref val4)).point; } } else if (Physics.SphereCast(val2, locomotion.raycastRadius, val3, ref val4, ((Vector3)(ref val3)).magnitude, LayerMask.op_Implicit(locomotion.blockingLayers))) { val5 = val2 + ((Vector3)(ref val3)).normalized * ((RaycastHit)(ref val4)).distance; } lastOffset = Vector3.Lerp(lastOffset, Vector3.zero, Time.deltaTime * 3f); val5 += Vector3.ClampMagnitude(lastOffset, 0.75f); val5.y = spine.pelvis.solverPosition.y; lastOffset = Vector3.Lerp(lastOffset, val5 - spine.pelvis.solverPosition, Time.deltaTime * 15f); return lastOffset; } } public class TwistRelaxer : MonoBehaviour { public IK ik; [Tooltip("If using multiple solvers, add them in inverse hierarchical order - first forearm roll bone, then forearm bone and upper arm bone.")] public TwistSolver[] twistSolvers = new TwistSolver[0]; public void Start() { if (twistSolvers.Length == 0) { Debug.LogError((object)"TwistRelaxer has no TwistSolvers. TwistRelaxer.cs was restructured for FIK v2.0 to support multiple relaxers on the same body part and TwistRelaxer components need to be set up again, sorry for the inconvenience!", (Object)(object)((Component)this).transform); return; } TwistSolver[] array = twistSolvers; for (int i = 0; i < array.Length; i++) { array[i].Initiate(); } if ((Object)(object)ik != (Object)null) { IKSolver iKSolver = ik.GetIKSolver(); iKSolver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolver.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostUpdate)); } } private void OnPostUpdate() { if ((Object)(object)ik != (Object)null) { TwistSolver[] array = twistSolvers; for (int i = 0; i < array.Length; i++) { array[i].Relax(); } } } private void LateUpdate() { if ((Object)(object)ik == (Object)null) { TwistSolver[] array = twistSolvers; for (int i = 0; i < array.Length; i++) { array[i].Relax(); } } } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolver iKSolver = ik.GetIKSolver(); iKSolver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolver.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostUpdate)); } } } [Serializable] public class TwistSolver { [Tooltip("The transform that this solver operates on.")] public Transform transform; [Tooltip("If this is the forearm roll bone, the parent should be the forearm bone. If null, will be found automatically.")] public Transform parent; [Tooltip("If this is the forearm roll bone, the child should be the hand bone. If null, will attempt to find automatically. Assign the hand manually if the hand bone is not a child of the roll bone.")] public Transform[] children = (Transform[])(object)new Transform[0]; [Tooltip("The weight of relaxing the twist of this Transform")] [Range(0f, 1f)] public float weight = 1f; [Tooltip("If 0.5, this Transform will be twisted half way from parent to child. If 1, the twist angle will be locked to the child and will rotate with along with it.")] [Range(0f, 1f)] public float parentChildCrossfade = 0.5f; [Tooltip("Rotation offset around the twist axis.")] [Range(-180f, 180f)] public float twistAngleOffset; private Vector3 twistAxis = Vector3.right; private Vector3 axis = Vector3.forward; private Vector3 axisRelativeToParentDefault; private Vector3 axisRelativeToChildDefault; private Quaternion[] childRotations; private bool inititated; public TwistSolver() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) weight = 1f; parentChildCrossfade = 0.5f; } public void Initiate() { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)transform == (Object)null) { Debug.LogError((object)"TwistRelaxer solver has unassigned Transform. TwistRelaxer.cs was restructured for FIK v2.0 to support multiple relaxers on the same body part and TwistRelaxer components need to be set up again, sorry for the inconvenience!", (Object)(object)transform); return; } if ((Object)(object)parent == (Object)null) { parent = transform.parent; } if (children.Length == 0) { if (transform.childCount == 0) { Transform[] componentsInChildren = ((Component)parent).GetComponentsInChildren(); for (int i = 1; i < componentsInChildren.Length; i++) { if ((Object)(object)componentsInChildren[i] != (Object)(object)transform) { componentsInChildren = (Transform[])(object)new Transform[1] { componentsInChildren[i] }; break; } } } else { children = (Transform[])(object)new Transform[1] { transform.GetChild(0) }; } } if (children.Length == 0 || (Object)(object)children[0] == (Object)null) { Debug.LogError((object)"TwistRelaxer has no children assigned.", (Object)(object)transform); return; } twistAxis = transform.InverseTransformDirection(children[0].position - transform.position); axis = new Vector3(twistAxis.y, twistAxis.z, twistAxis.x); Vector3 val = transform.rotation * axis; axisRelativeToParentDefault = Quaternion.Inverse(parent.rotation) * val; axisRelativeToChildDefault = Quaternion.Inverse(children[0].rotation) * val; childRotations = (Quaternion[])(object)new Quaternion[children.Length]; inititated = true; } public void Relax() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) if (inititated && !(weight <= 0f)) { Quaternion rotation = transform.rotation; Quaternion val = Quaternion.AngleAxis(twistAngleOffset, rotation * twistAxis); rotation = val * rotation; Vector3 val2 = val * parent.rotation * axisRelativeToParentDefault; Vector3 val3 = val * children[0].rotation * axisRelativeToChildDefault; Vector3 val4 = Vector3.Slerp(val2, val3, parentChildCrossfade); val4 = Quaternion.Inverse(Quaternion.LookRotation(rotation * axis, rotation * twistAxis)) * val4; float num = Mathf.Atan2(val4.x, val4.z) * 57.29578f; for (int i = 0; i < children.Length; i++) { childRotations[i] = children[i].rotation; } transform.rotation = Quaternion.AngleAxis(num * weight, rotation * twistAxis) * rotation; for (int j = 0; j < children.Length; j++) { children[j].rotation = childRotations[j]; } } } } [Serializable] public class InteractionEffector { private Poser poser; private IKEffector effector; private float timer; private float length; private float weight; private float fadeInSpeed; private float defaultPositionWeight; private float defaultRotationWeight; private float defaultPull; private float defaultReach; private float defaultPush; private float defaultPushParent; private float defaultBendGoalWeight; private float resetTimer; private bool positionWeightUsed; private bool rotationWeightUsed; private bool pullUsed; private bool reachUsed; private bool pushUsed; private bool pushParentUsed; private bool bendGoalWeightUsed; private bool pickedUp; private bool defaults; private bool pickUpOnPostFBBIK; private Vector3 pickUpPosition; private Vector3 pausePositionRelative; private Quaternion pickUpRotation; private Quaternion pauseRotationRelative; private InteractionTarget interactionTarget; private Transform target; private List triggered = new List(); private InteractionSystem interactionSystem; private bool started; public FullBodyBipedEffector effectorType { get; private set; } public bool isPaused { get; private set; } public InteractionObject interactionObject { get; private set; } public bool inInteraction => (Object)(object)interactionObject != (Object)null; public float progress { get { if (!inInteraction) { return 0f; } if (length == 0f) { return 0f; } return timer / length; } } public InteractionEffector(FullBodyBipedEffector effectorType) { this.effectorType = effectorType; } public void Initiate(InteractionSystem interactionSystem) { this.interactionSystem = interactionSystem; effector = interactionSystem.ik.solver.GetEffector(effectorType); poser = ((Component)effector.bone).GetComponent(); StoreDefaults(); } private void StoreDefaults() { defaultPositionWeight = interactionSystem.ik.solver.GetEffector(effectorType).positionWeight; defaultRotationWeight = interactionSystem.ik.solver.GetEffector(effectorType).rotationWeight; defaultPull = interactionSystem.ik.solver.GetChain(effectorType).pull; defaultReach = interactionSystem.ik.solver.GetChain(effectorType).reach; defaultPush = interactionSystem.ik.solver.GetChain(effectorType).push; defaultPushParent = interactionSystem.ik.solver.GetChain(effectorType).pushParent; defaultBendGoalWeight = interactionSystem.ik.solver.GetChain(effectorType).bendConstraint.weight; } public bool ResetToDefaults(float speed) { if (inInteraction) { return false; } if (isPaused) { return false; } if (defaults) { return false; } resetTimer = Mathf.MoveTowards(resetTimer, 0f, Time.deltaTime * speed); if (effector.isEndEffector) { if (pullUsed) { interactionSystem.ik.solver.GetChain(effectorType).pull = Mathf.Lerp(defaultPull, interactionSystem.ik.solver.GetChain(effectorType).pull, resetTimer); } if (reachUsed) { interactionSystem.ik.solver.GetChain(effectorType).reach = Mathf.Lerp(defaultReach, interactionSystem.ik.solver.GetChain(effectorType).reach, resetTimer); } if (pushUsed) { interactionSystem.ik.solver.GetChain(effectorType).push = Mathf.Lerp(defaultPush, interactionSystem.ik.solver.GetChain(effectorType).push, resetTimer); } if (pushParentUsed) { interactionSystem.ik.solver.GetChain(effectorType).pushParent = Mathf.Lerp(defaultPushParent, interactionSystem.ik.solver.GetChain(effectorType).pushParent, resetTimer); } if (bendGoalWeightUsed) { interactionSystem.ik.solver.GetChain(effectorType).bendConstraint.weight = Mathf.Lerp(defaultBendGoalWeight, interactionSystem.ik.solver.GetChain(effectorType).bendConstraint.weight, resetTimer); } } if (positionWeightUsed) { effector.positionWeight = Mathf.Lerp(defaultPositionWeight, effector.positionWeight, resetTimer); } if (rotationWeightUsed) { effector.rotationWeight = Mathf.Lerp(defaultRotationWeight, effector.rotationWeight, resetTimer); } if (resetTimer <= 0f) { pullUsed = false; reachUsed = false; pushUsed = false; pushParentUsed = false; positionWeightUsed = false; rotationWeightUsed = false; bendGoalWeightUsed = false; defaults = true; } return true; } public bool Pause() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (!inInteraction) { return false; } isPaused = true; pausePositionRelative = target.InverseTransformPoint(effector.position); pauseRotationRelative = Quaternion.Inverse(target.rotation) * effector.rotation; if (interactionSystem.OnInteractionPause != null) { interactionSystem.OnInteractionPause(effectorType, interactionObject); } return true; } public bool Resume() { if (!inInteraction) { return false; } isPaused = false; if (interactionSystem.OnInteractionResume != null) { interactionSystem.OnInteractionResume(effectorType, interactionObject); } return true; } public bool Start(InteractionObject interactionObject, string tag, float fadeInTime, bool interrupt) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) if (!inInteraction) { effector.position = effector.bone.position; effector.rotation = effector.bone.rotation; } else { if (!interrupt) { return false; } defaults = false; } target = interactionObject.GetTarget(effectorType, tag); if ((Object)(object)target == (Object)null) { return false; } interactionTarget = ((Component)target).GetComponent(); this.interactionObject = interactionObject; if (interactionSystem.OnInteractionStart != null) { interactionSystem.OnInteractionStart(effectorType, interactionObject); } interactionObject.OnStartInteraction(interactionSystem); triggered.Clear(); for (int i = 0; i < interactionObject.events.Length; i++) { triggered.Add(item: false); } if ((Object)(object)poser != (Object)null) { if ((Object)(object)poser.poseRoot == (Object)null) { poser.weight = 0f; } if ((Object)(object)interactionTarget != (Object)null) { poser.poseRoot = ((Component)target).transform; } else { poser.poseRoot = null; } poser.AutoMapping(); } positionWeightUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.PositionWeight); rotationWeightUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.RotationWeight); pullUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.Pull); reachUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.Reach); pushUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.Push); pushParentUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.PushParent); bendGoalWeightUsed = interactionObject.CurveUsed(InteractionObject.WeightCurve.Type.BendGoalWeight); if (defaults) { StoreDefaults(); } timer = 0f; weight = 0f; fadeInSpeed = ((fadeInTime > 0f) ? (1f / fadeInTime) : 1000f); length = interactionObject.length; isPaused = false; pickedUp = false; pickUpPosition = Vector3.zero; pickUpRotation = Quaternion.identity; if ((Object)(object)interactionTarget != (Object)null) { interactionTarget.RotateTo(effector.bone); } started = true; return true; } public void Update(Transform root, float speed) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) if (!inInteraction) { if (started) { isPaused = false; pickedUp = false; defaults = false; resetTimer = 1f; started = false; } return; } if ((Object)(object)interactionTarget != (Object)null && !interactionTarget.rotateOnce) { interactionTarget.RotateTo(effector.bone); } if (isPaused) { effector.position = target.TransformPoint(pausePositionRelative); effector.rotation = target.rotation * pauseRotationRelative; interactionObject.Apply(interactionSystem.ik.solver, effectorType, interactionTarget, timer, weight); return; } timer += Time.deltaTime * speed * (((Object)(object)interactionTarget != (Object)null) ? interactionTarget.interactionSpeedMlp : 1f); weight = Mathf.Clamp(weight + Time.deltaTime * fadeInSpeed * speed, 0f, 1f); bool pickUp = false; bool pause = false; TriggerUntriggeredEvents(checkTime: true, out pickUp, out pause); Vector3 val = (pickedUp ? ((Component)interactionSystem).transform.TransformPoint(pickUpPosition) : target.position); Quaternion val2 = (pickedUp ? (((Component)interactionSystem).transform.rotation * pickUpRotation) : target.rotation); effector.position = Vector3.Lerp(effector.bone.position, val, weight); effector.rotation = Quaternion.Lerp(effector.bone.rotation, val2, weight); interactionObject.Apply(interactionSystem.ik.solver, effectorType, interactionTarget, timer, weight); if (pickUp) { PickUp(root); } if (pause) { Pause(); } float value = interactionObject.GetValue(InteractionObject.WeightCurve.Type.PoserWeight, interactionTarget, timer); if ((Object)(object)poser != (Object)null) { poser.weight = Mathf.Lerp(poser.weight, value, weight); } else if (value > 0f) { Warning.Log("InteractionObject " + ((Object)interactionObject).name + " has a curve/multipler for Poser Weight, but the bone of effector " + effectorType.ToString() + " has no HandPoser/GenericPoser attached.", effector.bone); } if (timer >= length) { Stop(); } } private void TriggerUntriggeredEvents(bool checkTime, out bool pickUp, out bool pause) { pickUp = false; pause = false; for (int i = 0; i < triggered.Count; i++) { if (triggered[i] || (checkTime && !(interactionObject.events[i].time < timer))) { continue; } interactionObject.events[i].Activate(effector.bone); if (interactionObject.events[i].pickUp) { if (timer >= interactionObject.events[i].time) { timer = interactionObject.events[i].time; } pickUp = true; } if (interactionObject.events[i].pause) { if (timer >= interactionObject.events[i].time) { timer = interactionObject.events[i].time; } pause = true; } if (interactionSystem.OnInteractionEvent != null) { interactionSystem.OnInteractionEvent(effectorType, interactionObject, interactionObject.events[i]); } triggered[i] = true; } } private void PickUp(Transform root) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) pickUpPosition = root.InverseTransformPoint(effector.position); pickUpRotation = Quaternion.Inverse(((Component)interactionSystem).transform.rotation) * effector.rotation; pickUpOnPostFBBIK = true; pickedUp = true; Rigidbody component = ((Component)interactionObject.targetsRoot).GetComponent(); if ((Object)(object)component != (Object)null) { if (!component.isKinematic) { component.isKinematic = true; } Collider component2 = ((Component)root).GetComponent(); if ((Object)(object)component2 != (Object)null) { Collider[] componentsInChildren = ((Component)interactionObject.targetsRoot).GetComponentsInChildren(); foreach (Collider val in componentsInChildren) { if (!val.isTrigger && val.enabled) { Physics.IgnoreCollision(component2, val); } } } } if (interactionSystem.OnInteractionPickUp != null) { interactionSystem.OnInteractionPickUp(effectorType, interactionObject); } } public bool Stop() { if (!inInteraction) { return false; } bool pickUp = false; bool pause = false; TriggerUntriggeredEvents(checkTime: false, out pickUp, out pause); if (interactionSystem.OnInteractionStop != null) { interactionSystem.OnInteractionStop(effectorType, interactionObject); } if ((Object)(object)interactionTarget != (Object)null) { interactionTarget.ResetRotation(); } interactionObject = null; weight = 0f; timer = 0f; isPaused = false; target = null; defaults = false; resetTimer = 1f; if ((Object)(object)poser != (Object)null && !pickedUp) { poser.weight = 0f; } pickedUp = false; started = false; return true; } public void OnPostFBBIK() { //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (inInteraction) { float num = interactionObject.GetValue(InteractionObject.WeightCurve.Type.RotateBoneWeight, interactionTarget, timer) * weight; if (num > 0f) { Quaternion val = (pickedUp ? (((Component)interactionSystem).transform.rotation * pickUpRotation) : effector.rotation); Quaternion val2 = Quaternion.Slerp(effector.bone.rotation, val, num * num); effector.bone.localRotation = Quaternion.Inverse(effector.bone.parent.rotation) * val2; } if (pickUpOnPostFBBIK) { Vector3 position = effector.bone.position; effector.bone.position = ((Component)interactionSystem).transform.TransformPoint(pickUpPosition); interactionObject.targetsRoot.parent = effector.bone; effector.bone.position = position; pickUpOnPostFBBIK = false; } } } } [Serializable] public class InteractionLookAt { [Tooltip("(Optional) reference to the LookAtIK component that will be used to make the character look at the objects that it is interacting with.")] public LookAtIK ik; [Tooltip("Interpolation speed of the LookAtIK target.")] public float lerpSpeed = 5f; [Tooltip("Interpolation speed of the LookAtIK weight.")] public float weightSpeed = 1f; [HideInInspector] public bool isPaused; private Transform lookAtTarget; private float stopLookTime; private float weight; private bool firstFBBIKSolve; public void Look(Transform target, float time) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ik == (Object)null)) { if (ik.solver.IKPositionWeight <= 0f) { ik.solver.IKPosition = ik.solver.GetRoot().position + ik.solver.GetRoot().forward * 3f; } lookAtTarget = target; stopLookTime = time; } } public void OnFixTransforms() { if (!((Object)(object)ik == (Object)null) && ik.fixTransforms) { ik.solver.FixTransforms(); } } public void Update() { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik == (Object)null) { return; } if (((Behaviour)ik).enabled) { ((Behaviour)ik).enabled = false; } if (!((Object)(object)lookAtTarget == (Object)null)) { if (isPaused) { stopLookTime += Time.deltaTime; } float num = ((Time.time < stopLookTime) ? weightSpeed : (0f - weightSpeed)); weight = Mathf.Clamp(weight + num * Time.deltaTime, 0f, 1f); ik.solver.IKPositionWeight = Interp.Float(weight, InterpolationMode.InOutQuintic); ik.solver.IKPosition = Vector3.Lerp(ik.solver.IKPosition, lookAtTarget.position, lerpSpeed * Time.deltaTime); if (weight <= 0f) { lookAtTarget = null; } firstFBBIKSolve = true; } } public void SolveSpine() { if (!((Object)(object)ik == (Object)null) && firstFBBIKSolve) { float headWeight = ik.solver.headWeight; float eyesWeight = ik.solver.eyesWeight; ik.solver.headWeight = 0f; ik.solver.eyesWeight = 0f; ik.solver.Update(); ik.solver.headWeight = headWeight; ik.solver.eyesWeight = eyesWeight; } } public void SolveHead() { if (!((Object)(object)ik == (Object)null) && firstFBBIKSolve) { float bodyWeight = ik.solver.bodyWeight; ik.solver.bodyWeight = 0f; ik.solver.Update(); ik.solver.bodyWeight = bodyWeight; firstFBBIKSolve = false; } } } [HelpURL("https://www.youtube.com/watch?v=r5jiZnsDH3M")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Interaction System/Interaction Object")] public class InteractionObject : MonoBehaviour { [Serializable] public class InteractionEvent { [Tooltip("The time of the event since interaction start.")] public float time; [Tooltip("If true, the interaction will be paused on this event. The interaction can be resumed by InteractionSystem.ResumeInteraction() or InteractionSystem.ResumeAll;")] public bool pause; [Tooltip("If true, the object will be parented to the effector bone on this event. Note that picking up like this can be done by only a single effector at a time. If you wish to pick up an object with both hands, see the Interaction PickUp2Handed demo scene.")] public bool pickUp; [Tooltip("The animations called on this event.")] public AnimatorEvent[] animations; [Tooltip("The messages sent on this event using GameObject.SendMessage().")] public Message[] messages; [Tooltip("The UnityEvent to invoke on this event.")] public UnityEvent unityEvent; public void Activate(Transform t) { unityEvent.Invoke(); AnimatorEvent[] array = animations; for (int i = 0; i < array.Length; i++) { array[i].Activate(pickUp); } Message[] array2 = messages; for (int i = 0; i < array2.Length; i++) { array2[i].Send(t); } } } [Serializable] public class Message { [Tooltip("The name of the function called.")] public string function; [Tooltip("The recipient game object.")] public GameObject recipient; private const string empty = ""; public void Send(Transform t) { if (!((Object)(object)recipient == (Object)null) && !(function == string.Empty) && !(function == "")) { recipient.SendMessage(function, (object)t, (SendMessageOptions)0); } } } [Serializable] public class AnimatorEvent { [Tooltip("The Animator component that will receive the AnimatorEvents.")] public Animator animator; [Tooltip("The Animation component that will receive the AnimatorEvents (Legacy).")] public Animation animation; [Tooltip("The name of the animation state.")] public string animationState; [Tooltip("The crossfading time.")] public float crossfadeTime = 0.3f; [Tooltip("The layer of the animation state (if using Legacy, the animation state will be forced to this layer).")] public int layer; [Tooltip("Should the animation always start from 0 normalized time?")] public bool resetNormalizedTime; private const string empty = ""; public void Activate(bool pickUp) { if ((Object)(object)animator != (Object)null) { if (pickUp) { animator.applyRootMotion = false; } Activate(animator); } if ((Object)(object)animation != (Object)null) { Activate(animation); } } private void Activate(Animator animator) { if (!(animationState == "")) { if (resetNormalizedTime) { animator.CrossFade(animationState, crossfadeTime, layer, 0f); } else { animator.CrossFade(animationState, crossfadeTime, layer); } } } private void Activate(Animation animation) { if (!(animationState == "")) { if (resetNormalizedTime) { animation[animationState].normalizedTime = 0f; } animation[animationState].layer = layer; animation.CrossFade(animationState, crossfadeTime); } } } [Serializable] public class WeightCurve { [Serializable] public enum Type { PositionWeight, RotationWeight, PositionOffsetX, PositionOffsetY, PositionOffsetZ, Pull, Reach, RotateBoneWeight, Push, PushParent, PoserWeight, BendGoalWeight } [Tooltip("The type of the curve (InteractionObject.WeightCurve.Type).")] public Type type; [Tooltip("The weight curve.")] public AnimationCurve curve; public float GetValue(float timer) { return curve.Evaluate(timer); } } [Serializable] public class Multiplier { [Tooltip("The curve type to multiply.")] public WeightCurve.Type curve; [Tooltip("The multiplier of the curve's value.")] public float multiplier = 1f; [Tooltip("The resulting value will be applied to this channel.")] public WeightCurve.Type result; public float GetValue(WeightCurve weightCurve, float timer) { return weightCurve.GetValue(timer) * multiplier; } } [Tooltip("If the Interaction System has a 'Look At' LookAtIK component assigned, will use it to make the character look at the specified Transform. If unassigned, will look at this GameObject.")] public Transform otherLookAtTarget; [Tooltip("The root Transform of the InteractionTargets. If null, will use this GameObject. GetComponentsInChildren() will be used at initiation to find all InteractionTargets associated with this InteractionObject.")] public Transform otherTargetsRoot; [Tooltip("If assigned, all PositionOffset channels will be applied in the rotation space of this Transform. If not, they will be in the rotation space of the character.")] public Transform positionOffsetSpace; public WeightCurve[] weightCurves; public Multiplier[] multipliers; public InteractionEvent[] events; private InteractionTarget[] targets = new InteractionTarget[0]; public float length { get; private set; } public InteractionSystem lastUsedInteractionSystem { get; private set; } public Transform lookAtTarget { get { if ((Object)(object)otherLookAtTarget != (Object)null) { return otherLookAtTarget; } return ((Component)this).transform; } } public Transform targetsRoot { get { if ((Object)(object)otherTargetsRoot != (Object)null) { return otherTargetsRoot; } return ((Component)this).transform; } } [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page10.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_interaction_object.html"); } [ContextMenu("TUTORIAL VIDEO (PART 1: BASICS)")] private void OpenTutorial1() { Application.OpenURL("https://www.youtube.com/watch?v=r5jiZnsDH3M"); } [ContextMenu("TUTORIAL VIDEO (PART 2: PICKING UP...)")] private void OpenTutorial2() { Application.OpenURL("https://www.youtube.com/watch?v=eP9-zycoHLk"); } [ContextMenu("TUTORIAL VIDEO (PART 3: ANIMATION)")] private void OpenTutorial3() { Application.OpenURL("https://www.youtube.com/watch?v=sQfB2RcT1T4&index=14&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("TUTORIAL VIDEO (PART 4: TRIGGERS)")] private void OpenTutorial4() { Application.OpenURL("https://www.youtube.com/watch?v=-TDZpNjt2mk&index=15&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public void Initiate() { for (int i = 0; i < weightCurves.Length; i++) { if (weightCurves[i].curve.length > 0) { float time = ((Keyframe)(ref weightCurves[i].curve.keys[weightCurves[i].curve.length - 1])).time; length = Mathf.Clamp(length, time, length); } } for (int j = 0; j < events.Length; j++) { length = Mathf.Clamp(length, events[j].time, length); } targets = ((Component)targetsRoot).GetComponentsInChildren(); } public InteractionTarget GetTarget(FullBodyBipedEffector effectorType, InteractionSystem interactionSystem) { InteractionTarget[] array; if (((Component)interactionSystem).CompareTag(string.Empty) || ((Component)interactionSystem).CompareTag("")) { array = targets; foreach (InteractionTarget interactionTarget in array) { if (interactionTarget.effectorType == effectorType) { return interactionTarget; } } return null; } array = targets; foreach (InteractionTarget interactionTarget2 in array) { if (interactionTarget2.effectorType == effectorType && ((Component)interactionTarget2).CompareTag(((Component)interactionSystem).tag)) { return interactionTarget2; } } return null; } public bool CurveUsed(WeightCurve.Type type) { WeightCurve[] array = weightCurves; for (int i = 0; i < array.Length; i++) { if (array[i].type == type) { return true; } } Multiplier[] array2 = multipliers; for (int i = 0; i < array2.Length; i++) { if (array2[i].result == type) { return true; } } return false; } public InteractionTarget[] GetTargets() { return targets; } public Transform GetTarget(FullBodyBipedEffector effectorType, string tag) { if (tag == string.Empty || tag == "") { return GetTarget(effectorType); } for (int i = 0; i < targets.Length; i++) { if (targets[i].effectorType == effectorType && ((Component)targets[i]).CompareTag(tag)) { return ((Component)targets[i]).transform; } } return ((Component)this).transform; } public void OnStartInteraction(InteractionSystem interactionSystem) { lastUsedInteractionSystem = interactionSystem; } public void Apply(IKSolverFullBodyBiped solver, FullBodyBipedEffector effector, InteractionTarget target, float timer, float weight) { for (int i = 0; i < weightCurves.Length; i++) { float num = (((Object)(object)target == (Object)null) ? 1f : target.GetValue(weightCurves[i].type)); Apply(solver, effector, weightCurves[i].type, weightCurves[i].GetValue(timer), weight * num); } for (int j = 0; j < multipliers.Length; j++) { if (multipliers[j].curve == multipliers[j].result && !Warning.logged) { Warning.Log("InteractionObject Multiplier 'Curve' " + multipliers[j].curve.ToString() + "and 'Result' are the same.", ((Component)this).transform); } int weightCurveIndex = GetWeightCurveIndex(multipliers[j].curve); if (weightCurveIndex != -1) { float num2 = (((Object)(object)target == (Object)null) ? 1f : target.GetValue(multipliers[j].result)); Apply(solver, effector, multipliers[j].result, multipliers[j].GetValue(weightCurves[weightCurveIndex], timer), weight * num2); } else if (!Warning.logged) { Warning.Log("InteractionObject Multiplier curve " + multipliers[j].curve.ToString() + "does not exist.", ((Component)this).transform); } } } public float GetValue(WeightCurve.Type weightCurveType, InteractionTarget target, float timer) { int weightCurveIndex = GetWeightCurveIndex(weightCurveType); if (weightCurveIndex != -1) { float num = (((Object)(object)target == (Object)null) ? 1f : target.GetValue(weightCurveType)); return weightCurves[weightCurveIndex].GetValue(timer) * num; } for (int i = 0; i < multipliers.Length; i++) { if (multipliers[i].result == weightCurveType) { int weightCurveIndex2 = GetWeightCurveIndex(multipliers[i].curve); if (weightCurveIndex2 != -1) { float num2 = (((Object)(object)target == (Object)null) ? 1f : target.GetValue(multipliers[i].result)); return multipliers[i].GetValue(weightCurves[weightCurveIndex2], timer) * num2; } } } return 0f; } private void Start() { Initiate(); } private void Apply(IKSolverFullBodyBiped solver, FullBodyBipedEffector effector, WeightCurve.Type type, float value, float weight) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) switch (type) { case WeightCurve.Type.PositionWeight: solver.GetEffector(effector).positionWeight = Mathf.Lerp(solver.GetEffector(effector).positionWeight, value, weight); break; case WeightCurve.Type.RotationWeight: solver.GetEffector(effector).rotationWeight = Mathf.Lerp(solver.GetEffector(effector).rotationWeight, value, weight); break; case WeightCurve.Type.PositionOffsetX: { IKEffector effector3 = solver.GetEffector(effector); effector3.position += (((Object)(object)positionOffsetSpace != (Object)null) ? positionOffsetSpace.rotation : solver.GetRoot().rotation) * Vector3.right * value * weight; break; } case WeightCurve.Type.PositionOffsetY: { IKEffector effector4 = solver.GetEffector(effector); effector4.position += (((Object)(object)positionOffsetSpace != (Object)null) ? positionOffsetSpace.rotation : solver.GetRoot().rotation) * Vector3.up * value * weight; break; } case WeightCurve.Type.PositionOffsetZ: { IKEffector effector2 = solver.GetEffector(effector); effector2.position += (((Object)(object)positionOffsetSpace != (Object)null) ? positionOffsetSpace.rotation : solver.GetRoot().rotation) * Vector3.forward * value * weight; break; } case WeightCurve.Type.Pull: solver.GetChain(effector).pull = Mathf.Lerp(solver.GetChain(effector).pull, value, weight); break; case WeightCurve.Type.Reach: solver.GetChain(effector).reach = Mathf.Lerp(solver.GetChain(effector).reach, value, weight); break; case WeightCurve.Type.Push: solver.GetChain(effector).push = Mathf.Lerp(solver.GetChain(effector).push, value, weight); break; case WeightCurve.Type.PushParent: solver.GetChain(effector).pushParent = Mathf.Lerp(solver.GetChain(effector).pushParent, value, weight); break; case WeightCurve.Type.BendGoalWeight: solver.GetChain(effector).bendConstraint.weight = Mathf.Lerp(solver.GetChain(effector).bendConstraint.weight, value, weight); break; case WeightCurve.Type.RotateBoneWeight: case WeightCurve.Type.PoserWeight: break; } } private Transform GetTarget(FullBodyBipedEffector effectorType) { for (int i = 0; i < targets.Length; i++) { if (targets[i].effectorType == effectorType) { return ((Component)targets[i]).transform; } } return ((Component)this).transform; } private int GetWeightCurveIndex(WeightCurve.Type weightCurveType) { for (int i = 0; i < weightCurves.Length; i++) { if (weightCurves[i].type == weightCurveType) { return i; } } return -1; } private int GetMultiplierIndex(WeightCurve.Type weightCurveType) { for (int i = 0; i < multipliers.Length; i++) { if (multipliers[i].result == weightCurveType) { return i; } } return -1; } } [HelpURL("https://www.youtube.com/watch?v=r5jiZnsDH3M")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Interaction System/Interaction System")] public class InteractionSystem : MonoBehaviour { public delegate void InteractionDelegate(FullBodyBipedEffector effectorType, InteractionObject interactionObject); public delegate void InteractionEventDelegate(FullBodyBipedEffector effectorType, InteractionObject interactionObject, InteractionObject.InteractionEvent interactionEvent); [Tooltip("If not empty, only the targets with the specified tag will be used by this Interaction System.")] public string targetTag = ""; [Tooltip("The fade in time of the interaction.")] public float fadeInTime = 0.3f; [Tooltip("The master speed for all interactions.")] public float speed = 1f; [Tooltip("If > 0, lerps all the FBBIK channels used by the Interaction System back to their default or initial values when not in interaction.")] public float resetToDefaultsSpeed = 1f; [Header("Triggering")] [Tooltip("The collider that registers OnTriggerEnter and OnTriggerExit events with InteractionTriggers.")] [FormerlySerializedAs("collider")] public Collider characterCollider; [Tooltip("Will be used by Interaction Triggers that need the camera's position. Assign the first person view character camera.")] [FormerlySerializedAs("camera")] public Transform FPSCamera; [Tooltip("The layers that will be raycasted from the camera (along camera.forward). All InteractionTrigger look at target colliders should be included.")] public LayerMask camRaycastLayers; [Tooltip("Max distance of raycasting from the camera.")] public float camRaycastDistance = 1f; private List inContact = new List(); private List bestRangeIndexes = new List(); public InteractionDelegate OnInteractionStart; public InteractionDelegate OnInteractionPause; public InteractionDelegate OnInteractionPickUp; public InteractionDelegate OnInteractionResume; public InteractionDelegate OnInteractionStop; public InteractionEventDelegate OnInteractionEvent; public RaycastHit raycastHit; [Space(10f)] [Tooltip("Reference to the FBBIK component.")] [SerializeField] private FullBodyBipedIK fullBody; [Tooltip("Handles looking at the interactions.")] public InteractionLookAt lookAt = new InteractionLookAt(); private InteractionEffector[] interactionEffectors = new InteractionEffector[9] { new InteractionEffector(FullBodyBipedEffector.Body), new InteractionEffector(FullBodyBipedEffector.LeftFoot), new InteractionEffector(FullBodyBipedEffector.LeftHand), new InteractionEffector(FullBodyBipedEffector.LeftShoulder), new InteractionEffector(FullBodyBipedEffector.LeftThigh), new InteractionEffector(FullBodyBipedEffector.RightFoot), new InteractionEffector(FullBodyBipedEffector.RightHand), new InteractionEffector(FullBodyBipedEffector.RightShoulder), new InteractionEffector(FullBodyBipedEffector.RightThigh) }; private Collider lastCollider; private Collider c; public bool inInteraction { get { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].inInteraction && !interactionEffectors[i].isPaused) { return true; } } return false; } } public FullBodyBipedIK ik { get { return fullBody; } set { fullBody = value; } } public List triggersInRange { get; private set; } public bool initiated { get; private set; } [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page10.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_interaction_system.html"); } [ContextMenu("TUTORIAL VIDEO (PART 1: BASICS)")] private void OpenTutorial1() { Application.OpenURL("https://www.youtube.com/watch?v=r5jiZnsDH3M"); } [ContextMenu("TUTORIAL VIDEO (PART 2: PICKING UP...)")] private void OpenTutorial2() { Application.OpenURL("https://www.youtube.com/watch?v=eP9-zycoHLk"); } [ContextMenu("TUTORIAL VIDEO (PART 3: ANIMATION)")] private void OpenTutorial3() { Application.OpenURL("https://www.youtube.com/watch?v=sQfB2RcT1T4&index=14&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("TUTORIAL VIDEO (PART 4: TRIGGERS)")] private void OpenTutorial4() { Application.OpenURL("https://www.youtube.com/watch?v=-TDZpNjt2mk&index=15&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("Support")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public bool IsInInteraction(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { if (interactionEffectors[i].inInteraction) { return !interactionEffectors[i].isPaused; } return false; } } return false; } public bool IsPaused(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { if (interactionEffectors[i].inInteraction) { return interactionEffectors[i].isPaused; } return false; } } return false; } public bool IsPaused() { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].inInteraction && interactionEffectors[i].isPaused) { return true; } } return false; } public bool IsInSync() { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (!interactionEffectors[i].isPaused) { continue; } for (int j = 0; j < interactionEffectors.Length; j++) { if (j != i && interactionEffectors[j].inInteraction && !interactionEffectors[j].isPaused) { return false; } } } return true; } public bool StartInteraction(FullBodyBipedEffector effectorType, InteractionObject interactionObject, bool interrupt) { if (!IsValid(log: true)) { return false; } if ((Object)(object)interactionObject == (Object)null) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].Start(interactionObject, targetTag, fadeInTime, interrupt); } } return false; } public bool PauseInteraction(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].Pause(); } } return false; } public bool ResumeInteraction(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].Resume(); } } return false; } public bool StopInteraction(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return false; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].Stop(); } } return false; } public void PauseAll() { if (IsValid(log: true)) { for (int i = 0; i < interactionEffectors.Length; i++) { interactionEffectors[i].Pause(); } } } public void ResumeAll() { if (IsValid(log: true)) { for (int i = 0; i < interactionEffectors.Length; i++) { interactionEffectors[i].Resume(); } } } public void StopAll() { for (int i = 0; i < interactionEffectors.Length; i++) { interactionEffectors[i].Stop(); } } public InteractionObject GetInteractionObject(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return null; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].interactionObject; } } return null; } public float GetProgress(FullBodyBipedEffector effectorType) { if (!IsValid(log: true)) { return 0f; } for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].progress; } } return 0f; } public float GetMinActiveProgress() { if (!IsValid(log: true)) { return 0f; } float num = 1f; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].inInteraction) { float progress = interactionEffectors[i].progress; if (progress > 0f && progress < num) { num = progress; } } } return num; } public bool TriggerInteraction(int index, bool interrupt) { if (!IsValid(log: true)) { return false; } if (!TriggerIndexIsValid(index)) { return false; } bool result = true; InteractionTrigger.Range range = triggersInRange[index].ranges[bestRangeIndexes[index]]; for (int i = 0; i < range.interactions.Length; i++) { for (int j = 0; j < range.interactions[i].effectors.Length; j++) { if (!StartInteraction(range.interactions[i].effectors[j], range.interactions[i].interactionObject, interrupt)) { result = false; } } } return result; } public bool TriggerInteraction(int index, bool interrupt, out InteractionObject interactionObject) { interactionObject = null; if (!IsValid(log: true)) { return false; } if (!TriggerIndexIsValid(index)) { return false; } bool result = true; InteractionTrigger.Range range = triggersInRange[index].ranges[bestRangeIndexes[index]]; for (int i = 0; i < range.interactions.Length; i++) { for (int j = 0; j < range.interactions[i].effectors.Length; j++) { interactionObject = range.interactions[i].interactionObject; if (!StartInteraction(range.interactions[i].effectors[j], interactionObject, interrupt)) { result = false; } } } return result; } public bool TriggerInteraction(int index, bool interrupt, out InteractionTarget interactionTarget) { interactionTarget = null; if (!IsValid(log: true)) { return false; } if (!TriggerIndexIsValid(index)) { return false; } bool result = true; InteractionTrigger.Range range = triggersInRange[index].ranges[bestRangeIndexes[index]]; for (int i = 0; i < range.interactions.Length; i++) { for (int j = 0; j < range.interactions[i].effectors.Length; j++) { InteractionObject interactionObject = range.interactions[i].interactionObject; Transform target = interactionObject.GetTarget(range.interactions[i].effectors[j], ((Component)this).tag); if ((Object)(object)target != (Object)null) { interactionTarget = ((Component)target).GetComponent(); } if (!StartInteraction(range.interactions[i].effectors[j], interactionObject, interrupt)) { result = false; } } } return result; } public InteractionTrigger.Range GetClosestInteractionRange() { if (!IsValid(log: true)) { return null; } int closestTriggerIndex = GetClosestTriggerIndex(); if (closestTriggerIndex < 0 || closestTriggerIndex >= triggersInRange.Count) { return null; } return triggersInRange[closestTriggerIndex].ranges[bestRangeIndexes[closestTriggerIndex]]; } public InteractionObject GetClosestInteractionObjectInRange() { InteractionTrigger.Range closestInteractionRange = GetClosestInteractionRange(); if (closestInteractionRange == null) { return null; } return closestInteractionRange.interactions[0].interactionObject; } public InteractionTarget GetClosestInteractionTargetInRange() { InteractionTrigger.Range closestInteractionRange = GetClosestInteractionRange(); if (closestInteractionRange == null) { return null; } return closestInteractionRange.interactions[0].interactionObject.GetTarget(closestInteractionRange.interactions[0].effectors[0], this); } public InteractionObject[] GetClosestInteractionObjectsInRange() { InteractionTrigger.Range closestInteractionRange = GetClosestInteractionRange(); if (closestInteractionRange == null) { return new InteractionObject[0]; } InteractionObject[] array = new InteractionObject[closestInteractionRange.interactions.Length]; for (int i = 0; i < closestInteractionRange.interactions.Length; i++) { array[i] = closestInteractionRange.interactions[i].interactionObject; } return array; } public InteractionTarget[] GetClosestInteractionTargetsInRange() { InteractionTrigger.Range closestInteractionRange = GetClosestInteractionRange(); if (closestInteractionRange == null) { return new InteractionTarget[0]; } List list = new List(); InteractionTrigger.Range.Interaction[] interactions = closestInteractionRange.interactions; foreach (InteractionTrigger.Range.Interaction interaction in interactions) { FullBodyBipedEffector[] effectors = interaction.effectors; foreach (FullBodyBipedEffector effectorType in effectors) { list.Add(interaction.interactionObject.GetTarget(effectorType, this)); } } return list.ToArray(); } public bool TriggerEffectorsReady(int index) { if (!IsValid(log: true)) { return false; } if (!TriggerIndexIsValid(index)) { return false; } for (int i = 0; i < triggersInRange[index].ranges.Length; i++) { InteractionTrigger.Range range = triggersInRange[index].ranges[i]; for (int j = 0; j < range.interactions.Length; j++) { for (int k = 0; k < range.interactions[j].effectors.Length; k++) { if (IsInInteraction(range.interactions[j].effectors[k])) { return false; } } } for (int l = 0; l < range.interactions.Length; l++) { for (int m = 0; m < range.interactions[l].effectors.Length; m++) { if (!IsPaused(range.interactions[l].effectors[m])) { continue; } for (int n = 0; n < range.interactions[l].effectors.Length; n++) { if (n != m && !IsPaused(range.interactions[l].effectors[n])) { return false; } } } } } return true; } public InteractionTrigger.Range GetTriggerRange(int index) { if (!IsValid(log: true)) { return null; } if (index < 0 || index >= bestRangeIndexes.Count) { Warning.Log("Index out of range.", ((Component)this).transform); return null; } return triggersInRange[index].ranges[bestRangeIndexes[index]]; } public int GetClosestTriggerIndex() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (!IsValid(log: true)) { return -1; } if (triggersInRange.Count == 0) { return -1; } if (triggersInRange.Count == 1) { return 0; } int result = -1; float num = float.PositiveInfinity; for (int i = 0; i < triggersInRange.Count; i++) { if ((Object)(object)triggersInRange[i] != (Object)null) { float num2 = Vector3.SqrMagnitude(((Component)triggersInRange[i]).transform.position - ((Component)this).transform.position); if (num2 < num) { result = i; num = num2; } } } return result; } public void Start() { if ((Object)(object)fullBody == (Object)null) { fullBody = ((Component)this).GetComponent(); } if ((Object)(object)fullBody == (Object)null) { Warning.Log("InteractionSystem can not find a FullBodyBipedIK component", ((Component)this).transform); return; } IKSolverFullBodyBiped solver = fullBody.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPreUpdate, new IKSolver.UpdateDelegate(OnPreFBBIK)); IKSolverFullBodyBiped solver2 = fullBody.solver; solver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostFBBIK)); IKSolverFullBodyBiped solver3 = fullBody.solver; solver3.OnFixTransforms = (IKSolver.UpdateDelegate)Delegate.Combine(solver3.OnFixTransforms, new IKSolver.UpdateDelegate(OnFixTransforms)); OnInteractionStart = (InteractionDelegate)Delegate.Combine(OnInteractionStart, new InteractionDelegate(LookAtInteraction)); OnInteractionPause = (InteractionDelegate)Delegate.Combine(OnInteractionPause, new InteractionDelegate(InteractionPause)); OnInteractionResume = (InteractionDelegate)Delegate.Combine(OnInteractionResume, new InteractionDelegate(InteractionResume)); OnInteractionStop = (InteractionDelegate)Delegate.Combine(OnInteractionStop, new InteractionDelegate(InteractionStop)); InteractionEffector[] array = interactionEffectors; for (int i = 0; i < array.Length; i++) { array[i].Initiate(this); } triggersInRange = new List(); c = ((Component)this).GetComponent(); UpdateTriggerEventBroadcasting(); initiated = true; } private void InteractionPause(FullBodyBipedEffector effector, InteractionObject interactionObject) { lookAt.isPaused = true; } private void InteractionResume(FullBodyBipedEffector effector, InteractionObject interactionObject) { lookAt.isPaused = false; } private void InteractionStop(FullBodyBipedEffector effector, InteractionObject interactionObject) { lookAt.isPaused = false; } private void LookAtInteraction(FullBodyBipedEffector effector, InteractionObject interactionObject) { lookAt.Look(interactionObject.lookAtTarget, Time.time + interactionObject.length * 0.5f); } public void OnTriggerEnter(Collider c) { if (!((Object)(object)fullBody == (Object)null)) { InteractionTrigger component = ((Component)c).GetComponent(); if (!((Object)(object)component == (Object)null) && !inContact.Contains(component)) { inContact.Add(component); } } } public void OnTriggerExit(Collider c) { if (!((Object)(object)fullBody == (Object)null)) { InteractionTrigger component = ((Component)c).GetComponent(); if (!((Object)(object)component == (Object)null)) { inContact.Remove(component); } } } private bool ContactIsInRange(int index, out int bestRangeIndex) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) bestRangeIndex = -1; if (!IsValid(log: true)) { return false; } if (index < 0 || index >= inContact.Count) { Warning.Log("Index out of range.", ((Component)this).transform); return false; } if ((Object)(object)inContact[index] == (Object)null) { Warning.Log("The InteractionTrigger in the list 'inContact' has been destroyed", ((Component)this).transform); return false; } bestRangeIndex = inContact[index].GetBestRangeIndex(((Component)this).transform, FPSCamera, raycastHit); if (bestRangeIndex == -1) { return false; } return true; } private void OnDrawGizmosSelected() { if (!Application.isPlaying) { if ((Object)(object)fullBody == (Object)null) { fullBody = ((Component)this).GetComponent(); } if ((Object)(object)characterCollider == (Object)null) { characterCollider = ((Component)this).GetComponent(); } } } public void Update() { if ((Object)(object)fullBody == (Object)null) { return; } UpdateTriggerEventBroadcasting(); Raycasting(); triggersInRange.Clear(); bestRangeIndexes.Clear(); for (int i = 0; i < inContact.Count; i++) { int bestRangeIndex = -1; if ((Object)(object)inContact[i] != (Object)null && ((Component)inContact[i]).gameObject.activeInHierarchy && ContactIsInRange(i, out bestRangeIndex)) { triggersInRange.Add(inContact[i]); bestRangeIndexes.Add(bestRangeIndex); } } lookAt.Update(); } private void Raycasting() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (LayerMask.op_Implicit(camRaycastLayers) != -1 && !((Object)(object)FPSCamera == (Object)null)) { Physics.Raycast(FPSCamera.position, FPSCamera.forward, ref raycastHit, camRaycastDistance, LayerMask.op_Implicit(camRaycastLayers)); } } private void UpdateTriggerEventBroadcasting() { if ((Object)(object)characterCollider == (Object)null) { characterCollider = c; } if ((Object)(object)characterCollider != (Object)null && (Object)(object)characterCollider != (Object)(object)c) { if ((Object)(object)((Component)characterCollider).GetComponent() == (Object)null) { ((Component)characterCollider).gameObject.AddComponent().target = ((Component)this).gameObject; } if ((Object)(object)lastCollider != (Object)null && (Object)(object)lastCollider != (Object)(object)c && (Object)(object)lastCollider != (Object)(object)characterCollider) { TriggerEventBroadcaster component = ((Component)lastCollider).GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } } lastCollider = characterCollider; } private void UpdateEffectors() { if (!((Object)(object)fullBody == (Object)null)) { for (int i = 0; i < interactionEffectors.Length; i++) { interactionEffectors[i].Update(((Component)this).transform, speed); } for (int j = 0; j < interactionEffectors.Length; j++) { interactionEffectors[j].ResetToDefaults(resetToDefaultsSpeed * speed); } } } private void OnPreFBBIK() { if (!((Object)(object)fullBody == (Object)null)) { lookAt.SolveSpine(); UpdateEffectors(); } } private void OnPostFBBIK() { if (!((Object)(object)fullBody == (Object)null)) { for (int i = 0; i < interactionEffectors.Length; i++) { interactionEffectors[i].OnPostFBBIK(); } lookAt.SolveHead(); } } private void OnFixTransforms() { lookAt.OnFixTransforms(); } private void OnDestroy() { if (!((Object)(object)fullBody == (Object)null)) { IKSolverFullBodyBiped solver = fullBody.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPreUpdate, new IKSolver.UpdateDelegate(OnPreFBBIK)); IKSolverFullBodyBiped solver2 = fullBody.solver; solver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver2.OnPostUpdate, new IKSolver.UpdateDelegate(OnPostFBBIK)); IKSolverFullBodyBiped solver3 = fullBody.solver; solver3.OnFixTransforms = (IKSolver.UpdateDelegate)Delegate.Remove(solver3.OnFixTransforms, new IKSolver.UpdateDelegate(OnFixTransforms)); OnInteractionStart = (InteractionDelegate)Delegate.Remove(OnInteractionStart, new InteractionDelegate(LookAtInteraction)); OnInteractionPause = (InteractionDelegate)Delegate.Remove(OnInteractionPause, new InteractionDelegate(InteractionPause)); OnInteractionResume = (InteractionDelegate)Delegate.Remove(OnInteractionResume, new InteractionDelegate(InteractionResume)); OnInteractionStop = (InteractionDelegate)Delegate.Remove(OnInteractionStop, new InteractionDelegate(InteractionStop)); } } private bool IsValid(bool log) { if ((Object)(object)fullBody == (Object)null) { if (log) { Warning.Log("FBBIK is null. Will not update the InteractionSystem", ((Component)this).transform); } return false; } if (!initiated) { if (log) { Warning.Log("The InteractionSystem has not been initiated yet.", ((Component)this).transform); } return false; } return true; } private bool TriggerIndexIsValid(int index) { if (index < 0 || index >= triggersInRange.Count) { Warning.Log("Index out of range.", ((Component)this).transform); return false; } if ((Object)(object)triggersInRange[index] == (Object)null) { Warning.Log("The InteractionTrigger in the list 'inContact' has been destroyed", ((Component)this).transform); return false; } return true; } } [HelpURL("https://www.youtube.com/watch?v=r5jiZnsDH3M")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Interaction System/Interaction Target")] public class InteractionTarget : MonoBehaviour { [Serializable] public enum RotationMode { TwoDOF, ThreeDOF } [Serializable] public class Multiplier { [Tooltip("The curve type (InteractionObject.WeightCurve.Type).")] public InteractionObject.WeightCurve.Type curve; [Tooltip("Multiplier of the curve's value.")] public float multiplier; } [Tooltip("The type of the FBBIK effector.")] public FullBodyBipedEffector effectorType; [Tooltip("InteractionObject weight curve multipliers for this effector target.")] public Multiplier[] multipliers; [Tooltip("The interaction speed multiplier for this effector. This can be used to make interactions faster/slower for specific effectors.")] public float interactionSpeedMlp = 1f; [Tooltip("The pivot to twist/swing this interaction target about. For symmetric objects that can be interacted with from a certain angular range.")] public Transform pivot; [Tooltip("2 or 3 degrees of freedom to match this InteractionTarget's rotation to the effector bone rotation.")] public RotationMode rotationMode; [Tooltip("The axis of twisting the interaction target (blue line).")] public Vector3 twistAxis = Vector3.up; [Tooltip("The weight of twisting the interaction target towards the effector bone in the start of the interaction.")] public float twistWeight = 1f; [Tooltip("The weight of swinging the interaction target towards the effector bone in the start of the interaction. Swing is defined as a 3-DOF rotation around any axis, while twist is only around the twist axis.")] public float swingWeight; [Tooltip("The weight of rotating this InteractionTarget to the effector bone in the start of the interaction (and during if 'Rotate Once' is disabled")] [Range(0f, 1f)] public float threeDOFWeight = 1f; [Tooltip("If true, will twist/swing around the pivot only once at the start of the interaction. If false, will continue rotating throuout the whole interaction.")] public bool rotateOnce = true; private Quaternion defaultLocalRotation; private Transform lastPivot; [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page10.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_interaction_target.html"); } [ContextMenu("TUTORIAL VIDEO (PART 1: BASICS)")] private void OpenTutorial1() { Application.OpenURL("https://www.youtube.com/watch?v=r5jiZnsDH3M"); } [ContextMenu("TUTORIAL VIDEO (PART 2: PICKING UP...)")] private void OpenTutorial2() { Application.OpenURL("https://www.youtube.com/watch?v=eP9-zycoHLk"); } [ContextMenu("TUTORIAL VIDEO (PART 3: ANIMATION)")] private void OpenTutorial3() { Application.OpenURL("https://www.youtube.com/watch?v=sQfB2RcT1T4&index=14&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("TUTORIAL VIDEO (PART 4: TRIGGERS)")] private void OpenTutorial4() { Application.OpenURL("https://www.youtube.com/watch?v=-TDZpNjt2mk&index=15&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public float GetValue(InteractionObject.WeightCurve.Type curveType) { for (int i = 0; i < multipliers.Length; i++) { if (multipliers[i].curve == curveType) { return multipliers[i].multiplier; } } return 1f; } public void ResetRotation() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pivot != (Object)null) { pivot.localRotation = defaultLocalRotation; } } public void RotateTo(Transform bone) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pivot == (Object)null) { return; } if ((Object)(object)pivot != (Object)(object)lastPivot) { defaultLocalRotation = pivot.localRotation; lastPivot = pivot; } pivot.localRotation = defaultLocalRotation; switch (rotationMode) { case RotationMode.TwoDOF: if (twistWeight > 0f) { Vector3 fromDirection = ((Component)this).transform.position - pivot.position; Vector3 val2 = pivot.rotation * twistAxis; Vector3 val3 = val2; Vector3.OrthoNormalize(ref val3, ref fromDirection); val3 = val2; Vector3 toDirection = bone.position - pivot.position; Vector3.OrthoNormalize(ref val3, ref toDirection); Quaternion val4 = QuaTools.FromToAroundAxis(fromDirection, toDirection, val2); pivot.rotation = Quaternion.Lerp(Quaternion.identity, val4, twistWeight) * pivot.rotation; } if (swingWeight > 0f) { Quaternion val5 = Quaternion.FromToRotation(((Component)this).transform.position - pivot.position, bone.position - pivot.position); pivot.rotation = Quaternion.Lerp(Quaternion.identity, val5, swingWeight) * pivot.rotation; } break; case RotationMode.ThreeDOF: if (!(threeDOFWeight <= 0f)) { Quaternion val = QuaTools.FromToRotation(((Component)this).transform.rotation, bone.rotation); if (threeDOFWeight >= 1f) { pivot.rotation = val * pivot.rotation; } else { pivot.rotation = Quaternion.Slerp(Quaternion.identity, val, threeDOFWeight) * pivot.rotation; } } break; } } } [HelpURL("https://www.youtube.com/watch?v=-TDZpNjt2mk&index=15&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Interaction System/Interaction Trigger")] public class InteractionTrigger : MonoBehaviour { [Serializable] public class CharacterPosition { [Tooltip("If false, will not care where the character stands, as long as it is in contact with the trigger collider.")] public bool use; [Tooltip("The offset of the character's position relative to the trigger in XZ plane. Y position of the character is unlimited as long as it is contact with the collider.")] public Vector2 offset; [Tooltip("Angle offset from the default forward direction.")] [Range(-180f, 180f)] public float angleOffset; [Tooltip("Max angular offset of the character's forward from the direction of this trigger.")] [Range(0f, 180f)] public float maxAngle = 45f; [Tooltip("Max offset of the character's position from this range's center.")] public float radius = 0.5f; [Tooltip("If true, will rotate the trigger around it's Y axis relative to the position of the character, so the object can be interacted with from all sides.")] public bool orbit; [Tooltip("Fixes the Y axis of the trigger to Vector3.up. This makes the trigger symmetrical relative to the object. For example a gun will be able to be picked up from the same direction relative to the barrel no matter which side the gun is resting on.")] public bool fixYAxis; public Vector3 offset3D => new Vector3(offset.x, 0f, offset.y); public Vector3 direction3D => Quaternion.AngleAxis(angleOffset, Vector3.up) * Vector3.forward; public bool IsInRange(Transform character, Transform trigger, out float error) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) error = 0f; if (!use) { return true; } error = 180f; if (radius <= 0f) { return false; } if (maxAngle <= 0f) { return false; } Vector3 forward = trigger.forward; if (fixYAxis) { forward.y = 0f; } if (forward == Vector3.zero) { return false; } Vector3 val = (fixYAxis ? Vector3.up : trigger.up); Quaternion val2 = Quaternion.LookRotation(forward, val); Vector3 val3 = trigger.position + val2 * offset3D; Vector3 val4 = (orbit ? trigger.position : val3); Vector3 val5 = character.position - val4; Vector3.OrthoNormalize(ref val, ref val5); Vector3 val6 = val5; Vector3 val7 = Vector3.Project(character.position - val4, val5); val5 = val6 * ((Vector3)(ref val7)).magnitude; if (orbit) { float magnitude = ((Vector2)(ref offset)).magnitude; float magnitude2 = ((Vector3)(ref val5)).magnitude; if (magnitude2 < magnitude - radius || magnitude2 > magnitude + radius) { return false; } } else if (((Vector3)(ref val5)).magnitude > radius) { return false; } Vector3 val8 = val2 * direction3D; Vector3.OrthoNormalize(ref val, ref val8); if (orbit) { Vector3 val9 = val3 - trigger.position; if (val9 == Vector3.zero) { val9 = Vector3.forward; } val5 = Quaternion.Inverse(Quaternion.LookRotation(val9, val)) * val5; val8 = Quaternion.AngleAxis(Mathf.Atan2(val5.x, val5.z) * 57.29578f, val) * val8; } float num = Vector3.Angle(val8, character.forward); if (num > maxAngle) { return false; } error = num / maxAngle * 180f; return true; } } [Serializable] public class CameraPosition { [Tooltip("What the camera should be looking at to trigger the interaction? If null, this camera position will not be used.")] public Collider lookAtTarget; [Tooltip("The direction from the lookAtTarget towards the camera (in lookAtTarget's space).")] public Vector3 direction = -Vector3.forward; [Tooltip("Max distance from the lookAtTarget to the camera.")] public float maxDistance = 0.5f; [Tooltip("Max angle between the direction and the direction towards the camera.")] [Range(0f, 180f)] public float maxAngle = 45f; [Tooltip("Fixes the Y axis of the trigger to Vector3.up. This makes the trigger symmetrical relative to the object.")] public bool fixYAxis; public Quaternion GetRotation() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) Vector3 forward = ((Component)lookAtTarget).transform.forward; if (fixYAxis) { forward.y = 0f; } if (forward == Vector3.zero) { return Quaternion.identity; } Vector3 val = (fixYAxis ? Vector3.up : ((Component)lookAtTarget).transform.up); return Quaternion.LookRotation(forward, val); } public bool IsInRange(Transform raycastFrom, RaycastHit hit, Transform trigger, out float error) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) error = 0f; if ((Object)(object)lookAtTarget == (Object)null) { return true; } error = 180f; if ((Object)(object)raycastFrom == (Object)null) { return false; } if ((Object)(object)((RaycastHit)(ref hit)).collider != (Object)(object)lookAtTarget) { return false; } if (((RaycastHit)(ref hit)).distance > maxDistance) { return false; } if (direction == Vector3.zero) { return false; } if (maxDistance <= 0f) { return false; } if (maxAngle <= 0f) { return false; } Vector3 val = GetRotation() * direction; float num = Vector3.Angle(raycastFrom.position - ((RaycastHit)(ref hit)).point, val); if (num > maxAngle) { return false; } error = num / maxAngle * 180f; return true; } } [Serializable] public class Range { [Serializable] public class Interaction { [Tooltip("The InteractionObject to interact with.")] public InteractionObject interactionObject; [Tooltip("The effectors to interact with.")] public FullBodyBipedEffector[] effectors; } [HideInInspector] public string name; [HideInInspector] public bool show = true; [Tooltip("The range for the character's position and rotation.")] public CharacterPosition characterPosition; [Tooltip("The range for the character camera's position and rotation.")] public CameraPosition cameraPosition; [Tooltip("Definitions of the interactions associated with this range.")] public Interaction[] interactions; public bool IsInRange(Transform character, Transform raycastFrom, RaycastHit raycastHit, Transform trigger, out float maxError) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) maxError = 0f; float error = 0f; float error2 = 0f; if (!characterPosition.IsInRange(character, trigger, out error)) { return false; } if (!cameraPosition.IsInRange(raycastFrom, raycastHit, trigger, out error2)) { return false; } maxError = Mathf.Max(error, error2); return true; } } [Tooltip("The valid ranges of the character's and/or it's camera's position for triggering interaction when the character is in contact with the collider of this trigger.")] public Range[] ranges = new Range[0]; [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page10.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_interaction_trigger.html"); } [ContextMenu("TUTORIAL VIDEO")] private void OpenTutorial4() { Application.OpenURL("https://www.youtube.com/watch?v=-TDZpNjt2mk&index=15&list=PLVxSIA1OaTOu8Nos3CalXbJ2DrKnntMv6"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public int GetBestRangeIndex(Transform character, Transform raycastFrom, RaycastHit raycastHit) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)this).GetComponent() == (Object)null) { Warning.Log("Using the InteractionTrigger requires a Collider component.", ((Component)this).transform); return -1; } int result = -1; float num = 180f; float maxError = 0f; for (int i = 0; i < ranges.Length; i++) { if (ranges[i].IsInRange(character, raycastFrom, raycastHit, ((Component)this).transform, out maxError) && maxError <= num) { num = maxError; result = i; } } return result; } } public class GenericPoser : Poser { [Serializable] public class Map { public Transform bone; public Transform target; private Vector3 defaultLocalPosition; private Quaternion defaultLocalRotation; public Map(Transform bone, Transform target) { this.bone = bone; this.target = target; StoreDefaultState(); } public void StoreDefaultState() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) defaultLocalPosition = bone.localPosition; defaultLocalRotation = bone.localRotation; } public void FixTransform() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) bone.localPosition = defaultLocalPosition; bone.localRotation = defaultLocalRotation; } public void Update(float localRotationWeight, float localPositionWeight) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) bone.localRotation = Quaternion.Lerp(bone.localRotation, target.localRotation, localRotationWeight); bone.localPosition = Vector3.Lerp(bone.localPosition, target.localPosition, localPositionWeight); } } public Map[] maps; [ContextMenu("Auto-Mapping")] public override void AutoMapping() { if ((Object)(object)poseRoot == (Object)null) { maps = new Map[0]; return; } maps = new Map[0]; Transform[] componentsInChildren = ((Component)((Component)this).transform).GetComponentsInChildren(); Transform[] componentsInChildren2 = ((Component)poseRoot).GetComponentsInChildren(); for (int i = 1; i < componentsInChildren.Length; i++) { Transform targetNamed = GetTargetNamed(((Object)componentsInChildren[i]).name, componentsInChildren2); if ((Object)(object)targetNamed != (Object)null) { Array.Resize(ref maps, maps.Length + 1); maps[maps.Length - 1] = new Map(componentsInChildren[i], targetNamed); } } StoreDefaultState(); } protected override void InitiatePoser() { StoreDefaultState(); } protected override void UpdatePoser() { if (!(weight <= 0f) && (!(localPositionWeight <= 0f) || !(localRotationWeight <= 0f)) && !((Object)(object)poseRoot == (Object)null)) { float num = localRotationWeight * weight; float num2 = localPositionWeight * weight; for (int i = 0; i < maps.Length; i++) { maps[i].Update(num, num2); } } } protected override void FixPoserTransforms() { for (int i = 0; i < maps.Length; i++) { maps[i].FixTransform(); } } private void StoreDefaultState() { for (int i = 0; i < maps.Length; i++) { maps[i].StoreDefaultState(); } } private Transform GetTargetNamed(string tName, Transform[] array) { for (int i = 0; i < array.Length; i++) { if (((Object)array[i]).name == tName) { return array[i]; } } return null; } } public class HandPoser : Poser { protected Transform[] children; private Transform _poseRoot; private Transform[] poseChildren; private Vector3[] defaultLocalPositions; private Quaternion[] defaultLocalRotations; public override void AutoMapping() { if ((Object)(object)poseRoot == (Object)null) { poseChildren = (Transform[])(object)new Transform[0]; } else { poseChildren = ((Component)poseRoot).GetComponentsInChildren(); } _poseRoot = poseRoot; } protected override void InitiatePoser() { children = ((Component)this).GetComponentsInChildren(); StoreDefaultState(); } protected override void FixPoserTransforms() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < children.Length; i++) { children[i].localPosition = defaultLocalPositions[i]; children[i].localRotation = defaultLocalRotations[i]; } } protected override void UpdatePoser() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) if (weight <= 0f || (localPositionWeight <= 0f && localRotationWeight <= 0f)) { return; } if ((Object)(object)_poseRoot != (Object)(object)poseRoot) { AutoMapping(); } if ((Object)(object)poseRoot == (Object)null) { return; } if (children.Length != poseChildren.Length) { Warning.Log("Number of children does not match with the pose", ((Component)this).transform); return; } float num = localRotationWeight * weight; float num2 = localPositionWeight * weight; for (int i = 0; i < children.Length; i++) { if ((Object)(object)children[i] != (Object)(object)((Component)this).transform) { children[i].localRotation = Quaternion.Lerp(children[i].localRotation, poseChildren[i].localRotation, num); children[i].localPosition = Vector3.Lerp(children[i].localPosition, poseChildren[i].localPosition, num2); } } } protected void StoreDefaultState() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) defaultLocalPositions = (Vector3[])(object)new Vector3[children.Length]; defaultLocalRotations = (Quaternion[])(object)new Quaternion[children.Length]; for (int i = 0; i < children.Length; i++) { defaultLocalPositions[i] = children[i].localPosition; defaultLocalRotations[i] = children[i].localRotation; } } } public abstract class Poser : SolverManager { public Transform poseRoot; [Range(0f, 1f)] public float weight = 1f; [Range(0f, 1f)] public float localRotationWeight = 1f; [Range(0f, 1f)] public float localPositionWeight; private bool initiated; public abstract void AutoMapping(); public void UpdateManual() { UpdatePoser(); } protected abstract void InitiatePoser(); protected abstract void UpdatePoser(); protected abstract void FixPoserTransforms(); protected override void UpdateSolver() { if (!initiated) { InitiateSolver(); } if (initiated) { UpdatePoser(); } } protected override void InitiateSolver() { if (!initiated) { InitiatePoser(); initiated = true; } } protected override void FixTransforms() { if (initiated) { FixPoserTransforms(); } } } public class RagdollUtility : MonoBehaviour { public class Rigidbone { public Rigidbody r; public Transform t; public Collider collider; public Joint joint; public Rigidbody c; public bool updateAnchor; public Vector3 deltaPosition; public Quaternion deltaRotation; public float deltaTime; public Vector3 lastPosition; public Quaternion lastRotation; public Rigidbone(Rigidbody r) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) this.r = r; t = ((Component)r).transform; joint = ((Component)t).GetComponent(); collider = ((Component)t).GetComponent(); if ((Object)(object)joint != (Object)null) { c = joint.connectedBody; updateAnchor = (Object)(object)c != (Object)null; } lastPosition = t.position; lastRotation = t.rotation; } public void RecordVelocity() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) deltaPosition = t.position - lastPosition; lastPosition = t.position; deltaRotation = QuaTools.FromToRotation(lastRotation, t.rotation); lastRotation = t.rotation; deltaTime = Time.deltaTime; } public void WakeUp(float velocityWeight, float angularVelocityWeight) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) if (updateAnchor) { joint.connectedAnchor = t.InverseTransformPoint(c.position); } r.isKinematic = false; if (velocityWeight != 0f) { r.velocity = deltaPosition / deltaTime * velocityWeight; } if (angularVelocityWeight != 0f) { float num = 0f; Vector3 zero = Vector3.zero; ((Quaternion)(ref deltaRotation)).ToAngleAxis(ref num, ref zero); num *= MathF.PI / 180f; num /= deltaTime; zero *= num * angularVelocityWeight; r.angularVelocity = Vector3.ClampMagnitude(zero, r.maxAngularVelocity); } r.WakeUp(); } } public class Child { public Transform t; public Vector3 localPosition; public Quaternion localRotation; public Child(Transform transform) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) t = transform; localPosition = t.localPosition; localRotation = t.localRotation; } public void FixTransform(float weight) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!(weight <= 0f)) { if (weight >= 1f) { t.localPosition = localPosition; t.localRotation = localRotation; } else { t.localPosition = Vector3.Lerp(t.localPosition, localPosition, weight); t.localRotation = Quaternion.Lerp(t.localRotation, localRotation, weight); } } } public void StoreLocalState() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) localPosition = t.localPosition; localRotation = t.localRotation; } } [Tooltip("If you have multiple IK components, then this should be the one that solves last each frame.")] public IK ik; [Tooltip("How long does it take to blend from ragdoll to animation?")] public float ragdollToAnimationTime = 0.2f; [Tooltip("If true, IK can be used on top of physical ragdoll simulation.")] public bool applyIkOnRagdoll; [Tooltip("How much velocity transfer from animation to ragdoll?")] public float applyVelocity = 1f; [Tooltip("How much angular velocity to transfer from animation to ragdoll?")] public float applyAngularVelocity = 1f; private Animator animator; private Rigidbone[] rigidbones = new Rigidbone[0]; private Child[] children = new Child[0]; private bool enableRagdollFlag; private AnimatorUpdateMode animatorUpdateMode; private IK[] allIKComponents = new IK[0]; private bool[] fixTransforms = new bool[0]; private float ragdollWeight; private float ragdollWeightV; private bool fixedFrame; private bool[] disabledIKComponents = new bool[0]; private bool isRagdoll { get { if (!rigidbones[0].r.isKinematic) { return !((Behaviour)animator).enabled; } return false; } } private bool ikUsed { get { if ((Object)(object)ik == (Object)null) { return false; } if (((Behaviour)ik).enabled && ik.GetIKSolver().IKPositionWeight > 0f) { return true; } IK[] array = allIKComponents; foreach (IK iK in array) { if (((Behaviour)iK).enabled && iK.GetIKSolver().IKPositionWeight > 0f) { return true; } } return false; } } public void EnableRagdoll() { if (!isRagdoll) { ((MonoBehaviour)this).StopAllCoroutines(); enableRagdollFlag = true; } } public void DisableRagdoll() { if (isRagdoll) { StoreLocalState(); ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(DisableRagdollSmooth()); } } public void Start() { animator = ((Component)this).GetComponent(); allIKComponents = ((Component)this).GetComponentsInChildren(); disabledIKComponents = new bool[allIKComponents.Length]; fixTransforms = new bool[allIKComponents.Length]; if ((Object)(object)ik != (Object)null) { IKSolver iKSolver = ik.GetIKSolver(); iKSolver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(iKSolver.OnPostUpdate, new IKSolver.UpdateDelegate(AfterLastIK)); } Rigidbody[] componentsInChildren = ((Component)this).GetComponentsInChildren(); int num = (((Object)(object)((Component)componentsInChildren[0]).gameObject == (Object)(object)((Component)this).gameObject) ? 1 : 0); rigidbones = new Rigidbone[(num == 0) ? componentsInChildren.Length : (componentsInChildren.Length - 1)]; for (int i = 0; i < rigidbones.Length; i++) { rigidbones[i] = new Rigidbone(componentsInChildren[i + num]); } Transform[] componentsInChildren2 = ((Component)this).GetComponentsInChildren(); children = new Child[componentsInChildren2.Length - 1]; for (int j = 0; j < children.Length; j++) { children[j] = new Child(componentsInChildren2[j + 1]); } } private IEnumerator DisableRagdollSmooth() { for (int i = 0; i < rigidbones.Length; i++) { rigidbones[i].r.isKinematic = true; } for (int j = 0; j < allIKComponents.Length; j++) { allIKComponents[j].fixTransforms = fixTransforms[j]; if (disabledIKComponents[j]) { ((Behaviour)allIKComponents[j]).enabled = true; } } animator.updateMode = animatorUpdateMode; ((Behaviour)animator).enabled = true; while (ragdollWeight > 0f) { ragdollWeight = Mathf.SmoothDamp(ragdollWeight, 0f, ref ragdollWeightV, ragdollToAnimationTime); if (ragdollWeight < 0.001f) { ragdollWeight = 0f; } yield return null; } yield return null; } private void Update() { if (!isRagdoll) { return; } if (!applyIkOnRagdoll) { bool flag = false; for (int i = 0; i < allIKComponents.Length; i++) { if (((Behaviour)allIKComponents[i]).enabled) { flag = true; break; } } if (flag) { for (int j = 0; j < allIKComponents.Length; j++) { disabledIKComponents[j] = false; } } for (int k = 0; k < allIKComponents.Length; k++) { if (((Behaviour)allIKComponents[k]).enabled) { ((Behaviour)allIKComponents[k]).enabled = false; disabledIKComponents[k] = true; } } return; } bool flag2 = false; for (int l = 0; l < allIKComponents.Length; l++) { if (disabledIKComponents[l]) { flag2 = true; break; } } if (!flag2) { return; } for (int m = 0; m < allIKComponents.Length; m++) { if (disabledIKComponents[m]) { ((Behaviour)allIKComponents[m]).enabled = true; } } for (int n = 0; n < allIKComponents.Length; n++) { disabledIKComponents[n] = false; } } private void FixedUpdate() { if (isRagdoll && applyIkOnRagdoll) { FixTransforms(1f); } fixedFrame = true; } private void LateUpdate() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if ((int)animator.updateMode != 1 || ((int)animator.updateMode == 1 && fixedFrame)) { AfterAnimation(); } fixedFrame = false; if (!ikUsed) { OnFinalPose(); } } private void AfterLastIK() { if (ikUsed) { OnFinalPose(); } } private void AfterAnimation() { if (isRagdoll) { StoreLocalState(); } else { FixTransforms(ragdollWeight); } } private void OnFinalPose() { if (!isRagdoll) { RecordVelocities(); } if (enableRagdollFlag) { RagdollEnabler(); } } private void RagdollEnabler() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) StoreLocalState(); for (int i = 0; i < allIKComponents.Length; i++) { disabledIKComponents[i] = false; } if (!applyIkOnRagdoll) { for (int j = 0; j < allIKComponents.Length; j++) { if (((Behaviour)allIKComponents[j]).enabled) { ((Behaviour)allIKComponents[j]).enabled = false; disabledIKComponents[j] = true; } } } animatorUpdateMode = animator.updateMode; animator.updateMode = (AnimatorUpdateMode)1; ((Behaviour)animator).enabled = false; for (int k = 0; k < rigidbones.Length; k++) { rigidbones[k].WakeUp(applyVelocity, applyAngularVelocity); } for (int l = 0; l < fixTransforms.Length; l++) { fixTransforms[l] = allIKComponents[l].fixTransforms; allIKComponents[l].fixTransforms = false; } ragdollWeight = 1f; ragdollWeightV = 0f; enableRagdollFlag = false; } private void RecordVelocities() { Rigidbone[] array = rigidbones; for (int i = 0; i < array.Length; i++) { array[i].RecordVelocity(); } } private void StoreLocalState() { Child[] array = children; for (int i = 0; i < array.Length; i++) { array[i].StoreLocalState(); } } private void FixTransforms(float weight) { Child[] array = children; for (int i = 0; i < array.Length; i++) { array[i].FixTransform(weight); } } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolver iKSolver = ik.GetIKSolver(); iKSolver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(iKSolver.OnPostUpdate, new IKSolver.UpdateDelegate(AfterLastIK)); } } } public abstract class RotationLimit : MonoBehaviour { public Vector3 axis = Vector3.forward; [HideInInspector] public Quaternion defaultLocalRotation; private bool initiated; private bool applicationQuit; private bool defaultLocalRotationSet; public Vector3 secondaryAxis => new Vector3(axis.y, axis.z, axis.x); public Vector3 crossAxis => Vector3.Cross(axis, secondaryAxis); public bool defaultLocalRotationOverride { get; private set; } public void SetDefaultLocalRotation() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) defaultLocalRotation = ((Component)this).transform.localRotation; defaultLocalRotationSet = true; defaultLocalRotationOverride = false; } public void SetDefaultLocalRotation(Quaternion localRotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) defaultLocalRotation = localRotation; defaultLocalRotationSet = true; defaultLocalRotationOverride = true; } public Quaternion GetLimitedLocalRotation(Quaternion localRotation, out bool changed) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (!initiated) { Awake(); } Quaternion val = Quaternion.Inverse(defaultLocalRotation) * localRotation; Quaternion val2 = LimitRotation(val); val2 = Quaternion.Normalize(val2); changed = val2 != val; if (!changed) { return localRotation; } return defaultLocalRotation * val2; } public bool Apply() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) bool changed = false; ((Component)this).transform.localRotation = GetLimitedLocalRotation(((Component)this).transform.localRotation, out changed); return changed; } public void Disable() { if (initiated) { ((Behaviour)this).enabled = false; return; } Awake(); ((Behaviour)this).enabled = false; } protected abstract Quaternion LimitRotation(Quaternion rotation); private void Awake() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!defaultLocalRotationSet) { SetDefaultLocalRotation(); } if (axis == Vector3.zero) { Debug.LogError((object)"Axis is Vector3.zero."); } initiated = true; } private void LateUpdate() { Apply(); } public void LogWarning(string message) { Warning.Log(message, ((Component)this).transform); } protected static Quaternion Limit1DOF(Quaternion rotation, Vector3 axis) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return Quaternion.FromToRotation(rotation * axis, axis) * rotation; } protected static Quaternion LimitTwist(Quaternion rotation, Vector3 axis, Vector3 orthoAxis, float twistLimit) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) twistLimit = Mathf.Clamp(twistLimit, 0f, 180f); if (twistLimit >= 180f) { return rotation; } Vector3 val = rotation * axis; Vector3 val2 = orthoAxis; Vector3.OrthoNormalize(ref val, ref val2); Vector3 val3 = rotation * orthoAxis; Vector3.OrthoNormalize(ref val, ref val3); Quaternion val4 = Quaternion.FromToRotation(val3, val2) * rotation; if (twistLimit <= 0f) { return val4; } return Quaternion.RotateTowards(val4, rotation, twistLimit); } protected static float GetOrthogonalAngle(Vector3 v1, Vector3 v2, Vector3 normal) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) Vector3.OrthoNormalize(ref normal, ref v1); Vector3.OrthoNormalize(ref normal, ref v2); return Vector3.Angle(v1, v2); } } [HelpURL("http://www.root-motion.com/finalikdox/html/page14.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Rotation Limits/Rotation Limit Angle")] public class RotationLimitAngle : RotationLimit { [Range(0f, 180f)] public float limit = 45f; [Range(0f, 180f)] public float twistLimit = 180f; [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page14.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_rotation_limit_angle.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } protected override Quaternion LimitRotation(Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) return RotationLimit.LimitTwist(LimitSwing(rotation), axis, base.secondaryAxis, twistLimit); } private Quaternion LimitSwing(Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (axis == Vector3.zero) { return rotation; } if (rotation == Quaternion.identity) { return rotation; } if (limit >= 180f) { return rotation; } Vector3 val = rotation * axis; Quaternion val2 = Quaternion.FromToRotation(axis, val); Quaternion val3 = Quaternion.RotateTowards(Quaternion.identity, val2, limit); return Quaternion.FromToRotation(val, val3 * axis) * rotation; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page14.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Rotation Limits/Rotation Limit Hinge")] public class RotationLimitHinge : RotationLimit { public bool useLimits = true; public float min = -45f; public float max = 90f; [HideInInspector] public float zeroAxisDisplayOffset; private float lastAngle; [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page14.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_rotation_limit_hinge.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } protected override Quaternion LimitRotation(Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) return LimitHinge(rotation); } private Quaternion LimitHinge(Quaternion rotation) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (min == 0f && max == 0f && useLimits) { return Quaternion.AngleAxis(0f, axis); } Quaternion val = RotationLimit.Limit1DOF(rotation, axis); if (!useLimits) { return val; } Vector3 val2 = Quaternion.Inverse(Quaternion.AngleAxis(lastAngle, axis) * Quaternion.LookRotation(base.secondaryAxis, axis)) * val * base.secondaryAxis; float num = Mathf.Atan2(val2.x, val2.z) * 57.29578f; lastAngle = Mathf.Clamp(lastAngle + num, min, max); return Quaternion.AngleAxis(lastAngle, axis); } } [HelpURL("http://www.root-motion.com/finalikdox/html/page14.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Rotation Limits/Rotation Limit Polygonal")] public class RotationLimitPolygonal : RotationLimit { [Serializable] public class ReachCone { public Vector3[] tetrahedron; public float volume; public Vector3 S; public Vector3 B; public Vector3 o => tetrahedron[0]; public Vector3 a => tetrahedron[1]; public Vector3 b => tetrahedron[2]; public Vector3 c => tetrahedron[3]; public bool isValid => volume > 0f; public ReachCone(Vector3 _o, Vector3 _a, Vector3 _b, Vector3 _c) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) tetrahedron = (Vector3[])(object)new Vector3[4]; tetrahedron[0] = _o; tetrahedron[1] = _a; tetrahedron[2] = _b; tetrahedron[3] = _c; volume = 0f; S = Vector3.zero; B = Vector3.zero; } public void Calculate() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(a, b); volume = Vector3.Dot(val, c) / 6f; Vector3 val2 = Vector3.Cross(a, b); S = ((Vector3)(ref val2)).normalized; val2 = Vector3.Cross(b, c); B = ((Vector3)(ref val2)).normalized; } } [Serializable] public class LimitPoint { public Vector3 point; public float tangentWeight; public LimitPoint() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) point = Vector3.forward; tangentWeight = 1f; } } [Range(0f, 180f)] public float twistLimit = 180f; [Range(0f, 3f)] public int smoothIterations; [HideInInspector] public LimitPoint[] points; [HideInInspector] public Vector3[] P; [HideInInspector] public ReachCone[] reachCones = new ReachCone[0]; [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page14.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_rotation_limit_polygonal.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public void SetLimitPoints(LimitPoint[] points) { if (points.Length < 3) { LogWarning("The polygon must have at least 3 Limit Points."); return; } this.points = points; BuildReachCones(); } protected override Quaternion LimitRotation(Quaternion rotation) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (reachCones.Length == 0) { Start(); } return RotationLimit.LimitTwist(LimitSwing(rotation), axis, base.secondaryAxis, twistLimit); } private void Start() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) if (points.Length < 3) { ResetToDefault(); } for (int i = 0; i < reachCones.Length; i++) { if (!reachCones[i].isValid) { if (smoothIterations <= 0) { int num = 0; num = ((i < reachCones.Length - 1) ? (i + 1) : 0); LogWarning("Reach Cone {point " + i + ", point " + num + ", Origin} has negative volume. Make sure Axis vector is in the reachable area and the polygon is convex."); } else { LogWarning("One of the Reach Cones in the polygon has negative volume. Make sure Axis vector is in the reachable area and the polygon is convex."); } } } axis = ((Vector3)(ref axis)).normalized; } public void ResetToDefault() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) points = new LimitPoint[4]; for (int i = 0; i < points.Length; i++) { points[i] = new LimitPoint(); } Quaternion val = Quaternion.AngleAxis(45f, Vector3.right); Quaternion val2 = Quaternion.AngleAxis(45f, Vector3.up); points[0].point = val * val2 * axis; points[1].point = Quaternion.Inverse(val) * val2 * axis; points[2].point = Quaternion.Inverse(val) * Quaternion.Inverse(val2) * axis; points[3].point = val * Quaternion.Inverse(val2) * axis; BuildReachCones(); } public void BuildReachCones() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) smoothIterations = Mathf.Clamp(smoothIterations, 0, 3); P = (Vector3[])(object)new Vector3[points.Length]; for (int i = 0; i < points.Length; i++) { P[i] = ((Vector3)(ref points[i].point)).normalized; } for (int j = 0; j < smoothIterations; j++) { P = SmoothPoints(); } reachCones = new ReachCone[P.Length]; for (int k = 0; k < reachCones.Length - 1; k++) { reachCones[k] = new ReachCone(Vector3.zero, ((Vector3)(ref axis)).normalized, P[k], P[k + 1]); } reachCones[P.Length - 1] = new ReachCone(Vector3.zero, ((Vector3)(ref axis)).normalized, P[P.Length - 1], P[0]); for (int l = 0; l < reachCones.Length; l++) { reachCones[l].Calculate(); } } private Vector3[] SmoothPoints() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[P.Length * 2]; float scalar = GetScalar(P.Length); for (int i = 0; i < array.Length; i += 2) { array[i] = PointToTangentPlane(P[i / 2], 1f); } for (int j = 1; j < array.Length; j += 2) { Vector3 val = Vector3.zero; Vector3 zero = Vector3.zero; Vector3 val2 = Vector3.zero; if (j > 1 && j < array.Length - 2) { val = array[j - 2]; val2 = array[j + 1]; } else if (j == 1) { val = array[^2]; val2 = array[j + 1]; } else if (j == array.Length - 1) { val = array[j - 2]; val2 = array[0]; } zero = ((j >= array.Length - 1) ? array[0] : array[j + 1]); int num = array.Length / points.Length; array[j] = 0.5f * (array[j - 1] + zero) + scalar * points[j / num].tangentWeight * (zero - val) + scalar * points[j / num].tangentWeight * (array[j - 1] - val2); } for (int k = 0; k < array.Length; k++) { array[k] = TangentPointToSphere(array[k], 1f); } return array; } private float GetScalar(int k) { if (k <= 3) { return 0.1667f; } return k switch { 4 => 0.1036f, 5 => 0.085f, 6 => 0.0773f, 7 => 0.07f, _ => 0.0625f, }; } private Vector3 PointToTangentPlane(Vector3 p, float r) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Dot(axis, p); float num2 = 2f * r * r / (r * r + num); return num2 * p + (1f - num2) * -axis; } private Vector3 TangentPointToSphere(Vector3 q, float r) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Dot(q - axis, q - axis); float num2 = 4f * r * r / (4f * r * r + num); return num2 * q + (1f - num2) * -axis; } private Quaternion LimitSwing(Quaternion rotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (rotation == Quaternion.identity) { return rotation; } Vector3 val = rotation * axis; int reachCone = GetReachCone(val); if (reachCone == -1) { if (!Warning.logged) { LogWarning("RotationLimitPolygonal reach cones are invalid."); } return rotation; } if (Vector3.Dot(reachCones[reachCone].B, val) > 0f) { return rotation; } Vector3 val2 = Vector3.Cross(axis, val); val = Vector3.Cross(-reachCones[reachCone].B, val2); return Quaternion.FromToRotation(rotation * axis, val) * rotation; } private int GetReachCone(Vector3 L) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Dot(reachCones[0].S, L); for (int i = 0; i < reachCones.Length; i++) { float num2 = num; num = ((i >= reachCones.Length - 1) ? Vector3.Dot(reachCones[0].S, L) : Vector3.Dot(reachCones[i + 1].S, L)); if (num2 >= 0f && num < 0f) { return i; } } return -1; } } [HelpURL("http://www.root-motion.com/finalikdox/html/page14.html")] [AddComponentMenu("Scripts/RootMotion.FinalIK/Rotation Limits/Rotation Limit Spline")] public class RotationLimitSpline : RotationLimit { [Range(0f, 180f)] public float twistLimit = 180f; [HideInInspector] public AnimationCurve spline; [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page14.html"); } [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_rotation_limit_spline.html"); } [ContextMenu("Support Group")] private void SupportGroup() { Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik"); } [ContextMenu("Asset Store Thread")] private void ASThread() { Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/"); } public void SetSpline(Keyframe[] keyframes) { spline.keys = keyframes; } protected override Quaternion LimitRotation(Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) return RotationLimit.LimitTwist(LimitSwing(rotation), axis, base.secondaryAxis, twistLimit); } public Quaternion LimitSwing(Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (axis == Vector3.zero) { return rotation; } if (rotation == Quaternion.identity) { return rotation; } Vector3 val = rotation * axis; float num = RotationLimit.GetOrthogonalAngle(val, base.secondaryAxis, axis); if (Vector3.Dot(val, base.crossAxis) < 0f) { num = 180f + (180f - num); } float num2 = spline.Evaluate(num); Quaternion val2 = Quaternion.FromToRotation(axis, val); Quaternion val3 = Quaternion.RotateTowards(Quaternion.identity, val2, num2); return Quaternion.FromToRotation(val, val3 * axis) * rotation; } } public class AimController : MonoBehaviour { [Tooltip("Reference to the AimIK component.")] public AimIK ik; [Tooltip("Master weight of the IK solver.")] [Range(0f, 1f)] public float weight = 1f; [Header("Target Smoothing")] [Tooltip("The target to aim at. Do not use the Target transform that is assigned to AimIK. Set to null if you wish to stop aiming.")] public Transform target; [Tooltip("The time it takes to switch targets.")] public float targetSwitchSmoothTime = 0.3f; [Tooltip("The time it takes to blend in/out of AimIK weight.")] public float weightSmoothTime = 0.3f; [Header("Turning Towards The Target")] [Tooltip("Enables smooth turning towards the target according to the parameters under this header.")] public bool smoothTurnTowardsTarget = true; [Tooltip("Speed of turning towards the target using Vector3.RotateTowards.")] public float maxRadiansDelta = 3f; [Tooltip("Speed of moving towards the target using Vector3.RotateTowards.")] public float maxMagnitudeDelta = 3f; [Tooltip("Speed of slerping towards the target.")] public float slerpSpeed = 3f; [Tooltip("Smoothing time for turning towards the yaw and pitch of the target using Mathf.SmoothDampAngle. Value of 0 means smooth damping is disabled.")] public float smoothDampTime; [Tooltip("The position of the pivot that the aim target is rotated around relative to the root of the character.")] public Vector3 pivotOffsetFromRoot = Vector3.up; [Tooltip("Minimum distance of aiming from the first bone. Keeps the solver from failing if the target is too close.")] public float minDistance = 1f; [Tooltip("Offset applied to the target in world space. Convenient for scripting aiming inaccuracy.")] public Vector3 offset; [Header("RootRotation")] [Tooltip("Character root will be rotate around the Y axis to keep root forward within this angle from the aiming direction.")] [Range(0f, 180f)] public float maxRootAngle = 45f; [Tooltip("If enabled, aligns the root forward to target direction after 'Max Root Angle' has been exceeded.")] public bool turnToTarget; [Tooltip("The time of turning towards the target direction if 'Max Root Angle has been exceeded and 'Turn To Target' is enabled.")] public float turnToTargetTime = 0.2f; [Header("Mode")] [Tooltip("If true, AimIK will consider whatever the current direction of the weapon to be the forward aiming direction and work additively on top of that. This enables you to use recoil and reloading animations seamlessly with AimIK. Adjust the Vector3 value below if the weapon is not aiming perfectly forward in the aiming animation clip.")] public bool useAnimatedAimDirection; [Tooltip("The direction of the animated weapon aiming in character space. Tweak this value to adjust the aiming. 'Use Animated Aim Direction' must be enabled for this property to work.")] public Vector3 animatedAimDirection = Vector3.forward; private Transform lastTarget; private float switchWeight; private float switchWeightV; private float weightV; private Vector3 lastPosition; private Vector3 dir; private bool lastSmoothTowardsTarget; private bool turningToTarget; private float turnToTargetMlp = 1f; private float turnToTargetMlpV; private float yawV; private float pitchV; private float dirMagV; private Vector3 pivot => ((Component)ik).transform.position + ((Component)ik).transform.rotation * pivotOffsetFromRoot; private void Start() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) lastPosition = ik.solver.IKPosition; dir = ik.solver.IKPosition - pivot; ik.solver.target = null; } private void LateUpdate() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target != (Object)(object)lastTarget) { if ((Object)(object)lastTarget == (Object)null && (Object)(object)target != (Object)null && ik.solver.IKPositionWeight <= 0f) { lastPosition = target.position; dir = target.position - pivot; ik.solver.IKPosition = target.position + offset; } else { lastPosition = ik.solver.IKPosition; dir = ik.solver.IKPosition - pivot; } switchWeight = 0f; lastTarget = target; } float num = (((Object)(object)target != (Object)null) ? weight : 0f); ik.solver.IKPositionWeight = Mathf.SmoothDamp(ik.solver.IKPositionWeight, num, ref weightV, weightSmoothTime); if (ik.solver.IKPositionWeight >= 0.999f && num > ik.solver.IKPositionWeight) { ik.solver.IKPositionWeight = 1f; } if (ik.solver.IKPositionWeight <= 0.001f && num < ik.solver.IKPositionWeight) { ik.solver.IKPositionWeight = 0f; } if (ik.solver.IKPositionWeight <= 0f) { return; } switchWeight = Mathf.SmoothDamp(switchWeight, 1f, ref switchWeightV, targetSwitchSmoothTime); if (switchWeight >= 0.999f) { switchWeight = 1f; } if ((Object)(object)target != (Object)null) { ik.solver.IKPosition = Vector3.Lerp(lastPosition, target.position + offset, switchWeight); } if (smoothTurnTowardsTarget != lastSmoothTowardsTarget) { dir = ik.solver.IKPosition - pivot; lastSmoothTowardsTarget = smoothTurnTowardsTarget; } if (smoothTurnTowardsTarget) { Vector3 val = ik.solver.IKPosition - pivot; if (slerpSpeed > 0f) { dir = Vector3.Slerp(dir, val, Time.deltaTime * slerpSpeed); } if (maxRadiansDelta > 0f || maxMagnitudeDelta > 0f) { dir = Vector3.RotateTowards(dir, val, Time.deltaTime * maxRadiansDelta, maxMagnitudeDelta); } if (smoothDampTime > 0f) { float yaw = V3Tools.GetYaw(dir); float yaw2 = V3Tools.GetYaw(val); float num2 = Mathf.SmoothDampAngle(yaw, yaw2, ref yawV, smoothDampTime); float pitch = V3Tools.GetPitch(dir); float pitch2 = V3Tools.GetPitch(val); float num3 = Mathf.SmoothDampAngle(pitch, pitch2, ref pitchV, smoothDampTime); float num4 = Mathf.SmoothDamp(((Vector3)(ref dir)).magnitude, ((Vector3)(ref val)).magnitude, ref dirMagV, smoothDampTime); dir = Quaternion.Euler(num3, num2, 0f) * Vector3.forward * num4; } ik.solver.IKPosition = pivot + dir; } ApplyMinDistance(); RootRotation(); if (useAnimatedAimDirection) { ik.solver.axis = ik.solver.transform.InverseTransformVector(((Component)ik).transform.rotation * animatedAimDirection); } } private void ApplyMinDistance() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pivot; Vector3 val2 = ik.solver.IKPosition - val; val2 = ((Vector3)(ref val2)).normalized * Mathf.Max(((Vector3)(ref val2)).magnitude, minDistance); ik.solver.IKPosition = val + val2; } private void RootRotation() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Lerp(180f, maxRootAngle * turnToTargetMlp, ik.solver.IKPositionWeight); if (!(num < 180f)) { return; } Vector3 val = Quaternion.Inverse(((Component)ik).transform.rotation) * (ik.solver.IKPosition - pivot); float num2 = Mathf.Atan2(val.x, val.z) * 57.29578f; float num3 = 0f; if (num2 > num) { num3 = num2 - num; if (!turningToTarget && turnToTarget) { ((MonoBehaviour)this).StartCoroutine(TurnToTarget()); } } if (num2 < 0f - num) { num3 = num2 + num; if (!turningToTarget && turnToTarget) { ((MonoBehaviour)this).StartCoroutine(TurnToTarget()); } } ((Component)ik).transform.rotation = Quaternion.AngleAxis(num3, ((Component)ik).transform.up) * ((Component)ik).transform.rotation; } private IEnumerator TurnToTarget() { turningToTarget = true; while (turnToTargetMlp > 0f) { turnToTargetMlp = Mathf.SmoothDamp(turnToTargetMlp, 0f, ref turnToTargetMlpV, turnToTargetTime); if (turnToTargetMlp < 0.01f) { turnToTargetMlp = 0f; } yield return null; } turnToTargetMlp = 1f; turningToTarget = false; } } public class AimPoser : MonoBehaviour { [Serializable] public class Pose { public bool visualize = true; public string name; public Vector3 direction; public float yaw = 75f; public float pitch = 45f; private float angleBuffer; public bool IsInDirection(Vector3 d) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) if (direction == Vector3.zero) { return false; } if (yaw <= 0f || pitch <= 0f) { return false; } if (yaw < 180f) { Vector3 forward = default(Vector3); ((Vector3)(ref forward))..ctor(direction.x, 0f, direction.z); if (forward == Vector3.zero) { forward = Vector3.forward; } if (Vector3.Angle(new Vector3(d.x, 0f, d.z), forward) > yaw + angleBuffer) { return false; } } if (pitch >= 180f) { return true; } float num = Vector3.Angle(Vector3.up, direction); return Mathf.Abs(Vector3.Angle(Vector3.up, d) - num) < pitch + angleBuffer; } public void SetAngleBuffer(float value) { angleBuffer = value; } } public float angleBuffer = 5f; public Pose[] poses = new Pose[0]; public Pose GetPose(Vector3 localDirection) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (poses.Length == 0) { return null; } for (int i = 0; i < poses.Length - 1; i++) { if (poses[i].IsInDirection(localDirection)) { return poses[i]; } } return poses[poses.Length - 1]; } public void SetPoseActive(Pose pose) { for (int i = 0; i < poses.Length; i++) { poses[i].SetAngleBuffer((poses[i] == pose) ? angleBuffer : 0f); } } } public class Amplifier : OffsetModifier { [Serializable] public class Body { [Serializable] public class EffectorLink { [Tooltip("Type of the FBBIK effector to use")] public FullBodyBipedEffector effector; [Tooltip("Weight of using this effector")] public float weight; } [Tooltip("The Transform that's motion we are reading.")] public Transform transform; [Tooltip("Amplify the 'transform's' position relative to this Transform.")] public Transform relativeTo; [Tooltip("Linking the body to effectors. One Body can be used to offset more than one effector.")] public EffectorLink[] effectorLinks; [Tooltip("Amplification magnitude along the up axis of the character.")] public float verticalWeight = 1f; [Tooltip("Amplification magnitude along the horizontal axes of the character.")] public float horizontalWeight = 1f; [Tooltip("Speed of the amplifier. 0 means instant.")] public float speed = 3f; private Vector3 lastRelativePos; private Vector3 smoothDelta; private bool firstUpdate; public void Update(IKSolverFullBodyBiped solver, float w, float deltaTime) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)transform == (Object)null) && !((Object)(object)relativeTo == (Object)null)) { Vector3 val = relativeTo.InverseTransformDirection(transform.position - relativeTo.position); if (firstUpdate) { lastRelativePos = val; firstUpdate = false; } Vector3 val2 = (val - lastRelativePos) / deltaTime; smoothDelta = ((speed <= 0f) ? val2 : Vector3.Lerp(smoothDelta, val2, deltaTime * speed)); Vector3 v = relativeTo.TransformDirection(smoothDelta); Vector3 val3 = V3Tools.ExtractVertical(v, solver.GetRoot().up, verticalWeight) + V3Tools.ExtractHorizontal(v, solver.GetRoot().up, horizontalWeight); for (int i = 0; i < effectorLinks.Length; i++) { IKEffector effector = solver.GetEffector(effectorLinks[i].effector); effector.positionOffset += val3 * w * effectorLinks[i].weight; } lastRelativePos = val; } } private static Vector3 Multiply(Vector3 v1, Vector3 v2) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) v1.x *= v2.x; v1.y *= v2.y; v1.z *= v2.z; return v1; } } [Tooltip("The amplified bodies.")] public Body[] bodies; protected override void OnModifyOffset() { if (!ik.fixTransforms) { if (!Warning.logged) { Warning.Log("Amplifier needs the Fix Transforms option of the FBBIK to be set to true. Otherwise it might amplify to infinity, should the animator of the character stop because of culling.", ((Component)this).transform); } return; } Body[] array = bodies; for (int i = 0; i < array.Length; i++) { array[i].Update(ik.solver, weight, base.deltaTime); } } } public class BodyTilt : OffsetModifier { [Tooltip("Speed of tilting")] public float tiltSpeed = 6f; [Tooltip("Sensitivity of tilting")] public float tiltSensitivity = 0.07f; [Tooltip("The OffsetPose components")] public OffsetPose poseLeft; [Tooltip("The OffsetPose components")] public OffsetPose poseRight; private float tiltAngle; private Vector3 lastForward; protected override void Start() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) base.Start(); lastForward = ((Component)this).transform.forward; } protected override void OnModifyOffset() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.FromToRotation(lastForward, ((Component)this).transform.forward); float num = 0f; Vector3 zero = Vector3.zero; ((Quaternion)(ref val)).ToAngleAxis(ref num, ref zero); if (zero.y > 0f) { num = 0f - num; } num *= tiltSensitivity * 0.01f; num /= base.deltaTime; num = Mathf.Clamp(num, -1f, 1f); tiltAngle = Mathf.Lerp(tiltAngle, num, base.deltaTime * tiltSpeed); float num2 = Mathf.Abs(tiltAngle) / 1f; if (tiltAngle < 0f) { poseRight.Apply(ik.solver, num2); } else { poseLeft.Apply(ik.solver, num2); } lastForward = ((Component)this).transform.forward; } } public class CCDBendGoal : MonoBehaviour { public CCDIK ik; [Range(0f, 1f)] public float weight = 1f; private void Start() { IKSolverCCD solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPreUpdate, new IKSolver.UpdateDelegate(BeforeIK)); } private void BeforeIK() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled) { return; } float num = ik.solver.IKPositionWeight * weight; if (!(num <= 0f)) { Vector3 position = ik.solver.bones[0].transform.position; Quaternion val = Quaternion.FromToRotation(ik.solver.bones[ik.solver.bones.Length - 1].transform.position - position, ((Component)this).transform.position - position); if (num < 1f) { val = Quaternion.Slerp(Quaternion.identity, val, num); } ik.solver.bones[0].transform.rotation = val * ik.solver.bones[0].transform.rotation; } } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverCCD solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPreUpdate, new IKSolver.UpdateDelegate(BeforeIK)); } } } [ExecuteInEditMode] public class EditorIK : MonoBehaviour { [Tooltip("If slot assigned, will update Animator before IK.")] public Animator animator; [Tooltip("Create/Final IK/Editor IK Pose")] public EditorIKPose defaultPose; [HideInInspector] public Transform[] bones = (Transform[])(object)new Transform[0]; public IK ik { get; private set; } private void OnEnable() { if (!Application.isPlaying) { if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponent(); } if ((Object)(object)ik == (Object)null) { Debug.LogError((object)"EditorIK needs to have an IK component on the same GameObject.", (Object)(object)((Component)this).transform); } else if (bones.Length == 0) { bones = ((Component)((Component)ik).transform).GetComponentsInChildren(); } } } private void OnDisable() { if (!Application.isPlaying) { if ((Object)(object)defaultPose != (Object)null && defaultPose.poseStored) { defaultPose.Restore(bones); } if ((Object)(object)ik != (Object)null) { ik.GetIKSolver().executedInEditor = false; } } } private void OnDestroy() { if (!Application.isPlaying && !((Object)(object)ik == (Object)null)) { if (bones.Length == 0) { bones = ((Component)((Component)ik).transform).GetComponentsInChildren(); } if ((Object)(object)defaultPose != (Object)null && defaultPose.poseStored && bones.Length != 0) { defaultPose.Restore(bones); } ik.GetIKSolver().executedInEditor = false; } } public void StoreDefaultPose() { bones = ((Component)((Component)ik).transform).GetComponentsInChildren(); defaultPose.Store(bones); } public bool Initiate() { if ((Object)(object)defaultPose == (Object)null) { return false; } if (!defaultPose.poseStored) { return false; } if (bones.Length == 0) { return false; } if ((Object)(object)ik == (Object)null) { ik = ((Component)this).GetComponent(); } if ((Object)(object)ik == (Object)null) { Debug.LogError((object)"EditorIK can not find an IK component.", (Object)(object)((Component)this).transform); return false; } defaultPose.Restore(bones); ik.GetIKSolver().executedInEditor = false; ik.GetIKSolver().Initiate(((Component)ik).transform); ik.GetIKSolver().executedInEditor = true; return true; } public void Update() { if (Application.isPlaying || (Object)(object)ik == (Object)null || !((Behaviour)ik).enabled || !ik.GetIKSolver().executedInEditor) { return; } if (bones.Length == 0) { bones = ((Component)((Component)ik).transform).GetComponentsInChildren(); } if (bones.Length == 0 || !defaultPose.Restore(bones)) { return; } ik.GetIKSolver().executedInEditor = false; if (!ik.GetIKSolver().initiated) { ik.GetIKSolver().Initiate(((Component)ik).transform); } if (ik.GetIKSolver().initiated) { ik.GetIKSolver().executedInEditor = true; if ((Object)(object)animator != (Object)null && (Object)(object)animator.runtimeAnimatorController != (Object)null) { animator.Update(Time.deltaTime); } ik.GetIKSolver().Update(); } } } [CreateAssetMenu(fileName = "Editor IK Pose", menuName = "Final IK/Editor IK Pose", order = 1)] public class EditorIKPose : ScriptableObject { public Vector3[] localPositions = (Vector3[])(object)new Vector3[0]; public Quaternion[] localRotations = (Quaternion[])(object)new Quaternion[0]; public bool poseStored => localPositions.Length != 0; public void Store(Transform[] T) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) localPositions = (Vector3[])(object)new Vector3[T.Length]; localRotations = (Quaternion[])(object)new Quaternion[T.Length]; for (int i = 1; i < T.Length; i++) { localPositions[i] = T[i].localPosition; localRotations[i] = T[i].localRotation; } } public bool Restore(Transform[] T) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (localPositions.Length != T.Length) { Debug.LogError((object)"Can not restore pose (unmatched bone count). Please stop the solver and click on 'Store Default Pose' if you have made changes to character hierarchy."); return false; } for (int i = 1; i < T.Length; i++) { T[i].localPosition = localPositions[i]; T[i].localRotation = localRotations[i]; } return true; } } public class HitReaction : OffsetModifier { [Serializable] public abstract class HitPoint { [Tooltip("Just for visual clarity, not used at all")] public string name; [Tooltip("Linking this hit point to a collider")] public Collider collider; [Tooltip("Only used if this hit point gets hit when already processing another hit")] [SerializeField] private float crossFadeTime = 0.1f; private float length; private float crossFadeSpeed; private float lastTime; public bool inProgress => timer < length; protected float crossFader { get; private set; } protected float timer { get; private set; } protected Vector3 force { get; private set; } protected Vector3 point { get; private set; } public void Hit(Vector3 force, Vector3 point) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if (length == 0f) { length = GetLength(); } if (length <= 0f) { Debug.LogError((object)"Hit Point WeightCurve length is zero."); return; } if (timer < 1f) { crossFader = 0f; } crossFadeSpeed = ((crossFadeTime > 0f) ? (1f / crossFadeTime) : 0f); CrossFadeStart(); timer = 0f; this.force = force; this.point = point; } public void Apply(IKSolverFullBodyBiped solver, float weight) { float num = Time.time - lastTime; lastTime = Time.time; if (!(timer >= length)) { timer = Mathf.Clamp(timer + num, 0f, length); if (crossFadeSpeed > 0f) { crossFader = Mathf.Clamp(crossFader + num * crossFadeSpeed, 0f, 1f); } else { crossFader = 1f; } OnApply(solver, weight); } } protected abstract float GetLength(); protected abstract void CrossFadeStart(); protected abstract void OnApply(IKSolverFullBodyBiped solver, float weight); } [Serializable] public class HitPointEffector : HitPoint { [Serializable] public class EffectorLink { [Tooltip("The FBBIK effector type")] public FullBodyBipedEffector effector; [Tooltip("The weight of this effector (could also be negative)")] public float weight; private Vector3 lastValue; private Vector3 current; public void Apply(IKSolverFullBodyBiped solver, Vector3 offset, float crossFader) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) current = Vector3.Lerp(lastValue, offset * weight, crossFader); IKEffector iKEffector = solver.GetEffector(effector); iKEffector.positionOffset += current; } public void CrossFadeStart() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) lastValue = current; } } [Tooltip("Offset magnitude in the direction of the hit force")] public AnimationCurve offsetInForceDirection; [Tooltip("Offset magnitude in the direction of character.up")] public AnimationCurve offsetInUpDirection; [Tooltip("Linking this offset to the FBBIK effectors")] public EffectorLink[] effectorLinks; protected override float GetLength() { float num = ((offsetInForceDirection.keys.Length != 0) ? ((Keyframe)(ref offsetInForceDirection.keys[offsetInForceDirection.length - 1])).time : 0f); float num2 = ((offsetInUpDirection.keys.Length != 0) ? ((Keyframe)(ref offsetInUpDirection.keys[offsetInUpDirection.length - 1])).time : 0f); return Mathf.Clamp(num, num2, num); } protected override void CrossFadeStart() { EffectorLink[] array = effectorLinks; for (int i = 0; i < array.Length; i++) { array[i].CrossFadeStart(); } } protected override void OnApply(IKSolverFullBodyBiped solver, float weight) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) Vector3 up = solver.GetRoot().up; Vector3 val = base.force; Vector3 val2 = up * ((Vector3)(ref val)).magnitude; Vector3 val3 = offsetInForceDirection.Evaluate(base.timer) * base.force + offsetInUpDirection.Evaluate(base.timer) * val2; val3 *= weight; EffectorLink[] array = effectorLinks; for (int i = 0; i < array.Length; i++) { array[i].Apply(solver, val3, base.crossFader); } } } [Serializable] public class HitPointBone : HitPoint { [Serializable] public class BoneLink { [Tooltip("Reference to the bone that this hit point rotates")] public Transform bone; [Tooltip("Weight of rotating the bone")] [Range(0f, 1f)] public float weight; private Quaternion lastValue = Quaternion.identity; private Quaternion current = Quaternion.identity; public void Apply(IKSolverFullBodyBiped solver, Quaternion offset, float crossFader) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) current = Quaternion.Lerp(lastValue, Quaternion.Lerp(Quaternion.identity, offset, weight), crossFader); bone.rotation = current * bone.rotation; } public void CrossFadeStart() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) lastValue = current; } } [Tooltip("The angle to rotate the bone around it's rigidbody's world center of mass")] public AnimationCurve aroundCenterOfMass; [Tooltip("Linking this hit point to bone(s)")] public BoneLink[] boneLinks; private Rigidbody rigidbody; protected override float GetLength() { if (aroundCenterOfMass.keys.Length == 0) { return 0f; } return ((Keyframe)(ref aroundCenterOfMass.keys[aroundCenterOfMass.length - 1])).time; } protected override void CrossFadeStart() { BoneLink[] array = boneLinks; for (int i = 0; i < array.Length; i++) { array[i].CrossFadeStart(); } } protected override void OnApply(IKSolverFullBodyBiped solver, float weight) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rigidbody == (Object)null) { rigidbody = ((Component)collider).GetComponent(); } if ((Object)(object)rigidbody != (Object)null) { Vector3 val = Vector3.Cross(base.force, base.point - rigidbody.worldCenterOfMass); Quaternion offset = Quaternion.AngleAxis(aroundCenterOfMass.Evaluate(base.timer) * weight, val); BoneLink[] array = boneLinks; for (int i = 0; i < array.Length; i++) { array[i].Apply(solver, offset, base.crossFader); } } } } [Tooltip("Hit points for the FBBIK effectors")] public HitPointEffector[] effectorHitPoints; [Tooltip(" Hit points for bones without an effector, such as the head")] public HitPointBone[] boneHitPoints; public bool inProgress { get { HitPointEffector[] array = effectorHitPoints; for (int i = 0; i < array.Length; i++) { if (array[i].inProgress) { return true; } } HitPointBone[] array2 = boneHitPoints; for (int i = 0; i < array2.Length; i++) { if (array2[i].inProgress) { return true; } } return false; } } protected override void OnModifyOffset() { HitPointEffector[] array = effectorHitPoints; for (int i = 0; i < array.Length; i++) { array[i].Apply(ik.solver, weight); } HitPointBone[] array2 = boneHitPoints; for (int i = 0; i < array2.Length; i++) { array2[i].Apply(ik.solver, weight); } } public void Hit(Collider collider, Vector3 force, Vector3 point) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik == (Object)null) { Debug.LogError((object)"No IK assigned in HitReaction"); return; } HitPointEffector[] array = effectorHitPoints; foreach (HitPointEffector hitPointEffector in array) { if ((Object)(object)hitPointEffector.collider == (Object)(object)collider) { hitPointEffector.Hit(force, point); } } HitPointBone[] array2 = boneHitPoints; foreach (HitPointBone hitPointBone in array2) { if ((Object)(object)hitPointBone.collider == (Object)(object)collider) { hitPointBone.Hit(force, point); } } } } public class HitReactionVRIK : OffsetModifierVRIK { [Serializable] public abstract class Offset { [Tooltip("Just for visual clarity, not used at all")] public string name; [Tooltip("Linking this hit point to a collider")] public Collider collider; [Tooltip("Only used if this hit point gets hit when already processing another hit")] [SerializeField] private float crossFadeTime = 0.1f; private float length; private float crossFadeSpeed; private float lastTime; protected float crossFader { get; private set; } protected float timer { get; private set; } protected Vector3 force { get; private set; } protected Vector3 point { get; private set; } public void Hit(Vector3 force, AnimationCurve[] curves, Vector3 point) { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) if (length == 0f) { length = GetLength(curves); } if (length <= 0f) { Debug.LogError((object)"Hit Point WeightCurve length is zero."); return; } if (timer < 1f) { crossFader = 0f; } crossFadeSpeed = ((crossFadeTime > 0f) ? (1f / crossFadeTime) : 0f); CrossFadeStart(); timer = 0f; this.force = force; this.point = point; } public void Apply(VRIK ik, AnimationCurve[] curves, float weight) { float num = Time.time - lastTime; lastTime = Time.time; if (!(timer >= length)) { timer = Mathf.Clamp(timer + num, 0f, length); if (crossFadeSpeed > 0f) { crossFader = Mathf.Clamp(crossFader + num * crossFadeSpeed, 0f, 1f); } else { crossFader = 1f; } OnApply(ik, curves, weight); } } protected abstract float GetLength(AnimationCurve[] curves); protected abstract void CrossFadeStart(); protected abstract void OnApply(VRIK ik, AnimationCurve[] curves, float weight); } [Serializable] public class PositionOffset : Offset { [Serializable] public class PositionOffsetLink { [Tooltip("The FBBIK effector type")] public IKSolverVR.PositionOffset positionOffset; [Tooltip("The weight of this effector (could also be negative)")] public float weight; private Vector3 lastValue; private Vector3 current; public void Apply(VRIK ik, Vector3 offset, float crossFader) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) current = Vector3.Lerp(lastValue, offset * weight, crossFader); ik.solver.AddPositionOffset(positionOffset, current); } public void CrossFadeStart() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) lastValue = current; } } [Tooltip("Offset magnitude in the direction of the hit force")] public int forceDirCurveIndex; [Tooltip("Offset magnitude in the direction of character.up")] public int upDirCurveIndex = 1; [Tooltip("Linking this offset to the VRIK position offsets")] public PositionOffsetLink[] offsetLinks; protected override float GetLength(AnimationCurve[] curves) { float num = ((curves[forceDirCurveIndex].keys.Length != 0) ? ((Keyframe)(ref curves[forceDirCurveIndex].keys[curves[forceDirCurveIndex].length - 1])).time : 0f); float num2 = ((curves[upDirCurveIndex].keys.Length != 0) ? ((Keyframe)(ref curves[upDirCurveIndex].keys[curves[upDirCurveIndex].length - 1])).time : 0f); return Mathf.Clamp(num, num2, num); } protected override void CrossFadeStart() { PositionOffsetLink[] array = offsetLinks; for (int i = 0; i < array.Length; i++) { array[i].CrossFadeStart(); } } protected override void OnApply(VRIK ik, AnimationCurve[] curves, float weight) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) Vector3 up = ((Component)ik).transform.up; Vector3 val = base.force; Vector3 val2 = up * ((Vector3)(ref val)).magnitude; Vector3 val3 = curves[forceDirCurveIndex].Evaluate(base.timer) * base.force + curves[upDirCurveIndex].Evaluate(base.timer) * val2; val3 *= weight; PositionOffsetLink[] array = offsetLinks; for (int i = 0; i < array.Length; i++) { array[i].Apply(ik, val3, base.crossFader); } } } [Serializable] public class RotationOffset : Offset { [Serializable] public class RotationOffsetLink { [Tooltip("Reference to the bone that this hit point rotates")] public IKSolverVR.RotationOffset rotationOffset; [Tooltip("Weight of rotating the bone")] [Range(0f, 1f)] public float weight; private Quaternion lastValue = Quaternion.identity; private Quaternion current = Quaternion.identity; public void Apply(VRIK ik, Quaternion offset, float crossFader) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) current = Quaternion.Lerp(lastValue, Quaternion.Lerp(Quaternion.identity, offset, weight), crossFader); ik.solver.AddRotationOffset(rotationOffset, current); } public void CrossFadeStart() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) lastValue = current; } } [Tooltip("The angle to rotate the bone around it's rigidbody's world center of mass")] public int curveIndex; [Tooltip("Linking this hit point to bone(s)")] public RotationOffsetLink[] offsetLinks; private Rigidbody rigidbody; protected override float GetLength(AnimationCurve[] curves) { if (curves[curveIndex].keys.Length == 0) { return 0f; } return ((Keyframe)(ref curves[curveIndex].keys[curves[curveIndex].length - 1])).time; } protected override void CrossFadeStart() { RotationOffsetLink[] array = offsetLinks; for (int i = 0; i < array.Length; i++) { array[i].CrossFadeStart(); } } protected override void OnApply(VRIK ik, AnimationCurve[] curves, float weight) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)collider == (Object)null) { Debug.LogError((object)"No collider assigned for a HitPointBone in the HitReaction component."); return; } if ((Object)(object)rigidbody == (Object)null) { rigidbody = ((Component)collider).GetComponent(); } if ((Object)(object)rigidbody != (Object)null) { Vector3 val = Vector3.Cross(base.force, base.point - rigidbody.worldCenterOfMass); Quaternion offset = Quaternion.AngleAxis(curves[curveIndex].Evaluate(base.timer) * weight, val); RotationOffsetLink[] array = offsetLinks; for (int i = 0; i < array.Length; i++) { array[i].Apply(ik, offset, base.crossFader); } } } } public AnimationCurve[] offsetCurves; [Tooltip("Hit points for the FBBIK effectors")] public PositionOffset[] positionOffsets; [Tooltip(" Hit points for bones without an effector, such as the head")] public RotationOffset[] rotationOffsets; protected override void OnModifyOffset() { PositionOffset[] array = positionOffsets; for (int i = 0; i < array.Length; i++) { array[i].Apply(ik, offsetCurves, weight); } RotationOffset[] array2 = rotationOffsets; for (int i = 0; i < array2.Length; i++) { array2[i].Apply(ik, offsetCurves, weight); } } public void Hit(Collider collider, Vector3 force, Vector3 point) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik == (Object)null) { Debug.LogError((object)"No IK assigned in HitReaction"); return; } PositionOffset[] array = positionOffsets; foreach (PositionOffset positionOffset in array) { if ((Object)(object)positionOffset.collider == (Object)(object)collider) { positionOffset.Hit(force, offsetCurves, point); } } RotationOffset[] array2 = rotationOffsets; foreach (RotationOffset rotationOffset in array2) { if ((Object)(object)rotationOffset.collider == (Object)(object)collider) { rotationOffset.Hit(force, offsetCurves, point); } } } } public class Inertia : OffsetModifier { [Serializable] public class Body { [Serializable] public class EffectorLink { [Tooltip("Type of the FBBIK effector to use")] public FullBodyBipedEffector effector; [Tooltip("Weight of using this effector")] public float weight; } [Tooltip("The Transform to follow, can be any bone of the character")] public Transform transform; [Tooltip("Linking the body to effectors. One Body can be used to offset more than one effector")] public EffectorLink[] effectorLinks; [Tooltip("The speed to follow the Transform")] public float speed = 10f; [Tooltip("The acceleration, smaller values means lazyer following")] public float acceleration = 3f; [Tooltip("Matching target velocity")] [Range(0f, 1f)] public float matchVelocity; [Tooltip("gravity applied to the Body")] public float gravity; private Vector3 delta; private Vector3 lazyPoint; private Vector3 direction; private Vector3 lastPosition; private bool firstUpdate = true; public void Reset() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)transform == (Object)null)) { lazyPoint = transform.position; lastPosition = transform.position; direction = Vector3.zero; } } public void Update(IKSolverFullBodyBiped solver, float weight, float deltaTime) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)transform == (Object)null)) { if (firstUpdate) { Reset(); firstUpdate = false; } direction = Vector3.Lerp(direction, (transform.position - lazyPoint) / deltaTime * 0.01f, deltaTime * acceleration); lazyPoint += direction * deltaTime * speed; delta = transform.position - lastPosition; lazyPoint += delta * matchVelocity; lazyPoint.y += gravity * deltaTime; EffectorLink[] array = effectorLinks; foreach (EffectorLink effectorLink in array) { IKEffector effector = solver.GetEffector(effectorLink.effector); effector.positionOffset += (lazyPoint - transform.position) * effectorLink.weight * weight; } lastPosition = transform.position; } } } [Tooltip("The array of Bodies")] public Body[] bodies; [Tooltip("The array of OffsetLimits")] public OffsetLimits[] limits; public void ResetBodies() { lastTime = Time.time; Body[] array = bodies; for (int i = 0; i < array.Length; i++) { array[i].Reset(); } } protected override void OnModifyOffset() { Body[] array = bodies; for (int i = 0; i < array.Length; i++) { array[i].Update(ik.solver, weight, base.deltaTime); } ApplyLimits(limits); } } public class LookAtController : MonoBehaviour { public LookAtIK ik; [Header("Target Smoothing")] [Tooltip("The target to look at. Do not use the Target transform that is assigned to LookAtIK. Set to null if you wish to stop looking.")] public Transform target; [Range(0f, 1f)] public float weight = 1f; public Vector3 offset; [Tooltip("The time it takes to switch targets.")] public float targetSwitchSmoothTime = 0.3f; [Tooltip("The time it takes to blend in/out of LookAtIK weight.")] public float weightSmoothTime = 0.3f; [Header("Turning Towards The Target")] [Tooltip("Enables smooth turning towards the target according to the parameters under this header.")] public bool smoothTurnTowardsTarget = true; [Tooltip("Speed of turning towards the target using Vector3.RotateTowards.")] public float maxRadiansDelta = 3f; [Tooltip("Speed of moving towards the target using Vector3.RotateTowards.")] public float maxMagnitudeDelta = 3f; [Tooltip("Speed of slerping towards the target.")] public float slerpSpeed = 3f; [Tooltip("The position of the pivot that the look at target is rotated around relative to the root of the character.")] public Vector3 pivotOffsetFromRoot = Vector3.up; [Tooltip("Minimum distance of looking from the first bone. Keeps the solver from failing if the target is too close.")] public float minDistance = 1f; [Header("RootRotation")] [Tooltip("Character root will be rotate around the Y axis to keep root forward within this angle from the look direction.")] [Range(0f, 180f)] public float maxRootAngle = 45f; private Transform lastTarget; private float switchWeight; private float switchWeightV; private float weightV; private Vector3 lastPosition; private Vector3 dir; private bool lastSmoothTowardsTarget; private Vector3 pivot => ((Component)ik).transform.position + ((Component)ik).transform.rotation * pivotOffsetFromRoot; private void Start() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) lastPosition = ik.solver.IKPosition; dir = ik.solver.IKPosition - pivot; } private void LateUpdate() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target != (Object)(object)lastTarget) { if ((Object)(object)lastTarget == (Object)null && (Object)(object)target != (Object)null && ik.solver.IKPositionWeight <= 0f) { lastPosition = target.position; dir = target.position - pivot; ik.solver.IKPosition = target.position + offset; } else { lastPosition = ik.solver.IKPosition; dir = ik.solver.IKPosition - pivot; } switchWeight = 0f; lastTarget = target; } float num = (((Object)(object)target != (Object)null) ? weight : 0f); ik.solver.IKPositionWeight = Mathf.SmoothDamp(ik.solver.IKPositionWeight, num, ref weightV, weightSmoothTime); if (ik.solver.IKPositionWeight >= 0.999f && num > ik.solver.IKPositionWeight) { ik.solver.IKPositionWeight = 1f; } if (ik.solver.IKPositionWeight <= 0.001f && num < ik.solver.IKPositionWeight) { ik.solver.IKPositionWeight = 0f; } if (!(ik.solver.IKPositionWeight <= 0f)) { switchWeight = Mathf.SmoothDamp(switchWeight, 1f, ref switchWeightV, targetSwitchSmoothTime); if (switchWeight >= 0.999f) { switchWeight = 1f; } if ((Object)(object)target != (Object)null) { ik.solver.IKPosition = Vector3.Lerp(lastPosition, target.position + offset, switchWeight); } if (smoothTurnTowardsTarget != lastSmoothTowardsTarget) { dir = ik.solver.IKPosition - pivot; lastSmoothTowardsTarget = smoothTurnTowardsTarget; } if (smoothTurnTowardsTarget) { Vector3 val = ik.solver.IKPosition - pivot; dir = Vector3.Slerp(dir, val, Time.deltaTime * slerpSpeed); dir = Vector3.RotateTowards(dir, val, Time.deltaTime * maxRadiansDelta, maxMagnitudeDelta); ik.solver.IKPosition = pivot + dir; } ApplyMinDistance(); RootRotation(); } } private void ApplyMinDistance() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pivot; Vector3 val2 = ik.solver.IKPosition - val; val2 = ((Vector3)(ref val2)).normalized * Mathf.Max(((Vector3)(ref val2)).magnitude, minDistance); ik.solver.IKPosition = val + val2; } private void RootRotation() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Lerp(180f, maxRootAngle, ik.solver.IKPositionWeight); if (num < 180f) { Vector3 val = Quaternion.Inverse(((Component)ik).transform.rotation) * (ik.solver.IKPosition - pivot); float num2 = Mathf.Atan2(val.x, val.z) * 57.29578f; float num3 = 0f; if (num2 > num) { num3 = num2 - num; } if (num2 < 0f - num) { num3 = num2 + num; } ((Component)ik).transform.rotation = Quaternion.AngleAxis(num3, ((Component)ik).transform.up) * ((Component)ik).transform.rotation; } } } public abstract class OffsetModifier : MonoBehaviour { [Serializable] public class OffsetLimits { [Tooltip("The effector type (this is just an enum)")] public FullBodyBipedEffector effector; [Tooltip("Spring force, if zero then this is a hard limit, if not, offset can exceed the limit.")] public float spring; [Tooltip("Which axes to limit the offset on?")] public bool x; [Tooltip("Which axes to limit the offset on?")] public bool y; [Tooltip("Which axes to limit the offset on?")] public bool z; [Tooltip("The limits")] public float minX; [Tooltip("The limits")] public float maxX; [Tooltip("The limits")] public float minY; [Tooltip("The limits")] public float maxY; [Tooltip("The limits")] public float minZ; [Tooltip("The limits")] public float maxZ; public void Apply(IKEffector e, Quaternion rootRotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Quaternion.Inverse(rootRotation) * e.positionOffset; if (spring <= 0f) { if (x) { val.x = Mathf.Clamp(val.x, minX, maxX); } if (y) { val.y = Mathf.Clamp(val.y, minY, maxY); } if (z) { val.z = Mathf.Clamp(val.z, minZ, maxZ); } } else { if (x) { val.x = SpringAxis(val.x, minX, maxX); } if (y) { val.y = SpringAxis(val.y, minY, maxY); } if (z) { val.z = SpringAxis(val.z, minZ, maxZ); } } e.positionOffset = rootRotation * val; } private float SpringAxis(float value, float min, float max) { if (value > min && value < max) { return value; } if (value < min) { return Spring(value, min, negative: true); } return Spring(value, max, negative: false); } private float Spring(float value, float limit, bool negative) { float num = value - limit; float num2 = num * spring; if (negative) { return value + Mathf.Clamp(0f - num2, 0f, 0f - num); } return value - Mathf.Clamp(num2, 0f, num); } } [Tooltip("The master weight")] public float weight = 1f; [Tooltip("Reference to the FBBIK component")] public FullBodyBipedIK ik; protected float lastTime; protected float deltaTime => Time.time - lastTime; protected abstract void OnModifyOffset(); protected virtual void Start() { ((MonoBehaviour)this).StartCoroutine(Initiate()); } private IEnumerator Initiate() { while ((Object)(object)ik == (Object)null) { yield return null; } IKSolverFullBodyBiped solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPreUpdate, new IKSolver.UpdateDelegate(ModifyOffset)); lastTime = Time.time; } private void ModifyOffset() { if (((Behaviour)this).enabled && !(weight <= 0f) && !(deltaTime <= 0f) && !((Object)(object)ik == (Object)null)) { weight = Mathf.Clamp(weight, 0f, 1f); OnModifyOffset(); lastTime = Time.time; } } protected void ApplyLimits(OffsetLimits[] limits) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) foreach (OffsetLimits offsetLimits in limits) { offsetLimits.Apply(ik.solver.GetEffector(offsetLimits.effector), ((Component)this).transform.rotation); } } protected virtual void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverFullBodyBiped solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPreUpdate, new IKSolver.UpdateDelegate(ModifyOffset)); } } } public abstract class OffsetModifierVRIK : MonoBehaviour { [Tooltip("The master weight")] public float weight = 1f; [Tooltip("Reference to the VRIK component")] public VRIK ik; private float lastTime; protected float deltaTime => Time.time - lastTime; protected abstract void OnModifyOffset(); protected virtual void Start() { ((MonoBehaviour)this).StartCoroutine(Initiate()); } private IEnumerator Initiate() { while ((Object)(object)ik == (Object)null) { yield return null; } IKSolverVR solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPreUpdate, new IKSolver.UpdateDelegate(ModifyOffset)); lastTime = Time.time; } private void ModifyOffset() { if (((Behaviour)this).enabled && !(weight <= 0f) && !(deltaTime <= 0f) && !((Object)(object)ik == (Object)null)) { weight = Mathf.Clamp(weight, 0f, 1f); OnModifyOffset(); lastTime = Time.time; } } protected virtual void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverVR solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPreUpdate, new IKSolver.UpdateDelegate(ModifyOffset)); } } } public class OffsetPose : MonoBehaviour { [Serializable] public class EffectorLink { public FullBodyBipedEffector effector; public Vector3 offset; public Vector3 pin; public Vector3 pinWeight; public void Apply(IKSolverFullBodyBiped solver, float weight, Quaternion rotation) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) IKEffector iKEffector = solver.GetEffector(effector); iKEffector.positionOffset += rotation * offset * weight; Vector3 val = solver.GetRoot().position + rotation * pin - solver.GetEffector(effector).bone.position; Vector3 val2 = pinWeight * Mathf.Abs(weight); solver.GetEffector(effector).positionOffset = new Vector3(Mathf.Lerp(solver.GetEffector(effector).positionOffset.x, val.x, val2.x), Mathf.Lerp(solver.GetEffector(effector).positionOffset.y, val.y, val2.y), Mathf.Lerp(solver.GetEffector(effector).positionOffset.z, val.z, val2.z)); } } public EffectorLink[] effectorLinks = new EffectorLink[0]; public void Apply(IKSolverFullBodyBiped solver, float weight) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < effectorLinks.Length; i++) { effectorLinks[i].Apply(solver, weight, solver.GetRoot().rotation); } } public void Apply(IKSolverFullBodyBiped solver, float weight, Quaternion rotation) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < effectorLinks.Length; i++) { effectorLinks[i].Apply(solver, weight, rotation); } } } public class PenetrationAvoidance : OffsetModifier { [Serializable] public class Avoider { [Serializable] public class EffectorLink { [Tooltip("Effector to apply the offset to.")] public FullBodyBipedEffector effector; [Tooltip("Multiplier of the offset value, can be negative.")] public float weight; } [Tooltip("Bones to start the raycast from. Multiple raycasts can be used by assigning more than 1 bone.")] public Transform[] raycastFrom; [Tooltip("The Transform to raycast towards. Usually the body part that you want to keep from penetrating.")] public Transform raycastTo; [Tooltip("If 0, will use simple raycasting, if > 0, will use sphere casting (better, but slower).")] [Range(0f, 1f)] public float raycastRadius; [Tooltip("Linking this to FBBIK effectors.")] public EffectorLink[] effectors; [Tooltip("The time of smooth interpolation of the offset value to avoid penetration.")] public float smoothTimeIn = 0.1f; [Tooltip("The time of smooth interpolation of the offset value blending out of penetration avoidance.")] public float smoothTimeOut = 0.3f; [Tooltip("Layers to keep penetrating from.")] public LayerMask layers; private Vector3 offset; private Vector3 offsetTarget; private Vector3 offsetV; public void Solve(IKSolverFullBodyBiped solver, float weight) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) offsetTarget = GetOffsetTarget(solver); float num = ((((Vector3)(ref offsetTarget)).sqrMagnitude > ((Vector3)(ref offset)).sqrMagnitude) ? smoothTimeIn : smoothTimeOut); offset = Vector3.SmoothDamp(offset, offsetTarget, ref offsetV, num); EffectorLink[] array = effectors; foreach (EffectorLink effectorLink in array) { IKEffector effector = solver.GetEffector(effectorLink.effector); effector.positionOffset += offset * weight * effectorLink.weight; } } private Vector3 GetOffsetTarget(IKSolverFullBodyBiped solver) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; Transform[] array = raycastFrom; foreach (Transform val2 in array) { val += Raycast(val2.position, raycastTo.position + val); } return val; } private Vector3 Raycast(Vector3 from, Vector3 to) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) Vector3 val = to - from; float magnitude = ((Vector3)(ref val)).magnitude; RaycastHit val2 = default(RaycastHit); if (raycastRadius <= 0f) { Physics.Raycast(from, val, ref val2, magnitude, LayerMask.op_Implicit(layers)); } else { Physics.SphereCast(from, raycastRadius, val, ref val2, magnitude, LayerMask.op_Implicit(layers)); } if ((Object)(object)((RaycastHit)(ref val2)).collider == (Object)null) { return Vector3.zero; } return Vector3.Project(-((Vector3)(ref val)).normalized * (magnitude - ((RaycastHit)(ref val2)).distance), ((RaycastHit)(ref val2)).normal); } } [Tooltip("Definitions of penetration avoidances.")] public Avoider[] avoiders; protected override void OnModifyOffset() { Avoider[] array = avoiders; for (int i = 0; i < array.Length; i++) { array[i].Solve(ik.solver, weight); } } } public class Recoil : OffsetModifier { [Serializable] public class RecoilOffset { [Serializable] public class EffectorLink { [Tooltip("Type of the FBBIK effector to use")] public FullBodyBipedEffector effector; [Tooltip("Weight of using this effector")] public float weight; } [Tooltip("Offset vector for the associated effector when doing recoil.")] public Vector3 offset; [Tooltip("When firing before the last recoil has faded, how much of the current recoil offset will be maintained?")] [Range(0f, 1f)] public float additivity = 1f; [Tooltip("Max additive recoil for automatic fire.")] public float maxAdditiveOffsetMag = 0.2f; [Tooltip("Linking this recoil offset to FBBIK effectors.")] public EffectorLink[] effectorLinks; private Vector3 additiveOffset; private Vector3 lastOffset; public void Start() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (!(additivity <= 0f)) { additiveOffset = Vector3.ClampMagnitude(lastOffset * additivity, maxAdditiveOffsetMag); } } public void Apply(IKSolverFullBodyBiped solver, Quaternion rotation, float masterWeight, float length, float timeLeft) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) additiveOffset = Vector3.Lerp(Vector3.zero, additiveOffset, timeLeft / length); lastOffset = rotation * (offset * masterWeight) + rotation * additiveOffset; EffectorLink[] array = effectorLinks; foreach (EffectorLink effectorLink in array) { IKEffector effector = solver.GetEffector(effectorLink.effector); effector.positionOffset += lastOffset * effectorLink.weight; } } } [Serializable] public enum Handedness { Right, Left } [Tooltip("Reference to the AimIK component. Optional, only used to getting the aiming direction.")] public AimIK aimIK; [Tooltip("Set this true if you are using IKExecutionOrder.cs or a custom script to force AimIK solve after FBBIK.")] public bool aimIKSolvedLast; [Tooltip("Which hand is holding the weapon?")] public Handedness handedness; [Tooltip("Check for 2-handed weapons.")] public bool twoHanded = true; [Tooltip("Weight curve for the recoil offsets. Recoil procedure is as long as this curve.")] public AnimationCurve recoilWeight; [Tooltip("How much is the magnitude randomized each time Recoil is called?")] public float magnitudeRandom = 0.1f; [Tooltip("How much is the rotation randomized each time Recoil is called?")] public Vector3 rotationRandom; [Tooltip("Rotating the primary hand bone for the recoil (in local space).")] public Vector3 handRotationOffset; [Tooltip("Time of blending in another recoil when doing automatic fire.")] public float blendTime; [Space(10f)] [Tooltip("FBBIK effector position offsets for the recoil (in aiming direction space).")] public RecoilOffset[] offsets; [HideInInspector] public Quaternion rotationOffset = Quaternion.identity; private float magnitudeMlp = 1f; private float endTime = -1f; private Quaternion handRotation; private Quaternion secondaryHandRelativeRotation; private Quaternion randomRotation; private float length = 1f; private bool initiated; private float blendWeight; private float w; private Quaternion primaryHandRotation = Quaternion.identity; private bool handRotationsSet; private Vector3 aimIKAxis; public bool isFinished => Time.time > endTime; private IKEffector primaryHandEffector { get { if (handedness == Handedness.Right) { return ik.solver.rightHandEffector; } return ik.solver.leftHandEffector; } } private IKEffector secondaryHandEffector { get { if (handedness == Handedness.Right) { return ik.solver.leftHandEffector; } return ik.solver.rightHandEffector; } } private Transform primaryHand => primaryHandEffector.bone; private Transform secondaryHand => secondaryHandEffector.bone; public void SetHandRotations(Quaternion leftHandRotation, Quaternion rightHandRotation) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (handedness == Handedness.Left) { primaryHandRotation = leftHandRotation; } else { primaryHandRotation = rightHandRotation; } handRotationsSet = true; } public void Fire(float magnitude) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) float num = magnitude * Random.value * magnitudeRandom; magnitudeMlp = magnitude + num; randomRotation = Quaternion.Euler(rotationRandom * Random.value); RecoilOffset[] array = offsets; for (int i = 0; i < array.Length; i++) { array[i].Start(); } if (Time.time < endTime) { blendWeight = 0f; } else { blendWeight = 1f; } length = ((Keyframe)(ref recoilWeight.keys[^1])).time; endTime = Time.time + length; } protected override void OnModifyOffset() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)aimIK != (Object)null) { aimIKAxis = aimIK.solver.axis; } if (Time.time >= endTime) { rotationOffset = Quaternion.identity; return; } if (!initiated && (Object)(object)ik != (Object)null) { initiated = true; IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPostUpdate, new IKSolver.UpdateDelegate(AfterFBBIK)); if ((Object)(object)aimIK != (Object)null) { IKSolverAim solver2 = aimIK.solver; solver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver2.OnPostUpdate, new IKSolver.UpdateDelegate(AfterAimIK)); } } blendTime = Mathf.Max(blendTime, 0f); if (blendTime > 0f) { blendWeight = Mathf.Min(blendWeight + Time.deltaTime * (1f / blendTime), 1f); } else { blendWeight = 1f; } float num = recoilWeight.Evaluate(length - (endTime - Time.time)) * magnitudeMlp; w = Mathf.Lerp(w, num, blendWeight); Quaternion val = (((Object)(object)aimIK != (Object)null && (Object)(object)aimIK.solver.transform != (Object)null && !aimIKSolvedLast) ? Quaternion.LookRotation(aimIK.solver.IKPosition - aimIK.solver.transform.position, ik.references.root.up) : ik.references.root.rotation); val = randomRotation * val; RecoilOffset[] array = offsets; for (int i = 0; i < array.Length; i++) { array[i].Apply(ik.solver, val, w, length, endTime - Time.time); } if (!handRotationsSet) { primaryHandRotation = primaryHand.rotation; } handRotationsSet = false; rotationOffset = Quaternion.Lerp(Quaternion.identity, Quaternion.Euler(randomRotation * primaryHandRotation * handRotationOffset), w); handRotation = rotationOffset * primaryHandRotation; if (twoHanded) { Vector3 val2 = Quaternion.Inverse(primaryHand.rotation) * (secondaryHand.position - primaryHand.position); secondaryHandRelativeRotation = Quaternion.Inverse(primaryHand.rotation) * secondaryHand.rotation; Vector3 val3 = primaryHand.position + primaryHandEffector.positionOffset + handRotation * val2; IKEffector iKEffector = secondaryHandEffector; iKEffector.positionOffset += val3 - (secondaryHand.position + secondaryHandEffector.positionOffset); } if ((Object)(object)aimIK != (Object)null && aimIKSolvedLast) { aimIK.solver.axis = Quaternion.Inverse(ik.references.root.rotation) * Quaternion.Inverse(rotationOffset) * aimIKAxis; } } private void AfterFBBIK() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (!(Time.time >= endTime)) { primaryHand.rotation = handRotation; if (twoHanded) { secondaryHand.rotation = primaryHand.rotation * secondaryHandRelativeRotation; } } } private void AfterAimIK() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (aimIKSolvedLast) { aimIK.solver.axis = aimIKAxis; } } protected override void OnDestroy() { base.OnDestroy(); if ((Object)(object)ik != (Object)null && initiated) { IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPostUpdate, new IKSolver.UpdateDelegate(AfterFBBIK)); if ((Object)(object)aimIK != (Object)null) { IKSolverAim solver2 = aimIK.solver; solver2.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver2.OnPostUpdate, new IKSolver.UpdateDelegate(AfterAimIK)); } } } } public class ShoulderRotator : MonoBehaviour { [Tooltip("Weight of shoulder rotation")] public float weight = 1.5f; [Tooltip("The greater the offset, the sooner the shoulder will start rotating")] public float offset = 0.2f; private FullBodyBipedIK ik; private bool skip; private void Start() { ik = ((Component)this).GetComponent(); IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPostUpdate, new IKSolver.UpdateDelegate(RotateShoulders)); } private void RotateShoulders() { if (!((Object)(object)ik == (Object)null) && !(ik.solver.IKPositionWeight <= 0f)) { if (skip) { skip = false; return; } RotateShoulder(FullBodyBipedChain.LeftArm, weight, offset); RotateShoulder(FullBodyBipedChain.RightArm, weight, offset); skip = true; ik.solver.Update(); } } private void RotateShoulder(FullBodyBipedChain chain, float weight, float offset) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.FromToRotation(GetParentBoneMap(chain).swingDirection, ik.solver.GetEndEffector(chain).position - GetParentBoneMap(chain).transform.position); Vector3 val2 = ik.solver.GetEndEffector(chain).position - ik.solver.GetLimbMapping(chain).bone1.position; float num = ik.solver.GetChain(chain).nodes[0].length + ik.solver.GetChain(chain).nodes[1].length; float num2 = ((Vector3)(ref val2)).magnitude / num - 1f + offset; num2 = Mathf.Clamp(num2 * weight, 0f, 1f); Quaternion val3 = Quaternion.Lerp(Quaternion.identity, val, num2 * ik.solver.GetEndEffector(chain).positionWeight * ik.solver.IKPositionWeight); ik.solver.GetLimbMapping(chain).parentBone.rotation = val3 * ik.solver.GetLimbMapping(chain).parentBone.rotation; } private IKMapping.BoneMap GetParentBoneMap(FullBodyBipedChain chain) { return ik.solver.GetLimbMapping(chain).GetBoneMap(IKMappingLimb.BoneMapType.Parent); } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverFullBodyBiped solver = ik.solver; solver.OnPostUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPostUpdate, new IKSolver.UpdateDelegate(RotateShoulders)); } } } public static class VRIKCalibrator { [Serializable] public class Settings { [Tooltip("Multiplies character scale")] public float scaleMlp = 1f; [Tooltip("Local axis of the HMD facing forward.")] public Vector3 headTrackerForward = Vector3.forward; [Tooltip("Local axis of the HMD facing up.")] public Vector3 headTrackerUp = Vector3.up; [Tooltip("Local axis of the hand trackers pointing from the wrist towards the palm.")] public Vector3 handTrackerForward = Vector3.forward; [Tooltip("Local axis of the hand trackers pointing in the direction of the surface normal of the back of the hand.")] public Vector3 handTrackerUp = Vector3.up; [Tooltip("Local axis of the foot trackers towards the player's forward direction.")] public Vector3 footTrackerForward = Vector3.forward; [Tooltip("Local axis of the foot tracker towards the up direction.")] public Vector3 footTrackerUp = Vector3.up; [Space(10f)] [Tooltip("Offset of the head bone from the HMD in (headTrackerForward, headTrackerUp) space relative to the head tracker.")] public Vector3 headOffset; [Tooltip("Offset of the hand bones from the hand trackers in (handTrackerForward, handTrackerUp) space relative to the hand trackers.")] public Vector3 handOffset; [Tooltip("Forward offset of the foot bones from the foot trackers.")] public float footForwardOffset; [Tooltip("Inward offset of the foot bones from the foot trackers.")] public float footInwardOffset; [Tooltip("Used for adjusting foot heading relative to the foot trackers.")] [Range(-180f, 180f)] public float footHeadingOffset; [Range(0f, 1f)] public float pelvisPositionWeight = 1f; [Range(0f, 1f)] public float pelvisRotationWeight = 1f; } [Serializable] public class CalibrationData { [Serializable] public class Target { public bool used; public Vector3 localPosition; public Quaternion localRotation; public Target(Transform t) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) used = (Object)(object)t != (Object)null; if (used) { localPosition = t.localPosition; localRotation = t.localRotation; } } public void SetTo(Transform t) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (used) { t.localPosition = localPosition; t.localRotation = localRotation; } } } public float scale; public Target head; public Target leftHand; public Target rightHand; public Target pelvis; public Target leftFoot; public Target rightFoot; public Target leftLegGoal; public Target rightLegGoal; public Vector3 pelvisTargetRight; public float pelvisPositionWeight; public float pelvisRotationWeight; } public static void RecalibrateScale(VRIK ik, CalibrationData data, Settings settings) { RecalibrateScale(ik, data, settings.scaleMlp); } public static void RecalibrateScale(VRIK ik, CalibrationData data, float scaleMlp) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) CalibrateScale(ik, scaleMlp); data.scale = ik.references.root.localScale.y; } private static void CalibrateScale(VRIK ik, Settings settings) { CalibrateScale(ik, settings.scaleMlp); } private static void CalibrateScale(VRIK ik, float scaleMlp = 1f) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) float num = (ik.solver.spine.headTarget.position.y - ik.references.root.position.y) / (ik.references.head.position.y - ik.references.root.position.y); Transform root = ik.references.root; root.localScale *= num * scaleMlp; } public static CalibrationData Calibrate(VRIK ik, Settings settings, Transform headTracker, Transform bodyTracker = null, Transform leftHandTracker = null, Transform rightHandTracker = null, Transform leftFootTracker = null, Transform rightFootTracker = null) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_0509: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Unknown result type (might be due to invalid IL or missing references) //IL_0802: Unknown result type (might be due to invalid IL or missing references) //IL_07f9: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Unknown result type (might be due to invalid IL or missing references) if (!ik.solver.initiated) { Debug.LogError((object)"Can not calibrate before VRIK has initiated."); return null; } if ((Object)(object)headTracker == (Object)null) { Debug.LogError((object)"Can not calibrate VRIK without the head tracker."); return null; } CalibrationData calibrationData = new CalibrationData(); ik.solver.FixTransforms(); Vector3 val = headTracker.position + headTracker.rotation * Quaternion.LookRotation(settings.headTrackerForward, settings.headTrackerUp) * settings.headOffset; ik.references.root.position = new Vector3(val.x, ik.references.root.position.y, val.z); Vector3 val2 = headTracker.rotation * settings.headTrackerForward; val2.y = 0f; ik.references.root.rotation = Quaternion.LookRotation(val2); Transform val3 = (((Object)(object)ik.solver.spine.headTarget == (Object)null) ? new GameObject("Head Target").transform : ik.solver.spine.headTarget); val3.position = val; val3.rotation = ik.references.head.rotation; val3.parent = headTracker; ik.solver.spine.headTarget = val3; float num = (val3.position.y - ik.references.root.position.y) / (ik.references.head.position.y - ik.references.root.position.y); Transform root = ik.references.root; root.localScale *= num * settings.scaleMlp; if ((Object)(object)bodyTracker != (Object)null) { Transform val4 = (((Object)(object)ik.solver.spine.pelvisTarget == (Object)null) ? new GameObject("Pelvis Target").transform : ik.solver.spine.pelvisTarget); val4.position = ik.references.pelvis.position; val4.rotation = ik.references.pelvis.rotation; val4.parent = bodyTracker; ik.solver.spine.pelvisTarget = val4; ik.solver.spine.pelvisPositionWeight = settings.pelvisPositionWeight; ik.solver.spine.pelvisRotationWeight = settings.pelvisRotationWeight; ik.solver.plantFeet = false; ik.solver.spine.maxRootAngle = 180f; } else if ((Object)(object)leftFootTracker != (Object)null && (Object)(object)rightFootTracker != (Object)null) { ik.solver.spine.maxRootAngle = 0f; } if ((Object)(object)leftHandTracker != (Object)null) { Transform val5 = (((Object)(object)ik.solver.leftArm.target == (Object)null) ? new GameObject("Left Hand Target").transform : ik.solver.leftArm.target); val5.position = leftHandTracker.position + leftHandTracker.rotation * Quaternion.LookRotation(settings.handTrackerForward, settings.handTrackerUp) * settings.handOffset; val5.rotation = QuaTools.MatchRotation(upAxis: Vector3.Cross(ik.solver.leftArm.wristToPalmAxis, ik.solver.leftArm.palmToThumbAxis), targetRotation: leftHandTracker.rotation * Quaternion.LookRotation(settings.handTrackerForward, settings.handTrackerUp), targetforwardAxis: settings.handTrackerForward, targetUpAxis: settings.handTrackerUp, forwardAxis: ik.solver.leftArm.wristToPalmAxis); val5.parent = leftHandTracker; ik.solver.leftArm.target = val5; ik.solver.leftArm.positionWeight = 1f; ik.solver.leftArm.rotationWeight = 1f; } else { ik.solver.leftArm.positionWeight = 0f; ik.solver.leftArm.rotationWeight = 0f; } if ((Object)(object)rightHandTracker != (Object)null) { Transform val6 = (((Object)(object)ik.solver.rightArm.target == (Object)null) ? new GameObject("Right Hand Target").transform : ik.solver.rightArm.target); val6.position = rightHandTracker.position + rightHandTracker.rotation * Quaternion.LookRotation(settings.handTrackerForward, settings.handTrackerUp) * settings.handOffset; val6.rotation = QuaTools.MatchRotation(upAxis: -Vector3.Cross(ik.solver.rightArm.wristToPalmAxis, ik.solver.rightArm.palmToThumbAxis), targetRotation: rightHandTracker.rotation * Quaternion.LookRotation(settings.handTrackerForward, settings.handTrackerUp), targetforwardAxis: settings.handTrackerForward, targetUpAxis: settings.handTrackerUp, forwardAxis: ik.solver.rightArm.wristToPalmAxis); val6.parent = rightHandTracker; ik.solver.rightArm.target = val6; ik.solver.rightArm.positionWeight = 1f; ik.solver.rightArm.rotationWeight = 1f; } else { ik.solver.rightArm.positionWeight = 0f; ik.solver.rightArm.rotationWeight = 0f; } if ((Object)(object)leftFootTracker != (Object)null) { CalibrateLeg(settings, leftFootTracker, ik.solver.leftLeg, ((Object)(object)ik.references.leftToes != (Object)null) ? ik.references.leftToes : ik.references.leftFoot, ik.references.root.forward, isLeft: true); } if ((Object)(object)rightFootTracker != (Object)null) { CalibrateLeg(settings, rightFootTracker, ik.solver.rightLeg, ((Object)(object)ik.references.rightToes != (Object)null) ? ik.references.rightToes : ik.references.rightFoot, ik.references.root.forward, isLeft: false); } bool num2 = (Object)(object)bodyTracker != (Object)null || ((Object)(object)leftFootTracker != (Object)null && (Object)(object)rightFootTracker != (Object)null); VRIKRootController vRIKRootController = ((Component)ik.references.root).GetComponent(); if (num2) { if ((Object)(object)vRIKRootController == (Object)null) { vRIKRootController = ((Component)ik.references.root).gameObject.AddComponent(); } vRIKRootController.Calibrate(); } else if ((Object)(object)vRIKRootController != (Object)null) { Object.Destroy((Object)(object)vRIKRootController); } ik.solver.spine.minHeadHeight = 0f; ik.solver.locomotion.weight = (((Object)(object)bodyTracker == (Object)null && (Object)(object)leftFootTracker == (Object)null && (Object)(object)rightFootTracker == (Object)null) ? 1f : 0f); calibrationData.scale = ik.references.root.localScale.y; calibrationData.head = new CalibrationData.Target(ik.solver.spine.headTarget); calibrationData.pelvis = new CalibrationData.Target(ik.solver.spine.pelvisTarget); calibrationData.leftHand = new CalibrationData.Target(ik.solver.leftArm.target); calibrationData.rightHand = new CalibrationData.Target(ik.solver.rightArm.target); calibrationData.leftFoot = new CalibrationData.Target(ik.solver.leftLeg.target); calibrationData.rightFoot = new CalibrationData.Target(ik.solver.rightLeg.target); calibrationData.leftLegGoal = new CalibrationData.Target(ik.solver.leftLeg.bendGoal); calibrationData.rightLegGoal = new CalibrationData.Target(ik.solver.rightLeg.bendGoal); calibrationData.pelvisTargetRight = (((Object)(object)vRIKRootController != (Object)null) ? vRIKRootController.pelvisTargetRight : Vector3.zero); calibrationData.pelvisPositionWeight = ik.solver.spine.pelvisPositionWeight; calibrationData.pelvisRotationWeight = ik.solver.spine.pelvisRotationWeight; return calibrationData; } private static void CalibrateLeg(Settings settings, Transform tracker, IKSolverVR.Leg leg, Transform lastBone, Vector3 rootForward, bool isLeft) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) string text = (isLeft ? "Left" : "Right"); Transform val = (((Object)(object)leg.target == (Object)null) ? new GameObject(text + " Foot Target").transform : leg.target); Quaternion val2 = tracker.rotation * Quaternion.LookRotation(settings.footTrackerForward, settings.footTrackerUp); Vector3 val3 = val2 * Vector3.forward; val3.y = 0f; val2 = Quaternion.LookRotation(val3); float num = (isLeft ? settings.footInwardOffset : (0f - settings.footInwardOffset)); val.position = tracker.position + val2 * new Vector3(num, 0f, settings.footForwardOffset); val.position = new Vector3(val.position.x, lastBone.position.y, val.position.z); val.rotation = lastBone.rotation; Vector3 val4 = AxisTools.GetAxisVectorToDirection(lastBone, rootForward); if (Vector3.Dot(lastBone.rotation * val4, rootForward) < 0f) { val4 = -val4; } Vector3 val5 = Quaternion.Inverse(Quaternion.LookRotation(val.rotation * val4)) * val3; float num2 = Mathf.Atan2(val5.x, val5.z) * 57.29578f; float num3 = (isLeft ? settings.footHeadingOffset : (0f - settings.footHeadingOffset)); val.rotation = Quaternion.AngleAxis(num2 + num3, Vector3.up) * val.rotation; val.parent = tracker; leg.target = val; leg.positionWeight = 1f; leg.rotationWeight = 1f; Transform val6 = (((Object)(object)leg.bendGoal == (Object)null) ? new GameObject(text + " Leg Bend Goal").transform : leg.bendGoal); val6.position = lastBone.position + val2 * Vector3.forward + val2 * Vector3.up; val6.parent = tracker; leg.bendGoal = val6; leg.bendGoalWeight = 1f; } public static void Calibrate(VRIK ik, CalibrationData data, Transform headTracker, Transform bodyTracker = null, Transform leftHandTracker = null, Transform rightHandTracker = null, Transform leftFootTracker = null, Transform rightFootTracker = null) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) if (!ik.solver.initiated) { Debug.LogError((object)"Can not calibrate before VRIK has initiated."); return; } if ((Object)(object)headTracker == (Object)null) { Debug.LogError((object)"Can not calibrate VRIK without the head tracker."); return; } ik.solver.FixTransforms(); Transform val = (((Object)(object)ik.solver.spine.headTarget == (Object)null) ? new GameObject("Head Target").transform : ik.solver.spine.headTarget); val.parent = headTracker; data.head.SetTo(val); ik.solver.spine.headTarget = val; ik.references.root.localScale = data.scale * Vector3.one; if ((Object)(object)bodyTracker != (Object)null && data.pelvis != null) { Transform val2 = (((Object)(object)ik.solver.spine.pelvisTarget == (Object)null) ? new GameObject("Pelvis Target").transform : ik.solver.spine.pelvisTarget); val2.parent = bodyTracker; data.pelvis.SetTo(val2); ik.solver.spine.pelvisTarget = val2; ik.solver.spine.pelvisPositionWeight = data.pelvisPositionWeight; ik.solver.spine.pelvisRotationWeight = data.pelvisRotationWeight; ik.solver.plantFeet = false; ik.solver.spine.maxRootAngle = 180f; } else if ((Object)(object)leftFootTracker != (Object)null && (Object)(object)rightFootTracker != (Object)null) { ik.solver.spine.maxRootAngle = 0f; } if ((Object)(object)leftHandTracker != (Object)null) { Transform val3 = (((Object)(object)ik.solver.leftArm.target == (Object)null) ? new GameObject("Left Hand Target").transform : ik.solver.leftArm.target); val3.parent = leftHandTracker; data.leftHand.SetTo(val3); ik.solver.leftArm.target = val3; ik.solver.leftArm.positionWeight = 1f; ik.solver.leftArm.rotationWeight = 1f; } else { ik.solver.leftArm.positionWeight = 0f; ik.solver.leftArm.rotationWeight = 0f; } if ((Object)(object)rightHandTracker != (Object)null) { Transform val4 = (((Object)(object)ik.solver.rightArm.target == (Object)null) ? new GameObject("Right Hand Target").transform : ik.solver.rightArm.target); val4.parent = rightHandTracker; data.rightHand.SetTo(val4); ik.solver.rightArm.target = val4; ik.solver.rightArm.positionWeight = 1f; ik.solver.rightArm.rotationWeight = 1f; } else { ik.solver.rightArm.positionWeight = 0f; ik.solver.rightArm.rotationWeight = 0f; } if ((Object)(object)leftFootTracker != (Object)null) { CalibrateLeg(data, leftFootTracker, ik.solver.leftLeg, ((Object)(object)ik.references.leftToes != (Object)null) ? ik.references.leftToes : ik.references.leftFoot, ik.references.root.forward, isLeft: true); } if ((Object)(object)rightFootTracker != (Object)null) { CalibrateLeg(data, rightFootTracker, ik.solver.rightLeg, ((Object)(object)ik.references.rightToes != (Object)null) ? ik.references.rightToes : ik.references.rightFoot, ik.references.root.forward, isLeft: false); } bool num = (Object)(object)bodyTracker != (Object)null || ((Object)(object)leftFootTracker != (Object)null && (Object)(object)rightFootTracker != (Object)null); VRIKRootController vRIKRootController = ((Component)ik.references.root).GetComponent(); if (num) { if ((Object)(object)vRIKRootController == (Object)null) { vRIKRootController = ((Component)ik.references.root).gameObject.AddComponent(); } vRIKRootController.Calibrate(data); } else if ((Object)(object)vRIKRootController != (Object)null) { Object.Destroy((Object)(object)vRIKRootController); } ik.solver.spine.minHeadHeight = 0f; ik.solver.locomotion.weight = (((Object)(object)bodyTracker == (Object)null && (Object)(object)leftFootTracker == (Object)null && (Object)(object)rightFootTracker == (Object)null) ? 1f : 0f); } private static void CalibrateLeg(CalibrationData data, Transform tracker, IKSolverVR.Leg leg, Transform lastBone, Vector3 rootForward, bool isLeft) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if ((!isLeft || data.leftFoot != null) && (isLeft || data.rightFoot != null)) { string text = (isLeft ? "Left" : "Right"); Transform val = (((Object)(object)leg.target == (Object)null) ? new GameObject(text + " Foot Target").transform : leg.target); val.parent = tracker; if (isLeft) { data.leftFoot.SetTo(val); } else { data.rightFoot.SetTo(val); } leg.target = val; leg.positionWeight = 1f; leg.rotationWeight = 1f; Transform val2 = (((Object)(object)leg.bendGoal == (Object)null) ? new GameObject(text + " Leg Bend Goal").transform : leg.bendGoal); val2.parent = tracker; if (isLeft) { data.leftLegGoal.SetTo(val2); } else { data.rightLegGoal.SetTo(val2); } leg.bendGoal = val2; leg.bendGoalWeight = 1f; } } public static CalibrationData Calibrate(VRIK ik, Transform centerEyeAnchor, Transform leftHandAnchor, Transform rightHandAnchor, Vector3 centerEyePositionOffset, Vector3 centerEyeRotationOffset, Vector3 handPositionOffset, Vector3 handRotationOffset, float scaleMlp = 1f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) CalibrateHead(ik, centerEyeAnchor, centerEyePositionOffset, centerEyeRotationOffset); CalibrateHands(ik, leftHandAnchor, rightHandAnchor, handPositionOffset, handRotationOffset); CalibrateScale(ik, scaleMlp); return new CalibrationData { scale = ik.references.root.localScale.y, head = new CalibrationData.Target(ik.solver.spine.headTarget), leftHand = new CalibrationData.Target(ik.solver.leftArm.target), rightHand = new CalibrationData.Target(ik.solver.rightArm.target) }; } public static void CalibrateHead(VRIK ik, Transform centerEyeAnchor, Vector3 anchorPositionOffset, Vector3 anchorRotationOffset) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik.solver.spine.headTarget == (Object)null) { ik.solver.spine.headTarget = new GameObject("Head IK Target").transform; } Vector3 val = Quaternion.Inverse(ik.references.head.rotation) * ik.references.root.forward; Vector3 val2 = Quaternion.Inverse(ik.references.head.rotation) * ik.references.root.up; Quaternion val3 = Quaternion.LookRotation(val, val2); Vector3 val4 = ik.references.head.position + ik.references.head.rotation * val3 * anchorPositionOffset; Quaternion val5 = Quaternion.Inverse(ik.references.head.rotation * val3 * Quaternion.Euler(anchorRotationOffset)); ik.solver.spine.headTarget.parent = centerEyeAnchor; ik.solver.spine.headTarget.localPosition = val5 * (ik.references.head.position - val4); ik.solver.spine.headTarget.localRotation = val5 * ik.references.head.rotation; } public static void CalibrateBody(VRIK ik, Transform pelvisTracker, Vector3 trackerPositionOffset, Vector3 trackerRotationOffset) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik.solver.spine.pelvisTarget == (Object)null) { ik.solver.spine.pelvisTarget = new GameObject("Pelvis IK Target").transform; } ik.solver.spine.pelvisTarget.position = ik.references.pelvis.position + ik.references.root.rotation * trackerPositionOffset; ik.solver.spine.pelvisTarget.rotation = ik.references.root.rotation * Quaternion.Euler(trackerRotationOffset); ik.solver.spine.pelvisTarget.parent = pelvisTracker; } public static void CalibrateHands(VRIK ik, Transform leftHandAnchor, Transform rightHandAnchor, Vector3 anchorPositionOffset, Vector3 anchorRotationOffset) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik.solver.leftArm.target == (Object)null) { ik.solver.leftArm.target = new GameObject("Left Hand IK Target").transform; } if ((Object)(object)ik.solver.rightArm.target == (Object)null) { ik.solver.rightArm.target = new GameObject("Right Hand IK Target").transform; } CalibrateHand(ik.references.leftHand, ik.references.leftForearm, ik.solver.leftArm.target, leftHandAnchor, anchorPositionOffset, anchorRotationOffset, isLeft: true); CalibrateHand(ik.references.rightHand, ik.references.rightForearm, ik.solver.rightArm.target, rightHandAnchor, anchorPositionOffset, anchorRotationOffset, isLeft: false); } private static void CalibrateHand(Transform hand, Transform forearm, Transform target, Transform anchor, Vector3 positionOffset, Vector3 rotationOffset, bool isLeft) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (isLeft) { positionOffset.x = 0f - positionOffset.x; rotationOffset.y = 0f - rotationOffset.y; rotationOffset.z = 0f - rotationOffset.z; } Vector3 val = GuessWristToPalmAxis(hand, forearm); Vector3 val2 = GuessPalmToThumbAxis(hand, forearm); Quaternion val3 = Quaternion.LookRotation(val, val2); Vector3 val4 = hand.position + hand.rotation * val3 * positionOffset; Quaternion val5 = Quaternion.Inverse(hand.rotation * val3 * Quaternion.Euler(rotationOffset)); target.parent = anchor; target.localPosition = val5 * (hand.position - val4); target.localRotation = val5 * hand.rotation; } public static Vector3 GuessWristToPalmAxis(Transform hand, Transform forearm) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = forearm.position - hand.position; Vector3 val2 = AxisTools.ToVector3(AxisTools.GetAxisToDirection(hand, val)); if (Vector3.Dot(val, hand.rotation * val2) > 0f) { val2 = -val2; } return val2; } public static Vector3 GuessPalmToThumbAxis(Transform hand, Transform forearm) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) if (hand.childCount == 0) { Debug.LogWarning((object)("Hand " + ((Object)hand).name + " does not have any fingers, VRIK can not guess the hand bone's orientation. Please assign 'Wrist To Palm Axis' and 'Palm To Thumb Axis' manually for both arms in VRIK settings."), (Object)(object)hand); return Vector3.zero; } float num = float.PositiveInfinity; int num2 = 0; for (int i = 0; i < hand.childCount; i++) { float num3 = Vector3.SqrMagnitude(hand.GetChild(i).position - hand.position); if (num3 < num) { num = num3; num2 = i; } } Vector3 val = Vector3.Cross(Vector3.Cross(hand.position - forearm.position, hand.GetChild(num2).position - hand.position), hand.position - forearm.position); Vector3 val2 = AxisTools.ToVector3(AxisTools.GetAxisToDirection(hand, val)); if (Vector3.Dot(val, hand.rotation * val2) < 0f) { val2 = -val2; } return val2; } } public class VRIKLODController : MonoBehaviour { public Renderer LODRenderer; public float LODDistance = 15f; public bool allowCulled = true; private VRIK ik; private void Start() { ik = ((Component)this).GetComponent(); } private void Update() { ik.solver.LOD = GetLODLevel(); } private int GetLODLevel() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (allowCulled) { if ((Object)(object)LODRenderer == (Object)null) { return 0; } if (!LODRenderer.isVisible) { return 2; } } Vector3 val = ((Component)ik).transform.position - ((Component)Camera.main).transform.position; if (((Vector3)(ref val)).sqrMagnitude > LODDistance * LODDistance) { return 1; } return 0; } } public class VRIKRootController : MonoBehaviour { private Transform pelvisTarget; private Transform leftFootTarget; private Transform rightFootTarget; private VRIK ik; public Vector3 pelvisTargetRight { get; private set; } private void Awake() { ik = ((Component)this).GetComponent(); IKSolverVR solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Combine(solver.OnPreUpdate, new IKSolver.UpdateDelegate(OnPreUpdate)); Calibrate(); } public void Calibrate() { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik == (Object)null) { Debug.LogError((object)"No VRIK found on VRIKRootController's GameObject.", (Object)(object)((Component)this).transform); return; } pelvisTarget = ik.solver.spine.pelvisTarget; leftFootTarget = ik.solver.leftLeg.target; rightFootTarget = ik.solver.rightLeg.target; if ((Object)(object)pelvisTarget != (Object)null) { pelvisTargetRight = Quaternion.Inverse(pelvisTarget.rotation) * ik.references.root.right; } } public void Calibrate(VRIKCalibrator.CalibrationData data) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ik == (Object)null) { Debug.LogError((object)"No VRIK found on VRIKRootController's GameObject.", (Object)(object)((Component)this).transform); return; } pelvisTarget = ik.solver.spine.pelvisTarget; leftFootTarget = ik.solver.leftLeg.target; rightFootTarget = ik.solver.rightLeg.target; if ((Object)(object)pelvisTarget != (Object)null) { pelvisTargetRight = data.pelvisTargetRight; } } private void OnPreUpdate() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled) { if ((Object)(object)pelvisTarget != (Object)null) { ik.references.root.position = new Vector3(pelvisTarget.position.x, ik.references.root.position.y, pelvisTarget.position.z); Vector3 val = Vector3.Cross(pelvisTarget.rotation * pelvisTargetRight, ik.references.root.up); val.y = 0f; ik.references.root.rotation = Quaternion.LookRotation(val); ik.references.pelvis.position = Vector3.Lerp(ik.references.pelvis.position, pelvisTarget.position, ik.solver.spine.pelvisPositionWeight); ik.references.pelvis.rotation = Quaternion.Slerp(ik.references.pelvis.rotation, pelvisTarget.rotation, ik.solver.spine.pelvisRotationWeight); } else if ((Object)(object)leftFootTarget != (Object)null && (Object)(object)rightFootTarget != (Object)null) { ik.references.root.position = Vector3.Lerp(leftFootTarget.position, rightFootTarget.position, 0.5f); } } } private void OnDestroy() { if ((Object)(object)ik != (Object)null) { IKSolverVR solver = ik.solver; solver.OnPreUpdate = (IKSolver.UpdateDelegate)Delegate.Remove(solver.OnPreUpdate, new IKSolver.UpdateDelegate(OnPreUpdate)); } } } }