using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Threading; using BITKit.UX; using Cysharp.Threading.Tasks; using Project.B.Entities; using Project.B.Map; using UnityEngine; using UnityEngine.UIElements; using YooAsset; namespace Net.Like.Xue.Tokyo.UX { public class UXMenu : UIToolKitPanel { private readonly IGameMapService _gameMapService; protected override string DocumentPath => "ux_menu"; public override bool AllowInput => false; public override bool AllowCursor => true; [UXBindPath("play-button")] private Button _playButton; public UXMenu(IUXService uxService, IGameMapService gameMapService) : base(uxService) { _gameMapService = gameMapService; OnInitiated += Initiated; _gameMapService.OnMapChanged += OnMapChanged; } private void OnMapChanged(Guid arg1, string arg2) { if (string.IsNullOrEmpty(arg2)) { UXService.Entry(this); } } private void Initiated() { UXUtils.Inject(this); _playButton.clicked += UXService.Entry; } public override void Dispose() { base.Dispose(); _gameMapService.OnMapChanged -= OnMapChanged; } } }