private bool InputDialogueOption(int optionIndex)
        {
            var result = true;
            var flag   = true;

            if (optionIndex >= 0)
            {
                var selectedOption = _currentDialogueBox.OptionFromUIIndex(optionIndex);
                ContinueToNextNode(selectedOption);
            }
            else if (!_currentNode.HasNext())
            {
                ContinueToNextNode();
            }

            if (_currentNode == null)
            {
                _currentDialogueBox = null;
                flag   = false;
                result = false;
            }
            else
            {
                _currentDialogueBox = DisplayDialogueBox2();
            }

            if (flag)
            {
                Locator.GetPlayerAudioController().PlayDialogueAdvance();
            }

            return(result);
        }
        public void StartConversation()
        {
            VerifyInitialized();
            enabled = true;
            if (!_timeFrozen && PlayerData.GetFreezeTimeWhileReadingConversations() && !Locator.GetGlobalMusicController().IsEndTimesPlaying())
            {
                _timeFrozen = true;
                OWTime.Pause(OWTime.PauseType.Reading);
            }

            Locator.GetToolModeSwapper().UnequipTool();
            GlobalMessenger.FireEvent("EnterConversation");
            Locator.GetPlayerAudioController().PlayDialogueEnter();
            _wasFlashlightOn = Locator.GetFlashlight().IsFlashlightOn();
            if (_wasFlashlightOn && _turnOffFlashlight)
            {
                Locator.GetFlashlight().TurnOff(false);
            }

            DialogueConditionManager.SharedInstance.ReadPlayerData();
            SetEntryNode();
            _currentDialogueBox = DisplayDialogueBox2();
            if (_attentionPoint != null && !PlayerState.InZeroG())
            {
                Locator.GetPlayerTransform().GetRequiredComponent <PlayerLockOnTargeting>().LockOn(_attentionPoint, _attentionPointOffset, 2f);
            }

            if (PlayerState.InZeroG() && !_timeFrozen)
            {
                Locator.GetPlayerBody().GetComponent <Autopilot>().StartMatchVelocity(this.GetAttachedOWRigidbody().GetReferenceFrame());
            }
        }
Exemplo n.º 3
0
        public static bool Tree_InputDialogueOption(int optionIndex, DialogueBoxVer2 ____currentDialogueBox)
        {
            if (optionIndex < 0)
            {
                // in a page where there is no selectable options
                ConversationManager.Instance.CloseBoxPlayer();
                return(true);
            }

            var selectedOption = ____currentDialogueBox.OptionFromUIIndex(optionIndex);

            ConversationManager.Instance.SendPlayerOption(selectedOption.Text);
            return(true);
        }
Exemplo n.º 4
0
 private void SetUpDialogueOptions()
 {
     _dialogueBox = FindObjectOfType <DialogueBoxVer2>();
 }