Esempio n. 1
0
 public void Construct(LogicWorld logic_world, int id, EffectGeneratorData data)
 {
     m_logic_world = logic_world;
     m_id          = id;
     m_data        = data;
     for (int i = 0; i < m_data.m_entries.Count; ++i)
     {
         EffectGeneratorEntry entry = RecyclableObject.Create <EffectGeneratorEntry>();
         entry.Construct(this, m_data.m_entries[i], i);
         m_entries.Add(entry);
     }
 }
        protected override void OnDestruct()
        {
            EffectGenerator generator = GetLogicWorld().GetEffectManager().GetGenerator(m_generator_id);

            if (generator == null)
            {
                return;
            }
            EffectGeneratorEntry entry = generator.GetEntry(m_entry_index);

            if (entry == null)
            {
                return;
            }
            entry.RemoveEffect(ParentObject.ID);

            if (m_task != null)
            {
                m_task.Cancel();
                LogicTask.Recycle(m_task);
                m_task = null;
            }
        }