Simplified level load and Utitility.Seedpackets
This commit is contained in:
parent
1631bd87ce
commit
3a5154f051
7 changed files with 15 additions and 31 deletions
|
|
@ -17,8 +17,6 @@ public partial class RuntimeLevelData : Node
|
|||
[Export]
|
||||
public float SunCount { get; private set; } = 0;
|
||||
[Export]
|
||||
public AdventureLevelResource levelResource;
|
||||
[Export]
|
||||
private LevelRunner levelRunner;
|
||||
[Export]
|
||||
private AnimationPlayer player;
|
||||
|
|
@ -26,6 +24,7 @@ public partial class RuntimeLevelData : Node
|
|||
public delegate void OnLevelStateChangedEventHandler(LevelStates state);
|
||||
|
||||
public static RuntimeLevelData Instance { get; private set; }
|
||||
public static AdventureLevelResource LevelResource { get; set; }
|
||||
|
||||
private LevelStates _currentState = LevelStates.ChooseYourSeeds;
|
||||
|
||||
|
|
@ -36,9 +35,6 @@ public partial class RuntimeLevelData : Node
|
|||
Instance = this;
|
||||
GetTree().Paused = true;
|
||||
Engine.TimeScale = 1.0;
|
||||
}
|
||||
public void StartLevel()
|
||||
{
|
||||
SetLevelState(LevelStates.ChooseYourSeeds);
|
||||
}
|
||||
#region Sun
|
||||
|
|
@ -76,7 +72,7 @@ public partial class RuntimeLevelData : Node
|
|||
break;
|
||||
case LevelStates.Game:
|
||||
GetTree().Paused = false;
|
||||
levelRunner.SetLevelResource(levelResource);
|
||||
levelRunner.SetLevelResource(LevelResource);
|
||||
break;
|
||||
case LevelStates.Win:
|
||||
break;
|
||||
|
|
@ -88,6 +84,11 @@ public partial class RuntimeLevelData : Node
|
|||
{
|
||||
return _currentState;
|
||||
}
|
||||
public override void _ExitTree()
|
||||
{
|
||||
LevelController.Instance.EndLevel();
|
||||
}
|
||||
|
||||
|
||||
//private Array<PlantResource> _selectedPlants;
|
||||
//private bool _selected;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue