Class CircularArray
- Namespace
- Fr4z.CircularArrayUi
- Assembly
- Fr4z.CircularArray.dll
[ExecuteAlways]
[AddComponentMenu("Fr4z/Circular Array")]
[DisallowMultipleComponent]
public class CircularArray : MonoBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourCircularArray
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.transformComponent.gameObjectComponent.tagObject.GetInstanceID()Object.GetHashCode()Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Properties
AlwaysUpdate
Is the layout refreshed every frame?
public bool AlwaysUpdate { get; set; }
Property Value
AngleOffset
public float AngleOffset { get; set; }
Property Value
AnimateSeparately
If true move the content one after another instead of everyone at the same time during the open and close animations
public bool AnimateSeparately { get; set; }
Property Value
AnimationParameters
Parameters that define the animation behaviour
public AnimationParameters AnimationParameters { get; set; }
Property Value
AnimationState
The current state of the open/close animation
public AnimationState AnimationState { get; protected set; }
Property Value
CachedContent
Dictionary of cached children of the circular array
public IReadOnlyDictionary<Transform, CircularArrayContentItem> CachedContent { get; }
Property Value
- IReadOnlyDictionary<Transform, CircularArrayContentItem>
ChildRadius
public float ChildRadius { get; set; }
Property Value
EasedOpenProgress
The eased value of OpenProgress, it's determined by AnimationParameters's ease value
public float EasedOpenProgress { get; }
Property Value
EllipseSize
public Vector2 EllipseSize { get; set; }
Property Value
- Vector2
ExtensionModules
The extension modules of the circular array. They allow to modify the value of properties during the open/close animations
public List<ExtensionModule<CircularArray>> ExtensionModules { get; set; }
Property Value
FitInDimension
public Dimension FitInDimension { get; set; }
Property Value
FitInRect
Make the array content fit inside a rect transform
public bool FitInRect { get; set; }
Property Value
FitRect
public RectTransform FitRect { get; set; }
Property Value
- RectTransform
FromAngle
The start angle of the circular array
public float FromAngle { get; set; }
Property Value
IsOpen
Is OpenProgress 1?
public bool IsOpen { get; }
Property Value
LayoutListeners
Single action listeners you can use to override some properties individually to children before they are applied
public CircularArrayLayoutListeners LayoutListeners { get; }
Property Value
MaxRadius
The radius circular array when OpenProgress is 1. It's not used if FitInRect is true
public float MaxRadius { get; set; }
Property Value
MaxRadiusTransform
The transform used to determine the maximum radius of the array using its distance from the array center.
public RectTransform MaxRadiusTransform { get; set; }
Property Value
- RectTransform
MinRadius
The radius of the circular array when OpenProgress is 0
public float MinRadius { get; set; }
Property Value
MinRadiusTransform
The transform used to determine the minimum radius of the array using its distance from the array center.
public RectTransform MinRadiusTransform { get; set; }
Property Value
- RectTransform
OnCloseStart
Event fired when Close() is called
public UnityEvent OnCloseStart { get; set; }
Property Value
- UnityEvent
OnClosed
Event fired when the close animation ends
public UnityEvent OnClosed { get; set; }
Property Value
- UnityEvent
OnOpenStart
Event fired when Open() is called
public UnityEvent OnOpenStart { get; set; }
Property Value
- UnityEvent
OnOpened
Event fired when the open animation ends
public UnityEvent OnOpened { get; set; }
Property Value
- UnityEvent
OpenProgress
The current state of the open animation of the circular array. Set this a value from 0 to 1.
public float OpenProgress { get; set; }
Property Value
RotateTowardCenterWhenClosed
Rotate the content toward the center when the circular array is closed
public bool RotateTowardCenterWhenClosed { get; set; }
Property Value
RotateTowardCenterWhenOpen
Rotate the content toward the center when the circular array is open
public bool RotateTowardCenterWhenOpen { get; set; }
Property Value
RotationDirection
Sets the order of the content clockwise or counter-clockwise
public RotationDirection RotationDirection { get; set; }
Property Value
Shape
The distribution shape of the content
public Shape Shape { get; set; }
Property Value
StartOpened
If true, set the OpenProgress at 1 at the Start
public bool StartOpened { get; set; }
Property Value
ToAngle
The end angle of the circular array
public float ToAngle { get; set; }
Property Value
UseGlobalRotation
Rotate the content using global space instead of local space Note: if true, can cause unwanted rotations on world space canvas
public bool UseGlobalRotation { get; set; }
Property Value
UseTransformForMaxRadius
If true, use MaxRadiusTransform to determine the maximum radius of the array.
public bool UseTransformForMaxRadius { get; set; }
Property Value
UseTransformForMinRadius
If true, use MinRadiusTransform to determine the minimum radius of the array.
public bool UseTransformForMinRadius { get; set; }
Property Value
Methods
AddContentItem(GameObject)
Add an object to the array
public void AddContentItem(GameObject gameObject)
Parameters
gameObject
GameObjectThe object to add
Close()
Start the close animation
public void Close()
ForceLayoutReset()
Re-chache children and update the layout. Use when children are distributed incorrectly.
public void ForceLayoutReset()
ForceUpdateLayout()
Force a layout update
public void ForceUpdateLayout()
GetPositionByShape(CircularArray, float)
Get the position of the element by the selected shape
public static Vector3 GetPositionByShape(CircularArray circularArray, float angle)
Parameters
circularArray
CircularArrayangle
float
Returns
- Vector3
Open()
Start the open animation
public void Open()
Toggle()
Toggle the active state of the array
public void Toggle()