Skip to content

Commit 0ef4267

Browse files
author
Keanan Koppenhaver
committed
Hide newspaper on button click
1 parent ef29e54 commit 0ef4267

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

Newspaper.cs

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -96,34 +96,23 @@ void Start()
9696
}
9797

9898
data = new StringBuilder(2048);
99-
100-
monitors = new List<BoolMonitor>()
101-
{
102-
new BoolMonitor("PrimaryIndexTrigger", () => OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger)),
103-
new BoolMonitor("PrimaryIndexTriggerDown", () => OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger)),
104-
new BoolMonitor("PrimaryIndexTriggerUp", () => OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger)),
105-
new BoolMonitor("PrimaryIndexTrigger (Touch)", () => OVRInput.Get(OVRInput.Touch.PrimaryIndexTrigger)),
106-
new BoolMonitor("PrimaryIndexTriggerDown (Touch)", () => OVRInput.GetDown(OVRInput.Touch.PrimaryIndexTrigger)),
107-
new BoolMonitor("PrimaryIndexTriggerUp (Touch)", () => OVRInput.GetUp(OVRInput.Touch.PrimaryIndexTrigger)),
108-
new BoolMonitor("PrimaryHandTrigger", () => OVRInput.Get(OVRInput.Button.PrimaryHandTrigger)),
109-
new BoolMonitor("PrimaryHandTriggerDown", () => OVRInput.GetDown(OVRInput.Button.PrimaryHandTrigger)),
110-
new BoolMonitor("PrimaryHandTriggerUp", () => OVRInput.GetUp(OVRInput.Button.PrimaryHandTrigger)),
111-
};
11299
}
113100

114101
void Update()
115102
{
116103
// Hide the entire newspaper closeup
117-
this.transform.parent.gameObject.SetActive(false);
118104

119105
OVRInput.Controller activeController = OVRInput.GetActiveController();
120106

121107
data.Length = 0;
122108

123-
for (int i = 0; i < monitors.Count; i++)
124-
{
125-
monitors[i].Update();
126-
monitors[i].AppendToStringBuilder(ref data);
109+
if( OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger) ) {
110+
if (this.transform.parent.gameObject.active) {
111+
this.transform.parent.gameObject.SetActive(false);
112+
}
113+
else {
114+
this.transform.parent.gameObject.SetActive(true);
115+
}
127116
}
128117

129118
if (uiText != null)

0 commit comments

Comments
 (0)