private void CreateScorerOptions() { newScorerType = AISEditorUtil.allScorers[EditorGUILayout.Popup("New Scorer Type:", AISEditorUtil.allScorers.IndexOf(newScorerType), AISEditorUtil.allScorers.Select(x => x.Name).ToArray())]; if (GUILayout.Button("Create new Scorer")) { AISScorer scorer = CreateInstance(newScorerType) as AISScorer; if (scorer != null) { scorer.name = "New"; scorer.owner = this; SODatabase.Add(this, scorer, scorers); } } }
private void ScorerParameters() { for (int i = 0; i < scorers.Count; i++) { AISScorer p = scorers[i]; p.OnGui(); if (GUILayout.Button("Eliminate")) { scorers.Remove(p); DestroyImmediate(p, true); } } CreateScorerOptions(); }
void EliminateAction(AISAction root) { for (int d = 0; d < root.children.Count; d++) { AISAction a = root.children[d]; root.children.Remove(a); EliminateAction(a); } for (int i = 0; i < root.scorers.Count; i++) { AISScorer s = root.scorers[i]; root.scorers.Remove(s); DestroyImmediate(s, true); } root.parent.children.Remove(root); DestroyImmediate(root, true); }