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
cf901956
Commit
cf901956
authored
Feb 27, 2019
by
15김민규
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
스태츄 코드 작성. 근데 animator state 어디갔냐
parent
2984e326
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
157 additions
and
76 deletions
+157
-76
Goblin.prefab
Assets/Prefabs/Characters/Enemy/Goblin.prefab
+25
-3
PlayScene.unity
Assets/Scenes/PlayScene.unity
+91
-59
Enemy.cs
Assets/Scripts/Characters/Enemy/Enemy.cs
+11
-9
Scarecrow.cs
Assets/Scripts/Characters/Enemy/Scarecrow.cs
+15
-3
EnemyManager.cs
Assets/Scripts/EnemyManager.cs
+0
-1
GameManager.cs
Assets/Scripts/GameManager.cs
+15
-1
No files found.
Assets/Prefabs/Characters/Enemy/Goblin.prefab
View file @
cf901956
...
...
@@ -22,6 +22,7 @@ GameObject:
-
component
:
{
fileID
:
212540714587432698
}
-
component
:
{
fileID
:
95413729269184064
}
-
component
:
{
fileID
:
114118738857420128
}
-
component
:
{
fileID
:
114537163463468708
}
m_Layer
:
0
m_Name
:
Body
m_TagString
:
Untagged
...
...
@@ -61,7 +62,7 @@ GameObject:
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
m_IsActive
:
0
---
!u!1
&1734061800721222
GameObject
:
m_ObjectHideFlags
:
1
...
...
@@ -284,7 +285,7 @@ MonoBehaviour:
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1225288737757304
}
m_Enabled
:
1
m_Enabled
:
0
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
a11d071a77ab21c48882c6c6e4db8f17
,
type
:
3
}
m_Name
:
...
...
@@ -301,7 +302,6 @@ MonoBehaviour:
-
0.5
movementLock
:
0
attackRange
:
1.2
rotatable
:
1
WallTest
:
CliffTest
:
---
!u!114
&114173716467154830
...
...
@@ -329,6 +329,28 @@ MonoBehaviour:
m_EditorClassIdentifier
:
damage
:
4
isBumpAttack
:
0
---
!u!114
&114537163463468708
MonoBehaviour
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1225288737757304
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
bf69b9b0b3af3664e89e16eab14c1b0c
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
debuffState
:
monsterID
:
251
maxHealth
:
3
weight
:
1
patrolRange
:
0
noticeRange
:
0
patrolSpeed
:
0
trackSpeed
:
0
knockbackPercentage
:
[]
movementLock
:
0
scarecrow_or_statue
:
0
---
!u!114
&114851997656688694
MonoBehaviour
:
m_ObjectHideFlags
:
1
...
...
Assets/Scenes/PlayScene.unity
View file @
cf901956
...
...
@@ -213,12 +213,12 @@ Prefab:
-
target
:
{
fileID
:
114513527214926720
,
guid
:
408297f86a787fb499fef71b2a40e626
,
type
:
2
}
propertyPath
:
cam
value
:
value
:
objectReference
:
{
fileID
:
743604584
}
-
target
:
{
fileID
:
114513527214926720
,
guid
:
408297f86a787fb499fef71b2a40e626
,
type
:
2
}
propertyPath
:
can
value
:
value
:
objectReference
:
{
fileID
:
2088383384
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
408297f86a787fb499fef71b2a40e626
,
type
:
2
}
...
...
@@ -580,6 +580,80 @@ GameObject:
m_CorrespondingSourceObject
:
{
fileID
:
1623439448163086
,
guid
:
3d077a5f727dd1e4780e9265ed26e036
,
type
:
2
}
m_PrefabInternal
:
{
fileID
:
650104063
}
---
!u!1001
&549384201
Prefab
:
m_ObjectHideFlags
:
0
serializedVersion
:
2
m_Modification
:
m_TransformParent
:
{
fileID
:
0
}
m_Modifications
:
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalPosition.x
value
:
11.29
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalPosition.y
value
:
-17.94
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalPosition.z
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalRotation.x
value
:
-0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalRotation.y
value
:
-0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalRotation.z
value
:
-0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalRotation.w
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_RootOrder
value
:
14
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
114118738857420128
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_Enabled
value
:
0
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
m_IsPrefabAsset
:
0
---
!u!1
&549384202
stripped
GameObject
:
m_CorrespondingSourceObject
:
{
fileID
:
1225288737757304
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
m_PrefabInternal
:
{
fileID
:
549384201
}
---
!u!114
&549384203
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
549384202
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
bf69b9b0b3af3664e89e16eab14c1b0c
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
debuffState
:
monsterID
:
251
maxHealth
:
3
weight
:
1
patrolRange
:
0
noticeRange
:
0
patrolSpeed
:
0
trackSpeed
:
0
knockbackPercentage
:
[]
movementLock
:
0
scarecrow_or_statue
:
0
---
!u!1001
&579652633
Prefab
:
m_ObjectHideFlags
:
0
...
...
@@ -622,63 +696,21 @@ Prefab:
-
target
:
{
fileID
:
114772635349595938
,
guid
:
7fec52078de87f74abe791494596a804
,
type
:
2
}
propertyPath
:
frameSuper
value
:
value
:
objectReference
:
{
fileID
:
705690561
}
-
target
:
{
fileID
:
114772635349595938
,
guid
:
7fec52078de87f74abe791494596a804
,
type
:
2
}
propertyPath
:
stoneSuper
value
:
value
:
objectReference
:
{
fileID
:
871841152
}
-
target
:
{
fileID
:
114772635349595938
,
guid
:
7fec52078de87f74abe791494596a804
,
type
:
2
}
propertyPath
:
lifeStoneUI
value
:
value
:
objectReference
:
{
fileID
:
1206751492
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
7fec52078de87f74abe791494596a804
,
type
:
2
}
m_IsPrefabAsset
:
0
---
!u!1001
&604778652
Prefab
:
m_ObjectHideFlags
:
0
serializedVersion
:
2
m_Modification
:
m_TransformParent
:
{
fileID
:
0
}
m_Modifications
:
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalPosition.x
value
:
11.29
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalPosition.y
value
:
-17.94
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalPosition.z
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalRotation.x
value
:
-0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalRotation.y
value
:
-0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalRotation.z
value
:
-0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_LocalRotation.w
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4639192263818050
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
m_RootOrder
value
:
15
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
m_IsPrefabAsset
:
0
---
!u!1001
&650104063
Prefab
:
m_ObjectHideFlags
:
0
...
...
@@ -721,7 +753,7 @@ Prefab:
-
target
:
{
fileID
:
114880704145925944
,
guid
:
3d077a5f727dd1e4780e9265ed26e036
,
type
:
2
}
propertyPath
:
comboUI
value
:
value
:
objectReference
:
{
fileID
:
1504194384
}
-
target
:
{
fileID
:
114402380471012178
,
guid
:
3d077a5f727dd1e4780e9265ed26e036
,
type
:
2
}
...
...
@@ -824,8 +856,8 @@ MonoBehaviour:
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
1077351063
,
guid
:
f70555f144d8491a825f0804e09c671c
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
m_Name
:
m_EditorClassIdentifier
:
m_HorizontalAxis
:
Horizontal
m_VerticalAxis
:
Vertical
m_SubmitButton
:
Submit
...
...
@@ -842,8 +874,8 @@ MonoBehaviour:
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
-619905303
,
guid
:
f70555f144d8491a825f0804e09c671c
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
m_Name
:
m_EditorClassIdentifier
:
m_FirstSelected
:
{
fileID
:
0
}
m_sendNavigationEvents
:
1
m_DragThreshold
:
10
...
...
@@ -907,7 +939,7 @@ Prefab:
-
target
:
{
fileID
:
114287389059791124
,
guid
:
e6794ab8e2e4c6340a23b382e9497cbb
,
type
:
2
}
propertyPath
:
ui
value
:
value
:
objectReference
:
{
fileID
:
1206751492
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
e6794ab8e2e4c6340a23b382e9497cbb
,
type
:
2
}
...
...
@@ -1302,7 +1334,7 @@ Prefab:
-
target
:
{
fileID
:
114939219159237616
,
guid
:
62a83d11a7addc342ad436145784e698
,
type
:
2
}
propertyPath
:
coolUI
value
:
value
:
objectReference
:
{
fileID
:
1864071040
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
62a83d11a7addc342ad436145784e698
,
type
:
2
}
...
...
@@ -1606,7 +1638,7 @@ Prefab:
-
target
:
{
fileID
:
114102296575005222
,
guid
:
b67c2e6425443f14c85899a92710bf3f
,
type
:
2
}
propertyPath
:
player
value
:
value
:
objectReference
:
{
fileID
:
489222433
}
-
target
:
{
fileID
:
4354682656029732
,
guid
:
b67c2e6425443f14c85899a92710bf3f
,
type
:
2
}
propertyPath
:
m_LocalPosition.x
...
...
@@ -1667,8 +1699,8 @@ MonoBehaviour:
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
1301386320
,
guid
:
f70555f144d8491a825f0804e09c671c
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
m_Name
:
m_EditorClassIdentifier
:
m_IgnoreReversedGraphics
:
1
m_BlockingObjects
:
0
m_BlockingMask
:
...
...
@@ -1683,8 +1715,8 @@ MonoBehaviour:
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
1980459831
,
guid
:
f70555f144d8491a825f0804e09c671c
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
m_Name
:
m_EditorClassIdentifier
:
m_UiScaleMode
:
0
m_ReferencePixelsPerUnit
:
100
m_ScaleFactor
:
1
...
...
Assets/Scripts/Characters/Enemy/Enemy.cs
View file @
cf901956
...
...
@@ -6,7 +6,6 @@ using Random = UnityEngine.Random;
public
class
Enemy
:
MonoBehaviour
{
// data
// debuff
readonly
float
[]
immunity_time
=
new
float
[(
int
)
EnemyDebuffCase
.
END_POINTER
]
{
0.0f
,
3.0f
,
6.0f
,
6.0f
,
6.0f
};
[
SerializeField
]
...
...
@@ -252,7 +251,13 @@ public class Enemy : MonoBehaviour {
// Animation Event
// - When dead
public
void
DeadEvent
()
public
virtual
void
DeadEvent
()
{
ResetForPool
();
DropItem
();
}
public
void
ResetForPool
()
{
if
(
transform
.
parent
.
GetComponentInChildren
<
HPBar
>())
transform
.
parent
.
GetComponentInChildren
<
HPBar
>().
Inactivate
();
...
...
@@ -260,10 +265,12 @@ public class Enemy : MonoBehaviour {
transform
.
parent
.
SetParent
(
null
);
StopAllCoroutines
();
enemyManager
.
EnemyDeadCount
++;
CurrHealth
=
maxHealth
;
Invisible
=
false
;
// Drop 아이템 결정. 인덱스 별 아이템은 맨 밑에 서술
}
private
void
DropItem
()
{
if
(
dropTable
==
null
)
{
return
;
}
float
denominator
=
dropTable
[
dropTable
.
Length
-
1
];
...
...
@@ -302,11 +309,6 @@ public class Enemy : MonoBehaviour {
inventoryManager
.
AddonInstantiate
((
ItemQuality
)(
indexOfItem
-
12
),
transform
.
parent
.
position
,
EnemyManager
.
dropObjStrength
);
}
}
public
void
aaa
()
{
Debug
.
Log
(
"aaa"
);
}
}
/* Item Drop Index
...
...
Assets/Scripts/Characters/Enemy/Scarecrow.cs
View file @
cf901956
...
...
@@ -3,17 +3,16 @@ using System.Collections.Generic;
using
UnityEngine
;
public
class
Scarecrow
:
Enemy
{
public
bool
neverDie
;
public
bool
scarecrow_or_statue
;
// true: scarecrow
public
override
void
GetHit
(
PlayerAttackInfo
attack
)
{
if
(
Invisible
)
{
return
;
}
float
prevHealth
=
CurrHealth
;
CurrHealth
-=
attack
.
damage
;
if
(
CurrHealth
<=
0
)
{
if
(
neverDi
e
)
if
(
scarecrow_or_statu
e
)
{
CurrHealth
=
maxHealth
;
}
...
...
@@ -27,4 +26,17 @@ public class Scarecrow : Enemy {
animator
.
SetTrigger
(
"DamagedTrigger"
);
}
public
override
void
DeadEvent
()
{
if
(
scarecrow_or_statue
)
{
base
.
DeadEvent
();
}
else
{
MapManager
.
Instance
.
UpgradeRoom
(
RoomType
.
Gold
);
Destroy
(
transform
.
parent
.
gameObject
);
}
}
}
Assets/Scripts/EnemyManager.cs
View file @
cf901956
...
...
@@ -12,7 +12,6 @@ public class EnemyManager : Singleton<EnemyManager>
public
static
readonly
float
goldPer
=
0.5f
;
public
static
readonly
int
ameNum
=
0
;
public
static
readonly
float
dropObjStrength
=
1f
;
// hold player for animation
//public GameObject Player { get; private set; } // Use GameManager.Instance.player instead
...
...
Assets/Scripts/GameManager.cs
View file @
cf901956
...
...
@@ -12,7 +12,7 @@ public class GameManager : Singleton<GameManager> {
public
static
GameState
gameState
;
public
bool
isTutorial
=
false
;
private
bool
statueEvent
=
false
;
/// <summary>
/// Position where portal would spawn player.
/// </summary>
...
...
@@ -151,5 +151,19 @@ public class GameManager : Singleton<GameManager> {
}
}
CountLeftRoom
();
if
(!
statueEvent
&&
MapManager
.
Instance
.
clearedRoomCount
==
9
)
{
foreach
(
Transform
obj
in
MapManager
.
currentRoom
.
transform
)
{
if
(
obj
.
gameObject
.
GetComponent
<
EnemyGround
>()
!=
null
&&
obj
.
gameObject
.
GetComponent
<
SpriteRenderer
>().
isVisible
)
{
Vector3
pos
=
obj
.
position
;
obj
.
gameObject
.
GetComponent
<
Enemy
>().
ResetForPool
();
// Instantiate;
statueEvent
=
true
;
}
}
}
}
}
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