Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Tommé Nöll
seedling
Commits
3ce0d6eb
Commit
3ce0d6eb
authored
Jul 01, 2019
by
Tommé Nöll
Browse files
Merge branch 'master' of
https://gitlab.fsi.hochschule-trier.de/noellt/seedling
parents
00b545f9
91008069
Changes
3
Hide whitespace changes
Inline
Side-by-side
Assets/Scripts/Character.cs
View file @
3ce0d6eb
...
@@ -30,7 +30,10 @@ public abstract class Character : MonoBehaviour, VariableSoundPlayer.SoundOwner
...
@@ -30,7 +30,10 @@ public abstract class Character : MonoBehaviour, VariableSoundPlayer.SoundOwner
public
VariableSoundPlayer
.
ActivateSoundDelegate
activateSound
{
get
;
set
;
}
=
delegate
{};
public
VariableSoundPlayer
.
ActivateSoundDelegate
activateSound
{
get
;
set
;
}
=
delegate
{};
public
bool
getGroundStatus
()
{
return
isGrounded
;
}
void
Awake
()
void
Awake
()
{
{
rigidbody
=
GetComponent
<
Rigidbody2D
>();
rigidbody
=
GetComponent
<
Rigidbody2D
>();
...
...
Assets/Scripts/Player/InputManager.cs
View file @
3ce0d6eb
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
public
class
InputManager
:
MonoBehaviour
public
class
InputManager
:
MonoBehaviour
{
{
public
Animator
animator
;
[
SerializeField
]
private
Player
player
=
null
;
[
SerializeField
]
private
Player
player
=
null
;
[
SerializeField
]
private
UI_SceneManager
scene
=
null
;
[
SerializeField
]
private
UI_SceneManager
scene
=
null
;
[
SerializeField
]
private
RopeSystem
ropesys
=
null
;
[
SerializeField
]
private
RopeSystem
ropesys
=
null
;
...
@@ -21,6 +22,16 @@ public class InputManager : MonoBehaviour
...
@@ -21,6 +22,16 @@ public class InputManager : MonoBehaviour
// Update is called once per frame
// Update is called once per frame
void
Update
()
void
Update
()
{
{
if
(
Input
.
GetButton
(
"Horizontal"
))
{
animator
.
SetFloat
(
"speed"
,
1F
);
}
if
(
Input
.
GetButtonUp
(
"Horizontal"
))
{
animator
.
SetFloat
(
"speed"
,
0F
);
}
if
(
Input
.
GetButtonDown
(
"Cancel"
))
if
(
Input
.
GetButtonDown
(
"Cancel"
))
{
{
scene
.
TogglePause
();
scene
.
TogglePause
();
...
@@ -30,11 +41,25 @@ public class InputManager : MonoBehaviour
...
@@ -30,11 +41,25 @@ public class InputManager : MonoBehaviour
{
{
return
;
return
;
}
}
if
(
Input
.
GetButtonDown
(
"Jump"
))
if
(
Input
.
GetButtonDown
(
"Jump"
))
{
{
animator
.
SetBool
(
"isJumping"
,
true
);
jump
=
true
;
jump
=
true
;
}
}
if
(
Input
.
GetButton
(
"Jump"
))
{
animator
.
SetBool
(
"isJumping"
,
true
);
jump
=
true
;
}
if
(
player
.
getGroundStatus
())
{
animator
.
SetBool
(
"isJumping"
,
false
);
}
if
(
Input
.
GetButtonDown
(
"Attack"
))
if
(
Input
.
GetButtonDown
(
"Attack"
))
{
{
attack
=
true
;
attack
=
true
;
...
...
Assets/Scripts/RopeSystem.cs
View file @
3ce0d6eb
...
@@ -140,6 +140,8 @@ public class RopeSystem : MonoBehaviour, VariableSoundPlayer.SoundOwner
...
@@ -140,6 +140,8 @@ public class RopeSystem : MonoBehaviour, VariableSoundPlayer.SoundOwner
if
(
hit
.
collider
.
GetComponentInParent
<
PullableObject
>()
!=
null
)
if
(
hit
.
collider
.
GetComponentInParent
<
PullableObject
>()
!=
null
)
{
{
ropeAttached
=
true
;
ropeAttached
=
true
;
ropePositions
.
Add
(
hit
.
point
);
wrapPointsLookup
.
Add
(
hit
.
point
,
0
);
springJoint
.
enabled
=
true
;
springJoint
.
enabled
=
true
;
springJoint
.
distance
=
Vector2
.
Distance
(
playerPosition
,
hit
.
point
);
springJoint
.
distance
=
Vector2
.
Distance
(
playerPosition
,
hit
.
point
);
springJoint
.
connectedBody
=
hit
.
collider
.
GetComponentInParent
<
Rigidbody2D
>();
springJoint
.
connectedBody
=
hit
.
collider
.
GetComponentInParent
<
Rigidbody2D
>();
...
...
Write
Preview
Supports
Markdown
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