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
e83f329e
You need to sign in or sign up before continuing.
Commit
e83f329e
authored
Jan 18, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'enemy'
# Conflicts: # Assets/Scripts/Characters/EnemyManager.cs
parents
ce71b605
3da70bd7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
20 deletions
+27
-20
EnemyManager.cs
Assets/Scripts/Characters/EnemyManager.cs
+19
-20
Enumerators.cs
Assets/Scripts/Enumerators.cs
+8
-0
No files found.
Assets/Scripts/Characters/EnemyManager.cs
View file @
e83f329e
...
@@ -15,14 +15,16 @@ public class EnemyManager : Singleton<EnemyManager>
...
@@ -15,14 +15,16 @@ public class EnemyManager : Singleton<EnemyManager>
Attack
Attack
}
// 상속을 통해 수정할 가능성 높음. 염두만 해 두자.
}
// 상속을 통해 수정할 가능성 높음. 염두만 해 두자.
public
enum
ItemType
{
None
,
OneStone
,
TwoStone
,
ThreeStone
,
FourStone
,
FiveStone
,
GoldPotion
,
AmethystPotion
,
CommonItem
,
RareItem
,
EpicItem
,
LegendaryItem
,
CommonAdd
,
RareAdd
,
EpicAdd
,
LegendaryAdd
}
public
enum
EnemyData
{
Health
,
Weight
,
Height
,
Width
,
DetectRange
,
public
enum
EnemyData
{
Health
,
Weight
,
Height
,
Width
,
DetectRange
,
AtkRange
,
AtkDistance
,
AtkDelay
,
PjtSpeed
,
MoveSpeed
,
AtkRange
,
AtkDistance
,
AtkDelay
,
PjtSpeed
,
MoveSpeed
,
Damage
}
//Atk = Attack, Pjt = Projectile(투사체)
Damage
}
//Atk = Attack, Pjt = Projectile(투사체)
/* 기본적으로 각 경우에 대해 가지는 값은 양수일 것
* 하지만 특별한 경우가 있음
* 1. DetectRange(감지 범위) : DetectRange가 -1이면 방 전체를 감지한다는 뜻. -2이면 현재 에너미가 있는 플랫폼 전체, -3이면 플랫폼 전방만 감지를 뜻 함.
* 2. AtkRange(공격 범위) : -1이면 현재 위치한 플랫폼 전체를 의미, -2이면 플랫폼 전방만 의미.
* 3. AtkDistance(공격 사거리) : -1이면 현재 위치한 플랫폼 끝까지 의미.
* 4. AtkDelay(공격 딜레이) : -1이면 무한 즉, 단 1회 공격함.
*/
public
delegate
void
Action
();
public
delegate
void
Action
();
...
@@ -32,12 +34,10 @@ public class EnemyManager : Singleton<EnemyManager>
...
@@ -32,12 +34,10 @@ public class EnemyManager : Singleton<EnemyManager>
public
readonly
Dictionary
<
int
,
Dictionary
<
State
,
Action
>>
actionDictByID
;
public
readonly
Dictionary
<
int
,
Dictionary
<
State
,
Action
>>
actionDictByID
;
public
readonly
Dictionary
<
int
,
Dictionary
<
EnemyData
,
float
>>
enemyDataByID
;
public
readonly
Dictionary
<
int
,
Dictionary
<
EnemyData
,
float
>>
enemyDataByID
;
// standard enemy prefab
public
GameObject
enemyPrefab
;
public
GameObject
enemyPrefab
;
// method
// constructor
// method
protected
EnemyManager
()
// constructor
protected
EnemyManager
()
{
{
string
dropTableDataPath
=
""
;
string
dropTableDataPath
=
""
;
string
actionTableDataPath
=
""
;
string
actionTableDataPath
=
""
;
...
@@ -107,7 +107,7 @@ public class EnemyManager : Singleton<EnemyManager>
...
@@ -107,7 +107,7 @@ public class EnemyManager : Singleton<EnemyManager>
int
.
TryParse
(
cellValue
[
0
],
out
enemyID
);
int
.
TryParse
(
cellValue
[
0
],
out
enemyID
);
for
(
int
i
=
0
;
i
<
11
;
i
++)
for
(
int
i
=
0
;
i
<
11
;
i
++)
{
{
float
.
TryParse
(
cellValue
[
i
+
1
],
out
enemyData
[
i
]);
float
.
TryParse
(
cellValue
[
i
+
2
],
out
enemyData
[
i
]);
}
}
for
(
int
i
=
0
;
i
<
12
;
i
++)
for
(
int
i
=
0
;
i
<
12
;
i
++)
...
@@ -118,12 +118,11 @@ public class EnemyManager : Singleton<EnemyManager>
...
@@ -118,12 +118,11 @@ public class EnemyManager : Singleton<EnemyManager>
enemyDataByID
.
Add
(
enemyID
,
EnemyInfo
);
enemyDataByID
.
Add
(
enemyID
,
EnemyInfo
);
}
}
}
}
// called by gameManager to Spawn enemy
// called by gameManager to Spawn enemy
// little temporary. Many change will be exist.
// little temporary. Many change will be exist.
public
void
SpawnEnemy
()
public
void
SpawnEnemy
()
{
{
Vector2
playerPosition
=
GameObject
.
Find
(
"Player"
).
transform
.
position
;
Vector2
playerPosition
=
GameObject
.
Find
(
"Player"
).
transform
.
position
;
Instantiate
(
enemyPrefab
,
playerPosition
+
new
Vector2
(
7
,
0
),
Quaternion
.
identity
);
Instantiate
(
enemyPrefab
,
playerPosition
+
new
Vector2
(
7
,
0
),
Quaternion
.
identity
);
}
}
}
}
Assets/Scripts/Enumerators.cs
View file @
e83f329e
...
@@ -20,3 +20,11 @@ public enum LifeStoneType
...
@@ -20,3 +20,11 @@ public enum LifeStoneType
Gold
=
2
,
Gold
=
2
,
Amethyst
=
3
Amethyst
=
3
}
}
public
enum
ItemType
{
None
,
OneStone
,
TwoStone
,
ThreeStone
,
FourStone
,
FiveStone
,
GoldPotion
,
AmethystPotion
,
StudyItem
,
OrdinaryItem
,
SuperiorItem
,
MasterPieceItem
,
StudyAdd
,
OrdinaryAdd
,
SuperiorAdd
,
MasterpieceAdd
}
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