Exemplo n.º 1
0
 /// <summary>
 /// Awake is called when the script instance is being loaded.
 /// </summary>
 void Awake()
 {
     transform.position = monsterPhasePos.position;
     _monsterSpawner    = GetComponent <MonsterSpawner>();
     _animator          = GetComponent <Animator>();
     _monsterSpawner.monstersDeathEvent.AddListener(OnAllyDeath);
 }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     isGameOver     = false;
     monsterSpawner = Instantiate(monsterSpawnerPrefab);
     monsterSpawner.gameObject.SetActive(false);
     gameOverScore = gameOver.GetComponentInChildren <Text>();
 }
Exemplo n.º 3
0
    private void SetMonster(Transform player)
    {
        MonsterSpawner monsterSpawner = null;

        // 스폰
        for (int i = 0; i < _monsterSpawners.Length; i++)
        {
            //조건
            monsterSpawner = _monsterSpawners[i].GetComponent <MonsterSpawner>();
            MonsterKind[] spawnKinds = monsterSpawner._SpawnKind;

            List <GameObject[]> spawnMonsters = new List <GameObject[]>();
            for (int j = 0; j < spawnKinds.Length; ++j)
            {
                MonsterKind kind = MonsterKind.NONPASS;
                switch (spawnKinds[j])
                {
                case MonsterKind.SLIME:           kind = MonsterKind.SLIME;           break;

                case MonsterKind.SKELETONWARRIOR: kind = MonsterKind.SKELETONWARRIOR; break;

                case MonsterKind.ICE_ELEMENTAL:   kind = MonsterKind.ICE_ELEMENTAL;   break;

                case MonsterKind.KINGSLIME:       kind = MonsterKind.KINGSLIME;       break;
                }
                spawnMonsters.Add(Utility.ConvertList2Array(Sort(kind)));
            }

            monsterSpawner.SetSpawnMonsters(spawnMonsters);
            monsterSpawner.Spawn(player);
        }
    }
Exemplo n.º 4
0
    public void Init(MonsterSpawner monsterSpawner, Player enemy, MonsterStatsPanelController statsPanelController)
    {
        MonsterSpawner = monsterSpawner;
        Enemy          = enemy;
        int counter = 0;

        Monsters = new List <GameObject>();

        List <Vector3> positions = new List <Vector3>()
        {
            new Vector3(0f, -40f, 0f),
            new Vector3(30f, -30f, 0f),
            new Vector3(40f, 0f, 0f)
        };


        for (int i = 0; i < 3; i++)
        {
            GameObject monster = MonsterSpawner.Spawn(statsPanelController);
            monster.transform.SetParent(transform);
            Enemy.ChooseMonster(monster.GetComponent <MonsterController>().Monster);
            Monsters.Add(monster);

            monster.transform.localPosition = positions[counter];
            monster.transform.localScale    = new Vector3(.8f, .8f);

            counter++;
        }
    }
Exemplo n.º 5
0
    void InitCustomMazeObjList()
    {
        foreach (Transform child in level.customMazeObject.transform)
        {
            TileItem       item           = child.gameObject.GetComponent <TileItem>();
            MonsterSpawner monsterSpawner = child.gameObject.GetComponent <MonsterSpawner>();

            // Add all the layout object from "Maze" parent object
            if (child.gameObject.name == "Maze")
            {
                foreach (Transform layout in child.transform)
                {
                    customTileObjList.Add(layout.gameObject);
                }
            }
            // Add object to customTileItems list based on script attached
            else if (item != null)
            {
                if (!customTileItems.ContainsKey(item.itemType))
                {
                    customTileItems.Add(item.itemType, new List <TileItem>());
                }

                customTileItems[item.itemType].Add(item);
            }
            else if (monsterSpawner != null)
            {
                customMonsterSpawnerList.Add(monsterSpawner);
            }
        }
    }
