26 lines
753 B
C#
26 lines
753 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);
|
|
}
|
|
if (@event.IsActionPressed("cheat_unlock_all"))
|
|
{
|
|
PlayerProgress.Instance.PlayerPlants = GameRegistry.GetPlants();
|
|
}
|
|
}
|
|
}
|