Iterate over actors in C#?
Iterate over actors in C#?
Kind of a weird question, but is there a way to fetch the list of actors and their display names from the dialogue database to use in C#? For example, let's say there's a game feature where you can choose or set the display name (or 'nickname') of NPCs you encounter, and then take or collect 'notes' on them for later use - uh, like a phone book! The C# script managing the phone book may need to check all the nicknames you set via dialogue.
Re: Iterate over actors in C#?
Hi,
Sure:
Sure:
Code: Select all
foreach (var actor in DialogueManager.masterDatabase.actors)
{
Debug.Log(actor.Name + " aka " + DialogueLua.GetActorField(actor.Name, "Display Name").asString);
}
Re: Iterate over actors in C#?
Thanks Tony! I appreciate you.
Re: Iterate over actors in C#?
Happy to help!