Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Touch me if you can
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GameDevWeek
S
Sommersemester 2019
Unity
Touch me if you can
Commits
4be6549a
Commit
4be6549a
authored
Sep 21, 2019
by
Patrick Stengel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i promise my last next next next System change
parent
a63f8fd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
Assets/_Game/Scripts/Input/SwitchPlayerManager.cs
Assets/_Game/Scripts/Input/SwitchPlayerManager.cs
+25
-5
No files found.
Assets/_Game/Scripts/Input/SwitchPlayerManager.cs
View file @
4be6549a
...
...
@@ -7,21 +7,41 @@ using UnityEngine.Serialization;
namespace
_Game.Scripts.Input
{
public
class
SwitchPlayerManager
:
MonoBehaviour
{
[
SerializeField
]
private
string
characterTag
;
[
SerializeField
]
private
MovementBase
movement
;
[
SerializeField
]
private
UseMutation
mutation
;
public
void
OnMovement
(
InputValue
value
)
{
if
(
movement
==
null
)
return
;
public
MovementBase
Movement
{
get
{
if
(
movement
==
null
||
!
movement
.
gameObject
.
tag
.
Equals
(
characterTag
))
{
movement
=
GameObject
.
FindWithTag
(
characterTag
).
GetComponent
<
MovementBase
>();
}
return
movement
;
}
}
public
UseMutation
Mutation
{
get
{
if
(
mutation
==
null
||
!
mutation
.
gameObject
.
tag
.
Equals
(
characterTag
))
{
mutation
=
GameObject
.
FindWithTag
(
characterTag
).
GetComponent
<
UseMutation
>();
}
movement
.
OnMovement
(
value
);
return
mutation
;
}
}
public
void
OnMovement
(
InputValue
value
)
{
Movement
.
OnMovement
(
value
);
}
public
void
OnAbility1
()
{
m
utation
.
OnAbility1
();
M
utation
.
OnAbility1
();
}
public
void
OnAbility2
()
{
m
utation
.
OnAbility2
();
M
utation
.
OnAbility2
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment