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
four
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
31
Issues
31
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
gadig
four
Commits
15e510cd
Commit
15e510cd
authored
Nov 03, 2016
by
Andrew Van Buren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjusted walk particles and animation.
parent
ae59fabf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
33 deletions
+34
-33
Assets/prefabs/Player.prefab
Assets/prefabs/Player.prefab
+0
-0
Assets/scene/player_animation_test.unity
Assets/scene/player_animation_test.unity
+0
-0
Assets/script/WalkParticles.cs
Assets/script/WalkParticles.cs
+34
-33
Assets/sprite/animation/Player/Player.controller
Assets/sprite/animation/Player/Player.controller
+0
-0
No files found.
Assets/prefabs/Player.prefab
View file @
15e510cd
No preview for this file type
Assets/scene/player_animation_test.unity
View file @
15e510cd
No preview for this file type
Assets/script/WalkParticles.cs
View file @
15e510cd
using
UnityEngine
;
using
System.Collections
;
public
class
WalkParticles
:
MonoBehaviour
{
private
ParticleSystem
ps
;
private
ParticleSystem
.
EmissionModule
module
;
private
HeroMobility
hm
;
// Use this for initialization
void
Start
()
{
ps
=
GetComponentInChildren
<
ParticleSystem
>();
module
=
ps
.
emission
;
hm
=
GetComponent
<
HeroMobility
>();
}
// Update is called once per frame
void
LateUpdate
()
{
if
(
hm
.
deltaPos
.
sqrMagnitude
>
0
)
{
if
(!
ps
.
isPlaying
)
{
ps
.
Simulate
(
0.0f
,
true
,
false
);
module
.
enabled
=
true
;
ps
.
Play
();
}
}
else
{
if
(
ps
.
isPlaying
)
{
module
.
enabled
=
false
;
ps
.
Stop
();
}
}
}
}
using
UnityEngine
;
using
System.Collections
;
public
class
WalkParticles
:
MonoBehaviour
{
private
ParticleSystem
ps
;
private
ParticleSystem
.
EmissionModule
module
;
private
HeroMobility
hm
;
public
float
speedThreshold
=
0.001f
;
// Use this for initialization
void
Start
()
{
ps
=
GetComponentInChildren
<
ParticleSystem
>();
module
=
ps
.
emission
;
hm
=
GetComponent
<
HeroMobility
>();
}
// Update is called once per frame
void
LateUpdate
()
{
if
(
hm
.
deltaPos
.
sqrMagnitude
>
speedThreshold
)
{
if
(!
ps
.
isPlaying
)
{
ps
.
Simulate
(
0.0f
,
true
,
false
);
module
.
enabled
=
true
;
ps
.
Play
();
}
}
else
{
if
(
ps
.
isPlaying
)
{
module
.
enabled
=
false
;
ps
.
Stop
();
}
}
}
}
Assets/sprite/animation/Player/Player.controller
View file @
15e510cd
No preview for this file type
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