EchoTrio
 
Loading...
Searching...
No Matches
Discussion.cs
Go to the documentation of this file.
1using UnityEngine;
2
3namespace EchoTrio {
4 /// Discussions are a way for the designers to create a way for the actors to interact beyond the standard way of getting a basic response from the AI models.
5 public abstract class Discussion : ScriptableObject {
6 /// Ways that a discussion can be triggered.
7 [System.Flags] public enum TriggerMode : uint {
8 /// Trigger a discussion if the user mentions a specific topic.
9 Topic = 1 << 0,
10 /// Trigger a discussion if the round number reaches a certain number.
11 Round = 1 << 1,
12 /// Trigger a discussion if the user does not provide any input for a certain amount of time during a round.
13 IdleTime = 1 << 2,
14 }
15
16 [Header("Discussion Settings")]
17 [SerializeField] protected TriggerMode triggerMode = TriggerMode.Topic | TriggerMode.Round;
18 [SerializeField] protected string triggerTopic = string.Empty;
19 [SerializeField, Min(1)] protected int triggerRound = 1;
20 [SerializeField, Range(10.0f, 300.0f)] protected float triggerIdleTime = 60.0f;
21
22 public bool HasAllTriggerModes(TriggerMode modes) { return (triggerMode & modes) == modes; }
23 public bool HasAnyTriggerMode(TriggerMode modes) { return (triggerMode & modes) != 0; }
25 public string GetTriggerTopic() { return triggerTopic; }
26 public int GetTriggerRound() { return triggerRound; }
27 public float GetTriggerIdleTime() { return triggerIdleTime; }
28 }
29}
Discussions are a way for the designers to create a way for the actors to interact beyond the standar...
Definition: Discussion.cs:5
TriggerMode
Ways that a discussion can be triggered.
Definition: Discussion.cs:7
@ Topic
Trigger a discussion if the user mentions a specific topic.
@ IdleTime
Trigger a discussion if the user does not provide any input for a certain amount of time during a rou...
@ Round
Trigger a discussion if the round number reaches a certain number.
TriggerMode GetTriggerMode()
Definition: Discussion.cs:24
bool HasAllTriggerModes(TriggerMode modes)
Definition: Discussion.cs:22
float GetTriggerIdleTime()
Definition: Discussion.cs:27
TriggerMode triggerMode
Definition: Discussion.cs:17
string GetTriggerTopic()
Definition: Discussion.cs:25
bool HasAnyTriggerMode(TriggerMode modes)
Definition: Discussion.cs:23