new forge entity node to benefit from autoinject

This commit is contained in:
2026-05-02 15:24:28 +02:00
parent fb30a08b89
commit 0e6211943d
12 changed files with 134 additions and 99 deletions

View File

@@ -25,6 +25,7 @@ using Movementtests.interfaces;
using Movementtests.systems;
using Movementtests.player_controller.Scripts;
using Movementtests.managers;
using Movementtests.tools;
using RustyOptions;
using Node = Godot.Node;
@@ -455,15 +456,7 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
LoadSettings();
// General use stuff
List<AttributeSet> attributeSetList = [];
foreach (var node in GetChildren())
{
if (node is not ForgeAttributeSet attributeSetNode) continue;
var attributeSet = attributeSetNode.GetAttributeSet();
if (attributeSet is not null)
attributeSetList.Add(attributeSet);
}
Attributes = new EntityAttributes([.. attributeSetList]);
Attributes = new EntityAttributes([.. ForgeUtils.CollectAttributeList(this)]);
HealthAttribute = Attributes["PlayerAttributeSet.Health"];
ManaAttribute = Attributes["PlayerAttributeSet.Mana"];