Switch to regrowth game

This commit is contained in:
2024-12-15 03:08:48 -06:00
parent 4bff61b6d8
commit 5a62541e21
24 changed files with 798 additions and 2263 deletions

51
Assets/PlanetEditor.cs Normal file
View File

@@ -0,0 +1,51 @@
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;
[CustomEditor(typeof(Planet))]
public class PlanetEditor : Editor
{
Planet planet;
void OnEnable()
{
planet = target as Planet;
}
public override void OnInspectorGUI()
{
if (GUILayout.Button("Delete Planet"))
{
DestroyImmediate(planet.gameObject);
return;
}
// Check if size changed
var newSize = EditorGUILayout.Slider("Size", planet.Size, 1f, 300f);
if (newSize != planet.Size)
{
planet.Size = newSize;
planet.GenerateLine();
}
// Check if bulbs changed
var newBulbs = EditorGUILayout.IntSlider("Bulbs", planet.Bulbs, 0, 5);
if (newBulbs != planet.Bulbs)
{
planet.Bulbs = newBulbs;
planet.GenerateLine();
}
// Check if edge width changed
var newEdgeWidth = EditorGUILayout.Slider("Edge Width", planet.edgeWidth, 0.001f, 0.2f);
if (newEdgeWidth != planet.edgeWidth)
{
planet.edgeWidth = newEdgeWidth;
planet.GenerateLine();
}
DrawDefaultInspector();
}
}