Tanoda
CycleHandPairs.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using UnityEngine;
10using System.Collections;
11using Leap.Unity;
12
13public class CycleHandPairs : MonoBehaviour {
15 public string[] GroupNames;
16 private int currentGroup;
17 public int CurrentGroup {
18 get { return currentGroup; }
19 set {
20 disableAllGroups();
21 currentGroup = value;
23 }
24 }
25 private KeyCode[] keyCodes = {
26 KeyCode.Alpha1,
27 KeyCode.Alpha2,
28 KeyCode.Alpha3,
29 KeyCode.Alpha4,
30 KeyCode.Alpha5,
31 KeyCode.Alpha6
32 };
33
34 // Use this for initialization
35 void Start () {
36 HandPool = GetComponent<HandModelManager>();
37 disableAllGroups();
38 CurrentGroup = 0;
39 }
40
41 // Update is called once per frame
42 void Update () {
43 if (Input.GetKeyUp(KeyCode.RightArrow)) {
44 if (CurrentGroup < GroupNames.Length - 1) {
46 }
47 }
48 if (Input.GetKeyUp(KeyCode.LeftArrow)) {
49 if (CurrentGroup > 0) {
51 }
52 }
53 for (int i = 0; i < keyCodes.Length; i++) {
54 if (Input.GetKeyDown(keyCodes[i])) {
56 }
57 }
58 if(Input.GetKeyUp(KeyCode.Alpha0)){
59 disableAllGroups();
60 }
61 }
62
63 private void disableAllGroups() {
64 for (int i = 0; i < GroupNames.Length; i++) {
66 }
67 }
68
69}
HandModelManager HandPool
string[] GroupNames
The HandModelManager manages a pool of HandModelBases and makes HandRepresentations when a it detects...
void DisableGroup(string groupName)
void ToggleGroup(string groupName)
void EnableGroup(string groupName)