Initial field spawns
This commit is contained in:
parent
fdff25d451
commit
12b7435d19
28 changed files with 197 additions and 98 deletions
19
scripts/LevelStateBrainDisabler.cs
Normal file
19
scripts/LevelStateBrainDisabler.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using Godot;
|
||||
using Newlon.Components;
|
||||
using Newlon.Components.Level;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class LevelStateBrainDisabler : Node
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
RuntimeLevelData.Instance.OnLevelStateChanged += OnLevelStateChanged;
|
||||
}
|
||||
public void OnLevelStateChanged(RuntimeLevelData.LevelStates state)
|
||||
{
|
||||
if (state == RuntimeLevelData.LevelStates.Game)
|
||||
{
|
||||
GetParent<Entity>().EnableBrain();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue