IEnumerator ReleaseGhosts() { while (true) { GhostPlaybackController ghostPlayback = (GhostPlaybackController)Instantiate(GhostPlayback); ghostPlayback.transform.SetParent(GhostHolder.transform); ghostPlayback.SetPlayerReplayModel(_replays[0]); _ghostPlaybacks.Add(ghostPlayback); ghostPlayback.StartPlayGhostPlayback(); PlayerReplayModel tempPlayerReplayModel = new PlayerReplayModel(_replays[0].UserName, _replays[0].LevelName, _replays[0].ReplayTime, _replays[0].ReplayData); _replays.RemoveAt(0); _replays.Add(tempPlayerReplayModel); yield return(new WaitForSeconds(_ghostReleaseInterval)); } }
private void StartGame() { //if (_playerMoved == true) //{ // Player.PlayerCompleted(_levelName); // _playerMoved = false; //} _levelName = Level.GetSeed(); GrappleServerData.Instance.StartCoroutine(GrappleServerData.Instance.AddLevel(_levelName, (Success, ReturnString) => { if (!Success && ReturnString != "") { Debug.Log("Server Error: " + ReturnString); } PlayerReplay.Instance.StartCoroutine(PlayerReplay.Instance.GetPlayerReplays(_levelName, (replays) => { ReplaysRecieved(replays); _ghostPlaybacks = new List <GhostPlaybackController>(); for (int i = 0; i < _replays.Count; i++) { GhostPlaybackController ghostPlayback = (GhostPlaybackController)Instantiate(GhostPlayback); ghostPlayback.transform.SetParent(GhostHolder.transform); ghostPlayback.SetPlayerReplayModel(_replays[i]); _ghostPlaybacks.Add(ghostPlayback); } //Player.ResetPlayer(); GrappleUI.Hide(); VirtualCamera.GetCinemachineComponent <CinemachineComposer>().m_ScreenX = 0.5f; VirtualBackgroundCamera.GetCinemachineComponent <CinemachineComposer>().m_ScreenX = 0.5f; Player.EnableFullScreenInput(); StartCoroutine(StartCountDown()); })); })); }