public bool Create(SkillEffectProp prop) { m_Prop = null; m_Prop = prop; CreateEffectNode(m_Prop); return(true); }
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; }
public bool Add(SkillEffectProp e) { if (m_effectDict.ContainsKey(e.Name) == true) { return(false); //重名 } m_effectDict.Add(e.Name, e); return(true); }
public SkillEffectProp Add(string name) { SkillEffectProp e = ScriptableObject.CreateInstance <SkillEffectProp>();// new SkillEffectProp(); e.Name = name; if (Add(e) == false) { return(null); } return(e); }
//------------------------------------------------------------------------------------------------------- /** * @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); } } }
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); }
public void Remove(SkillEffectProp e) { m_effectDict.Remove(e.Name); }