예제 #1
0
    void MasterClientInit()
    {
        SaveGameToLoad saveGameToLoad = FindObjectOfType <SaveGameToLoad>();
        string         bundleId       = GameBuilderApplication.CurrentGameOptions.bundleIdToLoad;

        if (saveGameToLoad)
        {
            Debug.Log("Loading saved game!");
            saveLoad.Load(saveGameToLoad.saved, saveGameToLoad.voosFilePath);
            GameObject.Destroy(saveGameToLoad.gameObject);
        }
        else if (!bundleId.IsNullOrEmpty())
        {
            Debug.Log($"Loading game bundle {bundleId}");
            string voosPath = gameBundleLibrary.GetBundle(bundleId).GetVoosPath();
            saveLoad.Load(SaveLoadController.ReadSaveGame(voosPath), voosPath);
#if !USE_STEAMWORKS
            workshop.Load(gameBundleLibrary.GetBundle(bundleId).GetAssetsPath());
#endif
            lastLoadedBundleId = bundleId;
        }
        else
        {
            SaveLoadController.SaveGame save = SaveLoadController.ReadSaveGame(GameBuilderSceneController.GetMinimalScenePath(mode == Mode.Online));
            saveLoad.Load(save);
        }

        using (Util.Profile("SpawnLocalobjects"))
            SpawnLocalObjects();
        StartCoroutine(LoadingSequence());
    }