VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
void AVR.UI.Utils.AVRUI_ClickDragWheelEntryPrefab.initalize ( AVRUI_ClickDragWheel.ClickDragWheelEntry  entry,
float  textradius 
)
inline

Definition at line 29 of file AVRUI_ClickDragWheelEntryPrefab.cs.

29  {
30  img.color = entry.color;
31  txt.text = entry.name;
32 
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);
36 
37  img.fillAmount = (entry.max_angle-entry.min_angle) / 360.0f;
38  img.transform.localRotation = Quaternion.AngleAxis(entry.min_angle, Vector3.back);
39  }