initial upload
This commit is contained in:
@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using Convai.Scripts.Runtime.LoggerSystem;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace Convai.Scripts.Runtime.Features
|
||||
{
|
||||
/// <summary>
|
||||
/// Data class for Section Change Events
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class SectionChangeEventsData
|
||||
{
|
||||
[SerializeField] public string id;
|
||||
[SerializeField] public UnityEvent onSectionStart;
|
||||
[SerializeField] public UnityEvent onSectionEnd;
|
||||
private NarrativeDesignManager _manager;
|
||||
|
||||
private string SectionName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_manager == null) return string.Empty;
|
||||
SectionData sectionData = _manager.sectionDataList.Find(s => s.sectionId == id);
|
||||
return sectionData?.sectionName ?? "Unknown Section";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the Section Change Events
|
||||
/// </summary>
|
||||
/// <param name="manager"> The Narrative Design Manager </param>
|
||||
public void Initialize(NarrativeDesignManager manager)
|
||||
{
|
||||
_manager = manager;
|
||||
|
||||
onSectionStart.RemoveListener(LogSectionStart);
|
||||
onSectionStart.AddListener(LogSectionStart);
|
||||
|
||||
onSectionEnd.RemoveListener(LogSectionEnd);
|
||||
onSectionEnd.AddListener(LogSectionEnd);
|
||||
}
|
||||
|
||||
private void LogSectionStart()
|
||||
{
|
||||
ConvaiLogger.DebugLog($"Section {SectionName} started", ConvaiLogger.LogCategory.Character);
|
||||
}
|
||||
|
||||
private void LogSectionEnd()
|
||||
{
|
||||
ConvaiLogger.DebugLog($"Section {SectionName} ended", ConvaiLogger.LogCategory.Character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32b4f9b2242945c19917f76c7ceb0a71
|
||||
timeCreated: 1707390195
|
||||
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using Convai.Scripts.Runtime.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Convai.Scripts.Runtime.Features
|
||||
{
|
||||
/// <summary>
|
||||
/// Data class for Section Data
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class SectionData
|
||||
{
|
||||
[JsonProperty("section_id")] [ReadOnly] [SerializeField]
|
||||
public string sectionId;
|
||||
|
||||
[JsonProperty("section_name")] [ReadOnly] [SerializeField]
|
||||
public string sectionName;
|
||||
|
||||
[JsonProperty("bt_constants")] [HideInInspector] [SerializeField]
|
||||
public string behaviorTreeConstants;
|
||||
|
||||
[JsonProperty("objective")] [ReadOnly] [SerializeField]
|
||||
public string objective;
|
||||
|
||||
[JsonProperty("character_id")] [ReadOnly] [HideInInspector] [SerializeField]
|
||||
public string characterId;
|
||||
|
||||
[JsonProperty("decisions")] [ReadOnly] public object Decisions;
|
||||
|
||||
[JsonProperty("parents")] [ReadOnly] public object Parents;
|
||||
|
||||
[JsonProperty("triggers")] [ReadOnly] public object Triggers;
|
||||
|
||||
[JsonProperty("updated_character_data")] [ReadOnly]
|
||||
public object UpdatedCharacterData;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98ee0e1dea8bb8c4ba9fe2daf30e9960
|
||||
timeCreated: 1706764030
|
||||
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Convai.Scripts.Runtime.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Convai.Scripts.Runtime.Features
|
||||
{
|
||||
[Serializable]
|
||||
public class TriggerData
|
||||
{
|
||||
[JsonProperty("trigger_id")] [ReadOnly] [SerializeField]
|
||||
public string triggerId;
|
||||
|
||||
[JsonProperty("trigger_name")] [ReadOnly] [SerializeField]
|
||||
public string triggerName;
|
||||
|
||||
[JsonProperty("trigger_message")] [ReadOnly] [SerializeField]
|
||||
public string triggerMessage;
|
||||
|
||||
[JsonProperty("destination_section")] [ReadOnly] [SerializeField]
|
||||
public string destinationSection;
|
||||
|
||||
[JsonProperty("character_id")] [HideInInspector] [SerializeField]
|
||||
public string characterId;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ed95a107485d00746a551222f53d0950
|
||||
timeCreated: 1706764014
|
||||
Reference in New Issue
Block a user