private void LoadProject(string selectedPath)
        {
            Globals.ProjectDir     = selectedPath;
            Globals.NavigatorPlace = LoadSave.Load(Globals.ProjectFile);

            // Settings control
            settingsCtrl1.LoadControl();

            // Shops control
            listingContainerCtrl1.LoadControl();

            // Ads configuration control
            adConfigContainerCtrl1.LoadControl();

            // Image editor control
            imageEditorCtrl1.ProjectImagePath = Globals.ImagesDir;
            imageEditorCtrl1.CurrentPlace     = Globals.NavigatorPlace;
            imageEditorCtrl1.CurrentPath      = imageEditorCtrl1.CurrentPlace.Paths[0];
            imageEditorCtrl1.CurrentPoint     = imageEditorCtrl1.CurrentPlace.Paths[0].Points[0];
            imageEditorCtrl1.CurrentAngle     = 0;
            imageEditorCtrl1.StartRealView();

            // Hotspots control
            hotSpotContainerCtrl1.LoadControl();
        }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.O))
        {
            stats.sceneNo = Application.loadedLevel;
            stats.pHealth = 100;
            stats.pOil    = 100;
            stats.pPos    = transform.position;

            LoadSave.Save();
            print("GameSaved");
            stats.pPos.x = 0;
            stats.pPos.y = 0;
            stats.pPos.z = 0;
        }
        if (Input.GetKeyUp(KeyCode.P))
        {
            LoadSave.Load();


            print("GameLoaded");
            //transform.position = pPos;
            if (Application.loadedLevel != stats.sceneNo)
            {
                Application.LoadLevel(stats.sceneNo);
            }
        }

        if (gameloaded)
        {
            transform.position = current.stats.pPos;
            gameloaded         = false;
        }
    }
Beispiel #3
0
    private void Awake()
    {
        maxLevel = 1;

        maxLevel = LoadSave.Load();
        if (maxLevel == 0)
        {
            maxLevel = 1;
        }
    }
Beispiel #4
0
        public void Load_Company_Success()
        {
            //Arrange
            var path     = "D:/Study/TRPZ/Test.txt";
            var expected = company;
            //Act
            var actual = LoadSave.Load(path);

            //Assert
            expected.Should().BeEquivalentTo(actual);
        }
    private void OnPauseMenuClose()
    {
        Paused = false;
        if (_loadOnExit)
        {
            SaveMngr.Load();
            _loadOnExit = false;
        }
        _saved = false;

        PauseMenuClose?.Invoke();
    }
    public void Load()
    {
        LoadSave.CharacterName = characterName;
        GlobalSave save = LoadSave.Load();

        foreach (WeaponSave weaponSave in save.weaponSaves)
        {
            Weapon weapon = GameManager.instance.WeaponDatabase.GetWeaponByID(weaponSave.id);
            weapon.LoadFromSave(weaponSave);
            CharacterInventory.instance.PickupWeaponNoInventory(weapon, false);
        }
    }
Beispiel #7
0
    /// <summary>
    /// Starts the main part of the game.
    /// Checks if a game exists to load, and if so loads it.
    /// If not, we generate a game <see cref="GameManager.GenerateGame(int)"/>
    /// If we generate a game, at current we set the players location
    /// </summary>
    void Start()
    {
        Debug.BeginDeepProfile("game_start");
        if (GameToLoad == null || GameToLoad == "none")
        {
            Stopwatch s = new Stopwatch();
            s.Start();
            //UnityEngine.Profiling.CustomSampler gen = UnityEngine.Profiling.CustomSampler.Create("GenSampler");
            int seed = 0;
            Debug.Log("No game to load, generating with seed " + seed);

            GenerateGame(seed);
            PathFinder = new PathFinder(WorldManager.World);
            PathFinder.SetPlayerPosition(PlayerManager.Player.TilePos);

            System.GC.Collect();
            s.Stop();
            Debug.Log("Generation took total time: " + s.ElapsedMilliseconds / 1000f);
            DebugGUI.SetData("genTime", s.ElapsedMilliseconds / 1000f);
        }
        else
        {
            UnityEngine.Profiling.CustomSampler load = UnityEngine.Profiling.CustomSampler.Create("LoadSampler");
            load.Begin();
            GameLoadSave gls   = LoadSave.Load();
            World        world = new World();
            world.LoadWorld(gls);
            EntityManager.Load(gls);
            WorldManager.SetWorld(world);
            Player player = new Player();
            TestSettle = WorldManager.World.GetSettlement(0);
            Vec2i set = TestSettle.Centre;
            //player.SetPosition(new Vector3(set.x * World.ChunkSize, 0, set.z * World.ChunkSize));
            player.SetPosition(new Vector3(World.WorldSize / 2 * World.ChunkSize, 0, World.WorldSize / 2 * World.ChunkSize));
            PlayerManager.SetPlayer(player);

            load.End();
        }
        Debug.EndDeepProfile("game_start");



        RNG = new GenerationRandom(System.DateTime.Now.Millisecond);
    }
Beispiel #8
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog dlg = new FolderBrowserDialog();

            dlg.ShowNewFolderButton = true;
            dlg.RootFolder          = Environment.SpecialFolder.Desktop;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Globals.ProjectDir     = dlg.SelectedPath;
                Globals.NavigatorPlace = place = LoadSave.Load(Globals.ProjectFile);
                lstPoints.Items.Clear();
                lstPaths.Items.Clear();
                lstPaths.Items.AddRange(place.Paths.ToArray());
                if (lstPaths.Items.Count > 0)
                {
                    lstPaths.SelectedIndex = 0;
                }

                markControl1.LoadMapsList();
            }
        }
Beispiel #9
0
    // Use this for initialization
    void Start()
    {
        // There are not object yet.
        // Data didnt loaded yet.
        if (_instance == null)
        {
            _instance = this;

            DataPlayer dataPlayer = new DataPlayer();
            DataQuests dataQuests = new DataQuests();
            DataAd     dataAd     = new DataAd();

            // Load DataPlayer
            LoadSave.Load(ref dataPlayer);            //, DataplayerManager.Instance.NameFile,true);
            DataplayerManager.Instance.Data = dataPlayer;
            // Load AdData
            LoadSave.Load(ref dataAd, AdManager.Instance.NameFile);
            AdManager.Instance.Data = dataAd;
            // Load dataQuests
            LoadSave.Load(ref dataQuests, QuestsManager.Instance.NameFile);
            QuestsManager.Instance.Data = dataQuests;

            // Get languege

            /* Change to next alghorithm:
             * if not changing language by user
             *		try find witch languege use user and set it to default
             *		catch set english
             *	Now for will be always in default english
             *	Befor change to alghorithm, be sure that font
             *	suppor languages
             */
            LocalizationManager.Instance.SetLanguage("localizedTextEn.json");

            // Load scen when all data loaded
            SceneManager.LoadScene("MainMenu");
        }
    }
Beispiel #10
0
 public static Company BuildStructure(string path)
 {
     return(LoadSave.Load(path));
 }