Ejemplo n.º 1
0
    public override void Update()
    {
        if (TalkPanel.isSpeak)
        {
            //if (ChosePanel.isChose)
            //{
            //    return;
            //}

            if (addText == null)
            {
                if (Input.GetKeyDown(KeyCode.E))
                {
                    if (speakLabel.enabled == false)
                    {
                        speakLabel.enabled = true;
                        return;
                    }
                    if (writer.isActive)
                    {
                        writer.Finish();
                    }

                    else if (!writer.isActive)
                    {
                        GUIManager.HideView("TalkPanel");
                        StoryHander hander = null;
                        if (data.StoryHanderDic.TryGetValue(data.index, out hander))
                        {
                            hander();
                        }
                    }
                }
            }

            if (addText != null)
            {
                if (Input.GetKeyDown(KeyCode.E))
                {
                    if (speakLabel.enabled == false)
                    {
                        speakLabel.enabled = true;
                        return;
                    }

                    if (writer.isActive)
                    {
                        writer.Finish();
                    }

                    else if (!writer.isActive)
                    {
                        speakLabel.text = addText;
                        writer.ResetToBeginning();
                        addText = null;
                    }
                }
            }
        }
    }
Ejemplo n.º 2
0
    public void Init()
    {
        lb_typer.text = "";
        typewritter.Finish();

        spriteClear();
    }
Ejemplo n.º 3
0
 void StartTypewriting(UILabel label)
 {
     if (writingLabel != null)
     {
         writingEffect.Finish();
     }
     lastHeight        = 0f;
     writingLabel      = label;
     writingScrollView = writingLabel.transform.parent.GetComponent <UIScrollView>();
     writingEffect     = writingLabel.GetComponent <TypewriterEffect>();
     writingEffect.ResetToBeginning();
     btnMask.SetActive(true);
     EventDelegate.Add(writingEffect.onFinished, OnEndTypewriting, true);
 }
Ejemplo n.º 4
0
    public override void Update()
    {
        if (Input.GetKeyDown(KeyCode.E) || Input.GetMouseButtonDown(0))
        {
            if (speakLabel.gameObject.activeSelf == false)
            {
                speakLabel.enabled = true;
                return;
            }
            if (writer.isActive)
            {
                writer.Finish();
            }

            else if (!writer.isActive)
            {
                StoryHander hander = null;
                if (data.StoryHanderDic.TryGetValue(data.index, out hander))
                {
                    speakLabel.text = "";
                    speakLabel.gameObject.SetActive(false);
                    hander();
                }
            }
        }
    }
Ejemplo n.º 5
0
    // 点击屏幕
    public void OnClicked()
    {
        if (dlgType == TalkDlgType.TalkDlg_Talk)
        {
            // 1.如果正在播放打印机动画,停止动画。 否则显示下一组文字
            // 2.如果已经是最后一组,结束动画后触发回调
            if (descTypeEffect.isActive)
            {
                descTypeEffect.Finish();
            }
            else
            {
                if (contentIdx + 1 >= talkContentsList.Count)
                {
                    MoveGhostOutScreen();
                }
                else
                {
                    contentIdx += 1;

                    UpdateText(contentIdx);
                }
            }
        }
    }
Ejemplo n.º 6
0
    public void NextSpeech()
    {
        if (CommuCurrentSpeech < targetCustomer.CommuMax)
        {
            if (EndMessage)
            {
                CommuCurrentSpeech++;
                UISetting();
                NowFirstTalking = true;
                typeEffect.ResetToBeginning();
                StartCoroutine("BossPopUpSprite");
                EndMessage = false;
                targetCustomer.CommuCurrentIndex++;
            }
            else
            {
                typeEffect.Finish();
                EndMessage = true;
            }
        }
        else
        {
            if (EndMessage)
            {
                CustomerSpeech.SpeechStart(true);

                CustomerSpeech.BossItemGiv(targetCustomer);
                CustomerSpeech.BossItemGiv(targetCustomer);

                StopTime.StartCoroutine("TimeFlow");
                TimeManager.nowFlow = true;
                UIVisible(false);
                CommuCurrentSpeech = 0;
                NowFirstTalking    = false;
                EndMessage         = false;
            }
            else
            {
                typeEffect.Finish();
                EndMessage = true;
            }
        }
    }
Ejemplo n.º 7
0
 static public int Finish(IntPtr l)
 {
     try {
         TypewriterEffect self = (TypewriterEffect)checkSelf(l);
         self.Finish();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 8
0
 static int Finish(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         TypewriterEffect obj = (TypewriterEffect)ToLua.CheckObject(L, 1, typeof(TypewriterEffect));
         obj.Finish();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 9
0
    public override void Update()
    {
        //if (tp.isActiveAndEnabled)
        //{
        //    return;
        //}

        if (EventStoryPanel.isEventSpeak)
        {
            if (canUseE)
            {
                if (TalkPanel.isSpeak || ChosePanel.isChose)
                {
                    return;
                }
                if (addText == null)
                {
                    if (Input.GetKeyDown(KeyCode.E))
                    {
                        if (speakLabel.gameObject.activeSelf == false)
                        {
                            speakLabel.enabled = true;
                            return;
                        }
                        if (writer.isActive)
                        {
                            writer.Finish();
                        }

                        else if (!writer.isActive)
                        {
                            bool        needHide = true;
                            StoryHander hander   = null;
                            if (data.StoryHanderDic.TryGetValue(data.index, out hander))
                            {
                                if (lastHander != hander)
                                {
                                    hander();
                                    lastHander = hander;
                                    needHide   = false;
                                }
                            }


                            //if (needHide)
                            //{
                            //    GUIManager.HideView("EventStoryPanel");
                            //}
                        }
                    }
                }

                if (addText != null)
                {
                    if (Input.GetKeyDown(KeyCode.E))
                    {
                        if (speakLabel.gameObject.activeSelf == false)
                        {
                            speakLabel.enabled = true;
                            return;
                        }

                        if (writer.isActive)
                        {
                            writer.Finish();
                        }

                        else if (!writer.isActive)
                        {
                            speakLabel.text = addText;
                            writer.ResetToBeginning();
                            addText = null;
                        }
                    }
                }
            }
        }
    }