Exemple #1
0
 private void SelectFirst()
 {
     if (m_rideMgr.GetRideList().Count <= 0)
     {
         TipsManager.Instance.ShowTips(LocalTextType.Ride_Commond_nihaimeiyouzuoqibunengdakaizuoqijiemian);
         //UIPanelBase panelbase = this as UIPanelBase;
         UIFrameManager.Instance.OnCilckTogglePanel(PanelID.RidePanel, (int)UIPanelBase.FisrstTabsIndex, (int)TabMode.TuJian);
         //UIFrameManager.Instance.OnCilckTogglePanel(ref panelbase, 1, (int)TabMode.TuJian);
         //OnUIPageEventCallback(UIEventType.Click, m_dicTabs[(uint)RidePageEnum.RidePreView], true);
     }
     else if (m_UIGridCreatorBase != null)
     {
         UIRideGrid grid = m_UIGridCreatorBase.GetGrid <UIRideGrid>(0);
         if (grid != null)
         {
             OnRideGridUIEvent(UIEventType.Click, grid, null);
         }
     }
 }
    public int OnSelectRide(UIRideGrid grid)
    {
        RideData rideData = grid.RideData;

        if (m_RightRideData != null && grid.TransExpSelect == 2)
        {
            OnUnselectRight(); return(0);
        }
        else if (m_LeftRideData != null && grid.TransExpSelect == 1)
        {
            OnUnselectLeft(); return(0);
        }
        else if (m_LeftRideData == null)
        {
            if (rideData.id == DataManager.Manager <RideManager>().Auto_Ride)
            {
                TipsManager.Instance.ShowTips(LocalTextType.Ride_Inherit_chuzhanzhongdezuoqiwufachuancheng);
                return(0);
            }

            if (m_RightRideData != null && m_RightRideData.id == rideData.id)
            {
                TipsManager.Instance.ShowTips(LocalTextType.Ride_Inherit_bunengxuanzetongyigezuoqijinxingchuancheng);

                return(0);
            }
            m_LeftRideData = rideData;
            GetOldRideUIGo().SetActive(true);

            m_widget_old_select.gameObject.SetActive(false);
            m_widget_new_select.gameObject.SetActive(m_RightRideData == null);
            m_label_Old_level_Before.text = rideData.level.ToString();
            m_label_Old_level_After.text  = "0";
            m_label_Old_name.text         = rideData.name;
            m_label_Old_speed_Before.text = rideData.GetSpeed().ToString() + "%";
            m_label_Old_speed_After.text  = RideData.GetSpeedById_Level(rideData.baseid, 0) + "%";

            if (m__Old_icon != null)
            {
                UIManager.GetTextureAsyn(rideData.icon
                                         , ref iconOldAtlas, () =>
                {
                    if (null != m__Old_icon)
                    {
                        m__Icon.mainTexture = null;
                    }
                }, m__Old_icon
                                         , true);


                UISprite border = m__Old_icon.cachedTransform.parent.Find("IconBox").GetComponent <UISprite>();
                if (border != null)
                {
                    UIManager.GetAtlasAsyn(rideData.QualityBorderIcon
                                           , ref borderOldAtlas
                                           , () =>
                    {
                        if (null != border)
                        {
                            border.atlas = null;
                        }
                    }
                                           , border
                                           , true);
                }
            }


            TransExpType ttype = TransExpType.None;
            if (m_toggle_ptchuancheng.value)
            {
                ttype = TransExpType.Normal;
            }
            else if (m_toggle_wmchuancheng.value)
            {
                ttype = TransExpType.Perfect;
            }

            RefreshCostUI(ttype);

            return(1);
        }
        else if (m_RightRideData == null)
        {
            if (m_LeftRideData != null && m_LeftRideData.id == rideData.id)
            {
                TipsManager.Instance.ShowTips(LocalTextType.Ride_Inherit_bunengxuanzetongyigezuoqijinxingchuancheng);
                return(0);
            }
            m_RightRideData = rideData;
            GetNewRideUIGo().SetActive(true);
            m_widget_new_select.gameObject.SetActive(false);
            m_label_New_level_Before.text = m_RightRideData.level.ToString();
            m_label_New_name.text         = rideData.name;
            m_label_New_speed_Before.text = m_RightRideData.GetSpeed().ToString() + "%";

            if (m__New_icon != null)
            {
                UIManager.GetTextureAsyn(rideData.icon
                                         , ref iconNewdAtlas, () =>
                {
                    if (null != m__New_icon)
                    {
                        m__New_icon.mainTexture = null;
                    }
                }, m__New_icon, true);


                UISprite border = m__New_icon.cachedTransform.parent.Find("IconBox").GetComponent <UISprite>();
                if (border != null)
                {
                    UIManager.GetAtlasAsyn(rideData.QualityBorderIcon
                                           , ref borderNewAtlas, () =>
                    {
                        if (null != border)
                        {
                            border.atlas = null;
                        }
                    }, border, true);
                }
            }
            SetRightNewLevel();

            return(2);
        }
        return(0);
    }
Exemple #3
0
    public override void Release(bool depthRelease = true)
    {
        base.Release(depthRelease);
        m_currRideData = null;
        m_rideMgr.RidePropUpdateCallback = null;
        m_rideMgr.ValueUpdateEvent      -= OnValueUpdateEventArgs;

        if (m_preUIRideGrid != null)
        {
            m_preUIRideGrid.Release();
            m_preUIRideGrid.SetSelect(false);
            m_preUIRideGrid = null;
        }

        if (m_currUIRideGrid != null)
        {
            m_currUIRideGrid.Release();
            m_currUIRideGrid.SetSelect(false);
            m_currUIRideGrid = null;
        }

        if (null != iconOldAtlas)
        {
            iconOldAtlas.Release(true);
            iconOldAtlas = null;
        }

        if (null != iconNewdAtlas)
        {
            iconNewdAtlas.Release(true);
            iconNewdAtlas = null;
        }

        if (null != borderOldAtlas)
        {
            borderOldAtlas.Release(true);
            borderOldAtlas = null;
        }

        if (null != borderNewAtlas)
        {
            borderNewAtlas.Release(true);
            borderNewAtlas = null;
        }

        if (null != m_UIGridCreatorBase)
        {
            m_UIGridCreatorBase.Release();
        }

        if (null != m_ctor_tujianscroll)
        {
            m_ctor_tujianscroll.Release();
        }

        if (null != m_ctor_rideQRoot)
        {
            m_ctor_rideQRoot.Release();
        }
        if (particle != null)
        {
            particle.ReleaseParticle();
        }

        m_Content = TabMode.None;

        PropetyRelease();

        ResetAdoration();
    }
Exemple #4
0
    void OnRideGridUIEvent(UIEventType eventType, object data, object param)
    {
        switch (eventType)
        {
        case UIEventType.Click:
            UIRideGrid grid = data as UIRideGrid;
            if (grid != null)
            {
                if (grid.RideData.id == 0)
                {
                    if (grid.LastGrid)
                    {
                        //打开解锁提示
                        table.RideExpandData expand = GameTableManager.Instance.GetTableItem <table.RideExpandData>((uint)DataManager.Manager <RideManager>().ExpandNum);
                        TextManager          tmg    = DataManager.Manager <TextManager>();
                        if (expand != null)
                        {
                            TipsManager.Instance.ShowTipWindow(TipWindowType.YesNO
                                                               , tmg.GetLocalFormatText(LocalTextType.Ride_Commond_jiesuoxuyaoxiaohaoXdianjuan, expand.cost),
                                                               () => { DataManager.Instance.Sender.RideExpandMaxRide(); }, null, null, "增加坐骑栏");
                        }
                    }
                    else
                    {
                        TipsManager.Instance.ShowTips("更多炫酷坐骑可通过商城获得");
                    }
                    return;
                }


                m_preUIRideGrid = m_currUIRideGrid;
                if (m_preUIRideGrid != null)
                {
                    m_preUIRideGrid.SetSelect(false);
                }
                m_currUIRideGrid = grid;
                m_currUIRideGrid.SetSelect(true);

                m_currRideData = grid.RideData;


                if (m_Content == TabMode.MaJiu)
                {
                    InitPropetyUI(m_currRideData);
                }
                //else if (m_Content == TabMode.Page_技能)
                //{
                //    InitSkillUI(m_currRideData);
                //}
                //else if (m_Content == TabMode.Page_传承)
                //{
                //    int select = OnSelectRide(grid);
                //    if (select != 0)
                //    {
                //        grid.TransExpSelect = select;
                //        if (select == 1)
                //        {
                //            grid.SetSufferingState(true);
                //        }
                //        else if (select == 2)
                //        {
                //            grid.SetAdirationState(true);
                //        }
                //    }
                //}
            }
            break;
        }
    }