Esempio n. 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);
    }
Esempio n. 2
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);
     }
 }
Esempio n. 3
0
    //显示主持人
    void ShowCompere_Image(int index)
    {
        switch (index)
        {
        case 1:
            ChapterHelper.SetActive(compere_image.gameObject, true, async() =>
            {
                ChapterHelper.SetActive(papapa_image.gameObject, false);
                await UniTask.Delay(100);
                (compereHand_image.transform as RectTransform).DOAnchorPos(Resethand1Pos, 0.3f);
                compereHand_image.transform.DORotate(Resethand1Rotation, 0.3f);
                (compereHand2_image.transform as RectTransform).DOAnchorPos(Resethand2Pos, 0.3f);
                compereHand2_image.transform.DORotate(Resethand2Rotation, 0.3f);
            });
            dialogueBox.SetStartDialogueId(10000003);
            dialogueBox.Initial(() =>
            {
                dialogueBox.Close();
                //OpenClickBtn(true);
                ClickBtn();
            });
            dialogueBox.Show();
            break;

        case 2:
            particle.Clear();
            particle.Pause();    //暂停特效
            ChapterHelper.SetActive(compere_image.gameObject, true, () =>
            {
                ChapterHelper.SetActive(lecture_image.gameObject, false);
            });
            dialogueBox.SetStartDialogueId(10000007);
            dialogueBox.Initial(() =>
            {
                dialogueBox.Close();
                //OpenClickBtn(true);
                ClickBtn();
            });
            dialogueBox.Show();

            break;
        }
    }