Exemplo n.º 6
0
    public void SpawnObject(GameObject monsterPrefab, TileObject tileObject, MonsterSpawner spawner)
    {
        var tileSystem = TileSystem.Instance;

        GameObject monsterObj = Instantiate(monsterPrefab);

        monsterObj.InitTransformAsChild(tileSystem.GetTilemap(eTilemapType.GROUND).transform);

        Vector3 pos = monsterObj.transform.position;

        monsterObj.transform.position   = pos;
        monsterObj.transform.localScale = new Vector3(1.3f, 1.3f, 1.3f);

        Enemy monster = monsterObj.AddComponent <Enemy>();

        monster.name = "Enemy";
        monster.Init();
        monster.SetSpawner(spawner);

        var spriteRenderers = monster.GetComponentsInChildren <SpriteRenderer>(true);

        foreach (var spriteRenderer in spriteRenderers)
        {
            spriteRenderer.sortingOrder = tileSystem.GetTileCell(tileObject.GetTilePosition()).GetGroundLayerOrder();
        }
        tileSystem.GetTileCell(tileObject.GetTilePosition()).SetObject(monster, eTileLayer.GROUND);
    }
Exemplo n.º 7
0
 //Clears statuses and variables of various classes
 private void ClearData()
 {
     MonsterSpawner.Clear();
     WeaponController.Clear();
     ScoreController.Clear();
     GameStateController.IsInProgress = true;
     GameStateController.SetGameState(GameStateController.States.Gameplay);
 }
 /// <summary>
 /// Shorthand method for adding monster spawner to list
 /// </summary>
 /// <param name="spawner"></param>
 public void Register(MonsterSpawner spawner)
 {
     if (_spawners == null)
     {
         _spawners = new List <MonsterSpawner>();
     }
     _spawners.Add(spawner);
 }
        public bool SpawnForBanner(Banner banner, IDifficultySetting difficulty, Colony colony, float cooldown, IPandaBoss boss)
        {
            int     recycleFrequency  = MonsterSpawner.GetPathRecycleFrequency(1f / cooldown);
            NPCType zombieTypeToSpawn = difficulty.GetZombieTypeToSpawn(colony);
            float   maxPathDistance   = difficulty.GetMaxPathDistance(colony, zombieTypeToSpawn, banner.SafeRadius);

            return(CaclulateZombie(banner, colony, zombieTypeToSpawn, recycleFrequency, maxPathDistance));
        }
Exemplo n.º 10
0
 void Start()
 {
     _inventory       = FindObjectOfType <Inventory>();
     _equipment       = FindObjectOfType <Equipment>();
     _dungeon_manager = FindObjectOfType <DungeonManager>();
     _monster_spawner = FindObjectOfType <MonsterSpawner>();
     _animator        = GetComponent <Animator>();
     _audio_source    = GetComponent <AudioSource>();
 }
Exemplo n.º 11
0
    void CreateGameSystem()
    {
        GameObject gameSystem = new GameObject("GameSystem");

        GameObject monsterSpawner = new GameObject("MonsterSpawner");

        monsterSpawner.transform.parent = gameSystem.transform;
        m_monsterSpawner = monsterSpawner.AddComponent <MonsterSpawner>();
    }
Exemplo n.º 12
0
 void Start()
 {
     letterDisplay = transform.Find("letter").GetComponent <InputDisplayScript>();
     numberDisplay = transform.Find("number").GetComponent <InputDisplayScript>();
     spawner       = GetComponentInChildren <MonsterSpawner>();
     ammo          = GetComponentInChildren <AmmoScript>();
     shot          = GetComponentInChildren <ShotScript>();
     reload        = transform.Find("reload").GetComponent <SpriteRenderer>();
 }
Exemplo n.º 13
0
 public void Initialize(MonsterSpawner m)
 {
     MS               = m;
     dead             = false;
     gameObject.layer = LayerMask.NameToLayer("Monsters");
     anim             = GetComponent <Animator>();
     agent            = gameObject.AddComponent <NavMeshAgent>();
     agent.speed      = 2.5f;
 }
