Пример #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);
        }
    }
Пример #2
0
    void ShowModel()
    {
        int npcID = GameTableManager.Instance.GetGlobalConfig <int>("FinalTargetModelID");

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

            m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)modelID, 800);
            if (m_RTObj == null)
            {
                return;
            }

            m_RTObj.SetCamera(new Vector3(0, 1, 0), Vector3.zero, -4.85f);
            m_RTObj.SetModelRotateY(rotateY);
            //人物
            if (m__Model != null)
            {
                m__Model.mainTexture = m_RTObj.GetTexture();
                m__Model.MakePixelPerfect();
            }
        }
    }
Пример #3
0
 void OnDragModel(GameObject go, Vector2 delta)
 {
     if (m_RTObj != null)
     {
         rotateY += -0.5f * delta.x;
         m_RTObj.SetModelRotateY(rotateY);
     }
 }
Пример #4
0
 void OnDrag(Vector2 delta)
 {
     if (ready)
     {
         UICamera.currentTouch.clickNotification = UICamera.ClickNotification.None;
         rotateY += -0.5f * delta.x;
         renderObj.SetModelRotateY(rotateY);
     }
 }
Пример #5
0
    void InitModelPanel(uint ModelID)
    {
        //传入的数据全部都是在模型展示表格中的模型id
        ShowModelDataBase data = GameTableManager.Instance.GetTableItem <ShowModelDataBase>(ModelID);

        if (data == null)
        {
            return;
        }
        m_label_Name.text = data.ModelName;
        m_label_Des.text  = data.ModelDescription;

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

        m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)ModelID, 800);
        if (m_RTObj == null)
        {
            return;
        }

        // 0 1.52  0    7   45   0    5
        m_RTObj.SetCamera(new Vector3(0, data.quanOffsetY * 0.01f, 0), Vector3.zero, -data.quanDistance * 0.01f);
        //m_RTObj.SetCamera(new Vector3(0, 1.52f, 0), Vector3.zero, -4.89f);

        if (data.type == 1)
        {
            //eulerX = 0;
            m_label_BiaoTi.text = "珍兽详情";
        }
        else
        {
            //eulerX = -90;
            m_label_BiaoTi.text = "神兵详情";
            m_RTObj.AddLinkEffectWithoutEntity(10002);
            //CreateEffect(ModelID);
        }
        m_RTObj.SetModelRotateY(rotateY);
        //人物
        if (m__Model != null)
        {
            m__Model.mainTexture = m_RTObj.GetTexture();
            m__Model.MakePixelPerfect();
        }
    }
Пример #6
0
    private void CreatePlayerView()
    {
        if (null == m_RTObj)
        {
            m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj(DataManager.Instance.MainPlayer, 750);
            if (null != m_RTObj)
            {
                m_RTObj.SetModelRotateY(-135);
                m_RTObj.SetCamera(new Vector3(0, 1f, 0f), new Vector3(0, 45, 0), 4f);
                m_RTObj.PlayModelAni(Client.EntityAction.Show);

                if (m_RTObj != null)
                {
                    uint activeStoneSuitLv = DataManager.Manager <EquipManager>().ActiveStoneSuitLv;
                    DataManager.Manager <EquipManager>().AddEquipStoneSuitParticle(m_RTObj, activeStoneSuitLv);
                }
            }
        }
        SetPlayerFightPower();
    }
Пример #7
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);
    }
Пример #8
0
    void ShowRoleTexture(bool bPlayer, table.NpcDataBase npcDb = null)
    {
        if (m_RTObj != null)
        {
            m_RTObj.Release();
        }
        if (bPlayer)
        {
            m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj(MainPlayerHelper.GetMainPlayer(), 700);
        }
        else if (npcDb != null)
        {
            m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)npcDb.dwViewModelSet, 700);
        }
        if (m_RTObj == null)
        {
            return;
        }
        if (bPlayer)
        {
            Client.IPlayer player = MainPlayerHelper.GetMainPlayer();
            if (player == null)
            {
                return;
            }
            uint job = (uint)player.GetProp((int)Client.PlayerProp.Job);
            int  sex = (int)player.GetProp((int)Client.PlayerProp.Sex);
            table.SelectRoleDataBase roleSelectData = GameTableManager.Instance.GetTableItem <table.SelectRoleDataBase>(job, sex);
            float offsety  = 1.5f;
            float distance = 1.7f;
            float rotateX  = 0f;
            if (roleSelectData != null)
            {
                offsety  = roleSelectData.offsetY * 0.01f;
                distance = roleSelectData.distance * 0.01f;
                rotateX  = roleSelectData.diaRotateX * 0.01f;
            }

            m_RTObj.SetCamera(new Vector3(0f, offsety, 0), new Vector3(rotateX, 0, 0), distance);
            //m_RTObj.SetCamera(new Vector3(0f, offsety, 0), Vector3.zero, distance);
        }
        else
        {
            float offsety  = 1.0f;
            float distance = 1.7f;
            float rotateX  = 0f;
            if (npcDb != null)
            {
                offsety  = npcDb.diaOffsetY * 0.01f;
                distance = npcDb.diaDistance * 0.01f;
                rotateX  = npcDb.diaRotateX * 0.01f;
            }

            m_RTObj.SetCamera(new Vector3(0f, offsety, 0), new Vector3(rotateX, 0, 0), distance);
            //m_RTObj.SetCamera(new Vector3(0f, offsety, 0), Vector3.zero, distance);
        }
        rotateY = 170f;
        //设置人物旋转
        m_RTObj.SetModelRotateY(rotateY);
        m_RTObj.PlayModelAni(Client.EntityAction.Stand);

        //人物
        if (m__NpcTexture != null)
        {
            m__NpcTexture.mainTexture = m_RTObj.GetTexture();
            //m__NpcTexture.MakePixelPerfect();
        }
    }