void OnGUI() { GUILayout.Label("Card Data Import Export", EditorStyles.boldLabel); m_Source = EditorGUILayout.TextField("Source", m_Source); GUILayout.BeginHorizontal(); if (GUILayout.Button("Import")) { Import(); } if (GUILayout.Button("Export")) { Export(); } GUILayout.EndHorizontal(); GUILayout.Space(10); if (GUILayout.Button("Re-Init Database")) { InitCardDatabase(); } if (GUILayout.Button("Create New CardData Asset")) { CardData.BuildNewAsset($"New{System.Guid.NewGuid().ToString().Substring(0, 5)}", 0, string.Empty, new MinionExtraData()); } }
/// <summary> /// Creates a new asset by the card params. /// </summary> /// <param name="name"></param> /// <param name="cost"></param> /// <param name="artPath"></param> /// <param name="extraData"></param> private void ImportCardsToResources(string name, int cost, string artPath, ExtraData extraData) { CardData.BuildNewAsset(name, cost, artPath.ToString(), extraData); }