27 lines
893 B
C#
27 lines
893 B
C#
using Cysharp.Threading.Tasks;
|
|
using IServiceProvider = DanieleMarotta.RiversongCodeShowcase.IServiceProvider;
|
|
|
|
namespace DanieleMarotta.RiversongCodeShowcase
|
|
{
|
|
[GameSystemGroup(typeof(CommonServicesSystemGroup))]
|
|
[InitializeAfter(typeof(CommonServicesSystem))]
|
|
public class AnalyticsInitializationSystem : GameSystem, IServiceProvider, IInitializable
|
|
{
|
|
private IAnalyticsService _analyticsService;
|
|
|
|
public AnalyticsInitializationSystem(IServiceLocator serviceLocator) : base(serviceLocator)
|
|
{
|
|
}
|
|
|
|
public void RegisterServices(IServiceLocator serviceLocator)
|
|
{
|
|
_analyticsService = AnalyticsServiceFactory.Create();
|
|
serviceLocator.RegisterService(_analyticsService);
|
|
}
|
|
|
|
public async UniTask InitializeAsync()
|
|
{
|
|
await _analyticsService.InitializeAsync();
|
|
}
|
|
}
|
|
} |