Exemple #1
0
    void UpdateSearchUI()
    {
        if (searchRecordObj)
        {
            searchRecordObj.SetActive(false);
        }

        FriendSummaryList fslist      = Lobby.getInstance().CurrentSummaryList;
        GameObject        goNoResults = GameObject.Find("SearchNoResults");

        if (fslist.Data.Count > 0)
        {
            searchRecordObj.SetActive(true);
            GameObject go = GameObject.Find("SearchResult");
            go.SetActive(true);
            go.transform.Find("txtSearchResultName").GetComponent <Text>().text  = fslist.Data[0].Name;
            go.transform.Find("txtSearchResultLevel").GetComponent <Text>().text = fslist.Data[0].Level.ToString();
            int headIndex = Tools.StringToInt32(fslist.Data[0].HeadImgUrl);
            if (headIndex > 0)
            {
                GameObject goSrc = DialogSelectAvatar.GetHeadObject(fslist.Data[0].HeadImgUrl);
                go.transform.Find("ImgHead").GetComponent <Image>().sprite = goSrc.GetComponent <Image>().sprite;
            }

            if (goNoResults != null)
            {
                goNoResults.GetComponent <Text>().text = "";
            }
        }
        else
        {
            searchRecordObj.SetActive(false);
            if (goNoResults != null)
            {
                goNoResults.GetComponent <Text>().text = "NO RESULTS";
            }
        }
    }
Exemple #2
0
    public void AfterUpdateProfileHeadImgUrl()
    {
        GameObject goSrc = DialogSelectAvatar.GetHeadObject(m_headImgUrl);

        if (goSrc != null)
        {
            Lobby.getInstance().UserInfo.HeadImgUrl = m_headImgUrl;
            GameObject goDest =
                DialogPersonalInfo.GetInstance().transform.Find("main").
                transform.Find("BtnUpAvatar").gameObject;
            goDest.GetComponent <Image>().sprite = goSrc.GetComponent <Image>().sprite;
            GameObject.Find("BtnAvatar").transform.Find("BtnHead").GetComponent <Image>().sprite = goSrc.GetComponent <Image>().sprite;
        }
        else
        {
            GameObject goHeadDefault = GameObject.Find("BtnAvatar").transform.Find("BtnHeadDefault").gameObject;
            GameObject goDest        =
                DialogPersonalInfo.GetInstance().transform.Find("main").
                transform.Find("BtnUpAvatar").gameObject;
            goDest.GetComponent <Image>().sprite = goHeadDefault.GetComponent <Image>().sprite;
            GameObject.Find("BtnAvatar").transform.Find("BtnHead").GetComponent <Image>().sprite = goHeadDefault.GetComponent <Image>().sprite;
        }
    }
Exemple #3
0
    public void UpdateUserInfo()
    {
        if (null == inputNickNameObj)
        {
            return;
        }

        LionUserInfo ui = m_userInfo;

        // 区分自己和他人
        bool isSelf = m_userInfo.UserId == Lobby.getInstance().UId;

        // NickName
        if (isSelf)
        {
            valNickNameObj.SetActive(false);
            inputNickNameObj.SetActive(true);
            InputField field = inputNickNameObj.GetComponent <InputField>();
            field.text = ui.Name;
        }
        else
        {
            inputNickNameObj.SetActive(false);
            valNickNameObj.SetActive(true);
            valNickNameObj.GetComponent <Text>().text = ui.Name;
        }

        // Level
        GameObject.Find("valLevel").GetComponent <Text>().text = ui.Level.ToString();

        // Coins
        GameObject.Find("valCoins").GetComponent <Text>().text = Tools.CoinToString(ui.Gold);

        // Location
        GameObject.Find("valLocation").GetComponent <Text>().text = ui.Location;

        // Like
        GameObject.Find("valLike").GetComponent <Text>().text = ui.Praise.ToString();

        // UUID
        GameObject.Find("valUId").GetComponent <Text>().text = ui.UserId.ToString();

        // 头像
        //if (ui.HeadImgUrl != "")
        {
            GameObject goSrc = DialogSelectAvatar.GetHeadObject(ui.HeadImgUrl);;

            if (goSrc != null)
            {
                GameObject goDest =
                    DialogPersonalInfo.GetInstance().transform.Find("main").
                    transform.Find("BtnUpAvatar").gameObject;
                goDest.GetComponent <Image>().sprite = goSrc.GetComponent <Image>().sprite;
            }
            else
            {
                GameObject goHeadDefault = GameObject.Find("BtnAvatar").transform.Find("BtnHeadDefault").gameObject;
                GameObject goDest        =
                    DialogPersonalInfo.GetInstance().transform.Find("main").
                    transform.Find("BtnUpAvatar").gameObject;
                goDest.GetComponent <Image>().sprite = goHeadDefault.GetComponent <Image>().sprite;
            }
        }

        Reception recp = GameObject.Find("Reception").GetComponent <Reception>();

        recp.GetTigerStatInfo(m_userInfo.UserId, UpdateTigerStatUI);
    }