Esempio n. 1
0
    bool LoadCloneSceneProperty()
    {
        byte[] asset = ResourceManager.Instance.GetXml("CloneScene");
        if (asset == null)
        {
            return(false);
        }

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

        if (docNode == null)
        {
            return(false);
        }

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

        if (xmlNodeListLength < 1)
        {
            return(false);
        }

        for (int i = 0; i < xmlNodeListLength; ++i)
        {
            TbXmlNode          node = xmlNodeList[i] as TbXmlNode;
            CloneSceneProperty cs   = new CloneSceneProperty();
            int id = node.GetIntValue("CloneSceneId");

            cs.mCloneSceneMonsterInfoList = new List <CloneSceneProperty.CloneSceneMonsterInfo>();
            List <TbXmlNode> childNode = node.GetNodes("CloneSceneMonsterInfo");
            for (int j = 0; j < childNode.Count; ++j)
            {
                TbXmlNode child = childNode[j] as TbXmlNode;
                CloneSceneProperty.CloneSceneMonsterInfo csm = new CloneSceneProperty.CloneSceneMonsterInfo();
                csm.mMonsterId        = child.GetIntValue("MonsterId");
                csm.mMonsterPosition  = UtilTools.FormatStringVector3(child.GetStringValue("MonsterPosition"));
                csm.mMonsterRotationY = child.GetFloatValue("MonsterRotationY");
                csm.mMonsterScale     = child.GetFloatValue("MonsterScale");

                cs.mCloneSceneMonsterInfoList.Add(csm);
            }

            mCloneScenePropertyDic.Add(id, cs);
        }

        return(true);
    }
Esempio n. 2
0
    public override void onloaded(AssetBundles.NormalRes data)
    {
        if (null != m_confidata)
        {
            return;
        }
        m_confidata = new Dictionary <int, TD_PlayerPosition>();

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

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

            item            = new TD_PlayerPosition();
            item.pos        = node.GetIntValue("pos");
            item.atkPer     = node.GetFloatValue("atkPer");
            item.defPer     = node.GetFloatValue("defPer");
            item.controlPer = node.GetFloatValue("controlPer");
            item.passPer    = node.GetFloatValue("passPer");
            item.atkEnable  = node.GetIntValue("atkEnable") == 1 ? true : false;
            item.adaptDef   = node.GetStringValue("adaptDef");

            m_confidata[item.pos] = item;
        }
        asset = 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);
    }
Esempio n. 4
0
    public override void onloaded(AssetBundles.NormalRes data)
    {
        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;
        }

        TbXmlNode node = xmlNodeList[0] as TbXmlNode;

        offX      = node.GetFloatValue("offX");
        offY      = node.GetFloatValue("offY");
        offZ      = node.GetFloatValue("offZ");
        pX        = node.GetFloatValue("pX");
        pY        = node.GetFloatValue("pY");
        pZ        = node.GetFloatValue("pZ");
        rX        = node.GetFloatValue("rX");
        rY        = node.GetFloatValue("rY");
        rZ        = node.GetFloatValue("rZ");
        bound     = node.GetStringValue("bound");
        fieldView = node.GetFloatValue("fieldView");

        asset = null;
        base.onloaded(data);
    }
Esempio n. 5
0
    bool LoadSkillProperty()
    {
        byte[] asset = ResourceManager.Instance.GetXml("SkillProperty");
        if (asset == null)
        {
            return(false);
        }

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

        if (docNode == null)
        {
            return(false);
        }

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

        if (xmlNodeListLength < 1)
        {
            return(false);
        }

        for (int i = 0; i < xmlNodeListLength; ++i)
        {
            SkillProperty sp   = new SkillProperty();
            TbXmlNode     node = xmlNodeList[i] as TbXmlNode;
            sp.mSkillId               = node.GetIntValue("No");
            sp.mSkillName             = node.GetStringValue("Name");
            sp.mSkillOwnerId          = node.GetIntValue("Model");
            sp.mSkillIndex            = node.GetIntValue("SkillNumber");
            sp.mSkillSpace            = node.GetFloatValue("SkillSpace");
            sp.mSkillConsumptionType  = (SkillConsumptionType)node.GetIntValue("SkillConsumptionType");
            sp.mSkillConsumptionValue = node.GetIntValue("SkillConsumptionValue");
            sp.mAnimatorSkillProperty = new AnimatorSkillProperty();

            mSkillPropertyDic.Add(sp.mSkillId, sp);
        }

        return(true);
    }