From 1329be9662f218dc3054c1a1c18250a7a0b9c3c9 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 6 Mar 2024 17:42:36 +0900 Subject: [PATCH] impl onAddCallback, onRemoveCallback --- .../Editor/MeshUtility/MeshIntegrationTab.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Assets/UniGLTF/Editor/MeshUtility/MeshIntegrationTab.cs b/Assets/UniGLTF/Editor/MeshUtility/MeshIntegrationTab.cs index 85ceb93a9..125e572b5 100644 --- a/Assets/UniGLTF/Editor/MeshUtility/MeshIntegrationTab.cs +++ b/Assets/UniGLTF/Editor/MeshUtility/MeshIntegrationTab.cs @@ -73,12 +73,14 @@ namespace UniGLTF.MeshUtility var r = _renderers[index]; EditorGUI.ObjectField(rect, r, typeof(Renderer), true); }; - - // +ボタンが押された時のコールバック - _rendererList.onAddCallback = list => Debug.Log("+ clicked."); - - // -ボタンが押された時のコールバック - _rendererList.onRemoveCallback = list => Debug.Log("- clicked : " + list.index + "."); + _rendererList.onAddCallback = (list) => + { + _renderers.Add(new Renderer()); + }; + _rendererList.onRemoveCallback = list => + { + _renderers.RemoveAt(list.index); + }; } public void UpdateMeshIntegrationList(GameObject root)