Exemplo n.º 1
0
        public void SaveLevel()
        {
            this.Level.TileMap = FindObjectOfType <TilemapController>().tileMap;

            //SaveEngine.SaveNewLevel(this.Level);
            SaveEngine.SaveLevels(new List <Level> {
                this.Level
            });
        }
Exemplo n.º 2
0
        // Start is called before the first frame update
        void Awake()
        {
            this.level = SaveEngine.LoadLevels().Last();

            this.AddCash(this.level.InitialCash);

            this.SetActualWave(0);

            this.gameObject.GetComponent <TilemapController>().Initialize(this.level.TileMap, this.StartPoint);
        }
Exemplo n.º 3
0
        private void RenderLevels()
        {
            this.Helpers.RemoveChildrens(this.Container);

            this.levels = SaveEngine.LoadLevels();

            foreach (var level in this.levels)
            {
                var levelButton = Instantiate(LevelPrefab, this.Container.transform);

                var levelScript = levelButton.GetComponent <LevelUI>();
                levelScript.Initialize(level);
            }
        }
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        // Saving Data
        SaveData saveData = new SaveData();

        saveData.testString = testString;

        SaveEngine.Save("testSave01", saveData);

        // Loading Data

        /*SaveData saveData = SaveEngine.Load ("testSave01");
         *
         * testString = saveData.testString;
         *
         * Debug.Log (testString);*/
    }
Exemplo n.º 5
0
        // Start is called before the first frame update
        void Start()
        {
            this.selectedItem    = null;
            this.selectedWarrior = null;
            this.warriors        = SaveEngine.LoadWarriors();
            this.gameManager     = GetComponent <GameManager>();
            this.warriorsPrefabs = GetComponent <WarriorPrefabs>();

            foreach (var w in this.warriors)
            {
                var button = Instantiate(ButtonPrefab, this.WarriorsContainer.transform);
                button.onClick.AddListener(delegate { this.Selectitem(w, button); });

                var text = button.GetComponentInChildren <Text>();

                text.text = w.Name;

                this.ButtonPrefablist.Add(button);
            }
        }
Exemplo n.º 6
0
 public void SavePlayer()
 {
     SaveEngine.SavePlayer(this);
 }
Exemplo n.º 7
0
    public void LoadPlayer()
    {
        PlayerData data = SaveEngine.LoadPlayer();

        level = data.level;
    }