This commit is contained in:
2026-04-30 00:55:16 +07:00
parent 1222d39fdf
commit a8d268c42b
18 changed files with 326 additions and 464 deletions

View File

@@ -6,25 +6,22 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="f9183c68-daf0-43b8-be4c-fad79983f91b" name="Changes" comment=""> <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$/.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/Duy/PlayerInputData.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Duy/PlayerInputData.cs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scenes/Menu.unity" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Duy/_BasicSpawner.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Duy/_BasicSpawner.cs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scenes/Menu.unity.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Duy/_PlayerDataManager.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Duy/_PlayerDataManager.cs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scove/UIScaleTest.unity" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scove/UIScaleTest.unity" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Fusion.meta" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scripts/Duy/PlayerInputData.cs" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Fusion/BasicSpawner.cs" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scripts/Duy/PlayerInputData.cs.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Fusion/BasicSpawner.cs.meta" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scripts/Duy/_BasicSpawner.cs" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Fusion/LobbyHelper.cs" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scripts/Duy/_BasicSpawner.cs.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Fusion/LobbyHelper.cs.meta" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scripts/Duy/_PlayerData.cs" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Fusion/LobbyManager.cs" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scripts/Duy/_PlayerData.cs.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Fusion/LobbyManager.cs.meta" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scripts/Duy/_PlayerDataManager.cs" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Fusion/PlayerProfile.cs" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scripts/Duy/_PlayerDataManager.cs.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Fusion/PlayerProfile.cs.meta" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scripts/Duy/_PlayerInfo.cs" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Player Controller/PlayerStateMachine.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Player Controller/PlayerStateMachine.cs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scripts/Duy/_PlayerInfo.cs.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Player Controller/PlayerStats.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Player Controller/PlayerStats.cs" 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/HUDController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UI/HUDController.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/UI/LobbyController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UI/LobbyController.cs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Assets/Scripts/UI/LobbyController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UI/LobbyController.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/UI/MainPanelSettings.asset" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UI/MainPanelSettings.asset" 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$/ProjectSettings/EditorBuildSettings.asset" beforeDir="false" afterPath="$PROJECT_DIR$/ProjectSettings/EditorBuildSettings.asset" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -32,7 +29,7 @@
<option name="LAST_RESOLUTION" value="IGNORE" /> <option name="LAST_RESOLUTION" value="IGNORE" />
</component> </component>
<component name="EmbeddingIndexingInfo"> <component name="EmbeddingIndexingInfo">
<option name="cachedIndexableFilesCount" value="8" /> <option name="cachedIndexableFilesCount" value="13" />
<option name="fileBasedEmbeddingIndicesEnabled" value="true" /> <option name="fileBasedEmbeddingIndicesEnabled" value="true" />
</component> </component>
<component name="Git.Settings"> <component name="Git.Settings">
@@ -163,6 +160,8 @@
<workItem from="1777373072815" duration="1852000" /> <workItem from="1777373072815" duration="1852000" />
<workItem from="1777376778745" duration="10727000" /> <workItem from="1777376778745" duration="10727000" />
<workItem from="1777392719306" duration="13382000" /> <workItem from="1777392719306" duration="13382000" />
<workItem from="1777443280908" duration="5223000" />
<workItem from="1777484328779" duration="741000" />
</task> </task>
<servers /> <servers />
</component> </component>

View File

@@ -1,316 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 2
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &813769180
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 813769182}
- component: {fileID: 813769181}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &813769181
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 813769180}
m_Enabled: 1
serializedVersion: 12
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize2D: {x: 0.5, y: 0.5}
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ForceVisible: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
m_LightUnit: 1
m_LuxAtDistance: 1
m_EnableSpotReflector: 1
--- !u!4 &813769182
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 813769180}
serializedVersion: 2
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &1467441182
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1467441185}
- component: {fileID: 1467441184}
- component: {fileID: 1467441183}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1467441183
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1467441182}
m_Enabled: 1
--- !u!20 &1467441184
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1467441182}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1467441185
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1467441182}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 1467441185}
- {fileID: 813769182}

View File

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

View File

