10 class SCR_PrefabsSpawnerManagerClass : GenericEntityClass
17 [
Attribute(
"", UIWidgets.Object,
"Prefabs spawners, each for different type of SpawnPoints")]
18 protected ref array<ref SCR_PrefabsSpawner> m_aPrefabsSpawners;
21 protected static ref map<EPrefabSpawnType, ref array<SCR_PrefabSpawnPoint>> s_aPrefabSpawnPoints =
new map<EPrefabSpawnType, ref array<SCR_PrefabSpawnPoint>>();
28 if (
GetGame().GetWorldEntity() && s_aPrefabSpawnPoints)
30 array<SCR_PrefabSpawnPoint> spawnPoints = s_aPrefabSpawnPoints[prefabSpawnPoint.GetType()];
35 s_aPrefabSpawnPoints.Insert(prefabSpawnPoint.GetType(), spawnPoints);
38 spawnPoints.Insert(prefabSpawnPoint);
47 if (
GetGame().GetWorldEntity() && s_aPrefabSpawnPoints)
49 array<SCR_PrefabSpawnPoint> spawnPoints = s_aPrefabSpawnPoints[prefabSpawnPoint.GetType()];
51 spawnPoints.RemoveItem(prefabSpawnPoint);
59 override void EOnFrame(IEntity owner,
float timeSlice)
61 if (!
GetGame().GetWorldEntity() || RplSession.Mode() == RplMode.Client)
63 ClearEventMask(EntityEvent.FRAME);
69 prefabsSpawner.Spawn(s_aPrefabSpawnPoints[prefabsSpawner.GetType()]);
72 ClearEventMask(EntityEvent.FRAME);
81 SetEventMask(EntityEvent.FRAME);
88 s_aPrefabSpawnPoints =
new map<EPrefabSpawnType, ref array<SCR_PrefabSpawnPoint>>();