Exemplo n.º 1
0
    /// <summary>
    /// 显示模型
    /// </summary>
    /// <param name="lstSuit"></param>
    /// <param name="nJob"></param>
    /// <param name="nSex"></param>
    /// <param name="nSize"></param>
    private void OnShowModelTexture(List <GameCmd.SuitData> lstSuit, int nJob, int nSex, int nSize = 700)
    {
        if (m_RTObj_Player != null)
        {
            m_RTObj_Player.Release();
        }
        m_RTObj_Player = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj(lstSuit, nJob, nSex, nSize);
        if (m_RTObj_Player == null)
        {
            Engine.Utility.Log.Error("Create rt obj failed");
            return;
        }
        m_RTObj_Player.SetModelRotateY(-135f);
        m_RTObj_Player.SetCamera(new Vector3(0, 1f, 0f), new Vector3(0, 45, 0), 4f);
        m_RTObj_Player.PlayModelAni(Client.EntityAction.Stand);

        UIRenderTexture rt = m__modelTexture.GetComponent <UIRenderTexture>();

        if (null == rt)
        {
            rt = m__modelTexture.gameObject.AddComponent <UIRenderTexture>();
        }
        if (null != rt)
        {
            rt.SetDepth(1);
            rt.Initialize(m_RTObj_Player, -135f, new Vector2(700f, 700f), null);
        }
    }
Exemplo n.º 2
0
    void OnShowPetTexture(table.PetDataBase petdb)
    {
        if (m_RTObj_Pet != null)
        {
            m_RTObj_Pet.Release();
        }
        m_RTObj_Pet = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)petdb.modelID, 512);
        if (m_RTObj_Pet == null)
        {
            return;
        }
//        float rotateY = 170f;
        ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>(petdb.modelID);

        if (modelDisp == null)
        {
            Engine.Utility.Log.Error("宠物模型ID为{0}的模型展示数据为空", petdb.modelID);
            return;
        }
        m_RTObj_Pet.SetDisplayCamera(modelDisp.pos512, modelDisp.rotate512, modelDisp.Modelrotation);
        m_RTObj_Pet.PlayModelAni(Client.EntityAction.Stand);
        UIRenderTexture rt = m__PetModel.GetComponent <UIRenderTexture>();

        if (null == rt)
        {
            rt = m__PetModel.gameObject.AddComponent <UIRenderTexture>();
        }
        if (null != rt)
        {
            rt.SetDepth(0);
            rt.Initialize(m_RTObj_Pet, m_RTObj_Pet.YAngle, new Vector2(512, 512));
        }
    }
Exemplo n.º 3
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));
        }
    }
Exemplo n.º 4
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.º 5
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));
            }
        }
    }
Exemplo n.º 6
0
    void InitRt()
    {
        RideData data = m_rideMgr.GetRideDataById(m_rideMgr.Auto_Ride);

        if (data == null)
        {
            if (m_KnightRTObj != null)
            {
                m_KnightRTObj.Release();
            }
            return;
        }
        if (rtBaseID != data.modelid)
        {
            rtBaseID = data.modelid;
            if (m_KnightRTObj != null)
            {
                m_KnightRTObj.Release();
            }

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

            m_KnightRTObj.SetDisplayCamera(modelDisp.pos750, modelDisp.rotate750, modelDisp.Modelrotation);
            m_KnightRTObj.PlayModelAni(Client.EntityAction.Stand);
            UIRenderTexture rt = m__rideModel2.GetComponent <UIRenderTexture>();
            if (null == rt)
            {
                rt = m__rideModel2.gameObject.AddComponent <UIRenderTexture>();
            }
            if (null != rt)
            {
                rt.SetDepth(0);
                rt.Initialize(m_KnightRTObj, m_KnightRTObj.YAngle, new UnityEngine.Vector2(750, 750));
            }
        }
    }
Exemplo n.º 7
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));
             }
         }
     }
 }
Exemplo n.º 8
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));
            }
        }
    }
Exemplo n.º 9
0
    public void SetModel(List <SuitData> suitData, int job, uint faceId)
    {
        int sex = 0;

        sex = (int)GameUtil.FaceToSex(faceId);

        rtGo.SetActive(true);

        if (suitData == null)//机器人无时装数据
        {
            suitData = new List <SuitData>();
            SuitData sd = new SuitData {
                baseid = 0, suit_type = EquipSuitType.Unknow_Type
            };
            suitData.Add(sd);
        }

        if (rtObj != null)
        {
            rtObj.Release();
        }
        rtObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj(suitData, job, sex, 700);
        if (rtObj == null)
        {
            return;
        }

        UIRenderTexture rt = rtGo.GetComponent <UIRenderTexture>();

        if (rt == null)
        {
            rt = rtGo.AddComponent <UIRenderTexture>();
        }
        rtObj.SetModelRotateY(180);
        rtObj.SetModelScale(1f);
        rtObj.SetCamera(new Vector3(0, 1f, 0f), new Vector3(15, 0, 0), 4f);
        rt.SetDepth(3);
        rt.Initialize(rtObj, 180f, new UnityEngine.Vector2(600f, 600f));
        rtObj.PlayModelAni(Client.EntityAction.Stand);
    }
Exemplo n.º 10
0
 void ShowPetRenderTex(bool bShow)
 {
     if (m_petRTObj == null)
     {
         // Engine.Utility.Log.Error("pet rt obj is null");
         return;
     }
     if (m_petRTObj != null)
     {
         m_petRTObj.Enable(bShow);
         if (!bShow)
         {
             return;
         }
     }
     if (null != m__modelTexture)
     {
         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 Vector2(750, 750), () =>
             {
                 DataManager.Manager <UIPanelManager>().HidePanel(PanelID.FashionTips);
             });
         }
         SetRenderTexPos(m_petRTObj);
     }
     else
     {
         m_petRTObj.Release();
         m_petRTObj = null;
     }
 }
Exemplo n.º 11
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));
                }
            }
        }
    }