public static void Summon(UnitData data, FieldBlock block, UnitData data1, UnitData data2) { PlayerID id = PlayerID.Player1; if (data1.m_Owner != null) { id = data1.m_Owner.m_PlayerID; data1.m_Owner.m_Destroy.Destroy(); } else { Debug.LogError("Spirit doesn't exist"); } if (data2.m_Owner != null) { id = data1.m_Owner.m_PlayerID; data2.m_Owner.m_Destroy.Destroy(); } else { Debug.LogError("Spirit doesn't exist"); } CostMana(id, data); SummonManager.Summon(data, block, id); }
public override void TakeEffect(AbilityInfo[] info) { base.TakeEffect(info); TargetInfo info1 = GetAbilityInfo <TargetInfo>(); if (info1 == null) { return; } foreach (FieldBlock block in info1.m_Blocks) { if (block.m_Unit == null) { SummonManager.Summon(m_Unit, block, block.m_PlayerID); } } }
public static void Do(AIMove.UnitOption option) { Debug.Log("AI Summon Unit"); UnitData data = option.data; if(AIView.Instance.EmptyFront != null && data.CanBeFrontline) { int cost = data.GetStat(UnitStatsProperty.Cost); AIView.Instance.AI.m_Mana.Cost(cost); SummonManager.Summon(data.m_Owner, AIView.Instance.EmptyFront); } else if (AIView.Instance.EmptyBack != null && data.CanBeBackline) { int cost = data.GetStat(UnitStatsProperty.Cost); AIView.Instance.AI.m_Mana.Cost(cost); SummonManager.Summon(data.m_Owner, AIView.Instance.EmptyBack); } }
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); }