Ejemplo n.º 1
0
    public void DoNewFuncIconFlyEffect(GuideDefine.FuncOpenShowData showData)
    {
        CompleteNewFuncOpen(showData);
        Action <GuideDefine.FuncOpenShowData> onComplete = (data) =>
        {
            //执行下一个工作流
            Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.UIEVENTDOGUIDEWORKFLOW);
        };

        if (null == m_newFuncFlyGrid)
        {
            Transform flyTs = UIManager.GetObj(GridID.Uinewfuncflygrid);
            Util.AddChildToTarget(UIRootHelper.Instance.StretchTransRoot, flyTs);
            GameObject gObj = flyTs.gameObject;
            m_newFuncFlyGrid = gObj.GetComponent <UINewFuncFlyGrid>();
            if (null == m_newFuncFlyGrid)
            {
                m_newFuncFlyGrid = gObj.gameObject.AddComponent <UINewFuncFlyGrid>();
            }
            NGUITools.MarkParentAsChanged(gObj);
        }
        if (null != m_newFuncFlyGrid)
        {
            m_newFuncFlyGrid.StartFlyToTarget(showData, NewFuncFlyStartPos, onComplete);
        }
        else
        {
            onComplete.Invoke(showData);
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// 是否下一个新功能开启准备好了
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 private bool IsNextNewFuncOpenReady(out GuideDefine.FuncOpenShowData data)
 {
     if (TakeNextNewFuncOpen(out data) && IsNewFuncUIStatusReady(data))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 是否有下一个功能开启引导
 /// </summary>
 /// <returns></returns>
 private bool HaveNextNewFuncOpen()
 {
     GuideDefine.FuncOpenShowData newData = null;
     if (TakeNextNewFuncOpen(out newData))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 添加新功能开启到缓存列表
 /// </summary>
 /// <param name="funcId"></param>
 private void AddNewFuncOpen(uint funcId)
 {
     GuideDefine.FuncOpenShowData showData = new GuideDefine.FuncOpenShowData()
     {
         FOT        = GuideDefine.FuncOpenType.Base,
         FuncOpenId = funcId,
     };
     Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.UIEVENTNEWFUNCOPENADD, showData);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 充值新功能开启
 /// </summary>
 private void ResetFuncOpen()
 {
     //新功能提醒
     m_lst_alreadyDoFuncOpen.Clear();
     m_lst_canDoFuncOpen.Clear();
     m_lst_closeFuncOpen.Clear();
     m_FuncCommonNoticesQ.Clear();
     m_currentFuncOpenShowData = null;
     m_newFuncFlyGrid          = null;
     m_dic_completeFuncSort.Clear();
     m_bNewFuncDataReady = false;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 执行下一个新功能开启
 /// </summary>
 private bool DoNextNewFuncOpen()
 {
     if (IsDoingNewFuncOpen || IsDoingGuide(GuideDefine.GuideType.Constraint))
     {
         return(false);
     }
     GuideDefine.FuncOpenShowData newData = null;
     if (IsNextNewFuncOpenReady(out newData))
     {
         if (GuideManager.IsNewFunctionOpenNoticeEnable)
         {
             return(DoNewFuncOpen(newData));
         }
         else
         {
             CompleteNewFuncOpen(newData);
             return(false);
         }
     }
     return(false);
 }
Ejemplo n.º 7
0
    /// <summary>
    /// 是否新功能开启UI准备好
    /// </summary>
    /// <param name="isSkillOpen">是否为技能</param>
    /// <param name="newFuncOpenId"></param>
    /// <returns></returns>
    public bool IsNewFuncUIStatusReady(GuideDefine.FuncOpenShowData showData)
    {
        PanelID targetPanelId = PanelID.None;

        if (showData.FOT == GuideDefine.FuncOpenType.Skill)
        {
            targetPanelId = PanelID.MainPanel;
        }
        else if (showData.FOT == GuideDefine.FuncOpenType.Base)
        {
            GuideDefine.LocalFuncOpenData localdata = GuideDefine.LocalFuncOpenData.Create(showData.FuncOpenId);
            if (null != localdata)
            {
                targetPanelId = localdata.FlyToTargetDependPanel;
            }
        }
        if (targetPanelId == PanelID.None)
        {
            return(false);
        }
        return(DataManager.Manager <UIPanelManager>().IsPanelFocus(targetPanelId));
    }
Ejemplo n.º 8
0
    /// <summary>
    /// 添加新功能提醒到缓存
    /// </summary>
    /// <param name="showData"></param>
    private void OnNewFuncOpenAdd(GuideDefine.FuncOpenShowData showData)
    {
        if (null != showData)
        {
            bool add = false;
            if (showData.FOT == GuideDefine.FuncOpenType.Base)
            {
                GuideDefine.LocalFuncOpenData localdata = m_dic_funcOpenDatas[showData.FuncOpenId];
                if (IsNeedIgnoreByCondi(localdata.IgnoreCondi))
                {
                    CompleteNewFuncOpen(showData);
                }
                else if (!m_lst_canDoFuncOpen.Contains(showData.FuncOpenId))
                {
                    //1、添加到新功能提醒列表
                    m_lst_canDoFuncOpen.Add(showData.FuncOpenId);
                    //2、根据优先级排序
                    m_lst_canDoFuncOpen.Sort((left, right) =>
                    {
                        return(GuideDefine.LocalFuncOpenData.CompareFuncOpenPriority(left, right));
                    });
                    add = true;
                }
            }
            else if (showData.FOT == GuideDefine.FuncOpenType.Skill)
            {
                int count = m_FuncCommonNoticesQ.Count + 1;
                m_FuncCommonNoticesQ.Enqueue(showData);
                add = true;
            }

            if (add)
            {
                //执行下一个工作流
                Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.UIEVENTDOGUIDEWORKFLOW);
            }
        }
    }
Ejemplo n.º 9
0
 void OnEvent(int eventID, object data)
 {
     if (eventID == (int)GameEventID.SKILLSYSTEM_SETSKILLPOS)
     {
         stSetSkillPos sp = (stSetSkillPos)data;
         if (sp.pos == (uint)m_skillBtnIndex)
         {
             SkillDatabase db = GameTableManager.Instance.GetTableItem <SkillDatabase>(sp.skillid, 1);
             if (db != null)
             {
                 GuideDefine.FuncOpenShowData showData = new GuideDefine.FuncOpenShowData()
                 {
                     FOT       = GuideDefine.FuncOpenType.Skill,
                     Icon      = UIManager.BuildCircleIconName(db.iconPath),
                     TargetObj = this.gameObject,
                     Name      = db.strName,
                     Data      = data,
                 };
                 Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.UIEVENTNEWFUNCOPENADD, showData);
             }
         }
     }
 }
Ejemplo n.º 10
0
    /// <summary>
    /// 获取下一个新功能开启ID
    /// </summary>
    /// <param name="funcId"></param>
    /// <returns></returns>
    public bool TakeNextNewFuncOpen(out GuideDefine.FuncOpenShowData showData)
    {
        showData = null;
        if (null != m_FuncCommonNoticesQ &&
            m_FuncCommonNoticesQ.Count != 0 &&
            null != m_FuncCommonNoticesQ.Peek())
        {
            showData = (GuideDefine.FuncOpenShowData)m_FuncCommonNoticesQ.Peek();
            return(true);
        }
        else if (null != m_lst_canDoFuncOpen && m_lst_canDoFuncOpen.Count > 0)
        {
            GuideDefine.LocalFuncOpenData db = null;
            bool match = false;
            do
            {
                db       = GuideDefine.LocalFuncOpenData.Create(m_lst_canDoFuncOpen[0]);
                showData = db.ShowData;
                if (!IsNeedIgnoreByCondi(db.IgnoreCondi) &&
                    !m_lst_alreadyDoFuncOpen.Contains(db.FuncOpenId))
                {
                    match = true;
                }
                else
                {
                    CompleteNewFuncOpen(showData);
                }
            } while (!match && m_lst_canDoFuncOpen.Count > 0);

            if (match)
            {
                return(true);
            }
        }

        return(false);
    }
Ejemplo n.º 11
0
    void OnUIEvent(int type, object data)
    {
        switch (type)
        {
        case (int)Client.GameEventID.UIEVENT_UPDATEITEM:
        {
            OnUpdateItemDataUI(data);        //快捷使用道具
        }
        break;

        case (int)Client.GameEventID.UIEVENTNEWFUNCCOMPLETE:
        {
            if (data is GuideDefine.FuncOpenShowData)
            {
                GuideDefine.FuncOpenShowData guideData = (GuideDefine.FuncOpenShowData)data;
                if (guideData.FOT == GuideDefine.FuncOpenType.Skill)
                {        //SetSkillIcon
                    stSetSkillPos pos = (stSetSkillPos)guideData.Data;
                    for (int i = 0; i < m_lstSkillBtns.Count; i++)
                    {
                        if (m_lstSkillBtns[i].SkillIndex == pos.pos)
                        {
                            m_lstSkillBtns[i].Refresh();
                        }
                    }
                }
            }
        }
        break;

        case (int)Client.GameEventID.UIEVENT_SHORTCUTITEMUI:
        {
            InitShortcutUIAndData();
        }
        break;
        }
    }
Ejemplo n.º 12
0
 /// <summary>
 /// 读取新功能开启提示
 /// </summary>
 /// <param name="funcId"></param>
 private void OnNewFuncOpenRead(GuideDefine.FuncOpenShowData showData)
 {
     if (null == showData)
     {
         Engine.Utility.Log.Error("GuideManager->OnNewFuncOpenRead showdata null!");
         return;
     }
     //if (showData.FOT == GuideDefine.FuncOpenType.Base)
     //{
     //    CompleteNewFuncOpen(showData);
     //}else if (showData.FOT == GuideDefine.FuncOpenType.Skill)
     //{
     //    if (null != m_FuncCommonNoticesQ && null != m_FuncCommonNoticesQ.Peek())
     //    {
     //        GuideDefine.FuncOpenShowData cacheShowData = (GuideDefine.FuncOpenShowData)m_FuncCommonNoticesQ.Peek();
     //        if (cacheShowData.FuncOpenId ==  showData.FuncOpenId)
     //        {
     //            //取出第一个
     //            m_FuncCommonNoticesQ.Dequeue();
     //        }
     //    }
     //}
     DoNewFuncIconFlyEffect(showData);
 }
Ejemplo n.º 13
0
    /// <summary>
    /// 服务器下发已完成新功能ID
    /// </summary>
    /// <param name="completeIds"></param>
    public void OnNewFuncOpenInfoGet(List <uint> completeIds)
    {
        m_lst_alreadyDoFuncOpen.Clear();
        if (null != completeIds)
        {
            uint id = 0;
            GuideDefine.FuncOpenShowData showData = new GuideDefine.FuncOpenShowData()
            {
                FOT = GuideDefine.FuncOpenType.Base,
            };

            for (int i = 0; i < completeIds.Count; i++)
            {
                id = completeIds[i];
                if (m_lst_alreadyDoFuncOpen.Contains(id))
                {
                    continue;
                }
                showData.FuncOpenId = id;
                CompleteNewFuncOpen(showData);
            }
        }
        m_bNewFuncDataReady = true;
    }
Ejemplo n.º 14
0
 /// <summary>
 /// 是否下一个新功能开启准备好了
 /// </summary>
 /// <returns></returns>
 private bool IsNextNewFuncOpenReady()
 {
     GuideDefine.FuncOpenShowData newData = null;
     return(IsNextNewFuncOpenReady(out newData));
 }
Ejemplo n.º 15
0
    /// <summary>
    /// 添加到已完成功能提示列表
    /// </summary>
    /// <param name="funcId"></param>
    private void CompleteNewFuncOpen(GuideDefine.FuncOpenShowData showData)
    {
        if (null == showData)
        {
            return;
        }
        if (showData.FOT == GuideDefine.FuncOpenType.Base)
        {
            //1、从当前新功能开启列表中移除
            if (null != m_lst_canDoFuncOpen && m_lst_canDoFuncOpen.Contains(showData.FuncOpenId))
            {
                m_lst_canDoFuncOpen.Remove(showData.FuncOpenId);
            }

            bool add = false;
            //2、并添加到已完成提醒功能列表
            if (null != m_lst_alreadyDoFuncOpen && !m_lst_alreadyDoFuncOpen.Contains(showData.FuncOpenId))
            {
                m_lst_alreadyDoFuncOpen.Add(showData.FuncOpenId);
                add = true;
            }

            GuideDefine.LocalFuncOpenData openData = null;
            if (TryGetFuncOpenData(showData.FuncOpenId, out openData))
            {
                if (openData.NeedSort)
                {
                    List <uint> sortIds       = null;
                    bool        needRefreshUI = false;
                    if (!m_dic_completeFuncSort.TryGetValue(openData.SortGroup, out sortIds))
                    {
                        sortIds = new List <uint>();
                        sortIds.Add(showData.FuncOpenId);
                        m_dic_completeFuncSort.Add(openData.SortGroup, sortIds);
                        needRefreshUI = true;
                    }
                    else if (!sortIds.Contains(showData.FuncOpenId))
                    {
                        sortIds.Add(showData.FuncOpenId);
                        sortIds.Sort((left, right) =>
                        {
                            GuideDefine.LocalFuncOpenData leftData  = null;
                            GuideDefine.LocalFuncOpenData rightData = null;
                            if (TryGetFuncOpenData(left, out leftData) && TryGetFuncOpenData(right, out rightData))
                            {
                                return(leftData.SortID - rightData.SortID);
                            }
                            return(0);
                        });
                        needRefreshUI = true;
                    }
                    if (needRefreshUI)
                    {
                        DoRefreshNewFuncOpenStaus(openData.SortGroup);
                    }
                }
                else if (null != openData.CreateFuncObj && !openData.CreateFuncObj.activeSelf)
                {
                    openData.CreateFuncObj.SetActive(true);
                }
            }

            if (add)
            {
                Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.UIEVENTNEWFUNCOPEN, showData.FuncOpenId);
                //发送已完成消息
                SendNewFuncOpenComplete(showData.FuncOpenId);
            }
        }
        else if (showData.FOT == GuideDefine.FuncOpenType.Skill)
        {
            if (null != m_FuncCommonNoticesQ && m_FuncCommonNoticesQ.Count != 0)
            {
                GuideDefine.FuncOpenShowData cacheShowData = (GuideDefine.FuncOpenShowData)m_FuncCommonNoticesQ.Peek();
                if (cacheShowData.FuncOpenId == showData.FuncOpenId)
                {
                    //取出第一个
                    m_FuncCommonNoticesQ.Dequeue();
                }
            }
        }
        m_currentFuncOpenShowData = null;
        Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.UIEVENTNEWFUNCCOMPLETE, showData);
    }
