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
91008069
Commit
91008069
authored
Jul 01, 2019
by
Chrysis248
Browse files
jump animation seedling
parent
a813ff8a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Assets/Scripts/Character.cs
View file @
91008069
...
...
@@ -30,7 +30,10 @@ public abstract class Character : MonoBehaviour, VariableSoundPlayer.SoundOwner
public
VariableSoundPlayer
.
ActivateSoundDelegate
activateSound
{
get
;
set
;
}
=
delegate
{};
public
bool
getGroundStatus
()
{
return
isGrounded
;
}
void
Awake
()
{
rigidbody
=
GetComponent
<
Rigidbody2D
>();
...
...
Assets/Scripts/Player/InputManager.cs
View file @
91008069
...
...
@@ -2,6 +2,7 @@
public
class
InputManager
:
MonoBehaviour
{
public
Animator
animator
;
[
SerializeField
]
private
Player
player
=
null
;
[
SerializeField
]
private
UI_SceneManager
scene
=
null
;
[
SerializeField
]
private
RopeSystem
ropesys
=
null
;
...
...
@@ -21,6 +22,16 @@ public class InputManager : MonoBehaviour
// Update is called once per frame
void
Update
()
{
if
(
Input
.
GetButton
(
"Horizontal"
))
{
animator
.
SetFloat
(
"speed"
,
1F
);
}
if
(
Input
.
GetButtonUp
(
"Horizontal"
))
{
animator
.
SetFloat
(
"speed"
,
0F
);
}
if
(
Input
.
GetButtonDown
(
"Cancel"
))
{
scene
.
TogglePause
();
...
...
@@ -30,11 +41,25 @@ public class InputManager : MonoBehaviour
{
return
;
}
if
(
Input
.
GetButtonDown
(
"Jump"
))
{
animator
.
SetBool
(
"isJumping"
,
true
);
jump
=
true
;
}
if
(
Input
.
GetButton
(
"Jump"
))
{
animator
.
SetBool
(
"isJumping"
,
true
);
jump
=
true
;
}
if
(
player
.
getGroundStatus
())
{
animator
.
SetBool
(
"isJumping"
,
false
);
}
if
(
Input
.
GetButtonDown
(
"Attack"
))
{
attack
=
true
;
...
...
Assets/Scripts/RopeSystem.cs
View file @
91008069
...
...
@@ -140,6 +140,8 @@ public class RopeSystem : MonoBehaviour, VariableSoundPlayer.SoundOwner
if
(
hit
.
collider
.
GetComponentInParent
<
PullableObject
>()
!=
null
)
{
ropeAttached
=
true
;
ropePositions
.
Add
(
hit
.
point
);
wrapPointsLookup
.
Add
(
hit
.
point
,
0
);
springJoint
.
enabled
=
true
;
springJoint
.
distance
=
Vector2
.
Distance
(
playerPosition
,
hit
.
point
);
springJoint
.
connectedBody
=
hit
.
collider
.
GetComponentInParent
<
Rigidbody2D
>();
...
...
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