This commit is contained in:
CortexCore
2023-11-15 23:54:54 +08:00
parent ee3ecec6cb
commit 3c837a4a33
356 changed files with 73756 additions and 26493 deletions

View File

@@ -1,20 +1,26 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using BITFALL.Game;
using UnityEngine;
using UnityEngine.InputSystem;
using BITKit;
using BITKit.Game;
using BITKit.SceneManagement;
using BITKit.UX;
using INetClient = BITKit.INetClient;
using Cysharp.Threading.Tasks;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.UIElements;
namespace BITFALL.UX
{
public class UXMenu : UIToolKitPanel
{
[Header(Constant.Header.Services)]
[SerializeReference, SubclassSelector] private IReference[] mapTags;
[Header(Constant.Header.Providers)]
[SerializeReference, SubclassSelector] private ISceneService SceneService;
@@ -24,6 +30,11 @@ namespace BITFALL.UX
[SerializeField] private UXButton exitButton;
[SerializeField] private UXButton returnButton;
[SerializeField] private UXImage backgroundImage;
[SerializeField] private UXDropdown mapDropdown;
[Header(Constant.Header.Providers)]
[SerializeReference,SubclassSelector] private IGameService gameService;
[Header(Constant.Header.Input)]
[SerializeField] private InputActionReference returnAction;
[SerializeField] private InputActionReference inventoryAction;
@@ -40,6 +51,13 @@ namespace BITFALL.UX
OnDisconnected();
};
OnDisconnected();
var tags = mapTags.Select(x => x.Value).ToArray();
mapDropdown.visualElement.choices = SceneService.GetScenes(tags).ToList();
mapDropdown.visualElement.RegisterValueChangedCallback(x =>
{
gameService.ExpectMap = x.newValue;
});
}
private void OnConnected()
{