Class CurvyConnection
- Namespace
- FluffyUnderware.Curvy
Connection component
[ExecuteInEditMode]
public class CurvyConnection : DTVersionedMonoBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourDTVersionedMonoBehaviourCurvyConnection
Constructors
CurvyConnection()
public CurvyConnection()
Properties
ControlPointsList
The list of connected control points
public ReadOnlyCollection<CurvySplineSegment> ControlPointsList { get; }
Property Value
Count
Gets the number of Control Points being part of this connection
public int Count { get; }
Property Value
this[int]
Gets a certain Control Point by index
public CurvySplineSegment this[int idx] { get; }
Parameters
idx
intindex of the Control Point
Property Value
- CurvySplineSegment
a Control Point
Methods
AddControlPoints(params CurvySplineSegment[])
Adds Control Points to this connection
public void AddControlPoints(params CurvySplineSegment[] controlPoints)
Parameters
controlPoints
CurvySplineSegment[]the Control Points to add
AutoSetFollowUp()
public void AutoSetFollowUp()
Create(params CurvySplineSegment[])
Creates a connection and adds Control Points
public static CurvyConnection Create(params CurvySplineSegment[] controlPoints)
Parameters
controlPoints
CurvySplineSegment[]Control Points to add
Returns
- CurvyConnection
the new connection
Delete()
Deletes the connection
public void Delete()
OnAfterDeserialize()
Implementation of UnityEngine.ISerializationCallbackReceiver Called automatically by Unity, is not meant to be called by Curvy's users
public void OnAfterDeserialize()
OnBeforeSerialize()
Implementation of UnityEngine.ISerializationCallbackReceiver Called automatically by Unity, is not meant to be called by Curvy's users
public void OnBeforeSerialize()
RemoveControlPoint(CurvySplineSegment, bool)
Removes a Control Point from this connection
public void RemoveControlPoint(CurvySplineSegment controlPoint, bool destroySelfIfEmpty = true)
Parameters
controlPoint
CurvySplineSegmentthe Control Point to remove
destroySelfIfEmpty
boolwhether the connection should be destroyed when empty afterwards
SetSynchronisationPositionAndRotation(Vector3, Quaternion)
Synchronise all the connected control points to match the given position and rotation, based on their synchronisation options, namely ConnectionSyncPosition and ConnectionSyncRotation. Will update the CurvyConnection's game object's transform too.
public void SetSynchronisationPositionAndRotation(Vector3 referencePosition, Quaternion referenceRotation)
Parameters
referencePosition
Vector3referenceRotation
Quaternion
Remarks
Can dirty the splines of the updated control points