TrackFlow Pro Documentation 1
Generate roller coasters, railroads, conveyors and more with a physics aware spline and meshing system.
Loading...
Searching...
No Matches
TrackFlowPro.Editor.TrackFlowSpawnerEditor Class Reference

Custom editor for TrackFlowSpawner. More...

Classes

struct  Bounds2D

Public Member Functions

override VisualElement CreateInspectorGUI ()

Private Member Functions

void OnSceneGUI ()
Foldout BuildMeshMenu (SerializedObject spawner, PropertyField spawnTypeField)
 use the spawntypefield to register the callback on spawntype change after creating the menu
Foldout BuildCustomProfileMenu (SerializedObject spawner)
VisualElement BuildProfileParamsMenu (SerializedObject spawner, SerializedProperty customProp)
bool IsEditingAsset (SerializedProperty customProp, out CrossSectionProfile2DAsset asset)
SerializedObject GetOrCreateAssetSO (CrossSectionProfile2DAsset asset)
void CreateProfileAssetFromCurrent (SerializedObject spawnerSO, SerializedProperty customProp)
void PushInlineToAsset (SerializedObject spawnerSO, SerializedProperty customProp)
void PullAssetToInline (SerializedObject spawnerSO, SerializedProperty customProp)
void ApplyPreset (SerializedObject spawnerSO, SerializedProperty customProp, string preset)
void Mirror (SerializedObject spawnerSO, SerializedProperty customProp, bool mirrorX)
void Center (SerializedObject spawnerSO, SerializedProperty customProp)
void Normalize (SerializedObject spawnerSO, SerializedProperty customProp, bool keepAspect)
void ReverseWinding (SerializedObject spawnerSO, SerializedProperty customProp)
void ClearProfile (SerializedObject spawnerSO, SerializedProperty customProp)
void InvalidateEditedProfileCache (SerializedProperty customProp, bool editingAsset, CrossSectionProfile2DAsset asset)
void DrawProfileCanvas (SerializedObject spawnerSO, SerializedProperty customProp)
VisualElement BuildMainSettingsMenu (SerializedObject spawner)
VisualElement BuildSnapMenu (SerializedObject spawner)
Foldout BuildInstancingMenu (SerializedObject spawner)
Foldout BuildJitterMenu (SerializedObject spawner)

Static Private Member Functions

static CrossSectionProfile2D GetInlineProfile (SerializedProperty customProp)
static void MarkSplineDirty (SerializedObject spawnerSO)
static void DrawGrid (Rect rect, Vector2 viewExt)
static Vector2 WorldToGui (Rect rect, Vector2 viewExt, Vector2 p)
static Vector2 GuiToWorld (Rect rect, Vector2 viewExt, Vector2 gui)
static int PickVertex (Rect rect, Vector2 viewExt, Vector2[] verts, Vector2 mouse, float radiusPx)
static int FindClosestSegmentInsertIndex (Rect rect, Vector2 viewExt, Vector2[] verts, Vector2 worldPoint, bool closed)
static float DistancePointToSegmentSq (Vector2 p, Vector2 a, Vector2 b)
static Vector2[] GetVertices (SerializedProperty vertsProp)
static void SetVertices (SerializedProperty profileProp, Vector2[] verts)
static void AppendVertex (SerializedProperty vertsProp, Vector2 v)
static void InsertVertex (SerializedProperty vertsProp, int index, Vector2 v)
static void DeleteVertex (SerializedProperty vertsProp, int index)
static void SetVertex (SerializedProperty vertsProp, int index, Vector2 v)
static void SetEnum (SerializedProperty profileProp, string relName, int value)
static void SetBool (SerializedProperty profileProp, string relName, bool value)
static void SetProfileFrom (SerializedObject spawnerSO, SerializedProperty inlineProfileProp, CrossSectionProfile2D src)
static Vector2[] BuildCircleVerts (int sides)
static Vector2[] BuildRegularPolygon (int sides)
static Vector2[] BuildRoundedRect (float width, float height, float radius, int cornerSegments)
static Vector2[] BuildCapsule (float width, float height, int arcSegments)
static Vector2[] BuildUChannelOpen ()

Private Attributes

