Commit 3b95427d authored by 15김민규's avatar 15김민규

debug loadDropTable

parent 6418a996
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 {
...@@ -29,14 +32,19 @@ public class EnemyManager : Singleton<EnemyManager> { ...@@ -29,14 +32,19 @@ 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);
} }
......
{ {
"dependencies": { "dependencies": {
"com.unity.ads": "2.0.8", "com.unity.ads": "2.3.1",
"com.unity.analytics": "2.0.16", "com.unity.analytics": "3.2.2",
"com.unity.package-manager-ui": "1.9.11", "com.unity.collab-proxy": "1.2.15",
"com.unity.package-manager-ui": "2.0.3",
"com.unity.purchasing": "2.0.3", "com.unity.purchasing": "2.0.3",
"com.unity.textmeshpro": "1.2.4", "com.unity.textmeshpro": "1.3.0",
"com.unity.modules.ai": "1.0.0", "com.unity.modules.ai": "1.0.0",
"com.unity.modules.animation": "1.0.0", "com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0", "com.unity.modules.assetbundle": "1.0.0",
......
m_EditorVersion: 2018.2.0f2 m_EditorVersion: 2018.3.0f2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment