Skip to content

Commit 8c93c32

Browse files
committed
Renamed SampleButtonScript to SampleButton.
1 parent 4ccc0bc commit 8c93c32

2 files changed

Lines changed: 41 additions & 41 deletions

File tree

OSVR-Unity/Assets/OSVRUnity/Sample/Scripts/SampleButtonScript.cs renamed to OSVR-Unity/Assets/OSVRUnity/Sample/Scripts/SampleButton.cs

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
/// OSVR-Unity Connection
2-
///
3-
/// http://sensics.com/osvr
4-
///
5-
/// <copyright>
6-
/// Copyright 2014 Sensics, Inc.
7-
///
8-
/// Licensed under the Apache License, Version 2.0 (the "License");
9-
/// you may not use this file except in compliance with the License.
10-
/// You may obtain a copy of the License at
11-
///
12-
/// http://www.apache.org/licenses/LICENSE-2.0
13-
///
14-
/// Unless required by applicable law or agreed to in writing, software
15-
/// distributed under the License is distributed on an "AS IS" BASIS,
16-
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17-
/// See the License for the specific language governing permissions and
18-
/// limitations under the License.
19-
/// </copyright>
20-
21-
using UnityEngine;
22-
using System.Collections;
23-
24-
/// <summary>
25-
/// Note that this derives from the OSVR.Unity.RequiresButtonInterface, and so unlike the code in HandleButtonPress.cs,
26-
/// no class attributes are required to enforce the presence of an ButtonInterface component, nor is any
27-
/// GetComponent usage required to get to the ButtonInterface. We can just rely on it being there and use
28-
/// the inherited properties to access it concisely. Thus, this is the preferred technique for handling callbacks.
29-
/// </summary>
30-
public class SampleButtonScript : OSVR.Unity.RequiresButtonInterface
31-
{
32-
void Start()
33-
{
34-
this.Interface.StateChanged += handleButton;
35-
}
36-
37-
void handleButton(object sender, OSVR.ClientKit.TimeValue timestamp, int sensor, byte report)
38-
{
39-
Debug.Log("Got button: " + sensor.ToString() + " state is " + report);
40-
}
41-
}
1+
/// OSVR-Unity Connection
2+
///
3+
/// http://sensics.com/osvr
4+
///
5+
/// <copyright>
6+
/// Copyright 2014 Sensics, Inc.
7+
///
8+
/// Licensed under the Apache License, Version 2.0 (the "License");
9+
/// you may not use this file except in compliance with the License.
10+
/// You may obtain a copy of the License at
11+
///
12+
/// http://www.apache.org/licenses/LICENSE-2.0
13+
///
14+
/// Unless required by applicable law or agreed to in writing, software
15+
/// distributed under the License is distributed on an "AS IS" BASIS,
16+
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
/// See the License for the specific language governing permissions and
18+
/// limitations under the License.
19+
/// </copyright>
20+
21+
using UnityEngine;
22+
using System.Collections;
23+
24+
/// <summary>
25+
/// Note that this derives from the OSVR.Unity.RequiresButtonInterface, and so unlike the code in HandleButtonPress.cs,
26+
/// no class attributes are required to enforce the presence of an ButtonInterface component, nor is any
27+
/// GetComponent usage required to get to the ButtonInterface. We can just rely on it being there and use
28+
/// the inherited properties to access it concisely. Thus, this is the preferred technique for handling callbacks.
29+
/// </summary>
30+
public class SampleButton : OSVR.Unity.RequiresButtonInterface
31+
{
32+
void Start()
33+
{
34+
this.Interface.StateChanged += handleButton;
35+
}
36+
37+
void handleButton(object sender, OSVR.ClientKit.TimeValue timestamp, int sensor, byte report)
38+
{
39+
Debug.Log("Got button: " + sensor.ToString() + " state is " + report);
40+
}
41+
}

OSVR-Unity/Assets/OSVRUnity/Sample/Scripts/SampleButtonScript.cs.meta renamed to OSVR-Unity/Assets/OSVRUnity/Sample/Scripts/SampleButton.cs.meta

File renamed without changes.

0 commit comments

Comments
 (0)