12 bool shouldIncrementOffset;
13 SCR_ResourceContainerStorageQueue<SCR_ResourceEncapsulator> storageQueue;
17 foreach (SCR_ResourceStoragePolicyBase<SCR_ResourceEncapsulator> policy: m_StoragePolicies)
19 storageQueue = policy.GetStorageQueue();
21 if (shouldIncrementOffset)
23 storageQueue.IncrementOffset(1);
27 if (!policy.IsStorageTypeValid(storageType))
30 array<ref SCR_ResourceEncapsulatorActionBase> actions = m_Interactor.GetActions();
38 action.PerformAction(containerRepresentative, container);
42 m_fAggregatedResourceValue += container.GetResourceValue();;
43 m_fAggregatedMaxResourceValue += container.GetMaxResourceValue();
45 shouldIncrementOffset =
true;
46 position = storageQueue.RegisterContainer(container, m_Interactor);
53 override void DebugDraw()
61 Color color1 = Color.FromInt(m_Interactor.GetDebugColor().PackToInt());
62 Color color2 = Color.FromInt(m_Interactor.GetDebugColor().PackToInt());
66 color2.Lerp(Color.FromInt(Color.WHITE), 0.0);
74 string infoText =
string.Format(
" ENC Pos: %1 Distance: %2 m ", idx, vector.Distance(m_Interactor.GetOwnerOrigin(), container.GetOwnerOrigin()));
75 origin = container.GetOwnerOrigin();
76 consumerIdx = container.GetLinkedInteractorIndex(m_Interactor);
78 if (container.IsResourceGainEnabled())
81 if (container.IsResourceDecayEnabled())
84 heightDiff = container.debugControlOffset * consumerIdx + container.debugControlOffset * 3;
86 Shape.CreateArrow(origin + Vector(0.0, heightDiff, 0.0), origin, 0.0, 0xFFFFFFFF, ShapeFlags.ONCE | ShapeFlags.NOZBUFFER);
88 Shape.CreateArrow(m_Interactor.GetOwnerOrigin(), (origin + Vector(0.0, heightDiff, 0.0)), 0.1, color1.PackToInt(), ShapeFlags.ONCE | ShapeFlags.NOZBUFFER |ShapeFlags.DEPTH_DITHER);
90 DebugTextWorldSpace.Create(m_Interactor.GetOwner().GetWorld(), infoText, DebugTextFlags.CENTER | DebugTextFlags.FACE_CAMERA | DebugTextFlags.ONCE, origin[0], origin[1] + heightDiff, origin[2], 10, color1.PackToInt(), color2.PackToInt(), consumerIdx + 1);
92 if (!container.GetComponent().IsDebugVisualizationEnabled())
93 container.DebugDraw(
false);