13 [
Attribute(uiwidget: UIWidgets.SpinBox,
params:
string.Format(
"0.0 %1 1.0",
float.MAX))]
14 protected float m_fResourceValueCurrent;
18 if (!representedContainer)
21 float resourcesResult = Math.Min(m_fResourceValueCurrent, representedContainer.GetMaxResourceValue());
22 m_fResourceValueCurrent -= resourcesResult;
24 representedContainer.SetResourceValue(resourcesResult,
false);
33 if (!representedContainer)
36 IEntity owner = representedContainer.GetOwner();
41 ActionsManagerComponent actionManagerComponent = ActionsManagerComponent.Cast(owner.FindComponent(ActionsManagerComponent));
43 if (!actionManagerComponent)
46 actionManagerComponent.Deactivate(owner);
55 if (!representedContainer)
58 IEntity owner = representedContainer.GetOwner();
65 if (!inventoryComponent)
68 inventoryComponent.DisablePhysics();
69 inventoryComponent.ActivateOwner(
false);
81 if (!representedContainer)
84 representedContainer.SetResourceRights(m_eResourceRights);
92 protected bool m_bEnableResourceDecay;
95 protected float m_fResourceDecay;
97 [
Attribute(uiwidget: UIWidgets.SpinBox,
params:
string.Format(
"0.0 %1 1.0",
float.MAX))]
98 protected float m_fResourceDecayTickrate;
100 [
Attribute(uiwidget: UIWidgets.SpinBox,
params:
string.Format(
"0.0 %1 1.0",
float.MAX))]
101 protected float m_fResourceDecayTimeout;
105 if (!representedContainer)
108 representedContainer.EnableDecay(m_bEnableResourceDecay,
false);
109 representedContainer.SetResourceDecay(m_fResourceDecay,
false);
110 representedContainer.SetResourceDecayTickrate(m_fResourceDecayTickrate);
111 representedContainer.SetResourceDecayTimeout(m_fResourceDecayTimeout);
123 if (!representedContainer)
126 representedContainer.SetOnEmptyBehavior(m_eOnEmptyBehavior);
133 [
Attribute(uiwidget: UIWidgets.CheckBox)]
134 protected bool m_bEnableResourceGain;
137 protected float m_fResourceGain;
139 [
Attribute(uiwidget: UIWidgets.SpinBox,
params:
string.Format(
"0.0 %1 1.0",
float.MAX))]
140 protected float m_fResourceGainTickrate;
142 [
Attribute(uiwidget: UIWidgets.SpinBox,
params:
string.Format(
"0.0 %1 1.0",
float.MAX))]
143 protected float m_fResourceGainTimeout;
147 if (!representedContainer)
150 representedContainer.EnableGain(m_bEnableResourceGain,
false);
151 representedContainer.SetResourceGain(m_fResourceGain,
false);
152 representedContainer.SetResourceGainTickrate(m_fResourceGainTickrate);
153 representedContainer.SetResourceGainTimeout(m_fResourceGainTimeout);