// показать или спрятать портрет в диалоге фунгуса; используем ShowSpeakerFace private void ShowPortrait(Person Pers, SayDialog Okno, bool state) { if (Pers == null || Okno == null) { return; } if (state) { // подготовить диалог, перса и портрет Character currentCharacter = GetChar(Pers); Okno.SetActive(state); Okno.Clear(); // Okno = currentCharacter.SetSayDialog; Okno.SetCharacter(currentCharacter); string title = ""; if (Pers.GetPost() != null) { title = Pers.GetPost().Titul; } Okno.SetCharacterName(Pers.Name + ", " + title, Color.blue); } Sprite currentPortrait = ShowSpeakerFace(Pers, state); Okno.SetCharacterImage(currentPortrait); }
/// <summary> /// Opens the dialogue window and plays a conversation that matches the conversationKey. /// </summary> /// <param name="conversationKey">Conversation Key to play. Should be the name of a key from the localization sheet, without a numbered suffix. (i.e. "NPC_Bo/bo_intro")</param> /// <param name="startDelay">Time to wait before starting the conversation. -1 for default</param> /// <param name="endDelay">Time to wait after finishing the conversation before the complete callback is called. -1 for default</param> /// <param name="closeOnFinished">Automatically close the window when the conversation is finished (and after endDelay has expired)</param> public void PlayConversation(string characterID, string conversationKey, float startDelay = -1, float endDelay = -1, bool closeOnFinished = true) { if (_isPlaying) { Debug.LogError($"Please wait for the current conversation to finish (or cancel it) before starting a new one."); return; } if (string.IsNullOrEmpty(conversationKey)) { Debug.LogError($"Please specify a conversation key to open Dialogue panel with"); return; } _characterID = characterID; _convoID = $"{_characterID}/{conversationKey}"; _autoClose = closeOnFinished; Open("bring_in"); List <ConversationManager.ConversationItem> conversation = ConversationManager.GetConversationItems(_characterID, conversationKey); if (conversation.Count == 0) { Debug.LogError($"Could not find conversation for key '{_convoID}' in localization sheet"); Close("close"); OnConversationComplete?.Invoke(_convoID); OnConversationComplete = null; OnConversationCancelled = null; return; } Stage.GetActiveStage().Clean(); _dialog.Clear(); _dialog.SetCharacterName(null, Color.white); CanvasManager.instance.StartCoroutine(playConversation(conversation, startDelay, endDelay)); }
// показать-спрятать сейдайлог private void ShowDialog(bool flag) { BigWindow.Clear(); BigWindow.Stop(); BigWindow.SetActive(flag); }