Exemplo n.º 14
0
    void Start()
    {
        ItemDictionary.BuildDictionary();

        _inventory       = FindObjectOfType <Inventory>();
        _equipment       = FindObjectOfType <Equipment>();
        _dungeon_manager = FindObjectOfType <DungeonManager>();
        _monster_spawner = FindObjectOfType <MonsterSpawner>();
    }
Exemplo n.º 15
0
 private void Start()
 {
     Instance = this;
     for (int i = 0; i < spawnPoints.Count; i++)
     {
         SpawnMonster(i);
     }
     StartCoroutine(Spawning());
 }
Exemplo n.º 16
0
 void Awake()
 {
     if (instance != null)
     {
         Debug.Log("More than one Monster Spawner in scene!");
         return;
     }
     instance = this;
 }
Exemplo n.º 17
0
 // Use this for initialization
 void Start()
 {
     panicScript         = GetComponent <PanicTrigger>();
     whistleScript       = GetComponent <PlayerWhistle>();
     player              = GameObject.FindGameObjectWithTag("Player").transform;
     city                = GameObject.FindGameObjectWithTag("city").transform;
     getExitScript       = city.GetComponent <MonsterSpawner>();
     hospitalLightScript = player.GetComponent <HospitalLight>();
     setState();
 }
    void StartGame()
    {
        MonsterSpawner spawner = container.Build <MonsterSpawner>();

        //tickEngine could be added in the container as well
        //if needed to other classes!
        TickEngine tickEngine = new TickEngine();

        tickEngine.Add(spawner);
    }
Exemplo n.º 19
0
    public MonsterSpawner TryToAssignToMonsterSpawner()
    {
        MonsterSpawner monsterSpawner = GameManager.Instance.GetFreeMonsterSpawn(this);

        if (monsterSpawner != null)
        {
            currentMonsterSpawner = monsterSpawner;
        }
        return(monsterSpawner);
    }
Exemplo n.º 20
0
        void LoadMonsterSpawners_Process_Handler(Task t)
        {
            foreach (object[] row in t.Query.Rows)
            {
                MonsterSpawner ms = MonsterSpawner.ReadFromDB(row);
                _server.AddMonsterSpawner(ms);
            }

            t.Type = Task.TaskType.LoadQuestLines_Process;
            AddDBQuery("SELECT * FROM quest_lines;", t);
        }
Exemplo n.º 21
0
    private const float ROOM_CENTER_BUFFER = 0.15f; //

    private void Start()
    {
        _dungeon_size = 18;
        _spawn_size   = 40;
        Level         = 0;

        MonsterSpawner = FindObjectOfType <MonsterSpawner>().GetComponent <MonsterSpawner>();
        if (MonsterSpawner == null)
        {
            Debug.Log("DungeonManager could not find MonsterSpawner");
        }
        Player = FindObjectOfType <PlayerMovement>().gameObject;
        if (Player == null)
        {
            Debug.Log("DungeonManager could not find Player");
        }
        Grid = FindObjectOfType <Grid>().gameObject;
        if (Grid == null)
        {
            Debug.Log("DungeonManager could not find Grid");
        }
        CameraObject = FindObjectOfType <Camera>().gameObject;
        if (CameraObject == null)
        {
            Debug.Log("DungeonManager could not find Camera");
        }
        CameraObject.GetComponent <CameraMovement>().CameraState = "Follow";
        MusicManager = FindObjectOfType <MusicManager>();
        if (MusicManager == null)
        {
            Debug.Log("DungeonManager could not find MusicManager");
        }

        //Instantiate Spawn for the first time
        _room_spawn = MyInstantiate(
            Levels[Level].Spawn,
            Player.transform.position.x, 0);
        _room_left = MyInstantiate(
            Levels[Level].Filler,
            Player.transform.position.x - _spawn_size / 2 - _dungeon_size / 2, 0);
        RoomStage = _room_current = MyInstantiate(
            Levels[Level].Stages[_stage],
            Player.transform.position.x + _spawn_size / 2 + _dungeon_size / 2, 0);

        _wall = MyInstantiate(
            Levels[Level].Walls.SpawnWallsRight,
            Player.transform.position.x, 0);
        _wall_another = MyInstantiate(
            Levels[Level].Walls.StaticWallsLeft,
            _room_current.transform.position.x, 0);

        DungeonState = "Spawn";
    }
