예제 #1
0
    void Awake()
    {
        SelectColor(0);
        lockbattle = false;
        editmode   = false;

        bool loadNew = false; //GameMemento.current.hexGridMemento.size == 0 //load from most recent if player presses continue

        if (!loadNew)
        {
            Debug.Log("Loading");
            SaveLoad.Load();
            GameMemento.current = SaveLoad.savedGame;

            playerManager.SetActivePlayers();
            loadMap.LoadHexTiles();
            loadMap.LoadTerrain();
            loadMap.LoadBuildings();
            //loadMap.LoadEntities();
            loadMap.LoadResources();
            loadMap.LoadCorpses();
            summon.SummonEntity(14, EntityNames.Necromancer, 1);
            summon.SummonEntity(12, EntityNames.Militia, 2);
            summon.SummonEntity(15, EntityNames.Militia, 3);
            summon.SummonEntity(3, EntityNames.Skeleton, 1);
            summon.SummonEntity(18, EntityNames.Zombie, 1);
        }
        else //create new game when no game, set from player settings in menu
        {
            Debug.Log("New");
            playerManager.SetNewGamePlayers(); //TODO modify set active players to set new players when new game
            loadMap.LoadNewHexTiles(12, 12);
            loadMap.LoadRandomTerrain(12);     //sets the seed of the terrain spawn
            //TODO set above random seed somewhere
            //TODOTEST remove test entities
            summon.SummonEntity(14, EntityNames.Necromancer, 1);
            summon.SummonEntity(12, EntityNames.Militia, 2);
            summon.SummonEntity(15, EntityNames.Militia, 3);
            summon.SummonEntity(3, EntityNames.Skeleton, 1);
            summon.SummonEntity(18, EntityNames.Zombie, 1);
        }

        //TODO Overlay to add players
    }
예제 #2
0
    void Awake()
    {
        SelectColor(0);
        lockbattle = false;
        editmode   = false;

        SaveLoad.Load();
        GameMemento.current = SaveLoad.savedGame;
        if (GameMemento.current.hexGridMemento.size != 0) //load from most recent if player presses continue
        {
            Debug.Log("Loading");
            playerManager.SetActivePlayers();
            loadMap.LoadHexTiles();
            loadMap.LoadTerrain();
            loadMap.LoadBuildings();
            loadMap.LoadEntities();
            loadMap.LoadResources();
            loadMap.LoadCorpses();
        }
        else //create new game when no game, set from player settings in menu
        {
            Debug.Log("New");
            playerManager.SetActivePlayers(); //TODO modify set active players to set new players when new game
            loadMap.LoadNewHexTiles(12, 12);
            loadMap.LoadRandom(12);           //sets the seed of the terrain spawn
        }

        //		List<int> test = hexGrid.GetCellIndexesOneHexAway (28);
        //		int test0 = test [0];
        //		int test1 = test [1];
        //		Debug.Log (test0);
        //		Debug.Log (test1);


        //TODO Overlay to add players
    }