Ejemplo n.º 16
0
    public void StartFlyToTarget(GuideDefine.FuncOpenShowData showData, Vector3 startWorldPos, Action <GuideDefine.FuncOpenShowData> complteCallback)
    {
        this.m_showData      = showData;
        this.complteCallback = complteCallback;
        if (null != m_tp && null != m_ts && null != m_playTween)
        {
            if (null != showData.TargetObj)
            {
                SetVisible(true);
                m_tp.from = startWorldPos;
                m_tp.to   = showData.TargetObj.transform.position;

                if (m_showData.FOT == GuideDefine.FuncOpenType.Base)
                {
                    if (null != m_IconTex && m_IconTex.cachedGameObject.activeSelf)
                    {
                        m_IconTex.cachedGameObject.SetActive(false);
                    }

                    if (null != m_sp_icon)
                    {
                        if (!m_sp_icon.cachedGameObject.activeSelf)
                        {
                            m_sp_icon.cachedGameObject.SetActive(true);
                        }
                        UIManager.GetAtlasAsyn(m_showData.Icon, ref m_flyIconCSAD, () =>
                        {
                            if (null != m_sp_icon)
                            {
                                m_sp_icon.atlas = null;
                            }
                        }, m_sp_icon);
                    }
                }
                else
                {
                    if (null != m_sp_icon && m_sp_icon.cachedGameObject.activeSelf)
                    {
                        m_sp_icon.cachedGameObject.SetActive(false);
                    }

                    if (null != m_IconTex)
                    {
                        if (!m_IconTex.cachedGameObject.activeSelf)
                        {
                            m_IconTex.cachedGameObject.SetActive(true);
                        }
                        UIManager.GetTextureAsyn(m_showData.Icon, ref m_fyIconTexCSAD, () =>
                        {
                            if (null != m_IconTex)
                            {
                                m_IconTex.mainTexture = null;
                            }
                        }, m_IconTex);
                    }
                }
                m_playTween.Play(true);
            }
            else
            {
                SetVisible(false);
                Release();
            }
        }
    }
