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
5472a6ec
Commit
5472a6ec
authored
Feb 14, 2019
by
18류지석
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
체력바 정상적으로 사라짐
parent
cc5d47c1
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
549 deletions
+50
-549
PlayScene.unity
Assets/Scenes/PlayScene.unity
+42
-544
Enemy.cs
Assets/Scripts/Characters/Enemy/Enemy.cs
+2
-0
HPBar.cs
Assets/Scripts/HPBar.cs
+6
-5
No files found.
Assets/Scenes/PlayScene.unity
View file @
5472a6ec
This diff is collapsed.
Click to expand it.
Assets/Scripts/Characters/Enemy/Enemy.cs
View file @
5472a6ec
...
...
@@ -141,6 +141,8 @@ public class Enemy : MonoBehaviour {
// Dead
public
void
DeadEvent
()
{
if
(
transform
.
parent
.
GetComponentInChildren
<
HPBar
>())
transform
.
parent
.
GetComponentInChildren
<
HPBar
>().
Inactivate
();
transform
.
parent
.
gameObject
.
SetActive
(
false
);
enemyManager
.
EnemyDeadCount
++;
// 다른 enemy로 인해 소환되는 enemy가 추가될 경우 여기를 건드려야 함
...
...
Assets/Scripts/HPBar.cs
View file @
5472a6ec
...
...
@@ -36,10 +36,11 @@ public class HPBar : MonoBehaviour {
instRed
.
transform
.
localScale
=
new
Vector3
((
width
/
instRed
.
GetComponent
<
SpriteRenderer
>().
size
.
x
-
height
/
instRed
.
GetComponent
<
SpriteRenderer
>().
size
.
y
*
0.2f
)
*
cur
,
height
/
instRed
.
GetComponent
<
SpriteRenderer
>().
size
.
y
*
0.8f
,
1
);
instRed
.
transform
.
position
=
transform
.
parent
.
position
+
new
Vector3
((
width
-
height
*
0.2f
)
/
-
2f
,
yOffset
,
0
);
}
else
{
instBor
.
SetActive
(
false
);
instRed
.
SetActive
(
false
);
}
}
public
void
Inactivate
()
{
instBor
.
SetActive
(
false
);
instRed
.
SetActive
(
false
);
}
}
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