장애물 및 장애물 생성기
Kaykit Forest Nature 추가
This commit is contained in:
44
Assets/Scripts/Editor/ObstacleSpawnerEditor.cs
Normal file
44
Assets/Scripts/Editor/ObstacleSpawnerEditor.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Northbound
|
||||
{
|
||||
[CustomEditor(typeof(ObstacleSpawner))]
|
||||
public class ObstacleSpawnerEditor : UnityEditor.Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
DrawDefaultInspector();
|
||||
|
||||
ObstacleSpawner spawner = (ObstacleSpawner)target;
|
||||
|
||||
EditorGUILayout.Space(10);
|
||||
EditorGUILayout.LabelField("에디터 도구", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
if (GUILayout.Button("장애물 생성", GUILayout.Height(30)))
|
||||
{
|
||||
spawner.SpawnObstacles();
|
||||
EditorUtility.SetDirty(spawner);
|
||||
}
|
||||
|
||||
if (GUILayout.Button("장애물 제거", GUILayout.Height(30)))
|
||||
{
|
||||
spawner.ClearObstacles();
|
||||
EditorUtility.SetDirty(spawner);
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.Space(5);
|
||||
EditorGUILayout.HelpBox(
|
||||
"• 장애물 생성: 설정한 밀도에 따라 랜덤 배치\n" +
|
||||
"• 장애물 제거: 생성된 모든 장애물 삭제\n" +
|
||||
"• Scene 뷰에서 초록색 영역이 배치 범위입니다",
|
||||
MessageType.Info);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user