기획 데이터 수정
This commit is contained in:
parent
37c80a4bc1
commit
4df945a99a
|
|
@ -1,8 +1,26 @@
|
|||
using System.Collections;
|
||||
using MEC;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ExcelDatas
|
||||
{
|
||||
public Dictionary<long,시트1> 시트1;
|
||||
public Dictionary<long, UnitData> unitData;
|
||||
|
||||
|
||||
|
||||
|
||||
public IEnumerator<float> ToJson()
|
||||
{
|
||||
yield return Timing.WaitForSeconds(0);
|
||||
foreach (var data in unitData)
|
||||
{
|
||||
data.Value.toJson();
|
||||
UnityEngine.Debug.Log(data.Value.name);
|
||||
}
|
||||
yield return Timing.WaitForSeconds(0);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class Excel
|
||||
{
|
||||
public abstract void toJson();
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
public class UnitData : Excel
|
||||
{
|
||||
public int index;
|
||||
public string name;
|
||||
public int hp;
|
||||
public int attack;
|
||||
public float attack_speed;
|
||||
public int defense;
|
||||
public float move_speed;
|
||||
public string buy_list;
|
||||
|
||||
public List<int> buy;
|
||||
|
||||
public override void toJson()
|
||||
{
|
||||
buy = JsonConvert.DeserializeObject<List<int>>(buy_list);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class 시트1
|
||||
{
|
||||
public int index;
|
||||
public string test1;
|
||||
public int test2;
|
||||
public testenums test3;
|
||||
public string test4;
|
||||
public DateTime test5;
|
||||
}
|
||||
|
||||
public enum testenums
|
||||
{
|
||||
none = 0,
|
||||
aaa,
|
||||
bbb,
|
||||
ccc,
|
||||
ddd
|
||||
}
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
using Newtonsoft.Json;
|
||||
using System.Diagnostics;
|
||||
using UnityEditor.UIElements;
|
||||
using MEC;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class GameManager : DontDestroy<GameManager>
|
||||
|
|
@ -17,17 +16,7 @@ public class GameManager : DontDestroy<GameManager>
|
|||
{
|
||||
Statics.excelDatas = JsonConvert.DeserializeObject<ExcelDatas>(Crypto.Instance.Decompress(data.data));
|
||||
Statics.version = data.version;
|
||||
foreach (var item in Statics.excelDatas.시트1)
|
||||
{
|
||||
string newdata = "\n";
|
||||
newdata += $"index : {item.Value.index}\n";
|
||||
newdata += $"test1 : {item.Value.test1}\n";
|
||||
newdata += $"test2 : {item.Value.test2}\n";
|
||||
newdata += $"test3 : {item.Value.test3}\n";
|
||||
newdata += $"test4 : {item.Value.test4}\n";
|
||||
newdata += $"test5 : {item.Value.test5}\n";
|
||||
UnityEngine.Debug.Log($"data : {newdata}");
|
||||
}
|
||||
Timing.RunCoroutine(Statics.excelDatas.ToJson());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,22 @@
|
|||
using Newtonsoft.Json;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Test : MonoBehaviour
|
||||
{
|
||||
public List<int> testlist = new List<int>();
|
||||
[ContextMenu("test")]
|
||||
public void test()
|
||||
{
|
||||
|
||||
DownlodeResp request = new DownlodeResp();
|
||||
request.Request((data) =>
|
||||
{
|
||||
Crypto cr = new Crypto();
|
||||
Debug.Log(cr.Decompress(data.data));
|
||||
Statics.version = data.version;
|
||||
});
|
||||
Debug.Log(JsonConvert.SerializeObject(testlist));
|
||||
//DownlodeResp request = new DownlodeResp();
|
||||
//request.Request((data) =>
|
||||
//{
|
||||
// Crypto cr = new Crypto();
|
||||
// Debug.Log(cr.Decompress(data.data));
|
||||
// Statics.version = data.version;
|
||||
//});
|
||||
}
|
||||
|
||||
[ContextMenu("test2")]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue