Esempio n. 1
0
    /// <summary>
    /// Spawns the character at the selected entry point if there's one, or at the selected checkpoint.
    /// </summary>
    protected override void RegularSpawnSingleCharacter()
    {
        PointsOfEntryStorage point = GameManager.Instance.GetPointsOfEntry(SceneManager.GetActiveScene().name);

        if ((point != null) && (PointsOfEntry.Length >= (point.PointOfEntryIndex + 1)))
        {
            Players[0].RespawnAt(PointsOfEntry[point.PointOfEntryIndex], point.FacingDirection);
            return;
        }

        if (spawnAtFirstCheckPoint && CurrentCheckPoint != null)
        {
            CurrentCheckPoint.SpawnPlayer(Players[0]);
            return;
        }
    }
        public PodRacerRaceState Copy()
        {
            PodRacerRaceState copy;

            copy = new PodRacerRaceState(PodRacer.Copy())
            {
                CurrentCommand             = CurrentCommand.Copy(),
                ShieldPenaltyRoundsCounter = ShieldPenaltyRoundsCounter,
                HasBoosted         = HasBoosted,
                Failed             = Failed,
                CurrentCheckPoint  = CurrentCheckPoint.Copy(),
                RoundsFinished     = RoundsFinished,
                CheckPointsReached = CheckPointsReached
            };

            return(copy);
        }