// Create a custom ScriptableObject type
[CreateAssetMenu(menuName = "My Game/Dialog String")]
public class DialogString : ScriptableObject, IStringReference
{
[SerializeField] private string _value;
public string Value
{
get => _value;
set => _value = value;
}
}
// Use in a MonoBehaviour
public class DialogDisplay : MonoBehaviour
{
[SerializeField] private StringReference<DialogString> dialogText;
void Start()
{
// Access the value - works with both inline strings and asset references
Debug.Log(dialogText.Value);
}
}Value
: string
[Get][Set] |
Gets the string value from the referenced asset if set, otherwise returns the inline string value. Setting a value clears any asset reference and stores the value inline.
Signature
string Meta.WitAi.Data.ValueReferences.StringReference< T >.Value |