Skip to content

TryllWorkflowAsset

Type: ScriptableObject
Namespace: Tryll.Client
Source: Runtime/TryllWorkflowAsset.cs

ScriptableObject that stores a TryllGraphDescription as a project asset. Assign it to a TryllAgentComponent to define which workflow graph the agent runs. Because it is a regular Unity asset, it is serialized, version-controlled, and reusable across multiple GameObjects.


Creating an asset

In the Project window: right-click → Create → Tryll → Workflow Asset.

The asset opens in the Inspector where you can configure Graph nodes and routes, or populate them programmatically via TryllGraphBuilder.


Public API

public sealed class TryllWorkflowAsset : ScriptableObject
{
    public TryllGraphDescription Graph;
}

Graph is the complete workflow graph description. It is serialized by Unity's standard serialization and editable in the Inspector.


Programmatic alternative

If you do not need a persistent asset, populate a TryllGraphDescription directly in C# and assign it to TryllAgentComponent.InlineGraphDescription:

agentComponent.InlineGraphDescription = new TryllGraphBuilder()
    .AddGenerate("gen", new TryllGenerateParams
    {
        // DefaultExit is "" (END) by default
    })
    .SetStartNode("gen")
    .SetDefaultModelName("my-model")
    .Build();

See also