/// <summary> /// When something exits the trigger, this method removes the database if the condition is true. /// </summary> /// <param name='other'> /// Other. /// </param> void OnTriggerExit(Collider other) { if (condition.IsTrue(other.transform)) { DialogueDebug.DebugLevel originalLevel = DialogueManager.DebugLevel; if (debug) { DialogueManager.DebugLevel = DialogueDebug.DebugLevel.Info; Debug.Log(string.Format("{0}: Removing database '{1}'", DialogueDebug.Prefix, database.name)); } DialogueManager.RemoveDatabase(database); DialogueManager.DebugLevel = originalLevel; } }
/// <summary> /// Initializes the component by setting up the dialogue database and preparing the /// dialogue UI. If the assigned UI is a prefab, an instance is added. If no UI is /// assigned, the default UI is loaded. /// </summary> public void Awake() { if (allowOnlyOneInstance && (GameObject.FindObjectsOfType(typeof(DialogueSystemController)).Length > 1)) { DestroyImmediate(gameObject); } else { bool visuallyMarkOldResponses = ((displaySettings != null) && (displaySettings.inputSettings != null) && (displaySettings.inputSettings.emTagForOldResponses != EmTag.None)); DialogueLua.includeSimStatus = includeSimStatus || visuallyMarkOldResponses; if (dontDestroyOnLoad) DontDestroyOnLoad(this.gameObject); AllowLuaExceptions = false; WarnIfActorAndConversantSame = false; DialogueDebug.Level = debugLevel; lastDebugLevelSet = debugLevel; LastConversationStarted = string.Empty; CurrentActor = null; CurrentConversant = null; CurrentConversationState = null; InitializeDatabase(); InitializeDisplaySettings(); } }
private void CheckDebugLevel() { if (debugLevel != lastDebugLevelSet) { DialogueDebug.Level = debugLevel; lastDebugLevelSet = debugLevel; } }