Exemplo n.º 1
0
    void ShowTips(SkillDatabase db, Transform item, Vector2 offset)
    {
        LongPress lp = item.GetComponent <LongPress>();

        if (lp == null)
        {
            lp = item.gameObject.AddComponent <LongPress>();
        }
        lp.InitLongPress(() =>
        {
            DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.PlayerSkillTipsPanel, panelShowAction: (pb) =>
            {
                if (null != pb && pb is PlayerSkillTipsPanel)
                {
                    PlayerSkillTipsPanel panel = pb as PlayerSkillTipsPanel;
                    if (panel != null)
                    {
                        panel.InitParentTransform(item, offset);
                        panel.ShowUI(PlayerSkillTipsPanel.SkillTipsType.Pet, db);
                    }
                }
            });
        },
                         () =>
        {
            DataManager.Manager <UIPanelManager>().HidePanel(PanelID.PlayerSkillTipsPanel);
        });
    }
Exemplo n.º 2
0
 void OnSkillGridUIEvent(UIEventType eventType, object data, object param)
 {
     switch (eventType)
     {
     case UIEventType.Click:
         UISkillGrid grid = data as UISkillGrid;
         if (grid != null)
         {
             if (grid.Data != null && grid.Data.skillid != 0)
             {
                 DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.PlayerSkillTipsPanel, panelShowAction: (pb) =>
                 {
                     if (null != pb && pb is PlayerSkillTipsPanel)
                     {
                         PlayerSkillTipsPanel panel = pb as PlayerSkillTipsPanel;
                         if (panel != null)
                         {
                             table.SkillDatabase skilldb = GameTableManager.Instance.GetTableItem <table.SkillDatabase>((uint)grid.Data.skillid, grid.Data.level);
                             panel.ShowUI(PlayerSkillTipsPanel.SkillTipsType.Pet, skilldb, grid.Data.level);
                             panel.InitParentTransform(grid.transform, new Vector2(0, 80));
                         }
                     }
                 });
             }
         }
         break;
     }
 }
Exemplo n.º 3
0
    /// <summary>
    /// 设置长按
    /// </summary>
    /// <param name="bSet">true是设置 false是清空</param>
    void SetLongPressEvent(bool bSet)
    {
        //暂时去除长按tips功能
        return;

        LongPress lp = this.gameObject.GetComponent <LongPress>();

        if (lp == null)
        {
            lp = this.gameObject.AddComponent <LongPress>();
        }
        if (bSet)
        {
            lp.InitLongPress(() =>
            {
                DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.PlayerSkillTipsPanel, panelShowAction: (pb) =>
                {
                    if (null != pb && pb is PlayerSkillTipsPanel)
                    {
                        PlayerSkillTipsPanel panel = pb as PlayerSkillTipsPanel;
                        Client.IPlayer mainPlayer  = ClientGlobal.Instance().MainPlayer;
                        if (mainPlayer == null)
                        {
                            return;
                        }
                        panel.InitParentTransform(transform, new Vector2(m_nSprwidth, m_nSprheight));

                        //bool bRide = DataManager.Manager<RideManager>().IsRide;
                        //if (!bRide)
                        {
                            table.SkillDatabase db = GameTableManager.Instance.GetTableItem <table.SkillDatabase>((uint)m_skillid, 1);
                            if (db != null)
                            {
                                if (m_skillBtnIndex == 9)//宠物技能
                                {
                                    panel.ShowUI(PlayerSkillTipsPanel.SkillTipsType.Pet, db);
                                }
                                else
                                {
                                    panel.ShowUI(PlayerSkillTipsPanel.SkillTipsType.Player, db);
                                }
                            }
                        }
                        //else
                        //{
                        //    table.RideSkillDes rideSkill = GameTableManager.Instance.GetTableItem<table.RideSkillDes>((uint)m_skillid);
                        //    if (rideSkill != null)
                        //    {
                        //        panel.ShowUI(PlayerSkillTipsPanel.SkillTipsType.Ride, rideSkill);
                        //    }
                        //}
                    }
                });
            },
                             () =>
            {
                DataManager.Manager <UIPanelManager>().HidePanel(PanelID.PlayerSkillTipsPanel);
            }, 500);
        }
        else
        {
            lp.InitLongPress(null, null);
        }
    }