diff --git a/Editor/BuildScripts/ThumbnailGenerator.cs b/Editor/BuildScripts/ThumbnailGenerator.cs index 013dd91..5bc0ac2 100644 --- a/Editor/BuildScripts/ThumbnailGenerator.cs +++ b/Editor/BuildScripts/ThumbnailGenerator.cs @@ -57,14 +57,15 @@ private static void TakeSnapshot(Camera camera, string directory, string filenam { return; } - + RenderTexture rt = new RenderTexture(ThumbnailResWidth, ThumbnailResHeight, 24); + rt.name = "ThumbnailGenerator.TakeSnapshot.rt"; camera.targetTexture = rt; camera.Render(); RenderTexture.active = rt; Texture2D snapshot = new Texture2D(ThumbnailResWidth, ThumbnailResHeight, TextureFormat.RGB24, false); - snapshot.name = $"Snapshot-{filename}"; + snapshot.name = $"ThumbnailGenerator.TakeSnapshot.Snapshot-{filename}"; snapshot.ReadPixels(new Rect(0, 0, ThumbnailResWidth, ThumbnailResHeight), 0, 0); camera.targetTexture = null; diff --git a/Editor/Components/MVirtualCameraEventTrackerEditor.cs b/Editor/Components/MVirtualCameraEventTrackerEditor.cs index 99e5fac..8d19610 100644 --- a/Editor/Components/MVirtualCameraEventTrackerEditor.cs +++ b/Editor/Components/MVirtualCameraEventTrackerEditor.cs @@ -53,6 +53,7 @@ void OnEnable() TrackerEditorCamera.VizCamera = TrackerEditorCamera.cameraObject.AddComponent(); TrackerEditorCamera.VizTexture = new RenderTexture((int)(TrackerEditorCamera.defaultTextureHeight * instance_.CameraParams.AspectRatio), (int)TrackerEditorCamera.defaultTextureHeight, 0); + TrackerEditorCamera.VizTexture.name = "mtion.room.sdk.MVirtualCameraEventTrackerEditor.VizTexture"; TrackerEditorCamera.VizCamera.targetTexture = TrackerEditorCamera.VizTexture; } @@ -101,6 +102,7 @@ private static void DoOverlayUI(UnityEngine.Object target, SceneView sceneView) TrackerEditorCamera.VizTexture = new RenderTexture( (int)(TrackerEditorCamera.defaultTextureHeight * tracker.CameraParams.AspectRatio), (int)TrackerEditorCamera.defaultTextureHeight, 0); + TrackerEditorCamera.VizTexture.name = "mtion.room.sdk.MVirtualCameraEventTrackerEditor.VizTexture"; TrackerEditorCamera.VizCamera.targetTexture = TrackerEditorCamera.VizTexture; TrackerEditorCamera.VizCamera.Render(); } diff --git a/Editor/ControlPanels/MTIONSDKToolsBuildTab.cs b/Editor/ControlPanels/MTIONSDKToolsBuildTab.cs index fce1235..b2b4f65 100644 --- a/Editor/ControlPanels/MTIONSDKToolsBuildTab.cs +++ b/Editor/ControlPanels/MTIONSDKToolsBuildTab.cs @@ -175,6 +175,44 @@ private static void DrawBuildOptions() } MTIONSDKToolsWindow.EndBox(); + + MTIONSDKToolsWindow.StartBox(); + { + var blueprintSDKObject = GameObject.FindObjectOfType(); + if (blueprintSDKObject != null) + { + bool sceneExists = false; + string[] guids = AssetDatabase.FindAssets("t:SceneAsset"); + foreach (string guid in guids) + { + string path = AssetDatabase.GUIDToAssetPath(guid); + string sceneName = System.IO.Path.GetFileNameWithoutExtension(path); + if (sceneName == blueprintSDKObject.RoomSceneName) + { + sceneExists = true; + break; + } + } + + if (!sceneExists) + { + EditorGUILayout.HelpBox("Room scene not found. Please drag and drop the scene file.", MessageType.Warning); + SceneAsset newSceneAsset = EditorGUILayout.ObjectField("Room Scene", null, typeof(SceneAsset), false) as SceneAsset; + if (newSceneAsset != null) + { + string sceneName = newSceneAsset.name; + blueprintSDKObject.RoomSceneName = sceneName; + + EditorUtility.SetDirty(blueprintSDKObject); + } + + return; + } + } + } + MTIONSDKToolsWindow.EndBox(); + + MTIONSDKToolsWindow.StartBox(); { GUILayout.Label("Options", headerLabelStyle); @@ -276,11 +314,39 @@ private static void DrawBuildOptions() var blueprintSDKObject = GameObject.FindObjectOfType(); if (blueprintSDKObject != null) { - bool SwitchScene = GUILayout.Button(new GUIContent("Switch to Environment Scene"), MTIONSDKToolsWindow.MediumButtonStyle); - if (SwitchScene) + bool sceneExists = false; + string[] guids = AssetDatabase.FindAssets("t:SceneAsset"); + foreach (string guid in guids) + { + string path = AssetDatabase.GUIDToAssetPath(guid); + string sceneName = System.IO.Path.GetFileNameWithoutExtension(path); + if (sceneName == blueprintSDKObject.EnvironmentSceneName) + { + sceneExists = true; + break; + } + } + + if (!sceneExists) + { + EditorGUILayout.HelpBox("Environment scene not found. Please drag and drop the scene file.", MessageType.Warning); + SceneAsset newSceneAsset = EditorGUILayout.ObjectField("Environment Scene", null, typeof(SceneAsset), false) as SceneAsset; + if (newSceneAsset != null) + { + string sceneName = newSceneAsset.name; + blueprintSDKObject.EnvironmentSceneName = sceneName; + + EditorUtility.SetDirty(blueprintSDKObject); + } + } + else { - var scene = EditorSceneManager.GetSceneByName(blueprintSDKObject.EnvironmentSceneName); - EditorSceneManager.SetActiveScene(scene); + bool SwitchScene = GUILayout.Button(new GUIContent("Switch to Environment Scene"), MTIONSDKToolsWindow.MediumButtonStyle); + if (SwitchScene) + { + var scene = EditorSceneManager.GetSceneByName(blueprintSDKObject.EnvironmentSceneName); + EditorSceneManager.SetActiveScene(scene); + } } } diff --git a/Editor/ControlPanels/MTIONSDKToolsWindow.cs b/Editor/ControlPanels/MTIONSDKToolsWindow.cs index 1df5ad0..75b2de6 100644 --- a/Editor/ControlPanels/MTIONSDKToolsWindow.cs +++ b/Editor/ControlPanels/MTIONSDKToolsWindow.cs @@ -547,6 +547,7 @@ public static Texture2D CreateTextureForColor(int width, int height, Color col) pix[i] = col; } Texture2D result = new Texture2D(width, height); + result.name = "MTIONSDKToolsWindow.CreateTextureForColor"; result.SetPixels(pix); result.Apply(); return result; diff --git a/Plugins/ThirdParty/MTIONStudioSDK_Public_Compiled_Editor.dll b/Plugins/ThirdParty/MTIONStudioSDK_Public_Compiled_Editor.dll index 9c63fae..8b2db3e 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:23cffc8e87a0ca0ebc09edb39aa65caaee5a80f04c0674ce10d9d86fa764b35b -size 23040 +oid sha256:999bd95dc70808d5434da8bfb3608b77f87eb20db44166b3709a730ccfb262b4 +size 23552 diff --git a/Plugins/ThirdParty/MTIONUtilityClasses.dll b/Plugins/ThirdParty/MTIONUtilityClasses.dll index 020cf7e..516bc3b 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:e596c17cc92eeefc1f58f3ad17550dbde2f3537d9867fd2e2fd24daa85f313b4 +oid sha256:da2f710bd3fc9c80122b2c22a655a76313cc26bee0566f265d1455ed849f7b7a size 40448 diff --git a/Plugins/ThirdParty/UniVRM.Editor.dll b/Plugins/ThirdParty/UniVRM.Editor.dll index 0e47fcb..7015bf8 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:e091b448d3dee4162554b2ca35c15f192d41635e51a26bf38e6491124a23ad32 -size 124928 +oid sha256:dc4cd932508f9b2d7b00af9783480d01ac3e2759da160e0a18dba4660a3c3659 +size 125440 diff --git a/Plugins/ThirdParty/VRM.dll b/Plugins/ThirdParty/VRM.dll index d25dd72..c55f88c 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:cdefba48aefc3525cf3b37292ad7105401b9a8abd019ff7612063d5f30dba253 -size 179200 +oid sha256:a73e5650348537feff8c6c89959e2ae0e77a1bac3e905aeec00ba7142e3cbd30 +size 179712 diff --git a/Plugins/ThirdParty/VRMShaders.GLTF.IO.Runtime.dll b/Plugins/ThirdParty/VRMShaders.GLTF.IO.Runtime.dll index 4005fe6..f452161 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:0e24e1dbca240837db25fa5c637a90d3d2f847058a4ecb9bfc4c52d91f2481a9 +oid sha256:23159abf1f9194cd0688cb9d2bcfaba593cb7e0145f511d88f5070e0833c28a6 size 42496 diff --git a/Scripts/ActionSystem/IMActionInterfaceImpl.cs b/Scripts/ActionSystem/IMActionInterfaceImpl.cs index e79e48d..e261d9d 100644 --- a/Scripts/ActionSystem/IMActionInterfaceImpl.cs +++ b/Scripts/ActionSystem/IMActionInterfaceImpl.cs @@ -87,8 +87,7 @@ public interface IMMultiActionExitEvents : IAction void UnbindToActionComplete(Action onActionComplete); void SimulateActionComplete(); } - - + public interface IMActionExitParameterProvider : IAction { int Count { get; } @@ -104,8 +103,7 @@ public interface IMActionForceInternalUpdate { void ForceInternalUpdate(); } - - + public interface IMActionEntryEvent : IAction { diff --git a/Scripts/ActionSystem/Internal/ActionTypeConverter.cs b/Scripts/ActionSystem/Internal/ActionTypeConverter.cs index 9cd398c..77db954 100644 --- a/Scripts/ActionSystem/Internal/ActionTypeConverter.cs +++ b/Scripts/ActionSystem/Internal/ActionTypeConverter.cs @@ -10,12 +10,8 @@ namespace mtion.room.sdk.action { - - - public static class TypeConversion { - public static class NumericConverter { public static bool IsNumericType(Type type) @@ -90,7 +86,6 @@ public static object ConvertToNumericValue(object input, Type expectedType) } } - public static class ContainerConverter { public static T DeserializeContainer(string jsonString) @@ -129,17 +124,16 @@ public static bool CanDeserialize(string jsonString, Type targetType) return false; } } - - + public static bool IsContainer(Type type) { Type[] containerTypes = { - typeof(List<>), - typeof(Dictionary<,>), - typeof(HashSet<>), - typeof(Array), - }; + typeof(List<>), + typeof(Dictionary<,>), + typeof(HashSet<>), + typeof(Array), + }; foreach (Type containerType in containerTypes) { @@ -178,8 +172,7 @@ private static bool IsAssignableToGenericType(Type givenType, Type genericType) return IsAssignableToGenericType(baseType, genericType); } } - - + public static List GenerateParameters(List inputParameters, List parameterDefinitions) { List output = new List(); @@ -210,6 +203,13 @@ public static List GenerateParameters(List inputParameters, List param = NumericConverter.ConvertToNumericValue(param, expectedType); } else if (expectedType == typeof(string)) + { + param = param.ToString(); + } + } + else if (inputType == typeof(bool)) + { + if (expectedType == typeof(string)) { param = Convert.ChangeType(param, expectedType); } @@ -275,16 +275,10 @@ public static List GenerateParameters(List inputParameters, List { } - output.Add(param); } return output; } - - - - - } } diff --git a/Scripts/Utility/IResetStateListener.cs b/Scripts/Utility/IResetStateListener.cs index 9307e3d..81c6f4b 100644 --- a/Scripts/Utility/IResetStateListener.cs +++ b/Scripts/Utility/IResetStateListener.cs @@ -6,9 +6,6 @@ namespace mtion.room.sdk { public interface IResetStateListener { - public string ClubhouseGuid { get; set; } - public string ElementGuid { get; set; } - public void ResetState(); } } diff --git a/package.json b/package.json index 90d00b4..6d964eb 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.15.9", + "version": "0.15.10", "supportedVersion": "2021.3.25f1", "unity": "2021.3", "displayName": "Mtion SDK",