Exemplo n.º 22
0
        /// <summary>
        /// Adds monster spawner to a map.
        /// </summary>
        /// <remarks>
        /// Parameters:
        /// - string  monsterClassName
        /// - number  amount
        /// - number  respawnDelayMs
        /// - string  mapClassName
        /// - table   area
        /// {
        ///     x  X-coordinate of the spawn area's center
        ///     y  Y-coordinate of the spawn area's center
        ///     z  Z-coordinate of the spawn area's center
        ///     width  Width of the spawn area
        ///     height  Height of the spawn area
        /// }
        ///
        /// Example:
        /// -- Spawns 5 Kepas on the starter map, in a 100x100 area around
        /// -- [-605/260/-1155]. Respawns dead Kepas after 5000 milliseconds.
        /// addspawn("Onion", 5, 5000, "f_siauliai_west", { x = -605, y = 260, z = -1155, width = 100, height = 100 })
        /// </remarks>
        /// <param name="L"></param>
        /// <returns></returns>
        private int addspawn(IntPtr L)
        {
            var monsterClassName = luaL_checkstring(L, 1);
            var amount           = luaL_checkinteger(L, 2);
            var respawnDelayMs   = luaL_checkinteger(L, 3);
            var mapClassName     = luaL_checkstring(L, 4);

            luaL_checktype(L, 5, LUA_TTABLE);

            lua_getfield(L, 5, "x");
            var x = (float)luaL_checknumber(L, -1);

            lua_getfield(L, 5, "y");
            var y = (float)luaL_checknumber(L, -1);

            lua_getfield(L, 5, "z");
            var z = (float)luaL_checknumber(L, -1);

            lua_getfield(L, 5, "width");
            var width = (float)luaL_checknumber(L, -1);

            lua_getfield(L, 5, "height");
            var height = (float)luaL_checknumber(L, -1);

            lua_settop(L, 0);

            if (!ChannelServer.Instance.Data.MonsterDb.TryFind(a => a.ClassName == monsterClassName, out _))
            {
                return(melua_error(L, "addspawn: Monster '{0}'  not found.", monsterClassName));
            }

            if (!ChannelServer.Instance.World.TryGetMap(mapClassName, out var map))
            {
                return(melua_error(L, "addspawn: Map '{0}' for '{1}' spawn not found.", mapClassName, monsterClassName));
            }

            var area = new Position[]
            {
                new Position(x - width / 2, y, z - height / 2),
                new Position(x + width / 2, y, z - height / 2),
                new Position(x + width / 2, y, z + height / 2),
                new Position(x - width / 2, y, z + height / 2),
            };

            var spawner = new MonsterSpawner(monsterClassName, amount, TimeSpan.FromMilliseconds(respawnDelayMs), mapClassName, area);

            map.AddSpawner(spawner);

            return(0);
        }
Exemplo n.º 23
0
 // Use this for initialization
 void Start()
 {
     stateManager   = GetComponent <NPCState>();
     SpawnManager   = transform.parent.parent.parent.GetComponent <PeopleSpawner>();
     monsterManager = transform.parent.parent.parent.GetComponent <MonsterSpawner>();
     player         = GameObject.FindGameObjectWithTag("Player").transform;
     monster        = GameObject.FindGameObjectWithTag("monster").transform;
     animator       = GetComponent <Animator>();
     navMeshAgent   = GetComponent <NavMeshAgent>();
     halo           = (Behaviour)gameObject.GetComponent("Halo");
     city           = GameObject.FindGameObjectWithTag("city").transform;
     getExitScript  = city.GetComponent <MonsterSpawner>();
     exits          = monsterManager.exits;
 }
