Пример #1
0
 // 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
         }
     }
 }
Пример #2
0
 private void EndComPreCutscene()
 {
     if (_currentController != null)
     {
         _currentController.TriggerCompleteCutscene();
         EndComHelper();
         _currentController = null;
         PlayerController.Instance.UnfreezePlayer(); // unfreeze player movement
     }
 }
Пример #3
0
 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
     }
 }
Пример #4
0
 // 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);
     }
 }
Пример #5
0
        // 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);
            }
        }
Пример #6
0
        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);
            }
        }
Пример #7
0
 public void EndCommunicationCutscene()
 {
     EndComHelper();
     _currentController = null;                  // reset reference to com controller
     PlayerController.Instance.UnfreezePlayer(); // unfreeze player movement
 }
Пример #8
0
 private void Awake()
 {
     _instance = this;
 }