Files
aibis-dream/Assets/Shapes/Scripts/Editor/Components/TorusEditor.cs
T
2025-05-07 15:07:44 +08:00

35 lines
1.1 KiB
C#

using UnityEditor;
// Shapes © Freya Holmér - https://twitter.com/FreyaHolmer/
// Website & Documentation - https://acegikmo.com/shapes/
namespace Shapes {
[CustomEditor( typeof(Torus) )]
[CanEditMultipleObjects]
public class TorusEditor : ShapeRendererEditor {
SerializedProperty propRadius = null;
SerializedProperty propRadiusSpace = null;
SerializedProperty propThickness = null;
SerializedProperty propThicknessSpace = null;
SerializedProperty propAngRadiansStart = null;
SerializedProperty propAngRadiansEnd = null;
SerializedProperty propAngUnitInput = null;
public override void OnInspectorGUI() {
base.BeginProperties();
ShapesUI.FloatInSpaceField( propRadius, propRadiusSpace );
ShapesUI.FloatInSpaceField( propThickness, propThicknessSpace );
DrawAngleProperties();
base.EndProperties();
}
void DrawAngleProperties() {
ShapesUI.AngleProperty( propAngRadiansStart, "Angle start", propAngUnitInput, DiscEditor.angLabelLayout );
ShapesUI.AngleProperty( propAngRadiansEnd, "Angle end", propAngUnitInput, DiscEditor.angLabelLayout );
ShapesUI.DrawAngleSwitchButtons( propAngUnitInput );
}
}
}