From 05f41f2aac35dee74a9ff28e52350ed7b6e033ae Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 11 May 2022 16:10:20 +0900 Subject: [PATCH] fix var name --- .../Editor/MeshUtility/TabMeshIntegrator.cs | 19 +++++++++---------- .../Editor/MeshUtility/TabMeshSeparator.cs | 13 ++++++------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Assets/UniGLTF/Editor/MeshUtility/TabMeshIntegrator.cs b/Assets/UniGLTF/Editor/MeshUtility/TabMeshIntegrator.cs index 839d425a8..5f2ee0343 100644 --- a/Assets/UniGLTF/Editor/MeshUtility/TabMeshIntegrator.cs +++ b/Assets/UniGLTF/Editor/MeshUtility/TabMeshIntegrator.cs @@ -6,7 +6,7 @@ namespace UniGLTF.MeshUtility { public static class TabMeshIntegrator { - public static bool OnGUI(GameObject _exportTarget) + public static bool OnGUI(GameObject root) { var _isInvokeSuccess = false; GUILayout.BeginVertical(); @@ -15,7 +15,7 @@ namespace UniGLTF.MeshUtility GUILayout.FlexibleSpace(); if (GUILayout.Button("Process", GUILayout.MinWidth(100))) { - _isInvokeSuccess = TabMeshIntegrator.Execute(_exportTarget); + _isInvokeSuccess = TabMeshIntegrator.Execute(root); } GUILayout.EndHorizontal(); } @@ -24,9 +24,9 @@ namespace UniGLTF.MeshUtility } static string VRM_META = "VRMMeta"; - static bool HasVrm(GameObject go) + static bool HasVrm(GameObject root) { - var allComponents = go.GetComponents(typeof(Component)); + var allComponents = root.GetComponents(typeof(Component)); foreach (var component in allComponents) { if (component == null) continue; @@ -39,28 +39,27 @@ namespace UniGLTF.MeshUtility return false; } - static bool Execute(GameObject _exportTarget) + static bool Execute(GameObject root) { - if (_exportTarget == null) + if (root == null) { EditorUtility.DisplayDialog("Failed", MeshProcessingMessages.NO_GAMEOBJECT_SELECTED.Msg(), "ok"); return false; } - var go = _exportTarget; - if (HasVrm(go)) + if (HasVrm(root)) { EditorUtility.DisplayDialog("Failed", MeshProcessingMessages.VRM_DETECTED.Msg(), "ok"); return false; } - if (go.GetComponentsInChildren().Length == 0 && go.GetComponentsInChildren().Length == 0) + if (root.GetComponentsInChildren().Length == 0 && root.GetComponentsInChildren().Length == 0) { EditorUtility.DisplayDialog("Failed", MeshProcessingMessages.NO_MESH.Msg(), "ok"); return false; } - MeshUtility.MeshIntegrator(go); + MeshUtility.MeshIntegrator(root); return true; } } diff --git a/Assets/UniGLTF/Editor/MeshUtility/TabMeshSeparator.cs b/Assets/UniGLTF/Editor/MeshUtility/TabMeshSeparator.cs index bef557520..51017dfcd 100644 --- a/Assets/UniGLTF/Editor/MeshUtility/TabMeshSeparator.cs +++ b/Assets/UniGLTF/Editor/MeshUtility/TabMeshSeparator.cs @@ -9,7 +9,7 @@ namespace UniGLTF.MeshUtility /// public static class TabMeshSeparator { - public static bool OnGUI(GameObject _exportTarget) + public static bool OnGUI(GameObject root) { var _isInvokeSuccess = false; GUILayout.BeginVertical(); @@ -18,7 +18,7 @@ namespace UniGLTF.MeshUtility GUILayout.FlexibleSpace(); if (GUILayout.Button("Process", GUILayout.MinWidth(100))) { - _isInvokeSuccess = TabMeshSeparator.Execute(_exportTarget); + _isInvokeSuccess = TabMeshSeparator.Execute(root); } GUILayout.EndHorizontal(); } @@ -26,23 +26,22 @@ namespace UniGLTF.MeshUtility return _isInvokeSuccess; } - static bool Execute(GameObject _exportTarget) + static bool Execute(GameObject root) { - if (_exportTarget == null) + if (root == null) { EditorUtility.DisplayDialog("Failed", MeshProcessingMessages.NO_GAMEOBJECT_SELECTED.Msg(), "ok"); return false; } - var go = _exportTarget; - if (go.GetComponentsInChildren().Length == 0) + if (root.GetComponentsInChildren().Length == 0) { EditorUtility.DisplayDialog("Failed", MeshProcessingMessages.NO_SKINNED_MESH.Msg(), "ok"); return false; } // copy - var outputObject = GameObject.Instantiate(go); + var outputObject = GameObject.Instantiate(root); outputObject.name = outputObject.name + "_mesh_separation"; // 改変と asset の作成