public override void OnInspectorGUI() { DrawDefaultInspector(); gra mygra = (gra)target; if (GUILayout.Button("Make bot")) { mygra.init(); } }
// Update is called once per frame void Update() { if (mygra != null) { if (makeobject) { mygra.init(); makeobject = false; } else { mygra.moveObject(); } } }