Example #1
0
    /// <summary>
    /// 播放除草动画中
    /// </summary>
    async void WeedingAnimaPlaying()
    {
        roleWeedingAnimatorController.SetBool("IsWeeding", true);
        isWeeding = true;
        await UniTask.Delay(awaitTime);//等待除草动画播放完

        weedCount++;
        roleWeedingAnimatorController.SetBool("IsWeeding", false);
        isWeeding = false;

        GameObject tageObj = _weedBtns[_currWeedIndex].gameObject;

        if (tageObj.activeSelf)
        {
            tageObj.SetActive(false);
            CreationAwardItem(tageObj.transform.localPosition);
            _roleRect.SetAsLastSibling();
            if (IsWeedingEnd())
            {
                _roleRect.gameObject.SetActive(false);
                _weedingBtn.gameObject.SetActive(false);
                _tetragonumComponent.SetStartDialogueId(_tipDialogueId);
                _tetragonumComponent.Initial(() => { _tetragonumComponent.Close(); });
                _tetragonumComponent.gameObject.SetActive(true);
                _tetragonumComponent.Show();
                OpenAwardDrag(true);
            }
        }

        _weedingBtn.enabled = true;
        OpenAllWeedBtn(true);
    }
Example #2
0
 void WeChatDialogueClick(ChapterDialogueTextDefine data)
 {
     if (data.ID == 15000136)
     {//链接
         dialogueBoxWeChat.PauseOut(false, 1);
         ChapterModuleManager._Instance.transform.SetAsLastSibling();
         createGuidance = true;
         if (guidance != null)
         {
             Destroy(guidance);
         }
         _twoBg.rectTransform.DOAnchorPosX(0, 0.3f).OnComplete(async() =>
         {
             if (isFirst)
             {
                 return;
             }
             await UniTask.Delay(1000);
             if (isFirst)
             {
                 return;
             }
             dialogueBox.Initial(() =>
             {
                 dialogueBox.Close();
             });
             dialogueBox.Show();
         });
     }
 }
Example #3
0
 /// <summary>
 /// 初始化组件
 /// </summary>
 /// <param name="endAction"></param>
 public void Initial(Action endAction)
 {
     _endAction           = endAction;
     _thisCanvasGroup     = GetComponent <CanvasGroup>();
     _roleRect            = transform.Find("Role").GetComponent <RectTransform>();
     _weedingBtnRect      = transform.Find("WeedingBtn").GetComponent <RectTransform>();
     _weedingBtn          = _weedingBtnRect.GetComponent <Button>();
     _awardItem           = transform.Find("AwardItem").GetComponent <UIPanelDrag>();
     _outBtn              = transform.Find("OutBtn").GetComponent <Button>();
     _tetragonumComponent = transform.Find("DialogueBox_Tetragonum").GetComponent <DialogueBoxTetragonumComponent>();
     _outBtn.onClick.RemoveAllListeners();
     _outBtn.onClick.AddListener(ClickOutBtn);
     _weedingBtn.onClick.RemoveAllListeners();
     _weedingBtn.onClick.AddListener(ClickWeedingBtn);
     _weedingBtn.gameObject.SetActive(false);//recompose
     InitialWeedBtn();
     _roleRect.localPosition = _weedBtns[_currWeedIndex].transform.localPosition;
     //显示人物对象
     _roleRect.gameObject.SetActive(true);
     roleWeedingAnimatorController = _roleRect.Find("ChuCao/chucao").GetComponent <Animator>();
     _outBtn.gameObject.SetActive(false);
     OpenTrashCan(true);
     if (_startDialogueId != 0)
     {
         _tetragonumComponent.SetStartDialogueId(_startDialogueId);
         _tetragonumComponent.Initial(() => { _tetragonumComponent.Close(); });
         _tetragonumComponent.gameObject.SetActive(true);
         _tetragonumComponent.Show();
     }
     else
     {
         _tetragonumComponent.gameObject.SetActive(false);
     }
 }
Example #4
0
    //显示讲台
    async void ShowGraduationCeremony_image()
    {
        //1.15修改
        graduation_image.transform.DOScale(2.5f, 3f).SetEase(Ease.Linear);
        graduation_image.transform.DOLocalMoveY(1000f, 3f).SetEase(Ease.Linear);
        await UniTask.Delay(900);

        graduation_image.transform.GetComponent <CanvasGroup>().DOFade(0f, 0.5f).SetEase(Ease.Linear);
        platform_image.gameObject.SetActive(true);
        platform_image.transform.GetComponent <CanvasGroup>().DOFade(1f, 1f).SetEase(Ease.Linear).OnComplete(() =>
        {
            dialogueBox.Initial(() =>
            {
                dialogueBox.Close();
                //OpenClickBtn(true);
                ClickBtn();
            });
            dialogueBox.Show();
        });
    }
Example #5
0
 void ShowFourScene()
 {
     _threeScene.GetComponent <CanvasGroup>().alpha          = 0;
     _threeScene.GetComponent <CanvasGroup>().blocksRaycasts = false;
     dialogueBox.Initial(() =>
     {
         dialogueBox.Close();
         //进入聊天
         ChatDriver();
     });
     dialogueBox.Show();
 }
Example #6
0
 async void ShowBuyFlowersController()
 {
     dialogueBox_BuyFlowersTip.Initial(() =>
     {//提示初始化
         dialogueBox_BuyFlowersTip.Close();
     });
     await ChapterTool.FadeInFadeOut(_threeScene.GetComponent <CanvasGroup>(), 0, 0.1f, null, () =>
     {
         _threeScene.GetComponent <CanvasGroup>().blocksRaycasts = false;
         buyFlowersController.Initial(() =>
         {
             Debug.Log("选花完成");
             NextStep();
         });
         dialogueBox_BuyFlowersTip.Show();
     });
 }
