using System.Collections.Generic;
using Convai.Runtime.Actions;
using Convai.Runtime.Room;
using Convai.Shared.Actions;
using UnityEngine;
public sealed class DynamicActionSetup : MonoBehaviour
{
[SerializeField] private ConvaiManager _manager;
[SerializeField] private NavMeshMoveToActionExecutor _mover;
public async void ConnectWithOverrides()
{
var options = new RoomSessionConnectOptions
{
ActionConfigOverride = new ConvaiActionConfig
{
Actions = new List<string> { "Move To", "Pick Up" },
Objects = new List<ConvaiActionObjectDefinition>
{
new() { Name = "Helmet", Description = "Yellow hard hat on the equipment shelf" },
new() { Name = "Locker", Description = "Green metal locker near the exit" }
},
CurrentAttentionObject = "Helmet"
},
ActionDefinitionsOverride = new List<ConvaiActionDefinition>
{
new()
{
ActionName = "Move To",
TargetRequirement = ConvaiActionTargetRequirement.Object,
Executor = _mover
}
}
};
await _manager.ConnectAsync(options);
}
}