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

Commit

Permalink
Fix error on option menu
Browse files Browse the repository at this point in the history
  • Loading branch information
VIVE development area committed Jun 27, 2016
1 parent 3247cbc commit aeac833
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/Scripts/MenuController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static void createOptionMenu(IList<Option> options, Vector3 angle) {
instance._menuActive = false;

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

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

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

if (optionSelected != null && newSelected != optionSelected) {
Expand Down

0 comments on commit aeac833

Please sign in to comment.