public override void OnInspectorGUI() { base.OnInspectorGUI(); if (cardLibraryData.cardSprites.Length == 0) { EditorGUILayout.HelpBox(string.Format("Unable to load card sprites from {0}", cardLibraryData.path), MessageType.Error); } else { DisplayCardSprites(); if (cardLibraryData.cardLibray.Count == 0) { if (GUILayout.Button("Generate Random Card Library", EditorStyles.miniButton)) { cardLibraryData.Randomize(); } } else { DisplayCardLibrary(); } } EditorUtility.SetDirty(cardLibraryData); }
private void Start() { if (cardLibraryData.cardLibray == null || cardLibraryData.cardLibray.Count == 0) { cardLibraryData.Randomize(); } GenerateCardLibrary(); }