private static void CostMana(PlayerID id, UnitData data) { int cost = data.m_Cost; ManaObject mana = PlayerManager.Instance.GetPlayer(id).m_Mana; mana.Cost(cost); }
protected virtual void TrySummon(GameEventData eventData) { SummonData data = eventData.CastDataType <SummonData>(); if (data == null) { return; } Unit unit = data.m_Unit; FieldBlock block = data.m_Block; if (!CheckSummonAvaliability(data, unit, block)) { return; } int cost = unit.m_Data.GetStat(UnitStatsProperty.Cost); m_Mana.Cost(cost); SummonManager.Summon(unit, block); }