riversong code showcase

This commit is contained in:
Daniele Marotta
2026-05-21 15:52:18 +02:00
commit 4c9eea1c02
462 changed files with 23406 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
using System;
using Cysharp.Threading.Tasks;
using UnityEngine;
namespace DanieleMarotta.RiversongCodeShowcase
{
public class DemoPanelUIController : UIControllerSystem<DemoPanelUIView>, IDisposable
{
[InjectService]
private ISignalBus _signalBus;
[InjectService]
private World _world;
public DemoPanelUIController(IServiceLocator serviceLocator) : base(serviceLocator)
{
}
protected override DemoPanelUIView View => UIRoot.GetView<DemoPanelUIView>();
public override async UniTask InitializeAsync()
{
await base.InitializeAsync();
View.FeedbackButtonClick += OnFeedbackButtonClick;
_signalBus.Subscribe<DemoCompletedSignal>(OnDemoCompleted);
}
public void Dispose()
{
View.FeedbackButtonClick -= OnFeedbackButtonClick;
_signalBus.Unsubscribe<DemoCompletedSignal>(OnDemoCompleted);
}
private void OnDemoCompleted(DemoCompletedSignal signal)
{
View.OnDemoCompleted(_world.PopulationState.Population, signal.GameTime);
}
private void OnFeedbackButtonClick()
{
Application.OpenURL(AppLinks.DemoFeedbackUrl);
}
}
}