Add CloseDoorActionResource and update LogicSequenceComponentResource for activation and deactivation actions
This commit is contained in:
@@ -167,12 +167,21 @@ public class ComponentFactory
|
||||
IsOneTimeTrigger = resource.IsOneTimeTrigger,
|
||||
};
|
||||
|
||||
foreach (var actionResource in resource.OnCompleteActions)
|
||||
foreach (var actionResource in resource.OnActivateActions)
|
||||
{
|
||||
var action = _triggerActionFactory.Create(actionResource);
|
||||
if (action != null)
|
||||
{
|
||||
component.OnCompleteActions.Add(action);
|
||||
component.OnActivateActions.Add(action);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var actionResource in resource.OnDeactivateActions)
|
||||
{
|
||||
var action = _triggerActionFactory.Create(actionResource);
|
||||
if (action != null)
|
||||
{
|
||||
component.OnDeactivateActions.Add(action);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ public class TriggerActionFactory
|
||||
SpawnEntityActionResource spawn => new SpawnEntityAction(spawn.ArchetypeId, spawn.SpawnerWorldId),
|
||||
DebugMessageActionResource debug => new DebugMessageAction(debug.Message),
|
||||
OpenDoorActionResource open => new OpenDoorAction(open.TargetWorldId),
|
||||
CloseDoorActionResource close => new CloseDoorAction(close.TargetWorldId),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(resource),
|
||||
$"TriggerAction type {resource.GetType().Name} not recognized")
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user