1 using System.Collections;
2 using System.Collections.Generic;
5 using UnityEngine.EventSystems;
7 namespace AVR.UI.Utils {
10 private RectTransform
rect;
15 rect = GetComponent<RectTransform>();
16 img = GetComponentInChildren<Image>();
17 txt = GetComponentInChildren<Text>();
22 rect.localScale =
new Vector3(1.2f, 1.2f, 1.2f);
25 rect.localScale =
new Vector3(1.0f, 1.0f, 1.0f);
30 img.color = entry.color;
31 txt.text = entry.name;
33 float center_angle = (entry.min_angle + 0.5f * (entry.max_angle - entry.min_angle)) * Mathf.Deg2Rad;
34 Vector2 textPos = textradius *
new Vector2(-Mathf.Sin(center_angle), -Mathf.Cos(center_angle));
35 txt.transform.localPosition =
new Vector3(textPos.x, textPos.y, 0.0f);
37 img.fillAmount = (entry.max_angle-entry.min_angle) / 360.0f;
38 img.transform.localRotation = Quaternion.AngleAxis(entry.min_angle, Vector3.back);
void initalize(AVRUI_ClickDragWheel.ClickDragWheelEntry entry, float textradius)
void markSelected(bool selected)