Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
tetra-tower
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Oenos
tetra-tower
Commits
bc4ab857
Commit
bc4ab857
authored
Feb 26, 2019
by
15김민규
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
순찰거리(patrolRange)가 0보다 클 때만 Idle 상태에서 속도를 얻음. 와리가리 문제 없어질 듯
parent
206d4042
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
ArcherIdle.cs
Assets/Scripts/Characters/Enemy/Animator State/ArcherIdle.cs
+5
-2
EnemyMeleeIdle.cs
...Scripts/Characters/Enemy/Animator State/EnemyMeleeIdle.cs
+4
-2
Scarecrow.cs
Assets/Scripts/Characters/Enemy/Scarecrow.cs
+0
-1
EnemyManager.cs
Assets/Scripts/EnemyManager.cs
+1
-0
No files found.
Assets/Scripts/Characters/Enemy/Animator State/ArcherIdle.cs
View file @
bc4ab857
...
...
@@ -23,7 +23,10 @@ public class ArcherIdle : StateMachineBehaviour
patrolSpeed
=
enemy
.
patrolSpeed
;
enemy
.
ChangeDir_noOption
(
NumeratedDir
.
Left
);
enemy
.
ChangeVelocityX_noOption
(
enemy
.
MoveDir
*
patrolSpeed
);
if
(
patrolRange
>
0
)
{
enemy
.
ChangeVelocityX_noOption
(
enemy
.
MoveDir
*
patrolSpeed
);
}
}
// OnStateUpdate is called on each Update frame between OnStateEnter and O nStateExit callbacks
...
...
@@ -34,7 +37,7 @@ public class ArcherIdle : StateMachineBehaviour
animator
.
SetTrigger
(
"TrackTrigger"
);
return
;
}
if
(!
enemy
.
MovementLock
)
if
(!
enemy
.
MovementLock
&&
patrolRange
>
0
)
{
float
span
=
animatorRoot
.
position
.
x
-
origin
.
x
;
...
...
Assets/Scripts/Characters/Enemy/Animator State/EnemyMeleeIdle.cs
View file @
bc4ab857
...
...
@@ -21,7 +21,9 @@ public class EnemyMeleeIdle : StateMachineBehaviour {
patrolSpeed
=
enemy
.
patrolSpeed
;
enemy
.
ChangeDir_noOption
(
NumeratedDir
.
Left
);
enemy
.
ChangeVelocityX_noOption
(
enemy
.
MoveDir
*
patrolSpeed
);
if
(
enemy
.
patrolRange
>
0
)
{
enemy
.
ChangeVelocityX_noOption
(
enemy
.
MoveDir
*
patrolSpeed
);
}
}
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
...
...
@@ -31,7 +33,7 @@ public class EnemyMeleeIdle : StateMachineBehaviour {
animator
.
SetTrigger
(
"TrackTrigger"
);
return
;
}
if
(!
enemy
.
MovementLock
)
if
(!
enemy
.
MovementLock
&&
patrolRange
>
0
)
{
float
span
=
animatorRoot
.
position
.
x
-
origin
.
x
;
...
...
Assets/Scripts/Characters/Enemy/Scarecrow.cs
View file @
bc4ab857
...
...
@@ -15,7 +15,6 @@ public class Scarecrow : Enemy {
{
if
(
neverDie
)
{
prevHealth
=
maxHealth
;
currHealth
=
maxHealth
;
}
else
...
...
Assets/Scripts/EnemyManager.cs
View file @
bc4ab857
...
...
@@ -56,6 +56,7 @@ public class EnemyManager : Singleton<EnemyManager>
Transform
enemySpots
=
MapManager
.
currentRoom
.
roomInGame
.
transform
.
Find
(
"enemy spot"
);
foreach
(
Transform
enemySpot
in
enemySpots
)
{
if
(!
enemySpot
.
gameObject
.
activeSelf
)
{
continue
;
}
GameObject
enemy
=
enemySpot
.
gameObject
.
GetComponent
<
enemySpot
>().
enemyPrefab
;
foreach
(
Transform
location
in
enemySpot
)
{
...
...
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