示例#1
0
        private void FinishCooking()
        {
            Destroy(tickets.Dequeue());

            cookingCounter.SetCounter(tickets.Count);

            if (tickets.Count == 1)
            {
                cookingCounter.Disable();
            }

            if (tickets.Count == 0)
            {
                cookingProgressBar.Hide();
                isCooking = false;
                smokeParticleSystem.Stop(true, ParticleSystemStopBehavior.StopEmitting);
                cookingSound.Stop();
            }

            Food food = Instantiate(foodPrefab, foodSpawnpoint);

            foodSpawnEffect.Play();

            AudioManager.Instance.PlayEffect(SoundEffect.FoodReady);

            CookingFinished?.Invoke(food);
        }
示例#2
0
        private void Update()
        {
            if (!isGamePlayActive)
            {
                return;
            }

            roundTimer += Time.deltaTime;

            if (roundDuration - roundTimer <= 10 && !isTenSecondTimerStarted)
            {
                clockTickSound          = AudioManager.PlayEffectSafe(SoundEffect.ClockTick, true);
                isTenSecondTimerStarted = true;

                if (VikingController.Instance != null)
                {
                    VikingController.Instance.CanSpawn = false;
                }
            }

            if (roundTimer >= roundDuration)
            {
                clockTickSound.Stop();
                isTenSecondTimerStarted = false;
                StartIntermission();
            }
        }
示例#3
0
        private void OnDisable()
        {
            clockTickSound?.Stop();

            scoreCard.OnNextRound   -= HandleOnNextRound;
            Table.OnTablesDestroyed -= HandleOnTablesDestroyed;
        }
示例#4
0
        internal override int?Elapse(ElapseData data)
        {
            currentLocation = data.Vehicle.Location;

            //Calculate signalling status
            //Distance to next train
            UpdateAtpSpeeds(data, data.PrecedingVehicle);

            //Naive overspeed prevention that applies FSB
            if (train.trainModeActual == Train.TrainModes.CodedManual)
            {
                if (data.Vehicle.Speed.KilometersPerHour > train.atpSafetySpeed)
                {
                    return(-train.specs.BrakeNotches);
                }
                else if (data.Vehicle.Speed.KilometersPerHour > train.atpSafetySpeed - ATP_OVERSPEED_COAST_THRESHOLD)
                {
                    return(0);
                }

                if (data.Vehicle.Speed.KilometersPerHour > train.atpSafetySpeed - ATP_OVERSPEED_ALERT_THRESHOLD)
                {
                    //play sound
                    if (atpOverspeedSoundHandle == null)
                    {
                        atpOverspeedSoundHandle = train.PlaySound(0, 1, 1, true);
                    }
                }
                else
                {
                    if (atpOverspeedSoundHandle != null)
                    {
                        atpOverspeedSoundHandle.Stop();
                        atpOverspeedSoundHandle = null;
                    }
                }
            }

            return(null);
            //Check trip count
            //Check for speed limits
            //ElapseTripTimer(data);

            //Is train in RM?

            /*if (train.trainModeActual == Train.TrainModes.RestrictedManualForward ||
             *  train.trainModeActual == Train.TrainModes.RestrictedManualReverse ||
             *  train.trainModeActual == Train.TrainModes.Off)
             * {
             *  atpState = AtpStates.Off;
             * }
             * else
             * {
             *  switch (atpState)
             *  {
             *      case AtpStates.Active:
             *          if (atpTripTimer <= 0.0)
             *          {
             *              atpState = AtpStates.Tripped;
             *          }
             *          return null;
             *      case AtpStates.Tripped:
             *
             *          return -train.specs.BrakeNotches - 1;
             *      default:
             *          return null;
             *  }
             * }*/
        }