Ejemplo n.º 17
0
 /// <summary>
 /// 执行新功能开启提示
 /// </summary>
 /// <param name="funcId"></param>
 private bool DoNewFuncOpen(GuideDefine.FuncOpenShowData showData)
 {
     m_currentFuncOpenShowData = showData;
     DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.NewFuncOpenPanel, data: m_currentFuncOpenShowData);
     return(true);
 }
Ejemplo n.º 18
0
    protected override void OnShow(object data)
    {
        base.OnShow(data);
        if (null != m_sprite_Icon)
        {
            DataManager.Manager <GuideManager>().NewFuncFlyStartPos = m_sprite_Icon.transform.position;
        }
        if (null != data && data is GuideDefine.FuncOpenShowData)
        {
            this.m_data = data as GuideDefine.FuncOpenShowData;

            if (null != m_label_NewFuncName)
            {
                m_label_NewFuncName.text = m_data.Name;
            }

            if (m_data.FOT == GuideDefine.FuncOpenType.Base)
            {
                if (null != m__TexIcon && m__TexIcon.cachedGameObject.activeSelf)
                {
                    m__TexIcon.cachedGameObject.SetActive(false);
                }

                if (null != m_sprite_Icon)
                {
                    if (!m_sprite_Icon.cachedGameObject.activeSelf)
                    {
                        m_sprite_Icon.cachedGameObject.SetActive(true);
                    }
                    UIManager.GetAtlasAsyn(m_data.Icon, ref m_flyCASD, () =>
                    {
                        if (null != m_sprite_Icon)
                        {
                            m_sprite_Icon.atlas = null;
                        }
                    }, m_sprite_Icon);
                }
            }
            else
            {
                if (null != m_sprite_Icon && m_sprite_Icon.cachedGameObject.activeSelf)
                {
                    m_sprite_Icon.cachedGameObject.SetActive(false);
                }

                if (null != m__TexIcon)
                {
                    if (!m__TexIcon.cachedGameObject.activeSelf)
                    {
                        m__TexIcon.cachedGameObject.SetActive(true);
                    }
                    UIManager.GetTextureAsyn(m_data.Icon, ref m_flyTexCASD, () =>
                    {
                        if (null != m__TexIcon)
                        {
                            m__TexIcon.mainTexture = null;
                        }
                    }, m__TexIcon);
                }
            }

            if (null != m_label_NewFuncOpenTxt)
            {
                m_label_NewFuncOpenTxt.text = m_data.Title;
            }
        }
        m_float_sinceShow = 0;
    }