예제 #1
0
파일: SkillEffect.cs 프로젝트: sjb8100/src
 public bool Create(SkillEffectProp prop)
 {
     m_Prop = null;
     m_Prop = prop;
     CreateEffectNode(m_Prop);
     return(true);
 }
예제 #2
0
파일: SkillEffect.cs 프로젝트: sjb8100/src
        public void Destroy()
        {
            if (m_Prop != null)
            {
                m_Prop = null;
            }

            SortedDictionary <float, List <EffectNode> > .Enumerator iter = m_EffectNodes.GetEnumerator();
            while (iter.MoveNext())
            {
                for (int i = 0; i < iter.Current.Value.Count; ++i)
                {
                    if (iter.Current.Value[i] == null)
                    {
                        continue;
                    }

                    iter.Current.Value[i] = null;
                }

                iter.Current.Value.Clear();
                foreach (var node in iter.Current.Value)
                {
                    FreeSkillNode(node);
                }
            }

            m_EffectNodes.Clear();

            m_Atttacker = null;
        }
예제 #3
0
        public bool Add(SkillEffectProp e)
        {
            if (m_effectDict.ContainsKey(e.Name) == true)
            {
                return(false); //重名
            }

            m_effectDict.Add(e.Name, e);
            return(true);
        }
예제 #4
0
        public SkillEffectProp Add(string name)
        {
            SkillEffectProp e = ScriptableObject.CreateInstance <SkillEffectProp>();// new SkillEffectProp();

            e.Name = name;

            if (Add(e) == false)
            {
                return(null);
            }

            return(e);
        }
예제 #5
0
파일: SkillEffect.cs 프로젝트: sjb8100/src
        //-------------------------------------------------------------------------------------------------------

        /**
         * @brief 创建特效
         * @param
         */
        private void CreateEffectNode(SkillEffectProp prop)
        {
            SortedDictionary <float, EffectNodeConfig> .Enumerator iter = prop.m_EffectProps.GetEnumerator();
            while (iter.MoveNext())
            {
                for (int i = 0; i < iter.Current.Value.configlist.Count; ++i)
                {
                    EffectNodeProp nodeprop = iter.Current.Value.configlist[i];
                    EffectNode     node     = CreateEffectNode(nodeprop.type);
                    if (node == null)
                    {
                        continue;
                    }

                    node.Create(nodeprop);
                    AddEffectNode(nodeprop.time, node);
                }
            }
        }
예제 #6
0
        public bool Load(JsonData json_root)
        {
            #region 以名字为key
            name = json_root.GetString("name", "");

            JsonData effect_nodes = json_root["effects"];

            if (effect_nodes != null)
            {
                for (int n = 0; n < effect_nodes.Count; n++)
                {
                    SkillEffectProp e = ScriptableObject.CreateInstance <SkillEffectProp>(); //new SkillEffectProp();
                    e.Load(effect_nodes[n]);
                    Add(e);
                }
            }
            #endregion

            return(true);
        }
예제 #7
0
 public void Remove(SkillEffectProp e)
 {
     m_effectDict.Remove(e.Name);
 }