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

@@ -29,7 +29,9 @@
"GUID:045a42f233e479d41adc32d02b99631e",
"GUID:1235ca61e7f433b408ed5a68767e7123",
"GUID:c0b9c98c59e49554c8f4ca6dc4998d79",
"GUID:48ef04d98836e2640bf90b524bdff904"
"GUID:48ef04d98836e2640bf90b524bdff904",
"GUID:c56f2ae4d67b9b947a600c84225206a2",
"GUID:6c8d6bab65f07444c83f82808ee54271"
],
"includePlatforms": [],
"excludePlatforms": [],

View File

@@ -10,7 +10,6 @@ using BITKit;
using BITKit.UX;
using BITKit.Entities;
using BITKit.Entities.Player;
using UnityEngine.AddressableAssets;
namespace BITFALL.UX
{

View File

@@ -14,12 +14,15 @@ namespace BITFALL.UX
public class UXLoading : UIToolKitPanel
{
[Header(Constant.Header.Providers)]
[SerializeReference,SubclassSelector] private ISceneService sceneService;
[SerializeReference, SubclassSelector]
private INetProvider netProvider;
[SerializeReference, SubclassSelector] private ISceneService sceneService;
[SerializeReference, SubclassSelector] private INetProvider netProvider;
[Header(Constant.Header.Components)]
public UXBar loadBar;
public UXLabel loadText;
[SerializeField] private UXBar loadBar;
[SerializeField] private UXLabel loadText;
[SerializeField] private UXLabel mapLabel;
[SerializeField] private UXElement blackScreen;
protected override VisualElement background => null;
protected override void Awake()
{
base.Awake();
@@ -29,6 +32,7 @@ namespace BITFALL.UX
private void Load(string obj)
{
mapLabel.Set(obj);
loadBar.SetDirect(0,$"正在开始加载:{obj}");
Entry();
}
@@ -38,5 +42,11 @@ namespace BITFALL.UX
loadBar.Set(f);
loadText.Set(s);
}
public override void OnUpdate(float deltaTime)
{
base.OnUpdate(deltaTime);
blackScreen.GetVisualElement().SetOpacity(
TargetOpacity is 0 ? 1-CurrentOpacity : 0);
}
}
}

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()
{