2using System.Collections.Generic;
17 [
Header(
"Options Settings")]
24 [
Tooltip(
"the scale size the options will have when the menu is collapsed.")]
27 [
Tooltip(
"the scale size the options will have when the menu is expanded")]
30 [
Tooltip(
"this defines the options’ angle separation when the menu is collapsed.")]
33 [
Tooltip(
"this defines the options’ angle separation when the menu is expanded.")]
36 [
Tooltip(
"defines the start angle for the previous options (counterclockwise)")]
39 [
Tooltip(
"sets whether the menu options are shown one by one or all at once.")]
42 [
Tooltip(
"defines the time is takes from the collapsed menu to be expanded.")]
45 [
Tooltip(
"defines the time is takes from the expanded menu to be collapsed.")]
50 [
Tooltip(
"is used to define the options’ scale size over Open Transition time.")]
53 [
Tooltip(
"is used to define the options’ scale size over Close Transition time.")]
77 for (
int i = 0; i <
Options.Count; i++)
84 Options[num].transform.SetAsFirstSibling();
101 for (
int i = 0; i < componentsInChildren.Length; i++)
136 for (
int i = 0; i < count; i++)
140 float time2 = (
T - num * (float)i) / num;
141 if (
T >= num * (
float)i &&
T < num * (float)(i + 1))
143 time2 = (
T - num * (float)i) / num;
145 Options[i].transform.localScale =
new Vector3(num4, num4, num4);
151 Options[i].transform.localScale =
new Vector3(num5, num5, num5);
154 float x = num6 * Mathf.Cos(MathF.PI / 180f * num3);
155 float y = num6 * Mathf.Sin(MathF.PI / 180f * num3);
156 Options[i].GetComponent<RectTransform>().anchoredPosition =
new Vector2(x, y);
165 uIButton.SetActive(enable:
true);
166 uIButton.icon.sprite = sprite;
167 RectTransform rectTransform = uIButton.Rect();
170 Options =
new List<RectTransform>();
174 uIButton.onClick.SetListener(action);
175 rectTransform.localPosition =
new Vector3(0f, 0f, 0f);