private void SaveRecord() { AIAgentChart chart = (AIAgentChart)target; EditorUtility.SetDirty(target); EditorUtility.SetDirty(chart.agentNode); AssetDatabase.Refresh(ImportAssetOptions.ImportRecursive); AssetDatabase.SaveAssets(); }
public override void OnGUI() { // Keep repainting the GUI of the active NodeEditorWindow NodeEditorWindow.current.Repaint(); if (!isExecuteOnce) { AIAgentChart chart = (AIAgentChart)target; chart.SaveEvent -= SaveRecord; chart.SaveEvent += SaveRecord; isExecuteOnce = true; } }