39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
// ColliderMoveEditorWindow.cs
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace Efitor
|
|
{
|
|
public class ColliderMoveEditorWindow : EditorWindow
|
|
{
|
|
private GameObject originalPrefab;
|
|
private GameObject copyPrefab;
|
|
|
|
//[MenuItem("Tools/Collider Move Tool")]
|
|
public static void ShowWindow()
|
|
{
|
|
GetWindow(typeof(ColliderMoveEditorWindow), false, "Collider Move Tool");
|
|
}
|
|
|
|
private void OnGUI()
|
|
{
|
|
GUILayout.Label("Collider Move Tool", EditorStyles.boldLabel);
|
|
|
|
originalPrefab = (GameObject)EditorGUILayout.ObjectField("Original Prefab", originalPrefab, typeof(GameObject), true);
|
|
copyPrefab = (GameObject)EditorGUILayout.ObjectField("Copy Prefab", copyPrefab, typeof(GameObject), true);
|
|
|
|
if (GUILayout.Button("Move Colliders"))
|
|
{
|
|
if (originalPrefab != null && copyPrefab != null)
|
|
{
|
|
Efitor.ColliderMoveTool.MoveColliders(originalPrefab, copyPrefab);
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("Original Prefab and Copy Prefab must be assigned!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|