Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 49bd736

Browse files
PvP
started to implement a pvp system into the game using split screen
1 parent 1f192d5 commit 49bd736

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+609333
-32289
lines changed

‎Native_Compilation_Project/Assets/Input Systems/PlayerInputs.cs

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,24 @@ public @PlayerInputs()
8989
""processors"": """",
9090
""interactions"": """",
9191
""initialStateCheck"": false
92+
},
93+
{
94+
""name"": ""PvP_WeaponSwapLeft"",
95+
""type"": ""Button"",
96+
""id"": ""ecc5990e-695c-4d14-a0d6-a4af9964aa9a"",
97+
""expectedControlType"": ""Button"",
98+
""processors"": """",
99+
""interactions"": """",
100+
""initialStateCheck"": false
101+
},
102+
{
103+
""name"": ""PvP_WeaponSwapRight"",
104+
""type"": ""Button"",
105+
""id"": ""b9387764-88a7-4c38-8d47-83bbe0384ab9"",
106+
""expectedControlType"": ""Button"",
107+
""processors"": """",
108+
""interactions"": """",
109+
""initialStateCheck"": false
92110
}
93111
],
94112
""bindings"": [
@@ -289,6 +307,28 @@ public @PlayerInputs()
289307
""action"": ""Pause"",
290308
""isComposite"": false,
291309
""isPartOfComposite"": false
310+
},
311+
{
312+
""name"": """",
313+
""id"": ""60ebb146-67c0-408f-bb2f-ce4b55ba42a4"",
314+
""path"": ""<Gamepad>/leftShoulder"",
315+
""interactions"": """",
316+
""processors"": """",
317+
""groups"": """",
318+
""action"": ""PvP_WeaponSwapLeft"",
319+
""isComposite"": false,
320+
""isPartOfComposite"": false
321+
},
322+
{
323+
""name"": """",
324+
""id"": ""2b24f6d7-26c8-4b3f-91ed-d88ada35f2f9"",
325+
""path"": ""<Gamepad>/rightShoulder"",
326+
""interactions"": """",
327+
""processors"": """",
328+
""groups"": """",
329+
""action"": ""PvP_WeaponSwapRight"",
330+
""isComposite"": false,
331+
""isPartOfComposite"": false
292332
}
293333
]
294334
},
@@ -465,7 +505,19 @@ public @PlayerInputs()
465505
]
466506
}
467507
],
468-
""controlSchemes"": []
508+
""controlSchemes"": [
509+
{
510+
""name"": ""PvP"",
511+
""bindingGroup"": ""PvP"",
512+
""devices"": [
513+
{
514+
""devicePath"": ""<Gamepad>"",
515+
""isOptional"": false,
516+
""isOR"": false
517+
}
518+
]
519+
}
520+
]
469521
}");
470522
// Player_Map
471523
m_Player_Map = asset.FindActionMap("Player_Map", throwIfNotFound: true);
@@ -476,6 +528,8 @@ public @PlayerInputs()
476528
m_Player_Map_Shoot = m_Player_Map.FindAction("Shoot", throwIfNotFound: true);
477529
m_Player_Map_Dodge = m_Player_Map.FindAction("Dodge", throwIfNotFound: true);
478530
m_Player_Map_Pause = m_Player_Map.FindAction("Pause", throwIfNotFound: true);
531+
m_Player_Map_PvP_WeaponSwapLeft = m_Player_Map.FindAction("PvP_WeaponSwapLeft", throwIfNotFound: true);
532+
m_Player_Map_PvP_WeaponSwapRight = m_Player_Map.FindAction("PvP_WeaponSwapRight", throwIfNotFound: true);
479533
// Menus_Map
480534
m_Menus_Map = asset.FindActionMap("Menus_Map", throwIfNotFound: true);
481535
m_Menus_Map_Up = m_Menus_Map.FindAction("Up", throwIfNotFound: true);
@@ -550,6 +604,8 @@ public int FindBinding(InputBinding bindingMask, out InputAction action)
550604
private readonly InputAction m_Player_Map_Shoot;
551605
private readonly InputAction m_Player_Map_Dodge;
552606
private readonly InputAction m_Player_Map_Pause;
607+
private readonly InputAction m_Player_Map_PvP_WeaponSwapLeft;
608+
private readonly InputAction m_Player_Map_PvP_WeaponSwapRight;
553609
public struct Player_MapActions
554610
{
555611
private @PlayerInputs m_Wrapper;
@@ -561,6 +617,8 @@ public struct Player_MapActions
561617
public InputAction @Shoot => m_Wrapper.m_Player_Map_Shoot;
562618
public InputAction @Dodge => m_Wrapper.m_Player_Map_Dodge;
563619
public InputAction @Pause => m_Wrapper.m_Player_Map_Pause;
620+
public InputAction @PvP_WeaponSwapLeft => m_Wrapper.m_Player_Map_PvP_WeaponSwapLeft;
621+
public InputAction @PvP_WeaponSwapRight => m_Wrapper.m_Player_Map_PvP_WeaponSwapRight;
564622
public InputActionMap Get() { return m_Wrapper.m_Player_Map; }
565623
public void Enable() { Get().Enable(); }
566624
public void Disable() { Get().Disable(); }
@@ -591,6 +649,12 @@ public void SetCallbacks(IPlayer_MapActions instance)
591649
@Pause.started -= m_Wrapper.m_Player_MapActionsCallbackInterface.OnPause;
592650
@Pause.performed -= m_Wrapper.m_Player_MapActionsCallbackInterface.OnPause;
593651
@Pause.canceled -= m_Wrapper.m_Player_MapActionsCallbackInterface.OnPause;
652+
@PvP_WeaponSwapLeft.started -= m_Wrapper.m_Player_MapActionsCallbackInterface.OnPvP_WeaponSwapLeft;
653+
@PvP_WeaponSwapLeft.performed -= m_Wrapper.m_Player_MapActionsCallbackInterface.OnPvP_WeaponSwapLeft;
654+
@PvP_WeaponSwapLeft.canceled -= m_Wrapper.m_Player_MapActionsCallbackInterface.OnPvP_WeaponSwapLeft;
655+
@PvP_WeaponSwapRight.started -= m_Wrapper.m_Player_MapActionsCallbackInterface.OnPvP_WeaponSwapRight;
656+
@PvP_WeaponSwapRight.performed -= m_Wrapper.m_Player_MapActionsCallbackInterface.OnPvP_WeaponSwapRight;
657+
@PvP_WeaponSwapRight.canceled -= m_Wrapper.m_Player_MapActionsCallbackInterface.OnPvP_WeaponSwapRight;
594658
}
595659
m_Wrapper.m_Player_MapActionsCallbackInterface = instance;
596660
if (instance != null)
@@ -616,6 +680,12 @@ public void SetCallbacks(IPlayer_MapActions instance)
616680
@Pause.started += instance.OnPause;
617681
@Pause.performed += instance.OnPause;
618682
@Pause.canceled += instance.OnPause;
683+
@PvP_WeaponSwapLeft.started += instance.OnPvP_WeaponSwapLeft;
684+
@PvP_WeaponSwapLeft.performed += instance.OnPvP_WeaponSwapLeft;
685+
@PvP_WeaponSwapLeft.canceled += instance.OnPvP_WeaponSwapLeft;
686+
@PvP_WeaponSwapRight.started += instance.OnPvP_WeaponSwapRight;
687+
@PvP_WeaponSwapRight.performed += instance.OnPvP_WeaponSwapRight;
688+
@PvP_WeaponSwapRight.canceled += instance.OnPvP_WeaponSwapRight;
619689
}
620690
}
621691
}
@@ -693,6 +763,15 @@ public void SetCallbacks(IMenus_MapActions instance)
693763
}
694764
}
695765
public Menus_MapActions @Menus_Map => new Menus_MapActions(this);
766+
private int m_PvPSchemeIndex = -1;
767+
public InputControlScheme PvPScheme
768+
{
769+
get
770+
{
771+
if (m_PvPSchemeIndex == -1) m_PvPSchemeIndex = asset.FindControlSchemeIndex("PvP");
772+
return asset.controlSchemes[m_PvPSchemeIndex];
773+
}
774+
}
696775
public interface IPlayer_MapActions
697776
{
698777
void OnMovement(InputAction.CallbackContext context);
@@ -702,6 +781,8 @@ public interface IPlayer_MapActions
702781
void OnShoot(InputAction.CallbackContext context);
703782
void OnDodge(InputAction.CallbackContext context);
704783
void OnPause(InputAction.CallbackContext context);
784+
void OnPvP_WeaponSwapLeft(InputAction.CallbackContext context);
785+
void OnPvP_WeaponSwapRight(InputAction.CallbackContext context);
705786
}
706787
public interface IMenus_MapActions
707788
{

‎Native_Compilation_Project/Assets/Input Systems/PlayerInputs.inputactions

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,24 @@
6767
"processors": "",
6868
"interactions": "",
6969
"initialStateCheck": false
70+
},
71+
{
72+
"name": "PvP_WeaponSwapLeft",
73+
"type": "Button",
74+
"id": "ecc5990e-695c-4d14-a0d6-a4af9964aa9a",
75+
"expectedControlType": "Button",
76+
"processors": "",
77+
"interactions": "",
78+
"initialStateCheck": false
79+
},
80+
{
81+
"name": "PvP_WeaponSwapRight",
82+
"type": "Button",
83+
"id": "b9387764-88a7-4c38-8d47-83bbe0384ab9",
84+
"expectedControlType": "Button",
85+
"processors": "",
86+
"interactions": "",
87+
"initialStateCheck": false
7088
}
7189
],
7290
"bindings": [
@@ -267,6 +285,28 @@
267285
"action": "Pause",
268286
"isComposite": false,
269287
"isPartOfComposite": false
288+
},
289+
{
290+
"name": "",
291+
"id": "60ebb146-67c0-408f-bb2f-ce4b55ba42a4",
292+
"path": "<Gamepad>/leftShoulder",
293+
"interactions": "",
294+
"processors": "",
295+
"groups": "",
296+
"action": "PvP_WeaponSwapLeft",
297+
"isComposite": false,
298+
"isPartOfComposite": false
299+
},
300+
{
301+
"name": "",
302+
"id": "2b24f6d7-26c8-4b3f-91ed-d88ada35f2f9",
303+
"path": "<Gamepad>/rightShoulder",
304+
"interactions": "",
305+
"processors": "",
306+
"groups": "",
307+
"action": "PvP_WeaponSwapRight",
308+
"isComposite": false,
309+
"isPartOfComposite": false
270310
}
271311
]
272312
},
@@ -443,5 +483,17 @@
443483
]
444484
}
445485
],
446-
"controlSchemes": []
486+
"controlSchemes": [
487+
{
488+
"name": "PvP",
489+
"bindingGroup": "PvP",
490+
"devices": [
491+
{
492+
"devicePath": "<Gamepad>",
493+
"isOptional": false,
494+
"isOR": false
495+
}
496+
]
497+
}
498+
]
447499
}

‎Native_Compilation_Project/Assets/PvP.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Native_Compilation_Project/Assets/PvP/Prefab.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /