You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
856 B
35 lines
856 B
|
3 months ago
|
using Godot;
|
||
|
|
using Godot.Collections;
|
||
|
|
|
||
|
|
namespace Babushka.scripts.CSharp.Low_Code.Events;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Raises one or more <see cref="EventResource"/>s from the scene.
|
||
|
|
/// </summary>
|
||
|
|
public partial class EventRaiser : Node
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// The <see cref="EventResource"/>s to call
|
||
|
|
/// </summary>
|
||
|
|
[Export] Array<EventResource> _eventResources;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Raises all <see cref="EventResource"/>s present in <see cref="_eventResources"/>.
|
||
|
|
/// </summary>
|
||
|
|
public void RaiseEvents()
|
||
|
|
{
|
||
|
|
foreach (var eventRes in _eventResources)
|
||
|
|
{
|
||
|
|
eventRes.Raise();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Raises <see cref="EventResource"/> at index.
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="index"></param>
|
||
|
|
public void RaiseEvent(int index)
|
||
|
|
{
|
||
|
|
_eventResources[index].Raise();
|
||
|
|
}
|
||
|
|
}
|