Example #7
0
    /// <summary>
    /// 步骤切换
    /// </summary>
    /// <param name="index"></param>
    public async void StepCut(int index)
    {
        switch (index)
        {
        case 0:
            await ChapterTool.MoveUi(_oneIamgeRect, new Vector2(-490f, 0), 0.1f, 0.1f);

            await ChapterTool.FadeInFadeOut(_oneIamgeCanvasGroup, 0, fadeOut, null, () => { _oneIamgeRect.gameObject.SetActive(false); ClickBtn(); });

            //OpenClickBtn(true);
            break;

        case 1:
            _dialogueBase.Initial(() =>
            {
                Debug.Log("对话1完毕");
                //OpenClickBtn(true);
                _dialogueBase.Close();
                //_clickIndex = 2;
                ClickBtn();
                Debug.Log("_clickIndex:" + _clickIndex);
            }, TwoSceneSpeakBeforeCallBack, TwoSceneSpeakAfterCallBack);
            _dialogueBase.Show();
            //OpenClickBtn(false);
            break;

        case 2:
            //await ChapterTool.FadeInFadeOut(_twoImagCanvasGroup, 0, 0.1f, null, () =>
            //{
            _twoImagCanvasGroup.alpha = 0;
            _dialogueBoxTetragonumComponent.Initial(async() =>
            {
                await ChapterTool.FadeInFadeOut(_twoImagCanvasGroup, 1, fadeOut, new CancellationTokenSource(), () =>
                {
                    _therrBoxRect.gameObject.SetActive(false);
                    _dialogueBase.SetStartDialogueId(12000036);
                    _dialogueBase.Initial(() =>
                    {
                        ClickBtn();     //心想完成后直接下个画面
                        //OpenClickBtn(true);
                        _dialogueBase.Close();
                    });
                    _dialogueBase.Show();
                });
                _dialogueBoxTetragonumComponent.Close();
            }, SpeakBeforeAction, SpeakRearAction);
            _dialogueBoxTetragonumComponent.Show();
            //OpenClickBtn(false);
            //_dialogueBoxTetragonumComponent.OpenClickBtn(false);
            //});
            break;

        case 3:
            await ChapterTool.FadeInFadeOut(_twoImagCanvasGroup, 0, fadeOut, null, () => { _twoImagCanvasGroup.gameObject.SetActive(false); });

            _dialogueBaseTwo.Initial(() =>
            {
                _dialogueBaseTwo.Close();
                Debug.Log("对话2完毕");
                ChapterTool.MoveUi(_bgTwoRect, new Vector3(-737, 0, 0), 0.8f, 0.2f);
                ChapterTool.ChangeUiSize(_bgTwoRect, new Vector3(2737, 5808, 1), 90, 10, null, () =>
                {
                    _phoneBtn.enabled = true;
                    _phoneBtn.transform.GetComponent <Image>().enabled = true;
                    _phoneBtn.transform.Find("ChapterClickGuidance").gameObject.SetActive(true);
                });
            }, SpeakAeforeActionTwo, SpeakRearActionTwo, SpeakBoxCloseActionTwo);
            _dialogueBaseTwo.Show();
            Debug.Log("对话2初始化完毕");
            break;

        case 4:
            Debug.Log("第四步");

            await _dialogueBaseTwo.CloseAllShowText();

            await UniTask.WaitUntil(() => _dialogueBaseTwo.IsAllClose(0));

            await UniTask.Delay(TimeSpan.FromSeconds(1));

            _dialogueBaseTwo.MomentCloseOrOpen(true);
            _dialogueBaseTwo.OpenClickBtn(false);
            _dialogueBaseTwo.gameObject.SetActive(false);
            ChapterTool.FadeInFadeOut(_fourCanvasGroup, 1, fadeOut, new CancellationTokenSource());
            await ChapterTool.FadeInFadeOut(_twoImagCanvasGroup, 0, fadeOut, null, () =>
            {
                _twoImageRect.gameObject.SetActive(false);
                _chapterGuidance.gameObject.SetActive(true);
                _chapterGuidance.PlayGuidanceAnima(_chapterGuidance.transform.localPosition, new Vector3(-40, 247));
            });

            break;

        case 5:
            ChapterTool.FadeInFadeOut(_cupCanvasGroup, 0, fadeOut, null, () => { _cupRect.gameObject.SetActive(false); });
            await ChapterTool.FadeInFadeOut(_bgtOneCanvasGroup, 0, fadeOut, new CancellationTokenSource(), () =>
            {
                _bgtOneCanvasGroup.gameObject.SetActive(false);
                _dialogueBaseTwo.gameObject.SetActive(true);
                _dialogueBaseTwo.MomentCloseOrOpen(false);
                _dialogueBaseTwo.OpenClickBtn(true);
                _dialogueBaseTwo.GetRoleData(10000001).SetRolePoint(new Vector3(24, 543));
                _dialogueBaseTwo.GetRoleData(10000002).SetRolePoint(new Vector3(0, -1550));
                _dialogueBaseTwo.ClickBtn();
            });

            break;

        case 6:
            _phoneBtn.enabled = false;
            await ChapterTool.FadeInFadeOut(_bgTwoCanvasGroup, 0, fadeOut, null, () => { _bgTwoRect.gameObject.SetActive(false); });

            break;

        case 7:
            OprnFour();
            break;

        case 8:
            _fiveBtnBoxRect.gameObject.SetActive(true);
            _fourRect.gameObject.SetActive(false);
            _answerThePhoneRect.gameObject.SetActive(false);
            break;
        }
    }