rokojori_action_library/Runtime/Godot/NodeStateConfiguration.cs

67 lines
1.2 KiB
C#
Raw Normal View History

2025-07-22 14:08:22 +00:00
using Godot;
using System.Collections.Generic;
using System;
2026-05-22 12:25:02 +00:00
using Rokojori.Extensions;
namespace Rokojori;
2025-07-22 14:08:22 +00:00
2026-05-22 12:25:02 +00:00
[RokojoriActionCoreExport]
[Tool,GlobalClass]
public partial class NodeStateConfiguration:Resource
{
[Export]
public Trillean processEnabled = Trillean.Any;
2025-07-22 14:08:22 +00:00
2026-05-22 12:25:02 +00:00
[Export]
public Trillean inputEnabled = Trillean.Any;
2025-07-22 14:08:22 +00:00
2026-05-22 12:25:02 +00:00
[Export]
public Trillean physicsEnabled = Trillean.Any;
2025-07-22 14:08:22 +00:00
2026-05-22 12:25:02 +00:00
[Export]
public Trillean signalsEnabled = Trillean.Any;
2025-07-22 14:08:22 +00:00
2026-05-22 12:25:02 +00:00
[Export]
public Trillean visible = Trillean.Any;
2025-07-22 14:08:22 +00:00
2026-05-22 12:25:02 +00:00
[Export]
public bool setProcessMode = false;
2026-02-26 14:06:27 +00:00
2026-05-22 12:25:02 +00:00
[Export]
public Node.ProcessModeEnum processMode;
2026-02-26 14:06:27 +00:00
2026-05-22 12:25:02 +00:00
public static NodeStateConfiguration All( Trillean value )
{
var config = new NodeStateConfiguration();
2026-02-26 14:06:27 +00:00
2026-05-22 12:25:02 +00:00
config.processEnabled = value;
config.inputEnabled = value;
config.physicsEnabled = value;
config.signalsEnabled = value;
config.visible = value;
2026-02-26 14:06:27 +00:00
2026-05-22 12:25:02 +00:00
config.setProcessMode = true;
2026-02-26 14:06:27 +00:00
2026-05-22 12:25:02 +00:00
config.processMode = Trillean.True == value ? Node.ProcessModeEnum.Inherit : Node.ProcessModeEnum.Disabled;
2026-02-26 14:06:27 +00:00
2026-05-22 12:25:02 +00:00
return config;
}
2026-02-26 14:06:27 +00:00
2026-05-22 12:25:02 +00:00
public static NodeStateConfiguration AllOn()
{
return All( Trillean.True );
}
2026-02-26 14:06:27 +00:00
2026-05-22 12:25:02 +00:00
public static NodeStateConfiguration AllOff()
{
return All( Trillean.False );
2025-07-22 14:08:22 +00:00
}
2026-05-22 12:25:02 +00:00
2025-07-22 14:08:22 +00:00
}
2026-05-22 12:25:02 +00:00
2025-07-22 14:08:22 +00:00