Re: Creating a Show/Hide Dialogues Button
Posted: Thu May 04, 2017 5:28 pm
I FIXED IT!!!
Here is what I put inside my script :
the "GV.boolHideDialogueInterface" is a bool I toggle so that all of my "on conversations end" and "on conversations start" are not called when i stop and start the conversation...
I added a
Inside all of my public void OnConversationStart (Transform gm) that I have all over the game
So it all work now!! which is amazing!
It wasnt an important feature... but its so nice when you spend hours trying to fix something and it eventually work out!
There is however a warning that pops from one of your file :
UIShowHideController.cs : the line "currentHashID"
returns the following error message :
Here is what I put inside my script :
Code: Select all
if (Input.GetKeyDown (KeyCode.H))
{
DialogueManager.PlaySequence ("SetActive(Dialogue Panel,false);");
FindObjectOfType<GameSettingsOptions>().DisableEnergyNMenu();
}
if (Input.GetKeyDown (KeyCode.S))
{
DialogueManager.PlaySequence ("SetActive(Dialogue Panel,true)");
FindObjectOfType<GameSettingsOptions>().EnableEnergyNMenu();
var conversationID = DialogueLua.GetVariable ("CurrentConversationID").AsInt;
var entryID = DialogueLua.GetVariable ("CurrentEntryID").AsInt;
if (conversationID >= 0 && entryID > 0)
{
var conversation = DialogueManager.MasterDatabase.GetConversation (conversationID);
var actorName = DialogueLua.GetVariable ("CurrentConversationActor").AsString;
var conversantName = DialogueLua.GetVariable ("CurrentConversationConversant").AsString;
var actor = GameObject.Find (actorName);
var conversant = GameObject.Find (conversantName);
var actorTransform = (actor != null) ? actor.transform : null;
var conversantTransform = (conversant != null) ? conversant.transform : null;
GV.boolHideDialogueInterface = true;
DialogueManager.StopConversation ();
DialogueManager.StartConversation (conversation.Title, actorTransform, conversantTransform, entryID);
GV.boolHideDialogueInterface = false;
}
}
I added a
Code: Select all
if (!GV.boolHideDialogueInterface)
{
....
}
So it all work now!! which is amazing!
It wasnt an important feature... but its so nice when you spend hours trying to fix something and it eventually work out!
There is however a warning that pops from one of your file :
UIShowHideController.cs : the line "currentHashID"
Code: Select all
while ((currentHashID != goalHashID) && (currentHashID == oldHashId) && (Time.realtimeSinceStartup < timeout))
{
yield return null;
currentHashID = UITools.GetAnimatorNameHash(animator.GetCurrentAnimatorStateInfo(0));
}
I dont really like "leaving" warnings when possible i like to fix them... any tips on what that one mean?Animator is not playing an AnimatorController
UnityEngine.Animator:GetCurrentAnimatorStateInfo(Int32)
PixelCrushers.DialogueSystem.<WaitForAnimation>c__Iterator0:MoveNext() (at Assets/Dialogue System/Scripts/Supplemental/UI/Tools/UIShowHideController.cs:63)