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(); } ); }
private void DestroyTemporaryElements(bool isAll = false) { foreach (var data in BarrelRollShiftVariants) { if (data.Direction == SelectedShift && !isAll) { TemporaryShipBaseFinal = data.TemporaryShipBase; } else { GameObject.Destroy(data.TemporaryShipBase); } } BarrelRollShiftVariants = new List <BarrelRollShiftData>(); SelectedTemplate.DestroyTemplate(); }
private void HidePlanningTemplates() { SelectedBombDropHelper.DestroyTemplate(); Roster.SetRaycastTargets(true); }