@@ -119,6 +119,52 @@ NavMeshSettings:
debug: debug:
m_Flags: 0 m_Flags: 0
m_NavMeshData: {fileID: 0} m_NavMeshData: {fileID: 0}
--- !u!1 &417583765
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 417583767}
- component: {fileID: 417583766}
m_Layer: 0
m_Name: Spawner
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &417583766
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 417583765}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ca752d01bdc2c5e42938776307031da3, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Hallucinate.UI.BasicSpawner
_playerPrefab:
RawGuidValue: 761bdf2e5c0cff4488527355acb975e5
--- !u!4 &417583767
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 417583765}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &458228298 --- !u!1 &458228298
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -497,6 +543,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5962d8f2c8e40e240a4a4907c7b539fa, type: 3} m_Script: {fileID: 11500000, guid: 5962d8f2c8e40e240a4a4907c7b539fa, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: Assembly-CSharp::OnlyScove.Scripts.InputReader m_EditorClassIdentifier: Assembly-CSharp::OnlyScove.Scripts.InputReader
inputActions: {fileID: 0}
--- !u!4 &2128442885 --- !u!4 &2128442885
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -774,3 +821,4 @@ SceneRoots:
- {fileID: 626355270} - {fileID: 626355270}
- {fileID: 2128442885} - {fileID: 2128442885}
- {fileID: 458228301} - {fileID: 458228301}
- {fileID: 417583767}

View File

@@ -9,9 +9,10 @@ using OnlyScove.Scripts;
namespace Hallucinate.UI namespace Hallucinate.UI
{ {
public class _BasicSpawner : MonoBehaviour, INetworkRunnerCallbacks public class BasicSpawner : MonoBehaviour, INetworkRunnerCallbacks
{ {
private NetworkRunner _runner { get; set; } public static BasicSpawner Instance { get; private set; }
private NetworkRunner _runner;
public event Action<List<SessionInfo>> OnSessionListUpdatedEvent; public event Action<List<SessionInfo>> OnSessionListUpdatedEvent;
public event Action<string> OnShutdownEvent; public event Action<string> OnShutdownEvent;
@@ -20,29 +21,74 @@ namespace Hallucinate.UI
private void Awake() private void Awake()
{ {
if (_runner == null) _runner = gameObject.AddComponent<NetworkRunner>(); if (Instance != null && Instance != this)
{
Destroy(gameObject);
return;
}
Instance = this;
DontDestroyOnLoad(gameObject); DontDestroyOnLoad(gameObject);
} }
public _PlayerProfile LocalPlayerProfile { get; private set; } public PlayerProfile LocalPlayerProfile { get; private set; }
public void SetLocalPlayerProfile(_PlayerProfile _profile) public void SetLocalPlayerProfile(PlayerProfile _profile)
{ {
LocalPlayerProfile = _profile; LocalPlayerProfile = _profile;
} }
public async Task StartLobby() private async Task EnsureRunnerExists()
{ {
if (_runner == null) _runner = gameObject.AddComponent<NetworkRunner>(); if (_runner != null)
_runner.ProvideInput = true; {
_runner.AddCallbacks(this); // Nếu runner cũ vẫn đang chạy hoặc lỗi, dọn dẹp nó
var result = await _runner.JoinSessionLobby(SessionLobby.ClientServer); await _runner.Shutdown();
if (!result.Ok) Debug.LogError($"Failed to join lobby: {result.ShutdownReason}"); if (_runner != null && _runner.gameObject != null)
{
Destroy(_runner);
}
_runner = null;
} }
public async Task StartHost(string sessionName, string password = null) _runner = gameObject.AddComponent<NetworkRunner>();
_runner.ProvideInput = true;
_runner.AddCallbacks(this);
}
public async Task StartLobby()
{
await EnsureRunnerExists();
var result = await _runner.JoinSessionLobby(SessionLobby.ClientServer);
if (!result.Ok)
{
Debug.LogError($"Failed to join lobby: {result.ShutdownReason}. Check AppID type or Network/Firewall.");
}
}
public async Task<bool> StartHost(string sessionName, string password = null)
{ {
OnJoinStartedEvent?.Invoke(); OnJoinStartedEvent?.Invoke();
// 1. Kiểm tra Build Settings
bool sceneExists = false;
for (int i = 0; i < UnityEngine.SceneManagement.SceneManager.sceneCountInBuildSettings; i++)
{
if (UnityEngine.SceneManagement.SceneUtility.GetScenePathByBuildIndex(i).Contains("Main Scene"))
{
sceneExists = true;
break;
}
}
if (!sceneExists)
{
Debug.LogError("CRITICAL: 'Main Scene' is NOT in Build Settings!");
return false;
}
// 2. Khởi tạo Runner mới sạch sẽ
await EnsureRunnerExists();
var customProps = new Dictionary<string, SessionProperty>(); var customProps = new Dictionary<string, SessionProperty>();
if (!string.IsNullOrEmpty(password)) if (!string.IsNullOrEmpty(password))
{ {
@@ -55,34 +101,48 @@ namespace Hallucinate.UI
SessionName = sessionName, SessionName = sessionName,
SessionProperties = customProps, SessionProperties = customProps,
PlayerCount = 2, PlayerCount = 2,
SceneManager = gameObject.AddComponent<NetworkSceneManagerDefault>() // Thêm fixed region để tránh timeout khi tìm server
// SceneManager sẽ tự động add nếu thiếu
SceneManager = gameObject.GetComponent<NetworkSceneManagerDefault>() ?? gameObject.AddComponent<NetworkSceneManagerDefault>()
}); });
if (!result.Ok) if (result.Ok)
{ {
Debug.LogError($"Failed to start host: {result.ShutdownReason}"); return true;
}
else
{
Debug.LogError($"Fusion StartHost Failed: {result.ShutdownReason}.");
OnJoinFailedEvent?.Invoke(); OnJoinFailedEvent?.Invoke();
return false;
} }
} }
public async Task StartClient(string sessionName, string password = null) public async Task<bool> StartClient(string sessionName, string password = null)
{ {
OnJoinStartedEvent?.Invoke(); OnJoinStartedEvent?.Invoke();
await EnsureRunnerExists();
var result = await _runner.StartGame(new StartGameArgs() var result = await _runner.StartGame(new StartGameArgs()
{ {
GameMode = GameMode.Client, GameMode = GameMode.Client,
SessionName = sessionName, SessionName = sessionName,
SceneManager = gameObject.AddComponent<NetworkSceneManagerDefault>() SceneManager = gameObject.GetComponent<NetworkSceneManagerDefault>() ?? gameObject.AddComponent<NetworkSceneManagerDefault>()
}); });
if (!result.Ok) if (result.Ok)
{ {
Debug.LogError($"Failed to join client: {result.ShutdownReason}"); return true;
}
else
{
Debug.LogError($"Fusion StartClient Failed: {result.ShutdownReason}");
OnJoinFailedEvent?.Invoke(); OnJoinFailedEvent?.Invoke();
return false;
} }
} }
// --- Các phương thức Callbacks ---
[SerializeField] private NetworkPrefabRef _playerPrefab; [SerializeField] private NetworkPrefabRef _playerPrefab;
private Dictionary<PlayerRef, NetworkObject> _spawnedCharacters = new Dictionary<PlayerRef, NetworkObject>(); private Dictionary<PlayerRef, NetworkObject> _spawnedCharacters = new Dictionary<PlayerRef, NetworkObject>();
@@ -90,13 +150,21 @@ namespace Hallucinate.UI
{ {
if (player == runner.LocalPlayer) if (player == runner.LocalPlayer)
{ {
var pdm = FindFirstObjectByType<_PlayerDataManager>(); var pdm = FindFirstObjectByType<PlayerDataManager>();
if (pdm != null) if (pdm != null)
{ {
string playerName = "Player";
_Role playerRole = _Role.Seeker;
if (LocalPlayerProfile != null)
{
playerName = LocalPlayerProfile.Name;
}
var metaData = new _PlayerMetaData() var metaData = new _PlayerMetaData()
{ {
Name = LocalPlayerProfile.Name, Name = playerName,
Role = LocalPlayerProfile.Role, Role = playerRole,
IsReady = false IsReady = false
}; };
pdm.RPC_UpdatePlayerMetaData(player, metaData); pdm.RPC_UpdatePlayerMetaData(player, metaData);
@@ -106,7 +174,7 @@ namespace Hallucinate.UI
public void StartGame() public void StartGame()
{ {
if (_runner.IsServer) if (_runner != null && _runner.IsServer)
{ {
_runner.LoadScene("Main Scene"); _runner.LoadScene("Main Scene");
} }
@@ -135,26 +203,13 @@ namespace Hallucinate.UI
public void OnInput(NetworkRunner runner, NetworkInput input) public void OnInput(NetworkRunner runner, NetworkInput input)
{ {
var data = new PlayerInputData(); var data = new PlayerInputData();
// Try to get input from the local player's InputReader
if (PlayerStateMachine.Local != null && PlayerStateMachine.Local.Input != null) if (PlayerStateMachine.Local != null && PlayerStateMachine.Local.Input != null)
{ {
var inputReader = PlayerStateMachine.Local.Input; data.Direction = PlayerStateMachine.Local.Input.MoveInput;
data.Direction = inputReader.MoveInput; data.sprint = PlayerStateMachine.Local.Input.IsSprintHeld;
data.sprint = inputReader.IsSprintHeld;
if (PlayerStateMachine.Local.Cam != null) if (PlayerStateMachine.Local.Cam != null)
{
data.rot = PlayerStateMachine.Local.Cam.PlanarRotation; data.rot = PlayerStateMachine.Local.Cam.PlanarRotation;
} }
}
else
{
// Fallback to basic input if player not spawned or InputReader missing
data.Direction = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
data.sprint = Input.GetKey(KeyCode.LeftShift);
}
input.Set(data); input.Set(data);
} }
@@ -174,7 +229,6 @@ namespace Hallucinate.UI
public void OnSceneLoadDone(NetworkRunner runner) public void OnSceneLoadDone(NetworkRunner runner)
{ {
string currentSceneName = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name; string currentSceneName = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name;
if (runner.IsServer && currentSceneName == "Main Scene") if (runner.IsServer && currentSceneName == "Main Scene")
{ {
foreach (var player in runner.ActivePlayers) foreach (var player in runner.ActivePlayers)
@@ -184,15 +238,10 @@ namespace Hallucinate.UI
_spawnedCharacters.Add(player, networkPlayerObject); _spawnedCharacters.Add(player, networkPlayerObject);
} }
} }
if (currentSceneName == "Main Scene") if (currentSceneName == "Main Scene")
{ UIManager.Instance?.OnGameStarted();
if (UIManager.Instance != null) UIManager.Instance.OnGameStarted();
}
else if (currentSceneName == "Lobby" || currentSceneName == "Menu") else if (currentSceneName == "Lobby" || currentSceneName == "Menu")
{ UIManager.Instance?.OnBackToMenu();
if (UIManager.Instance != null) UIManager.Instance.OnBackToMenu();
}
} }
public void OnSceneLoadStart(NetworkRunner runner) { } public void OnSceneLoadStart(NetworkRunner runner) { }

View File

@@ -1,7 +1,7 @@
using Fusion; using Fusion;
using UnityEngine; using UnityEngine;
public class _PlayerData : NetworkBehaviour public class PlayerData : NetworkBehaviour
{ {
[Networked] [Networked]
public _Role PlayerRole { get; set; } public _Role PlayerRole { get; set; }

View File

@@ -9,7 +9,7 @@ public struct _PlayerMetaData : INetworkStruct
public NetworkBool IsReady; public NetworkBool IsReady;
} }
public class _PlayerDataManager : NetworkBehaviour public class PlayerDataManager : NetworkBehaviour
{ {
[Networked] [Networked]
public NetworkDictionary<PlayerRef, _PlayerMetaData> Players => default; public NetworkDictionary<PlayerRef, _PlayerMetaData> Players => default;

View File

@@ -8,17 +8,18 @@ public enum _Role
Trapper Trapper
} }
public struct _PlayerProfile [System.Serializable]
public class PlayerProfile
{ {
public string Name; public string Name = "Player";
public _Role Role; public _Role Role = _Role.Seeker;
} }
public class _PlayerInfo : NetworkBehaviour public class PlayerInfo : NetworkBehaviour
{ {
[Networked] public string playerName { get; set; } [Networked] public string playerName { get; set; }
public _PlayerDataManager playerDataManager; public PlayerDataManager playerDataManager;
public TextMeshProUGUI nameText; public TextMeshProUGUI nameText;
public GameObject[] characterIcons; // mảng chứa icon tương ứng với từng class, có thể gán trong inspector public GameObject[] characterIcons; // mảng chứa icon tương ứng với từng class, có thể gán trong inspector
@@ -27,7 +28,7 @@ public class _PlayerInfo : NetworkBehaviour
// sẽ gọi phương thức này để khởi tạo thông tin player // sẽ gọi phương thức này để khởi tạo thông tin player
public override void Spawned() public override void Spawned()
{ {
playerDataManager = FindFirstObjectByType<_PlayerDataManager>(); // tìm PlayerDataManager trong scene playerDataManager = FindFirstObjectByType<PlayerDataManager>(); // tìm PlayerDataManager trong scene
} }
// phương thức này sẽ được gọi mỗi frame để cập nhật thông tin hiển thị của player // phương thức này sẽ được gọi mỗi frame để cập nhật thông tin hiển thị của player
@@ -39,12 +40,17 @@ public class _PlayerInfo : NetworkBehaviour
var name = metadata.Name; var name = metadata.Name;
var charClass = metadata.Role; var charClass = metadata.Role;
if (nameText != null)
nameText.text = $"{name} ({charClass})"; nameText.text = $"{name} ({charClass})";
if (characterIcons != null)
{
for (var i = 0; i < characterIcons.Length; i++) for (var i = 0; i < characterIcons.Length; i++)
{ {
if (characterIcons[i] != null)
characterIcons[i].SetActive(i == (int)charClass); // hiển thị icon tương ứng với class của player characterIcons[i].SetActive(i == (int)charClass); // hiển thị icon tương ứng với class của player
} }
} }
} }
} }
}

View File

@@ -10,8 +10,7 @@ namespace Hallucinate.UI
public class LobbyController : BaseUIController public class LobbyController : BaseUIController
{ {
private VisualTreeAsset _roomItemTemplate; private VisualTreeAsset _roomItemTemplate;
private _BasicSpawner _spawner; private PlayerDataManager _playerDataManager;
private _PlayerDataManager _playerDataManager;
// Containers // Containers
private VisualElement _joinContainer, _createContainer, _loungeContainer, _passOverlay; private VisualElement _joinContainer, _createContainer, _loungeContainer, _passOverlay;
@@ -34,7 +33,6 @@ namespace Hallucinate.UI
public override void Initialize(VisualElement uxmlRoot, UIManager manager) public override void Initialize(VisualElement uxmlRoot, UIManager manager)
{ {
base.Initialize(uxmlRoot, manager); base.Initialize(uxmlRoot, manager);
_spawner = Object.FindFirstObjectByType<_BasicSpawner>();
// Query Elements // Query Elements
_joinContainer = root.Q<VisualElement>("JoinContainer"); _joinContainer = root.Q<VisualElement>("JoinContainer");
@@ -91,13 +89,24 @@ namespace Hallucinate.UI
}); });
} }
// Đăng ký sự kiện từ Spawner // Đăng ký sự kiện từ Spawner (Sử dụng Instance)
if (_spawner != null) if (BasicSpawner.Instance != null)
{ {
_spawner.OnSessionListUpdatedEvent += UpdateRoomList; RegisterSpawnerEvents();
_spawner.OnJoinFailedEvent += () => _joinPassError.style.display = DisplayStyle.Flex;
_spawner.OnJoinStartedEvent += () => { /* Show loading if needed */ };
} }
else
{
// Nếu chưa có, thử tìm sau một chút
Invoke(nameof(RegisterSpawnerEvents), 0.1f);
}
}
private void RegisterSpawnerEvents()
{
if (BasicSpawner.Instance == null) return;
BasicSpawner.Instance.OnSessionListUpdatedEvent += UpdateRoomList;
BasicSpawner.Instance.OnJoinFailedEvent += () => { if(_joinPassError != null) _joinPassError.style.display = DisplayStyle.Flex; };
BasicSpawner.Instance.OnJoinStartedEvent += () => { /* Show loading if needed */ };
} }
public void SetRoomTemplate(VisualTreeAsset template) => _roomItemTemplate = template; public void SetRoomTemplate(VisualTreeAsset template) => _roomItemTemplate = template;
@@ -110,39 +119,61 @@ namespace Hallucinate.UI
public void ShowJoin() public void ShowJoin()
{ {
_joinContainer.style.display = DisplayStyle.Flex; if (_joinContainer != null) _joinContainer.style.display = DisplayStyle.Flex;
_createContainer.style.display = DisplayStyle.None; if (_createContainer != null) _createContainer.style.display = DisplayStyle.None;
_loungeContainer.style.display = DisplayStyle.None; if (_loungeContainer != null) _loungeContainer.style.display = DisplayStyle.None;
_spawner?.StartLobby(); BasicSpawner.Instance?.StartLobby();
} }
public void ShowCreate() public void ShowCreate()
{ {
_joinContainer.style.display = DisplayStyle.None; if (_joinContainer != null) _joinContainer.style.display = DisplayStyle.None;
_createContainer.style.display = DisplayStyle.Flex; if (_createContainer != null) _createContainer.style.display = DisplayStyle.Flex;
} }
private void ShowLounge(string roomName) private void ShowLounge(string roomName)
{ {
_joinContainer.style.display = DisplayStyle.None; if (_joinContainer != null) _joinContainer.style.display = DisplayStyle.None;
_createContainer.style.display = DisplayStyle.None; if (_createContainer != null) _createContainer.style.display = DisplayStyle.None;
_loungeContainer.style.display = DisplayStyle.Flex; if (_loungeContainer != null) _loungeContainer.style.display = DisplayStyle.Flex;
_loungeRoomName.text = $"Room: {roomName}"; if (_loungeRoomName != null) _loungeRoomName.text = $"Room: {roomName}";
_playerDataManager = Object.FindFirstObjectByType<_PlayerDataManager>(); _playerDataManager = Object.FindFirstObjectByType<PlayerDataManager>();
} }
private async void OnCreateRoomClicked() private async void OnCreateRoomClicked()
{ {
string id = _roomIDInput.value.Trim(); var spawner = BasicSpawner.Instance;
string name = string.IsNullOrEmpty(_roomNameInput.value) ? id : _roomNameInput.value; if (spawner == null)
string pass = _passToggle.value ? _roomPassInput.value : null; {
Debug.LogError("[LobbyController] BasicSpawner.Instance is missing!");
return;
}
if (string.IsNullOrEmpty(id)) return; string id = _roomIDInput != null && !string.IsNullOrEmpty(_roomIDInput.value)
? _roomIDInput.value.Trim()
: Random.Range(1000, 9999).ToString();
await _spawner.StartHost(id, pass); if (_roomIDInput != null) _roomIDInput.value = id;
string name = _roomNameInput != null && !string.IsNullOrEmpty(_roomNameInput.value)
? _roomNameInput.value
: $"Room {id}";
string pass = (_passToggle != null && _passToggle.value && _roomPassInput != null)
? _roomPassInput.value
: null;
bool success = await spawner.StartHost(id, pass);
if (success)
{
ShowLounge(name); ShowLounge(name);
} }
else
{
Debug.LogWarning("[LobbyController] Failed to create room. Please check AppID/Region.");
}
}
private void UpdateRoomList(List<SessionInfo> sessions) private void UpdateRoomList(List<SessionInfo> sessions)
{ {
@@ -150,48 +181,53 @@ namespace Hallucinate.UI
_roomList.Clear(); _roomList.Clear();
foreach (var session in sessions) foreach (var session in sessions)
{ {
if (_roomItemTemplate == null) continue;
var item = _roomItemTemplate.Instantiate(); var item = _roomItemTemplate.Instantiate();
item.Q<Label>("RoomName").text = session.Name; item.Q<Label>("RoomName").text = session.Name;
item.Q<Label>("PlayerCount").text = $"{session.PlayerCount}/{session.MaxPlayers}"; item.Q<Label>("PlayerCount").text = $"{session.PlayerCount}/{session.MaxPlayers}";
bool needsPass = session.Properties.ContainsKey("pw"); bool needsPass = session.Properties.ContainsKey("pw");
item.Q<Label>("LockIcon").style.display = needsPass ? DisplayStyle.Flex : DisplayStyle.None; var lockIcon = item.Q<Label>("LockIcon");
if (lockIcon != null) lockIcon.style.display = needsPass ? DisplayStyle.Flex : DisplayStyle.None;
var joinBtn = item.Q<Button>("JoinBtn"); var joinBtn = item.Q<Button>("JoinBtn");
joinBtn.clicked += () => OnRoomItemClicked(session); if (joinBtn != null) joinBtn.clicked += () => OnRoomItemClicked(session);
_roomList.Add(item); _roomList.Add(item);
} }
} }
private void OnRoomItemClicked(SessionInfo session) private async void OnRoomItemClicked(SessionInfo session)
{ {
bool needsPass = session.Properties.ContainsKey("pw"); bool needsPass = session.Properties.ContainsKey("pw");
if (needsPass) if (needsPass)
{ {
_selectedSession = session; _selectedSession = session;
_passOverlay.style.display = DisplayStyle.Flex; if (_passOverlay != null) _passOverlay.style.display = DisplayStyle.Flex;
_joinPassError.style.display = DisplayStyle.None; if (_joinPassError != null) _joinPassError.style.display = DisplayStyle.None;
_joinPassInput.value = ""; if (_joinPassInput != null) _joinPassInput.value = "";
} }
else else
{ {
JoinRoom(session.Name, null); await JoinRoom(session.Name, null);
} }
} }
private async void OnConfirmPasswordClicked() private async void OnConfirmPasswordClicked()
{ {
if (_selectedSession == null) return; if (_selectedSession == null) return;
string pass = _joinPassInput.value; string pass = _joinPassInput != null ? _joinPassInput.value : "";
_passOverlay.style.display = DisplayStyle.None; if (_passOverlay != null) _passOverlay.style.display = DisplayStyle.None;
await JoinRoom(_selectedSession.Name, pass); await JoinRoom(_selectedSession.Name, pass);
} }
private async Task JoinRoom(string sessionName, string password) private async Task JoinRoom(string sessionName, string password)
{ {
await _spawner.StartClient(sessionName, password); if (BasicSpawner.Instance != null)
ShowLounge(sessionName); {
bool success = await BasicSpawner.Instance.StartClient(sessionName, password);
if (success) ShowLounge(sessionName);
}
} }
private void OnReadyClicked() private void OnReadyClicked()
@@ -209,7 +245,7 @@ namespace Hallucinate.UI
private void OnStartClicked() private void OnStartClicked()
{ {
_spawner.StartGame(); BasicSpawner.Instance?.StartGame();
} }
private void OnLeaveLoungeClicked() private void OnLeaveLoungeClicked()
@@ -221,7 +257,7 @@ namespace Hallucinate.UI
public override void Update() public override void Update()
{ {
if (_loungeContainer.style.display == DisplayStyle.Flex) if (_loungeContainer != null && _loungeContainer.style.display == DisplayStyle.Flex)
{ {
UpdateLoungeUI(); UpdateLoungeUI();
} }
@@ -231,14 +267,15 @@ namespace Hallucinate.UI
{ {
if (_playerDataManager == null) if (_playerDataManager == null)
{ {
_playerDataManager = Object.FindFirstObjectByType<_PlayerDataManager>(); _playerDataManager = Object.FindFirstObjectByType<PlayerDataManager>();
return; return;
} }
var runner = Object.FindFirstObjectByType<NetworkRunner>(); var runner = Object.FindFirstObjectByType<NetworkRunner>();
if (runner == null) return; if (runner == null) return;
// Update Player List if (_playerListContainer != null)
{
_playerListContainer.Clear(); _playerListContainer.Clear();
bool allReady = true; bool allReady = true;
int playerCount = 0; int playerCount = 0;
@@ -246,7 +283,6 @@ namespace Hallucinate.UI
foreach (var kvp in _playerDataManager.Players) foreach (var kvp in _playerDataManager.Players)
{ {
playerCount++; playerCount++;
var playerRef = kvp.Key;
var data = kvp.Value; var data = kvp.Value;
var playerItem = new VisualElement(); var playerItem = new VisualElement();
@@ -265,12 +301,21 @@ namespace Hallucinate.UI
if (!data.IsReady) allReady = false; if (!data.IsReady) allReady = false;
} }
// Update Buttons if (_startBtn != null)
_startBtn.style.display = (runner.IsServer && allReady && playerCount >= 2) ? DisplayStyle.Flex : DisplayStyle.None; _startBtn.style.display = (runner.IsServer && allReady && playerCount >= 2) ? DisplayStyle.Flex : DisplayStyle.None;
if (_readyBtn != null)
{
_playerDataManager.TryGetPlayerMetaData(runner.LocalPlayer, out var myData); _playerDataManager.TryGetPlayerMetaData(runner.LocalPlayer, out var myData);
_readyBtn.text = myData.IsReady ? "UNREADY" : "READY UP"; _readyBtn.text = myData.IsReady ? "UNREADY" : "READY UP";
} }
} }
} }
private async void Invoke(string methodName, float delay)
{
await Task.Delay((int)(delay * 1000));
if (methodName == nameof(RegisterSpawnerEvents)) RegisterSpawnerEvents();
}
}
}

