public static bool HasMPCharacterSave() { string mpClientLocalPath = SaveSlotUtils.GetMpClientLocalPath(); string clientSaveFileName = PlayerSpawn.GetClientSaveFileName(); return(File.Exists(mpClientLocalPath + clientSaveFileName)); }
public static void DeleteMpCharacter() { bool flag = PlayerSpawn.HasMPCharacterSave(); if (flag) { File.Delete(SaveSlotUtils.GetMpClientLocalPath() + PlayerSpawn.GetClientSaveFileName()); UnityEngine.Debug.Log("Deleted MP client local save"); } }
private IEnumerator LoadMpCharacterDelayed() { yield return(null); if (!SaveGameManager.Instance.requiredObjects.Contains(this._playerPrefab)) { SaveGameManager.Instance.requiredObjects = new UnityEngine.Object[] { this._playerPrefab }; LevelSerializer.InitPrefabList(); } File.ReadAllBytes(SaveSlotUtils.GetMpClientLocalPath() + PlayerSpawn.GetClientSaveFileName()).LoadObjectTree(null); Debug.Log("Client player loaded from local file"); LocalPlayer.Rigidbody.useGravity = false; LocalPlayer.Rigidbody.isKinematic = true; yield break; }
public static void SaveMpCharacter(GameObject playerGO) { byte[] data = playerGO.SaveObjectTree(); data.WriteToFile(SaveSlotUtils.GetMpClientLocalPath() + PlayerSpawn.GetClientSaveFileName()); }