chore: initial commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MoreMountains.Tools
|
||||
{
|
||||
/// <summary>
|
||||
/// Custom editor for the MMTilemapGenerator, handles generate button and reorderable layers
|
||||
/// </summary>
|
||||
[CustomEditor(typeof(MMTilemapGenerator), true)]
|
||||
[CanEditMultipleObjects]
|
||||
public class MMTilemapGeneratorEditor : Editor
|
||||
{
|
||||
|
||||
protected MMReorderableList _list;
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
_list = new MMReorderableList(serializedObject.FindProperty("Layers"));
|
||||
_list.elementNameProperty = "Layer";
|
||||
_list.elementDisplayType = MMReorderableList.ElementDisplayType.Expandable;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
DrawPropertiesExcluding(serializedObject, "Layers");
|
||||
EditorGUILayout.Space(10);
|
||||
_list.DoLayoutList();
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
if (GUILayout.Button("Generate"))
|
||||
{
|
||||
(target as MMTilemapGenerator).Generate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2fad23a01f1d6df49be8215ff24dbe62
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user