View File

@@ -21,7 +21,7 @@ MonoBehaviour:
m_ScaleMode: 1 m_ScaleMode: 1
m_ReferenceSpritePixelsPerUnit: 100 m_ReferenceSpritePixelsPerUnit: 100
m_PixelsPerUnit: 100 m_PixelsPerUnit: 100
m_Scale: 1.3 m_Scale: 1
m_ReferenceDpi: 96 m_ReferenceDpi: 96
m_FallbackDpi: 96 m_FallbackDpi: 96
m_ReferenceResolution: {x: 1200, y: 800} m_ReferenceResolution: {x: 1200, y: 800}

35
GEMINI.md Normal file
View File

@@ -0,0 +1,35 @@
/# 🌑 PROJECT HALLUCINATE - AI Instructions
Đây là file hướng dẫn dành cho Gemini CLI để hiểu bối cảnh và quy chuẩn của dự án HALLUCINATE.
## 🛠 Stack Kỹ thuật
- **Engine:** Unity 6 (6000.3.10f1 LTS)
- **Networking:** Photon Fusion (State Sync, Client-Side Prediction)
- **Render Pipeline:** Universal Render Pipeline (URP)
- **Architecture:** State Machine (Player), Interface-based Interaction (`IInteractable`).
## 📂 Quy chuẩn Cấu trúc Thư mục
Tuân thủ nghiêm ngặt cấu trúc:
- `Assets/Scripts/GameSetup/Maze/`: Các thuật toán tạo mê cung.
- `Assets/Scripts/Player Controller/`: Logic di chuyển và State Machine của người chơi.
- `Assets/Scripts/UI/`: Logic giao diện và Lobby.
- `Assets/Scripts/Fusion/`: Các script liên quan đến Network và Spawner.
## 📜 Quy ước Coding & Logic
1. **Networking:**
- Luôn sử dụng `FixedUpdateNetwork` thay vì `Update/FixedUpdate` cho các logic cần đồng bộ.
- Sử dụng thuộc tính `[Networked]` cho các biến cần đồng bộ trạng thái.
- Ưu tiên Client-Side Prediction và Reconciliation.
2. **Character Control:**
- Sử dụng State Machine để quản lý trạng thái di chuyển (Idle, Move, Sprint, Jump, Dash).
- Camera Dynamics (Shake, FOV Kick) phải được xử lý mượt mà.
3. **Interactions:**
- Mọi vật thể có thể tương tác phải kế thừa từ `IInteractable` hoặc `BaseInteractable`.
4. **Formatting:**
- Luôn sử dụng PascalCase cho tên Method và Class.
- camelCase cho biến private/local.
## 🤖 Chỉ thị cho AI
- **Phản hồi:** Ngắn gọn, súc tích, đi thẳng vào vấn đề kỹ thuật.
- **An toàn:** Không bao giờ tự ý commit code trừ khi được yêu cầu rõ ràng.
- **Tự động hóa:** Luôn cập nhật `MEMORY.md` sau mỗi thay đổi lớn hoặc khi kết thúc phiên làm việc.

View File

@@ -17,6 +17,9 @@ EditorBuildSettings:
- enabled: 1 - enabled: 1
path: Assets/Scove/UIScaleTest.unity path: Assets/Scove/UIScaleTest.unity
guid: 9feda3fec581ecb4aa311e4a937c625a guid: 9feda3fec581ecb4aa311e4a937c625a
- enabled: 1
path: Assets/Scenes/Main Scene.unity
guid: f6f338855ad36644f8143c150efa4089
m_configObjects: m_configObjects:
com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3} com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3}
m_UseUCBPForAssetBundles: 0 m_UseUCBPForAssetBundles: 0