Excel 코드 수정

This commit is contained in:
김판돌 2025-06-06 23:19:52 +09:00
parent e04fc50fb6
commit a2796087f1
2 changed files with 15 additions and 19 deletions

View File

@ -8,17 +8,6 @@ public class Excel
private List<Sheet> datas; private List<Sheet> datas;
public List<Sheet> getDatas { get { return datas; } } public List<Sheet> getDatas { get { return datas; } }
// 좀더 고도화가 필요함.
//public Sheet findSheet(string sheetName) {
// int index = datas.FindIndex(n => n.name == sheetName);
// if(index == -1)
// {
// Debug.Log("null exception");
// return null;
// }
// return datas[index];
//}
#region Dynamic #region Dynamic
//이러한 형태로 사용할것 //이러한 형태로 사용할것
public Dynamic dynamic; public Dynamic dynamic;
@ -57,12 +46,11 @@ public class Excel
} }
#endregion #endregion
public Excel() public Excel(List<string> fileNames)
{ {
ExcelManager excel = new ExcelManager(); ExcelManager excel = new ExcelManager();
//Dynamic, Unit excel.Add(fileNames);
excel.Add("Datas.xlsx");
datas = excel.Play(); datas = excel.Play();
@ -116,9 +104,13 @@ public class Excel
_sheets = new List<Sheet>(); _sheets = new List<Sheet>();
readList = new List<string>(); readList = new List<string>();
} }
public void Add(string file)
public void Add(List<string> files)
{ {
readList.Add(path + file); foreach (string file in files)
{
readList.Add(path + file);
}
} }
public List<Sheet> Play() public List<Sheet> Play()

View File

@ -1,4 +1,5 @@
using UnityEngine; using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
public class GameManager : DontDestroy<GameManager> public class GameManager : DontDestroy<GameManager>
@ -11,7 +12,10 @@ public class GameManager : DontDestroy<GameManager>
{ {
Application.targetFrameRate = 120; Application.targetFrameRate = 120;
nowScene = eScene.Title; nowScene = eScene.Title;
excel = new Excel(); //Datas.xlsx
// Dynamic
// Unit
excel = new Excel(new List<string>() {"Datas.xlsx"});
//사용법 //사용법
//Debug.Log(excel.dynamic.selectVelue("maxSwingCount")); //Debug.Log(excel.dynamic.selectVelue("maxSwingCount"));