public void InitData() { AssetBundleManager.Instance.Load("Assets.Res.DataAsset.SystemData.systemdata.asset", (go) => { SystemData = (SystemDataProperty)go.mainObject; }); }
private static void CreateSystemData() { ReadExcelCards(); ReadExcelRoles(); ReadExcelRounds(); ReadExcelDecks(); SystemDataProperty role = new SystemDataProperty(); var guids = AssetDatabase.FindAssets("card", new string[] { "Assets/Res/DataAsset/card" }); role.AllCards = new CardProperty[guids.Length]; for (int i = 0; i < guids.Length; i++) { role.AllCards[i] = (CardProperty)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guids[i]), typeof(CardProperty)); } var guids1 = AssetDatabase.FindAssets("round", new string[] { "Assets/Res/DataAsset/round" }); role.AllRounds = new RoundProperty[guids1.Length]; for (int i = 0; i < guids1.Length; i++) { role.AllRounds[i] = (RoundProperty)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guids1[i]), typeof(RoundProperty)); } var guids2 = AssetDatabase.FindAssets("role", new string[] { "Assets/Res/DataAsset/role" }); role.AllRoles = new RoleProperty[guids2.Length]; for (int i = 0; i < guids2.Length; i++) { role.AllRoles[i] = (RoleProperty)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guids2[i]), typeof(RoleProperty)); } var guids3 = AssetDatabase.FindAssets("deck", new string[] { "Assets/Res/DataAsset/deck" }); role.AllDecks = new DeckProperty[guids3.Length]; for (int i = 0; i < guids3.Length; i++) { role.AllDecks[i] = (DeckProperty)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guids3[i]), typeof(DeckProperty)); } AssetDatabase.CreateAsset(role, "Assets/Res/DataAsset/SystemData/systemdata.asset"); }