added encounter system

This commit is contained in:
Sebastian Bularca
2026-04-19 12:46:44 +02:00
parent c1b5d0e9e0
commit 8861bdc5eb
94 changed files with 2581 additions and 13 deletions

View File

@@ -0,0 +1,21 @@
using System;
using UnityEngine;
namespace Jovian.EncounterSystem {
/// <summary>Looks up <see cref="id"/> in the library passed to <see cref="Resolve"/>; falls back to <see cref="inlineText"/>.</summary>
[Serializable]
public struct DialogLineRef {
public string id;
[TextArea(2, 6)] public string inlineText;
public string Resolve(DialogLineLibrary library) {
if(library != null && !string.IsNullOrEmpty(id)) {
var text = library.Resolve(id);
if(!string.IsNullOrEmpty(text)) {
return text;
}
}
return inlineText;
}
}
}