36 lines
808 B
C#
36 lines
808 B
C#
using UnityEngine;
|
|
using Vanguard.Meta;
|
|
using Vanguard.UI;
|
|
|
|
namespace Vanguard.App
|
|
{
|
|
public sealed class BattleSceneController : SceneControllerBase
|
|
{
|
|
private BattleView _view;
|
|
|
|
private void Start()
|
|
{
|
|
SceneEnvironment.Build(SceneTheme.Battle);
|
|
|
|
var info = Flow.ConsumePendingMatch();
|
|
if (info == null)
|
|
{
|
|
_ = Flow.LoadLobbyAsync();
|
|
return;
|
|
}
|
|
|
|
var canvas = CreateCanvas("Battle Canvas");
|
|
_view = new BattleView(
|
|
canvas.transform,
|
|
Resolve<MetaService>(),
|
|
() => _ = Flow.LoadLobbyAsync());
|
|
_view.Show(info);
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
_view?.Tick();
|
|
}
|
|
}
|
|
}
|