Пример #1
0
        public static void AddMeta(CBuffMeta meta)
        {
            if (m_dict.ContainsKey(meta.sId))
            {
                Debug.LogError("CBehaviorMetaManager ALREADY CONTAIN the behavior with id -- " + meta.sId);
            }

            m_dict[meta.sId] = meta;
        }
Пример #2
0
        public static CBuffMeta GetMeta(string id)
        {
            CBuffMeta meta = null;
            bool      v    = m_dict.TryGetValue(id, out meta);

            if (!v)
            {
                Debug.LogError("CBehaviorMetaManager DO NOT CONTAIN the behavior with id -- " + id);
            }

            return(meta);
        }
Пример #3
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);
        }