mirror of
https://github.com/Xevion/Rebirth.git
synced 2025-12-09 08:08:35 -06:00
Switch to regrowth game
This commit is contained in:
42
Assets/NetworkEditor.cs
Normal file
42
Assets/NetworkEditor.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user