private void CreateGhostPlayer() { Debug.Log("[GhostController] CreateGhostPlayer"); if (RS_GamePlayController.Mode == RS_GameMode.Multiplayer) { #if !UNITY_EDITOR LoadedGhostData = RS_GamePlayController.Instance.Multiplayer.CompetitorReplay; #endif } else { if (RS_PlayerData.Instance.HasGhostData("Desert")) { LoadedGhostData = GhostReplayData.GetGhostDataOnTrack("Desert"); } } if (LoadedGhostData != null) { Debug.Log(LoadedGhostData.CarId); Debug.Log(LoadedGhostData.CarLevel); Debug.Log(LoadedGhostData.RawData.ToString() + " Count:" + LoadedGhostData.RawData.Count); foreach (GhostDataBundle action in LoadedGhostData.RawData) { StartCoroutine(GhostRacerAction(action.Event, action.Time)); } RS_CarFactory.CarLoadedAction += HandleActionGhostCarLoaded; RS_CarFactory.CreateCar(LoadedGhostData.CarId, RS_CarCreationMode.Garage); } }
//-------------------------------------- // Private Methods //-------------------------------------- private void UpdateCar() { if (CurrentCar != null) { DestroyImmediate(CurrentCar); } RS_CarFactory.CarLoadedAction += RS_CarFactory_CarLoadedAction; RS_CarFactory.CreateCar(RS_GameData.MenuCarId, RS_CarCreationMode.Garage); }
void Start() { _ghost = gameObject.AddComponent <RS_GhostCarManager> (); RS_CarFactory.CarLoadedAction += RS_CarFactory_CarLoadedAction; if (Mode == RS_GameMode.Multiplayer) { ActiveMatchData = new ST_TBM_MatchData(ActiveMatch); RS_CarFactory.CreateCar(ActiveMatchData.CompetitorReplay != null ? ActiveMatchData.CompetitorReplay.CarId : RS_GameData.MenuCarId, RS_CarCreationMode.Garage); _netController = gameObject.AddComponent <MultiplayerGameController> (); #if !UNITY_EDITOR _netController.InitMatchData(ActiveMatch); #endif } else { RS_CarFactory.CreateCar(RS_GameData.MenuCarId, RS_CarCreationMode.Garage); } }