rabidus-test/Assets/Dreamteck/Splines/Editor/Primitives/StarEditor.cs

32 lines
841 B
C#
Raw Permalink Normal View History

2023-07-24 16:38:13 +03:00
using UnityEngine;
using System.Collections;
using UnityEditor;
using Dreamteck.Splines.Editor;
namespace Dreamteck.Splines.Primitives
{
public class StarEditor : PrimitiveEditor
{
public override string GetName()
{
return "Star";
}
public override void Open(DreamteckSplinesEditor editor)
{
base.Open(editor);
primitive = new Star();
}
protected override void OnGUI()
{
base.OnGUI();
Star star = (Star)primitive;
star.radius = EditorGUILayout.FloatField("Radius", star.radius);
star.depth = EditorGUILayout.FloatField("Depth", star.depth);
star.sides = EditorGUILayout.IntField("Sides", star.sides);
if (star.sides < 3) star.sides = 3;
}
}
}