-
Notifications
You must be signed in to change notification settings - Fork 0
/
S_PlayerMovement_V2.cs
99 lines (86 loc) · 3.55 KB
/
S_PlayerMovement_V2.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class S_PlayerMovement_V2 : S_InputReceiver
{
private int _playerIndex = -1;
void Start()
{
}
private void Awake()
{
RegisterInput(EA_PlayerInputArguments.EInputType.Down, ReceiveInput.Pressed, OnMovementPressed);
RegisterInput(EA_PlayerInputArguments.EInputType.Down, ReceiveInput.Released, OnMovementReleased);
RegisterInput(EA_PlayerInputArguments.EInputType.Up, ReceiveInput.Pressed, OnMovementPressed);
RegisterInput(EA_PlayerInputArguments.EInputType.Up, ReceiveInput.Released, OnMovementReleased);
RegisterInput(EA_PlayerInputArguments.EInputType.Left, ReceiveInput.Pressed, OnMovementPressed);
RegisterInput(EA_PlayerInputArguments.EInputType.Left, ReceiveInput.Released, OnMovementReleased);
RegisterInput(EA_PlayerInputArguments.EInputType.Right, ReceiveInput.Pressed, OnMovementPressed);
RegisterInput(EA_PlayerInputArguments.EInputType.Right, ReceiveInput.Released, OnMovementReleased);
RegisterInput(EA_PlayerInputArguments.EInputType.LeftArmActivate, ReceiveInput.Pressed, LeftArmPressed);
RegisterInput(EA_PlayerInputArguments.EInputType.LeftArmActivate, ReceiveInput.Released, LeftArmReleased);
RegisterInput(EA_PlayerInputArguments.EInputType.RightArmActivate, ReceiveInput.Pressed, RightArmPressed);
RegisterInput(EA_PlayerInputArguments.EInputType.RightArmActivate, ReceiveInput.Released, RightArmReleased);
//RegisterInput(EA_PlayerInputArguments.EInputType.Look, ReceiveInput.Both, OnMouseMoved);
}
public void RightArmPressed(object o, EA_PlayerInputArguments args)
{
Debug.Log("Right Arm Pressed");
}
public void RightArmReleased(object o, EA_PlayerInputArguments args)
{
Debug.Log("Right Arm Released");
}
public void LeftArmPressed(object o, EA_PlayerInputArguments args)
{
Debug.Log("Left Arm Pressed");
}
public void LeftArmReleased(object o, EA_PlayerInputArguments args)
{
Debug.Log("Left Arm Released");
}
public void OnMovementPressed(object o, EA_PlayerInputArguments args)
{
Debug.Log("Input Pressed");
switch (args.PlayerInputType)
{
case EA_PlayerInputArguments.EInputType.Up:
Debug.Log("Up");
break;
case EA_PlayerInputArguments.EInputType.Down:
Debug.Log("Down");
break;
case EA_PlayerInputArguments.EInputType.Left:
Debug.Log("Left");
break;
case EA_PlayerInputArguments.EInputType.Right:
Debug.Log("Right");
break;
}
}
public void OnMovementReleased(object o, EA_PlayerInputArguments args)
{
Debug.Log("Input Released");
switch (args.PlayerInputType)
{
case EA_PlayerInputArguments.EInputType.Up:
Debug.Log("Up");
break;
case EA_PlayerInputArguments.EInputType.Down:
Debug.Log("Down");
break;
case EA_PlayerInputArguments.EInputType.Left:
Debug.Log("Left");
break;
case EA_PlayerInputArguments.EInputType.Right:
Debug.Log("Right");
break;
}
}
public void OnMouseMoved(object o, EA_PlayerInputArguments args)
{
Debug.Log("X Movement "+args.XAxis);
Debug.Log("Y Movement "+args.YAxis);
}
}