diff --git a/l2-unity-todo.txt b/l2-unity-todo.txt index dd5baac81..c29d90b53 100644 --- a/l2-unity-todo.txt +++ b/l2-unity-todo.txt @@ -1,7 +1,5 @@ TODO (priority from top to bottom) -further fixes in NPC html parsing (//buy command) -UI xml/css cleanup into separate CSS files + more reusable components game manager refacto into proper state machine FIX: equip fists in both hands @@ -20,6 +18,8 @@ Nature renderer for deco layer DONE +further fixes in NPC html parsing (//buy command) +UI xml/css cleanup into separate CSS files + more reusable components FIX: do not handle mouse inputs in UI when turning camera target name colors update inventory limit based on playerinfo packet diff --git a/l2-unity/Assets/Plugins/FMOD/src/RuntimeManager.cs.meta b/l2-unity/Assets/Plugins/FMOD/src/RuntimeManager.cs.meta index 4e923d82e..1dfc993f0 100644 --- a/l2-unity/Assets/Plugins/FMOD/src/RuntimeManager.cs.meta +++ b/l2-unity/Assets/Plugins/FMOD/src/RuntimeManager.cs.meta @@ -1,11 +1,10 @@ fileFormatVersion: 2 guid: 5e5fb8ce07f0ce84b9d1852869527ea5 -timeCreated: 1444628977 -licenseType: Free MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] - executionOrder: 100 + executionOrder: -5 icon: {instanceID: 0} userData: assetBundleName: diff --git a/l2-unity/Assets/Plugins/FMOD/src/StudioListener.cs.meta b/l2-unity/Assets/Plugins/FMOD/src/StudioListener.cs.meta index 73b729a2b..f23a46843 100644 --- a/l2-unity/Assets/Plugins/FMOD/src/StudioListener.cs.meta +++ b/l2-unity/Assets/Plugins/FMOD/src/StudioListener.cs.meta @@ -1,11 +1,10 @@ fileFormatVersion: 2 guid: 86c6556701af9e04380698b89f691b6e -timeCreated: 1449016511 -licenseType: Free MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] - executionOrder: 80 + executionOrder: -10 icon: {instanceID: 0} userData: assetBundleName: diff --git a/l2-unity/Assets/Plugins/Nature/Atmospheric Height Fog/Core/Runtime/HeightFogGlobal.cs.meta b/l2-unity/Assets/Plugins/Nature/Atmospheric Height Fog/Core/Runtime/HeightFogGlobal.cs.meta index f03d0673a..9d952ccf3 100644 --- a/l2-unity/Assets/Plugins/Nature/Atmospheric Height Fog/Core/Runtime/HeightFogGlobal.cs.meta +++ b/l2-unity/Assets/Plugins/Nature/Atmospheric Height Fog/Core/Runtime/HeightFogGlobal.cs.meta @@ -4,7 +4,7 @@ MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] - executionOrder: 100 + executionOrder: 0 icon: {fileID: 2800000, guid: 1ed6c69382334dd4e94337c8860e7116, type: 3} userData: assetBundleName: diff --git a/l2-unity/Assets/Resources/Data/Effects/skybox/L2Sky.mat b/l2-unity/Assets/Resources/Data/Effects/skybox/L2Sky.mat index 4cc2fe3d1..491703c02 100644 --- a/l2-unity/Assets/Resources/Data/Effects/skybox/L2Sky.mat +++ b/l2-unity/Assets/Resources/Data/Effects/skybox/L2Sky.mat @@ -50,8 +50,8 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _SunMoon: - m_Texture: {fileID: 2800000, guid: 87bfdbc0202b0e440b4b25a3824f15db, type: 3} - m_Scale: {x: 1.5, y: 1.5} + m_Texture: {fileID: 2800000, guid: b443728fc86061b4f8ecbe8a96c9d2ef, type: 3} + m_Scale: {x: 2.5, y: 2.5} m_Offset: {x: 0.5, y: 0.5} - unity_Lightmaps: m_Texture: {fileID: 0} @@ -70,13 +70,13 @@ Material: - _Cloud_Cutoff: 4.01 - _Cloud_Distance: 0.8 - _Clouds_Far_Tiling: 0.352 - - _Clouds_Opacity: 2.54 + - _Clouds_Opacity: 0.12 - _Clouds_Tiling: 0.12 - _GradientColor1Influence: 0.6 - _GradientColor2Influence: 0.5 - _HorizonCloudsRotationSpeed: -0.1 - _Horizon_Clouds_Height: 1.44 - - _Horizon_Clouds_Opacity: 1 + - _Horizon_Clouds_Opacity: 0.05 - _Horizon_Clouds_X_Tile: 1 - _Horizon_Clouds_Y_Tile: 3.17 - _QueueControl: 0 @@ -92,12 +92,12 @@ Material: - _Stars_Y_Tile: 1 - _SunMoonSize: 0.13 m_Colors: - - _GradientColor1: {r: 0, g: 0.3529412, b: 0.54901963, a: 1} + - _GradientColor1: {r: -0.003921569, g: -0.003921569, b: -0.007843138, a: -1} - _GradientColor2: {r: 0, g: 0, b: 0, a: 1} - _GradientColor3: {r: 6.1592746, g: 6.7682424, b: 7.37721, a: 1} - - _MainLightForward: {r: -0.0835492, g: -0.992995, b: -0.08354923, a: 0} - - _MainLightRight: {r: 0.7071067, g: 0, b: -0.7071068, a: 0} - - _MainLightUp: {r: 0.70215356, g: -0.11815645, b: 0.70215344, a: 0} + - _MainLightForward: {r: 0.6924627, g: -0.20246276, b: 0.6924625, a: 0} + - _MainLightRight: {r: 0.7071067, g: 0, b: -0.70710695, a: 0} + - _MainLightUp: {r: 0.14316282, g: 0.97928995, b: 0.14316279, a: 0} - _SunMoonColor: {r: 1, g: 1, b: 1, a: 0} m_BuildTextureStacks: [] m_AllowLocking: 1 diff --git a/l2-unity/Assets/Resources/Prefab/Game.prefab b/l2-unity/Assets/Resources/Prefab/Game.prefab index 4d8844955..7487281a1 100644 --- a/l2-unity/Assets/Resources/Prefab/Game.prefab +++ b/l2-unity/Assets/Resources/Prefab/Game.prefab @@ -9,10 +9,10 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 4644061901774829026} + - component: {fileID: 5806285974765348047} - component: {fileID: 842763773635486120} - component: {fileID: 2081572240581827940} - component: {fileID: 6227403751048920905} - - component: {fileID: 5806285974765348047} - component: {fileID: 3414367172090928233} - component: {fileID: 506747367762882996} - component: {fileID: 8274691919601176420} @@ -38,7 +38,7 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &842763773635486120 +--- !u!114 &5806285974765348047 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -47,14 +47,23 @@ MonoBehaviour: m_GameObject: {fileID: 6810262815525540192} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 021711eabd7d2494980c3047c33aee55, type: 3} + m_Script: {fileID: 11500000, guid: c81a49d02f1b9ae4fa6fc87875961bf1, type: 3} m_Name: m_EditorClassIdentifier: - _protocolVersion: 1 - _gameState: 0 - _autoLogin: 0 - _loadingCamera: {fileID: 0} ---- !u!114 &2081572240581827940 + _menuScene: Menu + _lobbyScene: l2_lobby + _gameScene: Game + _mapList: + - name: 17_25 + enabled: 1 + - name: 16_25 + enabled: 0 + - name: 17_24 + enabled: 0 + - name: 16_24 + enabled: 0 + _mapsToLoad: [] +--- !u!114 &842763773635486120 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -63,10 +72,17 @@ MonoBehaviour: m_GameObject: {fileID: 6810262815525540192} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 2424ac622c3549d479da2aa3fcaa2c2b, type: 3} + m_Script: {fileID: 11500000, guid: 021711eabd7d2494980c3047c33aee55, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!114 &6227403751048920905 + _enableLogs: 0 + _protocolVersion: 1 + _gameState: 0 + _autoLogin: 0 + _loadingCamera: {fileID: 0} + _loading: 0 + _currentState: 0 +--- !u!114 &2081572240581827940 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -75,10 +91,10 @@ MonoBehaviour: m_GameObject: {fileID: 6810262815525540192} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6c0b294c4f11da043a50af17e2d967fa, type: 3} + m_Script: {fileID: 11500000, guid: 2424ac622c3549d479da2aa3fcaa2c2b, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!114 &5806285974765348047 +--- !u!114 &6227403751048920905 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -87,22 +103,9 @@ MonoBehaviour: m_GameObject: {fileID: 6810262815525540192} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c81a49d02f1b9ae4fa6fc87875961bf1, type: 3} + m_Script: {fileID: 11500000, guid: 6c0b294c4f11da043a50af17e2d967fa, type: 3} m_Name: m_EditorClassIdentifier: - _menuScene: Menu - _lobbyScene: l2_lobby - _gameScene: Game - _mapList: - - name: 17_25 - enabled: 1 - - name: 16_25 - enabled: 0 - - name: 17_24 - enabled: 0 - - name: 16_24 - enabled: 0 - _mapsToLoad: [] --- !u!114 &3414367172090928233 MonoBehaviour: m_ObjectHideFlags: 0 @@ -140,6 +143,8 @@ MonoBehaviour: _collisionRadius: 0 _lhand: 0 _rhand: 0 + _serverNameColor: 0 + _serverTitleColor: 0 _race: 0 _sex: 0 _face: 0 @@ -153,17 +158,24 @@ MonoBehaviour: _playerStatus: _hp: 0 _mp: 0 + _dead: 0 _cp: 0 _pvpFlag: 0 _playerStats: _level: 0 - _speed: 0 - _scaledSpeed: 0 + _runSpeed: 0 + _moveSpeedMultiplier: 0 + _walkSpeed: 0 + _scaledRunSpeed: 0 + _scaledWalkSpeed: 0 + _attackSpeedMultiplier: 0 + _attackRange: 0 _pAtkSpd: 0 _mAtkSpd: 0 _maxHp: 0 _maxMp: 0 _maxCp: 0 + _karma: 0 _pAtk: 0 _mAtk: 0 _pEvasion: 0 @@ -176,22 +188,21 @@ MonoBehaviour: _pDef: 0 _shieldDef: 0 _exp: 0 - _maxExp: 0 + _expPercent: 0 _sp: 0 _currWeight: 0 _maxWeight: 0 - _attackRange: 0 _con: 0 _dex: 0 _str: 0 _wit: 0 _men: 0 _int: 0 - _karma: 0 _pvpKills: 0 _pkKills: 0 _isMage: 0 _classId: 0 + _baseClassId: 0 _exp: 0 _sp: 0 _expPercent: 0 diff --git a/l2-unity/Assets/Resources/Scenes/Game.unity b/l2-unity/Assets/Resources/Scenes/Game.unity index c59b7c42f..48b812170 100644 --- a/l2-unity/Assets/Resources/Scenes/Game.unity +++ b/l2-unity/Assets/Resources/Scenes/Game.unity @@ -955,6 +955,76 @@ Transform: - {fileID: 1093349308} m_Father: {fileID: 760118614} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!21 &731820638 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Override + m_Shader: {fileID: 4800000, guid: a3a3bc8785681554d9558e2ea68f100e, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - _AdvancedCat: 1 + - _Banner: 1 + - _DirectionalCat: 1 + - _DirectionalFalloff: 2 + - _DirectionalIntensity: 1 + - _FarDistanceHeight: 0 + - _FarDistanceOffset: 0 + - _FogAxisMode: 1 + - _FogCameraMode: 0 + - _FogCat: 1 + - _FogColorDuo: 1 + - _FogDistanceEnd: 100 + - _FogDistanceFalloff: 2 + - _FogDistanceStart: 0 + - _FogHeightEnd: 100 + - _FogHeightFalloff: 2 + - _FogHeightStart: 0 + - _FogIntensity: 1 + - _FogLayersMode: 0 + - _IsHeightFogPreset: 1 + - _IsHeightFogShader: 1 + - _JitterIntensity: 1 + - _NoiseCat: 1 + - _NoiseDistanceEnd: 50 + - _NoiseIntensity: 1 + - _NoiseMax: 1 + - _NoiseMin: 0 + - _NoiseModeBlend: 1 + - _NoiseScale: 30 + - _SkyboxCat: 1 + - _SkyboxFogBottom: 0 + - _SkyboxFogFalloff: 1 + - _SkyboxFogFill: 1 + - _SkyboxFogHeight: 1 + - _SkyboxFogIntensity: 1 + - _SkyboxFogOffset: 0 + m_Colors: + - _DirectionalColor: {r: 1, g: 0.7793103, b: 0.5, a: 1} + - _DirectionalDir: {r: 0, g: 0, b: 0, a: 0} + - _FogAxisOption: {r: 0, g: 0, b: 0, a: 0} + - _FogColorEnd: {r: 0.8862745, g: 1.443137, b: 2, a: 1} + - _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1} + - _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &734869360 Material: serializedVersion: 8 @@ -1875,19 +1945,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7988497584237515198, guid: 824ee6870a432f9439e35ee4e771a1f5, type: 3} propertyPath: m_LocalRotation.w - value: 0.91915315 + value: 0.9191212 objectReference: {fileID: 0} - target: {fileID: 7988497584237515198, guid: 824ee6870a432f9439e35ee4e771a1f5, type: 3} propertyPath: m_LocalRotation.x - value: 0.093332164 + value: 0.09364617 objectReference: {fileID: 0} - target: {fileID: 7988497584237515198, guid: 824ee6870a432f9439e35ee4e771a1f5, type: 3} propertyPath: m_LocalRotation.y - value: 0.38072574 + value: 0.3807125 objectReference: {fileID: 0} - target: {fileID: 7988497584237515198, guid: 824ee6870a432f9439e35ee4e771a1f5, type: 3} propertyPath: m_LocalRotation.z - value: -0.03865945 + value: -0.03878952 objectReference: {fileID: 0} - target: {fileID: 7988497584237515198, guid: 824ee6870a432f9439e35ee4e771a1f5, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -1911,7 +1981,7 @@ Transform: m_CorrespondingSourceObject: {fileID: 7988497584237515198, guid: 824ee6870a432f9439e35ee4e771a1f5, type: 3} m_PrefabInstance: {fileID: 1093349307} m_PrefabAsset: {fileID: 0} ---- !u!21 &1095865997 +--- !u!21 &1153295999 Material: serializedVersion: 8 m_ObjectHideFlags: 0 @@ -3445,76 +3515,6 @@ Material: - _SpecColor: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] m_AllowLocking: 1 ---- !u!21 &2133619757 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Override - m_Shader: {fileID: 4800000, guid: a3a3bc8785681554d9558e2ea68f100e, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: [] - m_Ints: [] - m_Floats: - - _AdvancedCat: 1 - - _Banner: 1 - - _DirectionalCat: 1 - - _DirectionalFalloff: 2 - - _DirectionalIntensity: 1 - - _FarDistanceHeight: 0 - - _FarDistanceOffset: 0 - - _FogAxisMode: 1 - - _FogCameraMode: 0 - - _FogCat: 1 - - _FogColorDuo: 1 - - _FogDistanceEnd: 100 - - _FogDistanceFalloff: 2 - - _FogDistanceStart: 0 - - _FogHeightEnd: 100 - - _FogHeightFalloff: 2 - - _FogHeightStart: 0 - - _FogIntensity: 1 - - _FogLayersMode: 0 - - _IsHeightFogPreset: 1 - - _IsHeightFogShader: 1 - - _JitterIntensity: 1 - - _NoiseCat: 1 - - _NoiseDistanceEnd: 50 - - _NoiseIntensity: 1 - - _NoiseMax: 1 - - _NoiseMin: 0 - - _NoiseModeBlend: 1 - - _NoiseScale: 30 - - _SkyboxCat: 1 - - _SkyboxFogBottom: 0 - - _SkyboxFogFalloff: 1 - - _SkyboxFogFill: 1 - - _SkyboxFogHeight: 1 - - _SkyboxFogIntensity: 1 - - _SkyboxFogOffset: 0 - m_Colors: - - _DirectionalColor: {r: 1, g: 0.7793103, b: 0.5, a: 1} - - _DirectionalDir: {r: 0, g: 0, b: 0, a: 0} - - _FogAxisOption: {r: 0, g: 0, b: 0, a: 0} - - _FogColorEnd: {r: 0.8862745, g: 1.443137, b: 2, a: 1} - - _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1} - - _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0} - m_BuildTextureStacks: [] - m_AllowLocking: 1 --- !u!1001 &38199690736628172 PrefabInstance: m_ObjectHideFlags: 0 @@ -3688,6 +3688,10 @@ PrefabInstance: propertyPath: m_Name value: UI objectReference: {fileID: 0} + - target: {fileID: 9166659596877626494, guid: d5d2a11e1a77f80418a7d8b1ec2abd25, type: 3} + propertyPath: _totalWindowsToLoad + value: 12 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] diff --git a/l2-unity/Assets/Resources/Scenes/Menu.unity b/l2-unity/Assets/Resources/Scenes/Menu.unity index 58f123acd..e14d61a32 100644 --- a/l2-unity/Assets/Resources/Scenes/Menu.unity +++ b/l2-unity/Assets/Resources/Scenes/Menu.unity @@ -254,42 +254,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 4877871055344985101, guid: 5ce2b4f594de97e49bdb71fea5235fc4, type: 3} m_PrefabInstance: {fileID: 906917057694660954} m_PrefabAsset: {fileID: 0} ---- !u!21 &409207257 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Height Fog Global - m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: 3000 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: [] - m_Ints: [] - m_Floats: - - _AdvancedCat: 1 - - _Banner: 1 - - _DirectionalCat: 1 - - _FogCat: 1 - - _HeightFogGlobal: 1 - - _IsHeightFogShader: 1 - - _NoiseCat: 1 - - _SkyboxCat: 1 - m_Colors: [] - m_BuildTextureStacks: [] - m_AllowLocking: 1 --- !u!1 &413261805 GameObject: m_ObjectHideFlags: 0 @@ -416,6 +380,10 @@ PrefabInstance: propertyPath: _autoLogin value: 0 objectReference: {fileID: 0} + - target: {fileID: 842763773635486120, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3} + propertyPath: _enableLogs + value: 1 + objectReference: {fileID: 0} - target: {fileID: 842763773635486120, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3} propertyPath: _protocolVersion value: 740 @@ -529,6 +497,42 @@ Transform: m_CorrespondingSourceObject: {fileID: 8789962366350326871, guid: 8da1883c4b37daf4b9a43afc824ae22e, type: 3} m_PrefabInstance: {fileID: 493211367756249381} m_PrefabAsset: {fileID: 0} +--- !u!21 &748322558 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Height Fog Global + m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - _AdvancedCat: 1 + - _Banner: 1 + - _DirectionalCat: 1 + - _FogCat: 1 + - _HeightFogGlobal: 1 + - _IsHeightFogShader: 1 + - _NoiseCat: 1 + - _SkyboxCat: 1 + m_Colors: [] + m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &778444643 Material: serializedVersion: 8 @@ -604,6 +608,76 @@ Transform: m_CorrespondingSourceObject: {fileID: 3693000308783194215, guid: 685b767ead3bf3a4bae0091e2d9a065c, type: 3} m_PrefabInstance: {fileID: 7652732757659369692} m_PrefabAsset: {fileID: 0} +--- !u!21 &796204851 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Override + m_Shader: {fileID: 4800000, guid: a3a3bc8785681554d9558e2ea68f100e, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: [] + m_Ints: [] + m_Floats: + - _AdvancedCat: 1 + - _Banner: 1 + - _DirectionalCat: 1 + - _DirectionalFalloff: 2 + - _DirectionalIntensity: 1 + - _FarDistanceHeight: 0 + - _FarDistanceOffset: 0 + - _FogAxisMode: 1 + - _FogCameraMode: 0 + - _FogCat: 1 + - _FogColorDuo: 1 + - _FogDistanceEnd: 100 + - _FogDistanceFalloff: 2 + - _FogDistanceStart: 0 + - _FogHeightEnd: 100 + - _FogHeightFalloff: 2 + - _FogHeightStart: 0 + - _FogIntensity: 1 + - _FogLayersMode: 0 + - _IsHeightFogPreset: 1 + - _IsHeightFogShader: 1 + - _JitterIntensity: 1 + - _NoiseCat: 1 + - _NoiseDistanceEnd: 50 + - _NoiseIntensity: 1 + - _NoiseMax: 1 + - _NoiseMin: 0 + - _NoiseModeBlend: 1 + - _NoiseScale: 30 + - _SkyboxCat: 1 + - _SkyboxFogBottom: 0 + - _SkyboxFogFalloff: 1 + - _SkyboxFogFill: 1 + - _SkyboxFogHeight: 1 + - _SkyboxFogIntensity: 1 + - _SkyboxFogOffset: 0 + m_Colors: + - _DirectionalColor: {r: 1, g: 0.7793103, b: 0.5, a: 1} + - _DirectionalDir: {r: 0, g: 0, b: 0, a: 0} + - _FogAxisOption: {r: 0, g: 0, b: 0, a: 0} + - _FogColorEnd: {r: 0.8862745, g: 1.443137, b: 2, a: 1} + - _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1} + - _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!4 &797956918 stripped Transform: m_CorrespondingSourceObject: {fileID: 7967364512120886253, guid: 34c431bb2b760d54483c4f5f4d848fd7, type: 3} @@ -692,6 +766,8 @@ MonoBehaviour: m_EditorClassIdentifier: _uiLoaded: 0 _mouseOverUI: 0 + _windowsLoaded: 0 + _totalWindowsToLoad: 5 --- !u!114 &803395391 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1071,7 +1147,7 @@ PrefabInstance: - target: {fileID: 14083907825353274, guid: 8742fc349ac4f354d9cfb98ebb79a0e3, type: 3} propertyPath: 'm_Materials.Array.data[0]' value: - objectReference: {fileID: 409207257} + objectReference: {fileID: 1157035679} - target: {fileID: 2134954596300280144, guid: 8742fc349ac4f354d9cfb98ebb79a0e3, type: 3} propertyPath: m_Name value: Height Fog Global @@ -1201,25 +1277,15 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 8742fc349ac4f354d9cfb98ebb79a0e3, type: 3} ---- !u!4 &1161417067 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 6795830854710114440, guid: d781d4f4a85c3514686fe8c13990bef2, type: 3} - m_PrefabInstance: {fileID: 3003231420872201999} - m_PrefabAsset: {fileID: 0} ---- !u!4 &1171911743 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 2018473782570864008, guid: c62264f2126e2b54bb9750d4e55a9881, type: 3} - m_PrefabInstance: {fileID: 818515487845165693} - m_PrefabAsset: {fileID: 0} ---- !u!21 &1199505180 +--- !u!21 &1157035679 Material: serializedVersion: 8 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: Override - m_Shader: {fileID: 4800000, guid: a3a3bc8785681554d9558e2ea68f100e, type: 3} + m_Name: Height Fog Global + m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] @@ -1227,7 +1293,7 @@ Material: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 + m_CustomRenderQueue: 3000 stringTagMap: {} disabledShaderPasses: [] m_LockedProperties: @@ -1239,48 +1305,24 @@ Material: - _AdvancedCat: 1 - _Banner: 1 - _DirectionalCat: 1 - - _DirectionalFalloff: 2 - - _DirectionalIntensity: 1 - - _FarDistanceHeight: 0 - - _FarDistanceOffset: 0 - - _FogAxisMode: 1 - - _FogCameraMode: 0 - _FogCat: 1 - - _FogColorDuo: 1 - - _FogDistanceEnd: 100 - - _FogDistanceFalloff: 2 - - _FogDistanceStart: 0 - - _FogHeightEnd: 100 - - _FogHeightFalloff: 2 - - _FogHeightStart: 0 - - _FogIntensity: 1 - - _FogLayersMode: 0 - - _IsHeightFogPreset: 1 + - _HeightFogGlobal: 1 - _IsHeightFogShader: 1 - - _JitterIntensity: 1 - _NoiseCat: 1 - - _NoiseDistanceEnd: 50 - - _NoiseIntensity: 1 - - _NoiseMax: 1 - - _NoiseMin: 0 - - _NoiseModeBlend: 1 - - _NoiseScale: 30 - _SkyboxCat: 1 - - _SkyboxFogBottom: 0 - - _SkyboxFogFalloff: 1 - - _SkyboxFogFill: 1 - - _SkyboxFogHeight: 1 - - _SkyboxFogIntensity: 1 - - _SkyboxFogOffset: 0 - m_Colors: - - _DirectionalColor: {r: 1, g: 0.7793103, b: 0.5, a: 1} - - _DirectionalDir: {r: 0, g: 0, b: 0, a: 0} - - _FogAxisOption: {r: 0, g: 0, b: 0, a: 0} - - _FogColorEnd: {r: 0.8862745, g: 1.443137, b: 2, a: 1} - - _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1} - - _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0} + m_Colors: [] m_BuildTextureStacks: [] m_AllowLocking: 1 +--- !u!4 &1161417067 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6795830854710114440, guid: d781d4f4a85c3514686fe8c13990bef2, type: 3} + m_PrefabInstance: {fileID: 3003231420872201999} + m_PrefabAsset: {fileID: 0} +--- !u!4 &1171911743 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2018473782570864008, guid: c62264f2126e2b54bb9750d4e55a9881, type: 3} + m_PrefabInstance: {fileID: 818515487845165693} + m_PrefabAsset: {fileID: 0} --- !u!1 &1212301096 GameObject: m_ObjectHideFlags: 0 @@ -1760,42 +1802,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 6494277511981815224, guid: 9e26ece1c355abd45835edac72dee7dd, type: 3} m_PrefabInstance: {fileID: 2633802724653778086} m_PrefabAsset: {fileID: 0} ---- !u!21 &1895409954 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Height Fog Global - m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: 3000 - stringTagMap: {} - disabledShaderPasses: [] - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: [] - m_Ints: [] - m_Floats: - - _AdvancedCat: 1 - - _Banner: 1 - - _DirectionalCat: 1 - - _FogCat: 1 - - _HeightFogGlobal: 1 - - _IsHeightFogShader: 1 - - _NoiseCat: 1 - - _SkyboxCat: 1 - m_Colors: [] - m_BuildTextureStacks: [] - m_AllowLocking: 1 --- !u!4 &1935287752 stripped Transform: m_CorrespondingSourceObject: {fileID: 3464943749389224790, guid: 384b25ed7e96a7849bad7cdb391de0c7, type: 3} @@ -2116,7 +2122,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2808076256991555282, guid: babd2d27777f4774581e9efa23af7856, type: 3} propertyPath: _logReceivedPackets - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2808076256991555282, guid: babd2d27777f4774581e9efa23af7856, type: 3} propertyPath: _positionSyncThreshold diff --git a/l2-unity/Assets/Scripts/Camera/LoginCameraManager.cs b/l2-unity/Assets/Scripts/Camera/LoginCameraManager.cs index 7f744a623..77a65a1a9 100644 --- a/l2-unity/Assets/Scripts/Camera/LoginCameraManager.cs +++ b/l2-unity/Assets/Scripts/Camera/LoginCameraManager.cs @@ -21,10 +21,7 @@ void Awake() { Destroy(this); } - } - private void Start() - { if (!_initialized) { Initialize(); @@ -45,7 +42,9 @@ private void Initialize() DisableCameras(); - GameManager.Instance.OnLoginCamerasInitialized(); + // GameManager.Instance.OnLoginCamerasInitialized(); + + // GameManager.Instance.NotifyEvent(GameEvent.LOADING_COMPLETE); } public Camera SelectClassCamera(string race, string charClass) diff --git a/l2-unity/Assets/Scripts/Game/Manager/GameManager.cs b/l2-unity/Assets/Scripts/Game/Manager/GameManager.cs deleted file mode 100644 index 9ccf21e23..000000000 --- a/l2-unity/Assets/Scripts/Game/Manager/GameManager.cs +++ /dev/null @@ -1,326 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using static CharSelectedPacket; -using static ServerListPacket; - -public class GameManager : MonoBehaviour -{ - // TODO: SWITCH TO EVENT HANDLER AND STATE MACHINE - // TODO: SWITCH TO EVENT HANDLER AND STATE MACHINE - // TODO: SWITCH TO EVENT HANDLER AND STATE MACHINE - // TODO: SWITCH TO EVENT HANDLER AND STATE MACHINE - // TODO: SWITCH TO EVENT HANDLER AND STATE MACHINE - // TODO: SWITCH TO EVENT HANDLER AND STATE MACHINE - // TODO: SWITCH TO EVENT HANDLER AND STATE MACHINE - [SerializeField] private int _protocolVersion = 740; - [SerializeField] private GameState _gameState = GameState.LOGIN_SCREEN; - private bool _gameReady = false; - [SerializeField] private bool _autoLogin = false; - [SerializeField] private Camera _loadingCamera; - [SerializeField] private bool _loading; - - public bool AutoLogin { get { return _autoLogin; } } - - public GameState GameState - { - get { return _gameState; } - set - { - _gameState = value; - Debug.Log($"Game state is now {_gameState}."); - } - } - - public bool GameReady { get { return _gameReady; } set { _gameReady = value; } } - public int ProtocolVersion { get { return _protocolVersion; } } - - private static GameManager _instance; - public static GameManager Instance { get { return _instance; } } - - void Awake() - { - if (_instance == null) - { - _instance = this; - } - else if (_instance != this) - { - Destroy(this); - } - - GameObject camObject = GameObject.Find("LoadingCamera"); - if (camObject == null) - { - Debug.LogError("Can't find loading camera"); - return; - } - - camObject.TryGetComponent(out _loadingCamera); - - StartLoading(); - } - - private void Start() - { - LoadTables(); - SceneLoader.Instance.LoadMenu(); - } - - private void LoadTables() - { - SkillSoundgrpTable.Instance.Initialize(); - SkillTable.Instance.Initialize(); - ItemTable.Instance.Initialize(); - ItemNameTable.Instance.Initialize(); - ItemStatDataTable.Instance.Initialize(); - ArmorgrpTable.Instance.Initialize(); - EtcItemgrpTable.Instance.Initialize(); - WeapongrpTable.Instance.Initialize(); - NpcgrpTable.Instance.Initialize(); - NpcNameTable.Instance.Initialize(); - ActionNameTable.Instance.Initialize(); - SysStringTable.Instance.Initialize(); - SkillNameTable.Instance.Initialize(); - SkillgrpTable.Instance.Initialize(); - LogongrpTable.Instance.Initialize(); - SystemMessageTable.Instance.Initialize(); - ChargrpTable.Instance.Initialize(); - - // Caching - ItemTable.Instance.CacheItems(); - SkillTable.Instance.CacheSkills(); - ModelTable.Instance.Initialize(); - SkillEffectTable.Instance.Initialize(); - ParticleEffectTable.Instance.Initialize(); - IconTable.Instance.Initialize(); - KeyImageTable.Instance.Initialize(); - - // Memory cleanup - ArmorgrpTable.Instance.ClearTable(); - EtcItemgrpTable.Instance.ClearTable(); - ItemNameTable.Instance.ClearTable(); - SkillgrpTable.Instance.ClearTable(); - SkillNameTable.Instance.ClearTable(); - } - - public void OnWorldSceneLoaded() - { - Debug.LogWarning("OnWorldSceneLoaded"); - GameObject.Destroy(L2LoginUI.Instance.gameObject); - - PlayerInfo playerInfo = GameClient.Instance.PlayerInfo; - - WorldClock.Instance.SynchronizeClock(playerInfo.CurrentGameTime); - - WorldSpawner.Instance.OnReceivePlayerInfo(playerInfo.Identity, playerInfo.Status, playerInfo.Stats, playerInfo.Appearance, playerInfo.EntityActionInfo); - - PlayerStateMachine.Instance.enabled = true; - - GameClient.Instance.ClientPacketHandler.SendLoadWorld(); - } - - public void OnPlayerInfoReceive() - { - // Add a small delay to avoid visual bugs - if (_loading) - { - StartCoroutine(StopLoading()); - } - } - - public void OnLoginServerConnected() - { - GameState = GameState.LOGIN_CONNECTED; - } - - public void OnLoginServerAuthAllowed() - { - GameState = GameState.READING_LICENSE; - - L2LoginUI.Instance.ShowLicenseWindow(); - } - - public void OnLoginServerPlayOk() - { - GameState = GameState.READY_TO_CONNECT; - } - - public void OnConnectingToGameServer() - { - GameState = GameState.CONNECTING_TO_GAMESERVER; - } - - public void OnReceivedServerList(byte lastServer, List serverData, Dictionary charsOnServers) - { - GameState = GameState.SERVER_LIST; - - L2LoginUI.Instance.ShowServerSelectWindow(); - - ServerSelectWindow.Instance.UpdateServerList(lastServer, serverData, charsOnServers); - } - - public void OnAuthAllowed() - { - GameState = GameState.CHAR_SELECT; - - SwitchToCharSelect(); - - L2LoginUI.Instance.ShowCharSelectWindow(); - } - - public void OnCharacterSelect() - { - GameState = GameState.IN_GAME; - - StartLoading(); - SceneLoader.Instance.LoadGame(); - } - - public void OnCreateUser() - { - GameState = GameState.CHAR_CREATION; - - LoginCameraManager.Instance.SwitchCamera("Login"); - - L2LoginUI.Instance.ShowCharCreationWindow(); - } - - public void OnWorldLoading() - { - MusicManager.Instance.Clear(); - StartLoading(); - } - - public void OnRelogin() - { - GameState = GameState.LOGIN_SCREEN; - - LoginCameraManager.Instance.SwitchCamera("Login"); - - L2LoginUI.Instance.ShowLoginWindow(); - } - - public void OnDisconnect() - { - if (GameState > GameState.CHAR_CREATION) - { - MusicManager.Instance.Clear(); - SceneLoader.Instance.LoadMenu(); - } - else if (GameState > GameState.LOGIN_SCREEN && !GameClient.Instance.IsConnected && !LoginClient.Instance.IsConnected) - { - OnRelogin(); - } - } - - public void OnGameserverSelected() - { - Debug.Log("Gameserver selected, connecting..."); - - //GameClient.Instance.Connect(); - } - - public void OnStartingGame() - { - Debug.Log("On Starting game"); - } - - public void OnGameLaunched() - { - Debug.Log("On game launched"); - - if (GameState == GameState.RESTARTING) - { - GameState = GameState.CHAR_SELECT; - L2LoginUI.Instance.ShowCharSelectWindow(); - } - - StopLoading(); - PawnCreator.Instance.SpawnAllPawns(); - } - - internal void OnCharSelectAllowed() - { - if (GameState > GameState.IN_GAME) - { - MusicManager.Instance.Clear(); - SceneLoader.Instance.LoadMenu(); - StartLoading(); - } - } - - public void OnLoginCamerasInitialized() - { - if (GameState == GameState.CHAR_SELECT) - { - SwitchToCharSelect(); - } - else - { - LoginCameraManager.Instance.SwitchCamera("Login"); - } - } - - public void SwitchToCharSelect() - { - CharSelectWindow.Instance.SetCharacterList(CharacterSelector.Instance.Characters); - - CharacterSelector.Instance.ApplyCharacterList(); - CharacterSelector.Instance.SelectDefaultCharacter(); - - CharSelectWindow.Instance.SelectSlot(CharacterSelector.Instance.SelectedSlot); - - LoginCameraManager.Instance.SwitchCamera("CharSelect"); - } - - public void OnCharCreateOk() - { - SwitchToCharSelect(); - } - - public void OnLoginUILoaded() - { - if (GameState == GameState.RESTARTING) - { - LoginWindow.Instance.HideWindow(); - } - else - { - LoginWindow.Instance.ShowLogo(); - } - } - - public void StartLoading() - { - _loading = true; - - _loadingCamera.enabled = true; - if (L2GameUI.Instance != null) - { - L2GameUI.Instance.StartLoading(); - } - if (L2LoginUI.Instance != null) - { - L2LoginUI.Instance.StartLoading(); - } - } - - public IEnumerator StopLoading() - { - yield return new WaitForSeconds(0.15f); - - _loading = false; - - _loadingCamera.enabled = false; - if (L2GameUI.Instance != null) - { - L2GameUI.Instance.StopLoading(); - } - if (L2LoginUI.Instance != null) - { - L2LoginUI.Instance.StopLoading(); - } - } -} diff --git a/l2-unity/Assets/Scripts/Game/Manager/GameState.cs b/l2-unity/Assets/Scripts/Game/Manager/GameState.cs deleted file mode 100644 index 6b2fec2ee..000000000 --- a/l2-unity/Assets/Scripts/Game/Manager/GameState.cs +++ /dev/null @@ -1,15 +0,0 @@ -public enum GameState : byte -{ - LOGIN_SCREEN = 0, - LOGIN_CONNECTED = 1, - READING_LICENSE = 2, - SERVER_LIST = 3, - READY_TO_CONNECT = 4, - CONNECTING_TO_GAMESERVER = 5, - GAMESERVER_CONNECTED = 6, - GAMESERVER_AUTHED = 7, - CHAR_SELECT = 8, - CHAR_CREATION = 9, - IN_GAME = 10, - RESTARTING = 11 -} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/SceneLoader.cs b/l2-unity/Assets/Scripts/Game/Manager/SceneLoader.cs index c5da20539..5c4c9caa9 100644 --- a/l2-unity/Assets/Scripts/Game/Manager/SceneLoader.cs +++ b/l2-unity/Assets/Scripts/Game/Manager/SceneLoader.cs @@ -50,14 +50,15 @@ private void FillMapsToLoadList() public void LoadMenu() { - GameManager.Instance.OnStartingGame(); + // GameManager.Instance.OnStartingGame(); SwitchScene(_menuScene, (AsyncOperation o) => { - GameManager.Instance.StartLoading(); + GameManager.Instance.NotifyEvent(GameEvent.LOADING_STARTED); LoadScene(_lobbyScene, (AsyncOperation operation) => { - GameManager.Instance.OnGameLaunched(); + // -> Loading complete in UI script to avoid null references + GameManager.Instance.NotifyEvent(GameEvent.WORLD_LOADED); }); }); } @@ -67,7 +68,8 @@ public void LoadGame() _totalLoadedScenes = 0; SwitchScene(_gameScene, ((AsyncOperation o) => { - GameManager.Instance.OnWorldLoading(); + GameManager.Instance.NotifyEvent(GameEvent.LOADING_STARTED); + // GameManager.Instance.OnWorldLoading(); for (int i = 0; i < _mapsToLoad.Count; i++) { var map = _mapsToLoad[i]; @@ -146,7 +148,7 @@ IEnumerator StartGame() if (World.Instance != null && !World.Instance.OfflineMode) { - GameManager.Instance.OnWorldSceneLoaded(); + GameManager.Instance.NotifyEvent(GameEvent.LOADING_COMPLETE); } } } diff --git a/l2-unity/Assets/Scripts/Game/Manager/SceneLoader.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/SceneLoader.cs.meta index 07a9ba7bb..cb423f163 100644 --- a/l2-unity/Assets/Scripts/Game/Manager/SceneLoader.cs.meta +++ b/l2-unity/Assets/Scripts/Game/Manager/SceneLoader.cs.meta @@ -4,7 +4,7 @@ MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] - executionOrder: 0 + executionOrder: 3 icon: {instanceID: 0} userData: assetBundleName: diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine.meta new file mode 100644 index 000000000..1b7ba824e --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 54dbfefc4131c06439e282d3cdf02058 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameEvent.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameEvent.cs new file mode 100644 index 000000000..999259d37 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameEvent.cs @@ -0,0 +1,18 @@ +public enum GameEvent +{ + CONNECTION_ALLOWED, + AUTH_ALLOWED, + SERVER_LIST_RECEIVED, + LOGIN_DISCONNECTED, + GAME_DISCONNECTED, + CHAR_CREATED, + CHAR_SELECTED, + CHAR_LOADED, + RETURN, + LOADING_STARTED, + UI_LOADED, + WORLD_LOADED, + LOADING_COMPLETE, + PLAY_ALLOWED, + RESTART_ALLOWED, +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameEvent.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameEvent.cs.meta new file mode 100644 index 000000000..7283d11f7 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameEvent.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 85dc83c2fae935e4ba5a598dfa8464a0 \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameManager.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameManager.cs new file mode 100644 index 000000000..a213e884e --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameManager.cs @@ -0,0 +1,179 @@ +using System; +using System.Collections; +using UnityEngine; + +public class GameManager : MonoBehaviour +{ + [SerializeField] private bool _enableLogs; + [SerializeField] private int _protocolVersion = 740; + [SerializeField] private bool _autoLogin = false; + [SerializeField] private Camera _loadingCamera; + [SerializeField] private bool _loading; + public bool Loading { get { return _loading; } } + public int ProtocolVersion { get { return _protocolVersion; } } + public bool AutoLogin { get { return _autoLogin; } } + + private static GameManager _instance; + public static GameManager Instance => _instance; + + [SerializeField] private GameState _currentState; + public GameState State { get { return _currentState; } } + public bool LogsEnabled { get { return _enableLogs; } } + + private GameStateBase _stateInstance; + + private void Awake() + { + if (_instance == null) + { + _instance = this; + } + else + { + Destroy(this); + return; + } + + InitializeState(); + + InitializeLoading(); + + ChangeState(GameState.STARTING_GAME); + } + + private void InitializeLoading() + { + GameObject camObject = GameObject.Find("LoadingCamera"); + + if (camObject == null) + { + Debug.LogError("Can't find loading camera"); + return; + } + + camObject.TryGetComponent(out _loadingCamera); + } + + public void StartLoading() + { + _loading = true; + + _loadingCamera.enabled = true; + if (L2GameUI.Instance != null) + { + L2GameUI.Instance.StartLoading(); + } + if (L2LoginUI.Instance != null) + { + L2LoginUI.Instance.StartLoading(); + } + } + + public void StopLoading() + { + StartCoroutine(StopLoadingCoroutine()); + } + + public IEnumerator StopLoadingCoroutine() + { + Debug.LogWarning("STOP LOADING!"); + yield return new WaitForSeconds(0.15f); + + _loading = false; + + _loadingCamera.enabled = false; + if (L2GameUI.Instance != null) + { + L2GameUI.Instance.StopLoading(); + } + if (L2LoginUI.Instance != null) + { + L2LoginUI.Instance.StopLoading(); + } + } + + public void LoadTables() + { + SkillSoundgrpTable.Instance.Initialize(); + SkillTable.Instance.Initialize(); + ItemTable.Instance.Initialize(); + ItemNameTable.Instance.Initialize(); + ItemStatDataTable.Instance.Initialize(); + ArmorgrpTable.Instance.Initialize(); + EtcItemgrpTable.Instance.Initialize(); + WeapongrpTable.Instance.Initialize(); + NpcgrpTable.Instance.Initialize(); + NpcNameTable.Instance.Initialize(); + ActionNameTable.Instance.Initialize(); + SysStringTable.Instance.Initialize(); + SkillNameTable.Instance.Initialize(); + SkillgrpTable.Instance.Initialize(); + LogongrpTable.Instance.Initialize(); + SystemMessageTable.Instance.Initialize(); + ChargrpTable.Instance.Initialize(); + + // Caching + ItemTable.Instance.CacheItems(); + SkillTable.Instance.CacheSkills(); + ModelTable.Instance.Initialize(); + SkillEffectTable.Instance.Initialize(); + ParticleEffectTable.Instance.Initialize(); + IconTable.Instance.Initialize(); + KeyImageTable.Instance.Initialize(); + + // Memory cleanup + ArmorgrpTable.Instance.ClearTable(); + EtcItemgrpTable.Instance.ClearTable(); + ItemNameTable.Instance.ClearTable(); + SkillgrpTable.Instance.ClearTable(); + SkillNameTable.Instance.ClearTable(); + } + + private void Update() + { + _stateInstance?.Update(); + } + + public void ChangeState(GameState newState) + { + ChangeState(newState, null); + } + + public void ChangeState(GameState newState, object arg0) + { + if (_enableLogs) Debug.Log("[GameStateMachine][STATE] " + newState); + _stateInstance?.Exit(); + _currentState = newState; + InitializeState(); + _stateInstance?.Enter(arg0); + } + + private void InitializeState() + { + _stateInstance = _currentState switch + { + GameState.STARTING_GAME => new StartingGameState(this), + GameState.LOGIN_SCREEN => new LoginState(this), + GameState.LOGIN_CONNECTED => new LoginConnectedState(this), + GameState.LOGIN_AUTHED => new LoginAuthedState(this), + GameState.CHAR_SELECT => new CharSelectionState(this), + GameState.CHAR_CREATION => new CharCreationState(this), + GameState.ENTERING_WORLD => new EnteringWorldState(this), + GameState.IN_GAME => new InGameState(this), + GameState.RESTARTING => new RestartingState(this), + GameState.DISONNECTING => new DisconnectingState(this), + _ => throw new ArgumentException("Invalid state") + }; + } + + public void NotifyEvent(GameEvent evt) + { + NotifyEvent(evt, null); + } + + public void NotifyEvent(GameEvent evt, object arg0) + { + if (_enableLogs) Debug.Log("[GameStateMachine][EVENT] " + evt); + _stateInstance?.HandleEvent(evt, arg0); + } +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/GameManager.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameManager.cs.meta similarity index 90% rename from l2-unity/Assets/Scripts/Game/Manager/GameManager.cs.meta rename to l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameManager.cs.meta index 17567b4db..01bbde392 100644 --- a/l2-unity/Assets/Scripts/Game/Manager/GameManager.cs.meta +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameManager.cs.meta @@ -4,7 +4,7 @@ MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] - executionOrder: -1100 + executionOrder: 5 icon: {instanceID: 0} userData: assetBundleName: diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameState.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameState.cs new file mode 100644 index 000000000..b49792239 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameState.cs @@ -0,0 +1,19 @@ +public enum GameState : byte +{ + STARTING_GAME, + ENTERING_WORLD, + LOGIN_SCREEN, + LOGIN_CONNECTED, + LOGIN_AUTHED, + READING_LICENSE, + SERVER_LIST, + READY_TO_CONNECT, + CONNECTING_TO_GAMESERVER, + GAMESERVER_CONNECTED, + GAMESERVER_AUTHED, + CHAR_SELECT, + CHAR_CREATION, + IN_GAME, + RESTARTING, + DISONNECTING +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/GameState.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameState.cs.meta similarity index 100% rename from l2-unity/Assets/Scripts/Game/Manager/GameState.cs.meta rename to l2-unity/Assets/Scripts/Game/Manager/StateMachine/GameState.cs.meta diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State.meta new file mode 100644 index 000000000..83793a569 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 50c1ea4251b972f4fb461ffce9978ee6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/CharCreationState.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/CharCreationState.cs new file mode 100644 index 000000000..37d390a06 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/CharCreationState.cs @@ -0,0 +1,40 @@ +using UnityEngine; + +public class CharCreationState : GameStateBase +{ + public CharCreationState(GameManager stateMachine) : base(stateMachine) { } + + public override void Enter(object arg0) + { + L2LoginUI.Instance.ShowCharCreationWindow(); + + LoginCameraManager.Instance.SwitchCamera("Login"); + } + + public override void Update() + { + + } + + public override void HandleEvent(GameEvent evt, object arg0) + { + switch (evt) + { + case GameEvent.GAME_DISCONNECTED: + L2LoginUI.Instance.ShowLoginWindow(); + _stateMachine.ChangeState(GameState.LOGIN_SCREEN); + break; + case GameEvent.CHAR_LOADED: + case GameEvent.RETURN: + L2LoginUI.Instance.ShowCharSelectWindow(); + _stateMachine.ChangeState(GameState.CHAR_SELECT); + break; + case GameEvent.CHAR_CREATED: + _stateMachine.ChangeState(GameState.CHAR_CREATION); + break; + default: + Debug.LogWarning($"[GameStateMachine] Unhandled event {evt} for state {_stateMachine.State}"); + break; + } + } +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/CharCreationState.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/CharCreationState.cs.meta new file mode 100644 index 000000000..f1783941b --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/CharCreationState.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f1c65600f9b5b3c4c9638d1607060ba8 \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/CharSelectionState.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/CharSelectionState.cs new file mode 100644 index 000000000..9b8d4b9b3 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/CharSelectionState.cs @@ -0,0 +1,42 @@ +using UnityEngine; + +public class CharSelectionState : GameStateBase +{ + public CharSelectionState(GameManager stateMachine) : base(stateMachine) { } + + public override void Enter(object arg0) + { + L2LoginUI.Instance.ShowCharSelectWindow(); + + CharSelectWindow.Instance.SetCharacterList(CharacterSelector.Instance.Characters); + + CharacterSelector.Instance.ApplyCharacterList(); + CharacterSelector.Instance.SelectDefaultCharacter(); + + CharSelectWindow.Instance.SelectSlot(CharacterSelector.Instance.SelectedSlot); + + LoginCameraManager.Instance.SwitchCamera("CharSelect"); + } + + public override void Update() + { + + } + + public override void HandleEvent(GameEvent evt, object arg0) + { + switch (evt) + { + case GameEvent.GAME_DISCONNECTED: + L2LoginUI.Instance.ShowLoginWindow(); + _stateMachine.ChangeState(GameState.LOGIN_SCREEN); + break; + case GameEvent.CHAR_SELECTED: + _stateMachine.ChangeState(GameState.ENTERING_WORLD); + break; + default: + Debug.LogWarning($"[GameStateMachine] Unhandled event {evt} for state {_stateMachine.State}"); + break; + } + } +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/CharSelectionState.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/CharSelectionState.cs.meta new file mode 100644 index 000000000..4dcc028ae --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/CharSelectionState.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b438f4b1a1e011249a168df5bfeb1322 \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/DisconnectingState.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/DisconnectingState.cs new file mode 100644 index 000000000..a96beeec7 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/DisconnectingState.cs @@ -0,0 +1,38 @@ +using UnityEngine; + +public class DisconnectingState : GameStateBase +{ + public DisconnectingState(GameManager stateMachine) : base(stateMachine) { } + + public override void Enter(object arg0) + { + MusicManager.Instance.Clear(); + _stateMachine.StartLoading(); + + SceneLoader.Instance.LoadMenu(); + } + + public override void Update() + { + + } + + public override void HandleEvent(GameEvent evt, object arg0) + { + switch (evt) + { + case GameEvent.UI_LOADED: + case GameEvent.WORLD_LOADED: + base.HandleEvent(evt, arg0); + break; + case GameEvent.LOADING_COMPLETE: + _stateMachine.StopLoading(); + L2LoginUI.Instance.ShowLoginWindow(); + _stateMachine.ChangeState(GameState.LOGIN_SCREEN); + break; + default: + Debug.LogWarning($"[GameStateMachine] Unhandled event {evt} for state {_stateMachine.State}"); + break; + } + } +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/DisconnectingState.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/DisconnectingState.cs.meta new file mode 100644 index 000000000..15ff9beec --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/DisconnectingState.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6de37e78545fefe4bb8053291c540b5d \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/EnteringWorldState.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/EnteringWorldState.cs new file mode 100644 index 000000000..c85ac5544 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/EnteringWorldState.cs @@ -0,0 +1,49 @@ +using UnityEngine; +using static CharSelectedPacket; + +public class EnteringWorldState : GameStateBase +{ + public EnteringWorldState(GameManager stateMachine) : base(stateMachine) { } + + public override void Enter(object arg0) + { + MusicManager.Instance.Clear(); + _stateMachine.StartLoading(); + + SceneLoader.Instance.LoadGame(); + } + + public override void Update() + { + + } + + public override void HandleEvent(GameEvent evt, object arg0) + { + switch (evt) + { + case GameEvent.UI_LOADED: + case GameEvent.WORLD_LOADED: + base.HandleEvent(evt, arg0); + break; + case GameEvent.LOADING_COMPLETE: + GameObject.Destroy(L2LoginUI.Instance.gameObject); + + PlayerInfo playerInfo = GameClient.Instance.PlayerInfo; + + WorldClock.Instance.SynchronizeClock(playerInfo.CurrentGameTime); + + WorldSpawner.Instance.OnReceivePlayerInfo(playerInfo.Identity, playerInfo.Status, playerInfo.Stats, playerInfo.Appearance, playerInfo.EntityActionInfo); + + PlayerStateMachine.Instance.enabled = true; + + _stateMachine.ChangeState(GameState.IN_GAME); + break; + case GameEvent.GAME_DISCONNECTED: + break; + default: + Debug.LogWarning($"[GameStateMachine] Unhandled event {evt} for state {_stateMachine.State}"); + break; + } + } +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/EnteringWorldState.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/EnteringWorldState.cs.meta new file mode 100644 index 000000000..83fc4ed38 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/EnteringWorldState.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2b0d328c428b2f3429e4c92a39d6d9fc \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/GameStateBase.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/GameStateBase.cs new file mode 100644 index 000000000..3581ab09c --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/GameStateBase.cs @@ -0,0 +1,34 @@ +public abstract class GameStateBase +{ + protected bool _uiLoaded = false; + protected bool _worldLoaded = false; + protected GameManager _stateMachine; + + public GameStateBase(GameManager stateMachine) + { + _uiLoaded = false; + _worldLoaded = false; + + _stateMachine = stateMachine; + } + + public virtual void Enter(object arg0) { } + public virtual void Exit() { } + public virtual void Update() { } + public virtual void HandleEvent(GameEvent evt, object arg0) + { + if (evt == GameEvent.UI_LOADED) + { + _uiLoaded = true; + } + else if (evt == GameEvent.WORLD_LOADED) + { + _worldLoaded = true; + } + + if (_uiLoaded && _worldLoaded) + { + _stateMachine.NotifyEvent(GameEvent.LOADING_COMPLETE); + } + } +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/GameStateBase.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/GameStateBase.cs.meta new file mode 100644 index 000000000..6a0082c9e --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/GameStateBase.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6a2d0973acfc0dd4d8f1ff1dec2b8cb5 \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/InGameState.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/InGameState.cs new file mode 100644 index 000000000..939859a08 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/InGameState.cs @@ -0,0 +1,35 @@ +using UnityEngine; + +public class InGameState : GameStateBase +{ + public InGameState(GameManager stateMachine) : base(stateMachine) { } + + public override void Enter(object arg0) + { + GameClient.Instance.ClientPacketHandler.SendLoadWorld(); + } + + public override void Update() + { + + } + + public override void HandleEvent(GameEvent evt, object arg0) + { + switch (evt) + { + case GameEvent.RESTART_ALLOWED: + _stateMachine.ChangeState(GameState.RESTARTING); + break; + case GameEvent.CHAR_LOADED: + _stateMachine.StopLoading(); + break; + case GameEvent.GAME_DISCONNECTED: + _stateMachine.ChangeState(GameState.DISONNECTING); + break; + default: + Debug.LogWarning($"[GameStateMachine] Unhandled event {evt} for state {_stateMachine.State}"); + break; + } + } +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/InGameState.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/InGameState.cs.meta new file mode 100644 index 000000000..9659c389d --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/InGameState.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 360e26009a0a908478ecef07b28197f3 \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginAuthedState.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginAuthedState.cs new file mode 100644 index 000000000..44998cc63 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginAuthedState.cs @@ -0,0 +1,40 @@ +using UnityEngine; + +public class LoginAuthedState : GameStateBase +{ + public LoginAuthedState(GameManager stateMachine) : base(stateMachine) { } + + public override void Enter(object arg0) + { + L2LoginUI.Instance.ShowLicenseWindow(); + } + + public override void Update() + { + + } + + public override void HandleEvent(GameEvent evt, object arg0) + { + switch (evt) + { + case GameEvent.LOGIN_DISCONNECTED: + L2LoginUI.Instance.ShowLoginWindow(); + _stateMachine.ChangeState(GameState.LOGIN_SCREEN); + break; + case GameEvent.SERVER_LIST_RECEIVED: + L2LoginUI.Instance.ShowServerSelectWindow(); + ServerSelectWindow.Instance.UpdateServerList((ServerListPacket)arg0); + break; + case GameEvent.PLAY_ALLOWED: + GameClient.Instance.Connect(); + break; + case GameEvent.AUTH_ALLOWED: + _stateMachine.ChangeState(GameState.CHAR_SELECT); + break; + default: + Debug.LogWarning($"[GameStateMachine] Unhandled event {evt} for state {_stateMachine.State}"); + break; + } + } +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginAuthedState.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginAuthedState.cs.meta new file mode 100644 index 000000000..d5fac354d --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginAuthedState.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9680fdc2f67e6e34b857b06e025a064e \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginConnectedState.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginConnectedState.cs new file mode 100644 index 000000000..8d7e6298f --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginConnectedState.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +public class LoginConnectedState : GameStateBase +{ + public LoginConnectedState(GameManager stateMachine) : base(stateMachine) { } + + + public override void Update() + { + + } + + public override void HandleEvent(GameEvent evt, object arg0) + { + switch (evt) + { + case GameEvent.AUTH_ALLOWED: + _stateMachine.ChangeState(GameState.LOGIN_AUTHED); + break; + case GameEvent.LOGIN_DISCONNECTED: + _stateMachine.ChangeState(GameState.LOGIN_SCREEN); + break; + default: + Debug.LogWarning($"[GameStateMachine] Unhandled event {evt} for state {_stateMachine.State}"); + break; + } + } +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginConnectedState.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginConnectedState.cs.meta new file mode 100644 index 000000000..697617faa --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginConnectedState.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f83984b21e133cc48a3fa22f007f7124 \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginState.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginState.cs new file mode 100644 index 000000000..44abab682 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginState.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +public class LoginState : GameStateBase +{ + public LoginState(GameManager stateMachine) : base(stateMachine) { } + + public override void Enter(object arg0) + { + LoginCameraManager.Instance.SwitchCamera("Login"); + L2LoginUI.Instance.ShowLoginWindow(); + } + + public override void Update() + { + + } + + public override void HandleEvent(GameEvent evt, object arg0) + { + switch (evt) + { + case GameEvent.CONNECTION_ALLOWED: + _stateMachine.ChangeState(GameState.LOGIN_CONNECTED); + break; + default: + Debug.LogWarning($"[GameStateMachine] Unhandled event {evt} for state {_stateMachine.State}"); + break; + } + } +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginState.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginState.cs.meta new file mode 100644 index 000000000..2ccc88a87 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/LoginState.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6bbb0ceb85e1bed4f8a41f378684ba6f \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/RestartingState.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/RestartingState.cs new file mode 100644 index 000000000..b563d0fc7 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/RestartingState.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +public class RestartingState : GameStateBase +{ + public RestartingState(GameManager stateMachine) : base(stateMachine) { } + + public override void Enter(object arg0) + { + MusicManager.Instance.Clear(); + _stateMachine.StartLoading(); + + SceneLoader.Instance.LoadMenu(); + } + + public override void Update() + { + + } + + public override void HandleEvent(GameEvent evt, object arg0) + { + switch (evt) + { + case GameEvent.UI_LOADED: + case GameEvent.WORLD_LOADED: + base.HandleEvent(evt, arg0); + break; + case GameEvent.LOADING_COMPLETE: + _stateMachine.StopLoading(); + _stateMachine.ChangeState(GameState.CHAR_SELECT); + break; + case GameEvent.GAME_DISCONNECTED: + L2LoginUI.Instance.ShowLoginWindow(); + _stateMachine.ChangeState(GameState.LOGIN_SCREEN); + break; + default: + Debug.LogWarning($"[GameStateMachine] Unhandled event {evt} for state {_stateMachine.State}"); + break; + } + } +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/RestartingState.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/RestartingState.cs.meta new file mode 100644 index 000000000..0a8664bb3 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/RestartingState.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a307f9a8ffd2814489fd478e22be7a01 \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/StartingGameState.cs b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/StartingGameState.cs new file mode 100644 index 000000000..989f3d41c --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/StartingGameState.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +public class StartingGameState : GameStateBase +{ + public StartingGameState(GameManager stateMachine) : base(stateMachine) { } + + + public override void Enter(object arg0) + { + _stateMachine.LoadTables(); + SceneLoader.Instance.LoadMenu(); + + _stateMachine.StartLoading(); + } + + public override void Update() + { + + } + + public override void HandleEvent(GameEvent evt, object arg0) + { + switch (evt) + { + case GameEvent.UI_LOADED: + case GameEvent.WORLD_LOADED: + base.HandleEvent(evt, arg0); + break; + case GameEvent.LOADING_COMPLETE: + LoginWindow.Instance.ShowWindow(); + LoginWindow.Instance.ShowLogo(); + PawnCreator.Instance.SpawnAllPawns(); + + _stateMachine.ChangeState(GameState.LOGIN_SCREEN); + break; + case GameEvent.CONNECTION_ALLOWED: + _stateMachine.ChangeState(GameState.LOGIN_CONNECTED); + break; + default: + Debug.LogWarning($"[GameStateMachine] Unhandled event {evt} for state {_stateMachine.State}"); + break; + } + } +} \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/StartingGameState.cs.meta b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/StartingGameState.cs.meta new file mode 100644 index 000000000..6178ca6a6 --- /dev/null +++ b/l2-unity/Assets/Scripts/Game/Manager/StateMachine/State/StartingGameState.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f225968027420e7449723d58a3c62153 \ No newline at end of file diff --git a/l2-unity/Assets/Scripts/Game/Manager/World/Spawner/PlayerSpawner.cs b/l2-unity/Assets/Scripts/Game/Manager/World/Spawner/PlayerSpawner.cs index 163f561fe..1ac673749 100644 --- a/l2-unity/Assets/Scripts/Game/Manager/World/Spawner/PlayerSpawner.cs +++ b/l2-unity/Assets/Scripts/Game/Manager/World/Spawner/PlayerSpawner.cs @@ -88,7 +88,9 @@ protected override void UpdateEntity(Entity entity, NetworkIdentity identity, // Player-specific updates CharacterInfoWindow.Instance.UpdateValues(); InventoryWindow.Instance.RefreshWeight(); - GameManager.Instance.OnPlayerInfoReceive(); + + GameManager.Instance.NotifyEvent(GameEvent.CHAR_LOADED); + NetworkTransformShare.Instance.SharePosition(); } diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/AsynchronousClient.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/AsynchronousClient.cs index d56d8e44d..33cd19f81 100644 --- a/l2-unity/Assets/Scripts/Networking/ClientLibrary/AsynchronousClient.cs +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/AsynchronousClient.cs @@ -85,10 +85,11 @@ public void Disconnect() return; } - Debug.Log("Disconnect"); ClientCleanup(); + Debug.Log("Disconnect"); + EventProcessor.Instance.QueueEvent(() => _client.OnDisconnect()); } diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/Gameserver/GameServerPacketHandler.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/Gameserver/GameServerPacketHandler.cs index c207a3321..a9f3b9175 100644 --- a/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/Gameserver/GameServerPacketHandler.cs +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/Gameserver/GameServerPacketHandler.cs @@ -30,7 +30,7 @@ public override void HandlePacket(byte[] data) OnSystemMessageReceive(data); break; case GameServerPacketType.CharSelected: - OnInitialPlayerInfoReceived(data); + OnCharSelected(data); break; case GameServerPacketType.ObjectPosition: OnUpdatePosition(data); @@ -204,25 +204,28 @@ private void OnLoginFail(byte[] data) private void OnCharSelectionInfoReceive(byte[] data) { Debug.LogWarning("OnCharSelectionInfoReceive"); - Debug.LogWarning(GameManager.Instance.GameState); CharSelectionInfoPacket packet = new CharSelectionInfoPacket(data); CharacterSelector.Instance.Characters = packet.Characters; CharacterSelector.Instance.DefaultSelectedSlot = packet.SelectedSlotId; - if (GameManager.Instance.GameState != GameState.RESTARTING) - { - Debug.Log($"Received {packet.Characters.Count} character(s) from server."); + Debug.Log($"Received {packet.Characters.Count} character(s) from server."); + if (GameManager.Instance.State == GameState.LOGIN_AUTHED) + { EventProcessor.Instance.QueueEvent(() => { LoginClient.Instance.Disconnect(); - GameClient.Instance.OnAuthAllowed(); + GameManager.Instance.NotifyEvent(GameEvent.AUTH_ALLOWED); }); } else { - EventProcessor.Instance.QueueEvent(() => GameClient.Instance.OnCharSelectAllowed()); + EventProcessor.Instance.QueueEvent(() => + { + Debug.Log("Return to character selection."); + GameManager.Instance.NotifyEvent(GameEvent.RESTART_ALLOWED); + }); } } @@ -237,9 +240,7 @@ private void OnCharCreateOk(byte[] data) { CharCreateOkPacket packet = new CharCreateOkPacket(data); Debug.Log($"Character creation succeeded."); - - EventProcessor.Instance.QueueEvent(() => GameClient.Instance.OnCharCreateOk()); - + // EventProcessor.Instance.QueueEvent(() => GameClient.Instance.OnCharCreateOk()); } private void OnMessageReceive(byte[] data) @@ -314,35 +315,22 @@ private void OnSystemMessageReceive(byte[] data) } } - private void OnInitialPlayerInfoReceived(byte[] data) + private void OnCharSelected(byte[] data) { CharSelectedPacket packet = new CharSelectedPacket(data); - if (GameManager.Instance.GameState != GameState.IN_GAME) + _eventProcessor.QueueEvent(() => { - _eventProcessor.QueueEvent(() => - { - GameClient.Instance.PlayerInfo = packet.PacketPlayerInfo; - GameManager.Instance.OnCharacterSelect(); - }); - } + GameClient.Instance.PlayerInfo = packet.PacketPlayerInfo; + GameManager.Instance.NotifyEvent(GameEvent.CHAR_SELECTED); + }); } private void OnPlayerInfoReceive(byte[] data) { PlayerInfoPacket packet = new PlayerInfoPacket(data); - if (packet.Identity.Owned) - { - WorldSpawner.Instance.OnReceivePlayerInfo(packet.Identity, packet.Status, packet.Stats, packet.Appearance, packet.EntityActionInfo); + WorldSpawner.Instance.OnReceivePlayerInfo(packet.Identity, packet.Status, packet.Stats, packet.Appearance, packet.EntityActionInfo); - PlayerInventory.Instance.SetInventorySize(packet.InventorySpace); - // Additional player information received, only now is the right time to show the UI/World to avoid visual bugs - GameManager.Instance.OnPlayerInfoReceive(); - } - else - { - Debug.LogError("Player info but id doesn't match!"); - // World.Instance.OnReceiveUserInfo(packet.Identity, packet.Status, packet.Stats, packet.Appearance, packet.Running); - } + PlayerInventory.Instance.SetInventorySize(packet.InventorySpace); } private void OnUserInfoReceived(byte[] data) @@ -476,12 +464,12 @@ private void OnLeaveWorld(byte[] data) private void OnRestartResponse(byte[] data) { - RestartResponsePacket packet = new RestartResponsePacket(data); - if (packet.Allowed) - { - // Do nothing, handle upcoming charselect packet instead - GameManager.Instance.GameState = GameState.RESTARTING; - } + // RestartResponsePacket packet = new RestartResponsePacket(data); + // if (packet.Allowed) + // { + // // Do nothing, handle upcoming charselect packet instead + // GameManager.Instance.GameState = GameState.RESTARTING; + // } } private void OnShortcutInit(byte[] data) diff --git a/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/LoginServer/LoginServerPacketHandler.cs b/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/LoginServer/LoginServerPacketHandler.cs index a3d335651..0cc77c52d 100644 --- a/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/LoginServer/LoginServerPacketHandler.cs +++ b/l2-unity/Assets/Scripts/Networking/ClientLibrary/PacketHandler/LoginServer/LoginServerPacketHandler.cs @@ -148,7 +148,7 @@ private void OnServerListReceived(byte[] data) ServerListPacket packet = new ServerListPacket(data); EventProcessor.Instance.QueueEvent( - () => LoginClient.Instance.OnServerListReceived(packet.LastServer, packet.ServersData, packet.CharsOnServers)); + () => LoginClient.Instance.OnServerListReceived(packet)); } private void OnPlayFail(byte[] data) diff --git a/l2-unity/Assets/Scripts/Networking/DefaultClient.cs b/l2-unity/Assets/Scripts/Networking/DefaultClient.cs index b47137df4..8f96ed3d4 100644 --- a/l2-unity/Assets/Scripts/Networking/DefaultClient.cs +++ b/l2-unity/Assets/Scripts/Networking/DefaultClient.cs @@ -104,7 +104,6 @@ public void Disconnect() public virtual void OnDisconnect() { _connected = false; - GameManager.Instance.OnDisconnect(); } #if UNITY_EDITOR diff --git a/l2-unity/Assets/Scripts/Networking/GameClient.cs b/l2-unity/Assets/Scripts/Networking/GameClient.cs index a9e48e63d..341e61df4 100644 --- a/l2-unity/Assets/Scripts/Networking/GameClient.cs +++ b/l2-unity/Assets/Scripts/Networking/GameClient.cs @@ -63,8 +63,6 @@ public void EnableCrypt(byte[] key) protected override void WhileConnecting() { base.WhileConnecting(); - - GameManager.Instance.OnConnectingToGameServer(); } protected override void OnConnectionSuccess() @@ -84,24 +82,12 @@ public override void OnConnectionFailed() public override void OnAuthAllowed() { Debug.Log("Authed to GameServer."); - - GameManager.Instance.OnAuthAllowed(); - } - - public void OnCharSelectAllowed() - { - Debug.Log("Return to character selection."); - GameManager.Instance.OnCharSelectAllowed(); } public override void OnDisconnect() { base.OnDisconnect(); Debug.Log("Disconnected from GameServer."); - } - - public void OnCharCreateOk() - { - GameManager.Instance.OnCharCreateOk(); + GameManager.Instance.NotifyEvent(GameEvent.GAME_DISCONNECTED); } } diff --git a/l2-unity/Assets/Scripts/Networking/LoginClient.cs b/l2-unity/Assets/Scripts/Networking/LoginClient.cs index ea80a4854..0f7d9fbf6 100644 --- a/l2-unity/Assets/Scripts/Networking/LoginClient.cs +++ b/l2-unity/Assets/Scripts/Networking/LoginClient.cs @@ -105,7 +105,7 @@ protected override void OnConnectionSuccess() Debug.Log("Connected to LoginServer"); - GameManager.Instance.OnLoginServerConnected(); + GameManager.Instance.NotifyEvent(GameEvent.CONNECTION_ALLOWED); } public override void OnConnectionFailed() @@ -116,22 +116,30 @@ public override void OnConnectionFailed() public override void OnAuthAllowed() { Debug.Log("Authed to LoginServer"); - GameManager.Instance.OnLoginServerAuthAllowed(); + GameManager.Instance.NotifyEvent(GameEvent.AUTH_ALLOWED); } public void OnPlayOk() { - GameManager.Instance.OnLoginServerPlayOk(); + // GameManager.Instance.OnLoginServerPlayOk(); - if (GameManager.Instance.GameState == GameState.READY_TO_CONNECT) - { - GameClient.Instance.Connect(); - } + // if (GameManager.Instance.GameState == GameState.READY_TO_CONNECT) + // { + // GameClient.Instance.Connect(); + // } + + GameManager.Instance.NotifyEvent(GameEvent.PLAY_ALLOWED); } - public void OnServerListReceived(byte lastServer, List serverData, Dictionary charsOnServers) + public void OnServerListReceived(ServerListPacket packet) { - GameManager.Instance.OnReceivedServerList(lastServer, serverData, charsOnServers); + GameManager.Instance.NotifyEvent(GameEvent.SERVER_LIST_RECEIVED, packet); + // / GameState = GameState.SERVER_LIST; + + // L2LoginUI.Instance.ShowServerSelectWindow(); + + // ServerSelectWindow.Instance.UpdateServerList(lastServer, serverData, charsOnServers); + // GameManager.Instance.OnReceivedServerList(lastServer, serverData, charsOnServers); } public void OnServerSelected(int serverId) @@ -144,5 +152,7 @@ public override void OnDisconnect() base.OnDisconnect(); Debug.Log("Disconnected from LoginServer."); + + GameManager.Instance.NotifyEvent(GameEvent.LOGIN_DISCONNECTED); } } diff --git a/l2-unity/Assets/Scripts/UI/Game/Action/ActionWindow.cs b/l2-unity/Assets/Scripts/UI/Game/Action/ActionWindow.cs index 9a8385d56..f921bf120 100644 --- a/l2-unity/Assets/Scripts/UI/Game/Action/ActionWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Game/Action/ActionWindow.cs @@ -109,6 +109,8 @@ protected override IEnumerator BuildWindow(VisualElement root) _slots[3].AssignAction(ActionType.NextTarget); _slots[4].AssignAction(ActionType.Pickup); _slots[5].AssignAction(ActionType.Assist); + + L2GameUI.Instance.WindowLoadComplete(); } private ActionSlot AddSlot(int position, VisualElement container) diff --git a/l2-unity/Assets/Scripts/UI/Game/CharacterWindow.cs b/l2-unity/Assets/Scripts/UI/Game/CharacterWindow.cs index 7fefe8db2..0395392bb 100644 --- a/l2-unity/Assets/Scripts/UI/Game/CharacterWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Game/CharacterWindow.cs @@ -167,6 +167,8 @@ protected override IEnumerator BuildWindow(VisualElement root) _pvpLabel = GetLabelById("PvpLabel"); _recLabel = GetLabelById("RecLabel"); _raidLabel = GetLabelById("RaidLabel"); + + L2GameUI.Instance.WindowLoadComplete(); } public void UpdateValues() diff --git a/l2-unity/Assets/Scripts/UI/Game/Chat/ChatWindow.cs b/l2-unity/Assets/Scripts/UI/Game/Chat/ChatWindow.cs index bedf640f6..d740eb3ac 100644 --- a/l2-unity/Assets/Scripts/UI/Game/Chat/ChatWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Game/Chat/ChatWindow.cs @@ -95,6 +95,8 @@ protected override IEnumerator BuildWindow(VisualElement root) yield return new WaitForEndOfFrame(); diagonalResizeManipulator.SnapSize(); + + L2GameUI.Instance.WindowLoadComplete(); } diff --git a/l2-unity/Assets/Scripts/UI/Game/ExitWindow.cs b/l2-unity/Assets/Scripts/UI/Game/ExitWindow.cs index 502803e33..d6932ac9b 100644 --- a/l2-unity/Assets/Scripts/UI/Game/ExitWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Game/ExitWindow.cs @@ -76,6 +76,8 @@ protected override IEnumerator BuildWindow(VisualElement root) _restartButton.RegisterCallback((evt) => HandleRestartButtonClick()); _exitButton.RegisterCallback((evt) => HandleExitButtonClick()); _cancelButton.RegisterCallback((evt) => HandleCancelButtonClick()); + + L2GameUI.Instance.WindowLoadComplete(); } public void OpenWindow(bool exit) diff --git a/l2-unity/Assets/Scripts/UI/Game/Inventory/InventoryWindow.cs b/l2-unity/Assets/Scripts/UI/Game/Inventory/InventoryWindow.cs index c1e8064b4..912869d6b 100644 --- a/l2-unity/Assets/Scripts/UI/Game/Inventory/InventoryWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Game/Inventory/InventoryWindow.cs @@ -154,6 +154,8 @@ protected override IEnumerator BuildWindow(VisualElement root) #if UNITY_EDITOR // DebugData(); #endif + + L2GameUI.Instance.WindowLoadComplete(); } private void OnExpandButtonPressed(MouseDownEvent evt) diff --git a/l2-unity/Assets/Scripts/UI/Game/MenuWindow.cs b/l2-unity/Assets/Scripts/UI/Game/MenuWindow.cs index f442fc628..ed2426b4e 100644 --- a/l2-unity/Assets/Scripts/UI/Game/MenuWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Game/MenuWindow.cs @@ -73,6 +73,8 @@ protected override IEnumerator BuildWindow(VisualElement root) var dragAreaEle = _windowEle.Q(null, "drag-area"); DragManipulator drag = new DragManipulator(dragAreaEle, _windowEle, this); dragAreaEle.AddManipulator(drag); + + L2GameUI.Instance.WindowLoadComplete(); } public Vector2 GetWindowPosition() diff --git a/l2-unity/Assets/Scripts/UI/Game/NpcHtmlWindow.cs b/l2-unity/Assets/Scripts/UI/Game/NpcHtmlWindow.cs index 7c9c0984a..caeaf9121 100644 --- a/l2-unity/Assets/Scripts/UI/Game/NpcHtmlWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Game/NpcHtmlWindow.cs @@ -92,6 +92,8 @@ protected override IEnumerator BuildWindow(VisualElement root) HideWindow(); + L2GameUI.Instance.WindowLoadComplete(); + // RefreshContent(0, // @"Newbie Helper:
// Welcome to Einhovant's School of Wizardry. I will be teaching you the basics of combat.
diff --git a/l2-unity/Assets/Scripts/UI/Game/RestartLocationWindow.cs b/l2-unity/Assets/Scripts/UI/Game/RestartLocationWindow.cs index 5c6e7cc72..d9509b29b 100644 --- a/l2-unity/Assets/Scripts/UI/Game/RestartLocationWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Game/RestartLocationWindow.cs @@ -69,6 +69,8 @@ protected override IEnumerator BuildWindow(VisualElement root) var dragAreaEle = _windowEle.Q(null, "drag-area"); DragManipulator drag = new DragManipulator(dragAreaEle, _windowEle, this); dragAreaEle.AddManipulator(drag); + + L2GameUI.Instance.WindowLoadComplete(); } public Vector2 GetWindowPosition() diff --git a/l2-unity/Assets/Scripts/UI/Game/Skillbar/SkillbarWindow.cs b/l2-unity/Assets/Scripts/UI/Game/Skillbar/SkillbarWindow.cs index 58751a374..6bf13bf12 100644 --- a/l2-unity/Assets/Scripts/UI/Game/Skillbar/SkillbarWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Game/Skillbar/SkillbarWindow.cs @@ -120,6 +120,8 @@ protected override IEnumerator BuildWindow(VisualElement root) #if UNITY_EDITOR // DebugData(); #endif + + L2GameUI.Instance.WindowLoadComplete(); } public void AddSkillbar() diff --git a/l2-unity/Assets/Scripts/UI/Game/StatusWindow.cs b/l2-unity/Assets/Scripts/UI/Game/StatusWindow.cs index c9635b095..f259b84e8 100644 --- a/l2-unity/Assets/Scripts/UI/Game/StatusWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Game/StatusWindow.cs @@ -162,6 +162,8 @@ protected override IEnumerator BuildWindow(VisualElement root) { OnClickSelf(); }, TrickleDown.TrickleDown); + + L2GameUI.Instance.WindowLoadComplete(); } void FixedUpdate() diff --git a/l2-unity/Assets/Scripts/UI/Game/SystemMenuWindow.cs b/l2-unity/Assets/Scripts/UI/Game/SystemMenuWindow.cs index 0b315479a..b6562e834 100644 --- a/l2-unity/Assets/Scripts/UI/Game/SystemMenuWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Game/SystemMenuWindow.cs @@ -68,6 +68,8 @@ protected override IEnumerator BuildWindow(VisualElement root) RegisterClickWindowEvent(_windowEle, null); HideWindow(); + + L2GameUI.Instance.WindowLoadComplete(); } private void HandleExitButtonClick() diff --git a/l2-unity/Assets/Scripts/UI/Game/TargetWindow.cs b/l2-unity/Assets/Scripts/UI/Game/TargetWindow.cs index 5e1f12a36..7cd3e4f5e 100644 --- a/l2-unity/Assets/Scripts/UI/Game/TargetWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Game/TargetWindow.cs @@ -89,6 +89,8 @@ protected override IEnumerator BuildWindow(VisualElement root) _windowEle.style.position = Position.Absolute; _windowEle.style.left = Screen.width / 2f - _windowEle.resolvedStyle.width / 2f; _windowEle.style.top = 0; + + L2GameUI.Instance.WindowLoadComplete(); } private void FixedUpdate() diff --git a/l2-unity/Assets/Scripts/UI/L2GameUI.cs b/l2-unity/Assets/Scripts/UI/L2GameUI.cs index 23e8cf450..4299687c6 100644 --- a/l2-unity/Assets/Scripts/UI/L2GameUI.cs +++ b/l2-unity/Assets/Scripts/UI/L2GameUI.cs @@ -30,6 +30,7 @@ private void Awake() private void Start() { MouseOverUI = false; + _windowsLoaded = 0; } private void OnDestroy() diff --git a/l2-unity/Assets/Scripts/UI/L2LoginUI.cs b/l2-unity/Assets/Scripts/UI/L2LoginUI.cs index 58c1fcc09..b8546ef8c 100644 --- a/l2-unity/Assets/Scripts/UI/L2LoginUI.cs +++ b/l2-unity/Assets/Scripts/UI/L2LoginUI.cs @@ -31,6 +31,11 @@ private void OnDestroy() _instance = null; } + private void Start() + { + _windowsLoaded = 0; + } + protected override void LoadUI() { base.LoadUI(); diff --git a/l2-unity/Assets/Scripts/UI/L2UI.cs b/l2-unity/Assets/Scripts/UI/L2UI.cs index 5fe3c15e3..5c7bfa6c2 100644 --- a/l2-unity/Assets/Scripts/UI/L2UI.cs +++ b/l2-unity/Assets/Scripts/UI/L2UI.cs @@ -19,6 +19,16 @@ public abstract class L2UI : MonoBehaviour public bool UILoaded { get { return _uiLoaded; } set { _uiLoaded = value; } } public VisualElement RootElement { get { return _rootElement; } } + [SerializeField] protected int _windowsLoaded = 0; + [SerializeField] protected int _totalWindowsToLoad = 0; + + public void WindowLoadComplete() + { + if (++_windowsLoaded >= _totalWindowsToLoad) + { + GameManager.Instance.NotifyEvent(GameEvent.UI_LOADED); + } + } protected virtual void Update() { diff --git a/l2-unity/Assets/Scripts/UI/Login/CharCreationWindow.cs b/l2-unity/Assets/Scripts/UI/Login/CharCreationWindow.cs index 0461b71a2..aa77fd711 100644 --- a/l2-unity/Assets/Scripts/UI/Login/CharCreationWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Login/CharCreationWindow.cs @@ -210,6 +210,8 @@ protected override IEnumerator BuildWindow(VisualElement root) charDetailWindow.Add(hairstyleInput); charDetailWindow.Add(hairColorInput); charDetailWindow.Add(faceInput); + + L2LoginUI.Instance.WindowLoadComplete(); } @@ -228,7 +230,7 @@ private void PreviousButtonPressed() raceManipulator.ClearInput(); userInputField.value = ""; - GameManager.Instance.OnAuthAllowed(); + GameManager.Instance.NotifyEvent(GameEvent.RETURN); } private void ShowRotatePawnWindow() diff --git a/l2-unity/Assets/Scripts/UI/Login/CharSelectWindow.cs b/l2-unity/Assets/Scripts/UI/Login/CharSelectWindow.cs index de4911c44..e1c090165 100644 --- a/l2-unity/Assets/Scripts/UI/Login/CharSelectWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Login/CharSelectWindow.cs @@ -120,6 +120,8 @@ protected override IEnumerator BuildWindow(VisualElement root) userNameInput.AddManipulator(_charNameManipulator); userNameInputContainer.Add(userNameInput); + + L2LoginUI.Instance.WindowLoadComplete(); } public void SetCharacterList(List characters) @@ -198,13 +200,12 @@ private void StartGamePressed() private void ReLoginPressed() { - GameManager.Instance.OnRelogin(); GameClient.Instance.Disconnect(); } private void CreatePressed() { - GameManager.Instance.OnCreateUser(); + GameManager.Instance.ChangeState(GameState.CHAR_CREATION); } private void DeletePressed() diff --git a/l2-unity/Assets/Scripts/UI/Login/LicenseWindow.cs b/l2-unity/Assets/Scripts/UI/Login/LicenseWindow.cs index 211236730..dfa5f3a6b 100644 --- a/l2-unity/Assets/Scripts/UI/Login/LicenseWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Login/LicenseWindow.cs @@ -64,6 +64,8 @@ protected override IEnumerator BuildWindow(VisualElement root) var lowBtn = (RepeatButton)GetElementById("unity-low-button"); highBtn.AddManipulator(new ButtonClickSoundManipulator(highBtn)); lowBtn.AddManipulator(new ButtonClickSoundManipulator(lowBtn)); + + L2LoginUI.Instance.WindowLoadComplete(); } private void AgreeButtonPressed() diff --git a/l2-unity/Assets/Scripts/UI/Login/LoginWindow.cs b/l2-unity/Assets/Scripts/UI/Login/LoginWindow.cs index bad689875..a7d918aed 100644 --- a/l2-unity/Assets/Scripts/UI/Login/LoginWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Login/LoginWindow.cs @@ -39,7 +39,6 @@ protected override IEnumerator BuildWindow(VisualElement root) InitWindow(root); _logo = root.Q("L2Logo"); - GameManager.Instance.OnLoginUILoaded(); yield return new WaitForEndOfFrame(); @@ -73,6 +72,8 @@ protected override IEnumerator BuildWindow(VisualElement root) _passwordInput.RegisterCallback((evt) => OnKeyPressed(evt, _passwordInput)); _userInput.Focus(); + + L2LoginUI.Instance.WindowLoadComplete(); } private void OnKeyPressed(KeyDownEvent evt, TextField input) diff --git a/l2-unity/Assets/Scripts/UI/Login/ServerSelectWindow.cs b/l2-unity/Assets/Scripts/UI/Login/ServerSelectWindow.cs index 0c1b5c12c..ec993c878 100644 --- a/l2-unity/Assets/Scripts/UI/Login/ServerSelectWindow.cs +++ b/l2-unity/Assets/Scripts/UI/Login/ServerSelectWindow.cs @@ -82,11 +82,15 @@ protected override IEnumerator BuildWindow(VisualElement root) root.Add(_windowEle); - yield return new WaitForEndOfFrame(); + L2LoginUI.Instance.WindowLoadComplete(); } - public void UpdateServerList(int lastServer, List serverData, Dictionary charsOnServers) + public void UpdateServerList(ServerListPacket packet) { + int lastServer = packet.LastServer; + List serverData = packet.ServersData; + Dictionary charsOnServers = packet.CharsOnServers; + ResetWindow(); _serverData = serverData; diff --git a/l2-unity/UserSettings/EditorUserSettings.asset b/l2-unity/UserSettings/EditorUserSettings.asset index ee792454a..45ad25447 100644 --- a/l2-unity/UserSettings/EditorUserSettings.asset +++ b/l2-unity/UserSettings/EditorUserSettings.asset @@ -6,7 +6,7 @@ EditorUserSettings: serializedVersion: 4 m_ConfigSettings: GraphicsSettingsInspector_UserSettings: - value: 18134705175a055722080a3115371d4a0d55006876786860616b0471b8b07a68ffab74f9ee2a3a30300cea1a11320d0beb1a0c25f7060f494b4cc80018eb09361fc211cb1f862d19c51d19dcc413d6ade0d8ddfcddf9f4d9d29195fcfde6ebeae6f0a9c9afa6f8c5b89ff7a1aacececac4eba4d7c9d28bda + value: 18134705175a055722080a3115371d4a0d55006876786860616b0471b8b3666cacb72ba5a52a362c3c0ee63201181433fe3e101bf3250b06144ca74c24f1190708e016c213c61a52f91c12cac80fd8edd298e1e4d1fde2cacddeacbcc1fee7eef0e3b6faa69af9ceaeaaec81a6d2c2c8c8c4b2e5dfd5ccd3f8cf flags: 0 RecentlyUsedSceneGuid-0: value: 55540c5f540c510c0e565f2012710b444315492b7b2d27342e2a1c63e6e1646e diff --git a/l2-unity/UserSettings/Layouts/default-6000.dwlt b/l2-unity/UserSettings/Layouts/default-6000.dwlt index 089d4b3b1..6462281ee 100644 --- a/l2-unity/UserSettings/Layouts/default-6000.dwlt +++ b/l2-unity/UserSettings/Layouts/default-6000.dwlt @@ -19,7 +19,7 @@ MonoBehaviour: width: 2560 height: 1357 m_ShowMode: 4 - m_Title: Game + m_Title: Console m_RootView: {fileID: 6} m_MinSize: {x: 875, y: 300} m_MaxSize: {x: 10000, y: 10000} @@ -48,7 +48,7 @@ MonoBehaviour: m_MinSize: {x: 300, y: 100} m_MaxSize: {x: 24288, y: 16192} vertical: 0 - controlID: 109 + controlID: 38 draggingID: 0 --- !u!114 &3 MonoBehaviour: @@ -60,24 +60,24 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 1 m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} - m_Name: UIElementsDebugger + m_Name: InspectorWindow m_EditorClassIdentifier: m_Children: [] m_Position: serializedVersion: 2 - x: 1569 + x: 1914 y: 0 - width: 991 + width: 646 height: 1301 - m_MinSize: {x: 51, y: 76} + m_MinSize: {x: 276, y: 76} m_MaxSize: {x: 4001, y: 4026} - m_ActualView: {fileID: 13} + m_ActualView: {fileID: 16} m_Panes: - {fileID: 16} - {fileID: 14} - {fileID: 13} - m_Selected: 2 - m_LastSelected: 0 + m_Selected: 0 + m_LastSelected: 2 --- !u!114 &4 MonoBehaviour: m_ObjectHideFlags: 52 @@ -95,8 +95,8 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 254 - height: 932 + width: 407 + height: 680 m_MinSize: {x: 201, y: 226} m_MaxSize: {x: 4001, y: 4026} m_ActualView: {fileID: 17} @@ -114,23 +114,23 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 1 m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} - m_Name: ProjectBrowser + m_Name: ConsoleWindow m_EditorClassIdentifier: m_Children: [] m_Position: serializedVersion: 2 x: 0 - y: 932 - width: 1569 - height: 369 - m_MinSize: {x: 231, y: 276} - m_MaxSize: {x: 10001, y: 10026} - m_ActualView: {fileID: 15} + y: 680 + width: 1914 + height: 621 + m_MinSize: {x: 101, y: 126} + m_MaxSize: {x: 4001, y: 4026} + m_ActualView: {fileID: 19} m_Panes: - {fileID: 15} - - {fileID: 20} - m_Selected: 0 - m_LastSelected: 1 + - {fileID: 19} + m_Selected: 1 + m_LastSelected: 0 --- !u!114 &6 MonoBehaviour: m_ObjectHideFlags: 52 @@ -221,12 +221,12 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 1569 + width: 1914 height: 1301 m_MinSize: {x: 200, y: 100} m_MaxSize: {x: 16192, y: 16192} vertical: 1 - controlID: 40 + controlID: 39 draggingID: 0 --- !u!114 &10 MonoBehaviour: @@ -247,12 +247,12 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 1569 - height: 932 + width: 1914 + height: 680 m_MinSize: {x: 200, y: 50} m_MaxSize: {x: 16192, y: 8096} vertical: 0 - controlID: 41 + controlID: 40 draggingID: 0 --- !u!114 &11 MonoBehaviour: @@ -269,18 +269,18 @@ MonoBehaviour: m_Children: [] m_Position: serializedVersion: 2 - x: 254 + x: 407 y: 0 - width: 1315 - height: 932 + width: 1507 + height: 680 m_MinSize: {x: 202, y: 226} m_MaxSize: {x: 4002, y: 4026} - m_ActualView: {fileID: 19} + m_ActualView: {fileID: 20} m_Panes: - {fileID: 18} - - {fileID: 19} - {fileID: 12} - m_Selected: 1 + - {fileID: 20} + m_Selected: 2 m_LastSelected: 2 --- !u!114 &12 MonoBehaviour: @@ -303,10 +303,10 @@ MonoBehaviour: m_TextWithWhitespace: "UI Builder\u200B" m_Pos: serializedVersion: 2 - x: 254 + x: 302 y: 79 - width: 1313 - height: 906 + width: 1616 + height: 609 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -339,9 +339,9 @@ MonoBehaviour: m_TextWithWhitespace: "UI Toolkit Debugger\u200B" m_Pos: serializedVersion: 2 - x: 1570 - y: 24 - width: 990 + x: 1487 + y: 79 + width: 1072 height: 1275 m_SerializedDataModeController: m_DataMode: 0 @@ -357,7 +357,7 @@ MonoBehaviour: m_DebuggerImpl: m_LastVisualTreeName: Lineage2 m_DebuggerContext: - m_SelectedElementIndex: 10 + m_SelectedElementIndex: 4189 m_ShowLayoutBound: 0 m_ShowRepaintOverlay: 0 m_ShowDrawStats: 0 @@ -385,10 +385,10 @@ MonoBehaviour: m_TextWithWhitespace: "Lighting\u200B" m_Pos: serializedVersion: 2 - x: 3220 + x: 1357 y: 79 - width: 1259 - height: 915 + width: 1202 + height: 1275 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -422,9 +422,9 @@ MonoBehaviour: m_Pos: serializedVersion: 2 x: 0 - y: 956 - width: 1568 - height: 343 + y: 759 + width: 1913 + height: 595 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -447,7 +447,7 @@ MonoBehaviour: m_SkipHidden: 0 m_SearchArea: 1 m_Folders: - - Assets/Resources/Data/UI/_Elements/Login/LicenseWindow + - Assets/Scripts/UI/Login m_Globs: [] m_ProductIds: m_AnyWithAssetOrigin: 0 @@ -457,16 +457,16 @@ MonoBehaviour: m_ViewMode: 1 m_StartGridSize: 16 m_LastFolders: - - Assets/Resources/Data/UI/_Elements/Login/LicenseWindow + - Assets/Scripts/UI/Login m_LastFoldersGridSize: 16 m_LastProjectPath: D:\Stock\Projects\L2-Unity\l2-unity\l2-unity m_LockTracker: m_IsLocked: 0 m_FolderTreeState: - scrollPos: {x: 0, y: 374} - m_SelectedIDs: 94e80100 - m_LastClickedID: 125076 - m_ExpandedIDs: 00000000dae70100dce70100dee70100e0e70100e2e70100e4e70100e6e70100e8e70100eae70100ece70100eee70100f0e70100f2e70100f4e70100f6e70100f8e70100fae70100fce70100fee7010000e8010002e8010004e8010006e8010008e801000ae801000ce801000ee8010010e8010012e8010014e8010016e8010018e801001ae801001ce801001ee8010020e8010022e8010024e8010026e8010028e801002ae801002ce801002ee8010030e8010032e8010034e8010036e8010038e801003ae801003ce801003ee8010040e8010042e8010044e8010046e80100 + scrollPos: {x: 0, y: 1013} + m_SelectedIDs: c2e90100 + m_LastClickedID: 125378 + m_ExpandedIDs: 00000000f6e70100f8e70100fae70100fce70100fee7010000e8010002e8010004e8010006e8010008e801000ae801000ce801000ee8010010e8010012e8010014e8010016e8010018e801001ae801001ce801001ee8010020e8010022e8010024e8010026e8010028e801002ae801002ce801002ee8010030e8010032e8010034e8010036e8010038e801003ae801003ce801003ee8010040e8010042e8010044e8010046e8010048e801004ae801004ce801004ee8010050e8010052e8010054e8010056e8010058e801005ae801005ce801005ee8010060e8010062e8010064e8010066e8010068e801006ae801006ce80100 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -495,7 +495,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: 00000000dae70100dce70100dee70100e0e70100e2e70100e4e70100e6e70100e8e70100eae70100ece70100eee70100f0e70100f2e70100f4e70100f6e70100f8e70100fae70100fce70100fee7010000e8010002e8010004e8010006e8010008e801000ae801000ce801000ee8010010e8010012e8010014e8010016e8010018e801001ae801001ce801001ee8010020e8010022e8010024e8010026e8010028e801002ae801002ce801002ee8010030e8010032e8010034e8010036e8010038e801003ae801003ce801003ee8010040e8010042e8010044e8010046e80100 + m_ExpandedIDs: 00000000f6e70100f8e70100fae70100fce70100fee7010000e8010002e8010004e8010006e8010008e801000ae801000ce801000ee8010010e8010012e8010014e8010016e8010018e801001ae801001ce801001ee8010020e8010022e8010024e8010026e8010028e801002ae801002ce801002ee8010030e8010032e8010034e8010036e8010038e801003ae801003ce801003ee8010040e8010042e8010044e8010046e8010048e801004ae801004ce801004ee8010050e8010052e8010054e8010056e8010058e801005ae801005ce801005ee8010060e8010062e8010064e8010066e8010068e801006ae801006ce80100 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -521,9 +521,9 @@ MonoBehaviour: m_Icon: {fileID: 0} m_ResourceFile: m_ListAreaState: - m_SelectedInstanceIDs: - m_LastClickedInstanceID: 0 - m_HadKeyboardFocusLastEvent: 1 + m_SelectedInstanceIDs: b6fe0000 + m_LastClickedInstanceID: 65206 + m_HadKeyboardFocusLastEvent: 0 m_ExpandedInstanceIDs: c62300003cbe00008cb80000ccab0000b2c70000 m_RenameOverlay: m_UserAcceptedRename: 0 @@ -574,9 +574,9 @@ MonoBehaviour: m_TextWithWhitespace: "Inspector\u200B" m_Pos: serializedVersion: 2 - x: 2038 - y: 79 - width: 521 + x: 1915 + y: 24 + width: 645 height: 1275 m_SerializedDataModeController: m_DataMode: 0 @@ -625,8 +625,8 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 24 - width: 253 - height: 906 + width: 406 + height: 654 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -643,7 +643,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: f46ffdff + m_ExpandedIDs: cc62faff2093fafff8fafffffafafffff4ffffff m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -689,10 +689,10 @@ MonoBehaviour: m_TextWithWhitespace: "Scene\u200B" m_Pos: serializedVersion: 2 - x: 334 + x: 2904 y: 79 - width: 1702 - height: 645 + width: 1089 + height: 625 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -1249,6 +1249,42 @@ MonoBehaviour: m_LastDebugDrawMode: 35 m_ViewIsLockedToObject: 0 --- !u!114 &19 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12003, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_MinSize: {x: 100, y: 100} + m_MaxSize: {x: 4000, y: 4000} + m_TitleContent: + m_Text: Console + m_Image: {fileID: -4327648978806127646, guid: 0000000000000000d000000000000000, type: 0} + m_Tooltip: + m_TextWithWhitespace: "Console\u200B" + m_Pos: + serializedVersion: 2 + x: 0 + y: 704 + width: 1913 + height: 595 + m_SerializedDataModeController: + m_DataMode: 0 + m_PreferredDataMode: 0 + m_SupportedDataModes: + isAutomatic: 1 + m_ViewDataDictionary: {fileID: 0} + m_OverlayCanvas: + m_LastAppliedPresetName: Default + m_SaveData: [] + m_ContainerData: [] + m_OverlaysVisible: 1 +--- !u!114 &20 MonoBehaviour: m_ObjectHideFlags: 52 m_CorrespondingSourceObject: {fileID: 0} @@ -1269,10 +1305,10 @@ MonoBehaviour: m_TextWithWhitespace: "Game\u200B" m_Pos: serializedVersion: 2 - x: 255 + x: 408 y: 24 - width: 1313 - height: 906 + width: 1505 + height: 654 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -1284,13 +1320,15 @@ MonoBehaviour: m_SaveData: [] m_ContainerData: [] m_OverlaysVisible: 1 - m_SerializedViewNames: [] - m_SerializedViewValues: [] + m_SerializedViewNames: + - UnityEditor.DeviceSimulation.SimulatorWindow + m_SerializedViewValues: + - D:\Stock\Projects\L2-Unity\l2-unity\l2-unity\Library\PlayModeViewStates\e6526243772a6f0439dfe30d3594be91 m_PlayModeViewName: GameView m_ShowGizmos: 0 m_TargetDisplay: 0 m_ClearColor: {r: 0, g: 0, b: 0, a: 0} - m_TargetSize: {x: 1313, y: 885} + m_TargetSize: {x: 1505, y: 633} m_TextureFilterMode: 0 m_TextureHideFlags: 61 m_RenderIMGUI: 1 @@ -1305,10 +1343,10 @@ MonoBehaviour: m_VRangeLocked: 0 hZoomLockedByDefault: 0 vZoomLockedByDefault: 0 - m_HBaseRangeMin: -656.5 - m_HBaseRangeMax: 656.5 - m_VBaseRangeMin: -442.5 - m_VBaseRangeMax: 442.5 + m_HBaseRangeMin: -752.5 + m_HBaseRangeMax: 752.5 + m_VBaseRangeMin: -316.5 + m_VBaseRangeMax: 316.5 m_HAllowExceedBaseRangeMin: 1 m_HAllowExceedBaseRangeMax: 1 m_VAllowExceedBaseRangeMin: 1 @@ -1317,7 +1355,7 @@ MonoBehaviour: m_HSlider: 0 m_VSlider: 0 m_IgnoreScrollWheelUntilClicked: 0 - m_EnableMouseInput: 1 + m_EnableMouseInput: 0 m_EnableSliderZoomHorizontal: 0 m_EnableSliderZoomVertical: 0 m_UniformScale: 1 @@ -1326,61 +1364,25 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 21 - width: 1313 - height: 885 + width: 1505 + height: 633 m_Scale: {x: 1, y: 1} - m_Translation: {x: 656.5, y: 442.5} + m_Translation: {x: 752.5, y: 316.5} m_MarginLeft: 0 m_MarginRight: 0 m_MarginTop: 0 m_MarginBottom: 0 m_LastShownAreaInsideMargins: serializedVersion: 2 - x: -656.5 - y: -442.5 - width: 1313 - height: 885 + x: -752.5 + y: -316.5 + width: 1505 + height: 633 m_MinimalGUI: 1 m_defaultScale: 1 - m_LastWindowPixelSize: {x: 1313, y: 906} + m_LastWindowPixelSize: {x: 1505, y: 654} m_ClearInEditMode: 1 m_NoCameraWarning: 1 m_LowResolutionForAspectRatios: 01000000000000000000 m_XRRenderMode: 0 m_RenderTexture: {fileID: 0} ---- !u!114 &20 -MonoBehaviour: - m_ObjectHideFlags: 52 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 1 - m_Script: {fileID: 12003, guid: 0000000000000000e000000000000000, type: 0} - m_Name: - m_EditorClassIdentifier: - m_MinSize: {x: 100, y: 100} - m_MaxSize: {x: 4000, y: 4000} - m_TitleContent: - m_Text: Console - m_Image: {fileID: -4327648978806127646, guid: 0000000000000000d000000000000000, type: 0} - m_Tooltip: - m_TextWithWhitespace: "Console\u200B" - m_Pos: - serializedVersion: 2 - x: 0 - y: 980 - width: 2037 - height: 374 - m_SerializedDataModeController: - m_DataMode: 0 - m_PreferredDataMode: 0 - m_SupportedDataModes: - isAutomatic: 1 - m_ViewDataDictionary: {fileID: 0} - m_OverlayCanvas: - m_LastAppliedPresetName: Default - m_SaveData: [] - m_ContainerData: [] - m_OverlaysVisible: 1