public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        NEATGraph myTarget = (NEATGraph)target;

        bool drawRandom;
        bool reset;
        bool drawGivenGenome;

        GUILayout.BeginHorizontal();
        drawRandom      = GUILayout.Button("Draw random");
        drawGivenGenome = GUILayout.Button("Draw given");
        reset           = GUILayout.Button("Reset");
        GUILayout.EndHorizontal();

        if (drawRandom)
        {
            myTarget.DrawRandomFromParameters();
        }
        else if (drawGivenGenome)
        {
            myTarget.DrawGivenGenomeProxy();
        }
        else if (reset)
        {
            myTarget.RemoveAllNodes();
        }
    }
示例#2
0
 private void Start()
 {
     instance = this;
     if (autoUpdate)
     {
         StartCoroutine(update());
     }
 }
示例#3
0
 private void Start()
 {
     smoothFollow = FindObjectOfType <SmoothFollow>();
     neatGraph    = FindObjectOfType <NEATGraph>();
 }