Skip to content
This repository was archived by the owner on May 25, 2018. It is now read-only.

Commit aeac833

Browse files
author
VIVE development area
committed
Fix error on option menu
1 parent 3247cbc commit aeac833

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Assets/Scripts/MenuController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public static void createOptionMenu(IList<Option> options, Vector3 angle) {
9090
instance._menuActive = false;
9191

9292
instance.optionRadian = Mathf.PI * 2f / options.Count;
93-
instance.optionDistance = options.Count < 5 ? 1f : (0.5f / Mathf.Tan(instance.optionRadian));
93+
instance.optionDistance = options.Count < 5 ? 1f : (0.6f / Mathf.Tan(instance.optionRadian / 2));
9494

9595
float accuAngle = 0f;
9696
foreach (Option option in options) {
@@ -128,7 +128,7 @@ public static void clearOptionMenu() {
128128

129129
void updateOptionMenu() {
130130
Vector2 haloPos = new Vector2(controller.controllerState.rAxis0.x, controller.controllerState.rAxis0.y);
131-
optionHalo.rectTransform.localPosition = haloPos * optionDistance;
131+
optionHalo.rectTransform.localPosition = haloPos * (optionDistance + 0.5f);
132132
var newSelected = optionBtns[Mathf.FloorToInt(((Mathf.Atan2(haloPos.y, haloPos.x) + optionRadian / 2 + 2 * Mathf.PI) % (2 * Mathf.PI)) / optionRadian)];
133133

134134
if (optionSelected != null && newSelected != optionSelected) {

0 commit comments

Comments
 (0)