This commit is contained in:
SoulliesOfficial
2025-06-06 10:14:55 -04:00
parent d4e860fa16
commit db4d131192
1088 changed files with 45704 additions and 2260 deletions

View File

@@ -0,0 +1,38 @@
namespace Dreamteck.Splines.Editor
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class DistanceWindow : EditorWindow
{
float distance = 0f;
DistanceReceiver rcv;
float length = 0f;
public delegate void DistanceReceiver(float distance);
public void Init(DistanceReceiver receiver, float totalLength)
{
rcv = receiver;
length = totalLength;
titleContent = new GUIContent("Set Distance");
minSize = maxSize = new Vector2(240, 90);
}
private void OnGUI()
{
if (Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.KeypadEnter || Event.current.keyCode == KeyCode.Return))
{
rcv(distance);
Close();
}
distance = EditorGUILayout.FloatField("Distance", distance);
if (distance < 0f) distance = 0f;
else if (distance > length) distance = length;
if (distance > 0f)
{
EditorGUILayout.LabelField("Press Enter to set.", EditorStyles.centeredGreyMiniLabel);
}
EditorGUILayout.HelpBox("Enter the distance and press Enter. Current spline length: " + length, MessageType.Info);
}
}
}