-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayerControls.cs
More file actions
73 lines (70 loc) · 2.35 KB
/
PlayerControls.cs
File metadata and controls
73 lines (70 loc) · 2.35 KB
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
// GENERATED AUTOMATICALLY FROM 'Assets/PlayerControls.inputactions'
using System;
using UnityEngine;
using UnityEngine.Experimental.Input;
[Serializable]
public class PlayerControls : InputActionAssetReference
{
public PlayerControls()
{
}
public PlayerControls(InputActionAsset asset)
: base(asset)
{
}
private bool m_Initialized;
private void Initialize()
{
// Gameplay
m_Gameplay = asset.GetActionMap("Gameplay");
m_Gameplay_Selecting = m_Gameplay.GetAction("Selecting");
m_Gameplay_Moveleft = m_Gameplay.GetAction("Moveleft");
m_Gameplay_Moveright = m_Gameplay.GetAction("Moveright");
m_Initialized = true;
}
private void Uninitialize()
{
m_Gameplay = null;
m_Gameplay_Selecting = null;
m_Gameplay_Moveleft = null;
m_Gameplay_Moveright = null;
m_Initialized = false;
}
public void SetAsset(InputActionAsset newAsset)
{
if (newAsset == asset) return;
if (m_Initialized) Uninitialize();
asset = newAsset;
}
public override void MakePrivateCopyOfActions()
{
SetAsset(ScriptableObject.Instantiate(asset));
}
// Gameplay
private InputActionMap m_Gameplay;
private InputAction m_Gameplay_Selecting;
private InputAction m_Gameplay_Moveleft;
private InputAction m_Gameplay_Moveright;
public struct GameplayActions
{
private PlayerControls m_Wrapper;
public GameplayActions(PlayerControls wrapper) { m_Wrapper = wrapper; }
public InputAction @Selecting { get { return m_Wrapper.m_Gameplay_Selecting; } }
public InputAction @Moveleft { get { return m_Wrapper.m_Gameplay_Moveleft; } }
public InputAction @Moveright { get { return m_Wrapper.m_Gameplay_Moveright; } }
public InputActionMap Get() { return m_Wrapper.m_Gameplay; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled { get { return Get().enabled; } }
public InputActionMap Clone() { return Get().Clone(); }
public static implicit operator InputActionMap(GameplayActions set) { return set.Get(); }
}
public GameplayActions @Gameplay
{
get
{
if (!m_Initialized) Initialize();
return new GameplayActions(this);
}
}
}