Пример #1
0
 async void ShowOneScene()
 {
     await ChapterTool.MoveUi(_oneScene.Find("bg") as RectTransform, new Vector2(-843f, 0f), 0.1f, 0.1f, null, () =>
     {
         ClickBtn();
     });
 }
Пример #2
0
    /// <summary>
    /// 步骤切换
    /// </summary>
    /// <param name="index"></param>
    public async void StepCut(int index)
    {
        switch (index)
        {
        case 0:
            await ChapterTool.MoveUi(_oneRect, new Vector2(1320.1f, 0), 0.1f, 0.1f, null, () => { _phoneBtn.enabled = true; _phoneBtn.gameObject.SetActive(true); });

            break;
        }
    }
Пример #3
0
    public async override void MoveEnd()
    {
        await ChapterTool.MoveUi(bg, new Vector2(-517.5f, 0f), 0.1f, 0.1f, null, () =>
        {
            DialogueBox_two.Initial(() =>
            {
                DialogueBox_two.Close();
            }, DialogueBeforeAction);
            DialogueBox_two.Show();
        });

        base.MoveEnd();
    }
Пример #4
0
    async void MoveThreeScene()
    {
        RectTransform bg = _threeScene.Find("Image_1") as RectTransform;
        await ChapterTool.MoveUi(bg, new Vector2(-929.71f, 0), 0.1f, 0.1f, null, () =>
        {
            threeubbleComponent.Initial(() =>
            {
                ClickBtn();
                threeubbleComponent.Close();
            });
        });

        threeubbleComponent.Show();
    }
Пример #5
0
    /// <summary>
    /// 人物说话前回调(移动镜头)
    /// </summary>
    /// <param name="data"></param>
    public async void SpeakAeforeAction_Two(ChapterDialogueTextDefine data)
    {
        _dialogueTwo.SetRoleSpeakAeforeAwait(true);
        float x = 589;

        switch (data.NameID)
        {
        case 10000001:
            x = 589;
            break;

        case 10000002:
            x = -452;
            break;

        case 10000004:
            x = 203;
            break;
        }
        await ChapterTool.MoveUi(_twoScene, new Vector2(x, _twoScene.localPosition.y), moveXspeed, 0.1f, null, () =>
        {
            if (data.ID == 12000001)
            {
                SwitchFace(3);
            }
            if (data.ID == 12000002 || data.ID == 12000005 || data.ID == 12000009)
            {//爷说话 说话前女闭嘴
                yeyeFace_scene1.gameObject.SetActive(false);
            }
            if (data.ID == 12000003 || data.ID == 12000007 || data.ID == 12000014)
            {                  //女主说话切换表情
                SwitchFace(1); //眯眼笑
            }
            if (data.ID == 12000006)
            {                  //打算的话。。。
                SwitchFace(4); //o嘴
            }
            if (data.ID == 12000010 || data.ID == 12000012)
            {
                SwitchFace(2);//害羞
            }
            if (data.ID == 12000011 || data.ID == 12000013)
            {//男说话 女主闭嘴
                nanzhuFace_scene1.gameObject.SetActive(true);
            }

            _dialogueTwo.SetRoleSpeakAeforeAwait(false);
        });
    }
Пример #6
0
 //场景1移动
 async void moveOne()
 {
     await ChapterTool.MoveUi(_oneScene, new Vector2(-621, 0), moveXspeed, 0.1f, null, () => { ClickBtn(); });
 }
Пример #7
0
    /// <summary>
    /// 杂草按钮点击
    /// </summary>
    /// <param name="tage"></param>
    public async void ClickWeedBtn(Transform tage)
    {
        Vector3 targetPos = tage.transform.localPosition;
        var     weedindex = _weedBtns.IndexOf(tage.GetComponent <Button>());

        if (weedindex == _currWeedIndex && weedCount != 0)
        {//点击当前除草区域不给予任何提示
            return;
        }
        if (isWeeding)
        {
            StaticData.CreateToastTips(ChapterTool.GetChapterFunctionString(10000541));//还没割完草
            return;
        }
        OpenAllWeedBtn(false);
        if (weedCount == 1)
        {
            createGuidance?.Invoke();
        }
        if (_roleRect.localPosition.x <= targetPos.x)
        {//向右
            if (weedindex == 1 || weedindex == 4 || weedindex == 7)
            {
                targetPos = new Vector3(targetPos.x - 65, targetPos.y, targetPos.z);//中间的草根据转向人物停止目标点修改
            }
            roleWeedingAnimatorController.SetBool("IsRight", true);
            roleWeedingAnimatorController.SetBool("IsRun", true);
        }
        else
        {//向左
            if (weedindex == 1 || weedindex == 4 || weedindex == 7)
            {
                targetPos = new Vector3(targetPos.x + 65, targetPos.y, targetPos.z);
            }
            roleWeedingAnimatorController.SetBool("IsLeft", true);
            roleWeedingAnimatorController.SetBool("IsRun", true);
        }
        _currWeedIndex = _weedBtns.IndexOf(tage.GetComponent <Button>());

        await ChapterTool.MoveUi(_roleRect, targetPos, 1, 0.5f, null, async() =>
        {
            OpenAllWeedBtn(true);
            //到达后播放待机动画
            roleWeedingAnimatorController.SetBool("IsLeft", false);
            roleWeedingAnimatorController.SetBool("IsRight", false);
            roleWeedingAnimatorController.SetBool("IsRun", false);
            //隐藏镰刀图片
            _weedBtns[weedindex].transform.Find("Image").gameObject.SetActive(false);
            //到达后自动播放锄草
            WeedingAnimaPlaying();
            //await UniTask.DelayFrame(1);
            //roleWeedingAnimatorController.SetBool("IsArrive", false);
            //除草按钮
            //if (_weedBtns[_currWeedIndex].gameObject.activeSelf)
            //{
            //    _weedingBtn.gameObject.SetActive(true);
            //}
            //else
            //{
            //    _weedingBtn.gameObject.SetActive(false);
            //}
        });
    }
Пример #8
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;
        }
    }