Exemplo n.º 1
0
    void OnShowRideUI(RideData data)
    {
        m_label_level.text     = DataManager.Manager <RideManager>().GetRideQualityStr(data.quality);
        m_label_Ride_Name.text = data.name;
        m_label_speed.text     = data.GetSpeed().ToString() + "%";
        if (data.skill_ids != null)
        {
            OnShowRideSkill(data.skill_ids);
        }
        if (m_nModelId == data.modelid)
        {
            return;
        }
        if (m_RTObj_Ride != null)
        {
            m_RTObj_Ride.Release();
        }
        m_nModelId   = (int)data.modelid;
        m_RTObj_Ride = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj(m_nModelId, 512);
        if (m_RTObj_Ride == null)
        {
            return;
        }
        table.RideDataBase rideData = GameTableManager.Instance.GetTableItem <table.RideDataBase>(data.baseid);
        if (rideData == null)
        {
            return;
        }
        ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>(rideData.viewresid);

        if (modelDisp == null)
        {
            Engine.Utility.Log.Error("坐骑模型ID为{0}的模型展示数据为空", rideData.viewresid);
            return;
        }
        m_RTObj_Ride.SetDisplayCamera(modelDisp.pos512, modelDisp.rotate512, modelDisp.Modelrotation);
        m_RTObj_Ride.PlayModelAni(Client.EntityAction.Stand);
//         //设置人物旋转
//         m_RTObj_Ride.SetModelRotateY(rotateY);
//         m_RTObj_Ride.SetModelScale(data.modelScale);
//         //人物
        UIRenderTexture rt = m__rideModel.GetComponent <UIRenderTexture>();

        if (null == rt)
        {
            rt = m__rideModel.gameObject.AddComponent <UIRenderTexture>();
        }
        if (null != rt)
        {
            rt.SetDepth(0);
            rt.Initialize(m_RTObj_Ride, m_RTObj_Ride.YAngle, new Vector2(512, 512));
        }
    }
Exemplo n.º 2
0
    private void InitPropetyUI(RideData data)
    {
        m_rideid = 0;
        if (data != null)
        {
            m_rideid = data.id;

            UpdateFightState();

            if (m_label_Ride_Name != null)
            {
                m_label_Ride_Name.text = data.name;
            }

            if (m_label_level != null)
            {
                m_label_level.text = data.level.ToString();
            }

            if (m_label_RideSpeedLabel != null)
            {
                m_label_RideSpeedLabel.text = "速度+" + data.GetSpeed().ToString() + "%";
            }

            if (m_label_life != null)
            {
                m_label_life.text = data.life.ToString();
            }

            //m_btn_btn_diuqi.gameObject.SetActive(data.life <= 0);
            //m_btn_btn_seal.gameObject.SetActive(data.life > 0);
            if (m_label_Repletion != null)
            {
                m_label_Repletion.text = data.repletion.ToString() + "/" + data.maxRepletion;
            }


            table.RideFeedData maxFeedata = GameTableManager.Instance.GetTableItem <table.RideFeedData>(data.baseid, data.level + 1);
            if (maxFeedata != null)
            {
                table.RideFeedData feedata = GameTableManager.Instance.GetTableItem <table.RideFeedData>(data.baseid, data.level);
                if (feedata != null)
                {
                    m_label_maxLevel.enabled = false;

                    // m_btn_btn_addExp.gameObject.SetActive(true);
                    // m_label_expLabel.gameObject.SetActive(true);
                    //// m_slider_ExpSlider.gameObject.SetActive(true);
                    // m_label_expLabel.text = string.Format("{0}/{1}", data.exp, feedata.upExp);
                    // m_slider_ExpSlider.value = data.exp * 1.0f / feedata.upExp;
                }
            }
            else
            {
                m_label_maxLevel.enabled = true;
                m_btn_btn_addExp.gameObject.SetActive(false);
                m_label_expLabel.gameObject.SetActive(false);
                m_slider_ExpSlider.gameObject.SetActive(false);
            }

            if (baseRideId != data.modelid)
            {
                baseRideId = data.modelid;
                if (m_RTObj != null)
                {
                    m_RTObj.Release();
                }
                m__rideModel.gameObject.SetActive(true);
                m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)baseRideId, 750);
                if (m_RTObj == null)
                {
                    return;
                }
                ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>(baseRideId);
                if (modelDisp == null)
                {
                    Engine.Utility.Log.Error("BOSS模型ID为{0}的模型展示数据为空", baseRideId);
                    return;
                }

                m_RTObj.SetDisplayCamera(modelDisp.pos750, modelDisp.rotate750, modelDisp.Modelrotation);
                m_RTObj.PlayModelAni(Client.EntityAction.Stand);
                UIRenderTexture rt = m__rideModel.GetComponent <UIRenderTexture>();
                if (null == rt)
                {
                    rt = m__rideModel.gameObject.AddComponent <UIRenderTexture>();
                }
                if (null != rt)
                {
                    rt.SetDepth(0);
                    rt.Initialize(m_RTObj, m_RTObj.YAngle, new UnityEngine.Vector2(750, 750));
                }
            }
        }
    }
Exemplo n.º 3
0
    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);
    }