9 [
Attribute(
params:
"et", uiwidget: UIWidgets.ResourcePickerThumbnail,
desc:
"Spawned entity")]
10 private ResourceName m_Prefab;
12 [
Attribute(
desc:
"Spawn the entity only when no entities are passed to the event.")]
13 protected bool m_bNoEntities;
15 [
Attribute(
desc:
"True to delete previous entity created by this effect when a new one is being created.")]
16 protected bool m_bReplacePrevious;
18 protected IEntity m_Entity;
31 if (
position == vector.Zero)
return false;
33 if (m_bNoEntities && entities && !entities.IsEmpty())
return false;
35 Resource resource = Resource.Load(
m_Prefab);
36 if (!resource || !resource.IsValid())
38 Print(
string.Format(
"Invalid prefab '%1'!",
m_Prefab), LogLevel.WARNING);
45 Print(
string.Format(
"Prefab '%1' is not an entity!",
m_Prefab), LogLevel.WARNING);
49 EntitySpawnParams spawnParams =
new EntitySpawnParams;
54 entitySource.Get(
"scale", scale);
57 spawnParams.Transform[0] = spawnParams.Transform[0] * scale;
58 spawnParams.Transform[1] = spawnParams.Transform[1] * scale;
59 spawnParams.Transform[2] = spawnParams.Transform[2] * scale;
62 if (m_bReplacePrevious)