// reset variables for ending communication public void EndCommunication() { if (_currentController != null && _currentController.EventTrigger) { EndComHelper(); _currentController.TriggerComplete(); } else if (_currentController != null) { EndComHelper(); if (PlayerController.Instance != null) { PlayerController.Instance.UnfreezePlayer(); // unfreeze player movement } _currentController.Instance.TriggerComplete(); _currentController = null; // reset reference to com controller } else { EndComHelper(); if (PlayerController.Instance != null) { PlayerController.Instance.UnfreezePlayer(); // unfreeze player movement } } }
private void EndComPreCutscene() { if (_currentController != null) { _currentController.TriggerCompleteCutscene(); EndComHelper(); _currentController = null; PlayerController.Instance.UnfreezePlayer(); // unfreeze player movement } }
private void EndCommunication(ResponseType type) { if (_currentController != null && type == ResponseType.Nothing) { _currentController.TriggerCompleteNoIncrement(); EndComHelper(); PlayerController.Instance.UnfreezePlayer(); // unfreeze player movement _currentController = null; PlayerController.Instance.UnfreezePlayer(); // unfreeze player movement } }
// regular dialogue communication initializer public void BeginCommunication(ComType type, Dialogue dialogue, ComController currentController) { if (_active) { Debug.Log("ComManager BeginCommunication Error: Communications already active, cannot begin new communication session!"); } else { _currentController = currentController; // reference to current com controller BeginCommunication(type, dialogue); } }
// choice dialouge communication initialzer public void BeginCommunication(ComType type, Dialogue dialogue, Choices choices, int choiceIndex, ResponseType[] responses, ComController currentController) { if (_active) { Debug.Log("ComManager BeginCommunication Error: Communications already active, cannot begin new communication session!"); } else { _currentReponses = responses; // assing current responses _choiceIndex = choiceIndex; _currentChoices = choices; _currentController = currentController; // reference to current com controller BeginCommunication(type, dialogue); } }
public void TriggerCommunication(ComController controller) { if (_calculateStringValues) { WizardFightController.Instance.CalculateBrothersText(); } if (_endingReplacements) { foreach (int index in _indexesToBeReplaced) { if (_displayColors[index]) { _dialogue.sentences[index] = _dialogue.sentences[index].Insert(_replacementPositions[index], WizardFightController.Instance.GetColorsText()); } else if (_displayBrothersSaved[index]) { _dialogue.sentences[index] = _dialogue.sentences[index].Insert(_replacementPositions[index], WizardFightController.Instance.GetBroSavedText()); } else if (_displayBrothersLeft[index]) { _dialogue.sentences[index] = _dialogue.sentences[index].Insert(_replacementPositions[index], WizardFightController.Instance.GetBroNotSavedText()); } } } _curController = controller; if (_moveNpc && _npcToMove != null) { if (_npcToMove.tag == "WIZARD") { _ravenAudioController.PlaySfx(); } _moveNpc = false; _npcToMove.Cutscene = true; } if (_comType == ComType.Dialogue) { ComManager.Instance.BeginCommunication(_comType, _dialogue, controller); } else if (_comType == ComType.Choice) { ComManager.Instance.BeginCommunication(_comType, _dialogue, _choices, _choiceIndex, _responseOptions, controller); } }
public void EndCommunicationCutscene() { EndComHelper(); _currentController = null; // reset reference to com controller PlayerController.Instance.UnfreezePlayer(); // unfreeze player movement }
private void Awake() { _instance = this; }