Repair unity packet
This commit is contained in:
@@ -2,6 +2,7 @@ using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using PrimeTween;
|
||||
using System.Threading.Tasks;
|
||||
using DG.Tweening;
|
||||
|
||||
namespace Hallucinate.UI
|
||||
{
|
||||
@@ -50,7 +51,7 @@ namespace Hallucinate.UI
|
||||
|
||||
public virtual void Update() { }
|
||||
|
||||
public virtual async Task PlayTransitionIn()
|
||||
/*public virtual async Task PlayTransitionIn()
|
||||
{
|
||||
if (root == null) return;
|
||||
|
||||
@@ -70,6 +71,6 @@ namespace Hallucinate.UI
|
||||
onValueChange: val => root.style.translate = new StyleTranslate(new Translate(Length.Percent(val), 0)));
|
||||
|
||||
Hide();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using PrimeTween;
|
||||
using System.Threading.Tasks;
|
||||
using DG.Tweening;
|
||||
|
||||
namespace Hallucinate.UI
|
||||
{
|
||||
@@ -73,25 +74,25 @@ namespace Hallucinate.UI
|
||||
public void WakeUpHUD()
|
||||
{
|
||||
_lastActionTime = Time.time;
|
||||
if (_isFaded)
|
||||
/*if (_isFaded)
|
||||
{
|
||||
_isFaded = false;
|
||||
Tween.Custom(_topLeft.style.opacity.value, 1f, duration: 0.3f, onValueChange: val => _topLeft.style.opacity = val);
|
||||
Tween.Custom(_bottomLeft.style.opacity.value, 1f, duration: 0.3f, onValueChange: val => _bottomLeft.style.opacity = val);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
if (!_isFaded && Time.time - _lastActionTime > FADE_TIMEOUT)
|
||||
/*if (!_isFaded && Time.time - _lastActionTime > FADE_TIMEOUT)
|
||||
{
|
||||
_isFaded = true;
|
||||
Tween.Custom(_topLeft.style.opacity.value, 0.2f, duration: 1.0f, onValueChange: val => _topLeft.style.opacity = val);
|
||||
Tween.Custom(_bottomLeft.style.opacity.value, 0.2f, duration: 1.0f, onValueChange: val => _bottomLeft.style.opacity = val);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public override Task PlayTransitionIn()
|
||||
/*public override Task PlayTransitionIn()
|
||||
{
|
||||
Show();
|
||||
_topLeft.style.opacity = 1;
|
||||
@@ -103,6 +104,6 @@ namespace Hallucinate.UI
|
||||
{
|
||||
Hide();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Hallucinate.UI
|
||||
|
||||
root.Q<Button>("GoToCreateBtn").clicked += ShowCreate;
|
||||
root.Q<Button>("CancelCreateBtn").clicked += ShowJoin;
|
||||
root.Q<Button>("BackToMenuBtn").clicked += async () => { if (_isBusy) return; await uiManager.Pop(); };
|
||||
/*root.Q<Button>("BackToMenuBtn").clicked += async () => { if (_isBusy) return; await uiManager.Pop(); };*/
|
||||
_confirmCreateBtn = root.Q<Button>("ConfirmCreateBtn");
|
||||
if (_confirmCreateBtn != null) _confirmCreateBtn.clicked += OnCreateRoomClicked;
|
||||
root.Q<Button>("ConfirmJoinBtn").clicked += OnConfirmPasswordClicked;
|
||||
@@ -142,12 +142,12 @@ namespace Hallucinate.UI
|
||||
private string GetT(string key) => LocalizationManager.Instance != null ? LocalizationManager.Instance.GetLocalizedString(key) : key;
|
||||
public void SetRoomTemplate(VisualTreeAsset template) => _roomItemTemplate = template;
|
||||
|
||||
public override async Task PlayTransitionIn()
|
||||
/*public override async Task PlayTransitionIn()
|
||||
{
|
||||
_isBusy = false;
|
||||
await base.PlayTransitionIn();
|
||||
ShowJoin();
|
||||
}
|
||||
}*/
|
||||
|
||||
public void ShowJoin()
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using PrimeTween;
|
||||
using System.Threading.Tasks;
|
||||
using DG.Tweening;
|
||||
|
||||
namespace Hallucinate.UI
|
||||
{
|
||||
@@ -19,8 +20,10 @@ namespace Hallucinate.UI
|
||||
_errorLabel = root.Q<Label>("ErrorMsg");
|
||||
_confirmBtn = root.Q<Button>("ConfirmBtn");
|
||||
|
||||
/*
|
||||
if (_confirmBtn != null)
|
||||
_confirmBtn.clicked += OnConfirmClicked;
|
||||
*/
|
||||
|
||||
// Đăng ký Localization
|
||||
if (LocalizationManager.Instance != null)
|
||||
@@ -45,7 +48,7 @@ namespace Hallucinate.UI
|
||||
|
||||
}
|
||||
|
||||
private async void OnConfirmClicked()
|
||||
/*private async void OnConfirmClicked()
|
||||
{
|
||||
string username = _nameInput.value.Trim();
|
||||
|
||||
@@ -89,16 +92,16 @@ namespace Hallucinate.UI
|
||||
_confirmBtn.text = "CONFIRM";
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
private void ShowError(string msg)
|
||||
/*private void ShowError(string msg)
|
||||
{
|
||||
if (_errorLabel == null) return;
|
||||
_errorLabel.text = msg;
|
||||
_errorLabel.style.display = DisplayStyle.Flex;
|
||||
}
|
||||
}*/
|
||||
|
||||
public override async Task PlayTransitionIn()
|
||||
/*public override async Task PlayTransitionIn()
|
||||
{
|
||||
// Login hiện ra như một overlay trung tâm
|
||||
if (root != null)
|
||||
@@ -108,6 +111,6 @@ namespace Hallucinate.UI
|
||||
}
|
||||
Show();
|
||||
await Tween.Custom(0f, 1f, duration: 0.5f, onValueChange: val => root.style.opacity = val);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using PrimeTween;
|
||||
using System.Threading.Tasks;
|
||||
using DG.Tweening;
|
||||
|
||||
namespace Hallucinate.UI
|
||||
{
|
||||
@@ -41,15 +42,15 @@ namespace Hallucinate.UI
|
||||
// Lắng nghe sự kiện thay đổi kích thước toàn màn hình
|
||||
root.RegisterCallback<GeometryChangedEvent>(OnScreenResize);
|
||||
|
||||
_logo.RegisterCallback<ClickEvent>(OnLogoClicked);
|
||||
/*_logo.RegisterCallback<ClickEvent>(OnLogoClicked);*/
|
||||
|
||||
var settingsBtn = root.Q<Button>("SettingsBtn");
|
||||
if (settingsBtn != null) settingsBtn.clicked += () => { if (_isBusy) return; uiManager.ToggleSettings(); };
|
||||
/*if (settingsBtn != null) settingsBtn.clicked += () => { if (_isBusy) return; uiManager.ToggleSettings(); };
|
||||
|
||||
root.Q<Button>("JoinBtn").clicked += async () => { if (_isBusy) return; _isBusy = true; await uiManager.Push<LobbyController>(); };
|
||||
root.Q<Button>("CreateBtn").clicked += async () => { if (_isBusy) return; _isBusy = true; await uiManager.Push<LobbyController>(); };
|
||||
root.Q<Button>("ProfileBtn").clicked += async () => { if (_isBusy) return; _isBusy = true; await uiManager.Push<ProfileController>(); };
|
||||
root.Q<Button>("ExitBtn").clicked += () => Application.Quit();
|
||||
root.Q<Button>("ExitBtn").clicked += () => Application.Quit();*/
|
||||
|
||||
// Đăng ký Localization
|
||||
if (LocalizationManager.Instance != null)
|
||||
@@ -130,19 +131,19 @@ namespace Hallucinate.UI
|
||||
|
||||
StartRotation();
|
||||
}
|
||||
|
||||
|
||||
private void StartRotation()
|
||||
{
|
||||
if (_currentIcon == null) return;
|
||||
/*if (_currentIcon == null) return;
|
||||
if (_rotationTween.isAlive) _rotationTween.Stop();
|
||||
|
||||
_rotationTween = Tween.Custom(0f, 360f, duration: 4f,
|
||||
onValueChange: val => _logo.style.rotate = new StyleRotate(new Rotate(Angle.Degrees(val))),
|
||||
cycles: -1,
|
||||
ease: Ease.Linear);
|
||||
ease: Ease.Linear);*/
|
||||
}
|
||||
|
||||
public override async Task PlayTransitionIn()
|
||||
/*public override async Task PlayTransitionIn()
|
||||
{
|
||||
_isBusy = false;
|
||||
_lastInteractionTime = Time.time;
|
||||
@@ -164,11 +165,11 @@ namespace Hallucinate.UI
|
||||
|
||||
public override async Task PlayTransitionOut()
|
||||
{
|
||||
if (_rotationTween.isAlive) _rotationTween.Stop();
|
||||
await base.PlayTransitionOut();
|
||||
}
|
||||
/*if (_rotationTween.isAlive) _rotationTween.Stop();
|
||||
await base.PlayTransitionOut();#1#
|
||||
}*/
|
||||
|
||||
private async void OnLogoClicked(ClickEvent evt)
|
||||
/*private async void OnLogoClicked(ClickEvent evt)
|
||||
{
|
||||
if (_isBusy) return;
|
||||
_lastInteractionTime = Time.time;
|
||||
@@ -178,7 +179,7 @@ namespace Hallucinate.UI
|
||||
_isBusy = true;
|
||||
await uiManager.Push<LobbyController>();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
private void TransitionToRibbon()
|
||||
{
|
||||
@@ -187,7 +188,9 @@ namespace Hallucinate.UI
|
||||
_lastInteractionTime = Time.time;
|
||||
|
||||
_ribbon.style.display = DisplayStyle.Flex;
|
||||
/*
|
||||
Tween.Custom(0f, 1f, duration: 0.3f, onValueChange: val => _ribbon.style.opacity = val);
|
||||
*/
|
||||
|
||||
// Đợi một frame để Ribbon layout xong rồi mới lấy vị trí LogoSpace
|
||||
_logoSpace.RegisterCallback<GeometryChangedEvent>(OnLogoSpaceReady);
|
||||
@@ -215,7 +218,7 @@ namespace Hallucinate.UI
|
||||
|
||||
if (animate)
|
||||
{
|
||||
Tween.Custom(_logo.resolvedStyle.left, targetX, duration: 0.5f,
|
||||
/*Tween.Custom(_logo.resolvedStyle.left, targetX, duration: 0.5f,
|
||||
onValueChange: val => _logo.style.left = val,
|
||||
ease: Ease.OutQuad);
|
||||
|
||||
@@ -229,7 +232,7 @@ namespace Hallucinate.UI
|
||||
|
||||
Tween.Custom(_logo.resolvedStyle.height, 100f, duration: 0.5f,
|
||||
onValueChange: val => _logo.style.height = val,
|
||||
ease: Ease.OutQuad);
|
||||
ease: Ease.OutQuad);*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -248,7 +251,7 @@ namespace Hallucinate.UI
|
||||
_currentState = MenuState.Idle;
|
||||
|
||||
// Quay lại dùng phần trăm để tự động căn giữa
|
||||
Tween.Custom(_logo.resolvedStyle.width, 200f, duration: 0.5f, onValueChange: val => _logo.style.width = val, ease: Ease.OutQuad);
|
||||
/*Tween.Custom(_logo.resolvedStyle.width, 200f, duration: 0.5f, onValueChange: val => _logo.style.width = val, ease: Ease.OutQuad);
|
||||
Tween.Custom(_logo.resolvedStyle.height, 200f, duration: 0.5f, onValueChange: val => _logo.style.height = val, ease: Ease.OutQuad);
|
||||
|
||||
// Animate left/top về 50%
|
||||
@@ -265,7 +268,7 @@ namespace Hallucinate.UI
|
||||
});
|
||||
|
||||
Tween.Custom(1f, 0f, duration: 0.5f, onValueChange: val => _ribbon.style.opacity = val)
|
||||
.OnComplete(() => _ribbon.style.display = DisplayStyle.None);
|
||||
.OnComplete(() => _ribbon.style.display = DisplayStyle.None);*/
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
@@ -283,12 +286,12 @@ namespace Hallucinate.UI
|
||||
|
||||
private void StartPulse()
|
||||
{
|
||||
if (_pulseTween.isAlive) _pulseTween.Stop();
|
||||
/*if (_pulseTween.isAlive) _pulseTween.Stop();
|
||||
_pulseTween = Tween.Custom(Vector3.one, Vector3.one * 1.1f, duration: 0.8f,
|
||||
onValueChange: val => _logo.style.scale = new StyleScale(new Scale(val)),
|
||||
cycles: -1,
|
||||
cycleMode: CycleMode.Yoyo,
|
||||
ease: Ease.InOutSine);
|
||||
ease: Ease.InOutSine);*/
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Hallucinate.UI
|
||||
_resumeBtn = root.Q<Button>("ResumeBtn");
|
||||
_quitBtn = root.Q<Button>("QuitBtn");
|
||||
|
||||
if (_resumeBtn != null) _resumeBtn.clicked += OnResumeClicked;
|
||||
/*if (_resumeBtn != null) _resumeBtn.clicked += OnResumeClicked;*/
|
||||
if (_quitBtn != null) _quitBtn.clicked += OnQuitClicked;
|
||||
|
||||
ApplyLocalization();
|
||||
@@ -40,37 +40,37 @@ namespace Hallucinate.UI
|
||||
if (title != null) title.text = GetLoc("PAUSE_TITLE");
|
||||
}
|
||||
|
||||
private void OnResumeClicked()
|
||||
/*private void OnResumeClicked()
|
||||
{
|
||||
uiManager.TogglePauseMenu();
|
||||
}
|
||||
}*/
|
||||
|
||||
private void OnQuitClicked()
|
||||
{
|
||||
Debug.Log("[PauseMenu] Quit clicked - shutting down runner.");
|
||||
if (BasicSpawner.Instance != null && BasicSpawner.Instance.Runner != null)
|
||||
/*if (BasicSpawner.Instance != null && BasicSpawner.Instance.Runner != null)
|
||||
{
|
||||
BasicSpawner.Instance.Runner.Shutdown();
|
||||
}
|
||||
else
|
||||
{
|
||||
uiManager.OnBackToMenu();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public override async Task PlayTransitionIn()
|
||||
/*public override async Task PlayTransitionIn()
|
||||
{
|
||||
Show();
|
||||
/*Show();
|
||||
root.style.opacity = 0;
|
||||
await PrimeTween.Tween.Custom(0f, 1f, duration: 0.2f, onValueChange: val => root.style.opacity = val);
|
||||
await Task.Delay(200);
|
||||
await Task.Delay(200);#1#
|
||||
}
|
||||
|
||||
public override async Task PlayTransitionOut()
|
||||
{
|
||||
await PrimeTween.Tween.Custom(1f, 0f, duration: 0.2f, onValueChange: val => root.style.opacity = val);
|
||||
/*await PrimeTween.Tween.Custom(1f, 0f, duration: 0.2f, onValueChange: val => root.style.opacity = val);
|
||||
await Task.Delay(200);
|
||||
Hide();
|
||||
}
|
||||
Hide();#1#
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,12 +26,12 @@ namespace Hallucinate.UI
|
||||
_winRateText = root.Q<Label>("WinRateText");
|
||||
_logoutBtn = root.Q<Button>("LogoutBtn");
|
||||
|
||||
root.Q<Button>("BackBtn").clicked += async () => await uiManager.Pop();
|
||||
/*root.Q<Button>("BackBtn").clicked += async () => await uiManager.Pop();*/
|
||||
|
||||
if (_logoutBtn != null)
|
||||
/*if (_logoutBtn != null)
|
||||
{
|
||||
_logoutBtn.clicked += Logout;
|
||||
}
|
||||
}*/
|
||||
|
||||
if (LocalizationManager.Instance != null)
|
||||
{
|
||||
@@ -65,11 +65,11 @@ namespace Hallucinate.UI
|
||||
if (_logoutBtn != null) _logoutBtn.text = LocalizationManager.Instance.GetLocalizedString("PROFILE_LOGOUT");
|
||||
}
|
||||
|
||||
public override async Task PlayTransitionIn()
|
||||
/*public override async Task PlayTransitionIn()
|
||||
{
|
||||
LoadProfileData(); // Refresh data every time we show the profile
|
||||
await base.PlayTransitionIn();
|
||||
}
|
||||
}*/
|
||||
|
||||
private void LoadProfileData()
|
||||
{
|
||||
@@ -87,7 +87,7 @@ namespace Hallucinate.UI
|
||||
_winRateText.text = "72%";
|
||||
}
|
||||
|
||||
private async void Logout()
|
||||
/*private async void Logout()
|
||||
{
|
||||
// Clear local save data
|
||||
PlayerPrefs.DeleteKey("Username");
|
||||
@@ -106,7 +106,7 @@ namespace Hallucinate.UI
|
||||
|
||||
// Redirect to Login Screen
|
||||
await uiManager.Push<LoginController>();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using DG.Tweening;
|
||||
using OnlyScove.Scripts;
|
||||
using Hallucinate.Audio;
|
||||
using PrimeTween;
|
||||
@@ -51,7 +52,7 @@ namespace Hallucinate.UI
|
||||
private float _masterVol = 80f;
|
||||
private int _overlayActiveCount = 0;
|
||||
|
||||
public override void Initialize(VisualElement uxmlRoot, UIManager manager)
|
||||
/*public override void Initialize(VisualElement uxmlRoot, UIManager manager)
|
||||
{
|
||||
base.Initialize(uxmlRoot, manager);
|
||||
|
||||
@@ -96,7 +97,7 @@ namespace Hallucinate.UI
|
||||
// Render ban đầu
|
||||
RefreshUI();
|
||||
ApplyVideoSettings();
|
||||
}
|
||||
}*/
|
||||
|
||||
private void OnLanguageChanged()
|
||||
{
|
||||
@@ -127,31 +128,31 @@ namespace Hallucinate.UI
|
||||
|
||||
private void OnSidebarPointerEnter(PointerEnterEvent evt)
|
||||
{
|
||||
_hoverTimer.Stop();
|
||||
ExpandSidebar();
|
||||
/*_hoverTimer.Stop();
|
||||
ExpandSidebar();*/
|
||||
}
|
||||
|
||||
private void OnSidebarPointerLeave(PointerLeaveEvent evt)
|
||||
{
|
||||
_hoverTimer.Stop();
|
||||
CollapseSidebar();
|
||||
/*_hoverTimer.Stop();
|
||||
CollapseSidebar();*/
|
||||
}
|
||||
|
||||
private void ExpandSidebar()
|
||||
/*private void ExpandSidebar()
|
||||
{
|
||||
if (_isExpanded) return;
|
||||
_isExpanded = true;
|
||||
_tabsColumn.AddToClassList("sidebar-expanded");
|
||||
Tween.Custom(_tabsColumn.resolvedStyle.width, 240f, duration: 0.5f, ease: Ease.OutQuart, onValueChange: val => _tabsColumn.style.width = val);
|
||||
}
|
||||
}*/
|
||||
|
||||
private void CollapseSidebar()
|
||||
/*rivate void CollapseSidebar()
|
||||
{
|
||||
if (!_isExpanded) return;
|
||||
_isExpanded = false;
|
||||
_tabsColumn.RemoveFromClassList("sidebar-expanded");
|
||||
Tween.Custom(_tabsColumn.resolvedStyle.width, 80f, duration: 0.45f, ease: Ease.OutQuart, onValueChange: val => _tabsColumn.style.width = val);
|
||||
}
|
||||
}*/
|
||||
|
||||
private void RenderAllSettings()
|
||||
{
|
||||
@@ -186,9 +187,9 @@ namespace Hallucinate.UI
|
||||
HighlightTab(tabId);
|
||||
|
||||
float targetY = header.layout.y;
|
||||
Tween.Custom(_content.scrollOffset.y, targetY, duration: 0.5f, ease: Ease.OutQuart, onValueChange: val => {
|
||||
/*Tween.Custom(_content.scrollOffset.y, targetY, duration: 0.5f, ease: Ease.OutQuart, onValueChange: val => {
|
||||
_content.scrollOffset = new Vector2(0, val);
|
||||
}).OnComplete(() => _isManualScrolling = false);
|
||||
}).OnComplete(() => _isManualScrolling = false);*/
|
||||
}
|
||||
|
||||
private void OnScrollValueChanged(float val)
|
||||
@@ -497,11 +498,11 @@ namespace Hallucinate.UI
|
||||
_masterVolLabel.text = $"{Mathf.RoundToInt(_masterVol)}%";
|
||||
int currentId = _overlayActiveCount;
|
||||
await Task.Delay(3000);
|
||||
if (currentId == _overlayActiveCount && _hoveredSubVolume == null)
|
||||
/*if (currentId == _overlayActiveCount && _hoveredSubVolume == null)
|
||||
{
|
||||
Tween.Custom(1f, 0f, duration: 0.5f, onValueChange: val => _volumeContainer.style.opacity = val)
|
||||
.OnComplete(() => { if (_volumeContainer.style.opacity == 0f) _volumeContainer.style.display = DisplayStyle.None; });
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
private VisualElement CreateSection(string title)
|
||||
@@ -585,7 +586,7 @@ namespace Hallucinate.UI
|
||||
}
|
||||
}
|
||||
|
||||
public override async Task PlayTransitionIn()
|
||||
/*public override async Task PlayTransitionIn()
|
||||
{
|
||||
root.style.display = DisplayStyle.Flex;
|
||||
_sidebar.style.translate = new StyleTranslate(new Translate(Length.Percent(-100), 0));
|
||||
@@ -596,7 +597,7 @@ namespace Hallucinate.UI
|
||||
{
|
||||
await Tween.Custom(0f, -100f, duration: 0.3f, ease: Ease.InQuad, onValueChange: val => _sidebar.style.translate = new StyleTranslate(new Translate(Length.Percent(val), 0)));
|
||||
Hide();
|
||||
}
|
||||
}*/
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using PrimeTween;
|
||||
@@ -138,7 +139,7 @@ namespace Hallucinate.UI
|
||||
}
|
||||
}
|
||||
|
||||
public void OnGameStarted()
|
||||
/*public void OnGameStarted()
|
||||
{
|
||||
_ = Push<HUDController>();
|
||||
}
|
||||
@@ -146,7 +147,7 @@ namespace Hallucinate.UI
|
||||
public void OnBackToMenu()
|
||||
{
|
||||
_ = Push<MainMenuController>();
|
||||
}
|
||||
}*/
|
||||
|
||||
public void SetUIScale(float scale)
|
||||
{
|
||||
@@ -201,14 +202,15 @@ namespace Hallucinate.UI
|
||||
|
||||
_rootElement.RegisterCallback<PointerDownEvent>(OnGlobalClick, TrickleDown.TrickleDown);
|
||||
|
||||
if (inputReader != null)
|
||||
/*if (inputReader != null)
|
||||
{
|
||||
inputReader.OnToggleSettingsEvent += ToggleSettings;
|
||||
inputReader.OnCancelEvent += HandleCancel;
|
||||
}
|
||||
*/
|
||||
|
||||
InitializeControllers();
|
||||
CheckLoginStatus();
|
||||
/*CheckLoginStatus();*/
|
||||
}
|
||||
|
||||
private void InitializeTrailPool()
|
||||
@@ -229,7 +231,7 @@ namespace Hallucinate.UI
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckLoginStatus()
|
||||
/*private void CheckLoginStatus()
|
||||
{
|
||||
string savedName = PlayerPrefs.GetString("Username", "");
|
||||
if (string.IsNullOrEmpty(savedName)) _ = Push<LoginController>();
|
||||
@@ -245,18 +247,18 @@ namespace Hallucinate.UI
|
||||
inputReader.OnToggleSettingsEvent -= ToggleSettings;
|
||||
inputReader.OnCancelEvent -= HandleCancel;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
private void HandleCancel()
|
||||
/*private void HandleCancel()
|
||||
{
|
||||
if (_isSettingsOpen) ToggleSettings();
|
||||
else if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "Main Scene")
|
||||
{
|
||||
TogglePauseMenu();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
public async void TogglePauseMenu()
|
||||
/*public async void TogglePauseMenu()
|
||||
{
|
||||
if (_pauseMenuController == null) return;
|
||||
if (!_isPauseMenuOpen)
|
||||
@@ -283,9 +285,9 @@ namespace Hallucinate.UI
|
||||
|
||||
await _pauseMenuController.PlayTransitionOut();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
public async void ToggleSettings()
|
||||
/*public async void ToggleSettings()
|
||||
{
|
||||
if (_settingsController == null) return;
|
||||
if (!_isSettingsOpen)
|
||||
@@ -293,14 +295,15 @@ namespace Hallucinate.UI
|
||||
_isSettingsOpen = true;
|
||||
_settingsController.Root.BringToFront();
|
||||
if (_cursorLayer != null) _cursorLayer.BringToFront();
|
||||
await _settingsController.PlayTransitionIn();
|
||||
await /*_settingsController.PlayTransitionIn();#1#
|
||||
}
|
||||
else
|
||||
{
|
||||
_isSettingsOpen = false;
|
||||
await _settingsController.PlayTransitionOut();
|
||||
await /*_settingsController.PlayTransitionOut();#1#
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
private void Update()
|
||||
{
|
||||
@@ -340,7 +343,7 @@ namespace Hallucinate.UI
|
||||
var particle = _trailPool[_currentTrailIndex];
|
||||
_currentTrailIndex = (_currentTrailIndex + 1) % MAX_TRAIL_PARTICLES;
|
||||
|
||||
Tween.StopAll(particle);
|
||||
/*Tween.StopAll(particle);*/
|
||||
particle.style.display = DisplayStyle.Flex;
|
||||
particle.style.left = pos.x;
|
||||
particle.style.top = pos.y;
|
||||
@@ -374,8 +377,8 @@ namespace Hallucinate.UI
|
||||
|
||||
_cursorLayer.Add(ripple);
|
||||
|
||||
Tween.Custom(Vector3.one, Vector3.one * 2.5f, duration: 0.4f, onValueChange: val => ripple.style.scale = new StyleScale(new Scale(val)), ease: Ease.OutQuad);
|
||||
Tween.Custom(1f, 0f, duration: 0.4f, onValueChange: val => ripple.style.opacity = val).OnComplete(() => ripple.RemoveFromHierarchy());
|
||||
/*Tween.Custom(Vector3.one, Vector3.one * 2.5f, duration: 0.4f, onValueChange: val => ripple.style.scale = new StyleScale(new Scale(val)), ease: Ease.OutQuad);
|
||||
Tween.Custom(1f, 0f, duration: 0.4f, onValueChange: val => ripple.style.opacity = val).OnComplete(() => ripple.RemoveFromHierarchy());*/
|
||||
}
|
||||
|
||||
private void InitializeControllers()
|
||||
@@ -411,7 +414,7 @@ namespace Hallucinate.UI
|
||||
return controller;
|
||||
}
|
||||
|
||||
public async Task Push<T>() where T : BaseUIController
|
||||
/*public async Task Push<T>() where T : BaseUIController
|
||||
{
|
||||
if (!_controllers.TryGetValue(typeof(T), out var newScreen)) return;
|
||||
if (_history.Count > 0 && _history.Peek() == newScreen) return;
|
||||
@@ -427,6 +430,6 @@ namespace Hallucinate.UI
|
||||
await _history.Pop().PlayTransitionOut();
|
||||
if (_history.Count > 0) await _history.Peek().PlayTransitionIn();
|
||||
if (_cursorLayer != null) _cursorLayer.BringToFront();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user