Example #1
0
    public override void onloaded(AssetBundles.NormalRes data)
    {
        byte[] asset = (data as AssetBundles.BytesRes).m_bytes;

        if (asset == null)
        {
            return;
        }

        m_data = new List <TD_SkillPrefabInfo>();

        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_SkillPrefabInfo item;

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

            item            = new TD_SkillPrefabInfo();
            item.id         = node.GetStringValue("id");
            item.scale      = node.GetStringValue("scale");
            item.rootScale  = node.GetStringValue("rootScale");
            item.enemyPoint = node.GetStringValue("enemyPoint");
            item.selfPoint  = node.GetStringValue("selfPoint");
            item.haveEnemy  = node.GetBooleanValue("haveEnemy");

            m_data.Add(item);
        }
        asset = null;

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

        base.onloaded(data);
    }
    public override void onloaded(AssetBundles.NormalRes data)
    {
        if (null != m_confidata)
        {
            return;
        }
        m_confidata = new Dictionary <int, TD_PositionAttribute>();

        byte[] asset = (data as AssetBundles.BytesRes).m_bytes;
        if (asset == null)
        {
            return;
        }
        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_PositionAttribute item;

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

            item          = new TD_PositionAttribute();
            item.pos      = node.GetIntValue("pos");
            item.powerPer = node.GetFloatValue("powerPer");
            item.distance = node.GetFloatValue("distance");
            item.isBound  = node.GetBooleanValue("bound");

            m_confidata[item.pos] = item;
        }
        asset = null;
        base.onloaded(data);
    }