diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..3e524c1 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,36 @@ +# Open76 AI Coding Guidelines + +## Project Overview +Open76 is a Unity engine reimplementation of Activision's Interstate '76 (1997), parsing original game assets and formats to recreate gameplay in modern Unity. Focuses on level rendering, car physics, and mission scripting via stack-based FSM. + +## Architecture +- **Core Systems**: Singleton managers (CacheManager, VirtualFilesystem, LevelLoader) handle asset loading and world setup. +- **Asset Pipeline**: Custom parsers in `Assets/Scripts/System/Fileparsers/` reverse-engineer I76 formats (.geo meshes, .sdf scenes, .vcf cars, .msn missions). +- **Mission Logic**: FSMRunner executes stack machines with bytecode opcodes (PUSH, ACTION, JMP) for game logic. +- **File Access**: VirtualFilesystem prioritizes loose files (MISSIONS/, ADDON/) over compressed ZFS archive. + +## Key Patterns +- Use singletons for global state (e.g., `CacheManager.Instance.ImportMesh()`). +- Cache parsed assets in dictionaries (meshes, materials, SDFs) to avoid redundant parsing. +- Handle palette-based textures: load .act palettes, apply to .vqm/.map textures. +- Instantiate prefabs from Resources/ (e.g., `Resources.Load("Prefabs/CarPrefab")`). +- FSM actions in FSMActionDelegator: implement entity-specific behaviors (cars, buildings). + +## Conventions +- File parsers: Static `ReadX()` methods (e.g., `GeoParser.ReadGeoMesh(filename)`). +- Naming: PascalCase for classes/methods, camelCase for locals. +- Error handling: Debug.LogWarning for missing assets, exceptions for format errors. +- Coordinates: I76 uses custom units; convert via `/100.0f` for rotations, `*640` for terrain patches. + +## Workflows +- **Level Loading**: Parse .msn via MsnMissionParser, create terrain patches, place objects from .sdf/.vcf. +- **Asset Import**: CacheManager.ImportGeo() for meshes, ImportSdf() for scenes, ImportVcf() for cars. +- **Debugging**: Use FSMRunner gizmos for path visualization; check VirtualFilesystem.FileExists() for asset presence. +- **Building**: Standard Unity build process; no custom scripts. + +## Examples +- Load mesh: `GeoMeshCacheEntry entry = CacheManager.Instance.ImportMesh("car.geo", vtf, textureGroup);` +- Place object: `GameObject obj = CacheManager.Instance.ImportSdf("building.sdf", parent, pos, rot, canWreck, out sdf, out wrecked);` +- FSM action: Implement in FSMActionDelegator.DoAction() switch case for new actions. + +Reference: [CacheManager.cs](C:/Users/Rob/Documents/Unity/Open76/Assets/Scripts/System/CacheManager.cs), [VirtualFilesystem.cs](C:/Users/Rob/Documents/Unity/Open76Assets/Scripts/System/VirtualFilesystem.cs), [LevelLoader.cs](C:/Users/Rob/Documents/Unity/Open76/Assets/Scripts/System/LevelLoader.cs) \ No newline at end of file diff --git a/.gitignore b/.gitignore index 60c97b9..e46428d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,103 @@ -Library/ +# This .gitignore file should be placed at the root of your Unity project directory +# +# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore +# +.utmp/ +/[Ll]ibrary/ +/[Tt]emp/ +/[Oo]bj/ +/[Bb]uild/ +/[Bb]uilds/ +/Logs +/[Uu]ser[Ss]ettings/ +*.log + +# By default unity supports Blender asset imports, *.blend1 blender files do not need to be commited to version control. +*.blend1 +*.blend1.meta + +# MemoryCaptures can get excessive in size. +# They also could contain extremely sensitive data +/[Mm]emoryCaptures/ + +# Recordings can get excessive in size +/[Rr]ecordings/ + +# Uncomment this line if you wish to ignore the asset store tools plugin +# /[Aa]ssets/AssetStoreTools* + +# Autogenerated Jetbrains Rider plugin +/[Aa]ssets/Plugins/Editor/JetBrains* +# Jetbrains Rider personal-layer settings +*.DotSettings.user + +# Visual Studio cache directory .vs/ -Temp/ -obj/ + +# Gradle cache directory +.gradle/ + +# Autogenerated VS/MD/Consulo solution and project files +ExportedObj/ +.consulo/ *.csproj +*.unityproj *.sln +*.suo +*.tmp +*.user *.userprefs -.vscode/ - -bin/ -obj/ -*.exe +*.pidb +*.booproj +*.svd *.pdb -*.user \ No newline at end of file +*.mdb +*.opendb +*.VC.db + +# Unity3D generated meta files +*.pidb.meta +*.pdb.meta +*.mdb.meta + +# Unity3D generated file on crash reports +sysinfo.txt + +# Mono auto generated files +mono_crash.* + +# Builds +*.apk +*.aab +*.unitypackage +*.unitypackage.meta +*.app + +# Crashlytics generated file +crashlytics-build.properties + +# TestRunner generated files +InitTestScene*.unity* + +# Addressables default ignores, before user customizations +/ServerData +/[Aa]ssets/StreamingAssets/aa* +/[Aa]ssets/AddressableAssetsData/link.xml* +/[Aa]ssets/Addressables_Temp* +# By default, Addressables content builds will generate addressables_content_state.bin +# files in platform-specific subfolders, for example: +# /Assets/AddressableAssetsData/OSX/addressables_content_state.bin +/[Aa]ssets/AddressableAssetsData/*/*.bin* + +# Visual Scripting auto-generated files +/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Flow/UnitOptions.db +/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Flow/UnitOptions.db.meta +/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Core/Property Providers +/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Core/Property Providers.meta + +# Auto-generated scenes by play mode tests +/[Aa]ssets/[Ii]nit[Tt]est[Ss]cene*.unity* +/Logs +Logs/shadercompiler-UnityShaderCompiler.exe-0.log +UserSettings/Layouts/default-6000.dwlt +*.log diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..ddb6ff8 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "visualstudiotoolsforunity.vstuc" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..da60e25 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,10 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Attach to Unity", + "type": "vstuc", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c1a7101 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,71 @@ +{ + "files.exclude": { + "**/.DS_Store": true, + "**/.git": true, + "**/.vs": true, + "**/.gitmodules": true, + "**/.vsconfig": true, + "**/*.booproj": true, + "**/*.pidb": true, + "**/*.suo": true, + "**/*.user": true, + "**/*.userprefs": true, + "**/*.unityproj": true, + "**/*.dll": true, + "**/*.exe": true, + "**/*.pdf": true, + "**/*.mid": true, + "**/*.midi": true, + "**/*.wav": true, + "**/*.gif": true, + "**/*.ico": true, + "**/*.jpg": true, + "**/*.jpeg": true, + "**/*.png": true, + "**/*.psd": true, + "**/*.tga": true, + "**/*.tif": true, + "**/*.tiff": true, + "**/*.3ds": true, + "**/*.3DS": true, + "**/*.fbx": true, + "**/*.FBX": true, + "**/*.lxo": true, + "**/*.LXO": true, + "**/*.ma": true, + "**/*.MA": true, + "**/*.obj": true, + "**/*.OBJ": true, + "**/*.asset": true, + "**/*.cubemap": true, + "**/*.flare": true, + "**/*.mat": true, + "**/*.meta": true, + "**/*.prefab": true, + "**/*.unity": true, + "build/": true, + "Build/": true, + "Library/": true, + "library/": true, + "obj/": true, + "Obj/": true, + "Logs/": true, + "logs/": true, + "ProjectSettings/": true, + "UserSettings/": true, + "temp/": true, + "Temp/": true + }, + "files.associations": { + "*.asset": "yaml", + "*.meta": "yaml", + "*.prefab": "yaml", + "*.unity": "yaml", + }, + "explorer.fileNesting.enabled": true, + "explorer.fileNesting.patterns": { + "*.sln": "*.csproj", + "*.slnx": "*.csproj" + }, + "dotnet.defaultSolution": "Open76.slnx" +} \ No newline at end of file diff --git a/Assets/InputSystem_Actions.inputactions b/Assets/InputSystem_Actions.inputactions new file mode 100644 index 0000000..1a12cb9 --- /dev/null +++ b/Assets/InputSystem_Actions.inputactions @@ -0,0 +1,1057 @@ +{ + "name": "InputSystem_Actions", + "maps": [ + { + "name": "Player", + "id": "df70fa95-8a34-4494-b137-73ab6b9c7d37", + "actions": [ + { + "name": "Move", + "type": "Value", + "id": "351f2ccd-1f9f-44bf-9bec-d62ac5c5f408", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Look", + "type": "Value", + "id": "6b444451-8a00-4d00-a97e-f47457f736a8", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Attack", + "type": "Button", + "id": "6c2ab1b8-8984-453a-af3d-a3c78ae1679a", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Interact", + "type": "Button", + "id": "852140f2-7766-474d-8707-702459ba45f3", + "expectedControlType": "Button", + "processors": "", + "interactions": "Hold", + "initialStateCheck": false + }, + { + "name": "Crouch", + "type": "Button", + "id": "27c5f898-bc57-4ee1-8800-db469aca5fe3", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Jump", + "type": "Button", + "id": "f1ba0d36-48eb-4cd5-b651-1c94a6531f70", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Previous", + "type": "Button", + "id": "2776c80d-3c14-4091-8c56-d04ced07a2b0", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Next", + "type": "Button", + "id": "b7230bb6-fc9b-4f52-8b25-f5e19cb2c2ba", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Sprint", + "type": "Button", + "id": "641cd816-40e6-41b4-8c3d-04687c349290", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + } + ], + "bindings": [ + { + "name": "", + "id": "978bfe49-cc26-4a3d-ab7b-7d7a29327403", + "path": "/leftStick", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "WASD", + "id": "00ca640b-d935-4593-8157-c05846ea39b3", + "path": "Dpad", + "interactions": "", + "processors": "", + "groups": "", + "action": "Move", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "e2062cb9-1b15-46a2-838c-2f8d72a0bdd9", + "path": "/w", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "8180e8bd-4097-4f4e-ab88-4523101a6ce9", + "path": "/upArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "320bffee-a40b-4347-ac70-c210eb8bc73a", + "path": "/s", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "1c5327b5-f71c-4f60-99c7-4e737386f1d1", + "path": "/downArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "d2581a9b-1d11-4566-b27d-b92aff5fabbc", + "path": "/a", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "2e46982e-44cc-431b-9f0b-c11910bf467a", + "path": "/leftArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "fcfe95b8-67b9-4526-84b5-5d0bc98d6400", + "path": "/d", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "77bff152-3580-4b21-b6de-dcd0c7e41164", + "path": "/rightArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "1635d3fe-58b6-4ba9-a4e2-f4b964f6b5c8", + "path": "/{Primary2DAxis}", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "3ea4d645-4504-4529-b061-ab81934c3752", + "path": "/stick", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "c1f7a91b-d0fd-4a62-997e-7fb9b69bf235", + "path": "/rightStick", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8c8e490b-c610-4785-884f-f04217b23ca4", + "path": "/delta", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse;Touch", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "3e5f5442-8668-4b27-a940-df99bad7e831", + "path": "/{Hatswitch}", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "143bb1cd-cc10-4eca-a2f0-a3664166fe91", + "path": "/buttonWest", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "05f6913d-c316-48b2-a6bb-e225f14c7960", + "path": "/leftButton", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "886e731e-7071-4ae4-95c0-e61739dad6fd", + "path": "/primaryTouch/tap", + "interactions": "", + "processors": "", + "groups": ";Touch", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "ee3d0cd2-254e-47a7-a8cb-bc94d9658c54", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8255d333-5683-4943-a58a-ccb207ff1dce", + "path": "/{PrimaryAction}", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "b3c1c7f0-bd20-4ee7-a0f1-899b24bca6d7", + "path": "/enter", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "cbac6039-9c09-46a1-b5f2-4e5124ccb5ed", + "path": "/2", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Next", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "e15ca19d-e649-4852-97d5-7fe8ccc44e94", + "path": "/dpad/right", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Next", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "f2e9ba44-c423-42a7-ad56-f20975884794", + "path": "/leftShift", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Sprint", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8cbb2f4b-a784-49cc-8d5e-c010b8c7f4e6", + "path": "/leftStickPress", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Sprint", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "d8bf24bf-3f2f-4160-a97c-38ec1eb520ba", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Sprint", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "eb40bb66-4559-4dfa-9a2f-820438abb426", + "path": "/space", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "daba33a1-ad0c-4742-a909-43ad1cdfbeb6", + "path": "/buttonSouth", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "603f3daf-40bd-4854-8724-93e8017f59e3", + "path": "/secondaryButton", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "1534dc16-a6aa-499d-9c3a-22b47347b52a", + "path": "/1", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Previous", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "25060bbd-a3a6-476e-8fba-45ae484aad05", + "path": "/dpad/left", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Previous", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "1c04ea5f-b012-41d1-a6f7-02e963b52893", + "path": "/e", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Interact", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "b3f66d0b-7751-423f-908b-a11c5bd95930", + "path": "/buttonNorth", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Interact", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4f4649ac-64a8-4a73-af11-b3faef356a4d", + "path": "/buttonEast", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Crouch", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "36e52cba-0905-478e-a818-f4bfcb9f3b9a", + "path": "/c", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Crouch", + "isComposite": false, + "isPartOfComposite": false + } + ] + }, + { + "name": "UI", + "id": "272f6d14-89ba-496f-b7ff-215263d3219f", + "actions": [ + { + "name": "Navigate", + "type": "PassThrough", + "id": "c95b2375-e6d9-4b88-9c4c-c5e76515df4b", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Submit", + "type": "Button", + "id": "7607c7b6-cd76-4816-beef-bd0341cfe950", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Cancel", + "type": "Button", + "id": "15cef263-9014-4fd5-94d9-4e4a6234a6ef", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Point", + "type": "PassThrough", + "id": "32b35790-4ed0-4e9a-aa41-69ac6d629449", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Click", + "type": "PassThrough", + "id": "3c7022bf-7922-4f7c-a998-c437916075ad", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "RightClick", + "type": "PassThrough", + "id": "44b200b1-1557-4083-816c-b22cbdf77ddf", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "MiddleClick", + "type": "PassThrough", + "id": "dad70c86-b58c-4b17-88ad-f5e53adf419e", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "ScrollWheel", + "type": "PassThrough", + "id": "0489e84a-4833-4c40-bfae-cea84b696689", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "TrackedDevicePosition", + "type": "PassThrough", + "id": "24908448-c609-4bc3-a128-ea258674378a", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "TrackedDeviceOrientation", + "type": "PassThrough", + "id": "9caa3d8a-6b2f-4e8e-8bad-6ede561bd9be", + "expectedControlType": "Quaternion", + "processors": "", + "interactions": "", + "initialStateCheck": false + } + ], + "bindings": [ + { + "name": "Gamepad", + "id": "809f371f-c5e2-4e7a-83a1-d867598f40dd", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "14a5d6e8-4aaf-4119-a9ef-34b8c2c548bf", + "path": "/leftStick/up", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "9144cbe6-05e1-4687-a6d7-24f99d23dd81", + "path": "/rightStick/up", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "2db08d65-c5fb-421b-983f-c71163608d67", + "path": "/leftStick/down", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "58748904-2ea9-4a80-8579-b500e6a76df8", + "path": "/rightStick/down", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "8ba04515-75aa-45de-966d-393d9bbd1c14", + "path": "/leftStick/left", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "712e721c-bdfb-4b23-a86c-a0d9fcfea921", + "path": "/rightStick/left", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "fcd248ae-a788-4676-a12e-f4d81205600b", + "path": "/leftStick/right", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "1f04d9bc-c50b-41a1-bfcc-afb75475ec20", + "path": "/rightStick/right", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "fb8277d4-c5cd-4663-9dc7-ee3f0b506d90", + "path": "/dpad", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "Joystick", + "id": "e25d9774-381c-4a61-b47c-7b6b299ad9f9", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "3db53b26-6601-41be-9887-63ac74e79d19", + "path": "/stick/up", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "0cb3e13e-3d90-4178-8ae6-d9c5501d653f", + "path": "/stick/down", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "0392d399-f6dd-4c82-8062-c1e9c0d34835", + "path": "/stick/left", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "942a66d9-d42f-43d6-8d70-ecb4ba5363bc", + "path": "/stick/right", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "Keyboard", + "id": "ff527021-f211-4c02-933e-5976594c46ed", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "563fbfdd-0f09-408d-aa75-8642c4f08ef0", + "path": "/w", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "eb480147-c587-4a33-85ed-eb0ab9942c43", + "path": "/upArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "2bf42165-60bc-42ca-8072-8c13ab40239b", + "path": "/s", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "85d264ad-e0a0-4565-b7ff-1a37edde51ac", + "path": "/downArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "74214943-c580-44e4-98eb-ad7eebe17902", + "path": "/a", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "cea9b045-a000-445b-95b8-0c171af70a3b", + "path": "/leftArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "8607c725-d935-4808-84b1-8354e29bab63", + "path": "/d", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "4cda81dc-9edd-4e03-9d7c-a71a14345d0b", + "path": "/rightArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "9e92bb26-7e3b-4ec4-b06b-3c8f8e498ddc", + "path": "*/{Submit}", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR", + "action": "Submit", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "82627dcc-3b13-4ba9-841d-e4b746d6553e", + "path": "*/{Cancel}", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR", + "action": "Cancel", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "c52c8e0b-8179-41d3-b8a1-d149033bbe86", + "path": "/position", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "e1394cbc-336e-44ce-9ea8-6007ed6193f7", + "path": "/position", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "5693e57a-238a-46ed-b5ae-e64e6e574302", + "path": "/touch*/position", + "interactions": "", + "processors": "", + "groups": "Touch", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4faf7dc9-b979-4210-aa8c-e808e1ef89f5", + "path": "/leftButton", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8d66d5ba-88d7-48e6-b1cd-198bbfef7ace", + "path": "/tip", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "47c2a644-3ebc-4dae-a106-589b7ca75b59", + "path": "/touch*/press", + "interactions": "", + "processors": "", + "groups": "Touch", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "bb9e6b34-44bf-4381-ac63-5aa15d19f677", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "38c99815-14ea-4617-8627-164d27641299", + "path": "/scroll", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "ScrollWheel", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4c191405-5738-4d4b-a523-c6a301dbf754", + "path": "/rightButton", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "RightClick", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "24066f69-da47-44f3-a07e-0015fb02eb2e", + "path": "/middleButton", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "MiddleClick", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "7236c0d9-6ca3-47cf-a6ee-a97f5b59ea77", + "path": "/devicePosition", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "TrackedDevicePosition", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "23e01e3a-f935-4948-8d8b-9bcac77714fb", + "path": "/deviceRotation", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "TrackedDeviceOrientation", + "isComposite": false, + "isPartOfComposite": false + } + ] + } + ], + "controlSchemes": [ + { + "name": "Keyboard&Mouse", + "bindingGroup": "Keyboard&Mouse", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + }, + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "Gamepad", + "bindingGroup": "Gamepad", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "Touch", + "bindingGroup": "Touch", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "Joystick", + "bindingGroup": "Joystick", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "XR", + "bindingGroup": "XR", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + } + ] +} \ No newline at end of file diff --git a/Assets/InputSystem_Actions.inputactions.meta b/Assets/InputSystem_Actions.inputactions.meta new file mode 100644 index 0000000..982f9ed --- /dev/null +++ b/Assets/InputSystem_Actions.inputactions.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 289c1b55c9541489481df5cc06664110 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} + generateWrapperCode: 0 + wrapperCodePath: + wrapperClassName: + wrapperCodeNamespace: diff --git a/Assets/Resources/Materials/TracerAdditive.mat b/Assets/Resources/Materials/TracerAdditive.mat new file mode 100644 index 0000000..aa8dbf5 --- /dev/null +++ b/Assets/Resources/Materials/TracerAdditive.mat @@ -0,0 +1,106 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: TracerAdditive + m_Shader: {fileID: 211, guid: 0000000000000000f000000000000000, type: 0} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _ALPHABLEND_ON + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: + - GRABPASS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 10300, guid: 0000000000000000f000000000000000, type: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BlendOp: 0 + - _BumpScale: 1 + - _CameraFadingEnabled: 0 + - _CameraFarFadeDistance: 2 + - _CameraNearFadeDistance: 1 + - _ColorMode: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DistortionBlend: 0.5 + - _DistortionEnabled: 0 + - _DistortionStrength: 1 + - _DistortionStrengthScaled: 0 + - _DstBlend: 1 + - _EmissionEnabled: 0 + - _FlipbookMode: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _LightingEnabled: 0 + - _Metallic: 0 + - _Mode: 4 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SoftParticlesEnabled: 0 + - _SoftParticlesFarFadeDistance: 1 + - _SoftParticlesNearFadeDistance: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} + - _Color: {r: 0.8113208, g: 0.38353303, b: 0, a: 1} + - _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Resources/Materials/TracerAdditive.mat.meta b/Assets/Resources/Materials/TracerAdditive.mat.meta new file mode 100644 index 0000000..fe6e2a3 --- /dev/null +++ b/Assets/Resources/Materials/TracerAdditive.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b8b4fcaa80bb4634dac5ebf2acbb3327 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Materials/TracerMaterial.mat b/Assets/Resources/Materials/TracerMaterial.mat new file mode 100644 index 0000000..09b5c1b --- /dev/null +++ b/Assets/Resources/Materials/TracerMaterial.mat @@ -0,0 +1,106 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: TracerMaterial + m_Shader: {fileID: 211, guid: 0000000000000000f000000000000000, type: 0} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _ALPHABLEND_ON + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: + - GRABPASS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 10300, guid: 0000000000000000f000000000000000, type: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BlendOp: 0 + - _BumpScale: 1 + - _CameraFadingEnabled: 0 + - _CameraFarFadeDistance: 2 + - _CameraNearFadeDistance: 1 + - _ColorMode: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DistortionBlend: 0.5 + - _DistortionEnabled: 0 + - _DistortionStrength: 1 + - _DistortionStrengthScaled: 0 + - _DstBlend: 10 + - _EmissionEnabled: 0 + - _FlipbookMode: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _LightingEnabled: 0 + - _Metallic: 0 + - _Mode: 2 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SoftParticlesEnabled: 0 + - _SoftParticlesFarFadeDistance: 1 + - _SoftParticlesNearFadeDistance: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} + - _Color: {r: 1, g: 0.7019608, b: 0.2627451, a: 1} + - _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Resources/Materials/TracerMaterial.mat.meta b/Assets/Resources/Materials/TracerMaterial.mat.meta new file mode 100644 index 0000000..b8637dd --- /dev/null +++ b/Assets/Resources/Materials/TracerMaterial.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4d831cbf152f1b041a67e6ccfb41ca57 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Prefabs/ProjectilePrefab.prefab b/Assets/Resources/Prefabs/ProjectilePrefab.prefab index 3c98dd7..442e13c 100644 --- a/Assets/Resources/Prefabs/ProjectilePrefab.prefab +++ b/Assets/Resources/Prefabs/ProjectilePrefab.prefab @@ -1,21 +1,11 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 0} - m_RootGameObject: {fileID: 1659379701980452} - m_IsPrefabAsset: 1 --- !u!1 &1659379701980452 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 4590032960292014} @@ -23,6 +13,7 @@ GameObject: - component: {fileID: 23963930231516730} - component: {fileID: 65995705008649512} - component: {fileID: 114016533403440828} + - component: {fileID: 3828283572028341590} m_Layer: 0 m_Name: ProjectilePrefab m_TagString: Untagged @@ -32,31 +23,51 @@ GameObject: m_IsActive: 1 --- !u!4 &4590032960292014 Transform: - m_ObjectHideFlags: 1 + m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1659379701980452} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &33052770494592386 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1659379701980452} + m_Mesh: {fileID: 0} --- !u!23 &23963930231516730 MeshRenderer: - m_ObjectHideFlags: 1 + m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1659379701980452} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 0 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 m_Materials: - {fileID: 0} m_StaticBatchInfo: @@ -66,6 +77,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -75,36 +87,152 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!33 &33052770494592386 -MeshFilter: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1659379701980452} - m_Mesh: {fileID: 0} + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!65 &65995705008649512 BoxCollider: - m_ObjectHideFlags: 1 + m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1659379701980452} m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 m_IsTrigger: 1 + m_ProvidesContacts: 0 m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} --- !u!114 &114016533403440828 MonoBehaviour: - m_ObjectHideFlags: 1 + m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1659379701980452} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 38049252fe4d9a044957d98fd0ffe0a7, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!96 &3828283572028341590 +TrailRenderer: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1659379701980452} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_Time: 0.1 + m_PreviewTimeScale: 1 + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0.1042941 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 0.7019608, b: 0.2627451, a: 1} + key1: {r: 1, g: 1, b: 1, a: 0} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 0 + textureScale: {x: 1, y: 1} + shadowBias: 0.5 + generateLightingData: 0 + m_MinVertexDistance: 0.1 + m_Autodestruct: 0 + m_Emitting: 1 + m_ApplyActiveColorSpace: 1 diff --git a/Assets/Scenes/Level.meta b/Assets/Scenes/Level.meta new file mode 100644 index 0000000..4f57403 --- /dev/null +++ b/Assets/Scenes/Level.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3867fd23c319eb944be8b697fdb23f9f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Level.unity b/Assets/Scenes/Level.unity index 330af55..2986cb5 100644 --- a/Assets/Scenes/Level.unity +++ b/Assets/Scenes/Level.unity @@ -13,7 +13,7 @@ OcclusionCullingSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 9 + serializedVersion: 10 m_Fog: 1 m_FogColor: {r: 0.53333336, g: 0.7568628, b: 0.9215687, a: 1} m_FogMode: 1 @@ -38,13 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 11 - m_GIWorkflowMode: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -67,9 +66,6 @@ LightmapSettings: m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 m_ReflectionCompression: 2 m_MixedBakeMode: 1 m_BakeBackend: 0 @@ -97,14 +93,15 @@ LightmapSettings: m_ExportTrainingData: 0 m_TrainingDataDestination: TrainingData m_LightProbeSampleCountMultiplier: 4 - m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 0 + m_LightingDataAsset: {fileID: 112000000, guid: e511016e55db7f4498a689d71aab9f83, + type: 2} + m_LightingSettings: {fileID: 2138307879} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -117,7 +114,9 @@ NavMeshSettings: cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 debug: m_Flags: 0 m_NavMeshData: {fileID: 0} @@ -131,7 +130,7 @@ GameObject: m_Component: - component: {fileID: 802766081} - component: {fileID: 802766080} - - component: {fileID: 802766079} + - component: {fileID: 802766082} m_Layer: 0 m_Name: MusicPlayer m_TagString: Untagged @@ -139,19 +138,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &802766079 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 802766078} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 2aa754c18b4306f488a8f6241c278891, type: 3} - m_Name: - m_EditorClassIdentifier: - Filepath: --- !u!82 &802766080 AudioSource: m_ObjectHideFlags: 0 @@ -163,6 +149,7 @@ AudioSource: serializedVersion: 4 OutputAudioMixerGroup: {fileID: 0} m_audioClip: {fileID: 0} + m_Resource: {fileID: 0} m_PlayOnAwake: 1 m_Volume: 1 m_Pitch: 1 @@ -255,18 +242,33 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 802766078} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &802766082 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 802766078} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 23c83d9bcf84aba46822289615518f97, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Assets.Scripts.MusicPlayer + MinTrackIndex: 2 + MaxTrackIndex: 18 + PlayOnStart: 1 --- !u!1 &831432015 GameObject: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 1858029681538958, guid: 3a9fc58e372f04d4680310fcc6b5c117, - type: 3} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 @@ -285,8 +287,7 @@ GameObject: --- !u!114 &831432016 MonoBehaviour: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 114412119079015014, guid: 3a9fc58e372f04d4680310fcc6b5c117, - type: 3} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 831432015} @@ -297,11 +298,11 @@ MonoBehaviour: m_EditorClassIdentifier: Speed: {x: 0.05, y: 0.05} Height: 1 + _textureFileName: --- !u!23 &831432017 MeshRenderer: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 23562869983257242, guid: 3a9fc58e372f04d4680310fcc6b5c117, - type: 3} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 831432015} @@ -309,10 +310,17 @@ MeshRenderer: m_CastShadows: 0 m_ReceiveShadows: 0 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -334,14 +342,16 @@ MeshRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &831432018 MeshFilter: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 33582019575132086, guid: 3a9fc58e372f04d4680310fcc6b5c117, - type: 3} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 831432015} @@ -349,17 +359,17 @@ MeshFilter: --- !u!4 &831432019 Transform: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 4822924353810136, guid: 3a9fc58e372f04d4680310fcc6b5c117, - type: 3} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 831432015} + serializedVersion: 2 m_LocalRotation: {x: 1, y: -0, z: -0, w: 0} m_LocalPosition: {x: 0, y: 100, z: 0} m_LocalScale: {x: 1000, y: 1, z: 1000} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 180, y: 0, z: 0} --- !u!1 &966376020 GameObject: @@ -371,7 +381,7 @@ GameObject: m_Component: - component: {fileID: 966376023} - component: {fileID: 966376022} - - component: {fileID: 966376021} + - component: {fileID: 966376024} m_Layer: 0 m_Name: EventSystem m_TagString: Untagged @@ -379,25 +389,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &966376021 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 966376020} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 0 --- !u!114 &966376022 MonoBehaviour: m_ObjectHideFlags: 0 @@ -420,13 +411,56 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 966376020} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &966376024 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 966376020} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.UI.InputSystemUIInputModule + m_SendPointerHoverToParent: 1 + m_MoveRepeatDelay: 0.5 + m_MoveRepeatRate: 0.1 + m_XRTrackingOrigin: {fileID: 0} + m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_DeselectOnBackgroundClick: 1 + m_PointerBehavior: 0 + m_CursorLockBehavior: 0 + m_ScrollDeltaPerTick: 6 --- !u!1 &1024800517 GameObject: m_ObjectHideFlags: 0 @@ -454,9 +488,9 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1441108047} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -488,6 +522,7 @@ MonoBehaviour: m_ChildControlHeight: 0 m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 --- !u!1 &1097909173 GameObject: m_ObjectHideFlags: 0 @@ -513,15 +548,14 @@ Light: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1097909173} m_Enabled: 1 - serializedVersion: 10 + serializedVersion: 12 m_Type: 1 - m_Shape: 0 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 m_Range: 10 m_SpotAngle: 30 m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 + m_CookieSize2D: {x: 10, y: 10} m_Shadows: m_Type: 2 m_Resolution: -1 @@ -564,8 +598,13 @@ Light: m_UseColorTemperature: 0 m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ForceVisible: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 --- !u!4 &1097909175 Transform: m_ObjectHideFlags: 0 @@ -573,12 +612,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1097909173} + serializedVersion: 2 m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} --- !u!1 &1211648312 GameObject: @@ -594,6 +634,7 @@ GameObject: - component: {fileID: 1211648313} - component: {fileID: 1211648319} - component: {fileID: 1211648318} + - component: {fileID: 1211648320} m_Layer: 0 m_Name: Camera m_TagString: MainCamera @@ -631,9 +672,17 @@ Camera: m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 m_SensorSize: {x: 36, y: 24} m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -667,12 +716,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1211648312} + serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1211648318 MonoBehaviour: @@ -703,6 +753,18 @@ MonoBehaviour: Height: 4 HeightDamping: 10 RotationDamping: 3 +--- !u!114 &1211648320 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1211648312} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dbca5db164730964593c7a40ea8de689, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::FSMCamera --- !u!1 &1285842486 GameObject: m_ObjectHideFlags: 0 @@ -761,6 +823,7 @@ MonoBehaviour: m_FallbackScreenDPI: 96 m_DefaultSpriteDPI: 96 m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 --- !u!223 &1285842490 Canvas: m_ObjectHideFlags: 0 @@ -778,7 +841,9 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -792,10 +857,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1441108047} m_Father: {fileID: 0} - m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -851,11 +916,11 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1614982628} - {fileID: 1024800518} m_Father: {fileID: 1285842491} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -908,9 +973,9 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: -1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1441108047} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -932,6 +997,8 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -980,6 +1047,7 @@ AudioSource: serializedVersion: 4 OutputAudioMixerGroup: {fileID: 0} m_audioClip: {fileID: 0} + m_Resource: {fileID: 0} m_PlayOnAwake: 1 m_Volume: 0.502 m_Pitch: 1 @@ -1077,9 +1145,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 76f779bb12e4ae04b95b0c2c559468b6, type: 3} m_Name: m_EditorClassIdentifier: - GamePath: E:\i76 + GamePath: C:\Program Files (x86)\GOG Galaxy\Games\Interstate 76 MissionFile: m01.msn VcfToLoad: vppirna1.vcf + MusicMinIndex: 2 + MusicMaxIndex: 18 --- !u!4 &1712330285 Transform: m_ObjectHideFlags: 0 @@ -1087,12 +1157,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1712330282} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1712330287 MonoBehaviour: @@ -1106,3 +1177,81 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 0353162ef6dc79d458de412f4d61ed39, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!850595691 &2138307879 +LightingSettings: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Settings.lighting + serializedVersion: 10 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_RealtimeEnvironmentLighting: 1 + m_BounceScale: 1 + m_AlbedoBoost: 1 + m_IndirectOutputScale: 1 + m_UsingShadowmask: 0 + m_BakeBackend: 1 + m_LightmapMaxSize: 1024 + m_LightmapSizeFixed: 0 + m_UseMipmapLimits: 1 + m_BakeResolution: 40 + m_Padding: 2 + m_LightmapCompression: 3 + m_LightmapPackingMode: 1 + m_LightmapPackingMethod: 0 + m_XAtlasPackingAttempts: 16384 + m_XAtlasBruteForce: 0 + m_XAtlasBlockAlign: 0 + m_XAtlasRepackUnderutilizedLightmaps: 1 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAO: 0 + m_MixedBakeMode: 1 + m_LightmapsBakeMode: 1 + m_FilterMode: 1 + m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} + m_ExportTrainingData: 0 + m_EnableWorkerProcessBaking: 1 + m_TrainingDataDestination: TrainingData + m_RealtimeResolution: 2 + m_ForceWhiteAlbedo: 0 + m_ForceUpdates: 0 + m_PVRCulling: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVREnvironmentSampleCount: 512 + m_PVREnvironmentReferencePointCount: 2048 + m_LightProbeSampleCountMultiplier: 4 + m_PVRBounces: 2 + m_PVRMinBounces: 2 + m_PVREnvironmentImportanceSampling: 0 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_RespectSceneVisibilityWhenBakingGI: 0 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1712330285} + - {fileID: 1097909175} + - {fileID: 831432019} + - {fileID: 1211648317} + - {fileID: 1285842491} + - {fileID: 966376023} + - {fileID: 802766081} diff --git a/Assets/Scenes/Level/LightingData.asset b/Assets/Scenes/Level/LightingData.asset new file mode 100644 index 0000000..227b7a2 Binary files /dev/null and b/Assets/Scenes/Level/LightingData.asset differ diff --git a/Assets/Scenes/Level/LightingData.asset.meta b/Assets/Scenes/Level/LightingData.asset.meta new file mode 100644 index 0000000..557b620 --- /dev/null +++ b/Assets/Scenes/Level/LightingData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e511016e55db7f4498a689d71aab9f83 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 112000000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity new file mode 100644 index 0000000..2221b04 --- /dev/null +++ b/Assets/Scenes/SampleScene.unity @@ -0,0 +1,267 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 705507994} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &705507993 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 705507995} + - component: {fileID: 705507994} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &705507994 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 705507993} + m_Enabled: 1 + serializedVersion: 8 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 1 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &705507995 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 705507993} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &963194225 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 963194228} + - component: {fileID: 963194227} + - component: {fileID: 963194226} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &963194226 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 +--- !u!20 &963194227 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_GateFitMode: 2 + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &963194228 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scenes/SampleScene.unity.meta b/Assets/Scenes/SampleScene.unity.meta new file mode 100644 index 0000000..952bd1e --- /dev/null +++ b/Assets/Scenes/SampleScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9fc0d4010bbf28b4594072e72b8655ab +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Camera/CameraController.cs b/Assets/Scripts/Camera/CameraController.cs index bc9dd89..5531e7c 100644 --- a/Assets/Scripts/Camera/CameraController.cs +++ b/Assets/Scripts/Camera/CameraController.cs @@ -1,7 +1,10 @@ -using Assets.Scripts.CarSystems; +using System.Collections.Generic; +using Assets.Scripts.CarSystems; using Assets.Scripts.Entities; using UnityEngine; using UnityEngine.XR; +// 1. Add New Input System Namespace +using UnityEngine.InputSystem; namespace Assets.Scripts.Camera { @@ -10,6 +13,13 @@ public class CameraController : MonoBehaviour { private SmoothFollow _smoothFollow; private Car _player; + + // Cached references + private Transform _thirdPersonChassis; + private Transform _firstPersonChassis; + private RaySusp[] _suspensions; + private List _vlocPoints = new List(); + private bool _referencesInitialized = false; public bool FirstPerson { get; private set; } @@ -20,109 +30,152 @@ private enum ChassisView AllHidden } - // Use this for initialization private void Start() { _smoothFollow = GetComponent(); } - // Update is called once per frame private void Update() { - if (!CameraManager.Instance.IsMainCameraActive) + if (CameraManager.Instance != null && !CameraManager.Instance.IsMainCameraActive) { return; } if (_player == null) { - Transform target = _smoothFollow.Target; - if (target != null) - { - _player = target.GetComponent(); - } + AttemptFindPlayer(); + return; } - else + + if (!_player.Alive) { - if (!_player.Alive) + if (FirstPerson) { SetCameraThirdPerson(); FirstPerson = false; - return; } + return; } - if (Input.GetKeyDown(KeyCode.F1)) - { - SetCameraFirstPersonAtVLOCIndex(0); - SetVisibleChassisModel(ChassisView.FirstPerson); - FirstPerson = true; - } - else if (Input.GetKeyDown(KeyCode.F2)) + HandleViewSwitching(); + HandleXRInput(); + + if (FirstPerson) { - SetCameraThirdPerson(); - FirstPerson = false; + HandleFirstPersonRotation(); } - else if (Input.GetKeyDown(KeyCode.F3)) + } + + private void AttemptFindPlayer() + { + Transform target = _smoothFollow.Target; + if (target != null) { - SetCameraFirstPersonAtVLOCIndex(1); - SetVisibleChassisModel(ChassisView.AllHidden); - FirstPerson = false; + _player = target.GetComponent(); + if (_player != null && !_referencesInitialized) + { + InitializePlayerReferences(); + } } - else if (Input.GetKeyDown(KeyCode.F4)) + } + + private void InitializePlayerReferences() + { + _thirdPersonChassis = _player.transform.Find("Chassis/ThirdPerson"); + _firstPersonChassis = _player.transform.Find("Chassis/FirstPerson"); + _suspensions = _player.GetComponentsInChildren(); + + _vlocPoints.Clear(); + foreach (Transform child in _player.transform) { - SetCameraAtWheelIndex(0); - SetVisibleChassisModel(ChassisView.ThirdPerson); - FirstPerson = false; + if (child.name == "VLOC") + { + _vlocPoints.Add(child); + } } - else if (Input.GetKeyDown(KeyCode.F5)) + _referencesInitialized = true; + } + + private void HandleViewSwitching() + { + // 2. Poll Keyboard safely + var kb = Keyboard.current; + if (kb == null) return; + + // F1 - F3: Main Views + if (kb.f1Key.wasPressedThisFrame) { - SetCameraAtWheelIndex(1); - SetVisibleChassisModel(ChassisView.ThirdPerson); - FirstPerson = false; + SetCameraFirstPersonAtVLOCIndex(0); + SetVisibleChassisModel(ChassisView.FirstPerson); + FirstPerson = true; } - else if (Input.GetKeyDown(KeyCode.F6)) + else if (kb.f2Key.wasPressedThisFrame) { - SetCameraAtWheelIndex(2); - SetVisibleChassisModel(ChassisView.ThirdPerson); + SetCameraThirdPerson(); FirstPerson = false; } - else if (Input.GetKeyDown(KeyCode.F7)) + else if (kb.f3Key.wasPressedThisFrame) { - SetCameraAtWheelIndex(3); - SetVisibleChassisModel(ChassisView.ThirdPerson); + SetCameraFirstPersonAtVLOCIndex(1); + SetVisibleChassisModel(ChassisView.AllHidden); FirstPerson = false; } + // F4 - F7: Wheel Views + else if (kb.f4Key.wasPressedThisFrame) SwitchToWheel(0); + else if (kb.f5Key.wasPressedThisFrame) SwitchToWheel(1); + else if (kb.f6Key.wasPressedThisFrame) SwitchToWheel(2); + else if (kb.f7Key.wasPressedThisFrame) SwitchToWheel(3); + } - if(Input.GetKeyDown(KeyCode.R)) - { - InputTracking.Recenter(); - } + private void SwitchToWheel(int index) + { + SetCameraAtWheelIndex(index); + SetVisibleChassisModel(ChassisView.ThirdPerson); + FirstPerson = false; + } - if (FirstPerson) + private void HandleXRInput() + { + // Reset VR position + if (Keyboard.current != null && Keyboard.current.rKey.wasPressedThisFrame) { - Quaternion targetRotation = Quaternion.Euler(-14, 0, 0); - if (Input.GetKey(KeyCode.Keypad6)) - targetRotation = Quaternion.Euler(-14, 90, 0); - else if (Input.GetKey(KeyCode.Keypad2)) - targetRotation = Quaternion.Euler(-14, 180, 0); - else if (Input.GetKey(KeyCode.Keypad4)) - targetRotation = Quaternion.Euler(-14, -90, 0); - if (Input.GetKey(KeyCode.Keypad8)) - targetRotation = Quaternion.Euler(7, 0, 0); - - transform.localRotation = Quaternion.Slerp(transform.localRotation, targetRotation, Time.deltaTime * 6); + var subsystems = new List(); + SubsystemManager.GetSubsystems(subsystems); + if (subsystems.Count > 0) + { + subsystems[0].TryRecenter(); + } } } + private void HandleFirstPersonRotation() + { + var kb = Keyboard.current; + if (kb == null) return; + + Quaternion targetRotation = Quaternion.Euler(-14, 0, 0); + + // Numpad Look logic using 'isPressed' + if (kb.numpad6Key.isPressed) targetRotation = Quaternion.Euler(-14, 90, 0); // Right + else if (kb.numpad2Key.isPressed) targetRotation = Quaternion.Euler(-14, 180, 0); // Back + else if (kb.numpad4Key.isPressed) targetRotation = Quaternion.Euler(-14, -90, 0); // Left + + if (kb.numpad8Key.isPressed) targetRotation = Quaternion.Euler(7, 0, 0); // Up + + transform.localRotation = Quaternion.Slerp(transform.localRotation, targetRotation, Time.deltaTime * 6); + } + private void SetCameraAtWheelIndex(int wheelIndex) { - var suspensions = _player.GetComponentsInChildren(); - if(wheelIndex < suspensions.Length) - { - var wheel = suspensions[wheelIndex].transform; - var target = wheel.Find("Mesh").GetChild(0); + if (_suspensions == null || wheelIndex >= _suspensions.Length) return; + var wheel = _suspensions[wheelIndex].transform; + var meshTransform = wheel.Find("Mesh"); + + if (meshTransform != null && meshTransform.childCount > 0) + { + var target = meshTransform.GetChild(0); transform.parent = wheel; transform.localPosition = target.localPosition; transform.localRotation = Quaternion.Euler(-14, 0, 0); @@ -141,26 +194,13 @@ private void SetCameraThirdPerson() private void SetCameraFirstPersonAtVLOCIndex(int vlocIndex) { - int i = 0; - Transform vloc = null; - foreach (Transform child in _player.transform) - { - if (child.name == "VLOC") - { - if (i == vlocIndex) - { - vloc = child; - } - i++; - } - } - - if (vloc == null) + if (vlocIndex >= _vlocPoints.Count) { - Debug.LogWarning("Cannot find VLOC with index " + vlocIndex); + Debug.LogWarning($"Cannot find VLOC with index {vlocIndex}"); return; } + Transform vloc = _vlocPoints[vlocIndex]; transform.parent = vloc; transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.Euler(-14, 0, 0); @@ -169,26 +209,24 @@ private void SetCameraFirstPersonAtVLOCIndex(int vlocIndex) private void SetVisibleChassisModel(ChassisView chassisView) { - var thirdPerson = _player.transform.Find("Chassis/ThirdPerson"); - thirdPerson.gameObject.SetActive(chassisView == ChassisView.ThirdPerson); + if (_thirdPersonChassis != null) + _thirdPersonChassis.gameObject.SetActive(chassisView == ChassisView.ThirdPerson); - var firstPerson = _player.transform.Find("Chassis/FirstPerson"); - firstPerson.gameObject.SetActive(chassisView == ChassisView.FirstPerson); + if (_firstPersonChassis != null) + _firstPersonChassis.gameObject.SetActive(chassisView == ChassisView.FirstPerson); - var suspensions = _player.GetComponentsInChildren(); - foreach (var suspension in suspensions) + if (_suspensions != null) { - suspension.SetWheelVisibile(chassisView == ChassisView.ThirdPerson); - } + bool showWheels = (chassisView == ChassisView.ThirdPerson); + foreach (var suspension in _suspensions) + { + suspension.SetWheelVisibile(showWheels); + } + } } public void SetCameraPositionAndLookAt(Vector3 position, Vector3 lookat) { - //var world = GameObject.Find("World"); - //var worldPos = world.transform.position; - //position += worldPos; - //lookat += worldPos; - transform.position = position; transform.LookAt(lookat); } diff --git a/Assets/Scripts/Camera/CameraManager.cs b/Assets/Scripts/Camera/CameraManager.cs index 26e49a2..cdc1d23 100644 --- a/Assets/Scripts/Camera/CameraManager.cs +++ b/Assets/Scripts/Camera/CameraManager.cs @@ -6,18 +6,42 @@ namespace Assets.Scripts.Camera public class CameraManager { private readonly Stack _cameraStack; - private readonly GameObject _mainCameraObject; + private GameObject _mainCameraObject; // Changed to simple GameObject reference private bool _audioEnabled; + // Singleton Instance + private static CameraManager _instance; + public static CameraManager Instance + { + get + { + if (_instance == null) + _instance = new CameraManager(); + return _instance; + } + } + + // Helper to safely get the Unity Camera component public UnityEngine.Camera MainCamera { - get { return _mainCameraObject != null ? _mainCameraObject.GetComponent() : null; } + get + { + // Safety check: If scene reloaded, this might be null or "missing" + if (_mainCameraObject == null) return null; + return _mainCameraObject.GetComponent(); + } } public FSMCamera ActiveCamera { get { + // Clean up stack if objects were destroyed externally + while (_cameraStack.Count > 0 && _cameraStack.Peek() == null) + { + _cameraStack.Pop(); + } + if (_cameraStack.Count > 0) { return _cameraStack.Peek(); @@ -27,79 +51,118 @@ public FSMCamera ActiveCamera } } - private static CameraManager _instance; - - public static CameraManager Instance - { - get { return _instance ?? (_instance = new CameraManager()); } - } - public bool AudioEnabled { get { return _audioEnabled; } set { - if (_audioEnabled == value) - { - return; - } - _audioEnabled = value; - if (_cameraStack.Count > 0) - { - var camera = _cameraStack.Peek(); - camera.GetComponent().enabled = value; - } - else - { - MainCamera.GetComponent().enabled = value; - } + UpdateAudioListenerState(); } } public bool IsMainCameraActive { - get { return MainCamera == ActiveCamera; } + get + { + if (MainCamera == null || ActiveCamera == null) return false; + // Compare GameObjects, not Component types + return MainCamera.gameObject == ActiveCamera.gameObject; + } } - private CameraManager() +private CameraManager() { _cameraStack = new Stack(); - var mainCamera = Object.FindObjectOfType(); - _mainCameraObject = mainCamera.gameObject; - _cameraStack.Push(mainCamera); + _audioEnabled = true; + + // 1. Try to find an existing FSMCamera + var targetCamera = Object.FindFirstObjectByType(); + + // 2. If missing, find the standard Unity Camera and auto-add the script + if (targetCamera == null) + { + var vanillaCamera = Object.FindFirstObjectByType(); + if (vanillaCamera != null) + { + Debug.Log("CameraManager: FSMCamera component missing. Auto-adding it to " + vanillaCamera.name); + targetCamera = vanillaCamera.gameObject.AddComponent(); + } + } + + // 3. Initialize Stack + if (targetCamera != null) + { + _mainCameraObject = targetCamera.gameObject; + _cameraStack.Push(targetCamera); + } + else + { + Debug.LogError("CameraManager: CRITICAL - No Camera found in scene at all!"); + } + _audioEnabled = true; } public void PushCamera() { - if (_cameraStack.Count > 0) + // 1. Disable current top camera + if (_cameraStack.Count > 0 && _cameraStack.Peek() != null) { - var camera = _cameraStack.Peek(); - camera.gameObject.SetActive(false); + var currentCamera = _cameraStack.Peek(); + currentCamera.gameObject.SetActive(false); } - GameObject newCameraObject = new GameObject("Stack Camera " + _cameraStack.Count); + // 2. Create new Camera + GameObject newCameraObject = new GameObject("Stack Camera " + (_cameraStack.Count + 1)); newCameraObject.AddComponent(); + // Copy clear flags/depth from main if needed? usually desirable. + var newCamera = newCameraObject.AddComponent(); newCameraObject.AddComponent(); + + // 3. Push and Update Audio _cameraStack.Push(newCamera); + UpdateAudioListenerState(); } public void PopCamera() { - if (_cameraStack.Count == 0) - { - return; - } + if (_cameraStack.Count == 0) return; + // 1. Remove and Destroy current var stackCamera = _cameraStack.Pop(); - Object.Destroy(stackCamera.gameObject); + if (stackCamera != null) + { + Object.Destroy(stackCamera.gameObject); + } + // 2. Re-enable the previous camera if (_cameraStack.Count > 0) { - var camera = _cameraStack.Peek(); - camera.gameObject.SetActive(false); + var previousCamera = _cameraStack.Peek(); + if (previousCamera != null) + { + // FIXED: Was SetActive(false), must be true to restore it + previousCamera.gameObject.SetActive(true); + + // Ensure audio state is correct for the restored camera + UpdateAudioListenerState(); + } + } + } + + // Helper to apply audio settings to the CURRENTLY active camera + private void UpdateAudioListenerState() + { + var activeCam = ActiveCamera; + if (activeCam != null) + { + var listener = activeCam.GetComponent(); + if (listener != null) + { + listener.enabled = _audioEnabled; + } } } @@ -108,10 +171,11 @@ public void Destroy() while (_cameraStack.Count > 0) { var stackCamera = _cameraStack.Pop(); - Object.Destroy(stackCamera.gameObject); + if (stackCamera != null) + Object.Destroy(stackCamera.gameObject); } _instance = null; } } -} +} \ No newline at end of file diff --git a/Assets/Scripts/CarSystems/CarAI.cs b/Assets/Scripts/CarSystems/CarAI.cs index 2f5a746..4adf93e 100644 --- a/Assets/Scripts/CarSystems/CarAI.cs +++ b/Assets/Scripts/CarSystems/CarAI.cs @@ -105,7 +105,7 @@ public void Navigate() pos2D.x = pos.x - _lastRoadOffset.x; pos2D.y = pos.z - _lastRoadOffset.y; - float velocity = _rigidBody.velocity.magnitude; + float velocity = _rigidBody.linearVelocity.magnitude; float distanceTreshold = Constants.PathMinDistanceTreshold; // Find the closest road point. diff --git a/Assets/Scripts/CarSystems/CarInput.cs b/Assets/Scripts/CarSystems/CarInput.cs index 967981f..c72c5d7 100644 --- a/Assets/Scripts/CarSystems/CarInput.cs +++ b/Assets/Scripts/CarSystems/CarInput.cs @@ -1,6 +1,8 @@ using Assets.Scripts.Camera; using Assets.Scripts.Entities; using UnityEngine; +// 1. Add the New Input System Namespace +using UnityEngine.InputSystem; namespace Assets.Scripts.CarSystems { @@ -17,108 +19,103 @@ private void Start() private void Update() { - if (!CameraManager.Instance.IsMainCameraActive || !_car.Alive) + // Safety Checks + if (CameraManager.Instance == null || !CameraManager.Instance.IsMainCameraActive || !_car.Alive) { return; } - // Kill player. - if (Input.GetKeyDown(KeyCode.K)) - { - _car.Kill(); - } + // 2. Poll Input Devices safely + var kb = Keyboard.current; + var gp = Gamepad.current; - // Debug: Toggle all AI cars to fire. - if (Input.GetKeyDown(KeyCode.Z)) + // If no keyboard connected (e.g. console/mobile), skip keyboard blocks to avoid null errors + if (kb != null) { - Car.FireWeapons = !Car.FireWeapons; - } + // --- System Commands --- + if (kb.kKey.wasPressedThisFrame) _car.Kill(); + if (kb.zKey.wasPressedThisFrame) Car.FireWeapons = !Car.FireWeapons; + if (kb.sKey.wasPressedThisFrame) _car.ToggleEngine(); - // Cycle radar target. - if (Input.GetKeyDown(KeyCode.E)) - { - _car.RadarPanel.CycleTarget(); - } + // --- Radar Controls --- + if (kb.eKey.wasPressedThisFrame) _car.RadarPanel.CycleTarget(); + if (kb.rKey.wasPressedThisFrame) _car.RadarPanel.ToggleRange(); + if (kb.tKey.wasPressedThisFrame) _car.RadarPanel.TargetNearest(); + if (kb.yKey.wasPressedThisFrame) _car.RadarPanel.ClearTarget(); - // Toggle radar range. - if (Input.GetKeyDown(KeyCode.R)) - { - _car.RadarPanel.ToggleRange(); + // --- Weapon Cycling --- + if (kb.enterKey.wasPressedThisFrame) _car.WeaponsController.CycleWeapon(); } - // Target nearest enemy. - if (Input.GetKeyDown(KeyCode.T)) - { - _car.RadarPanel.TargetNearest(); - } + // --- Firing Logic (Keyboard) --- + bool isFiringAnything = false; - // Clear radar target. - if (Input.GetKeyDown(KeyCode.Y)) + if (kb != null) { - _car.RadarPanel.ClearTarget(); - } + if (kb.spaceKey.isPressed) + { + _car.WeaponsController.Fire(-1); + isFiringAnything = true; + } + else if (kb.digit1Key.isPressed) { _car.WeaponsController.Fire(0); isFiringAnything = true; } + else if (kb.digit2Key.isPressed) { _car.WeaponsController.Fire(1); isFiringAnything = true; } + else if (kb.digit3Key.isPressed) { _car.WeaponsController.Fire(2); isFiringAnything = true; } + else if (kb.digit4Key.isPressed) { _car.WeaponsController.Fire(3); isFiringAnything = true; } + else if (kb.digit5Key.isPressed) { _car.WeaponsController.Fire(4); isFiringAnything = true; } + else if (kb.digit6Key.isPressed) { _car.SpecialsController.Fire(0); isFiringAnything = true; } - // Cycle weapon. - if (Input.GetKeyDown(KeyCode.Return)) - { - _car.WeaponsController.CycleWeapon(); + if (kb.digit7Key.isPressed) _car.SpecialsController.Fire(1); + if (kb.digit8Key.isPressed) _car.SpecialsController.Fire(2); } - // Fire active weapon(s). - if (Input.GetKey(KeyCode.Space)) - { - _car.WeaponsController.Fire(-1); - } - else if (Input.GetKey(KeyCode.Alpha1)) // Fire weapon 1. - { - _car.WeaponsController.Fire(0); - } - else if (Input.GetKey(KeyCode.Alpha2)) // Fire weapon 2. - { - _car.WeaponsController.Fire(1); - } - else if (Input.GetKey(KeyCode.Alpha3)) // Fire weapon 3. + // Gamepad Firing (Right Trigger) + if (gp != null && gp.rightTrigger.isPressed) { - _car.WeaponsController.Fire(2); + _car.WeaponsController.Fire(-1); + isFiringAnything = true; } - else if (Input.GetKey(KeyCode.Alpha4)) // Fire weapon 4. - { - _car.WeaponsController.Fire(3); - } - else if (Input.GetKey(KeyCode.Alpha5)) // Fire weapon 5. - { - _car.WeaponsController.Fire(4); - } - else if (Input.GetKey(KeyCode.Alpha6)) // Fire special 1. - { - _car.SpecialsController.Fire(0); - } - else + + if (!isFiringAnything) { _car.WeaponsController.StopFiring(); } - // Fire special 2. - if (Input.GetKey(KeyCode.Alpha7)) - { - _car.SpecialsController.Fire(1); - } + // --- Driving Physics --- + float throttleInput = 0f; + float steeringInput = 0f; + bool eBrakeInput = false; - // Fire special 3. - if (Input.GetKey(KeyCode.Alpha8)) + // Keyboard Axis Calculation (Simulating GetAxis("Vertical")) + if (kb != null) { - _car.SpecialsController.Fire(2); + // Throttle (W / Up Arrow) + if (kb.wKey.isPressed || kb.upArrowKey.isPressed) throttleInput += 1f; + // Brake/Reverse (S / Down Arrow) + if (kb.sKey.isPressed || kb.downArrowKey.isPressed) throttleInput -= 1f; + + // Steering (A / D / Arrows) + if (kb.dKey.isPressed || kb.rightArrowKey.isPressed) steeringInput += 1f; + if (kb.aKey.isPressed || kb.leftArrowKey.isPressed) steeringInput -= 1f; + + // E-Brake (Shift) + if (kb.leftShiftKey.isPressed) eBrakeInput = true; } - // Start / Stop engine. - if (Input.GetKeyDown(KeyCode.S)) + // Gamepad Axis Calculation + if (gp != null) { - _car.ToggleEngine(); + throttleInput += gp.leftStick.y.ReadValue(); + steeringInput += gp.leftStick.x.ReadValue(); + if (gp.buttonSouth.isPressed) eBrakeInput = true; // A/Cross button } - float throttle = Input.GetAxis("Vertical"); - float brake = -Mathf.Min(0, throttle); - throttle = Mathf.Max(0, throttle); + // Clamp values + throttleInput = Mathf.Clamp(throttleInput, -1f, 1f); + steeringInput = Mathf.Clamp(steeringInput, -1f, 1f); + + // Physics Application + float throttle = Mathf.Max(0, throttleInput); + float brake = -Mathf.Min(0, throttleInput); if (!_car.EngineRunning) { @@ -127,14 +124,8 @@ private void Update() _carPhysics.Throttle = throttle; _carPhysics.Brake = brake; - - float steering = Input.GetAxis("Horizontal"); - _carPhysics.Steer = steering; - - _carPhysics.EBrake = Input.GetButton("E-brake"); - // _car.RearSlip = ebrake; - + _carPhysics.Steer = steeringInput; + _carPhysics.EBrake = eBrakeInput; } } - } \ No newline at end of file diff --git a/Assets/Scripts/CarSystems/CarPhysics.cs b/Assets/Scripts/CarSystems/CarPhysics.cs index bf74b95..f9ddb17 100644 --- a/Assets/Scripts/CarSystems/CarPhysics.cs +++ b/Assets/Scripts/CarSystems/CarPhysics.cs @@ -151,7 +151,7 @@ private void UpdateSurfaceSound() if (_surfaceAudioSource != null) { - _surfaceAudioSource.volume = Mathf.Min(_rigidbody.velocity.magnitude * 0.025f, 0.6f); + _surfaceAudioSource.volume = Mathf.Min(_rigidbody.linearVelocity.magnitude * 0.025f, 0.6f); if (!_surfaceAudioSource.isPlaying) { _surfaceAudioSource.Play(); @@ -200,7 +200,7 @@ public void FixedUpdate() _airTime = 0.0f; UpdateSurfaceSound(); - Vector3 vel3d = transform.InverseTransformVector(_rigidbody.velocity); + Vector3 vel3d = transform.InverseTransformVector(_rigidbody.linearVelocity); _carVelocity = new Vector2(vel3d.z, vel3d.x); @@ -212,7 +212,7 @@ public void FixedUpdate() if (Mathf.Abs(Throttle) < 0.1 && Mathf.Abs(_speed) < 0.5f) { - _rigidbody.velocity = Vector3.zero; + _rigidbody.linearVelocity = Vector3.zero; _carVelocity = Vector2.zero; _speed = 0; _rigidbody.angularVelocity = Vector3.zero; @@ -273,7 +273,7 @@ public void FixedUpdate() _carAcceleration = Time.deltaTime * forces / _rigidbody.mass; Vector3 worldAcceleration = transform.TransformVector(new Vector3(_carAcceleration.y, 0, _carAcceleration.x)); - _rigidbody.velocity += worldAcceleration; + _rigidbody.linearVelocity += worldAcceleration; } //private void OnGUI() diff --git a/Assets/Scripts/Entities/Car.cs b/Assets/Scripts/Entities/Car.cs index 37694b9..479c7e3 100644 --- a/Assets/Scripts/Entities/Car.cs +++ b/Assets/Scripts/Entities/Car.cs @@ -1,4 +1,7 @@ using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; using Assets.Scripts.Camera; using Assets.Scripts.CarSystems; using Assets.Scripts.CarSystems.Ui; @@ -15,239 +18,126 @@ public enum DamageType Force } + [RequireComponent(typeof(Rigidbody))] + [RequireComponent(typeof(CarPhysics))] public class Car : WorldEntity { public static bool FireWeapons; - private const int VehicleStartHealth = 550; // TODO: Figure out where this is stored? - private const int CoreStartHealth = 250; // TODO: Figure out where this is stored? - private const int TireStartHealth = 100; // TODO: Parse. + // Constants + private const int VehicleStartHealth = 550; + private const int CoreStartHealth = 250; + private const int TireStartHealth = 100; + // Components & References private Transform _transform; private Rigidbody _rigidBody; + private CarPhysics _carPhysics; + private CameraController _camera; + private AudioSource _engineStartSound; + private AudioSource _engineLoopSound; + private Transform _thirdPersonChassis; + // Controllers public WeaponsController WeaponsController; public SpecialsController SpecialsController; public SystemsPanel SystemsPanel; public GearPanel GearPanel; public RadarPanel RadarPanel; + public CarAI AI { get; private set; } private CompassPanel _compassPanel; - private CameraController _camera; + + // State Data private int _vehicleHealthGroups; private int _currentVehicleHealthGroup; - private AudioSource _engineStartSound; - private AudioSource _engineLoopSound; private bool _engineStarting; private float _engineStartTimer; - private GameObject _gameObject; - private CacheManager _cacheManager; + + // Health Data private int[] _vehicleHitPoints; private int[] _vehicleStartHitPoints; + private Dictionary> _visualDamageParts; // Cached visual parts + // Properties public bool EngineRunning { get; private set; } public bool Arrived { get; set; } public Vdf Vdf { get; private set; } public Vcf Vcf { get; private set; } - - public override bool Alive - { - get { return GetComponentHealth(SystemType.Vehicle) > 0; } - } - public bool Attacked { get; private set; } public int TeamId { get; set; } public bool IsPlayer { get; set; } public int Skill1 { get; set; } public int Skill2 { get; set; } public int Aggressiveness { get; set; } - - public CarAI AI { get; private set; } - - private CarPhysics _carPhysics; - private int GetComponentHealth(SystemType healthType) - { - return _vehicleHitPoints[(int)healthType]; - } - - private int GetHealthGroup(SystemType system) + public override bool Alive { - int systemValue = (int)system; - int healthGroupCount; - int startHealth; - - if (system == SystemType.Vehicle) - { - healthGroupCount = _vehicleHealthGroups; - startHealth = _vehicleStartHitPoints[systemValue]; - } - else - { - healthGroupCount = 5; - startHealth = _vehicleStartHitPoints[systemValue]; - } - - if (_vehicleHitPoints[systemValue] <= 0) - { - return healthGroupCount - 1; - } - - --healthGroupCount; - int healthGroup = Mathf.CeilToInt(_vehicleHitPoints[systemValue] / (float)startHealth * healthGroupCount); - return healthGroupCount - healthGroup; + get { return GetComponentHealth(SystemType.Vehicle) > 0; } } - private void SetComponentHealth(SystemType system, int value) + private void Awake() { - if (!Alive) - { - return; - } - - _vehicleHitPoints[(int)system] = value; + _transform = transform; + _rigidBody = GetComponent(); + _carPhysics = GetComponent(); - if (system == SystemType.Vehicle) - { - SetHealthGroup(GetHealthGroup(system)); - if (value <= 0) - { - Explode(); - } - } - else + // Safety check for Camera Manager + if (CameraManager.Instance.MainCamera != null) { - int newValue = _vehicleHitPoints[(int)system]; - if (newValue < 0) - { - SystemType coreComponent = GetCoreComponent(); - SetComponentHealth(coreComponent, _vehicleHitPoints[(int)coreComponent] + newValue); - _vehicleHitPoints[(int)system] = 0; - } + _camera = CameraManager.Instance.MainCamera.GetComponent(); } - // Update UI - if (SystemsPanel != null && system != SystemType.Vehicle) - { - SystemsPanel.SetSystemHealthGroup(system, GetHealthGroup(system), true); - } + AI = new CarAI(this); + EngineRunning = true; + _currentVehicleHealthGroup = 1; + _visualDamageParts = new Dictionary>(); } - private SystemType GetCoreComponent() + private void Start() { - SystemType system; - - SystemType[] coreSystems = - { - SystemType.Vehicle, - SystemType.Brakes, - SystemType.Engine, - SystemType.Suspension - }; - - int iterations = 0; - const int maxIterations = 20; - - do - { - int coreIndex = Random.Range(0, coreSystems.Length); - system = coreSystems[coreIndex]; - ++iterations; - } while (GetComponentHealth(system) == 0 && iterations < maxIterations); + EntityManager.Instance.RegisterCar(this); + UpdateEngineSounds(); - if (iterations == maxIterations) - { - return SystemType.Vehicle; - } + Transform firstPersonTransform = _transform.Find("Chassis/FirstPerson"); + WeaponsController = new WeaponsController(this, Vcf, firstPersonTransform); + SpecialsController = new SpecialsController(Vcf, firstPersonTransform); - return system; + // FIX: Start the stabilization routine + StartCoroutine(StabilizeSpawnPhysics()); } - public override void ApplyDamage(DamageType damageType, Vector3 normal, int damageAmount) + private IEnumerator StabilizeSpawnPhysics() { - float angle = Quaternion.FromToRotation(Vector3.up, normal).eulerAngles.z; - - // TODO: Figure out how tire damage should be applied here. - - SystemType system; - switch (damageType) + // 1. Lock the car in place so gravity doesn't pull it through the floor + if (_rigidBody != null) { - case DamageType.Force: - if (angle >= 45f && angle < 135f) - { - system = SystemType.RightChassis; - } - else if (angle >= 135f && angle < 225f) - { - system = SystemType.BackChassis; - } - else if (angle >= 225f && angle < 315f) - { - system = SystemType.LeftChassis; - } - else - { - system = SystemType.FrontChassis; - } - break; - case DamageType.Projectile: - if (angle >= 45f && angle < 135f) - { - system = SystemType.RightArmor; - } - else if (angle >= 135f && angle < 225f) - { - system = SystemType.BackArmor; - } - else if (angle >= 225f && angle < 315f) - { - system = SystemType.LeftArmor; - } - else - { - system = SystemType.FrontArmor; - } - break; - default: - throw new NotSupportedException("Invalid damage type."); + _rigidBody.isKinematic = true; } - int currentHealth = GetComponentHealth(system); - SetComponentHealth(system, currentHealth - damageAmount); - } + // 2. Wait for 2 physics frames. + // This gives the TerrainCollider time to generate and register with the physics engine. + yield return new WaitForFixedUpdate(); + yield return new WaitForFixedUpdate(); - public void ToggleEngine() - { - if (_engineStartSound == null || _engineStartSound.isPlaying) + // 3. Optional: Snap to ground one last time if we have a valid Raycast + // (Only do this if you aren't spawning in mid-air on purpose) + RaycastHit hit; + if (Physics.Raycast(transform.position + Vector3.up * 5f, Vector3.down, out hit, 10f, LayerMask.GetMask("Terrain", "Default"))) { - return; + transform.position = hit.point + Vector3.up * 0.5f; // Slight buffer } - if (EngineRunning) + // 4. Release the car + if (_rigidBody != null) { - _engineLoopSound.Stop(); - EngineRunning = false; - } - else - { - _engineStartSound.Play(); - _engineStarting = true; - _engineStartTimer = 0f; + _rigidBody.isKinematic = false; + + // Reset any accumulated velocity from the spawn frame + _rigidBody.linearVelocity = Vector3.zero; // Note: Use .velocity in older Unity versions + _rigidBody.angularVelocity = Vector3.zero; } } - private void Awake() - { - _transform = transform; - _gameObject = gameObject; - _cacheManager = CacheManager.Instance; - _carPhysics = GetComponent(); - AI = new CarAI(this); - _camera = CameraManager.Instance.MainCamera.GetComponent(); - _rigidBody = GetComponent(); - EngineRunning = true; - _currentVehicleHealthGroup = 1; - } - public void Configure(Vdf vdf, Vcf vcf) { Vdf = vdf; @@ -255,50 +145,74 @@ public void Configure(Vdf vdf, Vcf vcf) _vehicleHealthGroups = Vdf.PartsThirdPerson.Count; - int systemCount = (int) SystemType.TotalSystems; + // Initialize Health + InitializeHealthData(); + + // Cache Visuals + CacheDamageVisuals(); + } + + private void InitializeHealthData() + { + int systemCount = (int)SystemType.TotalSystems; _vehicleHitPoints = new int[systemCount]; _vehicleStartHitPoints = new int[systemCount]; + // Core _vehicleStartHitPoints[(int)SystemType.Vehicle] = VehicleStartHealth; _vehicleStartHitPoints[(int)SystemType.Suspension] = CoreStartHealth; _vehicleStartHitPoints[(int)SystemType.Brakes] = CoreStartHealth; _vehicleStartHitPoints[(int)SystemType.Engine] = CoreStartHealth; - _vehicleStartHitPoints[(int)SystemType.FrontArmor] = (int)vcf.ArmorFront; - _vehicleStartHitPoints[(int)SystemType.RightArmor] = (int)vcf.ArmorRight; - _vehicleStartHitPoints[(int)SystemType.BackArmor] = (int)vcf.ArmorRear; - _vehicleStartHitPoints[(int)SystemType.LeftArmor] = (int)vcf.ArmorLeft; + // Armor + _vehicleStartHitPoints[(int)SystemType.FrontArmor] = (int)Vcf.ArmorFront; + _vehicleStartHitPoints[(int)SystemType.RightArmor] = (int)Vcf.ArmorRight; + _vehicleStartHitPoints[(int)SystemType.BackArmor] = (int)Vcf.ArmorRear; + _vehicleStartHitPoints[(int)SystemType.LeftArmor] = (int)Vcf.ArmorLeft; - _vehicleStartHitPoints[(int)SystemType.FrontChassis] = (int)vcf.ChassisFront; - _vehicleStartHitPoints[(int)SystemType.RightChassis] = (int)vcf.ChassisRight; - _vehicleStartHitPoints[(int)SystemType.BackChassis] = (int)vcf.ChassisRear; - _vehicleStartHitPoints[(int)SystemType.LeftChassis] = (int)vcf.ChassisLeft; + // Chassis + _vehicleStartHitPoints[(int)SystemType.FrontChassis] = (int)Vcf.ChassisFront; + _vehicleStartHitPoints[(int)SystemType.RightChassis] = (int)Vcf.ChassisRight; + _vehicleStartHitPoints[(int)SystemType.BackChassis] = (int)Vcf.ChassisRear; + _vehicleStartHitPoints[(int)SystemType.LeftChassis] = (int)Vcf.ChassisLeft; + // Tires _vehicleStartHitPoints[(int)SystemType.TireFL] = TireStartHealth; _vehicleStartHitPoints[(int)SystemType.TireFR] = TireStartHealth; _vehicleStartHitPoints[(int)SystemType.TireBL] = TireStartHealth; _vehicleStartHitPoints[(int)SystemType.TireBR] = TireStartHealth; - for (int i = 0; i < systemCount; ++i) - { - _vehicleHitPoints[i] = _vehicleStartHitPoints[i]; - } + // Reset current HP to max + Array.Copy(_vehicleStartHitPoints, _vehicleHitPoints, systemCount); } - private void Start() + private void CacheDamageVisuals() { - EntityManager.Instance.RegisterCar(this); + _thirdPersonChassis = transform.Find("Chassis/ThirdPerson"); + if (_thirdPersonChassis == null) return; - UpdateEngineSounds(); - - Transform firstPersonTransform = _transform.Find("Chassis/FirstPerson"); - WeaponsController = new WeaponsController(this, Vcf, firstPersonTransform); - SpecialsController = new SpecialsController(Vcf, firstPersonTransform); + // We expect child objects named "Health 0", "Health 1", etc. + // We group them here so we don't have to .Find() them during combat + for (int i = 0; i < _vehicleHealthGroups; ++i) + { + var part = _thirdPersonChassis.Find("Health " + i); + if (part != null) + { + // If you have multiple parts per group, logic goes here. + // Assuming 1:1 mapping based on original code. + if (!_visualDamageParts.ContainsKey(i)) + _visualDamageParts[i] = new List(); + + _visualDamageParts[i].Add(part); + } + } } public void InitPanels() { Transform firstPersonTransform = _transform.Find("Chassis/FirstPerson"); + if (firstPersonTransform == null) return; + SystemsPanel = new SystemsPanel(firstPersonTransform); GearPanel = new GearPanel(firstPersonTransform); _compassPanel = new CompassPanel(firstPersonTransform); @@ -307,27 +221,44 @@ public void InitPanels() private void Update() { - if (!Alive) - { - return; - } + if (!Alive) return; - if (EngineRunning) + HandleEngineAudio(); + HandleUIUpdates(); + HandleAIAndWeapons(); + } + + private void HandleEngineAudio() + { + if (EngineRunning && _engineLoopSound != null) { - // Simple and temporary engine pitch adjustment code based on rigidbody velocity - should be using wheels. + // Replaced 'while' loop with math for safety and performance const float firstGearTopSpeed = 40f; const float gearRatioAdjustment = 1.5f; const float minPitch = 0.6f; const float maxPitch = 1.2f; - float velocity = _rigidBody.velocity.magnitude; - float gearMaxSpeed = firstGearTopSpeed; - while (velocity / gearMaxSpeed > maxPitch - minPitch) + // Unity 6 uses linearVelocity, older uses velocity. + // Using velocity for LTS compatibility. + float velocity = _rigidBody.linearVelocity.magnitude; + + float currentGearMax = firstGearTopSpeed; + + // Simulate gear shifting mathematically + // If velocity > gearMax, we are in higher gears + while (velocity > currentGearMax && currentGearMax < 200f) // Cap at 200 to prevent infinite { - gearMaxSpeed *= gearRatioAdjustment; + currentGearMax *= gearRatioAdjustment; } - float enginePitch = minPitch + velocity / gearMaxSpeed; + // Calculate ratio within current gear + float gearStartSpeed = currentGearMax / gearRatioAdjustment; + float ratio = (velocity - gearStartSpeed) / (currentGearMax - gearStartSpeed); + // Clamp ratio for safety (0 to 1) + ratio = Mathf.Clamp01(Mathf.Max(0, (velocity - (currentGearMax/gearRatioAdjustment)) / (currentGearMax - (currentGearMax/gearRatioAdjustment)))); + + // Simplified pitch logic + float enginePitch = Mathf.Lerp(minPitch, maxPitch, (velocity / currentGearMax)); _engineLoopSound.pitch = enginePitch; } @@ -342,82 +273,228 @@ private void Update() _engineStartTimer = 0f; } } + } - if (_camera.FirstPerson) + private void HandleUIUpdates() + { + if (_camera != null && _camera.FirstPerson) { if (_compassPanel != null) - { _compassPanel.UpdateCompassHeading(_transform.eulerAngles.y); - } } - - // Always process radar panel, even outside first person view. + if (RadarPanel != null) - { RadarPanel.Update(); - } + } - if (!IsPlayer || !CameraManager.Instance.IsMainCameraActive) + private void HandleAIAndWeapons() + { + bool mainCameraActive = CameraManager.Instance.IsMainCameraActive; + + if (!IsPlayer || !mainCameraActive) { AI.Navigate(); } - if (!IsPlayer && FireWeapons) + if (!IsPlayer && FireWeapons && WeaponsController != null) + { + WeaponsController.Fire(0); + } + } + + // --- Health & Damage System --- + + public override void ApplyDamage(DamageType damageType, Vector3 normal, int damageAmount) + { + // Determine quadrant based on angle + float angle = Quaternion.FromToRotation(Vector3.up, normal).eulerAngles.z; + SystemType targetSystem = GetSystemFromAngle(angle, damageType); + + int currentHealth = GetComponentHealth(targetSystem); + SetComponentHealth(targetSystem, currentHealth - damageAmount); + } + + private SystemType GetSystemFromAngle(float angle, DamageType type) + { + // Normalize angle to 0-360 + if (angle < 0) angle += 360f; + + // Quadrant Logic + // Front: 315 - 45 + // Right: 45 - 135 + // Back: 135 - 225 + // Left: 225 - 315 + + bool isRight = angle >= 45f && angle < 135f; + bool isBack = angle >= 135f && angle < 225f; + bool isLeft = angle >= 225f && angle < 315f; + + if (type == DamageType.Force) + { + if (isRight) return SystemType.RightChassis; + if (isBack) return SystemType.BackChassis; + if (isLeft) return SystemType.LeftChassis; + return SystemType.FrontChassis; + } + else // Projectile + { + if (isRight) return SystemType.RightArmor; + if (isBack) return SystemType.BackArmor; + if (isLeft) return SystemType.LeftArmor; + return SystemType.FrontArmor; + } + } + + private int GetComponentHealth(SystemType healthType) + { + return _vehicleHitPoints[(int)healthType]; + } + + private void SetComponentHealth(SystemType system, int value) + { + if (!Alive) return; + + int sysIndex = (int)system; + _vehicleHitPoints[sysIndex] = value; + + if (system == SystemType.Vehicle) { - if (WeaponsController != null) + UpdateVisualHealthGroup(GetHealthGroup(system)); + if (value <= 0) Explode(); + } + else + { + // Pass through damage to core if component destroyed + if (_vehicleHitPoints[sysIndex] < 0) { - WeaponsController.Fire(0); + int overflowDamage = _vehicleHitPoints[sysIndex]; // This is negative + _vehicleHitPoints[sysIndex] = 0; + + SystemType coreComponent = GetCoreComponent(); + SetComponentHealth(coreComponent, GetComponentHealth(coreComponent) + overflowDamage); } } + + // Update UI + if (SystemsPanel != null && system != SystemType.Vehicle) + { + SystemsPanel.SetSystemHealthGroup(system, GetHealthGroup(system), true); + } } - - private void SetHealthGroup(int healthGroupIndex) + + private void UpdateVisualHealthGroup(int healthGroupIndex) { + if (_currentVehicleHealthGroup == healthGroupIndex) return; + _currentVehicleHealthGroup = healthGroupIndex; - Transform parent = transform.Find("Chassis/ThirdPerson"); - for (int i = 0; i < _vehicleHealthGroups; ++i) + + // Optimized: Use cached dictionary instead of .Find() + foreach (var kvp in _visualDamageParts) { - Transform child = parent.Find("Health " + i); - child.gameObject.SetActive(healthGroupIndex == i); + int groupIndex = kvp.Key; + bool isActive = (groupIndex == healthGroupIndex); + + foreach(var part in kvp.Value) + { + if(part.gameObject.activeSelf != isActive) + part.gameObject.SetActive(isActive); + } } } - private void Explode() + private int GetHealthGroup(SystemType system) { - _rigidBody.AddForce(Vector3.up * _rigidBody.mass * 5f, ForceMode.Impulse); + int sysIndex = (int)system; + int startHealth = _vehicleStartHitPoints[sysIndex]; + int currentHealth = _vehicleHitPoints[sysIndex]; + + // If dead, return the last group (most damaged) + int healthGroupCount = (system == SystemType.Vehicle) ? _vehicleHealthGroups : 5; + + if (currentHealth <= 0) return healthGroupCount - 1; + + // Calculate percentage + float pct = (float)currentHealth / startHealth; + // Map percentage to group index (inverted: 100% is group 0, 0% is group MAX) + int group = Mathf.CeilToInt(pct * (healthGroupCount - 1)); + + return (healthGroupCount - 1) - group; + } + + private SystemType GetCoreComponent() + { + SystemType[] coreSystems = { + SystemType.Vehicle, SystemType.Brakes, SystemType.Engine, SystemType.Suspension + }; + + // Filter for only alive systems to avoid infinite loops + var aliveSystems = coreSystems.Where(s => GetComponentHealth(s) > 0).ToList(); + + if (aliveSystems.Count > 0) + { + return aliveSystems[Random.Range(0, aliveSystems.Count)]; + } - CarInput carInputController = GetComponent(); - if (carInputController != null) + return SystemType.Vehicle; // Fallback + } + + // --- Core Mechanics --- + + public void ToggleEngine() + { + if (_engineStartSound == null || _engineStartSound.isPlaying) return; + + if (EngineRunning) { - Destroy(carInputController); + _engineLoopSound.Stop(); + EngineRunning = false; } + else + { + _engineStartSound.Play(); + _engineStarting = true; + _engineStartTimer = 0f; + } + } + + private void Explode() + { + _rigidBody.AddForce(Vector3.up * _rigidBody.mass * 5f, ForceMode.Impulse); - AudioSource explosionSource = _cacheManager.GetAudioSource(_gameObject, "xcar"); - if (explosionSource != null) + CarInput carInput = GetComponent(); + if (carInput != null) Destroy(carInput); + + AudioSource explosion = CacheManager.Instance.GetAudioSource(gameObject, "xcar"); + if (explosion != null) { - explosionSource.volume = 0.9f; - explosionSource.Play(); + explosion.volume = 0.9f; + explosion.Play(); } EngineRunning = false; - Destroy(_engineLoopSound); - Destroy(_engineStartSound); + if(_engineLoopSound) Destroy(_engineLoopSound); + if(_engineStartSound) Destroy(_engineStartSound); - Destroy(_carPhysics); + // Cleanup Components + if(_carPhysics) Destroy(_carPhysics); _carPhysics = null; AI = null; - WeaponsController = null; SpecialsController = null; SystemsPanel = null; - GearPanel = null; - _compassPanel = null; RadarPanel = null; + + // Visual Detachment (Using Find here is acceptable as it happens once on death) + DetachPart("FrontLeft"); + DetachPart("FrontRight"); + DetachPart("BackLeft"); + DetachPart("BackRight"); + } - Destroy(transform.Find("FrontLeft").gameObject); - Destroy(transform.Find("FrontRight").gameObject); - Destroy(transform.Find("BackLeft").gameObject); - Destroy(transform.Find("BackRight").gameObject); + private void DetachPart(string partName) + { + Transform t = transform.Find(partName); + if (t != null) Destroy(t.gameObject); } public void Kill() @@ -427,137 +504,68 @@ public void Kill() public void Sit() { - _carPhysics.Brake = 1.0f; - AI.Sit(); + if(_carPhysics != null) _carPhysics.Brake = 1.0f; + if(AI != null) AI.Sit(); } - private void OnDrawGizmos() - { - if (AI != null) - { - AI.DrawGizmos(); - } - } - - private void OnDestroy() - { - EntityManager.Instance.UnregisterCar(this); - } + // --- AI Delegates --- public void SetSpeed(int targetSpeed) { - _rigidBody.velocity = _transform.forward * targetSpeed; + _rigidBody.linearVelocity = _transform.forward * targetSpeed; } - public bool AtFollowTarget() - { - if (AI != null) - { - return AI.AtFollowTarget(); - } - - return false; - } + public bool AtFollowTarget() => AI != null && AI.AtFollowTarget(); + public void SetFollowTarget(Car targetCar, int xOffset, int targetSpeed) => AI?.SetFollowTarget(targetCar, xOffset, targetSpeed); + public void SetTargetPath(FSMPath path, int targetSpeed) => AI?.SetTargetPath(path, targetSpeed); + public bool IsWithinNav(FSMPath path, int distance) => AI != null && AI.IsWithinNav(path, distance); - public void SetFollowTarget(Car targetCar, int xOffset, int targetSpeed) - { - if (AI != null) - { - AI.SetFollowTarget(targetCar, xOffset, targetSpeed); - } - } - - public void SetTargetPath(FSMPath path, int targetSpeed) + private void OnDrawGizmos() { - if (AI != null) - { - AI.SetTargetPath(path, targetSpeed); - } + if (AI != null) AI.DrawGizmos(); } - public bool IsWithinNav(FSMPath path, int distance) + private void OnDestroy() { - if (AI != null) - { - return AI.IsWithinNav(path, distance); - } - - return false; + if(EntityManager.Instance != null) + EntityManager.Instance.UnregisterCar(this); } private void UpdateEngineSounds() { - string engineStartSound; - string engineLoopSound; + string startName = ""; + string loopName = ""; switch (Vdf.VehicleSize) { - case 1: // Small car - engineLoopSound = "eishp"; - engineStartSound = "esshp"; - engineStartSound += _currentVehicleHealthGroup; - break; - case 2: // Medium car - engineLoopSound = "eihp"; - engineStartSound = "eshp"; - engineStartSound += _currentVehicleHealthGroup; - break; - case 3: // Large car - engineLoopSound = "einp1"; - engineStartSound = "esnp"; - engineStartSound += _currentVehicleHealthGroup; - break; - case 4: // Van - engineLoopSound = "eisv"; - engineStartSound = "essv"; - break; - case 5: // Heavy vehicle - engineLoopSound = "eimarx"; - engineStartSound = "esmarx"; - break; - case 6: // Tank - engineLoopSound = "eitank"; - engineStartSound = "estank"; - break; - default: - Debug.LogWarningFormat("Unhandled vehicle size '{0}'. No vehicle sounds loaded.", Vdf.VehicleSize); - return; + case 1: loopName = "eishp"; startName = "esshp" + _currentVehicleHealthGroup; break; + case 2: loopName = "eihp"; startName = "eshp" + _currentVehicleHealthGroup; break; + case 3: loopName = "einp1"; startName = "esnp" + _currentVehicleHealthGroup; break; + case 4: loopName = "eisv"; startName = "essv"; break; // Note: Van didn't have health group in original? + case 5: loopName = "eimarx"; startName = "esmarx"; break; + case 6: loopName = "eitank"; startName = "estank"; break; + default: Debug.LogWarning($"Unknown vehicle size {Vdf.VehicleSize}"); return; } - engineStartSound += ".gpw"; - engineLoopSound += ".gpw"; - if (_engineStartSound == null || _engineStartSound.clip.name != engineStartSound) - { - if (_engineStartSound != null) - { - Destroy(_engineStartSound); - } - - _engineStartSound = _cacheManager.GetAudioSource(_gameObject, engineStartSound); - if (_engineStartSound != null) - { - _engineStartSound.volume = 0.6f; - } - } + startName += ".gpw"; + loopName += ".gpw"; - if (_engineLoopSound == null || _engineLoopSound.clip.name != engineLoopSound) - { - if (_engineLoopSound != null) - { - Destroy(_engineLoopSound); - } + ReplaceAudioSource(ref _engineStartSound, startName, false); + ReplaceAudioSource(ref _engineLoopSound, loopName, true); + } - _engineLoopSound = _cacheManager.GetAudioSource(_gameObject, engineLoopSound); - if (_engineLoopSound != null) - { - _engineLoopSound.loop = true; - _engineLoopSound.volume = 0.6f; + private void ReplaceAudioSource(ref AudioSource source, string name, bool loop) + { + if (source != null && source.clip.name == name) return; // Already correct - if (EngineRunning) - { - _engineLoopSound.Play(); - } - } + if (source != null) Destroy(source); + + source = CacheManager.Instance.GetAudioSource(gameObject, name); + if (source != null) + { + source.volume = 0.6f; + source.loop = loop; + if (loop && EngineRunning) source.Play(); } } } diff --git a/Assets/Scripts/Entities/Sign.cs b/Assets/Scripts/Entities/Sign.cs index 3cdf413..5817cc4 100644 --- a/Assets/Scripts/Entities/Sign.cs +++ b/Assets/Scripts/Entities/Sign.cs @@ -42,7 +42,7 @@ private void OnTriggerEnter(Collider collider) } Rigidbody rigidBody = collider.gameObject.GetComponentInParent(); - if (rigidBody != null && rigidBody.velocity.magnitude > 2) + if (rigidBody != null && rigidBody.linearVelocity.magnitude > 2) { _dead = true; foreach (MeshCollider c in _colliders) diff --git a/Assets/Scripts/Menus/GraphicsMenu.cs b/Assets/Scripts/Menus/GraphicsMenu.cs index dbbd3f5..67de060 100644 --- a/Assets/Scripts/Menus/GraphicsMenu.cs +++ b/Assets/Scripts/Menus/GraphicsMenu.cs @@ -1,4 +1,6 @@ using System; +using System.Collections; +using System.Linq; using UnityEngine; using UnityEngine.XR; @@ -7,17 +9,29 @@ namespace Assets.Scripts.Menus internal class GraphicsMenu : IMenu { private MenuController _menuController; + private Resolution[] _availableResolutions; public MenuDefinition BuildMenu(MenuController menuController) { _menuController = menuController; + // Cache resolutions + _availableResolutions = Screen.resolutions + .Select(r => new { r.width, r.height, r.refreshRateRatio.value }) // Use ratio.value for comparison + .Distinct() + .Select(x => Screen.resolutions.First(r => + r.width == x.width && + r.height == x.height && + r.refreshRateRatio.value == x.value)) + .ToArray(); + return new MenuDefinition { BackgroundFilename = "6grxdet1", MenuItems = new MenuItem[] { - new MenuButton("Screen Resolution", GetCurrentResolution(), NextResolution), + new MenuButton("Screen Resolution", GetCurrentResolutionString(), NextResolution), new MenuButton("Quality", GetCurrentQuality(), NextQuality), + new MenuButton("Fullscreen", Screen.fullScreen ? "On" : "Off", ToggleFullscreen), new MenuBlank(), new MenuButton("Virtual Reality", GetVRStatus(), ToggleVR), new MenuBlank(), @@ -31,10 +45,12 @@ private string GetVRStatus() return XRSettings.enabled ? "On" : "Off"; } - private string GetCurrentResolution() + private string GetCurrentResolutionString() { Resolution current = Screen.currentResolution; - return current.width + "x" + current.height + "@" + current.refreshRate; + // FIXED: Use refreshRateRatio.value. + // Formatted to "0.##" to show 59.94Hz correctly, but display 60Hz as just 60. + return $"{current.width} x {current.height} @ {current.refreshRateRatio.value:0.##}Hz"; } private string GetCurrentQuality() @@ -45,9 +61,30 @@ private string GetCurrentQuality() private void NextResolution() { - int nextIndex = (Array.IndexOf(Screen.resolutions, Screen.currentResolution) + 1) % Screen.resolutions.Length; - Resolution newResolution = Screen.resolutions[nextIndex]; - Screen.SetResolution(newResolution.width, newResolution.height, false, newResolution.refreshRate); + int currentIndex = -1; + Resolution current = Screen.currentResolution; + + for (int i = 0; i < _availableResolutions.Length; i++) + { + // Compare dimensions and refresh rate approximately (floating point safety) + if (_availableResolutions[i].width == current.width && + _availableResolutions[i].height == current.height && + Mathf.Approximately((float)_availableResolutions[i].refreshRateRatio.value, (float)current.refreshRateRatio.value)) + { + currentIndex = i; + break; + } + } + + // If not found (custom window size), default to 0, otherwise increment + int nextIndex = (currentIndex + 1) % _availableResolutions.Length; + Resolution newRes = _availableResolutions[nextIndex]; + + // FIXED: New SetResolution signature requires FullScreenMode and RefreshRate (struct) + // We convert the boolean 'Screen.fullScreen' to the appropriate mode. + FullScreenMode mode = Screen.fullScreen ? Screen.fullScreenMode : FullScreenMode.Windowed; + + Screen.SetResolution(newRes.width, newRes.height, mode, newRes.refreshRateRatio); _menuController.Redraw(); } @@ -55,15 +92,21 @@ private void NextResolution() private void NextQuality() { int nextLevel = (QualitySettings.GetQualityLevel() + 1) % QualitySettings.names.Length; - QualitySettings.SetQualityLevel(nextLevel); + QualitySettings.SetQualityLevel(nextLevel, true); + _menuController.Redraw(); + } + private void ToggleFullscreen() + { + // Simple toggle between Windowed and Exclusive Fullscreen + // You might prefer FullScreenMode.FullScreenWindow (Borderless) depending on your game style + Screen.fullScreenMode = !Screen.fullScreen ? FullScreenMode.ExclusiveFullScreen : FullScreenMode.Windowed; _menuController.Redraw(); } private void ToggleVR() { XRSettings.enabled = !XRSettings.enabled; - _menuController.Redraw(); } @@ -72,4 +115,4 @@ public void Back() _menuController.ShowMenu(); } } -} +} \ No newline at end of file diff --git a/Assets/Scripts/Menus/MenuController.cs b/Assets/Scripts/Menus/MenuController.cs index 19628ac..b41f3d0 100644 --- a/Assets/Scripts/Menus/MenuController.cs +++ b/Assets/Scripts/Menus/MenuController.cs @@ -2,9 +2,11 @@ using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; +using UnityEngine.InputSystem; namespace Assets.Scripts.Menus { + [RequireComponent(typeof(CanvasGroup))] // Ensure dependency exists public class MenuController : MonoBehaviour { public Button MenuButtonPrefab; @@ -16,60 +18,100 @@ public class MenuController : MonoBehaviour private IMenu _currentMenu; - // Use this for initialization private void Awake() { _canvasGroup = GetComponent(); - _canvasGroup.alpha = 0; + HideMenuCanvas(); // helper to set alpha and raycasts } - // Update is called once per frame private void Update() { - if (Input.GetKeyDown(KeyCode.Escape)) + // 2. Replace legacy Input.GetKeyDown with the new API + // We check if the Keyboard exists first to avoid null errors on consoles/mobile + if (Keyboard.current != null && Keyboard.current.escapeKey.wasPressedThisFrame) { if (_currentMenu != null) _currentMenu.Back(); else ShowMenu(); + } + // Optional: Support Gamepad "Start" or "B" button for back/menu + if (Gamepad.current != null && Gamepad.current.startButton.wasPressedThisFrame) + { + if (_currentMenu != null) _currentMenu.Back(); + else ShowMenu(); } } public void CloseMenu() { _currentMenu = null; - - _canvasGroup.alpha = 0; + HideMenuCanvas(); Time.timeScale = 1; } public void ShowMenu() where T : IMenu, new() { _currentMenu = new T(); + + // Clear selection so we start fresh or default to top EventSystem.current.SetSelectedGameObject(null); Redraw(); + ShowMenuCanvas(); + Time.timeScale = 0; + } + private void ShowMenuCanvas() + { _canvasGroup.alpha = 1; + _canvasGroup.interactable = true; + _canvasGroup.blocksRaycasts = true; // Enable clicking + } - Time.timeScale = 0; + private void HideMenuCanvas() + { + _canvasGroup.alpha = 0; + _canvasGroup.interactable = false; + _canvasGroup.blocksRaycasts = false; // Disable clicking } public void Redraw() { + if (_currentMenu == null) return; + MenuDefinition menuDefinition = _currentMenu.BuildMenu(this); - Texture2D texture = CacheManager.Instance.GetTexture(menuDefinition.BackgroundFilename); - Background.texture = texture; - Background.rectTransform.sizeDelta = new Vector2(texture.width, texture.height); + // 1. Background Handling + if (CacheManager.Instance != null) + { + Texture2D texture = CacheManager.Instance.GetTexture(menuDefinition.BackgroundFilename); + if (texture != null) + { + Background.texture = texture; + Background.rectTransform.sizeDelta = new Vector2(texture.width, texture.height); + } + } - int selectedIndex = EventSystem.current.currentSelectedGameObject == null ? 0 : EventSystem.current.currentSelectedGameObject.transform.GetSiblingIndex(); + // 2. Save Selection State + int selectedIndex = 0; + if (EventSystem.current.currentSelectedGameObject != null) + { + selectedIndex = EventSystem.current.currentSelectedGameObject.transform.GetSiblingIndex(); + } + // 3. Clean up old items safely + // Iterate backwards to avoid collection modification issues (though not strictly necessary with Transform enumeration, it's safer) foreach (Transform child in Items.transform) { + // CRITICAL FIX: Disable first to prevent LayoutGroup flickering + child.gameObject.SetActive(false); Destroy(child.gameObject); } + // 4. Instantiate new items + GameObject objectToSelect = null; + for (int i = 0; i < menuDefinition.MenuItems.Length; i++) { MenuItem menuItem = menuDefinition.MenuItems[i]; @@ -77,18 +119,38 @@ public void Redraw() { MenuButton menuButton = menuItem as MenuButton; Button button = Instantiate(MenuButtonPrefab, Items.transform); - button.transform.Find("TextContainer").GetComponentInChildren().text = menuButton.Text; - button.transform.Find("Value").GetComponent().text = menuButton.Value; + + // Safety check for text components + var textContainer = button.transform.Find("TextContainer"); + if(textContainer) textContainer.GetComponentInChildren().text = menuButton.Text; + + var valueText = button.transform.Find("Value"); + if(valueText) valueText.GetComponent().text = menuButton.Value; + button.onClick.AddListener(new UnityEngine.Events.UnityAction(menuButton.OnClick)); - if (selectedIndex == i) - EventSystem.current.SetSelectedGameObject(button.gameObject); + // Determine if this should be selected + if (i == selectedIndex) + { + objectToSelect = button.gameObject; + } + // Fallback: If our previous index is now out of bounds (e.g. went from 5 items to 2), select the first available button + else if (objectToSelect == null && i == 0) + { + objectToSelect = button.gameObject; + } } else if (menuItem is MenuBlank) { Instantiate(BlankSeparatorPrefab, Items.transform); } } + + // 5. Restore Selection + if (objectToSelect != null) + { + EventSystem.current.SetSelectedGameObject(objectToSelect); + } } } } \ No newline at end of file diff --git a/Assets/Scripts/MusicPlayer.cs b/Assets/Scripts/MusicPlayer.cs new file mode 100644 index 0000000..20411d8 --- /dev/null +++ b/Assets/Scripts/MusicPlayer.cs @@ -0,0 +1,67 @@ +using Assets.Scripts.System; +using Assets.Scripts.System.Fileparsers; +using UnityEngine; + +namespace Assets.Scripts +{ + [RequireComponent(typeof(AudioSource))] + public class MusicPlayer : MonoBehaviour + { + private static MusicPlayer _instance; + public static MusicPlayer Instance { get; private set; } + + [Header("Config")] + public int MinTrackIndex = 2; + public int MaxTrackIndex = 18; + public bool PlayOnStart = true; + + private AudioSource _audioSource; + + private void Awake() + { + // Singleton Pattern: Ensure only one MusicPlayer exists + if (Instance != null && Instance != this) + { + Destroy(gameObject); + return; + } + + Instance = this; + // Uncomment the next line if you want music to keep playing when scene changes + // DontDestroyOnLoad(gameObject); + + _audioSource = GetComponent(); + } + + private void Start() + { + if (PlayOnStart) + { + PlayRandomMusic(); + } + } + + public void PlayRandomMusic() + { + if (VirtualFilesystem.Instance == null) + { + Debug.LogWarning("MusicPlayer: VirtualFilesystem not initialized."); + return; + } + + // Using the logic extracted from your old SceneRoot + int trackIndex = Random.Range(MinTrackIndex, MaxTrackIndex); + AudioClip clip = VirtualFilesystem.Instance.GetMusicClip(trackIndex); + + if (clip != null) + { + _audioSource.clip = clip; + _audioSource.Play(); + } + else + { + Debug.LogWarning($"MusicPlayer: Could not load music track {trackIndex}"); + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/MusicPlayer.cs.meta b/Assets/Scripts/MusicPlayer.cs.meta new file mode 100644 index 0000000..53a85ad --- /dev/null +++ b/Assets/Scripts/MusicPlayer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 23c83d9bcf84aba46822289615518f97 \ No newline at end of file diff --git a/Assets/Scripts/SceneRoot.cs b/Assets/Scripts/SceneRoot.cs index ad5327b..40ec8f7 100644 --- a/Assets/Scripts/SceneRoot.cs +++ b/Assets/Scripts/SceneRoot.cs @@ -1,53 +1,133 @@ using System.Collections; using Assets.Scripts.Camera; using Assets.Scripts.CarSystems; -using Assets.Scripts.Entities; +using Assets.Scripts.Entities; // Assuming Vdf/Vcf are here or related using Assets.Scripts.System; using Assets.Scripts.System.Fileparsers; using UnityEngine; namespace Assets.Scripts { + [RequireComponent(typeof(AudioSource))] public class SceneRoot : MonoBehaviour { + [Header("Configuration")] public string GamePath; public string MissionFile; public string VcfToLoad; + [Header("Music Settings")] + [Tooltip("Minimum index for random music track selection")] + public int MusicMinIndex = 2; + [Tooltip("Maximum index for random music track selection (exclusive)")] + public int MusicMaxIndex = 18; + private IEnumerator Start() { #if UNITY_EDITOR - gameObject.AddComponent(); + // Helper for hearing audio when not maximizing the game view + if (GetComponent() == null) + { + gameObject.AddComponent(); + } #endif + // 1. Setup Global Paths (Fallback if starting directly from scene in Editor) + if (string.IsNullOrEmpty(Game.Instance.GamePath)) + { + Game.Instance.GamePath = GamePath; + } + + // 2. Override Mission File (If coming from Main Menu) if (!string.IsNullOrEmpty(Game.Instance.LevelName)) { MissionFile = Game.Instance.LevelName; } - if (string.IsNullOrEmpty(Game.Instance.GamePath)) + // 3. Load the Level Geometry/Data + yield return LevelLoader.Instance.LoadLevel(MissionFile); + + // 4. Initialize Player (Only for Missions starting with 'm') + // Using ToLowerInvariant for safer string comparison across cultures + if (!string.IsNullOrEmpty(MissionFile) && MissionFile.ToLowerInvariant().StartsWith("m")) { - Game.Instance.GamePath = GamePath; + InitializePlayer(); } - yield return LevelLoader.Instance.LoadLevel(MissionFile); + } + + private void InitializePlayer() + { + // Import the Vehicle + CacheManager cacheManager = CacheManager.Instance; - if (MissionFile.ToLower().StartsWith("m")) + // Note: We use 'out _' to discard the Vdf result if we don't need it locally + GameObject importedVcf = cacheManager.ImportVcf(VcfToLoad, true, out _); + + if (importedVcf != null) { - CacheManager cacheManager = CacheManager.Instance; - GameObject importedVcf = cacheManager.ImportVcf(VcfToLoad, true, out Vdf unused); + // Make it playable importedVcf.AddComponent(); + // Tag it as Player so AI knows who to target + var car = importedVcf.GetComponent(); + if (car != null) car.IsPlayer = true; - GameObject spawnPoint = GameObject.FindGameObjectsWithTag("Spawn")[0]; - importedVcf.transform.position = spawnPoint.transform.position; - importedVcf.transform.rotation = spawnPoint.transform.rotation; + // Find Spawn Point safely + GameObject spawnPoint = GameObject.FindGameObjectWithTag("Spawn"); + Vector3 finalPosition = Vector3.zero; + Quaternion finalRotation = Quaternion.identity; + + if (spawnPoint != null) + { + finalPosition = spawnPoint.transform.position; + finalRotation = spawnPoint.transform.rotation; + } + else + { + Debug.LogError("SceneRoot: No object with tag 'Spawn' found in scene! Player spawned at (0,0,0)."); + finalPosition = new Vector3(0, 100, 0); // High default to avoid falling immediately + } + + // 2. FIX: Snap to Ground Logic + // We cast a ray from high up (Y=1000) straight down to find the terrain/floor. + RaycastHit hit; + // Ensure your Terrain GameObject is on the "Terrain" or "Default" layer! + int layerMask = LayerMask.GetMask("Terrain", "Default"); + + if (Physics.Raycast(new Vector3(finalPosition.x, 1000f, finalPosition.z), Vector3.down, out hit, 2000f, layerMask)) + { + // Found ground! Move spawn point to hit point + 1.5 meters buffer + finalPosition.y = hit.point.y + 1.5f; + } + else + { + // Fallback: If raycast misses (e.g. terrain hole), just assume safe height + finalPosition.y = Mathf.Max(finalPosition.y, 50f); + } - CameraManager.Instance.MainCamera.GetComponent().Target = importedVcf.transform; + // 3. Apply Position + importedVcf.transform.position = finalPosition; + importedVcf.transform.rotation = finalRotation; + + // Attach Camera + if (CameraManager.Instance != null && CameraManager.Instance.MainCamera != null) + { + var smoothFollow = CameraManager.Instance.MainCamera.GetComponent(); + if (smoothFollow != null) + { + smoothFollow.Target = importedVcf.transform; + // Force camera to snap immediately so it doesn't "swoop" from 0,0,0 + // (Assuming SmoothFollow has a method/property for instant snap, or just disabling/enabling it) + smoothFollow.transform.position = finalPosition + new Vector3(0, 5, -10); + smoothFollow.transform.LookAt(finalPosition); + } + } + } + else + { + Debug.LogError($"SceneRoot: Failed to import VCF '{VcfToLoad}'"); } - - var musicAudioSource = GetComponent(); - musicAudioSource.clip = VirtualFilesystem.Instance.GetMusicClip(Random.Range(2, 18)); - musicAudioSource.Play(); } + } } \ No newline at end of file diff --git a/Assets/Scripts/Sky.cs b/Assets/Scripts/Sky.cs index d5e2c07..a24e6a9 100644 --- a/Assets/Scripts/Sky.cs +++ b/Assets/Scripts/Sky.cs @@ -5,42 +5,82 @@ namespace Assets.Scripts { + [RequireComponent(typeof(MeshRenderer))] public class Sky : MonoBehaviour { public Vector2 Speed; public float Height; - private Material _material; + // Added SerializeField so you can set the default texture in the Inspector + [SerializeField] private string _textureFileName; + + private Material _material; + private MeshRenderer _meshRenderer; + public string TextureFilename { - get { return _textureFileName;} + get { return _textureFileName; } set { - if (_textureFileName == value) - { - return; - } - + if (_textureFileName == value) return; _textureFileName = value; - _material.mainTexture = TextureParser.ReadMapTexture(TextureFilename, CacheManager.Instance.Palette); + UpdateSkyTexture(); } } private void Awake() { - _material = GetComponent().material; + _meshRenderer = GetComponent(); + + // IMPORTANT: Accessing .material creates a new instance. + // We store reference to destroy it later. + _material = _meshRenderer.material; + + UpdateSkyTexture(); + } + + private void Update() + { + // Safety Check: Ensure the camera manager and active camera exist + if (CameraManager.Instance == null || CameraManager.Instance.ActiveCamera == null) + { + return; + } + + // 1. Scroll Texture + if (_material != null) + { + _material.mainTextureOffset += Speed * Time.deltaTime; + } + + // 2. Follow Camera (Skybox effect) + Vector3 camPos = CameraManager.Instance.ActiveCamera.transform.position; + transform.position = camPos + (Vector3.up * Height); + } + + private void UpdateSkyTexture() + { + // Guard clause: Ensure we have a material and a filename + if (_material == null || string.IsNullOrEmpty(_textureFileName)) + { + return; + } - if (!string.IsNullOrEmpty(TextureFilename)) + // Guard clause: Ensure the CacheManager is ready + if (CacheManager.Instance != null && CacheManager.Instance.Palette != null) { - _material.mainTexture = TextureParser.ReadMapTexture(TextureFilename, CacheManager.Instance.Palette); + _material.mainTexture = TextureParser.ReadMapTexture(_textureFileName, CacheManager.Instance.Palette); } } - private void Update() + private void OnDestroy() { - _material.mainTextureOffset += Speed * Time.deltaTime; - transform.position = CameraManager.Instance.ActiveCamera.transform.position + Vector3.up * Height; + // FIXED: Clean up the instantiated material to prevent memory leaks + if (_material != null) + { + Destroy(_material); + } } } } \ No newline at end of file diff --git a/Assets/Scripts/System/CacheManager.cs b/Assets/Scripts/System/CacheManager.cs index d37382f..baeb197 100644 --- a/Assets/Scripts/System/CacheManager.cs +++ b/Assets/Scripts/System/CacheManager.cs @@ -115,21 +115,23 @@ public AudioSource GetAudioSource(GameObject rootObject, string soundName) public Texture2D GetTexture(string textureName) { - string filename = Path.GetFileNameWithoutExtension(textureName); - Texture2D texture = null; + if (string.IsNullOrEmpty(textureName)) return Texture2D.whiteTexture; + + string filename = global::System.IO.Path.GetFileNameWithoutExtension(textureName); + // 1. Try VQM if (VirtualFilesystem.Instance.FileExists(filename + ".vqm")) { - texture = TextureParser.ReadVqmTexture(filename + ".vqm", Palette); + return TextureParser.ReadVqmTexture(filename + ".vqm", Palette); } + // 2. Try MAP else if (VirtualFilesystem.Instance.FileExists(filename + ".map")) { - texture = TextureParser.ReadMapTexture(filename + ".map", Palette); + return TextureParser.ReadMapTexture(filename + ".map", Palette); } - else - { - Debug.LogWarning("Texture not found: " + textureName); - } - return texture; + + // 3. Fallback: Return a white square so we can see the mesh! + Debug.LogWarning($"[CacheManager] Missing texture '{textureName}'. Using white fallback."); + return Texture2D.whiteTexture; } public Material GetTextureMaterial(string textureName, bool transparent) diff --git a/Assets/Scripts/System/LevelLoader.cs b/Assets/Scripts/System/LevelLoader.cs index 50d1d15..85448fe 100644 --- a/Assets/Scripts/System/LevelLoader.cs +++ b/Assets/Scripts/System/LevelLoader.cs @@ -92,7 +92,6 @@ public IEnumerator LoadLevel(string msnFilename) terrain.terrainData = mdef.TerrainPatches[x, z].TerrainData; terrain.terrainData.terrainLayers = terrainLayers; terrain.materialTemplate = _terrainMaterial; - terrain.materialType = Terrain.MaterialType.Custom; TerrainCollider terrainCollider = patchGameObject.AddComponent(); terrainCollider.terrainData = terrain.terrainData; @@ -223,7 +222,12 @@ public IEnumerator LoadLevel(string msnFilename) worldGameObject.transform.position = new Vector3(-mdef.Middle.x * 640, 0, -mdef.Middle.y * 640); - Object.FindObjectOfType().color = _cacheManager.Palette[176]; + var mainLight = Object.FindFirstObjectByType(); + if (mainLight != null) + { + mainLight.color = _cacheManager.Palette[176]; + } + UnityEngine.Camera.main.backgroundColor = _cacheManager.Palette[239]; RenderSettings.fogColor = _cacheManager.Palette[239]; RenderSettings.ambientLight = _cacheManager.Palette[247]; diff --git a/Assets/XR.meta b/Assets/XR.meta new file mode 100644 index 0000000..3275009 --- /dev/null +++ b/Assets/XR.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be2c548d62eb1dd46a613c28fcaf6192 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/XR/Loaders.meta b/Assets/XR/Loaders.meta new file mode 100644 index 0000000..54f3b8b --- /dev/null +++ b/Assets/XR/Loaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f7a7c4526cc91084bb7287ff993b03ca +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/XR/Loaders/OculusLoader.asset b/Assets/XR/Loaders/OculusLoader.asset new file mode 100644 index 0000000..57ff242 --- /dev/null +++ b/Assets/XR/Loaders/OculusLoader.asset @@ -0,0 +1,14 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 03bc68f14d65e7747a59d5ff74bd199b, type: 3} + m_Name: OculusLoader + m_EditorClassIdentifier: Unity.XR.Oculus::Unity.XR.Oculus.OculusLoader diff --git a/Assets/XR/Loaders/OculusLoader.asset.meta b/Assets/XR/Loaders/OculusLoader.asset.meta new file mode 100644 index 0000000..d25394b --- /dev/null +++ b/Assets/XR/Loaders/OculusLoader.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5b77bfc85fef9394a86e324bf9c1ba92 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/XR/Settings 1.meta b/Assets/XR/Settings 1.meta new file mode 100644 index 0000000..548a98a --- /dev/null +++ b/Assets/XR/Settings 1.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0d9d22b4b797173409af2d146ae08af4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/XR/Settings.meta b/Assets/XR/Settings.meta new file mode 100644 index 0000000..6a470c4 --- /dev/null +++ b/Assets/XR/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a7252fd8ac3eabc48ba84595ecf7afdc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/XR/Settings/OculusSettings.asset b/Assets/XR/Settings/OculusSettings.asset new file mode 100644 index 0000000..7e08fbd --- /dev/null +++ b/Assets/XR/Settings/OculusSettings.asset @@ -0,0 +1,36 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c353a8f1e58cf884584123914fe63cd5, type: 3} + m_Name: OculusSettings + m_EditorClassIdentifier: Unity.XR.Oculus::Unity.XR.Oculus.OculusSettings + m_StereoRenderingModeDesktop: 1 + m_StereoRenderingModeAndroid: 2 + SharedDepthBuffer: 1 + DepthSubmission: 0 + DashSupport: 1 + LowOverheadMode: 0 + OptimizeBufferDiscards: 1 + PhaseSync: 1 + SymmetricProjection: 1 + SubsampledLayout: 0 + FoveatedRenderingMethod: 0 + LateLatching: 0 + LateLatchingDebug: 0 + EnableTrackingOriginStageMode: 0 + SpaceWarp: 0 + TargetQuest2: 1 + TargetQuestPro: 0 + TargetQuest3: 0 + TargetQuest3S: 0 + SystemSplashScreen: {fileID: 0} + UseStickControlThumbsticks: 0 + OptimizeMultiviewRenderRegions: 0 diff --git a/Assets/XR/Settings/OculusSettings.asset.meta b/Assets/XR/Settings/OculusSettings.asset.meta new file mode 100644 index 0000000..54ef546 --- /dev/null +++ b/Assets/XR/Settings/OculusSettings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6aea7bb2bee4c2e45a6cccc4ba204437 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/XR/XRGeneralSettingsPerBuildTarget.asset b/Assets/XR/XRGeneralSettingsPerBuildTarget.asset new file mode 100644 index 0000000..51e629a --- /dev/null +++ b/Assets/XR/XRGeneralSettingsPerBuildTarget.asset @@ -0,0 +1,47 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-1148105652830031445 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4c3631f5e58749a59194e0cf6baf6d5, type: 3} + m_Name: Standalone Providers + m_EditorClassIdentifier: Unity.XR.Management::UnityEngine.XR.Management.XRManagerSettings + m_RequiresSettingsUpdate: 0 + m_AutomaticLoading: 0 + m_AutomaticRunning: 0 + m_Loaders: [] +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2dc886499c26824283350fa532d087d, type: 3} + m_Name: XRGeneralSettingsPerBuildTarget + m_EditorClassIdentifier: Unity.XR.Management.Editor::UnityEditor.XR.Management.XRGeneralSettingsPerBuildTarget + Keys: 01000000 + Values: + - {fileID: 1051897866150448303} +--- !u!114 &1051897866150448303 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d236b7d11115f2143951f1e14045df39, type: 3} + m_Name: Standalone Settings + m_EditorClassIdentifier: Unity.XR.Management::UnityEngine.XR.Management.XRGeneralSettings + m_LoaderManagerInstance: {fileID: -1148105652830031445} + m_InitManagerOnStart: 0 diff --git a/Assets/XR/XRGeneralSettingsPerBuildTarget.asset.meta b/Assets/XR/XRGeneralSettingsPerBuildTarget.asset.meta new file mode 100644 index 0000000..0cfabe1 --- /dev/null +++ b/Assets/XR/XRGeneralSettingsPerBuildTarget.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8395e2a76592a4e4691116358dd06974 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Open76.slnx b/Open76.slnx new file mode 100644 index 0000000..20919c7 --- /dev/null +++ b/Open76.slnx @@ -0,0 +1,3 @@ + + + diff --git a/Packages/manifest.json b/Packages/manifest.json index 5ad066d..43061f1 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -2,14 +2,20 @@ "dependencies": { "com.unity.2d.sprite": "1.0.0", "com.unity.2d.tilemap": "1.0.0", - "com.unity.collab-proxy": "1.2.16", - "com.unity.ide.rider": "1.1.4", - "com.unity.ide.vscode": "1.1.4", - "com.unity.multiplayer-hlapi": "1.0.4", - "com.unity.test-framework": "1.1.11", - "com.unity.timeline": "1.2.6", - "com.unity.ugui": "1.0.0", - "com.unity.xr.legacyinputhelpers": "1.3.11", + "com.unity.ai.navigation": "2.0.9", + "com.unity.collab-proxy": "2.10.2", + "com.unity.ide.rider": "3.0.38", + "com.unity.ide.visualstudio": "2.0.26", + "com.unity.inputsystem": "1.17.0", + "com.unity.multiplayer.center": "1.0.1", + "com.unity.test-framework": "1.6.0", + "com.unity.timeline": "1.8.10", + "com.unity.ugui": "2.0.0", + "com.unity.xr.legacyinputhelpers": "2.1.13", + "com.unity.xr.management": "4.5.4", + "com.unity.xr.oculus": "4.5.2", + "com.unity.modules.accessibility": "1.0.0", + "com.unity.modules.adaptiveperformance": "1.0.0", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", @@ -36,6 +42,7 @@ "com.unity.modules.unitywebrequestaudio": "1.0.0", "com.unity.modules.unitywebrequesttexture": "1.0.0", "com.unity.modules.unitywebrequestwww": "1.0.0", + "com.unity.modules.vectorgraphics": "1.0.0", "com.unity.modules.vehicles": "1.0.0", "com.unity.modules.video": "1.0.0", "com.unity.modules.vr": "1.0.0", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json new file mode 100644 index 0000000..b8c5692 --- /dev/null +++ b/Packages/packages-lock.json @@ -0,0 +1,422 @@ +{ + "dependencies": { + "com.unity.2d.sprite": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.2d.tilemap": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.uielements": "1.0.0" + } + }, + "com.unity.ai.navigation": { + "version": "2.0.9", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.ai": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.collab-proxy": { + "version": "2.10.2", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.ext.nunit": { + "version": "2.0.5", + "depth": 1, + "source": "builtin", + "dependencies": {} + }, + "com.unity.ide.rider": { + "version": "3.0.38", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ide.visualstudio": { + "version": "2.0.26", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.33" + }, + "url": "https://packages.unity.com" + }, + "com.unity.inputsystem": { + "version": "1.17.0", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.uielements": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.multiplayer.center": { + "version": "1.0.1", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.uielements": "1.0.0" + } + }, + "com.unity.test-framework": { + "version": "1.6.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.ext.nunit": "2.0.3", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.timeline": { + "version": "1.8.10", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.director": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ugui": { + "version": "2.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0" + } + }, + "com.unity.xr.core-utils": { + "version": "2.5.3", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.modules.xr": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.xr.legacyinputhelpers": { + "version": "2.1.13", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.xr": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.xr.management": { + "version": "4.5.4", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.xr": "1.0.0", + "com.unity.xr.core-utils": "2.2.1", + "com.unity.modules.subsystems": "1.0.0", + "com.unity.xr.legacyinputhelpers": "2.1.11" + }, + "url": "https://packages.unity.com" + }, + "com.unity.xr.oculus": { + "version": "4.5.2", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.xr.management": "4.4.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.modules.accessibility": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.adaptiveperformance": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.subsystems": "1.0.0" + } + }, + "com.unity.modules.ai": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.androidjni": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.animation": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.assetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.audio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.cloth": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.director": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.animation": "1.0.0" + } + }, + "com.unity.modules.hierarchycore": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.imageconversion": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.imgui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.jsonserialize": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.particlesystem": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics2d": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.screencapture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.subsystems": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.terrain": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.terrainphysics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.terrain": "1.0.0" + } + }, + "com.unity.modules.tilemap": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics2d": "1.0.0" + } + }, + "com.unity.modules.ui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.uielements": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.hierarchycore": "1.0.0", + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.umbra": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unityanalytics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.unitywebrequest": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unitywebrequestassetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestaudio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.audio": "1.0.0" + } + }, + "com.unity.modules.unitywebrequesttexture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestwww": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.vectorgraphics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.uielements": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.imgui": "1.0.0" + } + }, + "com.unity.modules.vehicles": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.video": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.vr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } + }, + "com.unity.modules.wind": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.xr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.subsystems": "1.0.0" + } + } + } +} diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 298c7d1..38bd2a1 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -11,4 +11,9 @@ EditorBuildSettings: - enabled: 1 path: Assets/Scenes/Level.unity guid: cda69ed09409f0242a93af80262f53e6 - m_configObjects: {} + m_configObjects: + Unity.XR.Oculus.Settings: {fileID: 11400000, guid: 6aea7bb2bee4c2e45a6cccc4ba204437, + type: 2} + com.unity.xr.management.loader_settings: {fileID: 11400000, guid: 8395e2a76592a4e4691116358dd06974, + type: 2} + m_UseUCBPForAssetBundles: 0 diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset index d4596bb..6e9c7eb 100644 --- a/ProjectSettings/InputManager.asset +++ b/ProjectSettings/InputManager.asset @@ -293,3 +293,4 @@ InputManager: type: 0 axis: 0 joyNum: 0 + m_UsePhysicalKeys: 1 diff --git a/ProjectSettings/MemorySettings.asset b/ProjectSettings/MemorySettings.asset new file mode 100644 index 0000000..5b5face --- /dev/null +++ b/ProjectSettings/MemorySettings.asset @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!387306366 &1 +MemorySettings: + m_ObjectHideFlags: 0 + m_EditorMemorySettings: + m_MainAllocatorBlockSize: -1 + m_ThreadAllocatorBlockSize: -1 + m_MainGfxBlockSize: -1 + m_ThreadGfxBlockSize: -1 + m_CacheBlockSize: -1 + m_TypetreeBlockSize: -1 + m_ProfilerBlockSize: -1 + m_ProfilerEditorBlockSize: -1 + m_BucketAllocatorGranularity: -1 + m_BucketAllocatorBucketsCount: -1 + m_BucketAllocatorBlockSize: -1 + m_BucketAllocatorBlockCount: -1 + m_ProfilerBucketAllocatorGranularity: -1 + m_ProfilerBucketAllocatorBucketsCount: -1 + m_ProfilerBucketAllocatorBlockSize: -1 + m_ProfilerBucketAllocatorBlockCount: -1 + m_TempAllocatorSizeMain: -1 + m_JobTempAllocatorBlockSize: -1 + m_BackgroundJobTempAllocatorBlockSize: -1 + m_JobTempAllocatorReducedBlockSize: -1 + m_TempAllocatorSizeGIBakingWorker: -1 + m_TempAllocatorSizeNavMeshWorker: -1 + m_TempAllocatorSizeAudioWorker: -1 + m_TempAllocatorSizeCloudWorker: -1 + m_TempAllocatorSizeGfx: -1 + m_TempAllocatorSizeJobWorker: -1 + m_TempAllocatorSizeBackgroundWorker: -1 + m_TempAllocatorSizePreloadManager: -1 + m_PlatformMemorySettings: {} diff --git a/ProjectSettings/MultiplayerManager.asset b/ProjectSettings/MultiplayerManager.asset new file mode 100644 index 0000000..c19bcd7 --- /dev/null +++ b/ProjectSettings/MultiplayerManager.asset @@ -0,0 +1,9 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!655991488 &1 +MultiplayerManager: + m_ObjectHideFlags: 0 + m_EnableMultiplayerRoles: 0 + m_EnablePlayModeLocalDeployment: 0 + m_EnablePlayModeRemoteDeployment: 0 + m_StrippingTypes: {} diff --git a/ProjectSettings/PackageManagerSettings.asset b/ProjectSettings/PackageManagerSettings.asset new file mode 100644 index 0000000..112a053 --- /dev/null +++ b/ProjectSettings/PackageManagerSettings.asset @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_EnablePreReleasePackages: 0 + m_EnablePackageDependencies: 0 + m_AdvancedSettingsExpanded: 1 + m_ScopedRegistriesSettingsExpanded: 1 + m_SeeAllPackageVersions: 0 + oneTimeWarningShown: 0 + m_Registries: + - m_Id: main + m_Name: + m_Url: https://packages.unity.com + m_Scopes: [] + m_IsDefault: 1 + m_Capabilities: 7 + m_UserSelectedRegistryName: + m_UserAddingNewScopedRegistry: 0 + m_RegistryInfoDraft: + m_Modified: 0 + m_ErrorMessage: + m_UserModificationsInstanceId: -830 + m_OriginalInstanceId: -832 + m_LoadAssets: 0 diff --git a/ProjectSettings/Packages/com.unity.dedicated-server/MultiplayerRolesSettings.asset b/ProjectSettings/Packages/com.unity.dedicated-server/MultiplayerRolesSettings.asset new file mode 100644 index 0000000..d72800d --- /dev/null +++ b/ProjectSettings/Packages/com.unity.dedicated-server/MultiplayerRolesSettings.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 53 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 15023, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: UnityEditor.MultiplayerModule.dll::UnityEditor.Multiplayer.Internal.MultiplayerRolesSettings + m_MultiplayerRoleForClassicProfile: + m_Keys: [] + m_Values: diff --git a/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json b/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json new file mode 100644 index 0000000..3c7b4c1 --- /dev/null +++ b/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json @@ -0,0 +1,5 @@ +{ + "m_Dictionary": { + "m_DictionaryValues": [] + } +} \ No newline at end of file diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 2839afe..b8d238e 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -3,7 +3,7 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 15 + serializedVersion: 28 productGUID: 1b7541ad4e4f249488e9f4aaedfecd93 AndroidProfiler: 0 AndroidFilterTouchesWhenObscured: 0 @@ -48,13 +48,17 @@ PlayerSettings: defaultScreenHeightWeb: 600 m_StereoRenderingPath: 0 m_ActiveColorSpace: 0 + unsupportedMSAAFallback: 0 + m_SpriteBatchMaxVertexCount: 65535 + m_SpriteBatchVertexThreshold: 300 m_MTRendering: 1 + mipStripping: 0 + numberOfMipsStripped: 0 + numberOfMipsStrippedPerMipmapLimitGroup: {} m_StackTraceTypes: 010000000100000001000000010000000100000001000000 iosShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1 - iosAppInBackgroundBehavior: 0 - displayResolutionDialog: 1 - iosAllowHTTPDownload: 1 + iosUseCustomAppBackgroundBehavior: 0 allowedAutorotateToPortrait: 1 allowedAutorotateToPortraitUpsideDown: 1 allowedAutorotateToLandscapeRight: 1 @@ -65,25 +69,38 @@ PlayerSettings: disableDepthAndStencilBuffers: 0 androidStartInFullscreen: 1 androidRenderOutsideSafeArea: 0 + androidUseSwappy: 0 + androidDisplayOptions: 1 androidBlitType: 0 + androidResizeableActivity: 1 + androidDefaultWindowWidth: 1920 + androidDefaultWindowHeight: 1080 + androidMinimumWindowWidth: 400 + androidMinimumWindowHeight: 300 + androidFullscreenMode: 1 + androidAutoRotationBehavior: 1 + androidPredictiveBackSupport: 1 + androidApplicationEntry: 1 defaultIsNativeResolution: 1 macRetinaSupport: 1 runInBackground: 0 - captureSingleScreen: 0 muteOtherAudioSources: 0 Prepare IOS For Recording: 0 Force IOS Speakers When Recording: 0 + audioSpatialExperience: 0 deferSystemGesturesMode: 0 hideHomeButton: 0 submitAnalytics: 1 usePlayerLog: 1 + dedicatedServerOptimizations: 1 bakeCollisionMeshes: 0 forceSingleInstance: 0 + useFlipModelSwapchain: 1 resizableWindow: 0 useMacAppStoreValidation: 0 macAppStoreCategory: public.app-category.games gpuSkinning: 0 - graphicsJobs: 0 + meshDeformation: 0 xboxPIXTextureCapture: 0 xboxEnableAvatar: 0 xboxEnableKinect: 0 @@ -91,7 +108,6 @@ PlayerSettings: xboxEnableFitness: 0 visibleInBackground: 0 allowFullscreenSwitch: 1 - graphicsJobMode: 0 fullscreenMode: 1 xboxSpeechDB: 0 xboxEnableHeadOrientation: 0 @@ -104,15 +120,29 @@ PlayerSettings: xboxOneMonoLoggingLevel: 0 xboxOneLoggingLevel: 1 xboxOneDisableEsram: 0 + xboxOneEnableTypeOptimization: 0 xboxOnePresentImmediateThreshold: 0 switchQueueCommandMemory: 0 + switchQueueControlMemory: 16384 + switchQueueComputeMemory: 262144 + switchNVNShaderPoolsGranularity: 33554432 + switchNVNDefaultPoolsGranularity: 16777216 + switchNVNOtherPoolsGranularity: 16777216 + switchGpuScratchPoolGranularity: 2097152 + switchAllowGpuScratchShrinking: 0 + switchNVNMaxPublicTextureIDCount: 0 + switchNVNMaxPublicSamplerIDCount: 0 + switchMaxWorkerMultiple: 8 + switchNVNGraphicsFirmwareMemory: 32 + switchGraphicsJobsSyncAfterKick: 1 + vulkanNumSwapchainBuffers: 3 vulkanEnableSetSRGBWrite: 0 - m_SupportedAspectRatios: - 4:3: 1 - 5:4: 1 - 16:10: 1 - 16:9: 1 - Others: 1 + vulkanEnablePreTransform: 0 + vulkanEnableLateAcquireNextImage: 0 + vulkanEnableCommandBufferRecycling: 1 + loadStoreDebugModeEnabled: 0 + visionOSBundleVersion: 1.0 + tvOSBundleVersion: 1.0 bundleVersion: 1.0 preloadedAssets: [] metroInputSource: 0 @@ -120,45 +150,38 @@ PlayerSettings: m_HolographicPauseOnTrackingLoss: 1 xboxOneDisableKinectGpuReservation: 0 xboxOneEnable7thCore: 0 - isWsaHolographicRemotingEnabled: 0 vrSettings: - cardboard: - depthFormat: 0 - enableTransitionView: 0 - daydream: - depthFormat: 0 - useSustainedPerformanceMode: 0 - enableVideoLayer: 0 - useProtectedVideoMemory: 0 - minimumSupportedHeadTracking: 0 - maximumSupportedHeadTracking: 1 - hololens: - depthFormat: 1 - depthBufferSharingEnabled: 0 - oculus: - sharedDepthBuffer: 0 - dashSupport: 0 enable360StereoCapture: 0 - protectGraphicsMemory: 0 + isWsaHolographicRemotingEnabled: 0 enableFrameTimingStats: 0 + enableOpenGLProfilerGPURecorders: 1 + allowHDRDisplaySupport: 0 useHDRDisplay: 0 + hdrBitDepth: 0 m_ColorGamuts: 00000000 targetPixelDensity: 30 resolutionScalingMode: 0 + resetResolutionOnWindowResize: 0 androidSupportedAspectRatio: 1 androidMaxAspectRatio: 2.1 + androidMinAspectRatio: 1 applicationIdentifier: Android: com.Company.ProductName Standalone: unity.DefaultCompany.I76 Tizen: com.Company.ProductName - iOS: com.Company.ProductName + iPhone: com.Company.ProductName tvOS: com.Company.ProductName buildNumber: - iOS: 0 + Standalone: 0 + VisionOS: 0 + iPhone: 0 + tvOS: 0 + overrideDefaultApplicationIdentifier: 1 AndroidBundleVersionCode: 1 - AndroidMinSdkVersion: 16 + AndroidMinSdkVersion: 25 AndroidTargetSdkVersion: 0 AndroidPreferredInstallLocation: 1 + AndroidPreferredDataLocation: 1 aotOptions: stripEngineCode: 1 iPhoneStrippingLevel: 0 @@ -166,33 +189,26 @@ PlayerSettings: ForceInternetPermission: 0 ForceSDCardPermission: 0 CreateWallpaper: 0 - APKExpansionFiles: 0 + androidSplitApplicationBinary: 0 keepLoadedShadersAlive: 0 StripUnusedMeshComponents: 0 + strictShaderVariantMatching: 0 VertexChannelCompressionMask: 214 iPhoneSdkVersion: 988 - iOSTargetOSVersionString: 9.0 + iOSSimulatorArchitecture: 0 + iOSTargetOSVersionString: 15.0 tvOSSdkVersion: 0 + tvOSSimulatorArchitecture: 0 tvOSRequireExtendedGameController: 0 - tvOSTargetOSVersionString: 9.0 + tvOSTargetOSVersionString: 15.0 + VisionOSSdkVersion: 0 + VisionOSTargetOSVersionString: 1.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 uIStatusBarHidden: 1 uIExitOnSuspend: 0 uIStatusBarStyle: 0 - iPhoneSplashScreen: {fileID: 0} - iPhoneHighResSplashScreen: {fileID: 0} - iPhoneTallHighResSplashScreen: {fileID: 0} - iPhone47inSplashScreen: {fileID: 0} - iPhone55inPortraitSplashScreen: {fileID: 0} - iPhone55inLandscapeSplashScreen: {fileID: 0} - iPhone58inPortraitSplashScreen: {fileID: 0} - iPhone58inLandscapeSplashScreen: {fileID: 0} - iPadPortraitSplashScreen: {fileID: 0} - iPadHighResPortraitSplashScreen: {fileID: 0} - iPadLandscapeSplashScreen: {fileID: 0} - iPadHighResLandscapeSplashScreen: {fileID: 0} appleTVSplashScreen: {fileID: 0} appleTVSplashScreen2x: {fileID: 0} tvOSSmallIconLayers: [] @@ -211,7 +227,6 @@ PlayerSettings: rgba: 0 iOSLaunchScreenFillPct: 100 iOSLaunchScreenSize: 100 - iOSLaunchScreenCustomXibPath: iOSLaunchScreeniPadType: 0 iOSLaunchScreeniPadImage: {fileID: 0} iOSLaunchScreeniPadBackgroundColor: @@ -219,89 +234,196 @@ PlayerSettings: rgba: 0 iOSLaunchScreeniPadFillPct: 100 iOSLaunchScreeniPadSize: 100 - iOSLaunchScreeniPadCustomXibPath: - iOSUseLaunchScreenStoryboard: 0 iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: iOSDeviceRequirements: [] iOSURLSchemes: [] + macOSURLSchemes: [] iOSBackgroundModes: 0 iOSMetalForceHardShadows: 0 metalEditorSupport: 1 metalAPIValidation: 1 + metalCompileShaderBinary: 0 iOSRenderExtraFrameOnPause: 1 + iosCopyPluginsCodeInsteadOfSymlink: 0 appleDeveloperTeamID: iOSManualSigningProvisioningProfileID: tvOSManualSigningProvisioningProfileID: + VisionOSManualSigningProvisioningProfileID: iOSManualSigningProvisioningProfileType: 0 tvOSManualSigningProvisioningProfileType: 0 + VisionOSManualSigningProvisioningProfileType: 0 appleEnableAutomaticSigning: 0 iOSRequireARKit: 0 + iOSAutomaticallyDetectAndAddCapabilities: 1 appleEnableProMotion: 0 + shaderPrecisionModel: 0 clonedFromGUID: 00000000000000000000000000000000 templatePackageId: templateDefaultScene: + useCustomMainManifest: 0 + useCustomLauncherManifest: 0 + useCustomMainGradleTemplate: 0 + useCustomLauncherGradleManifest: 0 + useCustomBaseGradleTemplate: 0 + useCustomGradlePropertiesTemplate: 0 + useCustomGradleSettingsTemplate: 0 + useCustomProguardFile: 0 AndroidTargetArchitectures: 5 + AndroidAllowedArchitectures: -1 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} - AndroidKeystoreName: + AndroidKeystoreName: '{inproject}: ' AndroidKeyaliasName: + AndroidEnableArmv9SecurityFeatures: 0 + AndroidEnableArm64MTE: 0 AndroidBuildApkPerCpuArchitecture: 0 AndroidTVCompatibility: 1 AndroidIsGame: 1 + androidAppCategory: 3 + useAndroidAppCategory: 1 + androidAppCategoryOther: AndroidEnableTango: 0 androidEnableBanner: 1 androidUseLowAccuracyLocation: 0 + androidUseCustomKeystore: 0 m_AndroidBanners: - width: 320 height: 180 banner: {fileID: 0} androidGamepadSupportLevel: 0 - resolutionDialogBanner: {fileID: 0} + AndroidMinifyRelease: 0 + AndroidMinifyDebug: 0 + AndroidValidateAppBundleSize: 1 + AndroidAppBundleSizeToValidate: 200 + AndroidReportGooglePlayAppDependencies: 1 + androidSymbolsSizeThreshold: 800 m_BuildTargetIcons: [] m_BuildTargetPlatformIcons: [] m_BuildTargetBatching: [] - m_BuildTargetGraphicsAPIs: [] + m_BuildTargetShaderSettings: [] + m_BuildTargetGraphicsJobs: + - m_BuildTarget: WindowsStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: MacStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: LinuxStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: AndroidPlayer + m_GraphicsJobs: 0 + - m_BuildTarget: iOSSupport + m_GraphicsJobs: 0 + - m_BuildTarget: PS4Player + m_GraphicsJobs: 0 + - m_BuildTarget: PS5Player + m_GraphicsJobs: 0 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobs: 0 + - m_BuildTarget: GameCoreXboxOneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: GameCoreScarlettSupport + m_GraphicsJobs: 0 + - m_BuildTarget: Switch + m_GraphicsJobs: 0 + - m_BuildTarget: WebGLSupport + m_GraphicsJobs: 0 + - m_BuildTarget: MetroSupport + m_GraphicsJobs: 0 + - m_BuildTarget: AppleTVSupport + m_GraphicsJobs: 0 + - m_BuildTarget: VisionOSPlayer + m_GraphicsJobs: 0 + - m_BuildTarget: CloudRendering + m_GraphicsJobs: 0 + - m_BuildTarget: EmbeddedLinux + m_GraphicsJobs: 0 + - m_BuildTarget: QNX + m_GraphicsJobs: 0 + - m_BuildTarget: Kepler + m_GraphicsJobs: 0 + - m_BuildTarget: Switch2 + m_GraphicsJobs: 0 + m_BuildTargetGraphicsJobMode: + - m_BuildTarget: PS4Player + m_GraphicsJobMode: 0 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobMode: 0 + m_BuildTargetGraphicsAPIs: + - m_BuildTarget: iOSSupport + m_APIs: 10000000 + m_Automatic: 1 + - m_BuildTarget: AndroidPlayer + m_APIs: 0b000000 + m_Automatic: 0 + - m_BuildTarget: WindowsStandaloneSupport + m_APIs: 02000000 + m_Automatic: 0 m_BuildTargetVRSettings: - m_BuildTarget: Standalone m_Enabled: 0 m_Devices: - Oculus - OpenVR - m_BuildTargetEnableVuforiaSettings: [] + m_DefaultShaderChunkSizeInMB: 16 + m_DefaultShaderChunkCount: 0 openGLRequireES31: 0 openGLRequireES31AEP: 0 + openGLRequireES32: 0 m_TemplateCustomTags: {} mobileMTRendering: iPhone: 1 tvOS: 1 m_BuildTargetGroupLightmapEncodingQuality: - - m_BuildTarget: Standalone + - serializedVersion: 2 + m_BuildTarget: Standalone m_EncodingQuality: 1 - - m_BuildTarget: XboxOne + - serializedVersion: 2 + m_BuildTarget: XboxOne m_EncodingQuality: 1 - - m_BuildTarget: PS4 + - serializedVersion: 2 + m_BuildTarget: PS4 m_EncodingQuality: 1 + m_BuildTargetGroupHDRCubemapEncodingQuality: + - serializedVersion: 2 + m_BuildTarget: Standalone + m_EncodingQuality: 2 + - serializedVersion: 2 + m_BuildTarget: XboxOne + m_EncodingQuality: 2 + - serializedVersion: 2 + m_BuildTarget: PS4 + m_EncodingQuality: 2 m_BuildTargetGroupLightmapSettings: - m_BuildTarget: Standalone m_TextureStreamingEnabled: 0 m_TextureStreamingPriority: 0 + m_BuildTargetGroupLoadStoreDebugModeSettings: [] + m_BuildTargetNormalMapEncoding: [] + m_BuildTargetDefaultTextureCompressionFormat: [] playModeTestRunnerEnabled: 0 runPlayModeTestAsEditModeTest: 0 actionOnDotNetUnhandledException: 1 + editorGfxJobOverride: 1 enableInternalProfiler: 0 logObjCUncaughtExceptions: 1 enableCrashReportAPI: 0 cameraUsageDescription: locationUsageDescription: microphoneUsageDescription: + bluetoothUsageDescription: + macOSTargetOSVersion: 12.0 + switchNMETAOverride: switchNetLibKey: switchSocketMemoryPoolSize: 6144 switchSocketAllocatorPoolSize: 128 switchSocketConcurrencyLimit: 14 switchScreenResolutionBehavior: 2 switchUseCPUProfiler: 0 + switchEnableFileSystemTrace: 0 + switchLTOSetting: 0 switchApplicationID: 0x0005000C10000001 switchNSODependencies: + switchCompilerFlags: switchTitleNames_0: switchTitleNames_1: switchTitleNames_2: @@ -317,6 +439,7 @@ PlayerSettings: switchTitleNames_12: switchTitleNames_13: switchTitleNames_14: + switchTitleNames_15: switchPublisherNames_0: switchPublisherNames_1: switchPublisherNames_2: @@ -332,6 +455,7 @@ PlayerSettings: switchPublisherNames_12: switchPublisherNames_13: switchPublisherNames_14: + switchPublisherNames_15: switchIcons_0: {fileID: 0} switchIcons_1: {fileID: 0} switchIcons_2: {fileID: 0} @@ -347,6 +471,7 @@ PlayerSettings: switchIcons_12: {fileID: 0} switchIcons_13: {fileID: 0} switchIcons_14: {fileID: 0} + switchIcons_15: {fileID: 0} switchSmallIcons_0: {fileID: 0} switchSmallIcons_1: {fileID: 0} switchSmallIcons_2: {fileID: 0} @@ -362,6 +487,7 @@ PlayerSettings: switchSmallIcons_12: {fileID: 0} switchSmallIcons_13: {fileID: 0} switchSmallIcons_14: {fileID: 0} + switchSmallIcons_15: {fileID: 0} switchManualHTML: switchAccessibleURLs: switchLegalInformation: @@ -371,7 +497,6 @@ PlayerSettings: switchReleaseVersion: 0 switchDisplayVersion: 1.0.0 switchStartupUserAccount: 0 - switchTouchScreenUsage: 0 switchSupportedLanguagesMask: 0 switchLogoType: 0 switchApplicationErrorCodeCategory: @@ -393,6 +518,7 @@ PlayerSettings: switchRatingsInt_9: 0 switchRatingsInt_10: 0 switchRatingsInt_11: 0 + switchRatingsInt_12: 0 switchLocalCommunicationIds_0: 0x0005000C10000001 switchLocalCommunicationIds_1: switchLocalCommunicationIds_2: @@ -407,10 +533,12 @@ PlayerSettings: switchAllowsRuntimeAddOnContentInstall: 0 switchDataLossConfirmation: 0 switchUserAccountLockEnabled: 0 + switchSystemResourceMemory: 16777216 switchSupportedNpadStyles: 3 switchNativeFsCacheSize: 32 switchIsHoldTypeHorizontal: 0 switchSupportedNpadCount: 8 + switchEnableTouchScreen: 1 switchSocketConfigEnabled: 0 switchTcpInitialSendBufferSize: 32 switchTcpInitialReceiveBufferSize: 64 @@ -421,7 +549,14 @@ PlayerSettings: switchSocketBufferEfficiency: 4 switchSocketInitializeEnabled: 1 switchNetworkInterfaceManagerInitializeEnabled: 1 - switchPlayerConnectionEnabled: 1 + switchDisableHTCSPlayerConnection: 0 + switchUseNewStyleFilepaths: 1 + switchUseLegacyFmodPriorities: 0 + switchUseMicroSleepForYield: 1 + switchEnableRamDiskSupport: 0 + switchMicroSleepForYieldTime: 25 + switchRamDiskSpaceSize: 12 + switchUpgradedPlayerSettingsToNMETA: 0 ps4NPAgeRating: 12 ps4NPTitleSecret: ps4NPTrophyPackPath: @@ -448,6 +583,7 @@ PlayerSettings: ps4ShareFilePath: ps4ShareOverlayImagePath: ps4PrivacyGuardImagePath: + ps4ExtraSceSysFile: ps4NPtitleDatPath: ps4RemotePlayKeyAssignment: -1 ps4RemotePlayKeyMappingDir: @@ -460,6 +596,7 @@ PlayerSettings: ps4DownloadDataSize: 0 ps4GarlicHeapSize: 2048 ps4ProGarlicHeapSize: 2560 + playerPrefsMaxSize: 32768 ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ ps4pnSessions: 1 ps4pnPresence: 1 @@ -472,6 +609,7 @@ PlayerSettings: ps4UseResolutionFallback: 0 ps4ReprojectionSupport: 0 ps4UseAudio3dBackend: 0 + ps4UseLowGarlicFragmentationMode: 1 ps4SocialScreenEnabled: 0 ps4ScriptOptimizationLevel: 3 ps4Audio3dVirtualSpeakerCount: 14 @@ -488,15 +626,21 @@ PlayerSettings: ps4disableAutoHideSplash: 0 ps4videoRecordingFeaturesUsed: 0 ps4contentSearchFeaturesUsed: 0 + ps4CompatibilityPS5: 0 + ps4AllowPS5Detection: 0 + ps4GPU800MHz: 1 ps4attribEyeToEyeDistanceSettingVR: 0 ps4IncludedModules: [] + ps4attribVROutputEnabled: 0 monoEnv: splashScreenBackgroundSourceLandscape: {fileID: 0} splashScreenBackgroundSourcePortrait: {fileID: 0} + blurSplashScreenBackground: 1 spritePackerPolicy: webGLMemorySize: 256 webGLExceptionSupport: 1 webGLNameFilesAsHashes: 0 + webGLShowDiagnostics: 0 webGLDataCaching: 0 webGLDebugSymbols: 0 webGLEmscriptenArgs: @@ -505,20 +649,59 @@ PlayerSettings: webGLAnalyzeBuildSize: 0 webGLUseEmbeddedResources: 0 webGLCompressionFormat: 1 + webGLWasmArithmeticExceptions: 0 webGLLinkerTarget: 1 webGLThreadsSupport: 0 + webGLDecompressionFallback: 0 + webGLInitialMemorySize: 32 + webGLMaximumMemorySize: 2048 + webGLMemoryGrowthMode: 2 + webGLMemoryLinearGrowthStep: 16 + webGLMemoryGeometricGrowthStep: 0.2 + webGLMemoryGeometricGrowthCap: 96 + webGLPowerPreference: 2 + webGLWebAssemblyTable: 0 + webGLWebAssemblyBigInt: 0 + webGLCloseOnQuit: 0 + webWasm2023: 0 + webEnableSubmoduleStrippingCompatibility: 0 scriptingDefineSymbols: {} + additionalCompilerArguments: {} platformArchitecture: {} - scriptingBackend: {} + scriptingBackend: + Android: 0 il2cppCompilerConfiguration: {} + il2cppCodeGeneration: {} + il2cppStacktraceInformation: {} managedStrippingLevel: + Android: 1 + EmbeddedLinux: 1 + GameCoreScarlett: 1 + GameCoreXboxOne: 1 + Kepler: 1 + Nintendo Switch: 1 + Nintendo Switch 2: 1 + PS4: 1 + PS5: 1 + QNX: 1 Standalone: 3 + VisionOS: 1 + WebGL: 1 + Windows Store Apps: 1 + XboxOne: 1 + iPhone: 1 + tvOS: 1 incrementalIl2cppBuild: {} + suppressCommonWarnings: 1 allowUnsafeCode: 1 + useDeterministicCompilation: 1 additionalIl2CppArgs: scriptingRuntimeVersion: 1 + gcIncremental: 1 + gcWBarrierValidation: 0 apiCompatibilityLevelPerPlatform: Standalone: 6 + editorAssembliesCompatibilityLevel: 2 m_RenderingPath: 1 m_MobileRenderingPath: 1 metroPackageName: I76 @@ -543,12 +726,13 @@ PlayerSettings: metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} metroSplashScreenUseBackgroundColor: 0 + syncCapabilities: 0 platformCapabilities: {} metroTargetDeviceFamilies: {} metroFTAName: metroFTAFileTypes: [] metroProtocolName: - metroCompilationOverrides: 1 + vcxProjDefaultLanguage: XboxOneProductId: XboxOneUpdateKey: XboxOneSandboxId: @@ -567,18 +751,16 @@ PlayerSettings: XboxOneCapability: [] XboxOneGameRating: {} XboxOneIsContentPackage: 0 + XboxOneEnhancedXboxCompatibilityMode: 0 XboxOneEnableGPUVariability: 0 XboxOneSockets: {} XboxOneSplashScreen: {fileID: 0} XboxOneAllowedProductIds: [] XboxOnePersistentLocalStorageSize: 0 XboxOneXTitleMemory: 8 - xboxOneScriptCompiler: 0 XboxOneOverrideIdentityName: - vrEditorSettings: - daydream: - daydreamIconForeground: {fileID: 0} - daydreamIconBackground: {fileID: 0} + XboxOneOverrideIdentityPublisher: + vrEditorSettings: {} cloudServicesEnabled: {} luminIcon: m_Name: @@ -586,24 +768,34 @@ PlayerSettings: m_PortalFolderPath: luminCert: m_CertPath: - m_PrivateKeyPath: + m_SignPackage: 1 luminIsChannelApp: 0 luminVersion: m_VersionCode: 1 m_VersionName: - facebookSdkVersion: 7.9.1 - facebookAppId: - facebookCookies: 1 - facebookLogging: 1 - facebookStatus: 1 - facebookXfbml: 0 - facebookFrictionlessRequests: 1 + hmiPlayerDataPath: + hmiForceSRGBBlit: 0 + embeddedLinuxEnableGamepadInput: 0 + hmiCpuConfiguration: + hmiLogStartupTiming: 0 + qnxGraphicConfPath: apiCompatibilityLevel: 3 + captureStartupLogs: {} + activeInputHandler: 1 + windowsGamepadBackendHint: 0 cloudProjectId: framebufferDepthMemorylessMode: 0 + qualitySettingsNames: [] projectName: organizationId: cloudEnabled: 0 - enableNativePlatformBackendsForNewInputSystem: 0 - disableOldInputManagerSupport: 0 legacyClampBlendShapeWeights: 0 + hmiLoadingImage: {fileID: 0} + platformRequiresReadableAssets: 0 + virtualTexturingSupportEnabled: 0 + insecureHttpOption: 0 + androidVulkanDenyFilterList: [] + androidVulkanAllowFilterList: [] + androidVulkanDeviceFilterListAsset: {fileID: 0} + d3d12DeviceFilterListAsset: {fileID: 0} + allowedHttpConnections: 3 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 77fa359..879b68f 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2019.3.4f1 -m_EditorVersionWithRevision: 2019.3.4f1 (4f139db2fdbd) +m_EditorVersion: 6000.3.2f1 +m_EditorVersionWithRevision: 6000.3.2f1 (a9779f353c9b) diff --git a/ProjectSettings/SceneTemplateSettings.json b/ProjectSettings/SceneTemplateSettings.json new file mode 100644 index 0000000..ede5887 --- /dev/null +++ b/ProjectSettings/SceneTemplateSettings.json @@ -0,0 +1,121 @@ +{ + "templatePinStates": [], + "dependencyTypeInfos": [ + { + "userAdded": false, + "type": "UnityEngine.AnimationClip", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.Animations.AnimatorController", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.AnimatorOverrideController", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.Audio.AudioMixerController", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.ComputeShader", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.Cubemap", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.GameObject", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.LightingDataAsset", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.LightingSettings", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Material", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.MonoScript", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicsMaterial", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicsMaterial2D", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.VolumeProfile", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.SceneAsset", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.Shader", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.ShaderVariantCollection", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.Texture", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Texture2D", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Timeline.TimelineAsset", + "defaultInstantiationMode": 0 + } + ], + "defaultDependencyTypeInfo": { + "userAdded": false, + "type": "", + "defaultInstantiationMode": 1 + }, + "newSceneOverride": 0 +} \ No newline at end of file diff --git a/ProjectSettings/TimelineSettings.asset b/ProjectSettings/TimelineSettings.asset new file mode 100644 index 0000000..42ff6bc --- /dev/null +++ b/ProjectSettings/TimelineSettings.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 53 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.Timeline.Editor::TimelineProjectSettings + assetDefaultFramerate: 60 + m_DefaultFrameRate: 60 diff --git a/ProjectSettings/VersionControlSettings.asset b/ProjectSettings/VersionControlSettings.asset new file mode 100644 index 0000000..dca2881 --- /dev/null +++ b/ProjectSettings/VersionControlSettings.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!890905787 &1 +VersionControlSettings: + m_ObjectHideFlags: 0 + m_Mode: Visible Meta Files + m_CollabEditorSettings: + inProgressEnabled: 1 diff --git a/README.md b/README.md index 424658f..557d27d 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,8 @@ The simulation does not work yet. Driving around works as well as the various ca Some features of the above are not yet fully implemented or have problems - see Issues. ## How do I run it? -1. Open Level.scene in Unity. -2. Find the gameobject called "Game" and set the "Game path" property to your Interstate '76 install directory. - -~~For now, Open76 requires the uncompressed ZFS of version 1.0 as delivered on the original CD. It cannot parse the compressed ZFS present in later versions.~~ +1. Open Level.unity in Unity. +2. Find the game object called "Game" and set the "Game path" property to your Interstate '76 install directory. Open76 can now parse both the original uncompressed version and the compressed version of the ZFS. Nitro pack seems to have a different mission file format, this needs to be investigated.