Exemplo n.º 1
0
        public static bool HasMPCharacterSave()
        {
            string mpClientLocalPath  = SaveSlotUtils.GetMpClientLocalPath();
            string clientSaveFileName = PlayerSpawn.GetClientSaveFileName();

            return(File.Exists(mpClientLocalPath + clientSaveFileName));
        }
Exemplo n.º 2
0
        public static void DeleteMpCharacter()
        {
            bool flag = PlayerSpawn.HasMPCharacterSave();

            if (flag)
            {
                File.Delete(SaveSlotUtils.GetMpClientLocalPath() + PlayerSpawn.GetClientSaveFileName());
                UnityEngine.Debug.Log("Deleted MP client local save");
            }
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
 public static void SaveMpCharacter(GameObject playerGO)
 {
     byte[] data = playerGO.SaveObjectTree();
     data.WriteToFile(SaveSlotUtils.GetMpClientLocalPath() + PlayerSpawn.GetClientSaveFileName());
 }