1 Commits

Author SHA1 Message Date
943cb48056 hahahaha 2026-04-09 09:34:46 +07:00
6 changed files with 2063 additions and 13 deletions

View File

@@ -288,10 +288,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1956301527}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -910, y: -490}
m_SizeDelta: {x: 100, y: 100}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &884186907
MonoBehaviour:
@@ -306,7 +306,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Color: {r: 0.21960786, g: 0.21960786, b: 0.21960786, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1

View File

@@ -19,6 +19,7 @@ public struct PlayerInputData : INetworkInput
public class BasicSpawner : MonoBehaviour, INetworkRunnerCallbacks
{
private NetworkRunner _runner;
private string _roomName = "Room1";
public LobbyManager LobbyManager;
[SerializeField] private NetworkPrefabRef _playerPrefab;
@@ -75,11 +76,36 @@ public class BasicSpawner : MonoBehaviour, INetworkRunnerCallbacks
{
if (_runner == null || !_runner.IsRunning)
{
if (GUI.Button(new Rect(10, 10, 250, 40), "Bắt đầu (Auto Host/Client)"))
float width = 400;
float height = 300;
float x = (Screen.width - width) / 2f;
float y = (Screen.height - height) / 2f;
GUI.Box(new Rect(x, y, width, height), "FUSION MULTIPLAYER");
float innerX = x + 20;
float innerY = y + 40;
float contentWidth = width - 40;
GUI.Label(new Rect(innerX, innerY, 100, 30), "Tên phòng:");
_roomName = GUI.TextField(new Rect(innerX + 100, innerY, contentWidth - 100, 30), _roomName);
if (GUI.Button(new Rect(innerX, innerY + 50, contentWidth, 60), "VÀO PHÒNG\n(Tự động Host/Client)"))
{
_ = StartGame(GameMode.AutoHostOrClient);
_ = StartGame(GameMode.AutoHostOrClient, _roomName);
}
GUI.Label(new Rect(10, 60, 300, 20), "Gợi ý: Mở bản Build trước, sau đó mở Unity bấm nút trên.");
if (GUI.Button(new Rect(innerX, innerY + 120, (contentWidth / 2) - 5, 50), "Tạo phòng\n(Host)"))
{
_ = StartGame(GameMode.Host, _roomName);
}
if (GUI.Button(new Rect(innerX + (contentWidth / 2) + 5, innerY + 120, (contentWidth / 2) - 5, 50), "Tham gia\n(Client)"))
{
_ = StartGame(GameMode.Client, _roomName);
}
GUI.Label(new Rect(innerX, innerY + 180, contentWidth, 50), "Gợi ý: Nhập cùng tên phòng để chơi chung.\nNếu phòng chưa có, máy sẽ tự tạo mới.");
}
else
{

View File

@@ -12,12 +12,13 @@ namespace OnlyScove.Scripts
public override void Enter()
{
// Play the Parkour animation (Step Up)
stateMachine.Anim.CrossFadeInFixedTime(parkourHash, 0.1f);
if (stateMachine.Anim != null && stateMachine.Anim.layerCount > 0)
{
// Play the Parkour animation (Step Up)
// Use the overload with layer index 0 to be explicit
stateMachine.Anim.CrossFadeInFixedTime(parkourHash, 0.1f, 0);
}
// We'll wait for the animation to finish.
// In a real project, you might get the exact duration from the Animator.
// For now, we'll assume a fixed duration or check state.
timer = 0f;
}

8
Assets/_Recovery.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d2a193aae7ad2c940be4fc9041026670
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

2008
Assets/_Recovery/0.unity Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b6727156c95850341911776ca68a1086
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: