Rename to Rebirth, move Editor scripts to Assets/Editor

This commit is contained in:
2024-12-16 02:42:15 -06:00
parent 36a66d945a
commit fbdf355ce4
8 changed files with 40 additions and 32 deletions

View File

@@ -0,0 +1,42 @@
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;
[CustomEditor(typeof(Network))]
public class NetworkEditor : Editor
{
Network network;
void OnEnable()
{
network = target as Network;
}
// public override VisualElement CreateInspectorGUI()
// {
// VisualElement root = new();
// addPlanetButton = new Button(() => { network.AddPlanet(); }) { text = "Add Planet" };
// // var planetList = new TreeView() { style = { flexGrow = 1 } };
// // planetList.Bind()
// // planetList.makeItem = () => new Label();
// // planetList.bindItem = (element, i) => (element as Label).text = planetList.itemsSource[i].ToString();
// // root.Add(planetList);
// root.Add(addPlanetButton);
// return root;
public override void OnInspectorGUI()
{
if (GUILayout.Button("Add Planet"))
{
network.AddPlanet();
}
DrawDefaultInspector();
}
}