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
idxintindex 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
controlPointsCurvySplineSegment[]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
controlPointsCurvySplineSegment[]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
controlPointCurvySplineSegmentthe Control Point to remove
destroySelfIfEmptyboolwhether the connection should be destroyed when empty afterwards
SetSynchronisationPositionAndRotation(Vector3, Quaternion)
Synchronize 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
referencePositionVector3referenceRotationQuaternion
Remarks
Can dirty the splines of the updated control points
SetSynchronizationOptions(bool, bool)
Sets the ConnectionSyncPosition and ConnectionSyncRotation options for all the connected control points
public void SetSynchronizationOptions(bool syncPosition, bool syncRotation)