14 SCR_ResourceComponent resourceComponent;
19 float currentValue = supplyContainer.GetResourceValue();
20 float maxValue = supplyContainer.GetMaxResourceValue();
28 override void WriteVariable(Managed item,
SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager,
int playerID)
38 SCR_ResourceComponent resourceComponent;
43 float percentage = var.GetFloat();
44 float currentValue = supplyContainer.GetResourceValue();
45 float maxValue = supplyContainer.GetMaxResourceValue();
46 float newValue = (maxValue * percentage) / 100;
48 supplyContainer.SetResourceValue(newValue);
53 component = SCR_ResourceComponent.Cast(entity.FindComponent(SCR_ResourceComponent));
63 IEntity iteratedEntity = entity.GetChildren();
64 while (iteratedEntity)
66 component = SCR_ResourceComponent.Cast(iteratedEntity.FindComponent(SCR_ResourceComponent));
74 iteratedEntity = iteratedEntity.GetSibling();