Example #1
0
    private void Start()
    {
        sectors = new List <Sector>();
        islands = new List <Island>();
        bridges = new List <Bridge>();

        seed = GameData.instance.data.seed;

        // Create starting sector
        GenerateMap(new Point(0, 0));

        // Load visited islands
        foreach (Point point in GameData.instance.data.visitedIslands)
        {
            Island island = FindIsland(point.x, point.y);
            if (island != null)
            {
                island.Visited();
                island.RemoveEvent();
                if (currentIsland != null)
                {
                    Bridge b = FindBridge(currentIsland, island);
                    if (b != null)
                    {
                        b.Walk();
                    }
                    else
                    {
                        Debug.Log("No such bridge " + currentIsland.point + " - " + island.point);
                    }
                }
                RevealIsland(island);
                currentIsland = island;
            }
        }

        // Set player
        SetPlayer();

        // Load event
        LoadCurrentEvent();

        // Update UI
        mapUI.UpdateAll();

        // Save game
        // SaveManager.Save(GameData.instance);
    }