Пример #1
0
    void Start()
    {
        audio_source = GetComponent<AudioSource> ();

                if (new_level) {
                        SelectMusic ();
                        new_level = false;
                }

                levelManager = GameObject.Find ("LevelLogic").GetComponent<LevelManager> ();
                enemyManager = GameObject.Find ("LevelLogic").GetComponent<EnemyManager> ();
                playerManager = GameObject.Find ("LevelLogic").GetComponent<PlayerManager> ();

                //Form level
                levelManager.InitLevelMap ();
                //Update Each Tile in map - includeds asigning values through CA

                levelManager.UpdateGapsAndPlatforms ();
                levelManager.UpdateLevelMap ();
                //Draw level
                levelMap = levelManager.GetLevelMap ();
                levelManager.DrawLevelMap ();

                //Get level map tile array
                //levelMap = levelManager.GetLevelMap ();

                enemyManager.LoadMap (levelMap);
                playerManager.LoadMap (levelMap);

                //Player must be loaded after level for raycasting to work
                playerManager.LoadPlayerSpawn ();
                playerManager.LoadEndPoint ();
                enemyManager.LoadEnemySpawns ();
    }