newlon/scripts/debug/Cheats.cs
2025-07-12 22:32:12 +05:00

23 lines
601 B
C#

using Godot;
using Newlon.Components.Level;
namespace Newlon.Debug;
public partial class Cheats : Node
{
public override void _Input(InputEvent @event)
{
if (OS.IsDebugBuild() == false) return;
if (@event.IsActionPressed("cheat_add_sun"))
{
RuntimeLevelData.Instance.AddSun(50);
}
if (@event.IsActionPressed("cheat_zombie_spawn"))
{
var spawner = GD.Load<PackedScene>("res://scenes/debug_zombie_spawner.tscn").Instantiate<DebugZombieSpawner>();
GetTree().CurrentScene.AddChild(spawner);
}
}
}