public override IEnumerator AnimationCoroutine() { game.PlaySound(unit.jumpSound); HexCoords oldLoc = map.WhereIs(unit); HexCoords targetLoc = map.WhereIs(target); yield return(unit.AnimateParabolicMove( oldLoc, targetLoc)); game.PlaySound(unit.attackSound); target.TakeDamage(1); yield return(unit.AnimateParabolicMove( targetLoc, landingLoc, 1.0f, 1.0f)); map.UnplaceUnit(unit); map.PlaceUnit(unit, map[landingLoc]); unit.ap.Increment(-1); yield return(null); if (unit.team == UnitTeam.player) { game.ChangeState(new PlayerGiveOrder(unit)); } else if (unit.team == UnitTeam.enemy) { game.ChangeState(new EnemyTurnAI()); } }
public override IEnumerator AnimationCoroutine() { game.PlaySound(unit.jumpSound); HexCoords oldLoc = map.WhereIs(unit); yield return(unit.AnimateParabolicMove( oldLoc, newLoc)); map.UnplaceUnit(unit); map.PlaceUnit(unit, newLoc); unit.ap.Increment(-1); yield return(null); if (unit.team == UnitTeam.player) { game.ChangeState(new PlayerGiveOrder(unit)); } else if (unit.team == UnitTeam.enemy) { game.ChangeState(new EnemyTurnAI()); } }