Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GameDevWeek
Wintersemester 2018-2019
Unity
Suck It
Commits
4b786555
Commit
4b786555
authored
Mar 29, 2019
by
Sebastian Frey
Browse files
PlayerInteract geändert
parent
af1096a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Assets/_Game/Scripts/Player/PlayerInteract.cs
View file @
4b786555
...
...
@@ -133,16 +133,6 @@ namespace _Game.Scripts.Player
_fireAttack
.
enabled
=
false
;
_waterAttack
.
enabled
=
true
;
break
;
default
:
state
.
UpdateElement
(
InfusedElement
.
None
);
state
.
ChangeCharges
(
3
);
onElementInfused
.
Raise
(
InfusedElement
.
None
);
onChargeChange
.
Raise
();
_airAttack
.
enabled
=
false
;
_earthAttack
.
enabled
=
false
;
_fireAttack
.
enabled
=
false
;
_waterAttack
.
enabled
=
false
;
break
;
}
_controller
.
SetMovementParameters
(
state
.
GetCurrentMovementState
());
_targetScript
.
InfuseElement
();
...
...
Assets/_Game/Scripts/Scriptable Object/PlayerState.cs
View file @
4b786555
...
...
@@ -38,19 +38,22 @@ namespace _Game.Scripts.Scriptable_Object
return
currentMoveState
;
}
public
void
ChangeCharges
(
int
amount
)
public
bool
ChangeCharges
(
int
amount
)
{
if
((
charges
+
amount
)
>
5
)
{
charges
=
5
;
return
true
;
}
else
if
((
charges
+
amount
)
<=
0
)
{
charges
=
0
;
UpdateElement
(
InfusedElement
.
None
);
return
false
;
}
else
{
charges
+=
amount
;
return
true
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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