int _dragIndex = -1
bool _dragging
bool _keepAspectOnNormalize = true
CrossSectionProfile2DAsset _cachedAsset
SerializedObject _cachedAssetSO

Detailed Description

Custom editor for TrackFlowSpawner.

Member Function Documentation

◆ AppendVertex()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.AppendVertex ( SerializedProperty vertsProp,
Vector2 v )
staticprivate

◆ ApplyPreset()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.ApplyPreset ( SerializedObject spawnerSO,
SerializedProperty customProp,
string preset )
private

◆ BuildCapsule()

Vector2[] TrackFlowPro.Editor.TrackFlowSpawnerEditor.BuildCapsule ( float width,
float height,
int arcSegments )
staticprivate

◆ BuildCircleVerts()

Vector2[] TrackFlowPro.Editor.TrackFlowSpawnerEditor.BuildCircleVerts ( int sides)
staticprivate

◆ BuildCustomProfileMenu()

Foldout TrackFlowPro.Editor.TrackFlowSpawnerEditor.BuildCustomProfileMenu ( SerializedObject spawner)
private

◆ BuildInstancingMenu()

Foldout TrackFlowPro.Editor.TrackFlowSpawnerEditor.BuildInstancingMenu ( SerializedObject spawner)
private

◆ BuildJitterMenu()

Foldout TrackFlowPro.Editor.TrackFlowSpawnerEditor.BuildJitterMenu ( SerializedObject spawner)
private

◆ BuildMainSettingsMenu()

VisualElement TrackFlowPro.Editor.TrackFlowSpawnerEditor.BuildMainSettingsMenu ( SerializedObject spawner)
private

◆ BuildMeshMenu()

Foldout TrackFlowPro.Editor.TrackFlowSpawnerEditor.BuildMeshMenu ( SerializedObject spawner,
PropertyField spawnTypeField )
private

use the spawntypefield to register the callback on spawntype change after creating the menu

Parameters
spawner
spawnTypeField
Returns

◆ BuildProfileParamsMenu()

VisualElement TrackFlowPro.Editor.TrackFlowSpawnerEditor.BuildProfileParamsMenu ( SerializedObject spawner,
SerializedProperty customProp )
private

◆ BuildRegularPolygon()

Vector2[] TrackFlowPro.Editor.TrackFlowSpawnerEditor.BuildRegularPolygon ( int sides)
staticprivate

◆ BuildRoundedRect()

Vector2[] TrackFlowPro.Editor.TrackFlowSpawnerEditor.BuildRoundedRect ( float width,
float height,
float radius,
int cornerSegments )
staticprivate

◆ BuildSnapMenu()

VisualElement TrackFlowPro.Editor.TrackFlowSpawnerEditor.BuildSnapMenu ( SerializedObject spawner)
private

◆ BuildUChannelOpen()

Vector2[] TrackFlowPro.Editor.TrackFlowSpawnerEditor.BuildUChannelOpen ( )
staticprivate

◆ Center()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.Center ( SerializedObject spawnerSO,
SerializedProperty customProp )
private

◆ ClearProfile()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.ClearProfile ( SerializedObject spawnerSO,
SerializedProperty customProp )
private

◆ CreateInspectorGUI()

override VisualElement TrackFlowPro.Editor.TrackFlowSpawnerEditor.CreateInspectorGUI ( )

◆ CreateProfileAssetFromCurrent()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.CreateProfileAssetFromCurrent ( SerializedObject spawnerSO,
SerializedProperty customProp )
private

◆ DeleteVertex()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.DeleteVertex ( SerializedProperty vertsProp,
int index )
staticprivate

◆ DistancePointToSegmentSq()

float TrackFlowPro.Editor.TrackFlowSpawnerEditor.DistancePointToSegmentSq ( Vector2 p,
Vector2 a,
Vector2 b )
staticprivate

◆ DrawGrid()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.DrawGrid ( Rect rect,
Vector2 viewExt )
staticprivate

◆ DrawProfileCanvas()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.DrawProfileCanvas ( SerializedObject spawnerSO,
SerializedProperty customProp )
private

◆ FindClosestSegmentInsertIndex()

int TrackFlowPro.Editor.TrackFlowSpawnerEditor.FindClosestSegmentInsertIndex ( Rect rect,
Vector2 viewExt,
Vector2[] verts,
Vector2 worldPoint,
bool closed )
staticprivate

◆ GetInlineProfile()

CrossSectionProfile2D TrackFlowPro.Editor.TrackFlowSpawnerEditor.GetInlineProfile ( SerializedProperty customProp)
staticprivate

◆ GetOrCreateAssetSO()

SerializedObject TrackFlowPro.Editor.TrackFlowSpawnerEditor.GetOrCreateAssetSO ( CrossSectionProfile2DAsset asset)
private

◆ GetVertices()

Vector2[] TrackFlowPro.Editor.TrackFlowSpawnerEditor.GetVertices ( SerializedProperty vertsProp)
staticprivate

◆ GuiToWorld()

Vector2 TrackFlowPro.Editor.TrackFlowSpawnerEditor.GuiToWorld ( Rect rect,
Vector2 viewExt,
Vector2 gui )
staticprivate

◆ InsertVertex()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.InsertVertex ( SerializedProperty vertsProp,
int index,
Vector2 v )
staticprivate

◆ InvalidateEditedProfileCache()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.InvalidateEditedProfileCache ( SerializedProperty customProp,
bool editingAsset,
CrossSectionProfile2DAsset asset )
private

◆ IsEditingAsset()

bool TrackFlowPro.Editor.TrackFlowSpawnerEditor.IsEditingAsset ( SerializedProperty customProp,
out CrossSectionProfile2DAsset asset )
private

◆ MarkSplineDirty()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.MarkSplineDirty ( SerializedObject spawnerSO)
staticprivate

◆ Mirror()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.Mirror ( SerializedObject spawnerSO,
SerializedProperty customProp,
bool mirrorX )
private

◆ Normalize()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.Normalize ( SerializedObject spawnerSO,
SerializedProperty customProp,
bool keepAspect )
private

◆ OnSceneGUI()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.OnSceneGUI ( )
private

◆ PickVertex()

int TrackFlowPro.Editor.TrackFlowSpawnerEditor.PickVertex ( Rect rect,
Vector2 viewExt,
Vector2[] verts,
Vector2 mouse,
float radiusPx )
staticprivate

◆ PullAssetToInline()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.PullAssetToInline ( SerializedObject spawnerSO,
SerializedProperty customProp )
private

◆ PushInlineToAsset()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.PushInlineToAsset ( SerializedObject spawnerSO,
SerializedProperty customProp )
private

◆ ReverseWinding()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.ReverseWinding ( SerializedObject spawnerSO,
SerializedProperty customProp )
private

◆ SetBool()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.SetBool ( SerializedProperty profileProp,
string relName,
bool value )
staticprivate

◆ SetEnum()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.SetEnum ( SerializedProperty profileProp,
string relName,
int value )
staticprivate

◆ SetProfileFrom()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.SetProfileFrom ( SerializedObject spawnerSO,
SerializedProperty inlineProfileProp,
CrossSectionProfile2D src )
staticprivate

◆ SetVertex()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.SetVertex ( SerializedProperty vertsProp,
int index,
Vector2 v )
staticprivate

◆ SetVertices()

void TrackFlowPro.Editor.TrackFlowSpawnerEditor.SetVertices ( SerializedProperty profileProp,
Vector2[] verts )
staticprivate

◆ WorldToGui()

Vector2 TrackFlowPro.Editor.TrackFlowSpawnerEditor.WorldToGui ( Rect rect,
Vector2 viewExt,
Vector2 p )
staticprivate

Member Data Documentation

◆ _cachedAsset

CrossSectionProfile2DAsset TrackFlowPro.Editor.TrackFlowSpawnerEditor._cachedAsset
private

◆ _cachedAssetSO

SerializedObject TrackFlowPro.Editor.TrackFlowSpawnerEditor._cachedAssetSO
private

◆ _dragging

bool TrackFlowPro.Editor.TrackFlowSpawnerEditor._dragging
private

◆ _dragIndex

int TrackFlowPro.Editor.TrackFlowSpawnerEditor._dragIndex = -1
private

◆ _keepAspectOnNormalize

bool TrackFlowPro.Editor.TrackFlowSpawnerEditor._keepAspectOnNormalize = true
private

The documentation for this class was generated from the following file: