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
6418a996
Commit
6418a996
authored
Jan 03, 2019
by
18김상언
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EnemyManager의 LoadDropTable() 코드 작성함
민규 킴의 다음 지시를 머기하겠음
parent
eb02ff1b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
EnemyManager.cs
Assets/Scripts/Characters/EnemyManager.cs
+20
-2
No files found.
Assets/Scripts/Characters/EnemyManager.cs
View file @
6418a996
...
@@ -11,7 +11,7 @@ public class EnemyManager : Singleton<EnemyManager> {
...
@@ -11,7 +11,7 @@ public class EnemyManager : Singleton<EnemyManager> {
public
delegate
void
Action
<
T
>();
public
delegate
void
Action
<
T
>();
private
Dictionary
<
uint
,
List
<
int
[
]>
>
dropTableByID
;
private
Dictionary
<
uint
,
int
[
]
>
dropTableByID
;
private
Dictionary
<
uint
,
List
<
int
[
]>
>
actionDictByID
;
private
Dictionary
<
uint
,
List
<
int
[
]>
>
actionDictByID
;
protected
EnemyManager
()
{
protected
EnemyManager
()
{
...
@@ -21,9 +21,27 @@ public class EnemyManager : Singleton<EnemyManager> {
...
@@ -21,9 +21,27 @@ public class EnemyManager : Singleton<EnemyManager> {
LoadDropTable
(
dropTableDataPath
);
LoadDropTable
(
dropTableDataPath
);
LoadActionTable
(
actionTableDataPath
);
LoadActionTable
(
actionTableDataPath
);
}
}
private
void
LoadDropTable
(
string
dataPath
)
{
private
void
LoadDropTable
(
string
dataPath
)
{
StreamReader
strReader
=
new
StreamReader
(
dataPath
,
Encoding
.
UTF8
);
string
[]
cellValue
=
null
;
//csv파일 한 행에 포함되는 칸들의 값 넣을 배열
string
tableLine
=
null
;
//파일 한 행
strReader
.
ReadLine
();
//첫 줄 스킵
while
(
tableLine
=
strReader
.
ReadLine
()
!=
null
)
{
if
(
string
.
IsNullOrEmpty
(
tableLine
))
return
;
//행이 비었는지 체크
cellValue
=
tableLine
.
Split
(
','
);
int
monsterID
=
cellValue
[
0
];
//monster가 가진 ID
int
itemID
=
cellValue
[
2
];
//드랍하는 item의 ID
int
dropWeight
=
cellValue
[
3
];
//드랍할 확률
int
[]
itemDrop
=
new
int
[]
{
itemID
,
dropWeight
};
dropTableByID
.
Add
(
monsterID
,
itemDrop
);
}
}
}
private
void
LoadActionTable
(
string
dataPath
)
{
private
void
LoadActionTable
(
string
dataPath
)
{
}
}
...
...
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