Exemplo n.º 24
0
        // ��������Ⱥϵ���еĹ���
        public virtual void SpawnMonster(IWorld world, IGrainFactory grainFactory, IChunkColumnStorage chunk, Random rand, BlockWorldPos pos)
        {
            ChunkWorldPos chunkPos = pos.ToChunkWorldPos();
            int           seed     = chunkPos.Z * 16384 + chunkPos.X;
            Random        r        = new Random(seed);

            foreach (MobType eachType in _monsterList)
            {
                if (r.Next(64) == 0)
                {
                    MonsterSpawner spawner = new MonsterSpawner(eachType, 3);
                    spawner.Spawn(world, grainFactory, chunk, rand, new BlockWorldPos(pos.X, pos.Y, pos.Z));
                }
            }
        }
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        MonsterSpawner spawner = target as MonsterSpawner;

        if (GUILayout.Button("Add Spawn Point"))
        {
            spawner.CreateSpawnPoint();
        }

        if (GUILayout.Button("Force Spawn"))
        {
            spawner.SpawnMonster();
        }
    }
Exemplo n.º 26
0
    // Start is called before the first frame update
    void Start()
    {
        _completedWavesResult.SetActive(true);
        _roundsMobs = new List <int> {
            5, 10, 15
        };

        _maxProgress = 30;

        _monsterSpawnersScript = _gateModel1_SpawnerObject.GetComponent <MonsterSpawner>();

        if (!PlayerPrefs.HasKey("ScoreKilled1"))
        {
            PlayerPrefs.SetFloat("ScoreKilled1", -1);
        }
    }
Exemplo n.º 27
0
    void Start()
    {
        _player           = Player.GetComponent <Player>();
        _player_combat    = Player.GetComponent <PlayerCombat>();
        _player_movement  = Player.GetComponent <PlayerMovement>();
        _player_inventory = Player.GetComponent <PlayerInventory>();
        _player_animator  = Player.GetComponent <Animator>();
        _audio_source     = GetComponent <AudioSource>();
        _monster_spawner  = FindObjectOfType <MonsterSpawner>();

        _player_inventory.Stunned = true;
        _player_animator.SetBool("Dead", true);
        _player.GetComponent <Rigidbody2D>().gravityScale = 0;

        StoryText = new string[] { //Bug doesn't allow escape characters in inspector
            "Dungeon - noun \nA dark usually underground prison or vault \nMay contain monsters and treasure",
            "All known dungeons were vanquished by the Hero \nand no new dungeons have appeared since"
        };
    }
Exemplo n.º 28
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);

        MMScript = GetComponentInChildren<MonsterSpawner>();
        player = Instantiate(playerFab);
        player.transform.parent = this.transform;

        //Call the InitGame function to initialize the first level
        InitGame();
    }
Exemplo n.º 29
0
    public void PlayerDied()
    {
        if (hasDied)
        {
            return;
        }

        hasDied = true;

        AddStats();

        currentCam = Camera.main;

        deathPoint = playerOne.transform.position + new Vector3(0, 0, -10);

        Time.timeScale = .55f;

        currentCam.GetComponent <CameraFollow>().enabled = false;

        playerOne.GetComponent <SpriteRenderer>().enabled   = false;
        playerOne.GetComponent <PlayerController>().enabled = false;
        playerOne.GetComponent <Movement>().enabled         = false;

        Instantiate(endScreenPrefab);

        StartCoroutine(PlayerDiedZoom());

        MonsterSpawner mSpawner = FindObjectOfType <MonsterSpawner>();

        FindObjectOfType <EventSystem>().SetSelectedGameObject(FindObjectOfType <GameOver>().quitButton);

        stopSpawn = true;
        List <GameObject> enemies = mSpawner.SendList();

        foreach (var enemie in enemies)
        {
            enemie.GetComponentInChildren <EnemyDetection>().enabled = false;
            enemie.GetComponent <EnemyAI>().enabled = false;
            enemie.GetComponentInChildren <EnemyAttack>().isAttacking = false;
            enemie.GetComponentInChildren <EnemyAttack>().enabled     = false;
        }
    }
