static void CreateNewGraph() { var root = AssetCreator.CreateAsset <DialogueGraph>(); string name = root.Name; root.Name = "DialogueRoot"; root.EditorInit(null, Vector2.zero); root.Name = name; ConversationFlow c = new ConversationFlow(); SimpleEvent onOpen = AssetCreator.CreateAsset <SimpleEvent>(root); onOpen.Name = c.EVENT_NAME; onOpen.EditorInit(root, new Vector2(0, -50)); onOpen.CanCopy = false; onOpen.CanDelete = false; root.Nodes.Add(onOpen); AmbientDialogue a = new AmbientDialogue(); SimpleEvent onBark = AssetCreator.CreateAsset <SimpleEvent>(root); onBark.Name = a.EVENT_NAME; onBark.EditorInit(root, new Vector2(0, 50)); onBark.CanCopy = false; onBark.CanDelete = false; root.Nodes.Add(onBark); }
// Create new graph //[MenuItem("Assets/Create/Runemark/Visual Editor/New Graph")] static void CreateNewGraph() { var root = AssetCreator.CreateAsset <FunctionGraph>(); SimpleEvent onEnter = AssetCreator.CreateAsset <SimpleEvent>(root); onEnter.Name = "OnEnter"; onEnter.EditorInit(root, new Vector2(0, -50)); onEnter.CanCopy = false; onEnter.CanDelete = false; root.Nodes.Add(onEnter); SimpleEvent onExit = AssetCreator.CreateAsset <SimpleEvent>(root); onExit.Name = "OnExit"; onExit.EditorInit(root, new Vector2(0, 50)); onExit.CanCopy = false; onExit.CanDelete = false; root.Nodes.Add(onExit); }