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
B
Birb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
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
gadig
Birb
Commits
2122d06a
Commit
2122d06a
authored
Mar 08, 2017
by
Tanner Grehawick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
walk animation
parent
b580c2a4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
Assets/Art/Kiwi/Kiwi.controller
Assets/Art/Kiwi/Kiwi.controller
+0
-0
Assets/Prefabs/Player.prefab
Assets/Prefabs/Player.prefab
+0
-0
Assets/Scripts/Birb/Dash.cs
Assets/Scripts/Birb/Dash.cs
+1
-4
Assets/Scripts/Player/AbstractBehavior.cs
Assets/Scripts/Player/AbstractBehavior.cs
+1
-1
Assets/Scripts/Player/Walk.cs
Assets/Scripts/Player/Walk.cs
+5
-2
No files found.
Assets/Art/Kiwi/Kiwi.controller
100644 → 100755
View file @
2122d06a
No preview for this file type
Assets/Prefabs/Player.prefab
View file @
2122d06a
No preview for this file type
Assets/Scripts/Birb/Dash.cs
View file @
2122d06a
...
...
@@ -40,9 +40,6 @@ public class Dash : AbstractBehavior {
Activate
();
}
UpdateUI
();
if
(
isDashing
)
{
print
(
walk
.
enabled
);
}
}
// Should be called every frame
...
...
@@ -110,7 +107,7 @@ public class Dash : AbstractBehavior {
// Wait
yield
return
new
WaitForEndOfFrame
();
}
if
(
walk
!=
null
)
{
walk
.
enabled
=
true
;
}
...
...
Assets/Scripts/Player/AbstractBehavior.cs
View file @
2122d06a
...
...
@@ -12,7 +12,7 @@ public abstract class AbstractBehavior : MonoBehaviour {
protected
Rigidbody2D
body
;
protected
virtual
void
Awake
(){
animator
=
GetComponent
<
Animator
>
();
animator
=
GetComponent
InChildren
<
Animator
>
();
animator
.
logWarnings
=
false
;
inputState
=
GetComponent
<
InputState
>
();
collisionState
=
GetComponent
<
CollisionState
>();
...
...
Assets/Scripts/Player/Walk.cs
View file @
2122d06a
...
...
@@ -19,8 +19,11 @@ public class Walk : AbstractBehavior {
private
float
rightTime
=
0
;
private
float
leftTime
=
0
;
// Use this for initialization
void
Start
()
{
void
Update
()
{
Vector2
vel
=
body
.
velocity
;
float
hspeed
=
Mathf
.
Abs
(
vel
.
x
/
speed
);
animator
.
SetFloat
(
"horizontal speed"
,
hspeed
);
print
(
hspeed
);
}
// Update is called once per frame
...
...
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