예제 #1
0
        protected virtual void Awake()
        {
            if (gameObject.scene.name.ToLower() != "master")
            {
                current = this;
            }
            if (!playerStart)
            {
                PlayerSpawner playerSpawner = GameObject.FindObjectOfType <PlayerSpawner>();
                if (playerSpawner)
                {
                    playerStart = playerSpawner.transform;
                }
            }
#if DUNGEN
            dungeonNavMeshAdapter = this.GetComponentInChildren <UnityNavMeshAdapter>();
            if (dungeonNavMeshAdapter)
            {
                // Prevent Unity to crash when generating dungeon
                dungeonNavMeshAdapter.enabled = false;
            }
            dungeonGenerator = this.GetComponentInChildren <RuntimeDungeon>();
            if (dungeonGenerator)
            {
                dungeonGenerator.Generator.OnGenerationStatusChanged += OnGenerationStatusChanged;
                GenerateDungeon();
            }
#endif
        }