Ejemplo n.º 1
0
 public static void Update()
 {
     ActiveDialogue.Update();
     if (KeyHelper.CheckTap(Keys.Enter))
     {
         if (DialogueIndex < Dialogues.Length - 1)
         {
             if (!ActiveDialogue.IsCompleted())
             {
                 ActiveDialogue.QuickComplete();
             }
             else
             {
                 ActiveDialogue = Dialogues[++DialogueIndex];
             }
         }
         else
         {
             RenderHandler.CurrentGameState = GAMESTATE.ACTIVE;
             ActiveDialogue = null;
             Dialogues      = new Dialogue[] { };
             DialogueIndex  = 0;
         }
     }
 }
Ejemplo n.º 2
0
 private void SendActiveDialogue(ConversationWithActions dialogue, bool skip)
 {
     if (!Chatter.CanSendDialogue)
     {
         return;
     }
     ActiveDialogue?.StartDialogue(dialogue, skip);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Handling animating windows, fadeing in / out canvas etc.
        /// </summary>
        protected virtual void Update()
        {
            if (IsWorking)
            {
                // Animating text canvases
                AnimateSelectionWindow();
                AnimateReplyWindow();

                // Controlling switching replys etc.
                if (ActiveDialogue != null)
                {
                    ActiveDialogue.DialogueUpdate();

                    if (hidingReply)
                    {
                        if (softAnimationFinished)
                        {
                            if (ActiveDialogue.Replys != null)
                            {
                                if (ActiveReplyIndex >= ActiveDialogue.Replys.Count)
                                {
                                    EndDialogue(AvailableDialogues);
                                }
                                else
                                {
                                    ShowReply();
                                }
                            }
                        }
                    }
                }

                OnWorkingUpdate();

                if (ActiveReply != null)
                {
                    ActiveReply.ReplyUpdate();
                }
            }

            // Controlling main canvas alpha
            if (!IsHiding)
            {
                ConversationUI.MainCanvasG.alpha = Mathf.Lerp(ConversationUI.MainCanvasG.alpha, 1.05f, Time.unscaledDeltaTime * 10f + Time.unscaledDeltaTime * 2f);
            }
            else
            {
                ConversationUI.MainCanvasG.alpha = Mathf.Lerp(ConversationUI.MainCanvasG.alpha, -0.05f, Time.unscaledDeltaTime * 10f + Time.unscaledDeltaTime * 2f);
                if (ConversationUI.MainCanvasG.alpha <= 0f)
                {
                    FinishingHidingConversationSystem();
                }
            }
        }
Ejemplo n.º 4
0
 public void startFailDialogue()
 {
     if (dialogue[2].Length == 0)
     {
         noDialogue = true;
     }
     else
     {
         animator.SetBool("isOpen", true);
         activeDialogue  = ActiveDialogue.Fail;
         dialogueIndex   = 0;
         dialogueStarted = true;
         isComplete      = false;
         showNextSentence();
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Generating and showing dialogue options inside conversation
        /// </summary>
        protected virtual void ShowDialogueOptions(List <FBasic_DialogueBase> dialogues)
        {
            GenerateDialogueOptions(dialogues);

            ConversationUI.DialogueCanvasG.blocksRaycasts = true;
            ConversationUI.ReplyCanvasG.blocksRaycasts    = false;
            ConversationUI.MainCanvasG.blocksRaycasts     = true;

            OnShowDialogueOptions();

            if (ActiveDialogue != null)
            {
                ActiveDialogue.OnDialogueEnd();
            }
            if (ActiveReply != null)
            {
                ActiveReply.OnReplySkip();
            }

            ActiveDialogue = null;
            ActiveReply    = null;

            SetDefaultCameraOrientation();
        }
Ejemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     // Screen.SetResolution(Screen.width, Screen.width * 16 / 9, true);
     SM = FindObjectOfType <SoundManager>();
     AD = FindObjectOfType <ActiveDialogue>();
 }
Ejemplo n.º 7
0
 public static void Draw(SpriteBatch sp)
 {
     ActiveDialogue.Draw(sp);
 }