Ejemplo n.º 1
0
        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);
            }
                );
        }
Ejemplo n.º 2
0
        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();
            }
                );
        }
Ejemplo n.º 3
0
        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);
            }
                );
        }
    public void StartMinigame()
    {
        int    randomIndex  = Random.Range(0, debrisList.Count);
        Debris activeDebris = debrisList[randomIndex];

        activeDebris.Spawn();
    }