private void DropSparePartsToken() { Action Callback = Phases.CurrentSubPhase.CallBack; DecisionSubPhase.ConfirmDecisionNoCallback(); HostUpgrade.State.SpendCharge(); Debris spareParts = new Debris("Spare Parts", "spareparts"); spareParts.Spawn("Spare Parts " + HostShip.ShipId, Board.GetBoard()); ObstaclesManager.AddObstacle(spareParts); spareParts.ObstacleGO.transform.position = HostShip.GetBack(); spareParts.ObstacleGO.transform.eulerAngles = HostShip.GetAngles() + new Vector3(0, 180, 0); spareParts.IsPlaced = true; GameManagerScript.Wait( 1, delegate { Messages.ShowInfo("Spare Parts are dropped"); BreakAllLocksRecursive(Callback); } ); }
private void DropSparePartsToken() { Action Callback = Phases.CurrentSubPhase.CallBack; DecisionSubPhase.ConfirmDecisionNoCallback(); HostUpgrade.State.SpendCharge(); ManeuverTemplate dropTemplate = new ManeuverTemplate(ManeuverBearing.Straight, ManeuverDirection.Forward, ManeuverSpeed.Speed1, isBombTemplate: true); dropTemplate.ApplyTemplate(HostShip, HostShip.GetBack(), Direction.Bottom); Debris spareParts = new Debris("Spare Parts", "spareparts"); spareParts.Spawn("Spare Parts " + HostShip.ShipId, Board.GetBoard()); ObstaclesManager.AddObstacle(spareParts); spareParts.ObstacleGO.transform.position = dropTemplate.GetFinalPosition(); spareParts.ObstacleGO.transform.eulerAngles = dropTemplate.GetFinalAngles(); spareParts.IsPlaced = true; GameManagerScript.Wait( 1, delegate { Messages.ShowInfo("Spare Parts are dropped"); dropTemplate.DestroyTemplate(); BreakAllLocksRecursive(Callback); } ); }
private void DropCargoToken() { Action Callback = Phases.CurrentSubPhase.CallBack; DecisionSubPhase.ConfirmDecisionNoCallback(); HostUpgrade.State.SpendCharge(); ManeuverTemplate dropTemplate = new ManeuverTemplate(ManeuverBearing.Straight, ManeuverDirection.Forward, ManeuverSpeed.Speed1, isBombTemplate: true); dropTemplate.ApplyTemplate(HostShip, HostShip.GetBack(), Direction.Bottom); Debris looseCargo = new Debris("Loose Cargo", "loosecargo"); looseCargo.Spawn("Loose Cargo " + HostShip.ShipId, Board.GetBoard()); ObstaclesManager.AddObstacle(looseCargo); looseCargo.ObstacleGO.transform.position = dropTemplate.GetFinalPosition(); looseCargo.ObstacleGO.transform.eulerAngles = dropTemplate.GetFinalAngles(); looseCargo.IsPlaced = true; GameManagerScript.Wait( 1, delegate { dropTemplate.DestroyTemplate(); Callback(); } ); }