protected override void OnDestruct() { m_owner_component = null; m_mana_component = null; m_definition_component = null; ClearTargets(); }
protected override void PreInitializeObject(ObjectCreationContext context) { Entity owner_entity = context.m_logic_world.GetEntityManager().GetObject(m_context.m_owner_id); if (owner_entity != null) { m_owner_component = owner_entity.GetComponent(SkillManagerComponent.ID) as SkillManagerComponent; m_mana_component = owner_entity.GetComponent(ManaComponent.ID) as ManaComponent; } }
public override void Apply() { Entity owner = GetOwnerEntity(); ManaComponent mana_component = owner.GetComponent(ManaComponent.ID) as ManaComponent; if (mana_component == null) { return; } FixPoint amount = m_mana_amount.Evaluate(this); mana_component.ChangeMana(m_mana_type, amount); }