Esempio n. 1
0
    /// <summary>设置皮肤  isMain是否是主场</summary>
    public void SetGKSkin(bool isMain, Transform target)
    {
        TD_GKSkin cfg = InstanceProxy.Get <SkinConfig>().GKSkin;

        if (isMain)
        {
            SetSkin(target, cfg.skin, E_SkinPart.Skin);
            SetSkin(target, cfg.hair, E_SkinPart.Hair);
            SetSkin(target, cfg.cloth, E_SkinPart.Cloth);
        }
        else
        {
            SetSkin(target, cfg.skin2, E_SkinPart.Skin);
            SetSkin(target, cfg.hair2, E_SkinPart.Hair);
            SetSkin(target, cfg.cloth2, E_SkinPart.Cloth);
        }
    }
Esempio n. 2
0
    public override void onloaded(AssetBundles.NormalRes data)
    {
        byte[] asset = (data as AssetBundles.BytesRes).m_bytes;

        if (asset == null)
        {
            return;
        }

        m_teamData = new Dictionary <int, TD_TeamSkin>();

        TbXmlNode docNode = TbXml.Load(asset).docNode;

        if (docNode == null)
        {
            return;
        }

        List <TbXmlNode> xmlNodeList = docNode.GetNodes("Object/Property");
        int xmlNodeListLength        = xmlNodeList.Count;

        if (xmlNodeListLength < 1)
        {
            return;
        }

        TD_TeamSkin item;

        for (int i = 0; i < xmlNodeListLength; ++i)
        {
            TbXmlNode node = xmlNodeList[i] as TbXmlNode;

            item                 = new TD_TeamSkin();
            item.team            = node.GetIntValue("team");
            item.teamName        = node.GetStringValue("teamName");
            item.cloth           = node.GetStringValue("cloth");
            item.mainClothColor  = node.GetIntValue("mainClothColor");
            item.cloth2          = node.GetStringValue("cloth2");
            item.mainClothColor2 = node.GetIntValue("mainClothColor2");
            item.skin            = node.GetStringValue("skin");
            item.hair            = node.GetStringValue("hair");

            m_teamData[item.team] = item;
        }

        xmlNodeList       = docNode.GetNodes("Object/GKProperty");
        xmlNodeListLength = xmlNodeList.Count;
        TD_GKSkin gkItem = null;

        for (int i = 0; i < xmlNodeListLength; ++i)
        {
            TbXmlNode node = xmlNodeList[i] as TbXmlNode;

            gkItem        = new TD_GKSkin();
            gkItem.cloth  = node.GetStringValue("cloth");
            gkItem.cloth2 = node.GetStringValue("cloth2");
            gkItem.cloth3 = node.GetStringValue("cloth3");
            gkItem.skin   = node.GetStringValue("skin");
            gkItem.skin2  = node.GetStringValue("skin2");
            gkItem.skin3  = node.GetStringValue("skin3");
            gkItem.hair   = node.GetStringValue("hair");
            gkItem.hair2  = node.GetStringValue("hair2");
            gkItem.hair3  = node.GetStringValue("hair3");
        }

        m_gkData = gkItem;

        asset = null;

        if (null != m_callBack)
        {
            m_callBack();
            m_callBack = null;
        }

        base.onloaded(data);
    }