Пример #1
0
        public void StartConversation(ConversationInformationData thisConversation, Action callBack = null, List <DialogueIndexReaction> indexCallbacks = null)
        {
            Debug.Log("[Attempting to Start Conversation]");

            if (currentlyInConversation)
            {
                Debug.Log("[Currently in Conversation] Title:" + currentConversation.conversationTitle);
                return;
            }

            if (speechList != null && speechList.Count > 0)
            {
                ClearSpeechList();
            }

            Debug.Log("[Currently Not in Conversation]");
            dialoguePanel.SetActive(true);
            currentlyInConversation = true;
            currentDialogueIdx      = 0;
            currentBranchIdx        = 0;
            currentConversation     = thisConversation;

            if (afterConversationCallBack == null)
            {
                afterConversationCallBack = new List <Action>();
            }

            if (callBack != null)
            {
                Debug.Log("Adding Callback To this Conversation : " + currentConversation.conversationTitle);
                afterConversationCallBack.Add(callBack);
            }

            indexReactioncallBack = indexCallbacks;

            SummonSentenceText();
        }
Пример #2
0
        public void EndConversation()
        {
            dialoguePanel.SetActive(false);
            currentlyInConversation = false;
            ClearSpeechList();
            currentConversation   = null;
            indexReactioncallBack = null;
            summoningAllSentences = false;

            Debug.Log("Ending Conversation, AfterCallback Count: " + afterConversationCallBack.Count);

            if (afterConversationCallBack != null && afterConversationCallBack.Count > 0)
            {
                List <Action> copyCallbacks = new List <Action>();

                copyCallbacks.AddRange(afterConversationCallBack);
                afterConversationCallBack.Clear();

                for (int i = 0; i < copyCallbacks.Count; i++)
                {
                    copyCallbacks[i].Invoke();
                }
            }
        }