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
846d4337
Commit
846d4337
authored
Jan 14, 2019
by
18김상언
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
데이터 그냥 float배열에 넣는거에서 dictionary에다가 enum(EnemyData)랑 그 값을 넣도록 수정함
parent
db7a76b3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
EnemyManager.cs
Assets/Scripts/Characters/EnemyManager.cs
+12
-6
No files found.
Assets/Scripts/Characters/EnemyManager.cs
View file @
846d4337
...
@@ -20,6 +20,9 @@ public class EnemyManager : Singleton<EnemyManager>
...
@@ -20,6 +20,9 @@ public class EnemyManager : Singleton<EnemyManager>
EpicItem
,
LegendaryItem
,
CommonAdd
,
RareAdd
,
EpicAdd
,
EpicItem
,
LegendaryItem
,
CommonAdd
,
RareAdd
,
EpicAdd
,
LegendaryAdd
}
LegendaryAdd
}
public
enum
EnemyData
{
Health
,
Weight
,
Height
,
Width
,
DetectRange
,
AtkRange
,
AtkDistance
,
AtkDelay
,
PjtSpeed
,
MoveSpeed
,
Damage
}
//Atk = Attack, Pjt = Projectile(투사체)
public
delegate
void
Action
();
public
delegate
void
Action
();
...
@@ -27,7 +30,7 @@ public class EnemyManager : Singleton<EnemyManager>
...
@@ -27,7 +30,7 @@ public class EnemyManager : Singleton<EnemyManager>
// dictionary
// dictionary
public
readonly
Dictionary
<
int
,
Dictionary
<
ItemType
,
int
>>
dropTableByID
;
public
readonly
Dictionary
<
int
,
Dictionary
<
ItemType
,
int
>>
dropTableByID
;
public
readonly
Dictionary
<
int
,
Dictionary
<
State
,
Action
>>
actionDictByID
;
public
readonly
Dictionary
<
int
,
Dictionary
<
State
,
Action
>>
actionDictByID
;
public
readonly
Dictionary
<
int
,
float
[
]
>
enemyDataByID
;
public
readonly
Dictionary
<
int
,
Dictionary
<
EnemyData
,
float
>
>
enemyDataByID
;
// method
// method
...
@@ -91,15 +94,13 @@ public class EnemyManager : Singleton<EnemyManager>
...
@@ -91,15 +94,13 @@ public class EnemyManager : Singleton<EnemyManager>
string
[]
cellValue
=
null
;
string
[]
cellValue
=
null
;
string
tableLine
=
null
;
string
tableLine
=
null
;
strReader
.
ReadLine
();
strReader
.
ReadLine
();
Dictionary
<
EnemyData
,
float
>
EnemyInfo
=
new
Dictionary
<
EnemyData
,
float
>();
while
((
tableLine
=
strReader
.
ReadLine
())
!=
null
)
while
((
tableLine
=
strReader
.
ReadLine
())
!=
null
)
{
{
cellValue
=
tableLine
.
Split
(
','
);
cellValue
=
tableLine
.
Split
(
','
);
int
enemyID
=
-
1
;
int
enemyID
=
-
1
;
float
[]
enemyData
=
{
0.0f
};
float
[]
enemyData
=
{
0.0f
};
//enemyData 배열에 있는 값 순서대로 에너미의 health, weight, height, width, detectRange, atkRange, atkDistance, atkDelay, pjtSpeed, moveSpeed, damage
//atk = attack, pjt = projectile(투사체)
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
++)
...
@@ -107,7 +108,12 @@ public class EnemyManager : Singleton<EnemyManager>
...
@@ -107,7 +108,12 @@ public class EnemyManager : Singleton<EnemyManager>
float
.
TryParse
(
cellValue
[
i
+
1
],
out
enemyData
[
i
]);
float
.
TryParse
(
cellValue
[
i
+
1
],
out
enemyData
[
i
]);
}
}
enemyDataByID
.
Add
(
enemyID
,
enemyData
);
for
(
int
i
=
0
;
i
<
12
;
i
++)
{
EnemyInfo
.
Add
((
EnemyData
)
i
,
enemyData
[
i
]);
}
enemyDataByID
.
Add
(
enemyID
,
EnemyInfo
);
}
}
}
}
}
}
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