Ejemplo n.º 1
0
    void Start()
    {
        _audioManager     = AudioManager.Instance();
        _terrainDatabase  = TerrainDatabase.Instance();
        _characterManager = CharacterManager.Instance();
        _itemDatabase     = ItemDatabase.Instance();
        _key        = _terrainDatabase.GetRegionKey();
        _monsterObj = Resources.Load <GameObject>("Prefabs/Monster");
        var starter = GameObject.FindObjectOfType <SceneStarter>();

        if (starter != null)
        {
            _mapPosition      = starter.MapPosition;
            _previousPosition = starter.PreviousPosition;
        }
        _floor = FloorTiles[RandomHelper.Range(new Vector2(_mapPosition.x + 0.01f, _mapPosition.y + 0.01f), _key, FloorTiles.Length)];
        //print("Building Interior _floor: "  +"  " + _floor.name);
        _story = _terrainDatabase.GetStoryBasedOnRarity(_mapPosition, _key);
        GenerateInterior();
        if (_audioManager != null)
        {
            _audioManager.UpdateSoundVolume(_characterManager.UserPlayer.SoundVolume);
            _audioManager.PlayInsideMusic(_previousPosition, _key);
        }
    }