5 float m_fDefaultDecayTickRate;
8 float m_fDefaultDecayValue;
20 RplComponent rpl = RplComponent.Cast(entity.FindComponent(RplComponent));
21 SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.FindResourceComponent(entity);
22 if (!resourceComponent)
27 if (!supplyContainer || supplyContainer.IsEncapsulated())
33 override void WriteVariable(Managed item,
SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager,
int playerID)
38 if (!supplyContainer || supplyContainer.IsEncapsulated())
41 bool enabled = var.GetBool();
42 supplyContainer.EnableDecay(enabled);
47 if (supplyContainer.GetResourceDecayTickrate() <= 0)
48 supplyContainer.SetResourceDecayTickrate(m_fDefaultDecayTickRate);
50 if (supplyContainer.GetResourceDecay() <= 0)
51 supplyContainer.SetResourceDecay(m_fDefaultDecayValue);
64 SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.FindResourceComponent(entity);
65 if (!resourceComponent)
68 return resourceComponent.GetContainer(
EResourceType.SUPPLIES);