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
0a4852f5
Commit
0a4852f5
authored
Jan 03, 2019
by
18김상언
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EnemyManager 수정된 것
parent
6418a996
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
EnemyManager.cs
Assets/Scripts/Characters/EnemyManager.cs
+21
-9
No files found.
Assets/Scripts/Characters/EnemyManager.cs
View file @
0a4852f5
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine
;
using
System.IO
;
using
System.Text
;
using
System
;
public
class
EnemyManager
:
Singleton
<
EnemyManager
>
{
public
class
EnemyManager
:
Singleton
<
EnemyManager
>
public
enum
State
{
{
public
enum
State
{
Idle
,
Idle
,
Track
,
Track
,
Attack
Attack
...
@@ -14,14 +19,15 @@ public class EnemyManager : Singleton<EnemyManager> {
...
@@ -14,14 +19,15 @@ public class EnemyManager : Singleton<EnemyManager> {
private
Dictionary
<
uint
,
int
[
]>
dropTableByID
;
private
Dictionary
<
uint
,
int
[
]>
dropTableByID
;
private
Dictionary
<
uint
,
List
<
int
[
]>
>
actionDictByID
;
private
Dictionary
<
uint
,
List
<
int
[
]>
>
actionDictByID
;
protected
EnemyManager
()
{
protected
EnemyManager
()
{
string
dropTableDataPath
=
null
;
string
dropTableDataPath
=
null
;
string
actionTableDataPath
=
null
;
string
actionTableDataPath
=
null
;
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
);
StreamReader
strReader
=
new
StreamReader
(
dataPath
,
Encoding
.
UTF8
);
...
@@ -29,20 +35,26 @@ public class EnemyManager : Singleton<EnemyManager> {
...
@@ -29,20 +35,26 @@ public class EnemyManager : Singleton<EnemyManager> {
string
tableLine
=
null
;
//파일 한 행
string
tableLine
=
null
;
//파일 한 행
strReader
.
ReadLine
();
//첫 줄 스킵
strReader
.
ReadLine
();
//첫 줄 스킵
while
(
tableLine
=
strReader
.
ReadLine
()
!=
null
)
while
(
(
tableLine
=
strReader
.
ReadLine
())
!=
null
)
{
{
if
(
string
.
IsNullOrEmpty
(
tableLine
))
return
;
//행이 비었는지 체크
if
(
string
.
IsNullOrEmpty
(
tableLine
))
return
;
//행이 비었는지 체크
cellValue
=
tableLine
.
Split
(
','
);
cellValue
=
tableLine
.
Split
(
','
);
int
monsterID
=
cellValue
[
0
];
//monster가 가진 ID
int
itemID
=
cellValue
[
2
];
//드랍하는 item의 ID
uint
monsterID
=
0
;
int
dropWeight
=
cellValue
[
3
];
//드랍할 확률
int
itemID
=
0
,
dropWeight
=
0
;
uint
.
TryParse
(
cellValue
[
0
],
out
monsterID
);
int
.
TryParse
(
cellValue
[
2
],
out
itemID
);
int
.
TryParse
(
cellValue
[
3
],
out
dropWeight
);
int
[]
itemDrop
=
new
int
[]
{
itemID
,
dropWeight
};
int
[]
itemDrop
=
new
int
[]
{
itemID
,
dropWeight
};
dropTableByID
.
Add
(
monsterID
,
itemDrop
);
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