Exemplo n.º 1
0
        //解析 buff行为
        private void Parse_Status(XmlElement root)
        {
            string str  = string.Empty;
            var    meta = new CBuffStatusMeta(root.GetAttribute("id"));

            m_xreader.TryReadChildNodeAttr(root, "Duration", "value", ref meta.Duration);
            //m_xreader.TryReadChildNodeAttr(root, "Period", "value", ref meta.Period);
            //m_xreader.TryReadChildNodeAttr(root, "PeriodicEffect", "value", ref meta.PeriodicEffect);


            //read modify
            var modifyNode = root.SelectSingleNode("Modification") as XmlElement;

            if (modifyNode != null)
            {
                //var modify = meta.ModifyProperty;
                //m_xreader.TryReadChildNodeAttr(modifyNode, "MoveSpeedMultiplier", "value", ref modify.MoveSpeedMultiplier);
            }
            //end modify

            //read state
            var stateNode = root.SelectSingleNode("StateFlags") as XmlElement;

            if (stateNode != null)
            {
                int  state = 0;
                bool b     = m_xreader.TryReadChildNodeAttr(stateNode, "HitFly", "value", ref state);
                //if (b) meta.StateFlags[CPawnVO.State.HitFly] = state;
            }
            //end state

            CBuffMetaManager.AddMeta(meta);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据配表创建behavior
        /// </summary>
        public static CBuff Create(string meta, GameObject go)
        {
            CBuff behavior = null;

            CBuffMeta emeta = CBuffMetaManager.GetMeta(meta);

            switch (emeta.Type)
            {
            case CBuffMeta.BuffType.Dot:
                behavior          = go.AddComponent <CBuffDot>();
                behavior.BuffName = meta;
                break;
            }

            return(behavior);
        }