Exemplo n.º 1
0
    public static void Parse(TextAsset Text)
    {
        XmlDocument doc = new XmlDocument();

        doc.LoadXml(Text.text);
        XmlNode Node = doc.SelectSingleNode("Config");

        if (Node != null)
        {
            XmlNodeList NodeList = Node.ChildNodes;
            if (NodeList != null && NodeList.Count > 0)
            {
                foreach (XmlElement e in NodeList)
                {
                    if (e == null || !e.GetType().Equals(typeof(XmlElement)))
                    {
                        continue;
                    }
                    FaceIconConfig config = new FaceIconConfig();
                    config.id      = int.Parse(e.GetAttribute("id"));
                    config.resname = e.GetAttribute("resname");
                    FaceIconDic.Add(config.id, config);
                }
            }
        }
    }
Exemplo n.º 2
0
 public void SetInfo(FaceIconConfig item)
 {
     id = item.id;
     if (FaceIcon != null)
     {
         FaceIcon.texture = ResManager.GetResource <Texture>(item.resname);
     }
 }
Exemplo n.º 3
0
    public void UpdatePanel()
    {
        GuestLoginInfo info = PlayerManager.info;

        PlayerName.text = info.name;
        PlayerManager.LastPlayerName = PlayerName.text;
        string icon_name = FaceIconConfig.GetResNameById(info.face);

        PlayerIcon.texture     = ResManager.GetResource <Texture>(icon_name);
        PlayerUpgradeText.text = DataManager.Instance.is_guest ? "账号升级" : "注销账号";
        //PlayerUpgrade.gameObject.SetActive(DataManager.Instance.is_guest);
    }
Exemplo n.º 4
0
    private void updateSecondUI()
    {
        GuestLoginInfo res  = PlayerManager.info;
        PlayerData     data = PlayerManager.player_data;

        player_grade.text = data.grade.ToString();
        player_gold.text  = data.money.ToString();
        player_name.text  = res.name.ToString();
        Root3D.SetActive(true);
        string icon_name = FaceIconConfig.GetResNameById(res.face);

        player_icon.texture = ResManager.GetResource <Texture>(icon_name);
    }
Exemplo n.º 5
0
    void CreateFaceItem(FaceIconConfig item)
    {
        GameObject go = Instantiate(FaceObj);

        if (go != null)
        {
            go.transform.parent        = FaceIconRoot.transform;
            go.transform.localScale    = Vector3.one;
            go.transform.localPosition = Vector3.zero;
            go.SetActive(true);
            FaceItem face = go.AddComponent <FaceItem>();
            go.AddComponent <ButtonClickListener>().onClick = SelectFaceIcon;
            face.SetInfo(item);
            FaceIconDic.Add(item.id, face);
        }
    }
Exemplo n.º 6
0
    void InitFaceIcon()
    {
        Dictionary <int, FaceIconConfig> dic = FaceIconConfig.FaceIconDic;

        for (int index = 0; index < dic.Count; index++)
        {
            FaceIconConfig item = dic[index];
            CreateFaceItem(item);
        }
        float   offsetY            = GameData.FaceIconWidth * Mathf.CeilToInt(((dic.Count) / GameData.FaceIconOneLineCount)) + GameData.FaceTitleWidth;//根据头像的个数计算title与title的offset
        Vector3 LastAddPhotoObjPos = AddPhotoObj.transform.localPosition;

        AddPhotoObj.transform.localPosition = new Vector3(LastAddPhotoObjPos.x, FirstTitle.transform.localPosition.y - offsetY, LastAddPhotoObjPos.z);
        if (FaceIconDic != null && FaceIconDic.Count > 0)
        {
            FaceIconDic[LastSelectFaceIcon].SetSelectFlag(true);
        }
    }