Exemple #1
0
        private void ComputeSpiralPath()
        {
            ChunkManager chunkManager = stateMachine.ChunkManager;

            path = new Vector3[chunkManager.ChunkCount - 1];

            int         i = 0;
            ChunkFacade previousChunkFacade = chunkManager.PeakChunkFacade.PreviousChunkFacade;

            while (previousChunkFacade != null)
            {
                if (previousChunkFacade.PreviousChunkFacade == null)
                {
                    StartingZoneView startingZoneView = previousChunkFacade.ChunkView.GetComponentInChildren <StartingZoneView>();
                    path[i] = startingZoneView.NormalSpawn.Position;
                }
                else
                {
                    path[i] = previousChunkFacade.ChunkView.Position + (Vector3.up * previousChunkFacade.ChunkView.ChunkFeatureView.EntryAltitude);
                }

                i++;
                previousChunkFacade = previousChunkFacade.PreviousChunkFacade;
            }
        }
Exemple #2
0
        public void Initialize()
        {
            ChunkFacade      startingChunkFacade = chunkManager.StartingChunkFacade;
            StartingZoneView startingZoneView    = startingChunkFacade.ChunkView.GetComponentInChildren <StartingZoneView>();;

            spawnManager.CurrentSpawnView = startingZoneView.InitialSpawn.GetComponentInChildren <SpawnView>();

            gameStateTrigger.Fire(GameStateType.Play);

            foreach (Input input in gameStateMachine.GameReadyState.SelectedInputs)
            {
                PlayerFacade playerFacade = playerManager.SpawnPlayer(input, gameStateMachine.GameReadyState.ChosenCharacterType(input));
                deathManager.AddPlayer(input);

                float randomFactor = Mathf.Pow(UnityEngine.Random.value * 2, 2) / 4;
                playerFacade.Position += Vector3.up * randomFactor * settings.spawnAltitudeRange;

                playerFacade.Freefall();
                playerFacade.Player.Gravity = 1f;
                playerFacade.MoveDirection  = Vector3.zero;

                playerFacade.ProbeGround();
            }

            spawnManager.CurrentSpawnView = startingZoneView.NormalSpawn.GetComponentInChildren <SpawnView>();

            cameraView.IsActive = true;
            cameraAnchorManager.ResetAnchor();
            cameraManager.ResetCamera();

            deathManager.IsActive = true;

            mistManager.IsActive = true;
            mistManager.UpdateMistPosition(spawnManager.CurrentSpawnView.Position.y);

            rankManager.IsActive = true;

            aetherManager.GameTimer = Time.time;
        }