Exemplo n.º 30
0
    private void CreateGameSystem()
    {
        SpawnPoint[] spawnPoints = GameObject.FindObjectsOfType <SpawnPoint>();
        for (int i = 0; i < spawnPoints.Length; i++)
        {
            if (spawnPoints[i].m_bIsMonsterSpawnPoint)
            {
                m_monsterSpawnPoint = spawnPoints[i];
            }
            else
            {
                m_characerSpawnPoint = spawnPoints[i];
            }
        }

        GameObject monsterSpawner = new GameObject("MonsterSpawner");

        //monsterSpawner.transform.parent = gameSystem.transform;
        m_monsterSpawner = monsterSpawner.AddComponent <MonsterSpawner>();
    }
Exemplo n.º 31
0
    public MonsterSpawner GetFreeMonsterSpawn(User user)
    {
        List <MonsterSpawner> spawns = MonsterSpawners.FindAll(x => x.IsThereAFreeSpace());


        MonsterSpawner monsterSpawner = null;

        if (spawns.Count > 0)
        {
            monsterSpawner = spawns.MinBy(x => Vector3.Distance(user.transform.position, x.GetPosition()));
        }


        if (monsterSpawner != null)
        {
            monsterSpawner.OnUserAssign(user);
        }

        return(monsterSpawner);
    }
Exemplo n.º 32
0
 public void Stop()
 {
     this.spawner = null;
     nextGenerateTime = -1f;
 }
	public void LaunchSellMonsterGUI(MonsterSpawner spawner, SellMonsterResults monsterSoldCallback)
	{
		DismissAll();
		
		if (monsterSelectedCallback != null)
		{
			monsterSelectedCallback(null);
			monsterSelectedCallback = null;
		}
		
		//If we already have an active callback set then return false to that caller since it's monster wasn't sold.
		if (this.monsterSoldCallback != null)
			this.monsterSoldCallback(false);
		
		this.monsterSoldCallback = monsterSoldCallback;
		monsterSaleConfirmationPanel.BringIn();
	}
	/// <summary>
	/// Launches the monster GUI and returns the chosen monster to the last caller of this
	/// method at any given moment in time.
	/// </summary>
	/// <returns>
	/// The chosen monster.
	/// </returns>
	/// <param name='spawner'>
	/// The MonsterSpawner requesting that the user be allowed to choose a monster to spawn.
	/// </param>
	public void LaunchMonsterGUI1(MonsterSpawner spawner, MonsterSelectedForSpawner monsterChosenCallback)
	{
		//If we already have an active spawner set then deactivate it
		if (spawnerCallback != null)
			spawnerCallback(null);
			
		spawnerCallback = monsterChosenCallback;		
		
		if (!guiOpen)
		{
			StartCoroutine(monsterGUIManager.coLaunchGUI(spawner));
			guiOpen = true;
		}					
	}	
Exemplo n.º 35
0
    public void Start(MonsterSpawner spawner)
    {
        this.spawner = spawner;

        updateNextGenerateTime();
    }
	/// <summary>
	/// Launches the monster GUI and returns the chosen monster to the last caller of this
	/// method at any given moment in time.
	/// </summary>
	/// <returns>
	/// The chosen monster.
	/// </returns>
	/// <param name='spawner'>
	/// The MonsterSpawner requesting that the user be allowed to choose a monster to spawn.
	/// </param>
	public void LaunchMonsterGUI(MonsterSpawner spawner, MonsterSelected monsterChosenCallback)
	{
		//If we already have an active spawner set then deactivate it
		if (this.monsterSelectedCallback != null)
			this.monsterSelectedCallback(null);
			
		this.monsterSelectedCallback = monsterChosenCallback;		
		
		if (!monsterSelectionGUIOpen)
		{
			StartCoroutine(coLaunchGUI(spawner));
			monsterSelectionGUIOpen = true;
		}					
	}	
