Code: Select all
var menuActor = GetActorTransformFromID(responses[0].destinationEntry.ActorID);
private Transform GetActorTransformFromID(int actorID)
{
var actor = DialogueManager.masterDatabase.GetActor(actorID);
if (actor != null)
{
var actorTransform = PixelCrushers.DialogueSystem.CharacterInfo.GetRegisteredActorTransform(actor.Name);
if (actorTransform == null)
{
var actorGO = GameObject.Find(actor.Name);
if (actorGO != null) actorTransform = actorGO.transform;
}
if (actorTransform != null) return actorTransform;
}
return DialogueManager.currentActor;
}
May I suggest you to modify ResponseMenuControls to work like SubtitleControls? If it has to be in this way, I need some detailed example.
By the way, I saw the Close() method in StandardUIResponseMenuControls
Code: Select all
if (m_actorIdPanelCache.Count > 0)
{
var cachedPanels = new List<StandardUIMenuPanel>(m_actorIdPanelCache.Values);
foreach (var kvp in m_actorIdPanelCache)
{
var panel = kvp.Value;
if (panel != null && !m_builtinPanels.Contains(panel) && !cachedPanels.Contains(panel)) panel.Close();
}
}