forked from mariusrubo/Unity-Humanoid-Gestures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGesturesInterface.cs
40 lines (34 loc) · 1.42 KB
/
GesturesInterface.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GesturesInterface : MonoBehaviour {
[Tooltip("Manually drag your character here.")]
public Transform Character;
private Gestures CharacterGestures = null;
int GestureRight = 0;
int GestureLeft = 0;
float GestureSpeed = 0.015f; // set this to public to controll speed while script is running
// Use this for initialization
void Start () {
CharacterGestures = Character.GetComponent<Gestures>();
}
void OnGUI()
{
GUILayout.BeginArea(new Rect(230, 10, 100, 200));
if (GUILayout.Button("Right Scissors")) { GestureRight = 1; }
if (GUILayout.Button("Right Rock")) { GestureRight = 2; }
if (GUILayout.Button("Right Paper")) { GestureRight = 3; }
if (GUILayout.Button("Right Neutral")) { GestureRight = 4; }
GUILayout.EndArea();
GUILayout.BeginArea(new Rect(340, 10, 100, 200));
if (GUILayout.Button("Left Scissors")) { GestureLeft = 1; }
if (GUILayout.Button("Left Rock")) { GestureLeft = 2; }
if (GUILayout.Button("Left Paper")) { GestureLeft = 3; }
if (GUILayout.Button("Left Neutral")) { GestureLeft = 4; }
GUILayout.EndArea();
}
// Update is called once per frame
void Update () {
CharacterGestures.SetGestures(GestureRight, GestureLeft, GestureSpeed);
}
}