Exemplo n.º 37
0
        /// <summary>
        /// Creates a bunch of stuff (such as the biome library, primitive library etc.) which won't change
        /// from game to game.
        /// </summary>
        public void InitializeStaticData(string companyName, string companyMotto, NamedImageFrame companyLogo, Color companyColor)
        {
            CompositeLibrary.Initialize();
            CraftLibrary = new CraftLibrary();

            if (SoundManager.Content == null)
            {
                SoundManager.Content = Content;
                SoundManager.LoadDefaultSounds();
                SoundManager.SetActiveSongs(ContentPaths.Music.dwarfcorp, ContentPaths.Music.dwarfcorp_2, ContentPaths.Music.dwarfcorp_3, ContentPaths.Music.dwarfcorp_4);
            }
            new PrimitiveLibrary(GraphicsDevice, Content);
            InstanceManager = new InstanceManager();

            EntityFactory.InstanceManager = InstanceManager;
            InstanceManager.CreateStatics(Content);

            Color[] white = new Color[1];
            white[0] = Color.White;
            pixel = new Texture2D(GraphicsDevice, 1, 1);
            pixel.SetData(white);

            Tilesheet = TextureManager.GetTexture(ContentPaths.Terrain.terrain_tiles);
            AspectRatio = GraphicsDevice.Viewport.AspectRatio;
            DefaultShader = Content.Load<Effect>(ContentPaths.Shaders.TexturedShaders);
            DefaultShader.Parameters["xFogStart"].SetValue(40.0f);
            DefaultShader.Parameters["xFogEnd"].SetValue(80.0f);

            VoxelLibrary = new VoxelLibrary();
            VoxelLibrary.InitializeDefaultLibrary(GraphicsDevice, Tilesheet);

            bloom = new BloomComponent(Game)
            {
                Settings = BloomSettings.PresetSettings[5]
            };
            bloom.Initialize();

            fxaa = new FXAA();
            fxaa.Initialize();

            SoundManager.Content = Content;
            PlanService.Restart();

            ComponentManager = new ComponentManager(this, companyName, companyMotto, companyLogo, companyColor);
            ComponentManager.RootComponent = new Body("root", null, Matrix.Identity, Vector3.Zero, Vector3.Zero, false);
            Vector3 origin = new Vector3(WorldOrigin.X, 0, WorldOrigin.Y);
            Vector3 extents = new Vector3(1500, 1500, 1500);
            ComponentManager.CollisionManager = new CollisionManager(new BoundingBox(origin - extents, origin + extents));

            Alliance.Relationships = Alliance.InitializeRelationships();

            JobLibrary.Initialize();
            MonsterSpawner = new MonsterSpawner();
            EntityFactory.Initialize();
        }
	public IEnumerator coLaunchGUI(MonsterSpawner monsterSpawner)
	{		
		bool done = false;
		
		DismissSaleConfirmationPanel();
		
		if (monsterSoldCallback != null)
		{
			monsterSoldCallback(false);
			monsterSoldCallback = null;
		}
		
		//this.monsterSelectedCallback = monsterSelectedCallback;
		
		monsterChosen = false;
		
		listPanel.BringIn();
		
		while (!done)
		{
			if (monsterChosen)
			{
				done = true;
				
				Debug.Log("Monster chosen is: " + monsterScrollList.LastClickedControl.Data);			
			}
			
			yield return new WaitForSeconds(0.033f);
		}		
		
		yield return null;	
	}