Ejemplo n.º 1
0
    private void InitializeWorldMap()
    {
        // TODO: load world data properly
        WorldData worldData = Database.Instance.LoadWorldStageData(1);

        // Open map hud
        _mapHud = UIManager.Instance.OpenDialog(MapHud.DIALOG_ID) as MapHud;
        _mapHud.UpdateLife(_persistenceManager.CharacterBlob.CurrentLives, _persistenceManager.CharacterBlob.MaxLives);
        _mapHud.UpdateGold(_persistenceManager.CharacterBlob.Gold);

        // Create map
        GameObject gameMapGO = GameObject.Instantiate(_gameMapPrefab) as GameObject;

        _gameMap = gameMapGO.GetComponent <GameMap>();

        if (_persistenceManager.CharacterBlob.MapBlob == null)
        {
            _gameMap.GenerateNewMap(worldData);
        }
        else
        {
            _gameMap.LoadMap(_persistenceManager.CharacterBlob.MapBlob);
        }
        _gameMap.Initialize(_mapHud);
    }
Ejemplo n.º 2
0
        private void EnterNode(MapNodeVisual Node)
        {
            switch (Node.Type)
            {
            case NodeType.Enemy:
                MapHud.Get().OpenWindow <EnemyWindow>();
                break;

            case NodeType.EliteEnemy:
                MapHud.Get().OpenWindow <EnemyWindow>();
                break;

            case NodeType.Town:
                MapHud.Get().OpenWindow <TownWindow>();
                break;

            case NodeType.Rest:
                MapHud.Get().OpenWindow <RestWindow>();
                break;

            case NodeType.Boss:
                MapHud.Get().OpenWindow <EnemyWindow>();
                break;

            case NodeType.Examination:
                MapHud.Get().OpenWindow <TemplateMapWindow>();
                break;

            case NodeType.Loot:
                MapHud.Get().OpenWindow <TemplateMapWindow>();
                break;

            case NodeType.Question:
                MapHud.Get().OpenWindow <TemplateMapWindow>();
                break;

            case NodeType.Relic:
                MapHud.Get().OpenWindow <TemplateMapWindow>();
                break;

            case NodeType.Sanctuary:
                MapHud.Get().OpenWindow <TemplateMapWindow>();
                break;

            case NodeType.Trap:
                MapHud.Get().OpenWindow <TemplateMapWindow>();
                break;

            case NodeType.StartNode:
                MapHud.Get().OpenWindow <TemplateMapWindow>();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Ejemplo n.º 3
0
 public WorldMap()
 {
     Statics.LevelPlayer = new LevelPlayer(new Vector2(0, 0));
     mapHud = new MapHud();
 }
Ejemplo n.º 4
0
 public void Initialize(MapHud hud)
 {
     _mapHud = hud;
     _mapHud.Initialize(MoveToSelectedNode);
     CreatePlayer();
 }