Ejemplo n.º 1
0
 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);
         }
     }
 }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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);
        }