Manual

Graph Controller

Code examples to perform various interactions with the GraphController

Go to Node

Activate the passed Node if it belongs to the Graph

using Doozy.Engine.Nody;
using Doozy.Engine.Nody.Models;
using UnityEngine;

public class ExampleClass : MonoBehaviour
{
    public GraphController MyController;
    public Node MyNode;

    private void Start()
    {
        MyController.GoToNode(MyNode);
    }
}

Go to Node – by Name

Activate the first Node, found inside the Graph, with the given node name (if it exists)

using Doozy.Engine.Nody;
using UnityEngine;

public class ExampleClass : MonoBehaviour
{
    public GraphController MyController;
    public string NodeName = "MyNodeName";

    private void Start()
    {
        MyController.GoToNodeByName(NodeName);
    }
}

Go to Node – by Id

Activate the Node, found inside the Graph, with the given node id (if it exists)

using Doozy.Engine.Nody;
using UnityEngine;

public class ExampleClass : MonoBehaviour
{
    public GraphController MyController;
    public string NodeId = "b3cd426b-7441-4ff7-b8f1-77f7d0027eef";

    private void Start()
    {
        MyController.GoToNodeById(NodeId);
    }
}

GLOBAL – Get Controller by Name

Get the first GraphController with the given ControllerName. Returns null if no registered GraphController has the given ControllerName

using Doozy.Engine.Nody;
using UnityEngine;

public class ExampleClass : MonoBehaviour
{
    public string ControllerName = "MyController";

    private void Start()
    {
        GraphController controller = GraphController.Get(ControllerName);
    }
}