From 8d5c760d55de59f2232f0f74a9b3be7107dcb060 Mon Sep 17 00:00:00 2001 From: "Jeremy J. Hartmann" Date: Wed, 6 Mar 2024 20:14:49 -0500 Subject: [PATCH] Update version 0.13.1 --- Editor/BuildScripts/ThumbnailGenerator.cs | 2 + .../MVirtualLightingTrackerEditor.cs | 2 +- .../MTIONSDKToolsAvatarAnimationsTab.cs | 48 ++++++++ .../MTIONSDKToolsAvatarAnimationsTab.cs.meta | 11 ++ .../MTIONSDKToolsAvatarMovementTab.cs | 47 +++++++ .../MTIONSDKToolsAvatarMovementTab.cs.meta | 3 + Editor/ControlPanels/MTIONSDKToolsWindow.cs | 34 ++++++ Plugins/ThirdParty/Draco.dll | 2 +- Plugins/ThirdParty/DracoEditor.dll | 2 +- Plugins/ThirdParty/DracoEncoder.dll | 2 +- Plugins/ThirdParty/FastSpringBone.dll | 2 +- Plugins/ThirdParty/FastSpringBone10.dll | 2 +- Plugins/ThirdParty/GLTFSerialization.dll | 2 +- Plugins/ThirdParty/Ktx.Editor.dll | 2 +- Plugins/ThirdParty/Ktx.dll | 2 +- Plugins/ThirdParty/MTIONServerAPI_Core.dll | 4 +- .../MTIONStudioSDK_Public_Compiled.dll | 4 +- .../MTIONStudioSDK_Public_Compiled_Editor.dll | 2 +- Plugins/ThirdParty/MTIONUtilityClasses.dll | 2 +- Plugins/ThirdParty/MToon.Editor.dll | 2 +- Plugins/ThirdParty/MToon.dll | 2 +- Plugins/ThirdParty/NakamaRuntime.dll | 2 +- .../System.Threading.Channels.dll.meta | 2 +- Plugins/ThirdParty/UniGLTF.Editor.dll | 2 +- Plugins/ThirdParty/UniGLTF.Utils.dll | 2 +- Plugins/ThirdParty/UniGLTF.dll | 2 +- Plugins/ThirdParty/UniHumanoid.Editor.dll | 2 +- Plugins/ThirdParty/UniHumanoid.dll | 2 +- Plugins/ThirdParty/UniVRM.Editor.dll | 2 +- Plugins/ThirdParty/UnityGLTFEditor.dll | 2 +- Plugins/ThirdParty/UnityGLTFScripts.dll | 4 +- Plugins/ThirdParty/VRM.dll | 2 +- Plugins/ThirdParty/VRM10.Editor.dll | 2 +- Plugins/ThirdParty/VRM10.dll | 2 +- .../ThirdParty/VRMShaders.GLTF.IO.Editor.dll | 2 +- .../ThirdParty/VRMShaders.GLTF.IO.Runtime.dll | 2 +- .../VRMShaders.GLTF.UniUnlit.Editor.dll | 2 +- .../VRMShaders.GLTF.UniUnlit.Runtime.dll | 2 +- .../ThirdParty/VRMShaders.VRM.IO.Runtime.dll | 2 +- .../VRMShaders.VRM10.Format.Runtime.dll | 2 +- .../VRMShaders.VRM10.MToon10.Editor.dll | 2 +- .../VRMShaders.VRM10.MToon10.Runtime.dll | 2 +- Plugins/ThirdParty/VrmLib.dll | 2 +- Plugins/ThirdParty/Websocket.Client.dll.meta | 2 +- Plugins/ThirdParty/YamlDotNet.dll.meta | 2 +- Plugins/ThirdParty/glTFast.Editor.dll | 2 +- Plugins/ThirdParty/glTFast.Export.dll | 2 +- Plugins/ThirdParty/glTFast.dll | 2 +- Plugins/ThirdParty/glTFast.dots.dll | 4 +- .../ActionSystem/IMActionInterfaceHandler.cs | 12 +- Scripts/ActionSystem/IMActionInterfaceImpl.cs | 25 ++-- .../Internal/ActionEntryParameterInfo.cs | 20 ++- .../Internal/ActionTypeConverter.cs | 15 ++- .../ActionSystem/Internal/MActionBehaviour.cs | 12 +- Scripts/Avatar/AvatarAnimations.cs | 70 +++++++++++ Scripts/Avatar/AvatarAnimations.cs.meta | 11 ++ Scripts/Avatar/AvatarEmote.cs | 23 ++++ Scripts/Avatar/AvatarEmote.cs.meta | 11 ++ Scripts/Avatar/AvatarJumpAnimations.cs | 23 ++++ Scripts/Avatar/AvatarJumpAnimations.cs.meta | 3 + Scripts/Avatar/AvatarMovementAnimations.cs | 44 +++++++ .../Avatar/AvatarMovementAnimations.cs.meta | 3 + Scripts/Avatar/AvatarMovementSettings.cs | 31 +++++ Scripts/Avatar/AvatarMovementSettings.cs.meta | 3 + Scripts/MTIONSDKAvatar.cs | 17 +++ Scripts/NavMesh/MTIONNavMeshAgent.cs | 115 ++++++++++-------- Scripts/NavMesh/NavMeshAgentLinkMover.cs | 69 +++++++---- Scripts/NavMesh/NavMeshAgentMovement.cs | 40 ++++++ .../NavMesh/NavMeshAgentPositionMovement.cs | 6 + Scripts/NavMesh/NavMeshAgentRandomMovement.cs | 58 ++++++++- Scripts/NavMesh/NavMeshAgentTargetMovement.cs | 7 +- ThirdParty/VRMShaders/GLTF.meta | 2 +- ThirdParty/VRMShaders/GLTF/IO.meta | 2 +- ThirdParty/VRMShaders/GLTF/IO/Resources.meta | 2 +- .../VRMShaders/GLTF/IO/Resources/UniGLTF.meta | 2 +- ThirdParty/VRMShaders/GLTF/UniUnlit.meta | 2 +- .../VRMShaders/GLTF/UniUnlit/Resources.meta | 2 +- .../GLTF/UniUnlit/Resources/UniGLTF.meta | 2 +- ThirdParty/VRMShaders/VRM.meta | 2 +- ThirdParty/VRMShaders/VRM/MToon.meta | 2 +- ThirdParty/VRMShaders/VRM/MToon/Mtoon.meta | 2 +- .../VRMShaders/VRM/MToon/Mtoon/Resources.meta | 2 +- .../VRM/MToon/Mtoon/Resources/Shaders.meta | 2 +- .../VRM/VRMShaders.shadervariants.meta | 2 +- ThirdParty/VRMShaders/VRM10.meta | 2 +- ThirdParty/VRMShaders/VRM10/MToon10.meta | 2 +- .../VRMShaders/VRM10/MToon10/Resources.meta | 2 +- .../VRM10/MToon10/Resources/VRM10.meta | 2 +- .../VRM10/VRM10Shaders.shadervariants.meta | 2 +- package.json | 2 +- 90 files changed, 728 insertions(+), 167 deletions(-) create mode 100644 Editor/ControlPanels/MTIONSDKToolsAvatarAnimationsTab.cs create mode 100644 Editor/ControlPanels/MTIONSDKToolsAvatarAnimationsTab.cs.meta create mode 100644 Editor/ControlPanels/MTIONSDKToolsAvatarMovementTab.cs create mode 100644 Editor/ControlPanels/MTIONSDKToolsAvatarMovementTab.cs.meta create mode 100644 Scripts/Avatar/AvatarAnimations.cs create mode 100644 Scripts/Avatar/AvatarAnimations.cs.meta create mode 100644 Scripts/Avatar/AvatarEmote.cs create mode 100644 Scripts/Avatar/AvatarEmote.cs.meta create mode 100644 Scripts/Avatar/AvatarJumpAnimations.cs create mode 100644 Scripts/Avatar/AvatarJumpAnimations.cs.meta create mode 100644 Scripts/Avatar/AvatarMovementAnimations.cs create mode 100644 Scripts/Avatar/AvatarMovementAnimations.cs.meta create mode 100644 Scripts/Avatar/AvatarMovementSettings.cs create mode 100644 Scripts/Avatar/AvatarMovementSettings.cs.meta diff --git a/Editor/BuildScripts/ThumbnailGenerator.cs b/Editor/BuildScripts/ThumbnailGenerator.cs index 99d73aa..dfad923 100644 --- a/Editor/BuildScripts/ThumbnailGenerator.cs +++ b/Editor/BuildScripts/ThumbnailGenerator.cs @@ -64,6 +64,7 @@ private static void TakeSnapshot(Camera camera, string directory, string filenam RenderTexture.active = rt; Texture2D snapshot = new Texture2D(ThumbnailResWidth, ThumbnailResHeight, TextureFormat.RGB24, false); + snapshot.name = $"Snapshoot-{filename}"; snapshot.ReadPixels(new Rect(0, 0, ThumbnailResWidth, ThumbnailResHeight), 0, 0); camera.targetTexture = null; @@ -71,6 +72,7 @@ private static void TakeSnapshot(Camera camera, string directory, string filenam GameObject.DestroyImmediate(rt); WriteSnapshotToFile(snapshot, directory, filename); + GameObject.Destroy(snapshot); } private static void WriteSnapshotToFile(Texture2D snapshot, string directory, string filename) diff --git a/Editor/Components/MVirtualLightingTrackerEditor.cs b/Editor/Components/MVirtualLightingTrackerEditor.cs index e9501fe..78c2e73 100644 --- a/Editor/Components/MVirtualLightingTrackerEditor.cs +++ b/Editor/Components/MVirtualLightingTrackerEditor.cs @@ -97,7 +97,7 @@ public override void OnInspectorGUI() var lightComponent = instance_.gameObject.GetComponent(); - LightType unityType = instance_.LightParams.LightType == LightingComponentType.PointLight ? LightType.Point : LightType.Spot; + LightType unityType = instance_.LightParams.LightType == LightingComponentType.POINT_LIGHT ? LightType.Point : LightType.Spot; if (lightComponent.type != unityType) { lightComponent.type = unityType; diff --git a/Editor/ControlPanels/MTIONSDKToolsAvatarAnimationsTab.cs b/Editor/ControlPanels/MTIONSDKToolsAvatarAnimationsTab.cs new file mode 100644 index 0000000..1e01f32 --- /dev/null +++ b/Editor/ControlPanels/MTIONSDKToolsAvatarAnimationsTab.cs @@ -0,0 +1,48 @@ +using UnityEditor; +using UnityEngine; + +namespace mtion.room.sdk +{ + public static class MTIONSDKToolsAvatarAnimationsTab + { + private static Vector2 _scrollPos; + private static AvatarAnimations _avatarAnimations; + private static Editor _avatarAnimationsEditor; + + + public static void Refresh() + { + if (_avatarAnimations == null) + { + _avatarAnimations = GameObject.FindObjectOfType(); + _avatarAnimationsEditor = Editor.CreateEditor(_avatarAnimations); + } + } + + public static void Draw() + { + using (var scrollView = new EditorGUILayout.ScrollViewScope(_scrollPos)) + { + _scrollPos = scrollView.scrollPosition; + DrawAvatarAnimations(); + } + } + + private static void DrawAvatarAnimations() + { + if (_avatarAnimations == null) + { + MTIONSDKToolsWindow.StartBox(); + { + EditorGUILayout.LabelField("Add an avatar to edit animations", + MTIONSDKToolsWindow.ListHeaderStyle); + } + MTIONSDKToolsWindow.EndBox(); + return; + } + + _avatarAnimationsEditor.OnInspectorGUI(); + } + } + +} diff --git a/Editor/ControlPanels/MTIONSDKToolsAvatarAnimationsTab.cs.meta b/Editor/ControlPanels/MTIONSDKToolsAvatarAnimationsTab.cs.meta new file mode 100644 index 0000000..8f80f39 --- /dev/null +++ b/Editor/ControlPanels/MTIONSDKToolsAvatarAnimationsTab.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 43cc9d6d306c86e40bae25809a53e684 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/ControlPanels/MTIONSDKToolsAvatarMovementTab.cs b/Editor/ControlPanels/MTIONSDKToolsAvatarMovementTab.cs new file mode 100644 index 0000000..20d2d2f --- /dev/null +++ b/Editor/ControlPanels/MTIONSDKToolsAvatarMovementTab.cs @@ -0,0 +1,47 @@ +using UnityEditor; +using UnityEngine; + +namespace mtion.room.sdk +{ + public static class MTIONSDKToolsAvatarMovementTab + { + private static Vector2 _scrollPos; + private static AvatarMovementSettings _avatarMovement; + private static Editor _avatarMovementEditor; + + + public static void Refresh() + { + if (_avatarMovement == null) + { + _avatarMovement = GameObject.FindObjectOfType(); + _avatarMovementEditor = Editor.CreateEditor(_avatarMovement); + } + } + + public static void Draw() + { + using (var scrollView = new EditorGUILayout.ScrollViewScope(_scrollPos)) + { + _scrollPos = scrollView.scrollPosition; + DrawAvatarMovementSettings(); + } + } + + private static void DrawAvatarMovementSettings() + { + if (_avatarMovement == null) + { + MTIONSDKToolsWindow.StartBox(); + { + EditorGUILayout.LabelField("Add an avatar to edit movement settings", + MTIONSDKToolsWindow.ListHeaderStyle); + } + MTIONSDKToolsWindow.EndBox(); + return; + } + + _avatarMovementEditor.OnInspectorGUI(); + } + } +} diff --git a/Editor/ControlPanels/MTIONSDKToolsAvatarMovementTab.cs.meta b/Editor/ControlPanels/MTIONSDKToolsAvatarMovementTab.cs.meta new file mode 100644 index 0000000..f1588d3 --- /dev/null +++ b/Editor/ControlPanels/MTIONSDKToolsAvatarMovementTab.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1225aace448548d9be167754da9e8f60 +timeCreated: 1709075056 \ No newline at end of file diff --git a/Editor/ControlPanels/MTIONSDKToolsWindow.cs b/Editor/ControlPanels/MTIONSDKToolsWindow.cs index 916a144..cebe9cf 100644 --- a/Editor/ControlPanels/MTIONSDKToolsWindow.cs +++ b/Editor/ControlPanels/MTIONSDKToolsWindow.cs @@ -20,6 +20,8 @@ private enum Tabs ACTIONS, OPTIMIZATION, RAGDOLL, + AVATAR_MOVEMENT, + AVATAR_ANIMATIONS, HELP } @@ -33,6 +35,8 @@ public enum WarningType private static bool _showPropPanel; private static bool _showActionPanel; private static bool _showRagdollPanel; + private static bool _showAvatarMovementPanel; + private static bool _showAvatarAnimationsPanel; private static ListRequest _packageListRequest; private static string _sdkVersion; @@ -131,6 +135,12 @@ private void OnFocus() case Tabs.ACTIONS: MTIONSDKToolsActionTab.Refresh(); break; + case Tabs.AVATAR_MOVEMENT: + MTIONSDKToolsAvatarMovementTab.Refresh(); + break; + case Tabs.AVATAR_ANIMATIONS: + MTIONSDKToolsAvatarAnimationsTab.Refresh(); + break; case Tabs.OPTIMIZATION: break; case Tabs.HELP: @@ -359,6 +369,20 @@ private void DrawTabButtons() { _selectedTab = Tabs.RAGDOLL; } + else if (_showAvatarMovementPanel && GUILayout.Button("Movement", _selectedTab == Tabs.AVATAR_MOVEMENT + ? _toolbarButtonSelectedStyle + : _toolbarButtonStyle)) + { + _selectedTab = Tabs.AVATAR_MOVEMENT; + MTIONSDKToolsAvatarMovementTab.Refresh(); + } + else if (_showAvatarAnimationsPanel && GUILayout.Button("Animations", _selectedTab == Tabs.AVATAR_ANIMATIONS + ? _toolbarButtonSelectedStyle + : _toolbarButtonStyle)) + { + _selectedTab = Tabs.AVATAR_ANIMATIONS; + MTIONSDKToolsAvatarAnimationsTab.Refresh(); + } else if (GUILayout.Button("Help", _selectedTab == Tabs.HELP ? _toolbarButtonSelectedStyle : _toolbarButtonStyle)) @@ -389,6 +413,12 @@ private void DrawTabContent() case Tabs.RAGDOLL: MTIONSDKToolsRagdollTab.Draw(); break; + case Tabs.AVATAR_MOVEMENT: + MTIONSDKToolsAvatarMovementTab.Draw(); + break; + case Tabs.AVATAR_ANIMATIONS: + MTIONSDKToolsAvatarAnimationsTab.Draw(); + break; case Tabs.HELP: MTIONSDKToolsHelpTab.Draw(); break; @@ -403,6 +433,8 @@ private void UpdateTabsToDisplay() _showPropPanel = false; _showActionPanel = false; _showRagdollPanel = false; + _showAvatarMovementPanel = false; + _showAvatarAnimationsPanel = false; } else { @@ -410,6 +442,8 @@ private void UpdateTabsToDisplay() _showActionPanel = descriptorObject.ObjectType == MTIONObjectType.MTIONSDK_ASSET || descriptorObject.ObjectType == MTIONObjectType.MTIONSDK_AVATAR; _showRagdollPanel = descriptorObject.ObjectType == MTIONObjectType.MTIONSDK_AVATAR; + _showAvatarMovementPanel = descriptorObject.ObjectType == MTIONObjectType.MTIONSDK_AVATAR; + _showAvatarAnimationsPanel = descriptorObject.ObjectType == MTIONObjectType.MTIONSDK_AVATAR; } } diff --git a/Plugins/ThirdParty/Draco.dll b/Plugins/ThirdParty/Draco.dll index efe2cc9..2cea758 100644 --- a/Plugins/ThirdParty/Draco.dll +++ b/Plugins/ThirdParty/Draco.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7ef7d7746251fc39c03fa480e79acd1d90d65ae4cabf4a31028bf289d5f5ed94 +oid sha256:e5a4f28f4642390d09c3c1ef79f38345c0a62b5470d64fa29ac8d2efe9a0516b size 34304 diff --git a/Plugins/ThirdParty/DracoEditor.dll b/Plugins/ThirdParty/DracoEditor.dll index 0046d15..31e243a 100644 --- a/Plugins/ThirdParty/DracoEditor.dll +++ b/Plugins/ThirdParty/DracoEditor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7b20325255bf790419ec888ac158956c346f797158b88e0cbd705b5292868be7 +oid sha256:20e6995978ea8b736fb51ea4fae5d0e9b523456171161e0d493972cf79186b39 size 11776 diff --git a/Plugins/ThirdParty/DracoEncoder.dll b/Plugins/ThirdParty/DracoEncoder.dll index dc56cf7..f642aef 100644 --- a/Plugins/ThirdParty/DracoEncoder.dll +++ b/Plugins/ThirdParty/DracoEncoder.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8cb0c0fcc9536bf62ba638999c40b7b82cac5c7b0bb16b058453adfe8af7d496 +oid sha256:af35e3f8229b6abe1cdb3cb311b140d55be31ca70b82e08be26a8fc8efedaa76 size 9216 diff --git a/Plugins/ThirdParty/FastSpringBone.dll b/Plugins/ThirdParty/FastSpringBone.dll index 1be6a24..c935a2b 100644 --- a/Plugins/ThirdParty/FastSpringBone.dll +++ b/Plugins/ThirdParty/FastSpringBone.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:afbada10ee7a84f48735e0909c8cc57f3014ded4e88ce14a03dc88a5cea70242 +oid sha256:385b99c6a28c1eefc73663779af245c5f9aa64869ca7755c248b168203a4c048 size 22528 diff --git a/Plugins/ThirdParty/FastSpringBone10.dll b/Plugins/ThirdParty/FastSpringBone10.dll index b819af6..042f78a 100644 --- a/Plugins/ThirdParty/FastSpringBone10.dll +++ b/Plugins/ThirdParty/FastSpringBone10.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1347f60f89b32c9565c06e667357d6592796dfc6173d46565c23a3e3cf8571b8 +oid sha256:347ef6b32c3252a94e934ff8fc05c7c10c6dd2b81c7c643360d5ef2ac247bfc6 size 22016 diff --git a/Plugins/ThirdParty/GLTFSerialization.dll b/Plugins/ThirdParty/GLTFSerialization.dll index 41df13c..ce71e2a 100644 --- a/Plugins/ThirdParty/GLTFSerialization.dll +++ b/Plugins/ThirdParty/GLTFSerialization.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:17c4de340634a51181c6d2b1a249572ff9f620b5ffb0a4b00e4b9b0f8de6778b +oid sha256:9a7b01ce810ffb49725e1c13a56e5dbc0cfb9dc5a9d0fc6b2dbdb149b413e322 size 122368 diff --git a/Plugins/ThirdParty/Ktx.Editor.dll b/Plugins/ThirdParty/Ktx.Editor.dll index c72b853..e303783 100644 --- a/Plugins/ThirdParty/Ktx.Editor.dll +++ b/Plugins/ThirdParty/Ktx.Editor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:89de89e46c9fcc07126ced0fe0ba4531a4412cc477f6ebd106539bc9b7a6fb46 +oid sha256:ebef55d0fa986ff1be0a9c51cb33dd217046b0cbdeb9ac50b8cc44904cb30d16 size 10240 diff --git a/Plugins/ThirdParty/Ktx.dll b/Plugins/ThirdParty/Ktx.dll index e888167..997a3c0 100644 --- a/Plugins/ThirdParty/Ktx.dll +++ b/Plugins/ThirdParty/Ktx.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:35bced62a13668ff296a8467924d3fb6a8af1e8c677d8fafda19536a3b8f38c7 +oid sha256:02c956dda87f31572fcfef7c80207424a0793a3b79993328efcdd134d4f86d82 size 48640 diff --git a/Plugins/ThirdParty/MTIONServerAPI_Core.dll b/Plugins/ThirdParty/MTIONServerAPI_Core.dll index 9b61f73..7ed7732 100644 --- a/Plugins/ThirdParty/MTIONServerAPI_Core.dll +++ b/Plugins/ThirdParty/MTIONServerAPI_Core.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:88f59ba35906b4e80a3c3221a3a58d75338bd8b7cb4a79df54847904dd0ac940 -size 135680 +oid sha256:cb46b57e1e2649579e50eaa7fa560401748128c9443fdc9382d6f070456856d2 +size 139264 diff --git a/Plugins/ThirdParty/MTIONStudioSDK_Public_Compiled.dll b/Plugins/ThirdParty/MTIONStudioSDK_Public_Compiled.dll index b5ca7a3..c0296a4 100644 --- a/Plugins/ThirdParty/MTIONStudioSDK_Public_Compiled.dll +++ b/Plugins/ThirdParty/MTIONStudioSDK_Public_Compiled.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7b3a3e41ed8be8df2637eb27cbaf98f6e6374fcd2609c8846441914147bd56ce -size 58880 +oid sha256:96da96bfefa2092e7447b6f6bb65b449ac59ce4e1dff200e78f7d0828641b6b0 +size 59904 diff --git a/Plugins/ThirdParty/MTIONStudioSDK_Public_Compiled_Editor.dll b/Plugins/ThirdParty/MTIONStudioSDK_Public_Compiled_Editor.dll index c94f5c6..c300709 100644 --- a/Plugins/ThirdParty/MTIONStudioSDK_Public_Compiled_Editor.dll +++ b/Plugins/ThirdParty/MTIONStudioSDK_Public_Compiled_Editor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:919dd8eab440cb2e31922d0dfb88818f4908a0681b493c139e4d9a2fe575e565 +oid sha256:62df839e8860aa305bbb6f91fc1b075ba615411eea71395cb1a4991e83b03cf2 size 22016 diff --git a/Plugins/ThirdParty/MTIONUtilityClasses.dll b/Plugins/ThirdParty/MTIONUtilityClasses.dll index b83d06d..3650a21 100644 --- a/Plugins/ThirdParty/MTIONUtilityClasses.dll +++ b/Plugins/ThirdParty/MTIONUtilityClasses.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9260f705885a1ca5446922c41c3c1f4446ec71c8262ed5661ed1b0bb0487e5c +oid sha256:856d830689017ed1fd640dcbee3c1d297ad35ab00381ecd91b415551aad907c2 size 31744 diff --git a/Plugins/ThirdParty/MToon.Editor.dll b/Plugins/ThirdParty/MToon.Editor.dll index 7fcc0af..4d49814 100644 --- a/Plugins/ThirdParty/MToon.Editor.dll +++ b/Plugins/ThirdParty/MToon.Editor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ffb01eee99c17c3c02f37ca2b18e65f7349a17f8ee7235e082beec3701162783 +oid sha256:7e8cd6b505f446954fe848a53dfa864ae3c892c83ad603d6755c514916f177cc size 16384 diff --git a/Plugins/ThirdParty/MToon.dll b/Plugins/ThirdParty/MToon.dll index 2698c0e..9c11609 100644 --- a/Plugins/ThirdParty/MToon.dll +++ b/Plugins/ThirdParty/MToon.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dd8dcef55e33edeedf2aae8c615deff8c984b78ff0d0871b2a340654ff98b61d +oid sha256:52ff186ca7a53d7f66a2bfca67005f2dc16b00fb3037ea861f2bf9216288507c size 17408 diff --git a/Plugins/ThirdParty/NakamaRuntime.dll b/Plugins/ThirdParty/NakamaRuntime.dll index dff53e2..f4b6e36 100644 --- a/Plugins/ThirdParty/NakamaRuntime.dll +++ b/Plugins/ThirdParty/NakamaRuntime.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:82053e2d880616cfaaa312615549b93cb2411376f8cb2ad6f9f89df7d3ad7c0e +oid sha256:d251272f078b653ada22a539f9327444b8a6f1ab8edb00b5801874865a9164af size 13312 diff --git a/Plugins/ThirdParty/System.Threading.Channels.dll.meta b/Plugins/ThirdParty/System.Threading.Channels.dll.meta index 2ff1925..53b7a42 100644 --- a/Plugins/ThirdParty/System.Threading.Channels.dll.meta +++ b/Plugins/ThirdParty/System.Threading.Channels.dll.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7197b1165df3bf947b07415062620855 +guid: 02f2fb12332ad2146b7d5b75822e9f75 labels: - NuGetForUnity PluginImporter: diff --git a/Plugins/ThirdParty/UniGLTF.Editor.dll b/Plugins/ThirdParty/UniGLTF.Editor.dll index 19c4176..9e3ffee 100644 --- a/Plugins/ThirdParty/UniGLTF.Editor.dll +++ b/Plugins/ThirdParty/UniGLTF.Editor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fbade2fda9e6a57476a09b2e2a2f509edbf45336bee570bbef1e56555451168a +oid sha256:58305becd9972053a02d9c396868d39c28b537d9be334f263bca0aa0092aac2e size 176128 diff --git a/Plugins/ThirdParty/UniGLTF.Utils.dll b/Plugins/ThirdParty/UniGLTF.Utils.dll index acd9fbe..1f08073 100644 --- a/Plugins/ThirdParty/UniGLTF.Utils.dll +++ b/Plugins/ThirdParty/UniGLTF.Utils.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:434d1fac8eeb58a254319dee1c139b5d251903cd4636e4c7d123f4eaf2105341 +oid sha256:a6ae74d8b2df5cd70e6c8d2651bf87aa88764675656725564be229e4765a36f1 size 6656 diff --git a/Plugins/ThirdParty/UniGLTF.dll b/Plugins/ThirdParty/UniGLTF.dll index bd165f3..31b37af 100644 --- a/Plugins/ThirdParty/UniGLTF.dll +++ b/Plugins/ThirdParty/UniGLTF.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:51be6bf2b2bfc072ead22fb4387a787f9fd3af7c19758b38ee8a52edfd19512c +oid sha256:059542d5a1139d830f310cf0c13c7585b73ec2c7ae4db4d684995483cde68d4c size 363520 diff --git a/Plugins/ThirdParty/UniHumanoid.Editor.dll b/Plugins/ThirdParty/UniHumanoid.Editor.dll index 855ce63..5ac4ec1 100644 --- a/Plugins/ThirdParty/UniHumanoid.Editor.dll +++ b/Plugins/ThirdParty/UniHumanoid.Editor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b1ecb3b3478101ea81d83ea7f916db5bcafda50aa15d9aa75d1b0bfb46093c3 +oid sha256:a4702fa9b5c559540060e9fce76a6c6e2f424896b43890bb9f4b3e0d9e54efc3 size 33280 diff --git a/Plugins/ThirdParty/UniHumanoid.dll b/Plugins/ThirdParty/UniHumanoid.dll index 9cdfc02..3dc0e30 100644 --- a/Plugins/ThirdParty/UniHumanoid.dll +++ b/Plugins/ThirdParty/UniHumanoid.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f0f007a565ff90bdc4218968e270d346ae1041e4860c21d7e4d2e2bc14ebabdb +oid sha256:a9bf938e7a50783aaaf6b5e07ef7b8a2348a369caf3f5a860ed45d14fc50dcfc size 87552 diff --git a/Plugins/ThirdParty/UniVRM.Editor.dll b/Plugins/ThirdParty/UniVRM.Editor.dll index 0bc5bb2..56327ad 100644 --- a/Plugins/ThirdParty/UniVRM.Editor.dll +++ b/Plugins/ThirdParty/UniVRM.Editor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:27cc2b2e94f1deec3008dff02def07f2cb8ab86429c4890a527bf4b21acf623e +oid sha256:fd24aa1db288cbd3bdaccf3cbc8c8e7fe17697cbb10b8d8231784e59ddae0a37 size 124928 diff --git a/Plugins/ThirdParty/UnityGLTFEditor.dll b/Plugins/ThirdParty/UnityGLTFEditor.dll index 66512a5..7b0bdf4 100644 --- a/Plugins/ThirdParty/UnityGLTFEditor.dll +++ b/Plugins/ThirdParty/UnityGLTFEditor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5575a5d26eadee019be61236d92c5c5d866b2a6e7156cb79a600d61927f759db +oid sha256:65a8a2a2fca1b1f5a486a098b3679d7c3975f384b93ff5d79bd7a67a4a4eb084 size 28160 diff --git a/Plugins/ThirdParty/UnityGLTFScripts.dll b/Plugins/ThirdParty/UnityGLTFScripts.dll index 026bb31..aa0db30 100644 --- a/Plugins/ThirdParty/UnityGLTFScripts.dll +++ b/Plugins/ThirdParty/UnityGLTFScripts.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:308f4ace840127d4e8a514b263af648c20f47832f0bf8f59c6fc23648389b89a -size 233984 +oid sha256:aef8aa837f925455bba0189e5fe6db07274810256214ee2b6390515492b9ae3d +size 234496 diff --git a/Plugins/ThirdParty/VRM.dll b/Plugins/ThirdParty/VRM.dll index 856558a..77c0c77 100644 --- a/Plugins/ThirdParty/VRM.dll +++ b/Plugins/ThirdParty/VRM.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dc850b2f9bcbc5a5e961b4d048f36926a68657cd15ed3de3c15cc6c7de08c150 +oid sha256:673c8d346d814ab6dd19653032ef9474c07ce6ea92743e8bcb6f4a045a5606c6 size 179200 diff --git a/Plugins/ThirdParty/VRM10.Editor.dll b/Plugins/ThirdParty/VRM10.Editor.dll index bd6cc9a..c04baad 100644 --- a/Plugins/ThirdParty/VRM10.Editor.dll +++ b/Plugins/ThirdParty/VRM10.Editor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5ed2830a7a3938d660ac4fbc16c52ee08a72cd13e0e3b33750503731b8df9eac +oid sha256:e4a89b9bd19d81e62299d6b26c7478851838415df98e5b366de1eada1142e631 size 95744 diff --git a/Plugins/ThirdParty/VRM10.dll b/Plugins/ThirdParty/VRM10.dll index 01212de..a2ac868 100644 --- a/Plugins/ThirdParty/VRM10.dll +++ b/Plugins/ThirdParty/VRM10.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d288a2f2573a0b26787c5302aefee6b5a34bdf8aee0afaa8a5c22c09cfbf8933 +oid sha256:7ff85fdb273b8ab8391d4f627fa55596c98f202776866df3d8c57b08009ce5d1 size 598016 diff --git a/Plugins/ThirdParty/VRMShaders.GLTF.IO.Editor.dll b/Plugins/ThirdParty/VRMShaders.GLTF.IO.Editor.dll index 29ccc81..4b37a3d 100644 --- a/Plugins/ThirdParty/VRMShaders.GLTF.IO.Editor.dll +++ b/Plugins/ThirdParty/VRMShaders.GLTF.IO.Editor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a2d7f869d33ac0587bd80cf9d7d69d94bb427f5e09783f1b49ca02d0eb2b6d37 +oid sha256:c76655d295df5af991ef8f89a1efa9da86953e2f770d3fede2f4171e00477b08 size 8192 diff --git a/Plugins/ThirdParty/VRMShaders.GLTF.IO.Runtime.dll b/Plugins/ThirdParty/VRMShaders.GLTF.IO.Runtime.dll index 6f9245a..50c50b4 100644 --- a/Plugins/ThirdParty/VRMShaders.GLTF.IO.Runtime.dll +++ b/Plugins/ThirdParty/VRMShaders.GLTF.IO.Runtime.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fb4bac486a97ab62f38e09a075df574a9b49fc4ba513290582f4d412ee4777ea +oid sha256:a3221adc9ae22edb8687edc0f660ad7205dafcbff9c97e3d7adfaea0a5f5997b size 42496 diff --git a/Plugins/ThirdParty/VRMShaders.GLTF.UniUnlit.Editor.dll b/Plugins/ThirdParty/VRMShaders.GLTF.UniUnlit.Editor.dll index de1805d..1046ed2 100644 --- a/Plugins/ThirdParty/VRMShaders.GLTF.UniUnlit.Editor.dll +++ b/Plugins/ThirdParty/VRMShaders.GLTF.UniUnlit.Editor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f1984d6963cf7b432f5cc81bb6525d1aa404a62496e7d7ef8889e9abee93811d +oid sha256:a0493dce6bc501921d61177215604101ea140399890ae241014561bc167e4aea size 7680 diff --git a/Plugins/ThirdParty/VRMShaders.GLTF.UniUnlit.Runtime.dll b/Plugins/ThirdParty/VRMShaders.GLTF.UniUnlit.Runtime.dll index 911046a..f73e92e 100644 --- a/Plugins/ThirdParty/VRMShaders.GLTF.UniUnlit.Runtime.dll +++ b/Plugins/ThirdParty/VRMShaders.GLTF.UniUnlit.Runtime.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6cc0a02bb4ea97ca30dda69e90f7afc2abcfe82900a0991c2d0e1cef751f58fe +oid sha256:83ae8d758ae2102466aba3c0b6878d5df47e57d7ca16151513676f17d81f6bbf size 6656 diff --git a/Plugins/ThirdParty/VRMShaders.VRM.IO.Runtime.dll b/Plugins/ThirdParty/VRMShaders.VRM.IO.Runtime.dll index 8958531..cb776ac 100644 --- a/Plugins/ThirdParty/VRMShaders.VRM.IO.Runtime.dll +++ b/Plugins/ThirdParty/VRMShaders.VRM.IO.Runtime.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a4957a3afaddf529bc84f2edf541328f3087105f77ab65f6d52be06eefa2dad +oid sha256:70c0ba2091b217557625a1d225c909d7bfd2f9b75385aa6281055b1c46d71162 size 6656 diff --git a/Plugins/ThirdParty/VRMShaders.VRM10.Format.Runtime.dll b/Plugins/ThirdParty/VRMShaders.VRM10.Format.Runtime.dll index 9fa9198..4600958 100644 --- a/Plugins/ThirdParty/VRMShaders.VRM10.Format.Runtime.dll +++ b/Plugins/ThirdParty/VRMShaders.VRM10.Format.Runtime.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0e7b7fafd116be12f39957f5cd5aaf6ed75ca5f24ad7f130148835ab89d75ea2 +oid sha256:1605d2ea87c62c85bd4623a9377e5d1cec21cea5adacd435503f2e8062c1e226 size 4608 diff --git a/Plugins/ThirdParty/VRMShaders.VRM10.MToon10.Editor.dll b/Plugins/ThirdParty/VRMShaders.VRM10.MToon10.Editor.dll index e443bde..c6e4e71 100644 --- a/Plugins/ThirdParty/VRMShaders.VRM10.MToon10.Editor.dll +++ b/Plugins/ThirdParty/VRMShaders.VRM10.MToon10.Editor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dafba48fe3c171892f93475c0a39a43e331df41adc84d49501ca99a9c761771e +oid sha256:a6ec88077b4f5996ad294a5592acb40aa0d0a68230e39878b44cac31e89e4051 size 11264 diff --git a/Plugins/ThirdParty/VRMShaders.VRM10.MToon10.Runtime.dll b/Plugins/ThirdParty/VRMShaders.VRM10.MToon10.Runtime.dll index 16eeb01..1bfb2b3 100644 --- a/Plugins/ThirdParty/VRMShaders.VRM10.MToon10.Runtime.dll +++ b/Plugins/ThirdParty/VRMShaders.VRM10.MToon10.Runtime.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c4bdfaf6673eb97af7c7d21ea03cecf9e0a7cb6900df6ff2f454f782904ce20a +oid sha256:fc6c62bedd9b53de5a2d1ef7f9e061e6835b559caf4d2aded46d5c6d8f6dab4c size 14336 diff --git a/Plugins/ThirdParty/VrmLib.dll b/Plugins/ThirdParty/VrmLib.dll index 6fa4e46..abb3383 100644 --- a/Plugins/ThirdParty/VrmLib.dll +++ b/Plugins/ThirdParty/VrmLib.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ed6eb9bf0506a3d19d7306602be0e72cbd076d833970af2d44fc1c8d420ee9de +oid sha256:97b02f7a5dd75fd7a7e9be81186b9ef8325218979efe087f176c2649d11f6eaf size 64000 diff --git a/Plugins/ThirdParty/Websocket.Client.dll.meta b/Plugins/ThirdParty/Websocket.Client.dll.meta index af96225..b499a11 100644 --- a/Plugins/ThirdParty/Websocket.Client.dll.meta +++ b/Plugins/ThirdParty/Websocket.Client.dll.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 41ce811d6d9886446badb5b87a3671d1 +guid: 50ab54a44b8e59648955d5862a0a57f9 labels: - NuGetForUnity PluginImporter: diff --git a/Plugins/ThirdParty/YamlDotNet.dll.meta b/Plugins/ThirdParty/YamlDotNet.dll.meta index 9bda7c8..dc49f82 100644 --- a/Plugins/ThirdParty/YamlDotNet.dll.meta +++ b/Plugins/ThirdParty/YamlDotNet.dll.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0fd27792bb672964896f8410da4f9850 +guid: 95ce6894ad61fc4448602dd1e9224cf3 labels: - NuGetForUnity PluginImporter: diff --git a/Plugins/ThirdParty/glTFast.Editor.dll b/Plugins/ThirdParty/glTFast.Editor.dll index 694ca91..cf95e1d 100644 --- a/Plugins/ThirdParty/glTFast.Editor.dll +++ b/Plugins/ThirdParty/glTFast.Editor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b4a334cb6253931fa4fe155f061fa7c6e0b9c1114650aa80e9eccdf7964a9920 +oid sha256:a41c745ec35ec18e4ba7696104df134e85d6132b23095aa2b0539a938f401d50 size 36352 diff --git a/Plugins/ThirdParty/glTFast.Export.dll b/Plugins/ThirdParty/glTFast.Export.dll index 49988c7..301ff77 100644 --- a/Plugins/ThirdParty/glTFast.Export.dll +++ b/Plugins/ThirdParty/glTFast.Export.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:22f6927d7f22a49d01356618aa38228da3382a182b21789717baf291c37b99ce +oid sha256:855c08d1ce8b6ba48f41d551729608710db45d04ffe5b57d17d50c1a17302461 size 66560 diff --git a/Plugins/ThirdParty/glTFast.dll b/Plugins/ThirdParty/glTFast.dll index c4a0897..725e761 100644 --- a/Plugins/ThirdParty/glTFast.dll +++ b/Plugins/ThirdParty/glTFast.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:67f2728d28e066e4b74be073899c8bf526426c64740af491f2004e00e846bc04 +oid sha256:70ac346d814543dfbcea283856149aef6cf25cbe5a1115a2799abca322697abb size 232448 diff --git a/Plugins/ThirdParty/glTFast.dots.dll b/Plugins/ThirdParty/glTFast.dots.dll index 8b8d8cd..6d5e86a 100644 --- a/Plugins/ThirdParty/glTFast.dots.dll +++ b/Plugins/ThirdParty/glTFast.dots.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7c4469c9cb5a355ccf76e92d54af5f72c24749ed5537d54b80606d5482d975e3 -size 3072 +oid sha256:3fa966b2bcf9e8af83101492dd78f9ede27121992c16e62edfbcf8f078e5afe2 +size 3584 diff --git a/Scripts/ActionSystem/IMActionInterfaceHandler.cs b/Scripts/ActionSystem/IMActionInterfaceHandler.cs index 6530dd9..acc2c35 100644 --- a/Scripts/ActionSystem/IMActionInterfaceHandler.cs +++ b/Scripts/ActionSystem/IMActionInterfaceHandler.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; - namespace mtion.room.sdk.action { [Serializable] @@ -42,12 +41,23 @@ public sealed class ActionExitParameterInfo public string ParameterType; } + [Serializable] + public enum ActionNodeType + { + ACTION, + SETTER, + GETTER + } + [Serializable] public sealed class ActionInterfaceDescriptor { + public bool Deprecated; + public string Guid; public string ActionName; public string ActionDescription; + public ActionNodeType NodeType; public List ValidEntryPoints = new List(); public List ValidExitPoints = new List(); public List ValidExitParameters = new List(); diff --git a/Scripts/ActionSystem/IMActionInterfaceImpl.cs b/Scripts/ActionSystem/IMActionInterfaceImpl.cs index 85ed1e1..0ae079c 100644 --- a/Scripts/ActionSystem/IMActionInterfaceImpl.cs +++ b/Scripts/ActionSystem/IMActionInterfaceImpl.cs @@ -68,13 +68,18 @@ public sealed class ActionMetadata } - public interface IMActionExitEvent + public interface IAction + { + + } + + public interface IMActionExitEvent : IAction { void BindToActionComplete(Action onActionComplete); void UnbindToActionComplete(Action onActionComplete); } - public interface IMActionExitParameterProvider + public interface IMActionExitParameterProvider : IAction { int Count { get; } IReadOnlyList GetParameterNames(); @@ -85,42 +90,42 @@ public interface IMActionExitParameterProvider T GetParameterValue(int index); } - public interface IAction + public interface IMActionEntryEvent : IAction { } - public interface IMActionInterfaceImpl : IAction + public interface IMActionInterfaceImpl : IMActionEntryEvent { public void ActionEntryPoint(ActionMetadata metadata); } - public interface IMActionInterfaceImpl : IAction + public interface IMActionInterfaceImpl : IMActionEntryEvent { public void ActionEntryPoint(T0 param0, ActionMetadata metadata); } - public interface IMActionInterfaceImpl : IAction + public interface IMActionInterfaceImpl : IMActionEntryEvent { public void ActionEntryPoint(T0 param0, T1 param1, ActionMetadata metadata); } - public interface IMActionInterfaceImpl : IAction + public interface IMActionInterfaceImpl : IMActionEntryEvent { public void ActionEntryPoint(T0 param0, T1 param1, T2 param2, ActionMetadata metadata); } - public interface IMActionInterfaceImpl : IAction + public interface IMActionInterfaceImpl : IMActionEntryEvent { public void ActionEntryPoint(T0 param0, T1 param1, T2 param2, T3 param3, ActionMetadata metadata); } - public interface IMActionInterfaceImpl : IAction + public interface IMActionInterfaceImpl : IMActionEntryEvent { public void ActionEntryPoint(T0 param0, T1 param1, T2 param2, T3 param3, T4 param4, ActionMetadata metadata); } - public interface IMActionInterfaceImpl : IAction + public interface IMActionInterfaceImpl : IMActionEntryEvent { public void ActionEntryPoint(T0 param0, T1 param1, T2 param2, T3 param3, T4 param4, T5 param5, ActionMetadata metadata); } diff --git a/Scripts/ActionSystem/Internal/ActionEntryParameterInfo.cs b/Scripts/ActionSystem/Internal/ActionEntryParameterInfo.cs index 4a4b569..441a275 100644 --- a/Scripts/ActionSystem/Internal/ActionEntryParameterInfo.cs +++ b/Scripts/ActionSystem/Internal/ActionEntryParameterInfo.cs @@ -1,6 +1,7 @@ using Newtonsoft.Json; using System; using UnityEngine; +using System.Collections.Generic; #if MTION_INTERNAL_BUILD using mtion.service.interaction; @@ -30,14 +31,18 @@ public class ObjectMetadata : TypeMetadata { public override object DefaultValue => null; } - - + [Serializable] public class BoolMetadata : TypeMetadata { public override object DefaultValue => false; } + [Serializable] + public class EnumMetadata : TypeMetadata + { + public override object DefaultValue => 0; + } [Serializable] public class ContainerMetadata : TypeMetadata @@ -52,6 +57,7 @@ public class StringMetadata : TypeMetadata { public int TotalLength = -1; public string Default = "interlinked"; + public List Options = new List(); public override object DefaultValue => Default; } @@ -116,10 +122,18 @@ public void OnBeforeSerialize() public static ParameterType GetParameterType(string parameterType) { Type expectedType = Type.GetType(parameterType); - if (TypeConversion.NumericConverter.IsNumericType(expectedType)) + if (expectedType.IsEnum) + { + return service.interaction.ParameterType.ENUM; + } + else if (TypeConversion.NumericConverter.IsNumericType(expectedType)) { return service.interaction.ParameterType.NUMBER; } + else if (Type.GetTypeCode(expectedType) == TypeCode.Boolean) + { + return service.interaction.ParameterType.BOOLEAN; + } return service.interaction.ParameterType.STRING; } #endif diff --git a/Scripts/ActionSystem/Internal/ActionTypeConverter.cs b/Scripts/ActionSystem/Internal/ActionTypeConverter.cs index 947dc67..03cf553 100644 --- a/Scripts/ActionSystem/Internal/ActionTypeConverter.cs +++ b/Scripts/ActionSystem/Internal/ActionTypeConverter.cs @@ -199,9 +199,20 @@ public static List GenerateParameters(List inputParameters, List if (!inputType.Equals(expectedType)) { - if (NumericConverter.IsNumericType(inputType) && NumericConverter.IsNumericType(expectedType)) + if (NumericConverter.IsNumericType(inputType)) { - param = NumericConverter.ConvertToNumericValue(param, expectedType); + if (expectedType.IsEnum) + { + param = Enum.ToObject(expectedType, param); + } + else if (NumericConverter.IsNumericType(expectedType)) + { + param = NumericConverter.ConvertToNumericValue(param, expectedType); + } + else if (expectedType == typeof(string)) + { + param = Convert.ChangeType(param, expectedType); + } } else { diff --git a/Scripts/ActionSystem/Internal/MActionBehaviour.cs b/Scripts/ActionSystem/Internal/MActionBehaviour.cs index c7501e1..697a935 100644 --- a/Scripts/ActionSystem/Internal/MActionBehaviour.cs +++ b/Scripts/ActionSystem/Internal/MActionBehaviour.cs @@ -36,8 +36,10 @@ public sealed class MActionBehaviour : MonoBehaviour, IMActionInterfaceHandler public string DefaultChatCommand; + public bool Deprecated = false; public string ActionName; public string ActionDescription; + public ActionNodeType ActionNodeType = ActionNodeType.ACTION; public bool Active = true; [HideInInspector] @@ -45,7 +47,7 @@ public sealed class MActionBehaviour : MonoBehaviour, IMActionInterfaceHandler public List ActionEntryPoints = new List(); public List ActionExitPoints = new List(); - [FormerlySerializedAs("ActionExitParameters")] public List ActionExitParameterProviders = new List(); + public List ActionExitParameterProviders = new List(); private Dictionary _actionEntryMap = new Dictionary(); private Dictionary _actionExitMap = new Dictionary(); @@ -87,7 +89,11 @@ public void Invoke(ActionEventData actionData) return; } - List parameters = TypeConversion.GenerateParameters(input, paramdef); + List parameters = new List(); + if (paramdef != null) + { + parameters = TypeConversion.GenerateParameters(input, paramdef); + } parameters.Add(actionData.Metadata); @@ -103,6 +109,8 @@ public ActionInterfaceDescriptor GetInterfaceDescriptor() desc.Guid = Guid; desc.ActionName = ActionName; desc.ActionDescription = ActionDescription; + desc.NodeType = ActionNodeType; + desc.Deprecated = Deprecated; desc.ValidEntryPoints = new List(); diff --git a/Scripts/Avatar/AvatarAnimations.cs b/Scripts/Avatar/AvatarAnimations.cs new file mode 100644 index 0000000..75002d7 --- /dev/null +++ b/Scripts/Avatar/AvatarAnimations.cs @@ -0,0 +1,70 @@ +using System.Collections.Generic; +using mtion.room.sdk.action; +using UnityEngine; +using UnityEngine.Serialization; + +namespace mtion.room.sdk +{ + public sealed class AvatarAnimations : MTIONComponent + { + [SerializeField] private List IdleAnimations; + + [Header("Walk Animation Overrides")] + [SerializeField] private AvatarMovementAnimations WalkAnimations; + + [Space(5)] + [Header("Run Animation Overrides")] + [SerializeField] private AvatarMovementAnimations RunAnimations; + + [FormerlySerializedAs("JumpAnimation")] + [Space(5)] + [Header("Jump Animation Override")] + [SerializeField] private AvatarJumpAnimations IdleJumpAnimations; + [SerializeField] private AvatarJumpAnimations WalkJumpAnimations; + [SerializeField] private AvatarJumpAnimations RunJumpAnimations; + + + [Header("Custom Emotes")] + [SerializeField] public List Emotes = new List(); + + public void AddEmote(AvatarEmote emote) + { + Emotes.Add(emote); + } + + public AnimationClip[] GetIdleAnimations() + { + if (IdleAnimations.Count > 0) + { + return IdleAnimations.ToArray(); + } + + return null; + } + + public AnimationClip[] GetWalkAnimations() + { + return WalkAnimations.GetAnimationClips(); + } + + public AnimationClip[] GetRunAnimations() + { + return RunAnimations.GetAnimationClips(); + } + + public AnimationClip[] GetJumpIdleAnimations() + { + return IdleJumpAnimations.GetAnimationClips(); + } + + public AnimationClip[] GetJumpWalkAnimations() + { + return WalkJumpAnimations.GetAnimationClips(); + } + + public AnimationClip[] GetJumpRunAnimations() + { + return RunJumpAnimations.GetAnimationClips(); + } + } +} diff --git a/Scripts/Avatar/AvatarAnimations.cs.meta b/Scripts/Avatar/AvatarAnimations.cs.meta new file mode 100644 index 0000000..bf9b714 --- /dev/null +++ b/Scripts/Avatar/AvatarAnimations.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5eebe27249f08c44b885491df4631cac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Avatar/AvatarEmote.cs b/Scripts/Avatar/AvatarEmote.cs new file mode 100644 index 0000000..e011a67 --- /dev/null +++ b/Scripts/Avatar/AvatarEmote.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace mtion.room.sdk +{ + [Serializable] + public class AvatarEmote + { + [SerializeField] private string _name; + [SerializeField] private AnimationClip _animation; + + public string Name => _name; + public AnimationClip Animation => _animation; + + public AvatarEmote(string name, AnimationClip animation) + { + _name = name; + _animation = animation; + } + } +} diff --git a/Scripts/Avatar/AvatarEmote.cs.meta b/Scripts/Avatar/AvatarEmote.cs.meta new file mode 100644 index 0000000..5795b43 --- /dev/null +++ b/Scripts/Avatar/AvatarEmote.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 011789a7e8dbac5498a91ff9461bee0f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Avatar/AvatarJumpAnimations.cs b/Scripts/Avatar/AvatarJumpAnimations.cs new file mode 100644 index 0000000..6197a67 --- /dev/null +++ b/Scripts/Avatar/AvatarJumpAnimations.cs @@ -0,0 +1,23 @@ +using System; +using UnityEngine; + +namespace mtion.room.sdk +{ + [Serializable] + public struct AvatarJumpAnimations + { + [SerializeField] private AnimationClip JumpStart; + [SerializeField] private AnimationClip JumpLoop; + [SerializeField] private AnimationClip JumpEnd; + + public AnimationClip[] GetAnimationClips() + { + if (JumpStart && JumpLoop && JumpEnd) + { + return new[] { JumpStart, JumpLoop, JumpEnd }; + } + + return null; + } + } +} diff --git a/Scripts/Avatar/AvatarJumpAnimations.cs.meta b/Scripts/Avatar/AvatarJumpAnimations.cs.meta new file mode 100644 index 0000000..357328c --- /dev/null +++ b/Scripts/Avatar/AvatarJumpAnimations.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c2321b8eaf3744729427a32c329cd345 +timeCreated: 1709051086 \ No newline at end of file diff --git a/Scripts/Avatar/AvatarMovementAnimations.cs b/Scripts/Avatar/AvatarMovementAnimations.cs new file mode 100644 index 0000000..e9129ec --- /dev/null +++ b/Scripts/Avatar/AvatarMovementAnimations.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace mtion.room.sdk +{ + [Serializable] + public struct AvatarMovementAnimations + { + [Header("Main movements")] + [SerializeField] private AnimationClip MoveForward; + [SerializeField] private AnimationClip MoveBackward; + [SerializeField] private AnimationClip MoveLeft; + [SerializeField] private AnimationClip MoveRight; + [Header("Optional movements")] + [SerializeField] private AnimationClip MoveForwardLeft; + [SerializeField] private AnimationClip MoveForwardRight; + [SerializeField] private AnimationClip MoveBackwardLeft; + [SerializeField] private AnimationClip MoveBackwardRight; + + public AnimationClip[] GetAnimationClips() + { + if (MoveForward == null || MoveBackward == null + || MoveLeft == null || MoveRight == null) + { + return null; + } + List animations = new List(8); + animations.Add(MoveForward); + animations.Add(MoveBackward); + animations.Add(MoveLeft); + animations.Add(MoveRight); + if (MoveForwardLeft && MoveForwardRight && MoveBackwardLeft && MoveBackwardRight) + { + animations.Add(MoveForwardLeft); + animations.Add(MoveForwardRight); + animations.Add(MoveBackwardLeft); + animations.Add(MoveBackwardRight); + } + + return animations.ToArray(); + } + } +} diff --git a/Scripts/Avatar/AvatarMovementAnimations.cs.meta b/Scripts/Avatar/AvatarMovementAnimations.cs.meta new file mode 100644 index 0000000..732303a --- /dev/null +++ b/Scripts/Avatar/AvatarMovementAnimations.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 788316b9b36f4174905845e150c7d809 +timeCreated: 1709051036 \ No newline at end of file diff --git a/Scripts/Avatar/AvatarMovementSettings.cs b/Scripts/Avatar/AvatarMovementSettings.cs new file mode 100644 index 0000000..76523de --- /dev/null +++ b/Scripts/Avatar/AvatarMovementSettings.cs @@ -0,0 +1,31 @@ +using System; +using mtion.room.sdk.action; +using UnityEngine; + +namespace mtion.room.sdk +{ + public sealed class AvatarMovementSettings : MTIONComponent + { + #region private attributes + + [SerializeField] + [Min(0)] + private float _walkingSpeed = 2f; + [SerializeField] + [Min(0)] + private float _runningSpeed = 4f; + [SerializeField] + [Min(0)] + private float _jumpHeight = 2f; + + #endregion + + #region public properties + + public float WalkingSpeed => _walkingSpeed; + public float RunningSpeed => _runningSpeed; + public float JumpHeight => _jumpHeight; + + #endregion + } +} diff --git a/Scripts/Avatar/AvatarMovementSettings.cs.meta b/Scripts/Avatar/AvatarMovementSettings.cs.meta new file mode 100644 index 0000000..132f978 --- /dev/null +++ b/Scripts/Avatar/AvatarMovementSettings.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: cd3ab5d1aa954d0c82ba919791aa5457 +timeCreated: 1709075811 \ No newline at end of file diff --git a/Scripts/MTIONSDKAvatar.cs b/Scripts/MTIONSDKAvatar.cs index 101f32a..92d5bc0 100644 --- a/Scripts/MTIONSDKAvatar.cs +++ b/Scripts/MTIONSDKAvatar.cs @@ -1,3 +1,4 @@ +using mtion.room.sdk.action; using System; using UnityEngine; @@ -12,6 +13,22 @@ public sealed class MTIONSDKAvatar : MTIONSDKDescriptorSceneBase private void Update() { + for (int i = 0; i < ObjectReference.transform.childCount; ++i) + { + Transform child = ObjectReference.transform.GetChild(i); + if (child != null && child.GetComponentInChildren() == null) + { + if (child.GetComponentInChildren() == null) + { + child.gameObject.AddComponent(); + } + + if (child.GetComponentInChildren() == null) + { + child.gameObject.AddComponent(); + } + } + } } #endif diff --git a/Scripts/NavMesh/MTIONNavMeshAgent.cs b/Scripts/NavMesh/MTIONNavMeshAgent.cs index 4ee3a12..189cf71 100644 --- a/Scripts/NavMesh/MTIONNavMeshAgent.cs +++ b/Scripts/NavMesh/MTIONNavMeshAgent.cs @@ -1,4 +1,5 @@ using mtion.room.sdk.action; +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -8,19 +9,15 @@ namespace mtion.room { [AddComponentMenu("mtion/Nav Mesh Agent")] [RequireComponent(typeof(NavMeshAgentLinkMover))] - [RequireComponent(typeof(NavMeshAgentAnimator))] [RequireComponent(typeof(NavMeshAgent))] + [RequireComponent(typeof(NavMeshAgentRandomMovement))] + [RequireComponent(typeof(NavMeshAgentTargetMovement))] + [RequireComponent(typeof(NavMeshAgentPositionMovement))] [DisallowMultipleComponent] public sealed class MTIONNavMeshAgent : MTIONComponent { - [Header("Movement")] - [SerializeField] private float _maxJumpDistance = 5f; - - [Header("Animations")] - [SerializeField] private AnimationClip _idleAnimation; - [SerializeField] private AnimationClip _jumpAnimation; - [SerializeField] private AnimationClip _walkAnimation; - + #region private attributes + [SerializeField, HideInInspector] private int _version; @@ -29,12 +26,30 @@ public sealed class MTIONNavMeshAgent : MTIONComponent private NavMeshAgentTargetMovement _targetMovement; private NavMeshAgentPositionMovement _positionMovement; private NavMeshAgentLinkMover _linkMover; - private NavMeshAgentAnimator _navMeshAnimator; - private NavMeshAgent _agent; - - private bool _walkAnimationOverride; + + #endregion + #region public properties + public int Version => _version; + public NavMeshAgent NavMeshAgent { get; private set; } + + public float MovingSpeed + { + get + { + return NavMeshAgent.speed; + } + set + { + NavMeshAgent.speed = value; + NavMeshAgent.acceleration = 2 * value; + } + } + + #endregion + + #region Unity Events private void Awake() { @@ -42,60 +57,41 @@ private void Awake() _targetMovement = GetComponent(); _positionMovement = GetComponent(); _linkMover = GetComponent(); - _navMeshAnimator = GetComponent(); - _agent = GetComponent(); + NavMeshAgent = GetComponent(); } - private void Start() + private void OnDisable() { - _activeMovement = _randomMovement; - - _navMeshAnimator.SetAnimationClips(_idleAnimation, _jumpAnimation, _walkAnimation); - - _linkMover.SetMaxJumpDistance(_maxJumpDistance); + NavMeshAgent.enabled = false; + } - _linkMover.OnLinkJumpBegin += () => - { - _navMeshAnimator.PlayJumpAnimation(true); - }; + private void OnEnable() + { + NavMeshAgent.enabled = true; + } - _linkMover.OnLinkJumpEnd += () => - { - _navMeshAnimator.PlayJumpAnimation(false); - }; + #endregion - _linkMover.OnLinkWalkBegin += () => - { - _navMeshAnimator.PlayWalkAnimation(true); - _walkAnimationOverride = true; - }; + #region Public Methods - _linkMover.OnLinkWalkEnd += () => - { - _navMeshAnimator.PlayWalkAnimation(false); - _walkAnimationOverride = false; - }; + public void StartMovement() + { + _activeMovement?.StartMovement(); } - private void Update() + public void StopMovement() { - if (_agent.velocity.magnitude > 0f) - { - _navMeshAnimator.PlayWalkAnimation(true); - } - else if (!_walkAnimationOverride) - { - _navMeshAnimator.PlayWalkAnimation(false); - } + _activeMovement?.StopMovement(); } - public void StartMovement() + public void PauseMovement() { + _activeMovement?.PauseMovement(); } - public void StopMovement() + public void ResumeMovement() { - _activeMovement?.StopMovement(); + _activeMovement?.ResumeMovement(); } public void SetRandomMovement() @@ -132,5 +128,22 @@ public void SetPositionMovement(Vector3 position) _activeMovement = _positionMovement; _positionMovement.SetPosition(position); } + + public void SetJumpHeight(float height) + { + _linkMover.SetMaxJumpDistance(height); + } + + public void SetHyperactivity(float hyperactivity) + { + _randomMovement.SetHyperactivity(hyperactivity); + } + + public void SetOnPointReachedAction(NavMeshAgentMovement.OnPointReachedDelegate action) + { + _randomMovement.OnPointReached = action; + } + + #endregion } } diff --git a/Scripts/NavMesh/NavMeshAgentLinkMover.cs b/Scripts/NavMesh/NavMeshAgentLinkMover.cs index 8f7604a..50c9ad8 100644 --- a/Scripts/NavMesh/NavMeshAgentLinkMover.cs +++ b/Scripts/NavMesh/NavMeshAgentLinkMover.cs @@ -1,6 +1,5 @@ using System; using System.Collections; -using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; @@ -16,11 +15,14 @@ public sealed class NavMeshAgentLinkMover : MonoBehaviour private NavMeshAgent _agent; private float _maxJumpDistance; - public event Action OnLinkJumpBegin; + public event Action OnLinkJumpBegin; public event Action OnLinkJumpEnd; public event Action OnLinkWalkBegin; public event Action OnLinkWalkEnd; + + public bool Running { get; private set; } + public Vector3 Velocity { get; private set; } private void Awake() { @@ -48,9 +50,9 @@ private IEnumerator CrossOffMeshLink() _agent.isOnOffMeshLink && _agent.currentOffMeshLinkData.valid) { - var validStart = NavMeshUtility.ConvertLinkPosToNavMeshPos(_agent.currentOffMeshLinkData.startPos, out var startPos); - var validEnd = NavMeshUtility.ConvertLinkPosToNavMeshPos(_agent.currentOffMeshLinkData.endPos, out var endPos); - var distance = Vector3.Distance(startPos, endPos); + NavMeshUtility.ConvertLinkPosToNavMeshPos(_agent.currentOffMeshLinkData.startPos, out Vector3 startPos); + NavMeshUtility.ConvertLinkPosToNavMeshPos(_agent.currentOffMeshLinkData.endPos, out Vector3 endPos); + float distance = Vector3.Distance(startPos, endPos); if (distance > _maxJumpDistance) { @@ -60,11 +62,12 @@ private IEnumerator CrossOffMeshLink() yield return StartCoroutine(Walk(_agent.transform.position, startPos)); var yDistance = Math.Abs(endPos.y - startPos.y); - if (yDistance > JUMP_Y_THRESHOLD || - distance > JUMP_DISTANCE_THRESHOLD) + if (yDistance > JUMP_Y_THRESHOLD || distance > JUMP_DISTANCE_THRESHOLD) { - OnLinkJumpBegin?.Invoke(); - yield return StartCoroutine(Jump(startPos, endPos)); + float jumpDistance = (endPos - startPos).magnitude; + float jumpDuration = jumpDistance/ (_agent.speed * 1.5f); + OnLinkJumpBegin?.Invoke(jumpDistance, jumpDuration); + yield return StartCoroutine(Jump(startPos, endPos, jumpDuration)); OnLinkJumpEnd?.Invoke(); } else @@ -80,40 +83,52 @@ private IEnumerator CrossOffMeshLink() private IEnumerator Walk(Vector3 startPos, Vector3 endPos) { - var distance = Vector3.Distance(startPos, endPos); + Vector3 direction = endPos - startPos; + Running = true; + Velocity = direction.normalized * _agent.speed; + var distance = direction.magnitude; var duration = distance / _agent.speed; var normalizedTime = 0f; while (normalizedTime < 1f) { _agent.transform.position = Vector3.Lerp(startPos, endPos, normalizedTime); normalizedTime += Time.deltaTime / duration; + RotateTowards(direction); yield return null; } + Running = false; } - private IEnumerator Jump(Vector3 startPos, Vector3 endPos) + private IEnumerator Jump(Vector3 startPos, Vector3 endPos, float duration) { - var duration = 1f; - yield return new WaitForSeconds(0.25f); - - var lowerPoint = endPos.y < startPos.y - ? endPos - : startPos; ; - var higherPoint = endPos.y > startPos.y - ? endPos - : startPos; - - var midPos = new Vector3(lowerPoint.x, higherPoint.y + _agent.height * 2f, lowerPoint.z); - - var normalizedTime = 0f; + Vector3 direction = endPos - startPos; + Running = true; + Velocity = direction / duration; + + float normalizedTime = 0f; while (normalizedTime < 1f) { - Vector3 m1 = Vector3.Lerp(startPos, midPos, normalizedTime); - Vector3 m2 = Vector3.Lerp(midPos, endPos, normalizedTime); - _agent.transform.position = Vector3.Lerp(m1, m2, normalizedTime); + Vector3 position = Vector3.Lerp(startPos, endPos, normalizedTime); + position.y += Mathf.Sin(Mathf.PI * normalizedTime) * _agent.height * .25f; + _agent.transform.position = position; normalizedTime += Time.deltaTime / duration; + RotateTowards(direction); yield return null; } + + _agent.transform.position = endPos; + Running = false; + } + + private void RotateTowards(Vector3 direction) + { + direction.y = 0; + float desiredAngle = Vector3.SignedAngle(transform.forward, direction, Vector3.up); + float sign = Mathf.Sign(desiredAngle); + + float angle = sign * Mathf.Min(MathF.Abs(desiredAngle), _agent.angularSpeed) * Time.deltaTime; + + transform.Rotate(Vector3.up, angle); } } } diff --git a/Scripts/NavMesh/NavMeshAgentMovement.cs b/Scripts/NavMesh/NavMeshAgentMovement.cs index 4ff4822..2a9d937 100644 --- a/Scripts/NavMesh/NavMeshAgentMovement.cs +++ b/Scripts/NavMesh/NavMeshAgentMovement.cs @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -9,9 +10,16 @@ namespace mtion.room public abstract class NavMeshAgentMovement : MonoBehaviour { private Coroutine _moveCoroutine; + private Vector3 _destinationOnPause; protected NavMeshAgent _agent; + protected float _hyperactivity; + public delegate IEnumerator OnPointReachedDelegate(); + public OnPointReachedDelegate OnPointReached; + + public bool Paused { get; private set; } + private void Awake() { _agent = GetComponent(); @@ -29,6 +37,11 @@ public void StartMovement() public void StopMovement() { + if (_agent.isOnNavMesh) + { + _agent.ResetPath(); + } + if (_moveCoroutine == null) { return; @@ -38,6 +51,33 @@ public void StopMovement() _moveCoroutine = null; } + public virtual void PauseMovement() + { + if (_agent.isOnOffMeshLink) + { + NavMeshUtility.ConvertLinkPosToNavMeshPos(_agent.currentOffMeshLinkData.endPos, out Vector3 endPos); + _destinationOnPause = endPos; + } + else + { + _destinationOnPause = _agent.destination; + } + + _agent.SetDestination(_agent.transform.position); + Paused = true; + } + + public virtual void ResumeMovement() + { + _agent.SetDestination(_destinationOnPause); + Paused = false; + } + + public void SetHyperactivity(float hyperactivity) + { + _hyperactivity = hyperactivity; + } + protected abstract IEnumerator MoveCoroutine(); } } diff --git a/Scripts/NavMesh/NavMeshAgentPositionMovement.cs b/Scripts/NavMesh/NavMeshAgentPositionMovement.cs index 1f03885..71b575f 100644 --- a/Scripts/NavMesh/NavMeshAgentPositionMovement.cs +++ b/Scripts/NavMesh/NavMeshAgentPositionMovement.cs @@ -19,6 +19,12 @@ protected override IEnumerator MoveCoroutine() { while (true) { + if (Paused) + { + yield return null; + continue; + } + if (!_agent.isOnNavMesh) { yield return null; diff --git a/Scripts/NavMesh/NavMeshAgentRandomMovement.cs b/Scripts/NavMesh/NavMeshAgentRandomMovement.cs index 1b96c6d..cc7c931 100644 --- a/Scripts/NavMesh/NavMeshAgentRandomMovement.cs +++ b/Scripts/NavMesh/NavMeshAgentRandomMovement.cs @@ -9,14 +9,20 @@ namespace mtion.room public sealed class NavMeshAgentRandomMovement : NavMeshAgentMovement { private const float MinWaitTime = 0f; - private const float MaxWaitTime = 5f; - private const float TargetPointMaxDistance = 25f; + private const float MaxWaitTime = 2f; + private const float HyperactivityScale = 20f; + private const float TargetPointMaxDistance = 10f; private const float MinTimeSearch = 3f; protected override IEnumerator MoveCoroutine() { while (true) { + while (Paused) + { + yield return null; + } + if (!_agent.isOnNavMesh) { SnapToNavMesh(); @@ -26,10 +32,12 @@ protected override IEnumerator MoveCoroutine() NavMeshHit targetHit; while (!NavMesh.SamplePosition( - transform.position + Random.insideUnitSphere * TargetPointMaxDistance, out targetHit, 10f, ~0)) + transform.position + Random.onUnitSphere * TargetPointMaxDistance * _agent.gameObject.transform.lossyScale.x, out targetHit, 10f, ~0)) { yield return null; } + + yield return new WaitUntil(() => { return !Paused; }); _agent.SetDestination(targetHit.position); var curDistance = 0f; @@ -37,13 +45,55 @@ protected override IEnumerator MoveCoroutine() var curTime = 0f; do { + while (Paused) + { + yield return null; + } + prevDistance = curDistance; curDistance = Vector3.Distance(_agent.transform.position, targetHit.position); curTime += Time.deltaTime; yield return null; } while (curTime < MinTimeSearch || Mathf.Abs(curDistance - prevDistance) > 0.1f); - yield return new WaitForSeconds(Random.Range(MinWaitTime, MaxWaitTime)); + if (_agent.isOnOffMeshLink) + { + _agent.Warp(_agent.transform.position); + _agent.ResetPath(); + } + + float minWait = (MinWaitTime + (1f - _hyperactivity) * HyperactivityScale) / 2f; + float maxWait = (MaxWaitTime + (1f - _hyperactivity) * HyperactivityScale) / 2f; + + + { + float waitTime = Time.time + Random.Range(minWait, maxWait); + while (Time.time < waitTime) + { + yield return null; + } + } + + while (Paused) + { + yield return null; + } + + yield return StartCoroutine(OnPointReached()); + + while (Paused) + { + yield return null; + } + + { + float waitTime = Time.time + Random.Range(minWait, maxWait); + while (Time.time < waitTime) + { + yield return null; + } + + } } } diff --git a/Scripts/NavMesh/NavMeshAgentTargetMovement.cs b/Scripts/NavMesh/NavMeshAgentTargetMovement.cs index 942c0d6..bbe3281 100644 --- a/Scripts/NavMesh/NavMeshAgentTargetMovement.cs +++ b/Scripts/NavMesh/NavMeshAgentTargetMovement.cs @@ -2,7 +2,6 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -using UnityEngine.AI; namespace mtion.room { @@ -20,6 +19,12 @@ protected override IEnumerator MoveCoroutine() { while (true) { + if (Paused) + { + yield return null; + continue; + } + if (!_agent.isOnNavMesh) { yield return null; diff --git a/ThirdParty/VRMShaders/GLTF.meta b/ThirdParty/VRMShaders/GLTF.meta index 077d0a2..148b4e2 100644 --- a/ThirdParty/VRMShaders/GLTF.meta +++ b/ThirdParty/VRMShaders/GLTF.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d1f2223802d142d4a8a06c15936915fc +guid: 55feb4f87f85ccf43a29f6c2cec7bf62 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/GLTF/IO.meta b/ThirdParty/VRMShaders/GLTF/IO.meta index 4ab9706..cff4347 100644 --- a/ThirdParty/VRMShaders/GLTF/IO.meta +++ b/ThirdParty/VRMShaders/GLTF/IO.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4b889998e5dbf2541979af55bfdd17fa +guid: 84882f8b20204c04eb85824af9e98144 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/GLTF/IO/Resources.meta b/ThirdParty/VRMShaders/GLTF/IO/Resources.meta index a6b41b8..b61dfb2 100644 --- a/ThirdParty/VRMShaders/GLTF/IO/Resources.meta +++ b/ThirdParty/VRMShaders/GLTF/IO/Resources.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e3e315bf9f136d54d9afc347fa2a6931 +guid: 36444f2312d78e34d9bfa04f936617a3 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/GLTF/IO/Resources/UniGLTF.meta b/ThirdParty/VRMShaders/GLTF/IO/Resources/UniGLTF.meta index 9051325..7299146 100644 --- a/ThirdParty/VRMShaders/GLTF/IO/Resources/UniGLTF.meta +++ b/ThirdParty/VRMShaders/GLTF/IO/Resources/UniGLTF.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f4dbb178cadcec440a228750d8598874 +guid: a892004b338c1794d918bee3aba44e16 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/GLTF/UniUnlit.meta b/ThirdParty/VRMShaders/GLTF/UniUnlit.meta index bc0e0b2..aa512f6 100644 --- a/ThirdParty/VRMShaders/GLTF/UniUnlit.meta +++ b/ThirdParty/VRMShaders/GLTF/UniUnlit.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 05a356720a9673647b69b1d635779a78 +guid: 68bde09d43c51804392f7d36ee9ff342 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/GLTF/UniUnlit/Resources.meta b/ThirdParty/VRMShaders/GLTF/UniUnlit/Resources.meta index 9df1310..889726a 100644 --- a/ThirdParty/VRMShaders/GLTF/UniUnlit/Resources.meta +++ b/ThirdParty/VRMShaders/GLTF/UniUnlit/Resources.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 232a557bf82198649a3ca63a0dda2946 +guid: 28bea957a12726d43b29c99936b44967 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/GLTF/UniUnlit/Resources/UniGLTF.meta b/ThirdParty/VRMShaders/GLTF/UniUnlit/Resources/UniGLTF.meta index 824c91b..4309dc4 100644 --- a/ThirdParty/VRMShaders/GLTF/UniUnlit/Resources/UniGLTF.meta +++ b/ThirdParty/VRMShaders/GLTF/UniUnlit/Resources/UniGLTF.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0d74e0c1870b57b42ace8b7fdd5f514d +guid: 29a2220c0ae9e0548b30d57f3570212c folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/VRM.meta b/ThirdParty/VRMShaders/VRM.meta index 51091e5..4524fc1 100644 --- a/ThirdParty/VRMShaders/VRM.meta +++ b/ThirdParty/VRMShaders/VRM.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 396a85746d84c8a478407af0bbf0b084 +guid: 114da2b8938d86340939cabb5ae1a71b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/VRM/MToon.meta b/ThirdParty/VRMShaders/VRM/MToon.meta index eaa634c..b0aeea6 100644 --- a/ThirdParty/VRMShaders/VRM/MToon.meta +++ b/ThirdParty/VRMShaders/VRM/MToon.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 38262db589e2e474189675108180be8f +guid: e39a87d0027413a4b9588334e56281d4 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/VRM/MToon/Mtoon.meta b/ThirdParty/VRMShaders/VRM/MToon/Mtoon.meta index c06022b..b7898cb 100644 --- a/ThirdParty/VRMShaders/VRM/MToon/Mtoon.meta +++ b/ThirdParty/VRMShaders/VRM/MToon/Mtoon.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 408c5c61ab830fd4ba26823151b32678 +guid: b2dc1a08b57208146b6fd3f4cf31e52a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/VRM/MToon/Mtoon/Resources.meta b/ThirdParty/VRMShaders/VRM/MToon/Mtoon/Resources.meta index f4dc97f..5b786ee 100644 --- a/ThirdParty/VRMShaders/VRM/MToon/Mtoon/Resources.meta +++ b/ThirdParty/VRMShaders/VRM/MToon/Mtoon/Resources.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 64df3dd8fd835ca459bc839e142b56f6 +guid: bc2a8b52d38958147a080f84a8c63206 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/VRM/MToon/Mtoon/Resources/Shaders.meta b/ThirdParty/VRMShaders/VRM/MToon/Mtoon/Resources/Shaders.meta index c96efe8..0f23763 100644 --- a/ThirdParty/VRMShaders/VRM/MToon/Mtoon/Resources/Shaders.meta +++ b/ThirdParty/VRMShaders/VRM/MToon/Mtoon/Resources/Shaders.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e836c5adbc86a0147bc5416bfc605f7f +guid: c6012e7d3266a914a8113bed0f4b5d80 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/VRM/VRMShaders.shadervariants.meta b/ThirdParty/VRMShaders/VRM/VRMShaders.shadervariants.meta index f2d20c1..cd48173 100644 --- a/ThirdParty/VRMShaders/VRM/VRMShaders.shadervariants.meta +++ b/ThirdParty/VRMShaders/VRM/VRMShaders.shadervariants.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 775d7acd72cac484b811d6607c11e814 +guid: 9f2b093a16f542246a428cd3e42282a6 NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 diff --git a/ThirdParty/VRMShaders/VRM10.meta b/ThirdParty/VRMShaders/VRM10.meta index 385a357..fc6d624 100644 --- a/ThirdParty/VRMShaders/VRM10.meta +++ b/ThirdParty/VRMShaders/VRM10.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 80ead69071db75c4185cbe0400134224 +guid: 74189921b0edf9242ab9d0476ae6945d folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/VRM10/MToon10.meta b/ThirdParty/VRMShaders/VRM10/MToon10.meta index 4284cd1..5b26aba 100644 --- a/ThirdParty/VRMShaders/VRM10/MToon10.meta +++ b/ThirdParty/VRMShaders/VRM10/MToon10.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: cb402068f0e625246bfbab45eae6e29d +guid: a9fef426db35c984ab57c4b309f8af00 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/VRM10/MToon10/Resources.meta b/ThirdParty/VRMShaders/VRM10/MToon10/Resources.meta index 767d4ca..e27868b 100644 --- a/ThirdParty/VRMShaders/VRM10/MToon10/Resources.meta +++ b/ThirdParty/VRMShaders/VRM10/MToon10/Resources.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ac00437fecd91c848949fedb66295d0c +guid: a91ac3e1b0cfa2c4497f780a43af673c folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/VRM10/MToon10/Resources/VRM10.meta b/ThirdParty/VRMShaders/VRM10/MToon10/Resources/VRM10.meta index 16687d9..f3fbbca 100644 --- a/ThirdParty/VRMShaders/VRM10/MToon10/Resources/VRM10.meta +++ b/ThirdParty/VRMShaders/VRM10/MToon10/Resources/VRM10.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4bd78765e8c3fcb41930c11c0918105f +guid: 4dc4df17c477ef244bd42c99f8b15e11 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/ThirdParty/VRMShaders/VRM10/VRM10Shaders.shadervariants.meta b/ThirdParty/VRMShaders/VRM10/VRM10Shaders.shadervariants.meta index a99cbaf..99a3ab4 100644 --- a/ThirdParty/VRMShaders/VRM10/VRM10Shaders.shadervariants.meta +++ b/ThirdParty/VRMShaders/VRM10/VRM10Shaders.shadervariants.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e8bd97c794520db42bae0a708bc146ab +guid: 27119b5942f66254aa6f23292857ed40 NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 diff --git a/package.json b/package.json index 51f5f65..5bc3226 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.mtion.sdk", "description": "Tools to create assets and clubhouses for mtion studio.", - "version": "0.12.1", + "version": "0.13.1", "supportedVersion": "2021.3.25f1", "unity": "2021.3", "displayName": "Mtion SDK",