Пример #1
0
    void CreatePetRenderTexture(int resID)
    {
        if (m_petRTObj != null)
        {
            m_petRTObj.Release();
            m_petRTObj = null;
        }
        m_petRTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj(resID, 750);
        if (null == m_petRTObj)
        {
            return;
        }
        ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>((uint)resID);

        if (modelDisp == null)
        {
            Engine.Utility.Log.Error("模型ID为{0}的模型展示数据为空", resID);
            return;
        }
        m_petRTObj.SetDisplayCamera(modelDisp.pos750, modelDisp.rotate750, modelDisp.Modelrotation);
        m_petRTObj.PlayModelAni(Client.EntityAction.Stand);
        UIRenderTexture rt = m__modelTexture.GetComponent <UIRenderTexture>();

        if (null == rt)
        {
            rt = m__modelTexture.gameObject.AddComponent <UIRenderTexture>();
        }
        if (null != rt)
        {
            rt.SetDepth(0);
            rt.Initialize(m_petRTObj, m_petRTObj.YAngle, new UnityEngine.Vector2(750, 750));
        }
    }
Пример #2
0
    protected override void OnShow(object data)
    {
        base.OnShow(data);

        if (data is table.RideDataBase)
        {
            table.RideDataBase database = data as table.RideDataBase;

            // m_label_name.text = "坐骑详细";
            m_label_rarity.text   = DataManager.Manager <RideManager>().GetRideQualityStr(database.quality);
            m_label_showname.text = database.name;
            table.RideFeedData feeddata = GameTableManager.Instance.GetTableItem <table.RideFeedData>(database.rideID, 0);
            if (feeddata != null)
            {
                float value = (feeddata.speed / 100.0f);
                m_label_speed.text = value.ToString() + "%";
            }
            m_label_getway.text = database.getWay;

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

            m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)database.viewresid, 512);
            if (m_RTObj == null)
            {
                return;
            }
            ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>(database.viewresid);
            if (modelDisp == null)
            {
                Engine.Utility.Log.Error("BOSS模型ID为{0}的模型展示数据为空", database.viewresid);
                return;
            }

            m_RTObj.SetDisplayCamera(modelDisp.pos512, modelDisp.rotate512, 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(512, 512));
            }
        }
    }
Пример #3
0
 void RefreshTexture(PetDataBase db)
 {
     InitControls();
     m_pdb = db;
     OnPlayAudio(null);
     if (db != null)
     {
         if (null != m__CharacterRenderTexture)
         {
             if (characterRenderobj != null)
             {
                 characterRenderobj.Release();
             }
             characterRenderobj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)db.viewModelID, 512);
             if (characterRenderobj == null)
             {
                 Engine.Utility.Log.Error("宠物模型id{0}创建贴图失败!", db.viewModelID);
                 return;
             }
             DataManager.Manager <PetDataManager>().AddRenderObj(db.viewModelID, characterRenderobj);
             ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>(db.viewModelID);
             if (modelDisp == null)
             {
                 Engine.Utility.Log.Error("宠物模型ID为{0}的模型展示数据为空", db.viewModelID);
                 return;
             }
             characterRenderobj.SetDisplayCamera(modelDisp.pos512, modelDisp.rotate512, modelDisp.Modelrotation);
             characterRenderobj.PlayModelAni(Client.EntityAction.Stand);
             UIRenderTexture rt = m__CharacterRenderTexture.GetComponent <UIRenderTexture>();
             if (null == rt)
             {
                 rt = m__CharacterRenderTexture.gameObject.AddComponent <UIRenderTexture>();
             }
             if (null != rt)
             {
                 rt.SetDepth(0);
                 rt.Initialize(characterRenderobj, characterRenderobj.YAngle, new Vector2(512, 512));
             }
         }
     }
 }
Пример #4
0
    void ShowModel(HuntingDataBase data)
    {
        string[] monID     = data.monsterID.Split('_');
        uint     monsterid = uint.Parse(monID[0]);

        table.NpcDataBase npcData = GameTableManager.Instance.GetTableItem <NpcDataBase>(monsterid);
        if (npcData != null)
        {
            uint modelID = npcData.dwViewModelSet;  // 使用观察模型
            if (m_RTObj != null)
            {
                m_RTObj.Release();
                m_RTObj = null;
            }

            m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)modelID, 800);
            if (m_RTObj == null)
            {
                return;
            }
            ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>(modelID);
            if (modelDisp == null)
            {
                Engine.Utility.Log.Error("BOSS模型ID为{0}的模型展示数据为空", modelID);
                return;
            }
            m_RTObj.SetDisplayCamera(modelDisp.pos800, modelDisp.rotate800, modelDisp.Modelrotation);
            m_RTObj.PlayModelAni(Client.EntityAction.Stand);
            UIRenderTexture rt = m__Model.GetComponent <UIRenderTexture>();
            if (null == rt)
            {
                rt = m__Model.gameObject.AddComponent <UIRenderTexture>();
            }
            if (null != rt)
            {
                rt.SetDepth(3);
                rt.Initialize(m_RTObj, m_RTObj.YAngle, new UnityEngine.Vector2(800, 800));
            }
        }
    }
Пример #5
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));
                }
            }
        }
    }