Exemplo n.º 1
0
        private void HeadDownLoadCall(DownLoadResDesc res)
        {
            Debuger.Log("头像下载完成");
            PlayerInfo playerInfo = DataCenter.Instance.gamedata.playerInfo;

            playerInfo.WXTX_Icon_SpriteName = GD.HEAD_ICON_NAME;
            Debuger.Log("原始头像数据长度:" + res.bytes.Length);
            playerInfo.WXTX_Texture = res.texture;
            //Debuger.Log("头像数据长度JPG:" + res.texture.EncodeToJPG().Length);
            //Debuger.Log("缩放后头像数据长度JPG:" + GDFunc.ScaleTexture(res.texture, 100, 100).EncodeToJPG().Length);
            //Debuger.Log("缩放后头像数据长度PNG:" + GDFunc.ScaleTexture(res.texture, 100, 100).EncodeToPNG().Length);
            //playerInfo.WXTX_Texture = GDFunc.ScaleTexture(res.texture, 100, 100);
            //playerInfo.WXTX_Texture.LoadImage(res.bytes);
            //playerInfo.WXTX_Texture.LoadImage(res.texture.EncodeToJPG());
            playerInfo.WXTX_Texture.name = playerInfo.WXTX_Icon_SpriteName;
            playerInfo.WXTX_Datas        = res.bytes;
            //playerInfo.WXTX_Datas = res.texture.EncodeToJPG();
            //playerInfo.WXTX_Datas = playerInfo.WXTX_Texture.EncodeToPNG();
            Debuger.Log("最终头像数据长度:" + playerInfo.WXTX_Datas.Length);
            DealCommand.Instance.SendWXTX();
            DynamicAtlas.Instance.AddTexture(playerInfo.WXTX_Texture);

            //List<Texture> texList = new List<Texture>();
            //texList.Add(playerInfo.WXTX_Texture);
            //CreateAtlas.CreatAtlasFromTex(ResourcesManager.GetAtlas(Tags.MJ_DynamicAtlas), texList);

            ViewCenter.Instance.GetPanel <Panel_Hall>(PanelType.Hall).RefleshPlayerInfo();
            ControlCenter.Instance.UpdatePlayerInfo();
            DataSaveCenter.Instance.SavePlayerInfo();
        }
Exemplo n.º 2
0
 private void ImageDownLoadCall(DownLoadResDesc res)
 {
     Debuger.Log("图片下载完成!");
     Texture2D tex = res.texture;
 }