예제 #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);
    }
예제 #2
0
    /// <summary>获取项</summary>
    /// <returns></returns>
    public TD_SkillPrefabInfo GetItem(string id)
    {
        TD_SkillPrefabInfo itm = null;

        int cnt = m_data.Count;

        for (int i = 0; i < cnt; i++)
        {
            if (m_data[i].id.CompareTo(id) == 0)
            {
                return(m_data[i]);
            }
        }


        return(itm);
    }
예제 #3
0
    public void InitParams(string resId)
    {
        Vector3 scale = Target.localScale;

        scale.x *= FaceX;

        Target.localScale = scale;

        mOldScale    = Target.localScale;
        mOldPosition = Target.position;

        float per = AdaptScale / Mathf.Abs(mOldScale.x);

        scaleB = Target.localScale * per;

        mCfgItem = ProxyInstance.InstanceProxy.Get <SkillPrefabInfoConfig>().GetItem(resId);
        PVPManager.Instance.TweenOut_IsSng = mCfgItem.haveEnemy;
    }