GuildTycoon/Assets/_/Features/EventSystem/Runtime/LegacyRecruitementEvents.cs
2025-09-06 23:56:47 +02:00

29 lines
747 B
C#

using System;
using Adventurer.Runtime;
using UnityEngine;
namespace EventSystem.Runtime
{
public class LegacyRecruitementEvents : MonoBehaviour
{
public static event Action<AdventurerClass> OnHeroRecruited;
public static event Action<AdventurerClass> OnSpawnAdventurerModel;
private void OnEnable()
{
AdventurerSignals.OnAdventurerSpawnRequested += RelaySpawn;
}
private void OnDisable()
{
AdventurerSignals.OnAdventurerSpawnRequested -= RelaySpawn;
}
private void RelaySpawn(AdventurerClass adventurer)
{
OnHeroRecruited?.Invoke(adventurer);
OnSpawnAdventurerModel?.Invoke(adventurer);
}
}
}