This commit is contained in:
Фёдор Веселов 2024-09-10 19:36:20 +05:00
commit 2eb65c3092
24 changed files with 566 additions and 49 deletions

View file

@ -1,5 +1,4 @@
using Godot;
using System;
//
// Class that gives access to level data, pools and etc.
@ -11,8 +10,10 @@ public partial class LevelController : Node
private bool _isLevelRunning = false;
// Frequently accessed level elements
public RuntimeLevelData LevelData { get; set; }
public PoolContainer Pools { get; set; }
public PlantField PlantField { get; set; }
public override void _EnterTree()
{
@ -24,6 +25,11 @@ public partial class LevelController : Node
Instance = null;
}
/// <summary>
///
/// </summary>
/// <param name="levelTileset">Scene that will be loaded</param>
/// <param name="levelScript">Optional script that will be attached to loaded scene</param>
public void StartLevel(PackedScene levelTileset, Script levelScript = null)
{
if (_isLevelRunning)
@ -44,6 +50,7 @@ public partial class LevelController : Node
LevelData = null;
Pools = null;
PlantField = null;
_isLevelRunning = false;
}