📝 added documentation and improved event scope
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user