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

Commit 3247cbc

Browse files
author
VIVE development area
committed
Disable spin when menu enabled & speed up spin
1 parent 6b5a723 commit 3247cbc

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Assets/Scenes/main.unity

0 Bytes
Binary file not shown.

Assets/Scripts/MenuController.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static void addBtn(string txt, UnityEngine.Events.UnityAction onClick) {
8787

8888
public static void createOptionMenu(IList<Option> options, Vector3 angle) {
8989
clearOptionMenu();
90-
isActive = false;
90+
instance._menuActive = false;
9191

9292
instance.optionRadian = Mathf.PI * 2f / options.Count;
9393
instance.optionDistance = options.Count < 5 ? 1f : (0.5f / Mathf.Tan(instance.optionRadian));
@@ -112,6 +112,7 @@ public static void createOptionMenu(IList<Option> options, Vector3 angle) {
112112

113113
instance.transform.eulerAngles = angle;
114114
instance.optionCanvas.SetActive(true);
115+
ViveSpinScroll.enable = false;
115116
}
116117

117118
public static void clearOptionMenu() {
@@ -122,6 +123,7 @@ public static void clearOptionMenu() {
122123
instance.optionCanvas.SetActive(false);
123124
instance._menuActive = false;
124125
instance.optionSelected = null;
126+
ViveSpinScroll.enable = true;
125127
}
126128

127129
void updateOptionMenu() {

Assets/Scripts/ViveSpinScroll.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public class ViveSpinScroll : MonoBehaviour {
77
public event SpinScrollEventHandler SpinScrolled;
88

99
public float degreePerEvent;
10+
public static bool enable = true;
1011

1112
private SteamVR_TrackedController controller;
1213
private bool previousTouched;
@@ -20,7 +21,7 @@ void Start () {
2021

2122
// Update is called once per frame
2223
void Update () {
23-
if (!controller.padTouched) {
24+
if (!controller.padTouched || !enable) {
2425
previousTouched = false;
2526
return;
2627
}

0 commit comments

Comments
 (0)