Esempio n. 1
0
        override protected void initImpl(ResItem res)
        {
            base.initImpl(res);

            SecurityParser xmlDoc = new SecurityParser();

            xmlDoc.LoadXml(m_text);

            SecurityElement rootNode     = xmlDoc.ToXml();
            ArrayList       itemMeshList = rootNode.Children;
            SecurityElement itemMesh;

            ArrayList       itemSubMeshList;
            SecurityElement itemSubMesh;
            string          meshName    = "";
            string          subMeshName = "";
            string          bonesList   = "";

            foreach (SecurityElement itemNode1f in itemMeshList)
            {
                itemMesh = itemNode1f;
                UtilXml.getXmlAttrStr(itemMesh, "name", ref meshName);

                itemSubMeshList = itemMesh.Children;
                foreach (SecurityElement itemNode2f in itemSubMeshList)
                {
                    itemSubMesh = itemNode2f;
                    UtilXml.getXmlAttrStr(itemSubMesh, "name", ref subMeshName);
                    UtilXml.getXmlAttrStr(itemSubMesh, "bonelist", ref bonesList);
                    m_boneArr = bonesList.Split(',');
                }
            }

            m_text = "";
        }
Esempio n. 2
0
        public override void parseXml(SecurityElement xmlelem)
        {
            SecurityElement itemXml = null;

            UtilXml.getXmlChild(xmlelem, "item", ref itemXml);
            UtilXml.getXmlAttrUInt(itemXml, "id", ref m_sceneId);
            UtilXml.getXmlAttrStr(itemXml, "name", ref m_sceneName);
            UtilXml.getXmlAttrStr(itemXml, "res", ref m_levelName);
        }
Esempio n. 3
0
        public void parse(SecurityElement xe)
        {
            string attr = "";

            UtilXml.getXmlAttrStr(xe, "size", ref attr);
            attr = attr.Substring(1, attr.Length - 2);
            char[] split = new char[1];
            split[0] = ',';
            string[] strarr = attr.Split(split);

            m_width  = float.Parse(strarr[0]);
            m_height = float.Parse(strarr[2]);
        }
Esempio n. 4
0
        public void parse(SecurityElement xe)
        {
            m_pos    = new Vector3();
            m_rotate = new Quaternion();
            m_scale  = new Vector3();

            UtilXml.getXmlAttrStr(xe, "prefab", ref m_prefab);

            string attr = "";

            UtilXml.getXmlAttrStr(xe, "pos", ref attr);
            attr = attr.Substring(1, attr.Length - 2);
            char[] split = new char[1];
            split[0] = ',';
            string[] strarr = attr.Split(split);

            m_pos.x = float.Parse(strarr[0]);
            m_pos.y = float.Parse(strarr[1]);
            m_pos.z = float.Parse(strarr[2]);

            UtilXml.getXmlAttrStr(xe, "rotate", ref attr);
            attr     = attr.Substring(1, attr.Length - 2);
            split[0] = ',';
            strarr   = attr.Split(split);

            m_rotate.x = float.Parse(strarr[0]);
            m_rotate.y = float.Parse(strarr[1]);
            m_rotate.z = float.Parse(strarr[2]);
            m_rotate.w = float.Parse(strarr[3]);

            UtilXml.getXmlAttrStr(xe, "scale", ref attr);
            attr     = attr.Substring(1, attr.Length - 2);
            split[0] = ',';
            strarr   = attr.Split(split);

            m_scale.x = float.Parse(strarr[0]);
            m_scale.y = float.Parse(strarr[1]);
            m_scale.z = float.Parse(strarr[2]);
        }
Esempio n. 5
0
        public void parseXmlElem(SecurityElement elem_)
        {
            // 解析 Id
            UtilXml.getXmlAttrStr(elem_, "Id", ref m_id);

            // 解析攻击
            ArrayList       attackActionNodeList = elem_.Children; // AttackAction 攻击动作节点,这个节点只有一个 AttackAction
            SecurityElement attackActionNode     = attackActionNodeList[0] as SecurityElement;

            m_attackActionNode = new AttackActionNode();
            m_attackActionNode.parseXmlElem(attackActionNode);

            // 解析被击
            SecurityElement hurtActionNode = null;

            UtilXml.getXmlChild(attackActionNode, "HurtAction", ref hurtActionNode);
            if (hurtActionNode != null)
            {
                m_hurtActionNode = new HurtActionNode();
                m_hurtActionNode.parseXmlElem(hurtActionNode);
            }
        }
Esempio n. 6
0
        protected string m_linkBone;    // 连接的骨头

        virtual public void parseXmlElem(SecurityElement elem_)
        {
            UtilXml.getXmlAttrStr(elem_, "EffectId", ref m_effectId);
            UtilXml.getXmlAttrFloat(elem_, "DelayTime", ref m_delayTime);
            UtilXml.getXmlAttrStr(elem_, "LinkBone", ref m_linkBone);
        }