Esempio n. 1
0
 private void OnEnable()
 {
     if (_bgTra != null)
     {
         UniversalTool.StartUIAnimTwo(GetComponent <CanvasGroup>(), _bgTra);
     }
 }
Esempio n. 2
0
    /// <summary>
    /// 播放当前新手任务视频
    /// </summary>
    public async void PlayVideo()
    {
        //return;
        Debug.Log("播放动画");
        int           itemIndex = 0;
        RectTransform item      = _tyroTaskBoxMiddleScrollRect.CurrBeCentralItem(out itemIndex);

        if (_currShowItems == null || _currShowItems.Count <= 0)
        {
            OpenAllVideo(false);
            return;
        }

        TaskDefine data      = item.GetComponent <TaskPanelItem>()._ShowData;// _allTypeDataDic[Company.Cfg.TaskType.GuidanceTask][itemIndex];
        string     videoName = data.VideoName;

        if (!string.IsNullOrEmpty(videoName))
        {
            if (_haveVideoDic.ContainsKey(videoName) && _haveVideoDic[videoName].activeSelf == true)
            {
                if (_isPlayAnimation)
                {
                    _isPlayAnimation = false;
                    UniversalTool.StartUIAnimTwo(GetComponent <CanvasGroup>(), _thisBgRect);
                }
                return;
            }
            OpenAllVideo(false);
            if (_haveVideoDic.ContainsKey(videoName))
            {
                _haveVideoDic[videoName].SetActive(true);
            }
            else
            {
                //WaitManager.BeginRotate();
                //Debug.Log("+++++++++++++++++++++++++++++加载预制体:" + Time.realtimeSinceStartup);
                GameObject videoPrefabObj = await ABManager.GetAssetAsync <GameObject>(videoName);

                //Debug.Log("++++++++++++++++++++++++++++++++++++++加载预制体结束:" + Time.realtimeSinceStartup);
                //WaitManager.EndRotate();
                GameObject videoObj = GameObject.Instantiate(videoPrefabObj, _videRect);
                //Debug.Log("++++++++++++++++++++++++++++++++++++++++实例化预制体结束:" + Time.realtimeSinceStartup);
                videoObj.transform.localPosition = Vector3.zero;

                _haveVideoDic.Add(videoName, videoObj);
            }
        }
        else
        {
            OpenAllVideo(false);
        }
        if (_isPlayAnimation)
        {
            _isPlayAnimation = false;
            UniversalTool.StartUIAnimTwo(GetComponent <CanvasGroup>(), _thisBgRect);
        }
    }
Esempio n. 3
0
    private void GetManorLogInfo()
    {
        lsManorLog.ClearCells();
        //请求服务器,庄园日志,todo
        CSEmptyManorLogs csEmptyManorLogs = new CSEmptyManorLogs();

        ProtocalManager.Instance().SendCSEmptyManorLogs(csEmptyManorLogs, (scManorLogs) =>
        {
            if (scManorLogs != null)
            {
                listLogs = scManorLogs.StealInfo;
            }
            RefreshLogList();
            //
            UniversalTool.StartUIAnimTwo(_canvasGroup, _tra);
        }, (error) =>
        {
            StaticData.DebugGreen($"{error}");
        }, false);
    }
Esempio n. 4
0
 private void OnEnable()
 {
     UniversalTool.ReadyUIAnimTwo(_dealCG, _dealBG);
     UniversalTool.StartUIAnimTwo(_dealCG, _dealBG);
 }
Esempio n. 5
0
 //播放出现动画
 private void OnEnable()
 {
     UniversalTool.StartUIAnimTwo(canvasGroup, craneMachine);
 }
Esempio n. 6
0
 private void OnEnable()
 {
     UniversalTool.StartUIAnimTwo(GetComponent <CanvasGroup>(), _containerTF);
 }
Esempio n. 7
0
    /// <summary>
    /// 分页选择
    /// </summary>
    /// <param name="index">0:每日任务  1:新手任务</param>
    public void SelectToggle(int index)
    {
        if (index != 1)
        {
            if (_isPlayAnimation)
            {
                _isPlayAnimation = false;
                UniversalTool.StartUIAnimTwo(GetComponent <CanvasGroup>(), _thisBgRect);
            }
        }

        //if (_currPagingIndex == index)
        //{
        //    return;
        //}
        _currPagingIndex = index;
        List <TaskDefine> taskDefines = new List <TaskDefine>();
        Transform         parent      = null;

        switch (index)
        {
        case 0:
            _dailyTaskBoxRect.gameObject.SetActive(true);
            _tyroTaskBoxRect.gameObject.SetActive(false);
            parent = _dilyTaskBoxMiddleScrollRect.content;
            if (_allTypeDataDic.ContainsKey(Company.Cfg.TaskType.DailyTask))
            {
                taskDefines = _allTypeDataDic[Company.Cfg.TaskType.DailyTask];
            }
            break;

        case 1:
            _dailyTaskBoxRect.gameObject.SetActive(false);
            _tyroTaskBoxRect.gameObject.SetActive(true);
            parent = _tyroTaskBoxMiddleScrollRect.content;
            if (_allTypeDataDic.ContainsKey(Company.Cfg.TaskType.GuidanceTask))
            {
                taskDefines = _allTypeDataDic[Company.Cfg.TaskType.GuidanceTask];
            }
            break;
        }
        DisposeAllCurrShowItem();
        taskDefines = DataSort(taskDefines);

        for (int i = 0; i < taskDefines.Count; i++)
        {
            RectTransform itemTra       = CreationItem(parent).GetComponent <RectTransform>();
            TaskDefine    data          = taskDefines[i];
            TaskPanelItem taskPanelItem = itemTra.GetComponent <TaskPanelItem>();
            taskPanelItem.Initial(data, this);
            _currShowItems.Add(taskPanelItem);
            if (!_currShowItemDic.ContainsKey(data.TaskID))
            {
                _currShowItemDic.Add(data.TaskID, taskPanelItem);
            }
        }
        if (index == 0)
        {
            bool isOpen = IsOpenAKeyToGet();
            _aKeyToGetBtn.enabled = isOpen;
            Image btnIamge = _aKeyToGetBtn.transform.GetComponent <Image>();
            if (isOpen)
            {
                btnIamge.sprite = GetBtnSprite(1);
            }
            else
            {
                btnIamge.sprite = GetBtnSprite(2);
            }
        }

        if (index == 1)
        {
            _tyroTaskBoxSlideToTheLeftBtn.gameObject.SetActive(false);
            _tyroTaskBoxSlideToTheRightBtn.gameObject.SetActive(true);
            PlayVideo();
        }
        else
        {
            if (_isPlayAnimation)
            {
                _isPlayAnimation = false;
                UniversalTool.StartUIAnimTwo(GetComponent <CanvasGroup>(), _thisBgRect);
            }
        }
    }
Esempio n. 8
0
 private void OnEnable()
 {
     UniversalTool.StartUIAnimTwo(transform.Find("Box").GetComponent <CanvasGroup>(), transform.Find("Box"));
 }