Beispiel #1
0
 private void SaveOperation()
 {
     if (destAI == null)
     {
         //Debug.Log("No active object! Not saving");
         return;
     }
     if (_serializer == null)
     {
         _serializer = AIGraphSerializer.GetInstance(_graphView);
     }
     else
     {
         _serializer.UpdateVars(_graphView);
     }
     _serializer.SaveGraph(destAI);
 }
Beispiel #2
0
    //private SerializedObject _serializedObject;
    //[MenuItem("Graph/AI Graph")]
    public static void OpenDialogueGraphWindow(ActorAI AI)
    {
        AIGraph window = GetWindow <AIGraph>();

        window.titleContent = new GUIContent("AI Graph");
        window.destAI       = AI;
        window._serializer  = AIGraphSerializer.GetInstance(window._graphView);
        window._serializer.LoadGraph(AI);
        //window._serializedObject = new SerializedObject(AI);

        /*foreach(ActorStateNode n in window._graphView.nodes.ToList())
         * {
         *  var a = n.Q<Port>();
         *  var b = a.contentContainer.Q<ObjectField>();
         *  SerializedObject c;
         *  if(b != null) c = new SerializedObject(b.value);
         *  else { Debug.Log(a.contentContainer.Q<VisualElement>()); }
         *  a.contentContainer.Add(new Foldout());
         *  //a.contentContainer.Add(new IMGUIContainer());
         * }*/
    }