Update
This commit is contained in:
5
.idea/.idea.HALLUCINATE/.idea/workspace.xml
generated
5
.idea/.idea.HALLUCINATE/.idea/workspace.xml
generated
@@ -6,10 +6,9 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="f9183c68-daf0-43b8-be4c-fad79983f91b" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.HALLUCINATE/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.HALLUCINATE/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/UI/BaseUIController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UI/BaseUIController.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/UI/MainMenuController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UI/MainMenuController.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/UI/SettingsController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UI/SettingsController.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/UI/UIManager.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UI/UIManager.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/UI/MainMenu.uxml" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UI/MainMenu.uxml" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -146,7 +145,7 @@
|
||||
<workItem from="1777150520438" duration="58000" />
|
||||
<workItem from="1777150592854" duration="4699000" />
|
||||
<workItem from="1777181837663" duration="1519000" />
|
||||
<workItem from="1777269364664" duration="27758000" />
|
||||
<workItem from="1777269364664" duration="28868000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
||||
@@ -149,12 +149,17 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: bcb7b8ed439bb4546b0648c627c2ce5d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Hallucinate.UI.UIManager
|
||||
gameIcon: {fileID: 0}
|
||||
cursorTrailSprite: {fileID: 21300000, guid: b9c4a623634019648b505c6122243b00, type: 3}
|
||||
cursorSize: 30
|
||||
trailLength: 15
|
||||
enableRipples: 1
|
||||
rippleColor: {r: 1, g: 1, b: 1, a: 0.5}
|
||||
mainMenuTemplate: {fileID: 9197481963319205126, guid: 8dcbe9fd5e8c43c43921af21a6347624, type: 3}
|
||||
lobbyTemplate: {fileID: 9197481963319205126, guid: 2b2480fff4320714e9b503e7d5ef2c9f, type: 3}
|
||||
profileTemplate: {fileID: 9197481963319205126, guid: e481c7d94f843374cb57e215bf9b0624, type: 3}
|
||||
settingsTemplate: {fileID: 9197481963319205126, guid: 1e24e32e93afac8449d0bb181ab5c6a9, type: 3}
|
||||
hudTemplate: {fileID: 9197481963319205126, guid: b87ba33c06a8c1d46a3d9f03416ebf3f, type: 3}
|
||||
showDebugInfo: 1
|
||||
--- !u!114 &458228300
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -16,9 +16,11 @@ namespace Hallucinate.UI
|
||||
|
||||
private float _lastInteractionTime;
|
||||
private const float IDLE_TIMEOUT = 5.0f;
|
||||
private bool _isFirstLoad = true; // Biến cờ để nhận biết lần đầu vào game
|
||||
|
||||
private Tween _pulseTween;
|
||||
private Tween _rotationTween;
|
||||
private Texture2D _currentIcon;
|
||||
|
||||
public override void Initialize(VisualElement uxmlRoot, UIManager manager)
|
||||
{
|
||||
@@ -34,7 +36,6 @@ namespace Hallucinate.UI
|
||||
return;
|
||||
}
|
||||
|
||||
ResetLogoPosition();
|
||||
_logo.RegisterCallback<ClickEvent>(OnLogoClicked);
|
||||
|
||||
// Bind Buttons
|
||||
@@ -44,6 +45,7 @@ namespace Hallucinate.UI
|
||||
root.Q<Button>("ProfileBtn").clicked += () => uiManager.Push<ProfileController>();
|
||||
root.Q<Button>("ExitBtn").clicked += () => Application.Quit();
|
||||
|
||||
ResetLogoPosition();
|
||||
StartPulse();
|
||||
_lastInteractionTime = Time.time;
|
||||
}
|
||||
@@ -51,6 +53,7 @@ namespace Hallucinate.UI
|
||||
private void ResetLogoPosition()
|
||||
{
|
||||
if (_logo == null) return;
|
||||
_logo.style.translate = new StyleTranslate(new Translate(0, 0));
|
||||
_logo.style.left = (Screen.width / 2f) - 100;
|
||||
_logo.style.top = (Screen.height / 2f) - 100;
|
||||
_logo.style.width = 200;
|
||||
@@ -60,6 +63,7 @@ namespace Hallucinate.UI
|
||||
public void SetGameIcon(Texture2D icon)
|
||||
{
|
||||
if (icon == null || _logo == null) return;
|
||||
_currentIcon = icon;
|
||||
_logo.style.backgroundImage = icon;
|
||||
|
||||
var radius = new StyleLength(new Length(50, LengthUnit.Percent));
|
||||
@@ -72,28 +76,45 @@ namespace Hallucinate.UI
|
||||
var label = _logo.Q<Label>();
|
||||
if (label != null) label.style.display = DisplayStyle.None;
|
||||
|
||||
StartRotation();
|
||||
}
|
||||
|
||||
private void StartRotation()
|
||||
{
|
||||
if (_currentIcon == null) return;
|
||||
if (_rotationTween.isAlive) _rotationTween.Stop();
|
||||
|
||||
_rotationTween = Tween.Custom(0f, 360f, duration: 4f, cycles: -1, ease: Ease.Linear,
|
||||
onValueChange: val => _logo.style.rotate = new StyleRotate(new Rotate(Angle.Degrees(val))));
|
||||
}
|
||||
|
||||
public override async Task PlayTransitionIn()
|
||||
{
|
||||
// 1. Đưa về trạng thái Idle và reset vị trí Logo về giữa trước khi hiện
|
||||
_lastInteractionTime = Time.time;
|
||||
_currentState = MenuState.Idle;
|
||||
ResetLogoPosition();
|
||||
|
||||
if (_ribbon != null)
|
||||
{
|
||||
_ribbon.style.display = DisplayStyle.None;
|
||||
_ribbon.style.opacity = 0;
|
||||
}
|
||||
|
||||
// 2. Chạy hiệu ứng bay vào từ bên phải của Base class
|
||||
// Hàm này sẽ gọi Show() và chạy Tween di chuyển toàn bộ root
|
||||
// Khởi động lại rotation nếu có icon
|
||||
StartRotation();
|
||||
|
||||
UnityEngine.Cursor.visible = true;
|
||||
await base.PlayTransitionIn();
|
||||
|
||||
// 3. Sau khi bay vào xong, tự động kích hoạt Ribbon
|
||||
TransitionToRibbon();
|
||||
// Nếu không phải lần đầu load (tức là quay lại bằng nút Back), tự động bung Ribbon
|
||||
if (!_isFirstLoad)
|
||||
{
|
||||
TransitionToRibbon();
|
||||
}
|
||||
else
|
||||
{
|
||||
_isFirstLoad = false; // Đã xong lần đầu, các lần sau sẽ tự động bung
|
||||
}
|
||||
}
|
||||
|
||||
public override async Task PlayTransitionOut()
|
||||
@@ -109,33 +130,34 @@ namespace Hallucinate.UI
|
||||
else _ = uiManager.Push<LobbyController>();
|
||||
}
|
||||
|
||||
private async void TransitionToRibbon()
|
||||
private void TransitionToRibbon()
|
||||
{
|
||||
// Tránh chạy đè nếu đang ở Ribbon rồi
|
||||
if (_currentState == MenuState.Ribbon) return;
|
||||
if (_currentState == MenuState.Ribbon && _ribbon.resolvedStyle.display == DisplayStyle.Flex) return;
|
||||
_currentState = MenuState.Ribbon;
|
||||
_lastInteractionTime = Time.time;
|
||||
|
||||
// Hiện Ribbon
|
||||
_ribbon.style.display = DisplayStyle.Flex;
|
||||
Tween.Custom(0f, 1f, duration: 0.3f, onValueChange: val => _ribbon.style.opacity = val);
|
||||
|
||||
// Đợi UI Toolkit cập nhật layout
|
||||
await Task.Yield();
|
||||
_logoSpace.RegisterCallback<GeometryChangedEvent>(OnLogoSpaceReady);
|
||||
}
|
||||
|
||||
if (_logoSpace == null) return;
|
||||
private void OnLogoSpaceReady(GeometryChangedEvent evt)
|
||||
{
|
||||
_logoSpace.UnregisterCallback<GeometryChangedEvent>(OnLogoSpaceReady);
|
||||
Rect targetBounds = _logoSpace.worldBound;
|
||||
|
||||
// Di chuyển Logo vào vị trí trong Ribbon
|
||||
Tween.Custom(_logo.style.left.value.value, targetBounds.x, duration: 0.5f, ease: Ease.OutQuad,
|
||||
if (targetBounds.width <= 0) return;
|
||||
|
||||
Tween.Custom(_logo.resolvedStyle.left, targetBounds.x, duration: 0.5f, ease: Ease.OutQuad,
|
||||
onValueChange: val => _logo.style.left = val);
|
||||
|
||||
Tween.Custom(_logo.style.top.value.value, targetBounds.y - 35, duration: 0.5f, ease: Ease.OutQuad,
|
||||
Tween.Custom(_logo.resolvedStyle.top, targetBounds.y - 35, duration: 0.5f, ease: Ease.OutQuad,
|
||||
onValueChange: val => _logo.style.top = val);
|
||||
|
||||
Tween.Custom(_logo.style.width.value.value, 120f, duration: 0.5f, ease: Ease.OutQuad,
|
||||
Tween.Custom(_logo.resolvedStyle.width, 120f, duration: 0.5f, ease: Ease.OutQuad,
|
||||
onValueChange: val => _logo.style.width = val);
|
||||
|
||||
Tween.Custom(_logo.style.height.value.value, 120f, duration: 0.5f, ease: Ease.OutQuad,
|
||||
Tween.Custom(_logo.resolvedStyle.height, 120f, duration: 0.5f, ease: Ease.OutQuad,
|
||||
onValueChange: val => _logo.style.height = val);
|
||||
|
||||
_lastInteractionTime = Time.time;
|
||||
@@ -149,13 +171,13 @@ namespace Hallucinate.UI
|
||||
float targetX = (Screen.width / 2f) - 100;
|
||||
float targetY = (Screen.height / 2f) - 100;
|
||||
|
||||
Tween.Custom(_logo.style.left.value.value, targetX, duration: 0.5f, ease: Ease.OutQuad,
|
||||
Tween.Custom(_logo.resolvedStyle.left, targetX, duration: 0.5f, ease: Ease.OutQuad,
|
||||
onValueChange: val => _logo.style.left = val);
|
||||
Tween.Custom(_logo.style.top.value.value, targetY, duration: 0.5f, ease: Ease.OutQuad,
|
||||
Tween.Custom(_logo.resolvedStyle.top, targetY, duration: 0.5f, ease: Ease.OutQuad,
|
||||
onValueChange: val => _logo.style.top = val);
|
||||
Tween.Custom(_logo.style.width.value.value, 200f, duration: 0.5f, ease: Ease.OutQuad,
|
||||
Tween.Custom(_logo.resolvedStyle.width, 200f, duration: 0.5f, ease: Ease.OutQuad,
|
||||
onValueChange: val => _logo.style.width = val);
|
||||
Tween.Custom(_logo.style.height.value.value, 200f, duration: 0.5f, ease: Ease.OutQuad,
|
||||
Tween.Custom(_logo.resolvedStyle.height, 200f, duration: 0.5f, ease: Ease.OutQuad,
|
||||
onValueChange: val => _logo.style.height = val);
|
||||
|
||||
Tween.Custom(1f, 0f, duration: 0.5f, onValueChange: val => _ribbon.style.opacity = val)
|
||||
@@ -164,6 +186,11 @@ namespace Hallucinate.UI
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (Input.GetAxis("Mouse X") != 0 || Input.GetAxis("Mouse Y") != 0 || Input.anyKey)
|
||||
{
|
||||
_lastInteractionTime = Time.time;
|
||||
}
|
||||
|
||||
if (_currentState == MenuState.Ribbon && Time.time - _lastInteractionTime > IDLE_TIMEOUT)
|
||||
{
|
||||
TransitionToIdle();
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using PrimeTween;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
@@ -16,6 +17,7 @@ namespace Hallucinate.UI
|
||||
|
||||
private UIDocument _uiDocument;
|
||||
private VisualElement _rootElement;
|
||||
private VisualElement _cursorLayer; // Lớp trên cùng chứa trail và ripples
|
||||
|
||||
private readonly Dictionary<Type, BaseUIController> _controllers = new Dictionary<Type, BaseUIController>();
|
||||
private readonly Stack<BaseUIController> _history = new Stack<BaseUIController>();
|
||||
@@ -23,6 +25,13 @@ namespace Hallucinate.UI
|
||||
[Header("Game Metadata")]
|
||||
[SerializeField] private Texture2D gameIcon;
|
||||
|
||||
[Header("Cursor & Effects Settings")]
|
||||
[SerializeField] private Sprite cursorTrailSprite;
|
||||
[SerializeField, Range(10f, 100f)] private float cursorSize = 30f;
|
||||
[SerializeField, Range(5, 30)] private int trailLength = 15;
|
||||
[SerializeField] private bool enableRipples = true;
|
||||
[SerializeField] private Color rippleColor = new Color(1, 1, 1, 0.5f);
|
||||
|
||||
[Header("UI Templates")]
|
||||
[SerializeField] private VisualTreeAsset mainMenuTemplate;
|
||||
[SerializeField] private VisualTreeAsset lobbyTemplate;
|
||||
@@ -31,6 +40,7 @@ namespace Hallucinate.UI
|
||||
[SerializeField] private VisualTreeAsset hudTemplate;
|
||||
|
||||
private MainMenuController _mainMenuController;
|
||||
private List<VisualElement> _trailSegments = new List<VisualElement>();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -48,6 +58,20 @@ namespace Hallucinate.UI
|
||||
_uiDocument = GetComponent<UIDocument>();
|
||||
_rootElement = _uiDocument.rootVisualElement;
|
||||
|
||||
// Tạo lớp Cursor trên cùng
|
||||
_cursorLayer = new VisualElement();
|
||||
_cursorLayer.name = "CursorLayer";
|
||||
_cursorLayer.style.position = Position.Absolute;
|
||||
_cursorLayer.style.width = Length.Percent(100);
|
||||
_cursorLayer.style.height = Length.Percent(100);
|
||||
_cursorLayer.pickingMode = PickingMode.Ignore;
|
||||
_rootElement.Add(_cursorLayer);
|
||||
|
||||
SetupCursorTrail();
|
||||
|
||||
// Đăng ký ripple toàn cục
|
||||
_rootElement.RegisterCallback<PointerDownEvent>(OnGlobalClick, TrickleDown.TrickleDown);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (gameIcon == null)
|
||||
{
|
||||
@@ -59,6 +83,91 @@ namespace Hallucinate.UI
|
||||
InitializeControllers();
|
||||
}
|
||||
|
||||
private void SetupCursorTrail()
|
||||
{
|
||||
if (cursorTrailSprite == null) return;
|
||||
|
||||
for (int i = 0; i < trailLength; i++)
|
||||
{
|
||||
var segment = new VisualElement();
|
||||
segment.style.position = Position.Absolute;
|
||||
segment.style.width = cursorSize;
|
||||
segment.style.height = cursorSize;
|
||||
segment.style.backgroundImage = new StyleBackground(cursorTrailSprite);
|
||||
segment.style.opacity = 1f - ((float)i / trailLength);
|
||||
segment.style.scale = new StyleScale(new Vector2(1f - ((float)i / trailLength), 1f - ((float)i / trailLength)));
|
||||
segment.pickingMode = PickingMode.Ignore;
|
||||
|
||||
_cursorLayer.Add(segment);
|
||||
_trailSegments.Add(segment);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGlobalClick(PointerDownEvent evt)
|
||||
{
|
||||
if (!enableRipples) return;
|
||||
|
||||
var ripple = new VisualElement();
|
||||
ripple.style.position = Position.Absolute;
|
||||
ripple.style.width = cursorSize;
|
||||
ripple.style.height = cursorSize;
|
||||
ripple.style.borderTopLeftRadius = cursorSize;
|
||||
ripple.style.borderTopRightRadius = cursorSize;
|
||||
ripple.style.borderBottomLeftRadius = cursorSize;
|
||||
ripple.style.borderBottomRightRadius = cursorSize;
|
||||
ripple.style.borderTopColor = rippleColor;
|
||||
ripple.style.borderBottomColor = rippleColor;
|
||||
ripple.style.borderLeftColor = rippleColor;
|
||||
ripple.style.borderRightColor = rippleColor;
|
||||
ripple.style.borderTopWidth = 2;
|
||||
ripple.style.borderBottomWidth = 2;
|
||||
ripple.style.borderLeftWidth = 2;
|
||||
ripple.style.borderRightWidth = 2;
|
||||
|
||||
ripple.style.left = evt.localPosition.x - (cursorSize / 2);
|
||||
ripple.style.top = evt.localPosition.y - (cursorSize / 2);
|
||||
ripple.pickingMode = PickingMode.Ignore;
|
||||
|
||||
_cursorLayer.Add(ripple);
|
||||
|
||||
// Hiệu ứng Ripple: To ra và nhạt dần (Sửa lỗi dùng Vector3 thay vì float)
|
||||
Tween.Scale(ripple.transform, Vector3.one * 3f, duration: 0.5f, ease: Ease.OutQuad);
|
||||
Tween.Custom(1f, 0f, duration: 0.5f, onValueChange: val => ripple.style.opacity = val)
|
||||
.OnComplete(() => ripple.RemoveFromHierarchy());
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
_mainMenuController?.Update();
|
||||
UpdateTrail();
|
||||
}
|
||||
|
||||
private void UpdateTrail()
|
||||
{
|
||||
if (_trailSegments.Count == 0) return;
|
||||
|
||||
Vector2 mousePos = Input.mousePosition;
|
||||
Vector2 uiPos = new Vector2(mousePos.x, Screen.height - mousePos.y);
|
||||
|
||||
// Segment đầu tiên đi theo chuột
|
||||
_trailSegments[0].style.left = uiPos.x - (cursorSize / 2);
|
||||
_trailSegments[0].style.top = uiPos.y - (cursorSize / 2);
|
||||
|
||||
// Các segment sau đuổi theo segment trước
|
||||
for (int i = 1; i < _trailSegments.Count; i++)
|
||||
{
|
||||
float targetX = _trailSegments[i - 1].resolvedStyle.left;
|
||||
float targetY = _trailSegments[i - 1].resolvedStyle.top;
|
||||
|
||||
float currX = _trailSegments[i].resolvedStyle.left;
|
||||
float currY = _trailSegments[i].resolvedStyle.top;
|
||||
|
||||
// Nội suy để mượt mà (Lerp)
|
||||
_trailSegments[i].style.left = Mathf.Lerp(currX, targetX, Time.deltaTime * 20f);
|
||||
_trailSegments[i].style.top = Mathf.Lerp(currY, targetY, Time.deltaTime * 20f);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeControllers()
|
||||
{
|
||||
_mainMenuController = RegisterController<MainMenuController>(mainMenuTemplate);
|
||||
@@ -72,7 +181,6 @@ namespace Hallucinate.UI
|
||||
RegisterController<SettingsController>(settingsTemplate);
|
||||
RegisterController<HUDController>(hudTemplate);
|
||||
|
||||
// Khởi động màn hình đầu tiên
|
||||
_ = Push<MainMenuController>();
|
||||
}
|
||||
|
||||
@@ -85,9 +193,12 @@ namespace Hallucinate.UI
|
||||
instance.style.position = Position.Absolute;
|
||||
instance.style.width = Length.Percent(100);
|
||||
instance.style.height = Length.Percent(100);
|
||||
instance.style.display = DisplayStyle.None; // Ẩn mặc định
|
||||
instance.style.display = DisplayStyle.None;
|
||||
_rootElement.Add(instance);
|
||||
|
||||
// Luôn đảm bảo CursorLayer nằm trên cùng sau khi add màn hình mới
|
||||
_cursorLayer.BringToFront();
|
||||
|
||||
var controller = new T();
|
||||
controller.Initialize(instance, this);
|
||||
_controllers[typeof(T)] = controller;
|
||||
@@ -95,41 +206,23 @@ namespace Hallucinate.UI
|
||||
return controller;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
_mainMenuController?.Update();
|
||||
// Update các controller khác nếu cần
|
||||
}
|
||||
|
||||
public async Task Push<T>() where T : BaseUIController
|
||||
{
|
||||
if (!_controllers.TryGetValue(typeof(T), out var newScreen)) return;
|
||||
|
||||
// Nếu màn hình mới chính là màn hình đang hiện, không làm gì cả
|
||||
if (_history.Count > 0 && _history.Peek() == newScreen) return;
|
||||
|
||||
if (_history.Count > 0)
|
||||
{
|
||||
var currentScreen = _history.Peek();
|
||||
await currentScreen.PlayTransitionOut();
|
||||
}
|
||||
if (_history.Count > 0) await _history.Peek().PlayTransitionOut();
|
||||
|
||||
_history.Push(newScreen);
|
||||
await newScreen.PlayTransitionIn();
|
||||
_cursorLayer.BringToFront(); // Giữ trail luôn trên cùng
|
||||
}
|
||||
|
||||
public async Task Pop()
|
||||
{
|
||||
if (_history.Count <= 1) return;
|
||||
|
||||
var currentScreen = _history.Pop();
|
||||
await currentScreen.PlayTransitionOut();
|
||||
|
||||
if (_history.Count > 0)
|
||||
{
|
||||
var previousScreen = _history.Peek();
|
||||
await previousScreen.PlayTransitionIn();
|
||||
}
|
||||
await _history.Pop().PlayTransitionOut();
|
||||
if (_history.Count > 0) await _history.Peek().PlayTransitionIn();
|
||||
_cursorLayer.BringToFront();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ TextureImporter:
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 7
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
|
||||
@@ -1,25 +1,19 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
||||
<Style src="project:/Assets/UI/Global.uss" />
|
||||
<ui:VisualElement name="MainMenuRoot" class="screen-root" picking-mode="Position">
|
||||
<!-- Ribbon Container - Luôn ở giữa màn hình -->
|
||||
<ui:VisualElement name="MenuContainer" picking-mode="Position" style="flex-grow: 1; justify-content: center; align-items: center;">
|
||||
|
||||
<ui:VisualElement name="Ribbon" picking-mode="Position" style="flex-direction: row; display: none; background-color: rgba(0, 0, 0, 0.8); padding: 5px 20px; border-radius: 10px; align-items: center; justify-content: center;">
|
||||
<ui:Button name="SettingsBtn" text="Settings" class="button-spring" style="width: 100px; height: 50px;" />
|
||||
|
||||
<!-- Placeholder cho Logo -->
|
||||
<ui:VisualElement name="LogoSpace" style="width: 120px; height: 50px; background-color: transparent; margin: 0 10px;" />
|
||||
|
||||
<ui:Button name="JoinBtn" text="Join" class="button-spring" style="width: 100px; height: 50px;" />
|
||||
<ui:Button name="CreateBtn" text="Create" class="button-spring" style="width: 100px; height: 50px;" />
|
||||
<ui:Button name="ProfileBtn" text="Profile" class="button-spring" style="width: 100px; height: 50px;" />
|
||||
<ui:Button name="ExitBtn" text="Exit" class="button-spring" style="width: 100px; height: 50px;" />
|
||||
</ui:VisualElement>
|
||||
|
||||
</ui:VisualElement>
|
||||
|
||||
<!-- Logo -->
|
||||
<ui:VisualElement name="Logo" class="logo-pulse" picking-mode="Position" style="background-color: white; border-radius: 100px; position: absolute; width: 200px; height: 200px;">
|
||||
<!-- Đặt Logo ở giữa màn hình mặc định bằng Percent và Translate -->
|
||||
<ui:VisualElement name="Logo" class="logo-pulse" picking-mode="Position" style="background-color: white; border-radius: 100px; position: absolute; width: 200px; height: 200px; left: 50%; top: 50%; translate: -100px -100px;">
|
||||
<ui:Label text="LOGO" picking-mode="Ignore" style="color: black; align-self: center;" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
|
||||
@@ -14,7 +14,7 @@ PlayerSettings:
|
||||
accelerometerFrequency: 60
|
||||
companyName: Scovania
|
||||
productName: HALLUCINATE
|
||||
defaultCursor: {fileID: 0}
|
||||
defaultCursor: {fileID: 2800000, guid: bf03bd4e32f382f45bd848d91517f188, type: 3}
|
||||
cursorHotspot: {x: 0, y: 0}
|
||||
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
|
||||
m_ShowUnitySplashScreen: 1
|
||||
|
||||
Reference in New Issue
Block a user