Tanoda
KeyEnableBehaviors.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
9
using
UnityEngine
;
10
using
System.Collections;
11
using
System.Collections.Generic;
12
13
namespace
Leap.Unity
{
14
public
class
KeyEnableBehaviors
: MonoBehaviour {
15
public
List<Behaviour>
targets
;
16
[Header(
"Controls"
)]
17
public
KeyCode
unlockHold
= KeyCode.None;
18
public
KeyCode
toggle
= KeyCode.Space;
19
20
// Update is called once per frame
21
void
Update() {
22
if
(
unlockHold
!= KeyCode.None &&
23
!Input.GetKey(
unlockHold
)) {
24
return
;
25
}
26
if
(Input.GetKeyDown(
toggle
)) {
27
for
(
int
i = 0; i <
targets
.Count; i++) {
28
targets
[i].enabled = !
targets
[i].enabled;
29
}
30
}
31
}
32
}
33
}
Leap.Unity.KeyEnableBehaviors
Definition:
KeyEnableBehaviors.cs:14
Leap.Unity.KeyEnableBehaviors.toggle
KeyCode toggle
Definition:
KeyEnableBehaviors.cs:18
Leap.Unity.KeyEnableBehaviors.targets
List< Behaviour > targets
Definition:
KeyEnableBehaviors.cs:15
Leap.Unity.KeyEnableBehaviors.unlockHold
KeyCode unlockHold
Definition:
KeyEnableBehaviors.cs:17
Leap.Unity
Definition:
AssetFolderPropertyDrawer.cs:15
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
Plugins
LeapMotion
Core
Scripts
Utils
KeyEnableBehaviors.cs
Generated by
1.9.3