Exemple #1
0
    public void SetHead(UITexture tex, uint faceID, uint playerID, uint crc, HeaderOptType opt, object extraData = null)
    {
        string url      = SDKMgr.Instance.SDK.GetHeadUrl();
        bool   optValid = false;

        switch (opt)
        {
        case HeaderOptType.HEADER_GAME_SHARE:
        case HeaderOptType.HEADER_ME:
        case HeaderOptType.HEADER_CAR_SELF:
        case HeaderOptType.HEADER_UPLOAD:
            optValid = true;
            break;
        }
        if (!string.IsNullOrEmpty(url) && optValid)
        {
            AsyncImageDownload.Instance.SetAsyncImage(url, tex);
        }
        else
        {
            if (faceID < ConstValue.CUSTOM_HEADER)
            {
                tex.mainTexture = GlobalHallUIMgr.Instance.m_HeadTextureUI[faceID];
            }
            else
            {
                GetPlayerHeader(playerID, crc, opt, extraData);
            }
        }
    }
Exemple #2
0
    public void GetPlayerHeader(uint playerid, uint crc, HeaderOptType opt, object extraData)
    {
        DownPlayerHeader dph = new DownPlayerHeader();

        dph.PlayerID  = playerid;
        dph.Crc       = crc;
        dph.Opt       = (byte)opt;
        dph.extraData = extraData;
        m_DownList.Add(dph);
        //SceneMain.Instance.StartInnerCoroutine(GetHeader(dph));
    }
Exemple #3
0
    //玩家的头像获取结果。
    public void GetPlayerHeaderResult(uint id, Texture2D tex, HeaderOptType opt, object extraData)
    {
        switch (opt)
        {
        case HeaderOptType.HEADER_ME:
            GlobalHallUIMgr.Instance.SetMyHeader(tex);
            if (SceneRuntime.Instance != null)
            {
                SceneRuntime.LogicUI.SetMySelfHeader(tex);
            }
            break;

        case HeaderOptType.HEADER_UPLOAD:       //上传
            GlobalHallUIMgr.Instance.SetMyHeader(tex);
            if (HallRunTimeInfo.Instance_UI != null)
            {
                HallRunTimeInfo.Instance_UI.m_loginUi.SetMyHeader(tex);
            }
            break;

        case HeaderOptType.HEADER_SCENE:        //场景中玩家头像
            if (SceneRuntime.Instance != null)
            {
                SceneRuntime.PlayerMgr.SetPlayerHeader(id, (byte)extraData, tex);
            }
            break;

        case HeaderOptType.HEADER_FRIEND:       //好友
            if (FriendRuntime.Instance != null)
            {
                FriendRuntime.FriendSysMgr.SetHeader(id, (byte)extraData, tex);
            }
            break;

        case HeaderOptType.HEADER_FIND:         //查找好友中玩家头像
            if (FriendRuntime.Instance != null)
            {
                FriendRuntime.SearchUI.SetHeader(id, tex);
            }
            break;

        case HeaderOptType.HEADER_BLACK:        //黑名单中玩家头像
            if (FriendRuntime.Instance != null)
            {
                FriendRuntime.BlacklistUI.SetHeader(id, tex);
            }
            break;

        case HeaderOptType.HEADER_RANK:         //排行榜
            if (HallRunTimeInfo.Instance_UI != null)
            {
                HallRunTimeInfo.Instance_UI.m_loginUi.SetInformationHeader(id, (byte)extraData, tex);
            }
            break;

        case HeaderOptType.HEADER_MATCH:        //比赛排行榜数据
        {
            if (HallRunTimeInfo.Instance_UI != null)
            {
                HallRunTimeInfo.Instance_UI.m_loginUi.SetHeader(id, tex);
            }
        }
        break;

        case HeaderOptType.HEADER_CARDS:        //名片头像
        {
            GlobalHallUIMgr.Instance.SetCardsHeader(id, tex);
        }
        break;

        case HeaderOptType.HEADER_NIUNIU:
        {
            if (GlobalHallUIMgr.Instance != null)
            {
                GlobalHallUIMgr.Instance.SetPlayerHeader(tex);
            }
        }
        break;

        case HeaderOptType.HEADER_NIUNIUHOST:
        {
            if (GlobalHallUIMgr.Instance != null)
            {
                GlobalHallUIMgr.Instance.SetNiuniuHostHeader(tex);
            }
        }
        break;

        case HeaderOptType.HEADER_NIUNIUVIP:
        {
            if (GlobalHallUIMgr.Instance != null)
            {
                GlobalHallUIMgr.Instance.NiuniuSetVipHead((byte)extraData, tex);
            }
        }
        break;

        case HeaderOptType.HEADER_NIUNIUNORMAL:
        {
            if (GlobalHallUIMgr.Instance != null)
            {
                GlobalHallUIMgr.Instance.NiuniuSetNormalHead(tex, id, (byte)extraData);
            }
        }
        break;

        case HeaderOptType.HEADER_MATCHRANK:
        {
            if (SceneRuntime.Instance != null)
            {
                SceneRuntime.LogicUI.SetSceneMatchRankHeader(tex, id);
            }
        }
        break;

        case HeaderOptType.HEADER_FORESTDANCE:
        {
            if (GlobalHallUIMgr.Instance != null)
            {
                GlobalHallUIMgr.Instance.ForestDanceSetPlayerHead(tex);
            }
        }
        break;

        case HeaderOptType.HEADER_FORESTDANCEVIP:
        {
            if (GlobalHallUIMgr.Instance != null)
            {
                GlobalHallUIMgr.Instance.ForestDanceSetVipHead((byte)extraData, tex);
            }
        }
        break;

        case HeaderOptType.HEADER_FORESTDANCEHOST:
        {
            if (GlobalHallUIMgr.Instance != null)
            {
                GlobalHallUIMgr.Instance.ForestDanceSetHostHead(tex);
            }
        }
        break;

        case HeaderOptType.HEADER_FORESTDANCENORMAL:
        {
            if (GlobalHallUIMgr.Instance != null)
            {
                GlobalHallUIMgr.Instance.ForestDanceSetNormalHead(tex, id, (byte)extraData);
            }
            break;
        }

        case HeaderOptType.HEADER_CAR_SELF:
        {
            if (GlobalHallUIMgr.Instance != null)
            {
                GlobalHallUIMgr.Instance.SetCarAvetarSelf(tex);
            }

            break;
        }

        case HeaderOptType.HEADER_CAR_HOST:
        {
            if (GlobalHallUIMgr.Instance != null)
            {
                GlobalHallUIMgr.Instance.SetCarAvetarHost(tex);
            }
            break;
        }

        case HeaderOptType.HEADER_CAR_PlAYER_LIST:
        {
            if (GlobalHallUIMgr.Instance != null)
            {
                GlobalHallUIMgr.Instance.SetCarAvetarPlayList(tex, id, (byte)extraData);
            }
            break;
        }

        case HeaderOptType.HEADER_GAME_SHARE:
        {
            if (GlobalHallUIMgr.Instance != null)
            {
                GlobalHallUIMgr.Instance.GameShare.SetAvatar(tex);
            }
            break;
        }
        }
    }