Beispiel #1
0
 private void GenerateBlocks(Vector3 pos)
 {
     if (Singleton <WorldRunner> .Instance.CurrentChunk.Value.Index < 20 && PlayerData.Instance.LifetimePrestiges.Value <= 0)
     {
         string     chunkPrefabPath = GetChunkPrefabPath(Singleton <WorldRunner> .Instance.CurrentChunk.Value.Index);
         GameObject gameObject      = GameObjectExtensions.InstantiateFromResources(chunkPrefabPath, pos, Quaternion.identity);
         ChunkGenerator.GenerateFromPlaceholders(gameObject, BindingManager.Instance.BlockContainer);
         UnityEngine.Object.DestroyImmediate(gameObject);
         CalculateBlocksAndGoldBlocks();
     }
     else if (PersistentSingleton <ARService> .Instance.ARLevel.Value != null && (Singleton <WorldRunner> .Instance.CurrentChunk.Value.Index % 5 == 2 || PersistentSingleton <ARService> .Instance.ShowCustomLevel.Value))
     {
         CustomLevel.Value = true;
         ChunkGenerator.GenerateFromCustomLevel(PersistentSingleton <ARService> .Instance.ARLevel.Value, pos, BindingManager.Instance.BlockContainer);
         PersistentSingleton <ARService> .Instance.ShowCustomLevel.Value = false;
     }
     else
     {
         CustomLevel.Value = false;
         ChunkGenerator.GenerateFromConfig(pos, Singleton <WorldRunner> .Instance.CurrentChunk.Value.Index, PlayerData.Instance.LifetimePrestiges.Value, PlayerData.Instance.RetryLevelNumber.Value, BindingManager.Instance.BlockContainer, bossFight: false);
     }
     (from moving in Singleton <CameraMoveRunner> .Instance.IsCameraMoving
      where !moving
      select moving).Take(1).Subscribe(delegate
     {
         CalculateChunkHealth();
     }).AddTo(SceneLoader.Instance);
 }