/*Auto Create, Don't Edit !!!*/ using UnityEngine; using System.Collections.Generic; using System; using System.IO; [Serializable] public class EludeBeastOneExcelItem : ExcelItemBase { public int Grade; public int beginOne; public int finishOne; public int beginTwo; public int finishTwo; public float delayTime; public int Score; } [CreateAssetMenu(fileName = "EludeBeastOneExcelData", menuName = "Excel To ScriptableObject/Create EludeBeastOneExcelData", order = 1)] public class EludeBeastOneExcelData : ExcelDataBase { } #if UNITY_EDITOR public class EludeBeastOneAssetAssignment { public static bool CreateAsset(List> allItemValueRowList, string excelAssetPath) { if (allItemValueRowList == null || allItemValueRowList.Count == 0) return false; int rowCount = allItemValueRowList.Count; EludeBeastOneExcelItem[] items = new EludeBeastOneExcelItem[rowCount]; for (int i = 0; i < items.Length; i++) { items[i] = new EludeBeastOneExcelItem(); items[i].Grade = Convert.ToInt32(allItemValueRowList[i]["Grade"]); items[i].beginOne = Convert.ToInt32(allItemValueRowList[i]["beginOne"]); items[i].finishOne = Convert.ToInt32(allItemValueRowList[i]["finishOne"]); items[i].beginTwo = Convert.ToInt32(allItemValueRowList[i]["beginTwo"]); items[i].finishTwo = Convert.ToInt32(allItemValueRowList[i]["finishTwo"]); items[i].delayTime = Convert.ToSingle(allItemValueRowList[i]["delayTime"]); items[i].Score = Convert.ToInt32(allItemValueRowList[i]["Score"]); } EludeBeastOneExcelData excelDataAsset = ScriptableObject.CreateInstance(); excelDataAsset.items = items; if (!Directory.Exists(excelAssetPath)) Directory.CreateDirectory(excelAssetPath); string pullPath = excelAssetPath + "/" + typeof(EludeBeastOneExcelData).Name + ".asset"; UnityEditor.AssetDatabase.DeleteAsset(pullPath); UnityEditor.AssetDatabase.CreateAsset(excelDataAsset, pullPath); UnityEditor.AssetDatabase.Refresh(); return true; } } #endif