public void SpawnWordSet() { if (_foundResultCount == 0) { return; } if (_wordSet == null) { _wordSet = new WordSet(); } _wordSet.Words = _bestResult; _wordSet.Clue = Clue; WordSpawner.WordSet = _wordSet; WordSpawner.EditorInstatiate = EditorInstantiate; WordSpawner.SpawnWords(); }
void OnGUI() { GUILayout.Label("Word Spawner", EditorStyles.boldLabel); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Word Set"); _wordSet = (WordSet)EditorGUILayout.ObjectField(_wordSet, typeof(WordSet), true); EditorGUILayout.EndHorizontal(); if (!Wordspawner) { Wordspawner = FindObjectOfType <WordSpawner>(); } if (_wordSet) { EditorGUILayout.LabelField("Word Set Clue : ", PersianFixer.Fix(_wordSet.Clue)); EditorGUILayout.LabelField("Word Count : ", _wordSet.Words.Count.ToString()); EditorGUILayout.LabelField("Nonunique Word Count : ", _wordSet.NonuniqWords.Count.ToString()); EditorGUILayout.BeginHorizontal(); _useJason = EditorGUILayout.Toggle("From Json ", _useJason); if (GUILayout.Button("Spawn")) { Wordspawner.EditorInstatiate = EditorInstantiate; Wordspawner.WordSet = _useJason? ToJason(_wordSet):_wordSet; Wordspawner.SpawnWords(); } if (GUILayout.Button("To Generatoe")) { string allWords = ""; foreach (SWord word in _wordSet.Words) { allWords += word.Name + " "; } FindObjectOfType <WordSetGenerator>().AllWords = allWords; } EditorGUILayout.EndHorizontal(); } }