Repair unity packet
This commit is contained in:
@@ -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