Table of Contents

Class CircularArray

Namespace
Fr4z.CircularArrayUi
Assembly
Fr4z.CircularArray.dll
[ExecuteAlways]
[AddComponentMenu("Fr4z/Circular Array")]
[DisallowMultipleComponent]
public class CircularArray : MonoBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
CircularArray
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.transform
Component.gameObject
Component.tag
Object.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.name
Object.hideFlags

Properties

AlwaysUpdate

Is the layout refreshed every frame?

public bool AlwaysUpdate { get; set; }

Property Value

bool

AngleOffset

The offset angle added to FromAngle and ToAngle

public float AngleOffset { get; set; }

Property Value

float

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

bool

AnimationParameters

Parameters that define the animation behaviour

public AnimationParameters AnimationParameters { get; set; }

Property Value

AnimationParameters

AnimationState

The current state of the open/close animation

public AnimationState AnimationState { get; protected set; }

Property Value

AnimationState

CachedContent

Dictionary of cached children of the circular array

public IReadOnlyDictionary<Transform, CircularArrayContentItem> CachedContent { get; }

Property Value

IReadOnlyDictionary<Transform, CircularArrayContentItem>

ChildRadius

The radius of the content. Used only if FitInRect is true

public float ChildRadius { get; set; }

Property Value

float

EasedOpenProgress

The eased value of OpenProgress, it's determined by AnimationParameters's ease value

public float EasedOpenProgress { get; }

Property Value

float

EllipseSize

Horizontal and verical size of the ellipse if Shape is Ellipse

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

List<ExtensionModule<CircularArray>>

FitInDimension

The dimension (Width or Height) used to fit the content if FitInRect is true

public Dimension FitInDimension { get; set; }

Property Value

Dimension

FitInRect

Make the array content fit inside a rect transform

public bool FitInRect { get; set; }

Property Value

bool

FitRect

The rect transform used to fit the array content if FitInRect is true

public RectTransform FitRect { get; set; }

Property Value

RectTransform

FromAngle

The start angle of the circular array

public float FromAngle { get; set; }

Property Value

float

IsOpen

public bool IsOpen { get; }

Property Value

bool

LayoutListeners

Single action listeners you can use to override some properties individually to children before they are applied

public CircularArrayLayoutListeners LayoutListeners { get; }

Property Value

CircularArrayLayoutListeners

MaxRadius

The radius circular array when OpenProgress is 1. It's not used if FitInRect is true

public float MaxRadius { get; set; }

Property Value

float

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

float

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

float

RotateTowardCenterWhenClosed

Rotate the content toward the center when the circular array is closed

public bool RotateTowardCenterWhenClosed { get; set; }

Property Value

bool

RotateTowardCenterWhenOpen

Rotate the content toward the center when the circular array is open

public bool RotateTowardCenterWhenOpen { get; set; }

Property Value

bool

RotationDirection

Sets the order of the content clockwise or counter-clockwise

public RotationDirection RotationDirection { get; set; }

Property Value

RotationDirection

Shape

The distribution shape of the content

public Shape Shape { get; set; }

Property Value

Shape

StartOpened

If true, set the OpenProgress at 1 at the Start

public bool StartOpened { get; set; }

Property Value

bool

ToAngle

The end angle of the circular array

public float ToAngle { get; set; }

Property Value

float

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

bool

UseTransformForMaxRadius

If true, use MaxRadiusTransform to determine the maximum radius of the array.

public bool UseTransformForMaxRadius { get; set; }

Property Value

bool

UseTransformForMinRadius

If true, use MinRadiusTransform to determine the minimum radius of the array.

public bool UseTransformForMinRadius { get; set; }

Property Value

bool

Methods

AddContentItem(GameObject)

Add an object to the array

public void AddContentItem(GameObject gameObject)

Parameters

gameObject GameObject

The 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 CircularArray
angle float

Returns

Vector3

Open()

Start the open animation

public void Open()

Toggle()

Toggle the active state of the array

public void Toggle()