Example #1
0
        private void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            else if (instance != this)
            {
                Destroy(gameObject);
            }

            seed = Random.Range(0f, 10000f);

            underworldMap.size        = new Vector3Int(chunkSize.x, chunkSize.y * chunksCount, 0);
            underworldOres.size       = new Vector3Int(chunkSize.x, chunkSize.y * chunksCount, 0);
            underworldLadders.size    = new Vector3Int(chunkSize.x, chunkSize.y * chunksCount, 0);
            underworldBackground.size = new Vector3Int(chunkSize.x, chunkSize.y * chunksCount, 0);

            GenerateOverworld();
            GenerateWorldChunk();
            LoadNearbyChunks();
            sceneFade = FindObjectOfType <SceneFade>();
            sceneFade.BeginFade(-1);
            playerRB.bodyType = RigidbodyType2D.Dynamic;
        }