├── Assets ├── Misc │ ├── Floor.metatex │ ├── Strawman.fbx │ ├── Dancer.mat.meta │ ├── Floor.mat.meta │ ├── Floor.metatex.meta │ ├── Strawman.fbx.meta │ ├── Dancer.mat │ └── Floor.mat ├── Main.unity.meta ├── Main │ └── Sub.unity.meta ├── Main.meta ├── Misc.meta ├── Samples.meta ├── URP.meta ├── SceneDependencyCache.meta ├── Samples │ ├── Character Controller.meta │ └── Character Controller │ │ ├── 1.0.0-exp.22.meta │ │ └── 1.0.0-exp.22 │ │ ├── Standard Characters.meta │ │ └── Standard Characters │ │ ├── Common.meta │ │ ├── Common │ │ ├── Scripts.meta │ │ ├── Materials.meta │ │ ├── Scripts │ │ │ ├── Camera.meta │ │ │ ├── Camera │ │ │ │ ├── MainEntityCamera.cs │ │ │ │ ├── MainCameraSystem.cs.meta │ │ │ │ ├── MainEntityCamera.cs.meta │ │ │ │ ├── MainGameObjectCamera.cs.meta │ │ │ │ ├── MainEntityCameraAuthoring.cs.meta │ │ │ │ ├── MainGameObjectCamera.cs │ │ │ │ ├── MainEntityCameraAuthoring.cs │ │ │ │ └── MainCameraSystem.cs │ │ │ ├── FixedInputEvent.cs.meta │ │ │ ├── FixedTickSystem.cs.meta │ │ │ ├── FixedInputEvent.cs │ │ │ └── FixedTickSystem.cs │ │ └── Materials │ │ │ ├── SimpleMaterial_White.mat.meta │ │ │ ├── SimpleShader.shadergraph.meta │ │ │ └── SimpleMaterial_White.mat │ │ ├── FirstPerson.meta │ │ ├── ThirdPerson.meta │ │ ├── .sample.json │ │ ├── FirstPerson │ │ ├── Prefabs.meta │ │ ├── Scripts.meta │ │ ├── Prefabs │ │ │ ├── FirstPersonCharacter.prefab.meta │ │ │ ├── FirstPersonPlayer.prefab.meta │ │ │ ├── FirstPersonPlayer.prefab │ │ │ └── FirstPersonCharacter.prefab │ │ └── Scripts │ │ │ ├── FirstPersonPlayer.cs.meta │ │ │ ├── FirstPersonCharacterAspect.cs.meta │ │ │ ├── FirstPersonCharacterSystems.cs.meta │ │ │ ├── FirstPersonPlayerAuthoring.cs.meta │ │ │ ├── FirstPersonPlayerSystems.cs.meta │ │ │ ├── FirstPersonCharacterAuthoring.cs.meta │ │ │ ├── FirstPersonCharacterComponent.cs.meta │ │ │ ├── FirstPersonCharacterUtilities.cs.meta │ │ │ ├── FirstPersonCharacterViewAuthoring.cs.meta │ │ │ ├── FirstPersonPlayer.cs │ │ │ ├── FirstPersonPlayerAuthoring.cs │ │ │ ├── FirstPersonCharacterViewAuthoring.cs │ │ │ ├── FirstPersonCharacterAuthoring.cs │ │ │ ├── FirstPersonCharacterComponent.cs │ │ │ ├── FirstPersonPlayerSystems.cs │ │ │ ├── FirstPersonCharacterUtilities.cs │ │ │ ├── FirstPersonCharacterSystems.cs │ │ │ └── FirstPersonCharacterAspect.cs │ │ └── ThirdPerson │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ ├── OrbitCamera.prefab.meta │ │ ├── ThirdPersonCharacter.prefab.meta │ │ ├── ThirdPersonPlayer.prefab.meta │ │ ├── ThirdPersonPlayer.prefab │ │ ├── OrbitCamera.prefab │ │ └── ThirdPersonCharacter.prefab │ │ ├── Scripts.meta │ │ └── Scripts │ │ ├── OrbitCamera.meta │ │ ├── OrbitCamera │ │ ├── CameraTarget.cs │ │ ├── CameraTarget.cs.meta │ │ ├── OrbitCamera.cs.meta │ │ ├── OrbitCameraAuthoring.cs.meta │ │ ├── OrbitCameraSystem.cs.meta │ │ ├── CameraTargetAuthoring.cs.meta │ │ ├── CameraTargetAuthoring.cs │ │ ├── OrbitCameraAuthoring.cs │ │ └── OrbitCamera.cs │ │ ├── ThirdPersonPlayer.cs.meta │ │ ├── ThirdPersonCharacterAspect.cs.meta │ │ ├── ThirdPersonCharacterSystems.cs.meta │ │ ├── ThirdPersonPlayerAuthoring.cs.meta │ │ ├── ThirdPersonPlayerSystems.cs.meta │ │ ├── ThirdPersonCharacterAuthoring.cs.meta │ │ ├── ThirdPersonCharacterComponent.cs.meta │ │ ├── ThirdPersonPlayer.cs │ │ ├── ThirdPersonPlayerAuthoring.cs │ │ ├── ThirdPersonCharacterAuthoring.cs │ │ ├── ThirdPersonCharacterComponent.cs │ │ ├── ThirdPersonCharacterSystems.cs │ │ ├── ThirdPersonPlayerSystems.cs │ │ └── ThirdPersonCharacterAspect.cs ├── URP │ ├── URP.asset.meta │ ├── GlobalSettings.asset.meta │ ├── URP_Renderer.asset.meta │ ├── GlobalSettings.asset │ ├── URP_Renderer.asset │ └── URP.asset └── Main.unity ├── ProjectSettings ├── ProjectVersion.txt ├── CommonBurstAotSettings.json ├── ClusterInputManager.asset ├── PresetManager.asset ├── XRSettings.asset ├── VersionControlSettings.asset ├── TimeManager.asset ├── EditorBuildSettings.asset ├── VFXManager.asset ├── BurstAotSettings_WebGL.json ├── URPProjectSettings.asset ├── BurstAotSettings_StandaloneOSX.json ├── AudioManager.asset ├── TimelineSettings.asset ├── EntitiesClientSettings.asset ├── BurstAotSettings_StandaloneWindows.json ├── ShaderGraphSettings.asset ├── TagManager.asset ├── UnityConnectSettings.asset ├── DynamicsManager.asset ├── MemorySettings.asset ├── PackageManagerSettings.asset ├── EditorSettings.asset ├── NavMeshAreas.asset ├── QualitySettings.asset ├── Physics2DSettings.asset ├── GraphicsSettings.asset ├── SceneTemplateSettings.json └── InputManager.asset ├── .gitignore ├── .gitattributes └── Packages ├── manifest.json └── packages-lock.json /Assets/Misc/Floor.metatex: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Assets/Misc/Strawman.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ECS-CharacterControllerTest/HEAD/Assets/Misc/Strawman.fbx -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2022.3.9f1 2 | m_EditorVersionWithRevision: 2022.3.9f1 (ea401c316338) 3 | -------------------------------------------------------------------------------- /ProjectSettings/CommonBurstAotSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "Version": 4, 4 | "DisabledWarnings": "" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Thumbs.db 2 | Desktop.ini 3 | .DS_Store 4 | *.swp 5 | 6 | /Assets/SceneDependencyCache 7 | /Library 8 | /Logs 9 | /Recordings 10 | /Temp 11 | /UserSettings 12 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /Assets/Main.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d1ee5439f956e9429f8810e46e94930 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Main/Sub.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e97ba449cab001448a018fb1627b745 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /Assets/Main.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65276afe570ddf84289169a7b64e367b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Misc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0102e2bfa7d856d4a9ca342af21bf647 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a39410e033516743ac26f1c8df0c007 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URP.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec13d45ba11d55143a82785f70d54b05 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * -text 2 | 3 | *.cs text eol=lf diff=csharp 4 | *.shader text eol=lf 5 | *.cginc text eol=lf 6 | *.hlsl text eol=lf 7 | *.compute text eol=lf 8 | 9 | *.meta text eol=lf 10 | -------------------------------------------------------------------------------- /Assets/SceneDependencyCache.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81b0c2c4bfb03294aacc79f9963c066b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /Assets/Misc/Dancer.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a223f32c83514184dbd14603f1f2b8ee 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Misc/Floor.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67ece384dff158e47a28f7ca3967c0de 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d0574f1c2296c04d8a115031071b4b3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URP/URP.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b4a563bbbe76df4f910689b91466930 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c10b87599c7b6e949aacab62eb627664 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URP/GlobalSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af475ddc951385a4eb0ec2776bf5c357 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URP/URP_Renderer.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07c83bcd1c38cd54fbaed930e68ee0e9 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cca37b77a50feb14092ba1e9cf882788 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70f0f4c77223cfe47874f4fa60a4dde6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 612c2e3af04f3d54a9f97a248cc1b074 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bbdb83402ee5311408f853bab201d6a0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52b9553a57dc1e84fb7958bdbe268b3f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/.sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "displayName":"Standard Characters", 3 | "description": "Replace this string with your own description of the sample. Delete the Samples folder if not needed.", 4 | "createSeparatePackage": false 5 | } 6 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cae70069c0be15b49a1ae75f627ca5b0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dee4f1f9965526945b6c704f95625b90 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03d97814abf1c7b45b2d6aab78865870 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3618e38bce9ef804a9830edc2f987f2b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Prefabs/OrbitCamera.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 492a184cc1501fe4da86d69b5eddc366 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 160196554b17cd743aac83686c6eb5dc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts/Camera.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99214d3f1d71df340b942a6ad26882ae 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Prefabs/FirstPersonCharacter.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e95be3f6ef9cc8243994bdcda968a0e5 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Prefabs/FirstPersonPlayer.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c22dcbefac332745a1efbea69cb8bfc 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Prefabs/ThirdPersonCharacter.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fbcc801dea8fd640a004697d22ed448 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Prefabs/ThirdPersonPlayer.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65701a63aea96444fa3a4b2ed4edbb25 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts/Camera/MainEntityCamera.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Unity.Collections; 3 | using Unity.Entities; 4 | using Unity.Mathematics; 5 | 6 | [Serializable] 7 | public struct MainEntityCamera : IComponentData 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/OrbitCamera.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d266609e8af72ea41909b7a326478e84 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Materials/SimpleMaterial_White.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70c3442346d77cb4781288146feb488a 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Main.unity 10 | guid: 3d1ee5439f956e9429f8810e46e94930 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/OrbitCamera/CameraTarget.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Unity.Collections; 3 | using Unity.Entities; 4 | using Unity.Mathematics; 5 | 6 | [Serializable] 7 | public struct CameraTarget : IComponentData 8 | { 9 | public Entity TargetEntity; 10 | } 11 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts/FixedInputEvent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8544c6607fc2464898a9419ad9e6edf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts/FixedTickSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6fbafd4891f00443b6216ceb5e730e2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b475ce53dfa6de64ea0a2e1beac9c141 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8586d18bf7667c040949956b7ff40b6d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts/Camera/MainCameraSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d4fbc2db2fb32d48b168c795a5c3afd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts/Camera/MainEntityCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9680d5663c7e4b24a9308dce893ab885 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts/Camera/MainGameObjectCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef98a7c3224c6704d976c8bd33dfc59e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts/Camera/MainEntityCameraAuthoring.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91cffade3faa23640921cbb79b1e6bb0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonCharacterAspect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5e8284f926e5e7448f516cf2f1b9519 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonCharacterSystems.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8255af6f295149f41bc8baf529b5b711 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonPlayerAuthoring.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98df7776338bbf9418e4d50363a02333 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonPlayerSystems.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 068c7fe0e7567404cb30b0d8715b4560 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/OrbitCamera/CameraTarget.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74ff9a59933a5494bbc1bb465a5f2180 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/OrbitCamera/OrbitCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 441900b2dca2cda429cba5f372fcf5fe 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonCharacterAspect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e1982b631c39194b8eaa4838ec11284 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonCharacterSystems.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b37392a281d8a5f45a770ad4cfd747a6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonPlayerAuthoring.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fbdb3174a73a07408595a85d3e7fb6a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonPlayerSystems.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 427fac77ddc96db4a87e6d5b4a31555f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonCharacterAuthoring.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03c9592a80483fd478e45d176ac83132 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonCharacterComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 639e80f96b7d5f94bbb37c78f27edecd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonCharacterUtilities.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 446b6f888df7be748b79fecd775dff83 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/OrbitCamera/OrbitCameraAuthoring.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70c323b4be4b1fa4089d1a1fd2872754 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/OrbitCamera/OrbitCameraSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d6d36bc694f390408f5683be8de8c7d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonCharacterAuthoring.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c854a728d43c7cf47bec103607a449f9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonCharacterComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8471dfde63584745b2234708055b211 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonCharacterViewAuthoring.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3ddd2cb094880b40a1612adcf67e9a2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/OrbitCamera/CameraTargetAuthoring.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3a88336df575c34e80048c54a815367 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts/Camera/MainGameObjectCamera.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | 7 | public class MainGameObjectCamera : MonoBehaviour 8 | { 9 | public static Camera Instance; 10 | 11 | void Awake() 12 | { 13 | Instance = GetComponent(); 14 | } 15 | } -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Materials/SimpleShader.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d40c85a2e8955d4ea370f6fd8c48a34 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /ProjectSettings/BurstAotSettings_WebGL.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "Version": 4, 4 | "EnableBurstCompilation": true, 5 | "EnableOptimisations": true, 6 | "EnableSafetyChecks": false, 7 | "EnableDebugInAllBuilds": false, 8 | "DebugDataKind": 1, 9 | "EnableArmv9SecurityFeatures": false, 10 | "CpuMinTargetX32": 0, 11 | "CpuMaxTargetX32": 0, 12 | "CpuMinTargetX64": 0, 13 | "CpuMaxTargetX64": 0, 14 | "OptimizeFor": 0 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.charactercontroller": "1.0.0-exp.22", 4 | "com.unity.entities.graphics": "1.0.14", 5 | "com.unity.render-pipelines.universal": "14.0.8", 6 | "jp.keijiro.metatex": "1.0.4", 7 | "com.unity.modules.uielements": "1.0.0" 8 | }, 9 | "scopedRegistries": [ 10 | { 11 | "name": "Keijiro", 12 | "url": "https://registry.npmjs.com", 13 | "scopes": [ 14 | "jp.keijiro" 15 | ] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /ProjectSettings/URPProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 247994e1f5a72c2419c26a37e9334c01, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_LastMaterialVersion: 7 16 | -------------------------------------------------------------------------------- /ProjectSettings/BurstAotSettings_StandaloneOSX.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "Version": 4, 4 | "EnableBurstCompilation": true, 5 | "EnableOptimisations": true, 6 | "EnableSafetyChecks": false, 7 | "EnableDebugInAllBuilds": false, 8 | "DebugDataKind": 1, 9 | "EnableArmv9SecurityFeatures": false, 10 | "CpuMinTargetX32": 0, 11 | "CpuMaxTargetX32": 0, 12 | "CpuMinTargetX64": 0, 13 | "CpuMaxTargetX64": 0, 14 | "CpuTargetsX64": 72, 15 | "OptimizeFor": 0 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /ProjectSettings/TimelineSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | assetDefaultFramerate: 60 16 | m_DefaultFrameRate: 60 17 | -------------------------------------------------------------------------------- /ProjectSettings/EntitiesClientSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: e2ea235c1fcfe29488ed97c467a0da53, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | FilterSettings: 16 | ExcludedBakingSystemAssemblies: [] 17 | -------------------------------------------------------------------------------- /ProjectSettings/BurstAotSettings_StandaloneWindows.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "Version": 4, 4 | "EnableBurstCompilation": true, 5 | "EnableOptimisations": true, 6 | "EnableSafetyChecks": false, 7 | "EnableDebugInAllBuilds": false, 8 | "DebugDataKind": 1, 9 | "EnableArmv9SecurityFeatures": false, 10 | "CpuMinTargetX32": 0, 11 | "CpuMaxTargetX32": 0, 12 | "CpuMinTargetX64": 0, 13 | "CpuMaxTargetX64": 0, 14 | "CpuTargetsX32": 6, 15 | "CpuTargetsX64": 72, 16 | "OptimizeFor": 0 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ProjectSettings/ShaderGraphSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: de02f9e1d18f588468e474319d09a723, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | customInterpolatorErrorThreshold: 32 16 | customInterpolatorWarningThreshold: 16 17 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonPlayer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Unity.Collections; 3 | using Unity.Entities; 4 | using Unity.Mathematics; 5 | 6 | [Serializable] 7 | public struct FirstPersonPlayer : IComponentData 8 | { 9 | public Entity ControlledCharacter; 10 | public float MouseSensitivity; 11 | } 12 | 13 | [Serializable] 14 | public struct FirstPersonPlayerInputs : IComponentData 15 | { 16 | public float2 MoveInput; 17 | public float2 LookInput; 18 | public FixedInputEvent JumpPressed; 19 | } -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonPlayer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Unity.Collections; 3 | using Unity.Entities; 4 | using Unity.Mathematics; 5 | 6 | [Serializable] 7 | public struct ThirdPersonPlayer : IComponentData 8 | { 9 | public Entity ControlledCharacter; 10 | public Entity ControlledCamera; 11 | } 12 | 13 | [Serializable] 14 | public struct ThirdPersonPlayerInputs : IComponentData 15 | { 16 | public float2 MoveInput; 17 | public float2 CameraLookInput; 18 | public float CameraZoomInput; 19 | public FixedInputEvent JumpPressed; 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts/FixedInputEvent.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public struct FixedInputEvent 6 | { 7 | private byte _wasEverSet; 8 | private uint _lastSetTick; 9 | 10 | public void Set(uint tick) 11 | { 12 | _lastSetTick = tick; 13 | _wasEverSet = 1; 14 | } 15 | 16 | public bool IsSet(uint tick) 17 | { 18 | if (_wasEverSet == 1) 19 | { 20 | return tick == _lastSetTick; 21 | } 22 | 23 | return false; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts/Camera/MainEntityCameraAuthoring.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using Unity.Entities; 5 | 6 | [DisallowMultipleComponent] 7 | public class MainEntityCameraAuthoring : MonoBehaviour 8 | { 9 | public class Baker : Baker 10 | { 11 | public override void Bake(MainEntityCameraAuthoring authoring) 12 | { 13 | Entity entity = GetEntity(TransformUsageFlags.Dynamic); 14 | AddComponent(entity); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/OrbitCamera/CameraTargetAuthoring.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using Unity.Entities; 5 | 6 | [DisallowMultipleComponent] 7 | public class CameraTargetAuthoring : MonoBehaviour 8 | { 9 | public GameObject Target; 10 | 11 | public class Baker : Baker 12 | { 13 | public override void Bake(CameraTargetAuthoring authoring) 14 | { 15 | Entity entity = GetEntity(TransformUsageFlags.Dynamic); 16 | AddComponent(entity, new CameraTarget 17 | { 18 | TargetEntity = GetEntity(authoring.Target, TransformUsageFlags.Dynamic), 19 | }); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts/Camera/MainCameraSystem.cs: -------------------------------------------------------------------------------- 1 | using Unity.Burst; 2 | using Unity.Collections; 3 | using Unity.Entities; 4 | using Unity.Jobs; 5 | using Unity.Mathematics; 6 | using Unity.Transforms; 7 | 8 | [UpdateInGroup(typeof(PresentationSystemGroup))] 9 | public partial class MainCameraSystem : SystemBase 10 | { 11 | protected override void OnUpdate() 12 | { 13 | if (MainGameObjectCamera.Instance != null && SystemAPI.HasSingleton()) 14 | { 15 | Entity mainEntityCameraEntity = SystemAPI.GetSingletonEntity(); 16 | LocalToWorld targetLocalToWorld = SystemAPI.GetComponent(mainEntityCameraEntity); 17 | MainGameObjectCamera.Instance.transform.SetPositionAndRotation(targetLocalToWorld.Position, targetLocalToWorld.Rotation); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonPlayerAuthoring.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Unity.Entities; 3 | 4 | [DisallowMultipleComponent] 5 | public class FirstPersonPlayerAuthoring : MonoBehaviour 6 | { 7 | public GameObject ControlledCharacter; 8 | public float MouseSensitivity = 1f; 9 | 10 | public class Baker : Baker 11 | { 12 | public override void Bake(FirstPersonPlayerAuthoring authoring) 13 | { 14 | Entity entity = GetEntity(TransformUsageFlags.None); 15 | AddComponent(entity, new FirstPersonPlayer 16 | { 17 | ControlledCharacter = GetEntity(authoring.ControlledCharacter, TransformUsageFlags.Dynamic), 18 | MouseSensitivity = authoring.MouseSensitivity, 19 | }); 20 | AddComponent(entity, new FirstPersonPlayerInputs()); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonPlayerAuthoring.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Unity.Entities; 3 | 4 | [DisallowMultipleComponent] 5 | public class ThirdPersonPlayerAuthoring : MonoBehaviour 6 | { 7 | public GameObject ControlledCharacter; 8 | public GameObject ControlledCamera; 9 | 10 | public class Baker : Baker 11 | { 12 | public override void Bake(ThirdPersonPlayerAuthoring authoring) 13 | { 14 | Entity entity = GetEntity(TransformUsageFlags.None); 15 | AddComponent(entity, new ThirdPersonPlayer 16 | { 17 | ControlledCharacter = GetEntity(authoring.ControlledCharacter, TransformUsageFlags.Dynamic), 18 | ControlledCamera = GetEntity(authoring.ControlledCamera, TransformUsageFlags.Dynamic), 19 | }); 20 | AddComponent(entity, new ThirdPersonPlayerInputs()); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Assets/URP/GlobalSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 2ec995e51a6e251468d2a3fd8a686257, type: 3} 13 | m_Name: GlobalSettings 14 | m_EditorClassIdentifier: 15 | k_AssetVersion: 3 16 | m_RenderingLayerNames: 17 | - Default 18 | m_ValidRenderingLayers: 1 19 | lightLayerName0: 20 | lightLayerName1: 21 | lightLayerName2: 22 | lightLayerName3: 23 | lightLayerName4: 24 | lightLayerName5: 25 | lightLayerName6: 26 | lightLayerName7: 27 | m_StripDebugVariants: 1 28 | m_StripUnusedPostProcessingVariants: 0 29 | m_StripUnusedVariants: 1 30 | m_StripUnusedLODCrossFadeVariants: 1 31 | m_StripScreenCoordOverrideVariants: 1 32 | supportRuntimeDebugDisplay: 0 33 | m_ShaderVariantLogLevel: 0 34 | m_ExportShaderVariants: 1 35 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Scripts/FixedTickSystem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using Unity.Burst; 5 | using Unity.Entities; 6 | using UnityEngine; 7 | 8 | [UpdateInGroup(typeof(FixedStepSimulationSystemGroup), OrderLast = true)] 9 | [BurstCompile] 10 | public partial struct FixedTickSystem : ISystem 11 | { 12 | public struct Singleton : IComponentData 13 | { 14 | public uint Tick; 15 | } 16 | 17 | public void OnCreate(ref SystemState state) 18 | { 19 | if (!SystemAPI.HasSingleton()) 20 | { 21 | Entity singletonEntity = state.EntityManager.CreateEntity(); 22 | state.EntityManager.AddComponentData(singletonEntity, new Singleton()); 23 | } 24 | } 25 | 26 | [BurstCompile] 27 | public void OnUpdate(ref SystemState state) 28 | { 29 | ref Singleton singleton = ref SystemAPI.GetSingletonRW().ValueRW; 30 | singleton.Tick++; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | m_PackageRequiringCoreStatsPresent: 0 27 | UnityAdsSettings: 28 | m_Enabled: 0 29 | m_InitializeOnStartup: 1 30 | m_TestMode: 0 31 | m_IosGameId: 32 | m_AndroidGameId: 33 | m_GameIds: {} 34 | m_GameId: 35 | PerformanceReportingSettings: 36 | m_Enabled: 0 37 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonCharacterViewAuthoring.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using Unity.Entities; 4 | using UnityEngine; 5 | 6 | [DisallowMultipleComponent] 7 | public class FirstPersonCharacterViewAuthoring : MonoBehaviour 8 | { 9 | public GameObject Character; 10 | 11 | public class Baker : Baker 12 | { 13 | public override void Bake(FirstPersonCharacterViewAuthoring authoring) 14 | { 15 | if (authoring.transform.parent != authoring.Character.transform) 16 | { 17 | UnityEngine.Debug.LogError("ERROR: the Character View must be a direct 1st-level child of the character authoring GameObject. Conversion will be aborted"); 18 | return; 19 | } 20 | 21 | Entity entity = GetEntity(TransformUsageFlags.Dynamic); 22 | AddComponent(entity, new FirstPersonCharacterView { CharacterEntity = GetEntity(authoring.Character, TransformUsageFlags.Dynamic) }); 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonCharacterAuthoring.cs: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | using Unity.Mathematics; 3 | using Unity.Physics.Authoring; 4 | using UnityEngine; 5 | using Unity.CharacterController; 6 | using Unity.Physics; 7 | using UnityEngine.Serialization; 8 | 9 | [DisallowMultipleComponent] 10 | public class ThirdPersonCharacterAuthoring : MonoBehaviour 11 | { 12 | public AuthoringKinematicCharacterProperties CharacterProperties = AuthoringKinematicCharacterProperties.GetDefault(); 13 | public ThirdPersonCharacterComponent Character = ThirdPersonCharacterComponent.GetDefault(); 14 | 15 | public class Baker : Baker 16 | { 17 | public override void Bake(ThirdPersonCharacterAuthoring authoring) 18 | { 19 | KinematicCharacterUtilities.BakeCharacter(this, authoring, authoring.CharacterProperties); 20 | 21 | Entity entity = GetEntity(TransformUsageFlags.Dynamic | TransformUsageFlags.WorldSpace); 22 | 23 | AddComponent(entity, authoring.Character); 24 | AddComponent(entity, new ThirdPersonCharacterControl()); 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 1 16 | m_AdvancedSettingsExpanded: 1 17 | m_ScopedRegistriesSettingsExpanded: 1 18 | m_SeeAllPackageVersions: 0 19 | m_DismissPreviewPackagesInUse: 0 20 | oneTimeWarningShown: 1 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_ConfigSource: 0 29 | - m_Id: scoped:project:Keijiro 30 | m_Name: Keijiro 31 | m_Url: https://registry.npmjs.com 32 | m_Scopes: 33 | - jp.keijiro 34 | m_IsDefault: 0 35 | m_Capabilities: 0 36 | m_ConfigSource: 4 37 | m_UserSelectedRegistryName: Keijiro 38 | m_UserAddingNewScopedRegistry: 0 39 | m_RegistryInfoDraft: 40 | m_Modified: 0 41 | m_ErrorMessage: 42 | m_UserModificationsInstanceId: -834 43 | m_OriginalInstanceId: -836 44 | m_LoadAssets: 0 45 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonCharacterAuthoring.cs: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | using Unity.Mathematics; 3 | using Unity.Physics.Authoring; 4 | using UnityEngine; 5 | using Unity.CharacterController; 6 | using Unity.Physics; 7 | using System.Collections.Generic; 8 | using UnityEngine.Serialization; 9 | 10 | [DisallowMultipleComponent] 11 | public class FirstPersonCharacterAuthoring : MonoBehaviour 12 | { 13 | public GameObject ViewEntity; 14 | public AuthoringKinematicCharacterProperties CharacterProperties = AuthoringKinematicCharacterProperties.GetDefault(); 15 | public FirstPersonCharacterComponent Character = FirstPersonCharacterComponent.GetDefault(); 16 | 17 | public class Baker : Baker 18 | { 19 | public override void Bake(FirstPersonCharacterAuthoring authoring) 20 | { 21 | KinematicCharacterUtilities.BakeCharacter(this, authoring, authoring.CharacterProperties); 22 | 23 | authoring.Character.ViewEntity = GetEntity(authoring.ViewEntity, TransformUsageFlags.Dynamic); 24 | 25 | Entity entity = GetEntity(TransformUsageFlags.Dynamic | TransformUsageFlags.WorldSpace); 26 | 27 | AddComponent(entity, authoring.Character); 28 | AddComponent(entity, new FirstPersonCharacterControl()); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/Misc/Floor.metatex.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ca473c9234c9ce4ca24ee4bdc03e5a3 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 1431cff934e074ba08d350fd0fc5be0d, type: 3} 11 | _dimensions: {x: 512, y: 512} 12 | _generator: 6 13 | _colormap: 0 14 | _color: {r: 0.5, g: 0.5, b: 0.5, a: 1} 15 | _color2: {r: 0.31132078, g: 0.31132078, b: 0.31132078, a: 1} 16 | _gradient: 17 | serializedVersion: 2 18 | key0: {r: 1, g: 1, b: 1, a: 1} 19 | key1: {r: 0.5, g: 0.5, b: 0.5, a: 0} 20 | key2: {r: 0, g: 0, b: 0, a: 0} 21 | key3: {r: 0, g: 0, b: 0, a: 0} 22 | key4: {r: 0, g: 0, b: 0, a: 0} 23 | key5: {r: 0, g: 0, b: 0, a: 0} 24 | key6: {r: 0, g: 0, b: 0, a: 0} 25 | key7: {r: 0, g: 0, b: 0, a: 0} 26 | ctime0: 0 27 | ctime1: 65535 28 | ctime2: 0 29 | ctime3: 0 30 | ctime4: 0 31 | ctime5: 0 32 | ctime6: 0 33 | ctime7: 0 34 | atime0: 0 35 | atime1: 65535 36 | atime2: 0 37 | atime3: 0 38 | atime4: 0 39 | atime5: 0 40 | atime6: 0 41 | atime7: 0 42 | mode: 0 43 | colorSpace: -1 44 | numColorKeys: 2 45 | numAlphaKeys: 2 46 | _scale: {x: 1, y: 1} 47 | _codepoint: 1f600 48 | _shader: {instanceID: 0} 49 | _material: {instanceID: 0} 50 | _wrapMode: 0 51 | _filterMode: 2 52 | _anisoLevel: 4 53 | _compression: 1 54 | _linear: 0 55 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonCharacterComponent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Unity.Collections; 3 | using Unity.Entities; 4 | using Unity.Mathematics; 5 | using UnityEngine; 6 | using Unity.CharacterController; 7 | 8 | [Serializable] 9 | public struct ThirdPersonCharacterComponent : IComponentData 10 | { 11 | public float RotationSharpness; 12 | public float GroundMaxSpeed; 13 | public float GroundedMovementSharpness; 14 | public float AirAcceleration; 15 | public float AirMaxSpeed; 16 | public float AirDrag; 17 | public float JumpSpeed; 18 | public float3 Gravity; 19 | public bool PreventAirAccelerationAgainstUngroundedHits; 20 | public BasicStepAndSlopeHandlingParameters StepAndSlopeHandling; 21 | 22 | [HideInInspector] public bool DoubleJumped; 23 | 24 | public static ThirdPersonCharacterComponent GetDefault() 25 | { 26 | return new ThirdPersonCharacterComponent 27 | { 28 | RotationSharpness = 25f, 29 | GroundMaxSpeed = 10f, 30 | GroundedMovementSharpness = 15f, 31 | AirAcceleration = 50f, 32 | AirMaxSpeed = 10f, 33 | AirDrag = 0f, 34 | JumpSpeed = 10f, 35 | Gravity = math.up() * -30f, 36 | PreventAirAccelerationAgainstUngroundedHits = true, 37 | StepAndSlopeHandling = BasicStepAndSlopeHandlingParameters.GetDefault(), 38 | }; 39 | } 40 | } 41 | 42 | [Serializable] 43 | public struct ThirdPersonCharacterControl : IComponentData 44 | { 45 | public float3 MoveVector; 46 | public bool Jump; 47 | } 48 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Prefabs/FirstPersonPlayer.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &577874318210893199 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 577874318210893197} 12 | - component: {fileID: 7698645590983583992} 13 | m_Layer: 0 14 | m_Name: FirstPersonPlayer 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &577874318210893197 21 | Transform: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 0} 24 | m_PrefabInstance: {fileID: 0} 25 | m_PrefabAsset: {fileID: 0} 26 | m_GameObject: {fileID: 577874318210893199} 27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 28 | m_LocalPosition: {x: 0, y: 0, z: 0} 29 | m_LocalScale: {x: 1, y: 1, z: 1} 30 | m_ConstrainProportionsScale: 0 31 | m_Children: [] 32 | m_Father: {fileID: 0} 33 | m_RootOrder: 0 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | --- !u!114 &7698645590983583992 36 | MonoBehaviour: 37 | m_ObjectHideFlags: 0 38 | m_CorrespondingSourceObject: {fileID: 0} 39 | m_PrefabInstance: {fileID: 0} 40 | m_PrefabAsset: {fileID: 0} 41 | m_GameObject: {fileID: 577874318210893199} 42 | m_Enabled: 1 43 | m_EditorHideFlags: 0 44 | m_Script: {fileID: 11500000, guid: 98df7776338bbf9418e4d50363a02333, type: 3} 45 | m_Name: 46 | m_EditorClassIdentifier: 47 | ControlledCharacter: {fileID: 0} 48 | MouseSensitivity: 1 49 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Prefabs/ThirdPersonPlayer.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &4729649056687684238 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 4729649056687684239} 12 | - component: {fileID: 5910332505473654983} 13 | m_Layer: 0 14 | m_Name: ThirdPersonPlayer 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &4729649056687684239 21 | Transform: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 0} 24 | m_PrefabInstance: {fileID: 0} 25 | m_PrefabAsset: {fileID: 0} 26 | m_GameObject: {fileID: 4729649056687684238} 27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 28 | m_LocalPosition: {x: 0, y: 0, z: 0} 29 | m_LocalScale: {x: 1, y: 1, z: 1} 30 | m_ConstrainProportionsScale: 0 31 | m_Children: [] 32 | m_Father: {fileID: 0} 33 | m_RootOrder: 0 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | --- !u!114 &5910332505473654983 36 | MonoBehaviour: 37 | m_ObjectHideFlags: 0 38 | m_CorrespondingSourceObject: {fileID: 0} 39 | m_PrefabInstance: {fileID: 0} 40 | m_PrefabAsset: {fileID: 0} 41 | m_GameObject: {fileID: 4729649056687684238} 42 | m_Enabled: 1 43 | m_EditorHideFlags: 0 44 | m_Script: {fileID: 11500000, guid: 3fbdb3174a73a07408595a85d3e7fb6a, type: 3} 45 | m_Name: 46 | m_EditorClassIdentifier: 47 | ControlledCharacter: {fileID: 0} 48 | ControlledCamera: {fileID: 0} 49 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_SerializationMode: 2 8 | m_LineEndingsForNewScripts: 1 9 | m_DefaultBehaviorMode: 0 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 0 13 | m_SpritePackerCacheSize: 10 14 | m_SpritePackerPaddingPower: 1 15 | m_Bc7TextureCompressor: 0 16 | m_EtcTextureCompressorBehavior: 1 17 | m_EtcTextureFastCompressor: 1 18 | m_EtcTextureNormalCompressor: 2 19 | m_EtcTextureBestCompressor: 4 20 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 21 | m_ProjectGenerationRootNamespace: 22 | m_EnableTextureStreamingInEditMode: 1 23 | m_EnableTextureStreamingInPlayMode: 1 24 | m_EnableEditorAsyncCPUTextureLoading: 0 25 | m_AsyncShaderCompilation: 1 26 | m_PrefabModeAllowAutoSave: 1 27 | m_EnterPlayModeOptionsEnabled: 1 28 | m_EnterPlayModeOptions: 3 29 | m_GameObjectNamingDigits: 1 30 | m_GameObjectNamingScheme: 0 31 | m_AssetNamingUsesSpace: 1 32 | m_InspectorUseIMGUIDefaultInspector: 0 33 | m_UseLegacyProbeSampleCount: 0 34 | m_SerializeInlineMappingsOnOneLine: 1 35 | m_DisableCookiesInLightmapper: 0 36 | m_AssetPipelineMode: 1 37 | m_RefreshImportMode: 0 38 | m_CacheServerMode: 0 39 | m_CacheServerEndpoint: 40 | m_CacheServerNamespacePrefix: default 41 | m_CacheServerEnableDownload: 1 42 | m_CacheServerEnableUpload: 1 43 | m_CacheServerEnableAuth: 0 44 | m_CacheServerEnableTls: 0 45 | m_CacheServerValidationMode: 2 46 | m_CacheServerDownloadBatchSize: 128 47 | m_EnableEnlightenBakedGI: 0 48 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/OrbitCamera/OrbitCameraAuthoring.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Unity.Entities; 3 | using Unity.Mathematics; 4 | using Unity.Transforms; 5 | using UnityEngine; 6 | 7 | [DisallowMultipleComponent] 8 | public class OrbitCameraAuthoring : MonoBehaviour 9 | { 10 | public List IgnoredEntities = new List(); 11 | public OrbitCamera OrbitCamera = OrbitCamera.GetDefault(); 12 | 13 | public class Baker : Baker 14 | { 15 | public override void Bake(OrbitCameraAuthoring authoring) 16 | { 17 | authoring.OrbitCamera.CurrentDistanceFromMovement = authoring.OrbitCamera.TargetDistance; 18 | authoring.OrbitCamera.CurrentDistanceFromObstruction = authoring.OrbitCamera.TargetDistance; 19 | authoring.OrbitCamera.PlanarForward = -math.forward(); 20 | 21 | Entity entity = GetEntity(TransformUsageFlags.Dynamic | TransformUsageFlags.WorldSpace); 22 | 23 | AddComponent(entity, authoring.OrbitCamera); 24 | AddComponent(entity, new OrbitCameraControl()); 25 | DynamicBuffer ignoredEntitiesBuffer = AddBuffer(entity); 26 | 27 | for (int i = 0; i < authoring.IgnoredEntities.Count; i++) 28 | { 29 | ignoredEntitiesBuffer.Add(new OrbitCameraIgnoredEntityBufferElement 30 | { 31 | Entity = GetEntity(authoring.IgnoredEntities[i], TransformUsageFlags.None), 32 | }); 33 | } 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonCharacterComponent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Unity.Collections; 3 | using Unity.Entities; 4 | using Unity.Mathematics; 5 | using UnityEngine; 6 | using Unity.CharacterController; 7 | 8 | [Serializable] 9 | public struct FirstPersonCharacterComponent : IComponentData 10 | { 11 | public float GroundMaxSpeed; 12 | public float GroundedMovementSharpness; 13 | public float AirAcceleration; 14 | public float AirMaxSpeed; 15 | public float AirDrag; 16 | public float JumpSpeed; 17 | public float3 Gravity; 18 | public bool PreventAirAccelerationAgainstUngroundedHits; 19 | public BasicStepAndSlopeHandlingParameters StepAndSlopeHandling; 20 | 21 | public float MinViewAngle; 22 | public float MaxViewAngle; 23 | [HideInInspector] 24 | public Entity ViewEntity; 25 | [HideInInspector] 26 | public float ViewPitchDegrees; 27 | [HideInInspector] 28 | public quaternion ViewLocalRotation; 29 | 30 | public static FirstPersonCharacterComponent GetDefault() 31 | { 32 | return new FirstPersonCharacterComponent 33 | { 34 | GroundMaxSpeed = 10f, 35 | GroundedMovementSharpness = 15f, 36 | AirAcceleration = 50f, 37 | AirMaxSpeed = 10f, 38 | AirDrag = 0f, 39 | JumpSpeed = 10f, 40 | Gravity = math.up() * -30f, 41 | PreventAirAccelerationAgainstUngroundedHits = true, 42 | StepAndSlopeHandling = BasicStepAndSlopeHandlingParameters.GetDefault(), 43 | 44 | MinViewAngle = -90f, 45 | MaxViewAngle = 90f, 46 | }; 47 | } 48 | } 49 | 50 | [Serializable] 51 | public struct FirstPersonCharacterControl : IComponentData 52 | { 53 | public float3 MoveVector; 54 | public float2 LookYawPitchDegrees; 55 | public bool Jump; 56 | } 57 | 58 | [Serializable] 59 | public struct FirstPersonCharacterView : IComponentData 60 | { 61 | public Entity CharacterEntity; 62 | } 63 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 0 8 | m_QualitySettings: 9 | - serializedVersion: 3 10 | name: High 11 | pixelLightCount: 2 12 | shadows: 2 13 | shadowResolution: 1 14 | shadowProjection: 1 15 | shadowCascades: 2 16 | shadowDistance: 40 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 1 21 | skinWeights: 2 22 | globalTextureMipmapLimit: 0 23 | textureMipmapLimitSettings: [] 24 | anisotropicTextures: 1 25 | antiAliasing: 4 26 | softParticles: 0 27 | softVegetation: 1 28 | realtimeReflectionProbes: 1 29 | billboardsFaceCameraPosition: 1 30 | useLegacyDetailDistribution: 1 31 | vSyncCount: 1 32 | lodBias: 1 33 | maximumLODLevel: 0 34 | enableLODCrossFade: 1 35 | streamingMipmapsActive: 0 36 | streamingMipmapsAddAllCameras: 1 37 | streamingMipmapsMemoryBudget: 512 38 | streamingMipmapsRenderersPerFrame: 512 39 | streamingMipmapsMaxLevelReduction: 2 40 | streamingMipmapsMaxFileIORequests: 1024 41 | particleRaycastBudget: 256 42 | asyncUploadTimeSlice: 2 43 | asyncUploadBufferSize: 16 44 | asyncUploadPersistentBuffer: 1 45 | resolutionScalingFixedDPIFactor: 1 46 | customRenderPipeline: {fileID: 0} 47 | terrainQualityOverrides: 0 48 | terrainPixelError: 1 49 | terrainDetailDensityScale: 1 50 | terrainBasemapDistance: 1000 51 | terrainDetailDistance: 80 52 | terrainTreeDistance: 5000 53 | terrainBillboardStart: 50 54 | terrainFadeLength: 5 55 | terrainMaxTrees: 50 56 | excludedTargetPlatforms: [] 57 | m_TextureMipmapLimitGroupNames: [] 58 | m_PerPlatformDefaultQuality: 59 | Android: 0 60 | Lumin: 0 61 | Nintendo 3DS: 0 62 | Nintendo Switch: 0 63 | PS4: 0 64 | PSP2: 0 65 | Server: 0 66 | Stadia: 0 67 | Standalone: 0 68 | WebGL: 0 69 | Windows Store Apps: 0 70 | XboxOne: 0 71 | iPhone: 0 72 | tvOS: 0 73 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Prefabs/OrbitCamera.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &7568817337597995144 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 7568817337597995142} 12 | - component: {fileID: 7568817337597995143} 13 | m_Layer: 0 14 | m_Name: OrbitCamera 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &7568817337597995142 21 | Transform: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 0} 24 | m_PrefabInstance: {fileID: 0} 25 | m_PrefabAsset: {fileID: 0} 26 | m_GameObject: {fileID: 7568817337597995144} 27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 28 | m_LocalPosition: {x: 0, y: 1.09, z: -3.54} 29 | m_LocalScale: {x: 1, y: 1, z: 1} 30 | m_Children: [] 31 | m_Father: {fileID: 0} 32 | m_RootOrder: 0 33 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 34 | --- !u!114 &7568817337597995143 35 | MonoBehaviour: 36 | m_ObjectHideFlags: 0 37 | m_CorrespondingSourceObject: {fileID: 0} 38 | m_PrefabInstance: {fileID: 0} 39 | m_PrefabAsset: {fileID: 0} 40 | m_GameObject: {fileID: 7568817337597995144} 41 | m_Enabled: 1 42 | m_EditorHideFlags: 0 43 | m_Script: {fileID: 11500000, guid: 70c323b4be4b1fa4089d1a1fd2872754, type: 3} 44 | m_Name: 45 | m_EditorClassIdentifier: 46 | FollowedCharacter: {fileID: 0} 47 | IgnoredEntities: [] 48 | OrbitCamera: 49 | RotationSpeed: 2.4 50 | MaxVAngle: 89 51 | MinVAngle: -89 52 | RotateWithCharacterParent: 1 53 | TargetDistance: 5 54 | MinDistance: 0 55 | MaxDistance: 10 56 | DistanceMovementSpeed: 0.5 57 | DistanceMovementSharpness: 20 58 | ObstructionRadius: 0.1 59 | ObstructionInnerSmoothingSharpness: 3.4028235e+38 60 | ObstructionOuterSmoothingSharpness: 5 61 | PreventFixedUpdateJitter: 1 62 | CurrentDistanceFromMovement: 5 63 | CurrentDistanceFromObstruction: 5 64 | PitchAngle: 0 65 | PlanarForward: 66 | x: -0 67 | y: -0 68 | z: -1 69 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/OrbitCamera/OrbitCamera.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Unity.Collections; 3 | using Unity.Entities; 4 | using Unity.Mathematics; 5 | using UnityEngine; 6 | 7 | [Serializable] 8 | public struct OrbitCamera : IComponentData 9 | { 10 | [Header("Rotation")] 11 | public float RotationSpeed; 12 | public float MaxVAngle; 13 | public float MinVAngle; 14 | public bool RotateWithCharacterParent; 15 | 16 | [Header("Zooming")] 17 | public float TargetDistance; 18 | public float MinDistance; 19 | public float MaxDistance; 20 | public float DistanceMovementSpeed; 21 | public float DistanceMovementSharpness; 22 | 23 | [Header("Obstructions")] 24 | public float ObstructionRadius; 25 | public float ObstructionInnerSmoothingSharpness; 26 | public float ObstructionOuterSmoothingSharpness; 27 | public bool PreventFixedUpdateJitter; 28 | 29 | // Data in calculations 30 | [HideInInspector] 31 | public float CurrentDistanceFromMovement; 32 | [HideInInspector] 33 | public float CurrentDistanceFromObstruction; 34 | [HideInInspector] 35 | public float PitchAngle; 36 | [HideInInspector] 37 | public float3 PlanarForward; 38 | 39 | public static OrbitCamera GetDefault() 40 | { 41 | OrbitCamera c = new OrbitCamera 42 | { 43 | RotationSpeed = 150f, 44 | MaxVAngle = 89f, 45 | MinVAngle = -89f, 46 | 47 | TargetDistance = 5f, 48 | MinDistance = 0f, 49 | MaxDistance = 10f, 50 | DistanceMovementSpeed = 50f, 51 | DistanceMovementSharpness = 20f, 52 | 53 | ObstructionRadius = 0.1f, 54 | ObstructionInnerSmoothingSharpness = float.MaxValue, 55 | ObstructionOuterSmoothingSharpness = 5f, 56 | PreventFixedUpdateJitter = true, 57 | 58 | CurrentDistanceFromObstruction = 0f, 59 | }; 60 | return c; 61 | } 62 | } 63 | 64 | [Serializable] 65 | public struct OrbitCameraControl : IComponentData 66 | { 67 | public Entity FollowedCharacterEntity; 68 | public float2 Look; 69 | public float Zoom; 70 | } 71 | 72 | [Serializable] 73 | public struct OrbitCameraIgnoredEntityBufferElement : IBufferElementData 74 | { 75 | public Entity Entity; 76 | } -------------------------------------------------------------------------------- /Assets/URP/URP_Renderer.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} 13 | m_Name: URP_Renderer 14 | m_EditorClassIdentifier: 15 | debugShaders: 16 | debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, type: 3} 17 | hdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3} 18 | m_RendererFeatures: [] 19 | m_RendererFeatureMap: 20 | m_UseNativeRenderPass: 0 21 | postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} 22 | shaders: 23 | blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} 24 | copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} 25 | screenSpaceShadowPS: {fileID: 0} 26 | samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} 27 | stencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3} 28 | fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} 29 | fallbackLoadingPS: {fileID: 4800000, guid: 7f888aff2ac86494babad1c2c5daeee2, type: 3} 30 | materialErrorPS: {fileID: 4800000, guid: 5fd9a8feb75a4b5894c241777f519d4e, type: 3} 31 | coreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3} 32 | coreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, type: 3} 33 | blitHDROverlay: {fileID: 4800000, guid: a89bee29cffa951418fc1e2da94d1959, type: 3} 34 | cameraMotionVector: {fileID: 4800000, guid: c56b7e0d4c7cb484e959caeeedae9bbf, type: 3} 35 | objectMotionVector: {fileID: 4800000, guid: 7b3ede40266cd49a395def176e1bc486, type: 3} 36 | dataDrivenLensFlare: {fileID: 4800000, guid: 6cda457ac28612740adb23da5d39ea92, type: 3} 37 | m_AssetVersion: 2 38 | m_OpaqueLayerMask: 39 | serializedVersion: 2 40 | m_Bits: 4294967295 41 | m_TransparentLayerMask: 42 | serializedVersion: 2 43 | m_Bits: 4294967295 44 | m_DefaultStencilState: 45 | overrideStencilState: 0 46 | stencilReference: 0 47 | stencilCompareFunction: 8 48 | passOperation: 2 49 | failOperation: 0 50 | zFailOperation: 0 51 | m_ShadowTransparentReceive: 1 52 | m_RenderingMode: 2 53 | m_DepthPrimingMode: 0 54 | m_CopyDepthMode: 1 55 | m_AccurateGbufferNormals: 0 56 | m_IntermediateTextureMode: 1 57 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 15 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_DepthNormals: 17 | m_Mode: 1 18 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 19 | m_MotionVectors: 20 | m_Mode: 1 21 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 22 | m_LightHalo: 23 | m_Mode: 1 24 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LensFlare: 26 | m_Mode: 1 27 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 28 | m_VideoShadersIncludeMode: 2 29 | m_AlwaysIncludedShaders: 30 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 31 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 32 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 36 | m_PreloadedShaders: [] 37 | m_PreloadShadersBatchTimeLimit: -1 38 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 39 | m_CustomRenderPipeline: {fileID: 11400000, guid: 5b4a563bbbe76df4f910689b91466930, type: 2} 40 | m_TransparencySortMode: 0 41 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 42 | m_DefaultRenderingPath: 1 43 | m_DefaultMobileRenderingPath: 1 44 | m_TierSettings: [] 45 | m_LightmapStripping: 0 46 | m_FogStripping: 0 47 | m_InstancingStripping: 0 48 | m_BrgStripping: 0 49 | m_LightmapKeepPlain: 1 50 | m_LightmapKeepDirCombined: 1 51 | m_LightmapKeepDynamicPlain: 1 52 | m_LightmapKeepDynamicDirCombined: 1 53 | m_LightmapKeepShadowMask: 1 54 | m_LightmapKeepSubtractive: 1 55 | m_FogKeepLinear: 1 56 | m_FogKeepExp: 1 57 | m_FogKeepExp2: 1 58 | m_AlbedoSwatchInfos: [] 59 | m_LightsUseLinearIntensity: 1 60 | m_LightsUseColorTemperature: 1 61 | m_DefaultRenderingLayerMask: 1 62 | m_LogWhenShaderIsCompiled: 0 63 | m_SRPDefaultSettings: 64 | UnityEngine.Rendering.Universal.UniversalRenderPipeline: {fileID: 11400000, guid: af475ddc951385a4eb0ec2776bf5c357, type: 2} 65 | m_LightProbeOutsideHullStrategy: 0 66 | m_CameraRelativeLightCulling: 0 67 | m_CameraRelativeShadowCulling: 0 68 | -------------------------------------------------------------------------------- /Assets/Misc/Strawman.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a89e8a8a5f52d0458be6d42a9e7a7fb 3 | ModelImporter: 4 | serializedVersion: 22200 5 | internalIDToNameTable: [] 6 | externalObjects: {} 7 | materials: 8 | materialImportMode: 0 9 | materialName: 0 10 | materialSearch: 1 11 | materialLocation: 1 12 | animations: 13 | legacyGenerateAnimations: 4 14 | bakeSimulation: 0 15 | resampleCurves: 1 16 | optimizeGameObjects: 0 17 | removeConstantScaleCurves: 0 18 | motionNodeName: 19 | rigImportErrors: 20 | rigImportWarnings: 21 | animationImportErrors: 22 | animationImportWarnings: 23 | animationRetargetingWarnings: 24 | animationDoRetargetingWarnings: 0 25 | importAnimatedCustomProperties: 0 26 | importConstraints: 0 27 | animationCompression: 1 28 | animationRotationError: 0.5 29 | animationPositionError: 0.5 30 | animationScaleError: 0.5 31 | animationWrapMode: 0 32 | extraExposedTransformPaths: [] 33 | extraUserProperties: [] 34 | clipAnimations: [] 35 | isReadable: 0 36 | meshes: 37 | lODScreenPercentages: [] 38 | globalScale: 1 39 | meshCompression: 0 40 | addColliders: 0 41 | useSRGBMaterialColor: 1 42 | sortHierarchyByName: 1 43 | importPhysicalCameras: 1 44 | importVisibility: 0 45 | importBlendShapes: 0 46 | importCameras: 0 47 | importLights: 0 48 | nodeNameCollisionStrategy: 1 49 | fileIdsGeneration: 2 50 | swapUVChannels: 0 51 | generateSecondaryUV: 0 52 | useFileUnits: 1 53 | keepQuads: 0 54 | weldVertices: 1 55 | bakeAxisConversion: 0 56 | preserveHierarchy: 0 57 | skinWeightsMode: 0 58 | maxBonesPerVertex: 4 59 | minBoneWeight: 0.001 60 | optimizeBones: 1 61 | meshOptimizationFlags: -1 62 | indexFormat: 0 63 | secondaryUVAngleDistortion: 8 64 | secondaryUVAreaDistortion: 15.000001 65 | secondaryUVHardAngle: 88 66 | secondaryUVMarginMethod: 1 67 | secondaryUVMinLightmapResolution: 40 68 | secondaryUVMinObjectScale: 1 69 | secondaryUVPackMargin: 4 70 | useFileScale: 1 71 | strictVertexDataChecks: 0 72 | tangentSpace: 73 | normalSmoothAngle: 60 74 | normalImportMode: 0 75 | tangentImportMode: 3 76 | normalCalculationMode: 4 77 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 78 | blendShapeNormalImportMode: 1 79 | normalSmoothingSource: 0 80 | referencedClips: [] 81 | importAnimation: 0 82 | humanDescription: 83 | serializedVersion: 3 84 | human: [] 85 | skeleton: [] 86 | armTwist: 0.5 87 | foreArmTwist: 0.5 88 | upperLegTwist: 0.5 89 | legTwist: 0.5 90 | armStretch: 0.05 91 | legStretch: 0.05 92 | feetSpacing: 0 93 | globalScale: 1 94 | rootMotionBoneName: 95 | hasTranslationDoF: 0 96 | hasExtraRoot: 0 97 | skeletonHasParents: 1 98 | lastHumanDescriptionAvatarSource: {instanceID: 0} 99 | autoGenerateAvatarMappingIfUnspecified: 1 100 | animationType: 0 101 | humanoidOversampling: 1 102 | avatarSetup: 0 103 | addHumanoidExtraRootOnlyWhenUsingAvatar: 1 104 | importBlendShapeDeformPercent: 0 105 | remapMaterialsIfMaterialImportModeIsNone: 0 106 | additionalBone: 0 107 | userData: 108 | assetBundleName: 109 | assetBundleVariant: 110 | -------------------------------------------------------------------------------- /Assets/URP/URP.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3} 13 | m_Name: URP 14 | m_EditorClassIdentifier: 15 | k_AssetVersion: 11 16 | k_AssetPreviousVersion: 11 17 | m_RendererType: 1 18 | m_RendererData: {fileID: 0} 19 | m_RendererDataList: 20 | - {fileID: 11400000, guid: 07c83bcd1c38cd54fbaed930e68ee0e9, type: 2} 21 | m_DefaultRendererIndex: 0 22 | m_RequireDepthTexture: 0 23 | m_RequireOpaqueTexture: 0 24 | m_OpaqueDownsampling: 1 25 | m_SupportsTerrainHoles: 1 26 | m_SupportsHDR: 1 27 | m_HDRColorBufferPrecision: 0 28 | m_MSAA: 4 29 | m_RenderScale: 1 30 | m_UpscalingFilter: 0 31 | m_FsrOverrideSharpness: 0 32 | m_FsrSharpness: 0.92 33 | m_EnableLODCrossFade: 1 34 | m_LODCrossFadeDitheringType: 1 35 | m_ShEvalMode: 0 36 | m_MainLightRenderingMode: 1 37 | m_MainLightShadowsSupported: 1 38 | m_MainLightShadowmapResolution: 2048 39 | m_AdditionalLightsRenderingMode: 1 40 | m_AdditionalLightsPerObjectLimit: 4 41 | m_AdditionalLightShadowsSupported: 1 42 | m_AdditionalLightsShadowmapResolution: 2048 43 | m_AdditionalLightsShadowResolutionTierLow: 256 44 | m_AdditionalLightsShadowResolutionTierMedium: 512 45 | m_AdditionalLightsShadowResolutionTierHigh: 1024 46 | m_ReflectionProbeBlending: 0 47 | m_ReflectionProbeBoxProjection: 0 48 | m_ShadowDistance: 50 49 | m_ShadowCascadeCount: 1 50 | m_Cascade2Split: 0.25 51 | m_Cascade3Split: {x: 0.1, y: 0.3} 52 | m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} 53 | m_CascadeBorder: 0.2 54 | m_ShadowDepthBias: 1 55 | m_ShadowNormalBias: 1 56 | m_AnyShadowsSupported: 1 57 | m_SoftShadowsSupported: 0 58 | m_ConservativeEnclosingSphere: 1 59 | m_NumIterationsEnclosingSphere: 64 60 | m_SoftShadowQuality: 2 61 | m_AdditionalLightsCookieResolution: 2048 62 | m_AdditionalLightsCookieFormat: 3 63 | m_UseSRPBatcher: 1 64 | m_SupportsDynamicBatching: 0 65 | m_MixedLightingSupported: 1 66 | m_SupportsLightCookies: 1 67 | m_SupportsLightLayers: 0 68 | m_DebugLevel: 0 69 | m_StoreActionsOptimization: 0 70 | m_EnableRenderGraph: 0 71 | m_UseAdaptivePerformance: 1 72 | m_ColorGradingMode: 0 73 | m_ColorGradingLutSize: 32 74 | m_UseFastSRGBLinearConversion: 0 75 | m_ShadowType: 1 76 | m_LocalShadowsSupported: 0 77 | m_LocalShadowsAtlasResolution: 256 78 | m_MaxPixelLights: 0 79 | m_ShadowAtlasResolution: 256 80 | m_VolumeFrameworkUpdateMode: 0 81 | m_Textures: 82 | blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3} 83 | bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3} 84 | m_PrefilteringModeMainLightShadows: 3 85 | m_PrefilteringModeAdditionalLight: 0 86 | m_PrefilteringModeAdditionalLightShadows: 2 87 | m_PrefilterXRKeywords: 1 88 | m_PrefilteringModeForwardPlus: 2 89 | m_PrefilteringModeDeferredRendering: 0 90 | m_PrefilteringModeScreenSpaceOcclusion: 0 91 | m_PrefilterDebugKeywords: 1 92 | m_PrefilterWriteRenderingLayers: 1 93 | m_PrefilterHDROutput: 1 94 | m_PrefilterSSAODepthNormals: 1 95 | m_PrefilterSSAOSourceDepthLow: 1 96 | m_PrefilterSSAOSourceDepthMedium: 1 97 | m_PrefilterSSAOSourceDepthHigh: 1 98 | m_PrefilterSSAOInterleaved: 1 99 | m_PrefilterSSAOBlueNoise: 1 100 | m_PrefilterSSAOSampleCountLow: 1 101 | m_PrefilterSSAOSampleCountMedium: 1 102 | m_PrefilterSSAOSampleCountHigh: 1 103 | m_PrefilterDBufferMRT1: 1 104 | m_PrefilterDBufferMRT2: 1 105 | m_PrefilterDBufferMRT3: 1 106 | m_PrefilterScreenCoord: 1 107 | m_PrefilterNativeRenderPass: 1 108 | m_ShaderVariantLogLevel: 0 109 | m_ShadowCascades: 0 110 | -------------------------------------------------------------------------------- /Assets/Misc/Dancer.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-6843434998607615801 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 11 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | version: 7 16 | --- !u!21 &2100000 17 | Material: 18 | serializedVersion: 8 19 | m_ObjectHideFlags: 0 20 | m_CorrespondingSourceObject: {fileID: 0} 21 | m_PrefabInstance: {fileID: 0} 22 | m_PrefabAsset: {fileID: 0} 23 | m_Name: Dancer 24 | m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} 25 | m_Parent: {fileID: 0} 26 | m_ModifiedSerializedProperties: 0 27 | m_ValidKeywords: [] 28 | m_InvalidKeywords: [] 29 | m_LightmapFlags: 4 30 | m_EnableInstancingVariants: 0 31 | m_DoubleSidedGI: 0 32 | m_CustomRenderQueue: -1 33 | stringTagMap: 34 | RenderType: Opaque 35 | disabledShaderPasses: [] 36 | m_LockedProperties: 37 | m_SavedProperties: 38 | serializedVersion: 3 39 | m_TexEnvs: 40 | - _BaseMap: 41 | m_Texture: {fileID: 0} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | - _BumpMap: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - _DetailAlbedoMap: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | - _DetailMask: 53 | m_Texture: {fileID: 0} 54 | m_Scale: {x: 1, y: 1} 55 | m_Offset: {x: 0, y: 0} 56 | - _DetailNormalMap: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - _EmissionMap: 61 | m_Texture: {fileID: 0} 62 | m_Scale: {x: 1, y: 1} 63 | m_Offset: {x: 0, y: 0} 64 | - _MainTex: 65 | m_Texture: {fileID: 0} 66 | m_Scale: {x: 1, y: 1} 67 | m_Offset: {x: 0, y: 0} 68 | - _MetallicGlossMap: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | - _OcclusionMap: 73 | m_Texture: {fileID: 0} 74 | m_Scale: {x: 1, y: 1} 75 | m_Offset: {x: 0, y: 0} 76 | - _ParallaxMap: 77 | m_Texture: {fileID: 0} 78 | m_Scale: {x: 1, y: 1} 79 | m_Offset: {x: 0, y: 0} 80 | - _SpecGlossMap: 81 | m_Texture: {fileID: 0} 82 | m_Scale: {x: 1, y: 1} 83 | m_Offset: {x: 0, y: 0} 84 | - unity_Lightmaps: 85 | m_Texture: {fileID: 0} 86 | m_Scale: {x: 1, y: 1} 87 | m_Offset: {x: 0, y: 0} 88 | - unity_LightmapsInd: 89 | m_Texture: {fileID: 0} 90 | m_Scale: {x: 1, y: 1} 91 | m_Offset: {x: 0, y: 0} 92 | - unity_ShadowMasks: 93 | m_Texture: {fileID: 0} 94 | m_Scale: {x: 1, y: 1} 95 | m_Offset: {x: 0, y: 0} 96 | m_Ints: [] 97 | m_Floats: 98 | - _AlphaClip: 0 99 | - _AlphaToMask: 0 100 | - _Blend: 0 101 | - _BlendModePreserveSpecular: 1 102 | - _BumpScale: 1 103 | - _ClearCoatMask: 0 104 | - _ClearCoatSmoothness: 0 105 | - _Cull: 2 106 | - _Cutoff: 0.5 107 | - _DetailAlbedoMapScale: 1 108 | - _DetailNormalMapScale: 1 109 | - _DstBlend: 0 110 | - _DstBlendAlpha: 0 111 | - _EnvironmentReflections: 1 112 | - _GlossMapScale: 0 113 | - _Glossiness: 0 114 | - _GlossyReflections: 0 115 | - _Metallic: 0 116 | - _OcclusionStrength: 1 117 | - _Parallax: 0.005 118 | - _QueueOffset: 0 119 | - _ReceiveShadows: 1 120 | - _Smoothness: 0 121 | - _SmoothnessTextureChannel: 0 122 | - _SpecularHighlights: 1 123 | - _SrcBlend: 1 124 | - _SrcBlendAlpha: 1 125 | - _Surface: 0 126 | - _WorkflowMode: 1 127 | - _ZWrite: 1 128 | m_Colors: 129 | - _BaseColor: {r: 1, g: 0.98369855, b: 0, a: 1} 130 | - _Color: {r: 1, g: 0.98369855, b: 0, a: 1} 131 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 132 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} 133 | m_BuildTextureStacks: [] 134 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/Common/Materials/SimpleMaterial_White.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-7466207842126543850 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 11 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | version: 7 16 | --- !u!21 &2100000 17 | Material: 18 | serializedVersion: 8 19 | m_ObjectHideFlags: 0 20 | m_CorrespondingSourceObject: {fileID: 0} 21 | m_PrefabInstance: {fileID: 0} 22 | m_PrefabAsset: {fileID: 0} 23 | m_Name: SimpleMaterial_White 24 | m_Shader: {fileID: -6465566751694194690, guid: 2d40c85a2e8955d4ea370f6fd8c48a34, type: 3} 25 | m_Parent: {fileID: 0} 26 | m_ModifiedSerializedProperties: 0 27 | m_ValidKeywords: [] 28 | m_InvalidKeywords: [] 29 | m_LightmapFlags: 4 30 | m_EnableInstancingVariants: 0 31 | m_DoubleSidedGI: 0 32 | m_CustomRenderQueue: -1 33 | stringTagMap: {} 34 | disabledShaderPasses: [] 35 | m_LockedProperties: 36 | m_SavedProperties: 37 | serializedVersion: 3 38 | m_TexEnvs: 39 | - _BaseMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _BumpMap: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _DetailAlbedoMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DetailMask: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _DetailNormalMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _EmissionMap: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _MainTex: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _MetallicGlossMap: 68 | m_Texture: {fileID: 0} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - _OcclusionMap: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - _ParallaxMap: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - _SpecGlossMap: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | - unity_Lightmaps: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | - unity_LightmapsInd: 88 | m_Texture: {fileID: 0} 89 | m_Scale: {x: 1, y: 1} 90 | m_Offset: {x: 0, y: 0} 91 | - unity_ShadowMasks: 92 | m_Texture: {fileID: 0} 93 | m_Scale: {x: 1, y: 1} 94 | m_Offset: {x: 0, y: 0} 95 | m_Ints: [] 96 | m_Floats: 97 | - Vector1_3962d271a12b44169f6af5da4a6b1eae: 0.5 98 | - _AlphaClip: 0 99 | - _Blend: 0 100 | - _BumpScale: 1 101 | - _ClearCoatMask: 0 102 | - _ClearCoatSmoothness: 0 103 | - _Cull: 2 104 | - _Cutoff: 0.5 105 | - _DetailAlbedoMapScale: 1 106 | - _DetailNormalMapScale: 1 107 | - _DstBlend: 0 108 | - _EnvironmentReflections: 1 109 | - _GlossMapScale: 0 110 | - _Glossiness: 0 111 | - _GlossyReflections: 0 112 | - _Metallic: 0 113 | - _OcclusionStrength: 1 114 | - _Parallax: 0.005 115 | - _QueueControl: 0 116 | - _QueueOffset: 0 117 | - _ReceiveShadows: 1 118 | - _Smoothness: 0.5 119 | - _SmoothnessTextureChannel: 0 120 | - _SpecularHighlights: 1 121 | - _SrcBlend: 1 122 | - _Surface: 0 123 | - _WorkflowMode: 1 124 | - _ZWrite: 1 125 | m_Colors: 126 | - Color_cb3bb3be051d4782821489a356b18884: {r: 1, g: 1, b: 1, a: 1} 127 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 128 | - _Color: {r: 1, g: 1, b: 1, a: 1} 129 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 130 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} 131 | m_BuildTextureStacks: [] 132 | -------------------------------------------------------------------------------- /Assets/Misc/Floor.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Floor 11 | m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} 12 | m_Parent: {fileID: 0} 13 | m_ModifiedSerializedProperties: 0 14 | m_ValidKeywords: [] 15 | m_InvalidKeywords: [] 16 | m_LightmapFlags: 4 17 | m_EnableInstancingVariants: 0 18 | m_DoubleSidedGI: 0 19 | m_CustomRenderQueue: -1 20 | stringTagMap: 21 | RenderType: Opaque 22 | disabledShaderPasses: [] 23 | m_LockedProperties: 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _BaseMap: 28 | m_Texture: {fileID: 7506314328700112305, guid: 7ca473c9234c9ce4ca24ee4bdc03e5a3, type: 3} 29 | m_Scale: {x: 100, y: 100} 30 | m_Offset: {x: 0, y: 0} 31 | - _BumpMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _DetailAlbedoMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _DetailMask: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _DetailNormalMap: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _EmissionMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _MainTex: 52 | m_Texture: {fileID: 7506314328700112305, guid: 7ca473c9234c9ce4ca24ee4bdc03e5a3, type: 3} 53 | m_Scale: {x: 100, y: 100} 54 | m_Offset: {x: 0, y: 0} 55 | - _MetallicGlossMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _OcclusionMap: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _ParallaxMap: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _SpecGlossMap: 68 | m_Texture: {fileID: 0} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - unity_Lightmaps: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - unity_LightmapsInd: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - unity_ShadowMasks: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | m_Ints: [] 84 | m_Floats: 85 | - _AlphaClip: 0 86 | - _AlphaToMask: 0 87 | - _Blend: 0 88 | - _BlendModePreserveSpecular: 1 89 | - _BumpScale: 1 90 | - _ClearCoatMask: 0 91 | - _ClearCoatSmoothness: 0 92 | - _Cull: 2 93 | - _Cutoff: 0.5 94 | - _DetailAlbedoMapScale: 1 95 | - _DetailNormalMapScale: 1 96 | - _DstBlend: 0 97 | - _DstBlendAlpha: 0 98 | - _EnvironmentReflections: 1 99 | - _GlossMapScale: 0 100 | - _Glossiness: 0 101 | - _GlossyReflections: 0 102 | - _Metallic: 0 103 | - _OcclusionStrength: 1 104 | - _Parallax: 0.005 105 | - _QueueOffset: 0 106 | - _ReceiveShadows: 1 107 | - _Smoothness: 0 108 | - _SmoothnessTextureChannel: 0 109 | - _SpecularHighlights: 1 110 | - _SrcBlend: 1 111 | - _SrcBlendAlpha: 1 112 | - _Surface: 0 113 | - _WorkflowMode: 1 114 | - _ZWrite: 1 115 | m_Colors: 116 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 117 | - _Color: {r: 1, g: 1, b: 1, a: 1} 118 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 119 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} 120 | m_BuildTextureStacks: [] 121 | --- !u!114 &4264369263324701797 122 | MonoBehaviour: 123 | m_ObjectHideFlags: 11 124 | m_CorrespondingSourceObject: {fileID: 0} 125 | m_PrefabInstance: {fileID: 0} 126 | m_PrefabAsset: {fileID: 0} 127 | m_GameObject: {fileID: 0} 128 | m_Enabled: 1 129 | m_EditorHideFlags: 0 130 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 131 | m_Name: 132 | m_EditorClassIdentifier: 133 | version: 7 134 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonCharacterSystems.cs: -------------------------------------------------------------------------------- 1 | using Unity.Burst; 2 | using Unity.Entities; 3 | using Unity.Collections; 4 | using Unity.Jobs; 5 | using Unity.Mathematics; 6 | using Unity.Physics; 7 | using Unity.Transforms; 8 | using Unity.CharacterController; 9 | using Unity.Burst.Intrinsics; 10 | 11 | [UpdateInGroup(typeof(KinematicCharacterPhysicsUpdateGroup))] 12 | [BurstCompile] 13 | public partial struct ThirdPersonCharacterPhysicsUpdateSystem : ISystem 14 | { 15 | private EntityQuery _characterQuery; 16 | private ThirdPersonCharacterUpdateContext _context; 17 | private KinematicCharacterUpdateContext _baseContext; 18 | 19 | [BurstCompile] 20 | public void OnCreate(ref SystemState state) 21 | { 22 | _characterQuery = KinematicCharacterUtilities.GetBaseCharacterQueryBuilder() 23 | .WithAll< 24 | ThirdPersonCharacterComponent, 25 | ThirdPersonCharacterControl>() 26 | .Build(ref state); 27 | 28 | _context = new ThirdPersonCharacterUpdateContext(); 29 | _context.OnSystemCreate(ref state); 30 | _baseContext = new KinematicCharacterUpdateContext(); 31 | _baseContext.OnSystemCreate(ref state); 32 | 33 | state.RequireForUpdate(_characterQuery); 34 | state.RequireForUpdate(); 35 | } 36 | 37 | [BurstCompile] 38 | public void OnDestroy(ref SystemState state) 39 | { } 40 | 41 | [BurstCompile] 42 | public void OnUpdate(ref SystemState state) 43 | { 44 | _context.OnSystemUpdate(ref state); 45 | _baseContext.OnSystemUpdate(ref state, SystemAPI.Time, SystemAPI.GetSingleton()); 46 | 47 | ThirdPersonCharacterPhysicsUpdateJob job = new ThirdPersonCharacterPhysicsUpdateJob 48 | { 49 | Context = _context, 50 | BaseContext = _baseContext, 51 | }; 52 | job.ScheduleParallel(); 53 | } 54 | 55 | [BurstCompile] 56 | [WithAll(typeof(Simulate))] 57 | public partial struct ThirdPersonCharacterPhysicsUpdateJob : IJobEntity, IJobEntityChunkBeginEnd 58 | { 59 | public ThirdPersonCharacterUpdateContext Context; 60 | public KinematicCharacterUpdateContext BaseContext; 61 | 62 | void Execute(ThirdPersonCharacterAspect characterAspect) 63 | { 64 | characterAspect.PhysicsUpdate(ref Context, ref BaseContext); 65 | } 66 | 67 | public bool OnChunkBegin(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useEnabledMask, in v128 chunkEnabledMask) 68 | { 69 | BaseContext.EnsureCreationOfTmpCollections(); 70 | return true; 71 | } 72 | 73 | public void OnChunkEnd(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useEnabledMask, in v128 chunkEnabledMask, bool chunkWasExecuted) 74 | { } 75 | } 76 | } 77 | 78 | [UpdateInGroup(typeof(KinematicCharacterVariableUpdateGroup))] 79 | [BurstCompile] 80 | public partial struct ThirdPersonCharacterVariableUpdateSystem : ISystem 81 | { 82 | private EntityQuery _characterQuery; 83 | private ThirdPersonCharacterUpdateContext _context; 84 | private KinematicCharacterUpdateContext _baseContext; 85 | 86 | [BurstCompile] 87 | public void OnCreate(ref SystemState state) 88 | { 89 | _characterQuery = KinematicCharacterUtilities.GetBaseCharacterQueryBuilder() 90 | .WithAll< 91 | ThirdPersonCharacterComponent, 92 | ThirdPersonCharacterControl>() 93 | .Build(ref state); 94 | 95 | _context = new ThirdPersonCharacterUpdateContext(); 96 | _context.OnSystemCreate(ref state); 97 | _baseContext = new KinematicCharacterUpdateContext(); 98 | _baseContext.OnSystemCreate(ref state); 99 | 100 | state.RequireForUpdate(_characterQuery); 101 | } 102 | 103 | [BurstCompile] 104 | public void OnDestroy(ref SystemState state) 105 | { } 106 | 107 | [BurstCompile] 108 | public void OnUpdate(ref SystemState state) 109 | { 110 | _context.OnSystemUpdate(ref state); 111 | _baseContext.OnSystemUpdate(ref state, SystemAPI.Time, SystemAPI.GetSingleton()); 112 | 113 | ThirdPersonCharacterVariableUpdateJob job = new ThirdPersonCharacterVariableUpdateJob 114 | { 115 | Context = _context, 116 | BaseContext = _baseContext, 117 | }; 118 | job.ScheduleParallel(); 119 | } 120 | 121 | [BurstCompile] 122 | [WithAll(typeof(Simulate))] 123 | public partial struct ThirdPersonCharacterVariableUpdateJob : IJobEntity, IJobEntityChunkBeginEnd 124 | { 125 | public ThirdPersonCharacterUpdateContext Context; 126 | public KinematicCharacterUpdateContext BaseContext; 127 | 128 | void Execute(ThirdPersonCharacterAspect characterAspect) 129 | { 130 | characterAspect.VariableUpdate(ref Context, ref BaseContext); 131 | } 132 | 133 | public bool OnChunkBegin(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useEnabledMask, in v128 chunkEnabledMask) 134 | { 135 | BaseContext.EnsureCreationOfTmpCollections(); 136 | return true; 137 | } 138 | 139 | public void OnChunkEnd(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useEnabledMask, in v128 chunkEnabledMask, bool chunkWasExecuted) 140 | { } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "ignore": false, 8 | "defaultInstantiationMode": 0, 9 | "supportsModification": true 10 | }, 11 | { 12 | "userAdded": false, 13 | "type": "UnityEditor.Animations.AnimatorController", 14 | "ignore": false, 15 | "defaultInstantiationMode": 0, 16 | "supportsModification": true 17 | }, 18 | { 19 | "userAdded": false, 20 | "type": "UnityEngine.AnimatorOverrideController", 21 | "ignore": false, 22 | "defaultInstantiationMode": 0, 23 | "supportsModification": true 24 | }, 25 | { 26 | "userAdded": false, 27 | "type": "UnityEditor.Audio.AudioMixerController", 28 | "ignore": false, 29 | "defaultInstantiationMode": 0, 30 | "supportsModification": true 31 | }, 32 | { 33 | "userAdded": false, 34 | "type": "UnityEngine.ComputeShader", 35 | "ignore": true, 36 | "defaultInstantiationMode": 1, 37 | "supportsModification": true 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEngine.Cubemap", 42 | "ignore": false, 43 | "defaultInstantiationMode": 0, 44 | "supportsModification": true 45 | }, 46 | { 47 | "userAdded": false, 48 | "type": "UnityEngine.GameObject", 49 | "ignore": false, 50 | "defaultInstantiationMode": 0, 51 | "supportsModification": true 52 | }, 53 | { 54 | "userAdded": false, 55 | "type": "UnityEditor.LightingDataAsset", 56 | "ignore": false, 57 | "defaultInstantiationMode": 0, 58 | "supportsModification": false 59 | }, 60 | { 61 | "userAdded": false, 62 | "type": "UnityEngine.LightingSettings", 63 | "ignore": false, 64 | "defaultInstantiationMode": 0, 65 | "supportsModification": true 66 | }, 67 | { 68 | "userAdded": false, 69 | "type": "UnityEngine.Material", 70 | "ignore": false, 71 | "defaultInstantiationMode": 0, 72 | "supportsModification": true 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEditor.MonoScript", 77 | "ignore": true, 78 | "defaultInstantiationMode": 1, 79 | "supportsModification": true 80 | }, 81 | { 82 | "userAdded": false, 83 | "type": "UnityEngine.PhysicMaterial", 84 | "ignore": false, 85 | "defaultInstantiationMode": 0, 86 | "supportsModification": true 87 | }, 88 | { 89 | "userAdded": false, 90 | "type": "UnityEngine.PhysicsMaterial2D", 91 | "ignore": false, 92 | "defaultInstantiationMode": 0, 93 | "supportsModification": true 94 | }, 95 | { 96 | "userAdded": false, 97 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 98 | "ignore": false, 99 | "defaultInstantiationMode": 0, 100 | "supportsModification": true 101 | }, 102 | { 103 | "userAdded": false, 104 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 105 | "ignore": false, 106 | "defaultInstantiationMode": 0, 107 | "supportsModification": true 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Rendering.VolumeProfile", 112 | "ignore": false, 113 | "defaultInstantiationMode": 0, 114 | "supportsModification": true 115 | }, 116 | { 117 | "userAdded": false, 118 | "type": "UnityEditor.SceneAsset", 119 | "ignore": false, 120 | "defaultInstantiationMode": 1, 121 | "supportsModification": true 122 | }, 123 | { 124 | "userAdded": false, 125 | "type": "UnityEngine.Shader", 126 | "ignore": true, 127 | "defaultInstantiationMode": 1, 128 | "supportsModification": true 129 | }, 130 | { 131 | "userAdded": false, 132 | "type": "UnityEngine.ShaderVariantCollection", 133 | "ignore": true, 134 | "defaultInstantiationMode": 1, 135 | "supportsModification": true 136 | }, 137 | { 138 | "userAdded": false, 139 | "type": "UnityEngine.Texture", 140 | "ignore": false, 141 | "defaultInstantiationMode": 0, 142 | "supportsModification": true 143 | }, 144 | { 145 | "userAdded": false, 146 | "type": "UnityEngine.Texture2D", 147 | "ignore": false, 148 | "defaultInstantiationMode": 0, 149 | "supportsModification": true 150 | }, 151 | { 152 | "userAdded": false, 153 | "type": "UnityEngine.Timeline.TimelineAsset", 154 | "ignore": false, 155 | "defaultInstantiationMode": 0, 156 | "supportsModification": true 157 | } 158 | ], 159 | "defaultDependencyTypeInfo": { 160 | "userAdded": false, 161 | "type": "", 162 | "ignore": false, 163 | "defaultInstantiationMode": 1, 164 | "supportsModification": true 165 | }, 166 | "newSceneOverride": 0 167 | } -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonPlayerSystems.cs: -------------------------------------------------------------------------------- 1 | using Unity.Burst; 2 | using Unity.Collections; 3 | using Unity.Entities; 4 | using Unity.Jobs; 5 | using Unity.Mathematics; 6 | using Unity.Transforms; 7 | using UnityEngine; 8 | using Unity.Physics.Systems; 9 | using Unity.CharacterController; 10 | using UnityEngine.SocialPlatforms; 11 | 12 | [UpdateInGroup(typeof(InitializationSystemGroup))] 13 | public partial class FirstPersonPlayerInputsSystem : SystemBase 14 | { 15 | protected override void OnCreate() 16 | { 17 | RequireForUpdate(); 18 | RequireForUpdate(SystemAPI.QueryBuilder().WithAll().Build()); 19 | } 20 | 21 | protected override void OnUpdate() 22 | { 23 | uint fixedTick = SystemAPI.GetSingleton().Tick; 24 | 25 | foreach (var (playerInputs, player) in SystemAPI.Query, FirstPersonPlayer>()) 26 | { 27 | playerInputs.ValueRW.MoveInput = new float2(); 28 | playerInputs.ValueRW.MoveInput.y += Input.GetKey(KeyCode.W) ? 1f : 0f; 29 | playerInputs.ValueRW.MoveInput.y += Input.GetKey(KeyCode.S) ? -1f : 0f; 30 | playerInputs.ValueRW.MoveInput.x += Input.GetKey(KeyCode.D) ? 1f : 0f; 31 | playerInputs.ValueRW.MoveInput.x += Input.GetKey(KeyCode.A) ? -1f : 0f; 32 | 33 | playerInputs.ValueRW.LookInput = new float2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y")); 34 | 35 | // For button presses that need to be queried during fixed update, use the "FixedInputEvent" helper struct. 36 | // This is part of a strategy for proper handling of button press events that are consumed during the fixed update group 37 | if (Input.GetKeyDown(KeyCode.Space)) 38 | { 39 | playerInputs.ValueRW.JumpPressed.Set(fixedTick); 40 | } 41 | } 42 | } 43 | } 44 | 45 | /// 46 | /// Apply inputs that need to be read at a variable rate 47 | /// 48 | [UpdateInGroup(typeof(SimulationSystemGroup), OrderFirst = true)] 49 | [UpdateBefore(typeof(FixedStepSimulationSystemGroup))] 50 | [BurstCompile] 51 | public partial struct FirstPersonPlayerVariableStepControlSystem : ISystem 52 | { 53 | [BurstCompile] 54 | public void OnCreate(ref SystemState state) 55 | { 56 | state.RequireForUpdate(SystemAPI.QueryBuilder().WithAll().Build()); 57 | } 58 | 59 | public void OnDestroy(ref SystemState state) 60 | { } 61 | 62 | [BurstCompile] 63 | public void OnUpdate(ref SystemState state) 64 | { 65 | foreach (var (playerInputs, player) in SystemAPI.Query().WithAll()) 66 | { 67 | if (SystemAPI.HasComponent(player.ControlledCharacter)) 68 | { 69 | FirstPersonCharacterControl characterControl = SystemAPI.GetComponent(player.ControlledCharacter); 70 | 71 | // Look 72 | characterControl.LookYawPitchDegrees = playerInputs.LookInput * player.MouseSensitivity; 73 | 74 | SystemAPI.SetComponent(player.ControlledCharacter, characterControl); 75 | } 76 | } 77 | } 78 | } 79 | 80 | /// 81 | /// Apply inputs that need to be read at a fixed rate. 82 | /// It is necessary to handle this as part of the fixed step group, in case your framerate is lower than the fixed step rate. 83 | /// 84 | [UpdateInGroup(typeof(FixedStepSimulationSystemGroup), OrderFirst = true)] 85 | [BurstCompile] 86 | public partial struct FirstPersonPlayerFixedStepControlSystem : ISystem 87 | { 88 | [BurstCompile] 89 | public void OnCreate(ref SystemState state) 90 | { 91 | state.RequireForUpdate(); 92 | state.RequireForUpdate(SystemAPI.QueryBuilder().WithAll().Build()); 93 | } 94 | 95 | public void OnDestroy(ref SystemState state) 96 | { } 97 | 98 | [BurstCompile] 99 | public void OnUpdate(ref SystemState state) 100 | { 101 | uint fixedTick = SystemAPI.GetSingleton().Tick; 102 | 103 | foreach (var (playerInputs, player) in SystemAPI.Query, FirstPersonPlayer>().WithAll()) 104 | { 105 | if (SystemAPI.HasComponent(player.ControlledCharacter)) 106 | { 107 | FirstPersonCharacterControl characterControl = SystemAPI.GetComponent(player.ControlledCharacter); 108 | 109 | quaternion characterRotation = SystemAPI.GetComponent(player.ControlledCharacter).Rotation; 110 | 111 | // Move 112 | float3 characterForward = MathUtilities.GetForwardFromRotation(characterRotation); 113 | float3 characterRight = MathUtilities.GetRightFromRotation(characterRotation); 114 | characterControl.MoveVector = (playerInputs.ValueRW.MoveInput.y * characterForward) + (playerInputs.ValueRW.MoveInput.x * characterRight); 115 | characterControl.MoveVector = MathUtilities.ClampToMaxLength(characterControl.MoveVector, 1f); 116 | 117 | // Jump 118 | // We use the "FixedInputEvent" helper struct here to detect if the event needs to be processed. 119 | // This is part of a strategy for proper handling of button press events that are consumed during the fixed update group. 120 | characterControl.Jump = playerInputs.ValueRW.JumpPressed.IsSet(fixedTick); 121 | 122 | SystemAPI.SetComponent(player.ControlledCharacter, characterControl); 123 | } 124 | } 125 | } 126 | } -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonCharacterUtilities.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Unity.Collections; 3 | using Unity.Entities; 4 | using Unity.Mathematics; 5 | using Unity.CharacterController; 6 | 7 | public static class FirstPersonCharacterUtilities 8 | { 9 | public static quaternion GetCurrentWorldViewRotation(quaternion characterRotation, quaternion localCharacterViewRotation) 10 | { 11 | return math.mul(characterRotation, localCharacterViewRotation); 12 | } 13 | 14 | public static void GetCurrentWorldViewDirectionAndRotation( 15 | quaternion characterRotation, 16 | quaternion localCharacterViewRotation, 17 | out float3 worldCharacterViewDirection, 18 | out quaternion worldCharacterViewRotation) 19 | { 20 | worldCharacterViewRotation = GetCurrentWorldViewRotation(characterRotation, localCharacterViewRotation); 21 | worldCharacterViewDirection = math.mul(worldCharacterViewRotation, math.forward()); 22 | } 23 | 24 | public static void ComputeFinalRotationsFromTargetLookDirection( 25 | ref quaternion characterRotation, 26 | ref quaternion localCharacterViewRotation, 27 | ref float3 targetLookDirection, 28 | ref float viewPitchDegrees, 29 | float viewRollDegrees, 30 | float minViewPitchDegrees, 31 | float maxViewPitchDegrees, 32 | float3 characterUp) 33 | { 34 | // rotate character root to point at look direction on character up plane 35 | float3 newCharacterForward = math.normalizesafe(MathUtilities.ProjectOnPlane(targetLookDirection, characterUp)); 36 | characterRotation = quaternion.LookRotationSafe(newCharacterForward, characterUp); 37 | 38 | // calculate view pitch angles to look at target direction 39 | viewPitchDegrees = math.degrees(MathUtilities.AngleRadians(newCharacterForward, targetLookDirection)); 40 | if (math.dot(characterUp, targetLookDirection) < 0f) 41 | { 42 | viewPitchDegrees *= -1f; 43 | } 44 | viewPitchDegrees = math.clamp(viewPitchDegrees, minViewPitchDegrees, maxViewPitchDegrees); 45 | 46 | localCharacterViewRotation = CalculateLocalViewRotation(viewPitchDegrees, viewRollDegrees); 47 | } 48 | 49 | public static void ComputeFinalRotationsFromRotationDelta( 50 | ref float viewPitchDegrees, 51 | ref float characterRotationYDegrees, 52 | float3 characterTransformUp, 53 | float2 yawPitchDeltaDegrees, 54 | float viewRollDegrees, 55 | float minPitchDegrees, 56 | float maxPitchDegrees, 57 | out quaternion characterRotation, 58 | out float canceledPitchDegrees, 59 | out quaternion viewLocalRotation) 60 | { 61 | // Yaw 62 | characterRotationYDegrees += yawPitchDeltaDegrees.x; 63 | ComputeRotationFromYAngleAndUp(characterRotationYDegrees, characterTransformUp, out characterRotation); 64 | 65 | // Pitch 66 | viewPitchDegrees += yawPitchDeltaDegrees.y; 67 | float viewPitchAngleDegreesBeforeClamp = viewPitchDegrees; 68 | viewPitchDegrees = math.clamp(viewPitchDegrees, minPitchDegrees, maxPitchDegrees); 69 | canceledPitchDegrees = yawPitchDeltaDegrees.y - (viewPitchAngleDegreesBeforeClamp - viewPitchDegrees); 70 | 71 | viewLocalRotation = CalculateLocalViewRotation(viewPitchDegrees, viewRollDegrees); 72 | } 73 | 74 | public static void ComputeRotationFromYAngleAndUp( 75 | float characterRotationYDegrees, 76 | float3 characterTransformUp, 77 | out quaternion characterRotation) 78 | { 79 | characterRotation = math.mul(MathUtilities.CreateRotationWithUpPriority(characterTransformUp, math.forward()), quaternion.Euler(0f, math.radians(characterRotationYDegrees), 0f)); 80 | } 81 | 82 | public static void ComputeFinalRotationsFromRotationDelta( 83 | ref quaternion characterRotation, 84 | ref float viewPitchDegrees, 85 | float2 yawPitchDeltaDegrees, 86 | float viewRollDegrees, 87 | float minPitchDegrees, 88 | float maxPitchDegrees, 89 | out float canceledPitchDegrees, 90 | out quaternion viewLocalRotation) 91 | { 92 | // Yaw 93 | quaternion yawRotation = quaternion.Euler(math.up() * math.radians(yawPitchDeltaDegrees.x)); 94 | characterRotation = math.mul(characterRotation, yawRotation); 95 | 96 | // Pitch 97 | viewPitchDegrees += yawPitchDeltaDegrees.y; 98 | float viewPitchAngleDegreesBeforeClamp = viewPitchDegrees; 99 | viewPitchDegrees = math.clamp(viewPitchDegrees, minPitchDegrees, maxPitchDegrees); 100 | canceledPitchDegrees = yawPitchDeltaDegrees.y - (viewPitchAngleDegreesBeforeClamp - viewPitchDegrees); 101 | 102 | viewLocalRotation = CalculateLocalViewRotation(viewPitchDegrees, viewRollDegrees); 103 | } 104 | 105 | public static quaternion CalculateLocalViewRotation(float viewPitchDegrees, float viewRollDegrees) 106 | { 107 | // Pitch 108 | quaternion viewLocalRotation = quaternion.AxisAngle(-math.right(), math.radians(viewPitchDegrees)); 109 | 110 | // Roll 111 | viewLocalRotation = math.mul(viewLocalRotation, quaternion.AxisAngle(math.forward(), math.radians(viewRollDegrees))); 112 | 113 | return viewLocalRotation; 114 | } 115 | 116 | public static float3 ComputeTargetLookDirectionFromRotationAngles( 117 | ref float viewPitchDegrees, 118 | float minViewPitchDegrees, 119 | float maxViewPitchDegrees, 120 | float2 pitchYawDegrees, 121 | quaternion characterRotation) 122 | { 123 | // Yaw 124 | quaternion yawRotation = quaternion.Euler(math.up() * math.radians(pitchYawDegrees.x)); 125 | quaternion targetRotation = math.mul(characterRotation, yawRotation); 126 | 127 | // Pitch 128 | float tmpViewPitchAngleDegrees = viewPitchDegrees + pitchYawDegrees.y; 129 | tmpViewPitchAngleDegrees = math.clamp(tmpViewPitchAngleDegrees, minViewPitchDegrees, maxViewPitchDegrees); 130 | quaternion pitchRotation = quaternion.Euler(-math.right() * math.radians(tmpViewPitchAngleDegrees)); 131 | targetRotation = math.mul(targetRotation, pitchRotation); 132 | 133 | return math.mul(targetRotation, math.forward()); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonCharacterSystems.cs: -------------------------------------------------------------------------------- 1 | using Unity.Burst; 2 | using Unity.Entities; 3 | using Unity.Collections; 4 | using Unity.Jobs; 5 | using Unity.Mathematics; 6 | using Unity.Physics; 7 | using Unity.Transforms; 8 | using Unity.CharacterController; 9 | using Unity.Burst.Intrinsics; 10 | 11 | [UpdateInGroup(typeof(KinematicCharacterPhysicsUpdateGroup))] 12 | [BurstCompile] 13 | public partial struct FirstPersonCharacterPhysicsUpdateSystem : ISystem 14 | { 15 | private EntityQuery _characterQuery; 16 | private FirstPersonCharacterUpdateContext _context; 17 | private KinematicCharacterUpdateContext _baseContext; 18 | 19 | [BurstCompile] 20 | public void OnCreate(ref SystemState state) 21 | { 22 | _characterQuery = KinematicCharacterUtilities.GetBaseCharacterQueryBuilder() 23 | .WithAll< 24 | FirstPersonCharacterComponent, 25 | FirstPersonCharacterControl>() 26 | .Build(ref state); 27 | 28 | _context = new FirstPersonCharacterUpdateContext(); 29 | _context.OnSystemCreate(ref state); 30 | _baseContext = new KinematicCharacterUpdateContext(); 31 | _baseContext.OnSystemCreate(ref state); 32 | 33 | state.RequireForUpdate(_characterQuery); 34 | state.RequireForUpdate(); 35 | } 36 | 37 | [BurstCompile] 38 | public void OnDestroy(ref SystemState state) 39 | { } 40 | 41 | [BurstCompile] 42 | public void OnUpdate(ref SystemState state) 43 | { 44 | _context.OnSystemUpdate(ref state); 45 | _baseContext.OnSystemUpdate(ref state, SystemAPI.Time, SystemAPI.GetSingleton()); 46 | 47 | FirstPersonCharacterPhysicsUpdateJob job = new FirstPersonCharacterPhysicsUpdateJob 48 | { 49 | Context = _context, 50 | BaseContext = _baseContext, 51 | }; 52 | job.ScheduleParallel(); 53 | } 54 | 55 | [BurstCompile] 56 | [WithAll(typeof(Simulate))] 57 | public partial struct FirstPersonCharacterPhysicsUpdateJob : IJobEntity, IJobEntityChunkBeginEnd 58 | { 59 | public FirstPersonCharacterUpdateContext Context; 60 | public KinematicCharacterUpdateContext BaseContext; 61 | 62 | void Execute(FirstPersonCharacterAspect characterAspect) 63 | { 64 | characterAspect.PhysicsUpdate(ref Context, ref BaseContext); 65 | } 66 | 67 | public bool OnChunkBegin(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useEnabledMask, in v128 chunkEnabledMask) 68 | { 69 | BaseContext.EnsureCreationOfTmpCollections(); 70 | return true; 71 | } 72 | 73 | public void OnChunkEnd(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useEnabledMask, in v128 chunkEnabledMask, bool chunkWasExecuted) 74 | { 75 | } 76 | } 77 | } 78 | 79 | [UpdateInGroup(typeof(KinematicCharacterVariableUpdateGroup))] 80 | [BurstCompile] 81 | public partial struct FirstPersonCharacterVariableUpdateSystem : ISystem 82 | { 83 | private EntityQuery _characterQuery; 84 | private FirstPersonCharacterUpdateContext _context; 85 | private KinematicCharacterUpdateContext _baseContext; 86 | 87 | [BurstCompile] 88 | public void OnCreate(ref SystemState state) 89 | { 90 | _characterQuery = KinematicCharacterUtilities.GetBaseCharacterQueryBuilder() 91 | .WithAll< 92 | FirstPersonCharacterComponent, 93 | FirstPersonCharacterControl>() 94 | .Build(ref state); 95 | 96 | _context = new FirstPersonCharacterUpdateContext(); 97 | _context.OnSystemCreate(ref state); 98 | _baseContext = new KinematicCharacterUpdateContext(); 99 | _baseContext.OnSystemCreate(ref state); 100 | 101 | state.RequireForUpdate(_characterQuery); 102 | } 103 | 104 | [BurstCompile] 105 | public void OnDestroy(ref SystemState state) 106 | { } 107 | 108 | [BurstCompile] 109 | public void OnUpdate(ref SystemState state) 110 | { 111 | _context.OnSystemUpdate(ref state); 112 | _baseContext.OnSystemUpdate(ref state, SystemAPI.Time, SystemAPI.GetSingleton()); 113 | 114 | FirstPersonCharacterVariableUpdateJob variableUpdateJob = new FirstPersonCharacterVariableUpdateJob 115 | { 116 | Context = _context, 117 | BaseContext = _baseContext, 118 | }; 119 | variableUpdateJob.ScheduleParallel(); 120 | 121 | FirstPersonCharacterViewJob viewJob = new FirstPersonCharacterViewJob 122 | { 123 | FirstPersonCharacterLookup = SystemAPI.GetComponentLookup(true), 124 | }; 125 | viewJob.ScheduleParallel(); 126 | } 127 | 128 | [BurstCompile] 129 | [WithAll(typeof(Simulate))] 130 | public partial struct FirstPersonCharacterVariableUpdateJob : IJobEntity, IJobEntityChunkBeginEnd 131 | { 132 | public FirstPersonCharacterUpdateContext Context; 133 | public KinematicCharacterUpdateContext BaseContext; 134 | 135 | void Execute(FirstPersonCharacterAspect characterAspect) 136 | { 137 | characterAspect.VariableUpdate(ref Context, ref BaseContext); 138 | } 139 | 140 | public bool OnChunkBegin(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useEnabledMask, in v128 chunkEnabledMask) 141 | { 142 | BaseContext.EnsureCreationOfTmpCollections(); 143 | return true; 144 | } 145 | 146 | public void OnChunkEnd(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useEnabledMask, in v128 chunkEnabledMask, bool chunkWasExecuted) 147 | { } 148 | } 149 | 150 | [BurstCompile] 151 | [WithAll(typeof(Simulate))] 152 | public partial struct FirstPersonCharacterViewJob : IJobEntity 153 | { 154 | [ReadOnly] 155 | public ComponentLookup FirstPersonCharacterLookup; 156 | 157 | void Execute(ref LocalTransform localTransform, in FirstPersonCharacterView characterView) 158 | { 159 | if (FirstPersonCharacterLookup.TryGetComponent(characterView.CharacterEntity, out FirstPersonCharacterComponent character)) 160 | { 161 | localTransform.Rotation = character.ViewLocalRotation; 162 | } 163 | } 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonPlayerSystems.cs: -------------------------------------------------------------------------------- 1 | using Unity.Burst; 2 | using Unity.Collections; 3 | using Unity.Entities; 4 | using Unity.Jobs; 5 | using Unity.Mathematics; 6 | using Unity.Transforms; 7 | using UnityEngine; 8 | using Unity.Physics.Systems; 9 | using Unity.CharacterController; 10 | 11 | [UpdateInGroup(typeof(InitializationSystemGroup))] 12 | public partial class ThirdPersonPlayerInputsSystem : SystemBase 13 | { 14 | protected override void OnCreate() 15 | { 16 | RequireForUpdate(); 17 | RequireForUpdate(SystemAPI.QueryBuilder().WithAll().Build()); 18 | } 19 | 20 | protected override void OnUpdate() 21 | { 22 | uint fixedTick = SystemAPI.GetSingleton().Tick; 23 | 24 | foreach (var (playerInputs, player) in SystemAPI.Query, ThirdPersonPlayer>()) 25 | { 26 | playerInputs.ValueRW.MoveInput = new float2(); 27 | playerInputs.ValueRW.MoveInput.y += Input.GetKey(KeyCode.W) ? 1f : 0f; 28 | playerInputs.ValueRW.MoveInput.y += Input.GetKey(KeyCode.S) ? -1f : 0f; 29 | playerInputs.ValueRW.MoveInput.x += Input.GetKey(KeyCode.D) ? 1f : 0f; 30 | playerInputs.ValueRW.MoveInput.x += Input.GetKey(KeyCode.A) ? -1f : 0f; 31 | 32 | playerInputs.ValueRW.CameraLookInput = new float2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y")); 33 | playerInputs.ValueRW.CameraZoomInput = -Input.mouseScrollDelta.y; 34 | 35 | // For button presses that need to be queried during fixed update, use the "FixedInputEvent" helper struct. 36 | // This is part of a strategy for proper handling of button press events that are consumed during the fixed update group 37 | if (Input.GetKeyDown(KeyCode.Space)) 38 | { 39 | playerInputs.ValueRW.JumpPressed.Set(fixedTick); 40 | } 41 | } 42 | } 43 | } 44 | 45 | /// 46 | /// Apply inputs that need to be read at a variable rate 47 | /// 48 | [UpdateInGroup(typeof(SimulationSystemGroup), OrderFirst = true)] 49 | [UpdateBefore(typeof(FixedStepSimulationSystemGroup))] 50 | [BurstCompile] 51 | public partial struct ThirdPersonPlayerVariableStepControlSystem : ISystem 52 | { 53 | [BurstCompile] 54 | public void OnCreate(ref SystemState state) 55 | { 56 | state.RequireForUpdate(SystemAPI.QueryBuilder().WithAll().Build()); 57 | } 58 | 59 | public void OnDestroy(ref SystemState state) 60 | { } 61 | 62 | [BurstCompile] 63 | public void OnUpdate(ref SystemState state) 64 | { 65 | foreach (var (playerInputs, player) in SystemAPI.Query().WithAll()) 66 | { 67 | if (SystemAPI.HasComponent(player.ControlledCamera)) 68 | { 69 | OrbitCameraControl cameraControl = SystemAPI.GetComponent(player.ControlledCamera); 70 | 71 | cameraControl.FollowedCharacterEntity = player.ControlledCharacter; 72 | cameraControl.Look = playerInputs.CameraLookInput; 73 | cameraControl.Zoom = playerInputs.CameraZoomInput; 74 | 75 | SystemAPI.SetComponent(player.ControlledCamera, cameraControl); 76 | } 77 | } 78 | } 79 | } 80 | 81 | /// 82 | /// Apply inputs that need to be read at a fixed rate. 83 | /// It is necessary to handle this as part of the fixed step group, in case your framerate is lower than the fixed step rate. 84 | /// 85 | [UpdateInGroup(typeof(FixedStepSimulationSystemGroup), OrderFirst = true)] 86 | [BurstCompile] 87 | public partial struct ThirdPersonPlayerFixedStepControlSystem : ISystem 88 | { 89 | [BurstCompile] 90 | public void OnCreate(ref SystemState state) 91 | { 92 | state.RequireForUpdate(); 93 | state.RequireForUpdate(SystemAPI.QueryBuilder().WithAll().Build()); 94 | } 95 | 96 | public void OnDestroy(ref SystemState state) 97 | { } 98 | 99 | [BurstCompile] 100 | public void OnUpdate(ref SystemState state) 101 | { 102 | uint fixedTick = SystemAPI.GetSingleton().Tick; 103 | 104 | foreach (var (playerInputs, player) in SystemAPI.Query, ThirdPersonPlayer>().WithAll()) 105 | { 106 | if (SystemAPI.HasComponent(player.ControlledCharacter)) 107 | { 108 | ThirdPersonCharacterControl characterControl = SystemAPI.GetComponent(player.ControlledCharacter); 109 | 110 | float3 characterUp = MathUtilities.GetUpFromRotation(SystemAPI.GetComponent(player.ControlledCharacter).Rotation); 111 | 112 | // Get camera rotation data, since our movement is relative to it 113 | quaternion cameraRotation = quaternion.identity; 114 | if (SystemAPI.HasComponent(player.ControlledCamera)) 115 | { 116 | cameraRotation = SystemAPI.GetComponent(player.ControlledCamera).Rotation; 117 | } 118 | float3 cameraForwardOnUpPlane = math.normalizesafe(MathUtilities.ProjectOnPlane(MathUtilities.GetForwardFromRotation(cameraRotation), characterUp)); 119 | float3 cameraRight = MathUtilities.GetRightFromRotation(cameraRotation); 120 | 121 | // Move 122 | characterControl.MoveVector = (playerInputs.ValueRW.MoveInput.y * cameraForwardOnUpPlane) + (playerInputs.ValueRW.MoveInput.x * cameraRight); 123 | characterControl.MoveVector = MathUtilities.ClampToMaxLength(characterControl.MoveVector, 1f); 124 | 125 | // Jump 126 | // We use the "FixedInputEvent" helper struct here to detect if the event needs to be processed. 127 | // This is part of a strategy for proper handling of button press events that are consumed during the fixed update group. 128 | characterControl.Jump = playerInputs.ValueRW.JumpPressed.IsSet(fixedTick); 129 | 130 | SystemAPI.SetComponent(player.ControlledCharacter, characterControl); 131 | } 132 | } 133 | } 134 | } -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Prefabs/FirstPersonCharacter.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &1555240848202863130 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 1555240848202863129} 12 | - component: {fileID: 1555240848202863135} 13 | - component: {fileID: 1555240848202863128} 14 | m_Layer: 0 15 | m_Name: Capsule 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &1555240848202863129 22 | Transform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 1555240848202863130} 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 1, z: 0} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_ConstrainProportionsScale: 0 32 | m_Children: [] 33 | m_Father: {fileID: 1555240849038293810} 34 | m_RootOrder: 0 35 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 36 | --- !u!33 &1555240848202863135 37 | MeshFilter: 38 | m_ObjectHideFlags: 0 39 | m_CorrespondingSourceObject: {fileID: 0} 40 | m_PrefabInstance: {fileID: 0} 41 | m_PrefabAsset: {fileID: 0} 42 | m_GameObject: {fileID: 1555240848202863130} 43 | m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} 44 | --- !u!23 &1555240848202863128 45 | MeshRenderer: 46 | m_ObjectHideFlags: 0 47 | m_CorrespondingSourceObject: {fileID: 0} 48 | m_PrefabInstance: {fileID: 0} 49 | m_PrefabAsset: {fileID: 0} 50 | m_GameObject: {fileID: 1555240848202863130} 51 | m_Enabled: 1 52 | m_CastShadows: 1 53 | m_ReceiveShadows: 1 54 | m_DynamicOccludee: 1 55 | m_StaticShadowCaster: 0 56 | m_MotionVectors: 1 57 | m_LightProbeUsage: 1 58 | m_ReflectionProbeUsage: 1 59 | m_RayTracingMode: 2 60 | m_RayTraceProcedural: 0 61 | m_RenderingLayerMask: 257 62 | m_RendererPriority: 0 63 | m_Materials: 64 | - {fileID: 2100000, guid: 70c3442346d77cb4781288146feb488a, type: 2} 65 | m_StaticBatchInfo: 66 | firstSubMesh: 0 67 | subMeshCount: 0 68 | m_StaticBatchRoot: {fileID: 0} 69 | m_ProbeAnchor: {fileID: 0} 70 | m_LightProbeVolumeOverride: {fileID: 0} 71 | m_ScaleInLightmap: 1 72 | m_ReceiveGI: 1 73 | m_PreserveUVs: 0 74 | m_IgnoreNormalsForChartDetection: 0 75 | m_ImportantGI: 0 76 | m_StitchLightmapSeams: 1 77 | m_SelectedEditorRenderState: 3 78 | m_MinimumChartSize: 4 79 | m_AutoUVMaxDistance: 0.5 80 | m_AutoUVMaxAngle: 89 81 | m_LightmapParameters: {fileID: 0} 82 | m_SortingLayerID: 0 83 | m_SortingLayer: 0 84 | m_SortingOrder: 0 85 | m_AdditionalVertexStreams: {fileID: 0} 86 | --- !u!1 &1555240849038293811 87 | GameObject: 88 | m_ObjectHideFlags: 0 89 | m_CorrespondingSourceObject: {fileID: 0} 90 | m_PrefabInstance: {fileID: 0} 91 | m_PrefabAsset: {fileID: 0} 92 | serializedVersion: 6 93 | m_Component: 94 | - component: {fileID: 1555240849038293810} 95 | - component: {fileID: 6060867110873050882} 96 | - component: {fileID: 2674214978767437844} 97 | m_Layer: 0 98 | m_Name: FirstPersonCharacter 99 | m_TagString: Untagged 100 | m_Icon: {fileID: 0} 101 | m_NavMeshLayer: 0 102 | m_StaticEditorFlags: 0 103 | m_IsActive: 1 104 | --- !u!4 &1555240849038293810 105 | Transform: 106 | m_ObjectHideFlags: 0 107 | m_CorrespondingSourceObject: {fileID: 0} 108 | m_PrefabInstance: {fileID: 0} 109 | m_PrefabAsset: {fileID: 0} 110 | m_GameObject: {fileID: 1555240849038293811} 111 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 112 | m_LocalPosition: {x: 0, y: 0, z: 0} 113 | m_LocalScale: {x: 1, y: 1, z: 1} 114 | m_ConstrainProportionsScale: 0 115 | m_Children: 116 | - {fileID: 1555240848202863129} 117 | - {fileID: 6401532902016766949} 118 | m_Father: {fileID: 0} 119 | m_RootOrder: 0 120 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 121 | --- !u!136 &6060867110873050882 122 | CapsuleCollider: 123 | m_ObjectHideFlags: 0 124 | m_CorrespondingSourceObject: {fileID: 0} 125 | m_PrefabInstance: {fileID: 0} 126 | m_PrefabAsset: {fileID: 0} 127 | m_GameObject: {fileID: 1555240849038293811} 128 | m_Material: {fileID: 0} 129 | m_IncludeLayers: 130 | serializedVersion: 2 131 | m_Bits: 0 132 | m_ExcludeLayers: 133 | serializedVersion: 2 134 | m_Bits: 0 135 | m_LayerOverridePriority: 0 136 | m_IsTrigger: 0 137 | m_ProvidesContacts: 0 138 | m_Enabled: 1 139 | serializedVersion: 2 140 | m_Radius: 0.5 141 | m_Height: 2 142 | m_Direction: 1 143 | m_Center: {x: 0, y: 1, z: 0} 144 | --- !u!114 &2674214978767437844 145 | MonoBehaviour: 146 | m_ObjectHideFlags: 0 147 | m_CorrespondingSourceObject: {fileID: 0} 148 | m_PrefabInstance: {fileID: 0} 149 | m_PrefabAsset: {fileID: 0} 150 | m_GameObject: {fileID: 1555240849038293811} 151 | m_Enabled: 1 152 | m_EditorHideFlags: 0 153 | m_Script: {fileID: 11500000, guid: 03c9592a80483fd478e45d176ac83132, type: 3} 154 | m_Name: 155 | m_EditorClassIdentifier: 156 | ViewEntity: {fileID: 3463604651959167738} 157 | CharacterProperties: 158 | CustomPhysicsBodyTags: 159 | Tag00: 0 160 | Tag01: 0 161 | Tag02: 0 162 | Tag03: 0 163 | Tag04: 0 164 | Tag05: 0 165 | Tag06: 0 166 | Tag07: 0 167 | InterpolatePosition: 1 168 | InterpolateRotation: 0 169 | EvaluateGrounding: 1 170 | SnapToGround: 1 171 | GroundSnappingDistance: 0.5 172 | EnhancedGroundPrecision: 0 173 | MaxGroundedSlopeAngle: 60 174 | DetectMovementCollisions: 1 175 | DecollideFromOverlaps: 1 176 | ProjectVelocityOnInitialOverlaps: 0 177 | MaxContinuousCollisionsIterations: 8 178 | MaxOverlapDecollisionIterations: 2 179 | DiscardMovementWhenExceedMaxIterations: 1 180 | KillVelocityWhenExceedMaxIterations: 1 181 | DetectObstructionsForParentBodyMovement: 0 182 | SimulateDynamicBody: 1 183 | Mass: 1 184 | Character: 185 | GroundMaxSpeed: 10 186 | GroundedMovementSharpness: 15 187 | AirAcceleration: 50 188 | AirMaxSpeed: 10 189 | AirDrag: 0 190 | JumpSpeed: 10 191 | Gravity: 192 | x: -0 193 | y: -30 194 | z: -0 195 | PreventAirAccelerationAgainstUngroundedHits: 1 196 | StepAndSlopeHandling: 197 | StepHandling: 0 198 | MaxStepHeight: 0.5 199 | ExtraStepChecksDistance: 0.1 200 | CharacterWidthForStepGroundingCheck: 1 201 | PreventGroundingWhenMovingTowardsNoGrounding: 1 202 | HasMaxDownwardSlopeChangeAngle: 0 203 | MaxDownwardSlopeChangeAngle: 90 204 | ConstrainVelocityToGroundPlane: 1 205 | MinViewAngle: -90 206 | MaxViewAngle: 90 207 | ViewPitchDegrees: 0 208 | ViewLocalRotation: 209 | value: 210 | x: 0 211 | y: 0 212 | z: 0 213 | w: 0 214 | --- !u!1 &3463604651959167738 215 | GameObject: 216 | m_ObjectHideFlags: 0 217 | m_CorrespondingSourceObject: {fileID: 0} 218 | m_PrefabInstance: {fileID: 0} 219 | m_PrefabAsset: {fileID: 0} 220 | serializedVersion: 6 221 | m_Component: 222 | - component: {fileID: 6401532902016766949} 223 | - component: {fileID: 3909008753188905296} 224 | m_Layer: 0 225 | m_Name: View 226 | m_TagString: Untagged 227 | m_Icon: {fileID: 0} 228 | m_NavMeshLayer: 0 229 | m_StaticEditorFlags: 0 230 | m_IsActive: 1 231 | --- !u!4 &6401532902016766949 232 | Transform: 233 | m_ObjectHideFlags: 0 234 | m_CorrespondingSourceObject: {fileID: 0} 235 | m_PrefabInstance: {fileID: 0} 236 | m_PrefabAsset: {fileID: 0} 237 | m_GameObject: {fileID: 3463604651959167738} 238 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 239 | m_LocalPosition: {x: 0, y: 1.4, z: 0} 240 | m_LocalScale: {x: 1, y: 1, z: 1} 241 | m_ConstrainProportionsScale: 0 242 | m_Children: [] 243 | m_Father: {fileID: 1555240849038293810} 244 | m_RootOrder: 1 245 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 246 | --- !u!114 &3909008753188905296 247 | MonoBehaviour: 248 | m_ObjectHideFlags: 0 249 | m_CorrespondingSourceObject: {fileID: 0} 250 | m_PrefabInstance: {fileID: 0} 251 | m_PrefabAsset: {fileID: 0} 252 | m_GameObject: {fileID: 3463604651959167738} 253 | m_Enabled: 1 254 | m_EditorHideFlags: 0 255 | m_Script: {fileID: 11500000, guid: f3ddd2cb094880b40a1612adcf67e9a2, type: 3} 256 | m_Name: 257 | m_EditorClassIdentifier: 258 | Character: {fileID: 1555240849038293811} 259 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.burst": { 4 | "version": "1.8.8", 5 | "depth": 1, 6 | "source": "registry", 7 | "dependencies": { 8 | "com.unity.mathematics": "1.2.1" 9 | }, 10 | "url": "https://packages.unity.com" 11 | }, 12 | "com.unity.charactercontroller": { 13 | "version": "1.0.0-exp.22", 14 | "depth": 0, 15 | "source": "registry", 16 | "dependencies": { 17 | "com.unity.entities": "1.0.8", 18 | "com.unity.physics": "1.0.8", 19 | "com.unity.modules.uielements": "1.0.0", 20 | "com.unity.modules.physics": "1.0.0" 21 | }, 22 | "url": "https://packages.unity.com" 23 | }, 24 | "com.unity.collections": { 25 | "version": "2.1.4", 26 | "depth": 2, 27 | "source": "registry", 28 | "dependencies": { 29 | "com.unity.burst": "1.8.4", 30 | "com.unity.modules.unityanalytics": "1.0.0", 31 | "com.unity.nuget.mono-cecil": "1.11.4" 32 | }, 33 | "url": "https://packages.unity.com" 34 | }, 35 | "com.unity.entities": { 36 | "version": "1.0.14", 37 | "depth": 1, 38 | "source": "registry", 39 | "dependencies": { 40 | "com.unity.burst": "1.8.7", 41 | "com.unity.serialization": "3.1.1", 42 | "com.unity.collections": "2.1.4", 43 | "com.unity.mathematics": "1.2.6", 44 | "com.unity.modules.assetbundle": "1.0.0", 45 | "com.unity.modules.audio": "1.0.0", 46 | "com.unity.modules.unitywebrequest": "1.0.0", 47 | "com.unity.test-framework.performance": "3.0.2", 48 | "com.unity.nuget.mono-cecil": "1.11.4", 49 | "com.unity.scriptablebuildpipeline": "1.20.2", 50 | "com.unity.profiling.core": "1.0.2" 51 | }, 52 | "url": "https://packages.unity.com" 53 | }, 54 | "com.unity.entities.graphics": { 55 | "version": "1.0.14", 56 | "depth": 0, 57 | "source": "registry", 58 | "dependencies": { 59 | "com.unity.entities": "1.0.14", 60 | "com.unity.modules.particlesystem": "1.0.0", 61 | "com.unity.render-pipelines.core": "14.0.7" 62 | }, 63 | "url": "https://packages.unity.com" 64 | }, 65 | "com.unity.ext.nunit": { 66 | "version": "1.0.6", 67 | "depth": 4, 68 | "source": "registry", 69 | "dependencies": {}, 70 | "url": "https://packages.unity.com" 71 | }, 72 | "com.unity.mathematics": { 73 | "version": "1.2.6", 74 | "depth": 1, 75 | "source": "registry", 76 | "dependencies": {}, 77 | "url": "https://packages.unity.com" 78 | }, 79 | "com.unity.nuget.mono-cecil": { 80 | "version": "1.11.4", 81 | "depth": 2, 82 | "source": "registry", 83 | "dependencies": {}, 84 | "url": "https://packages.unity.com" 85 | }, 86 | "com.unity.physics": { 87 | "version": "1.0.8", 88 | "depth": 1, 89 | "source": "registry", 90 | "dependencies": { 91 | "com.unity.burst": "1.8.4", 92 | "com.unity.collections": "2.1.4", 93 | "com.unity.entities": "1.0.8", 94 | "com.unity.mathematics": "1.2.6", 95 | "com.unity.modules.imgui": "1.0.0", 96 | "com.unity.modules.jsonserialize": "1.0.0" 97 | }, 98 | "url": "https://packages.unity.com" 99 | }, 100 | "com.unity.profiling.core": { 101 | "version": "1.0.2", 102 | "depth": 2, 103 | "source": "registry", 104 | "dependencies": {}, 105 | "url": "https://packages.unity.com" 106 | }, 107 | "com.unity.render-pipelines.core": { 108 | "version": "14.0.8", 109 | "depth": 1, 110 | "source": "builtin", 111 | "dependencies": { 112 | "com.unity.ugui": "1.0.0", 113 | "com.unity.modules.physics": "1.0.0", 114 | "com.unity.modules.terrain": "1.0.0", 115 | "com.unity.modules.jsonserialize": "1.0.0" 116 | } 117 | }, 118 | "com.unity.render-pipelines.universal": { 119 | "version": "14.0.8", 120 | "depth": 0, 121 | "source": "builtin", 122 | "dependencies": { 123 | "com.unity.mathematics": "1.2.1", 124 | "com.unity.burst": "1.8.4", 125 | "com.unity.render-pipelines.core": "14.0.8", 126 | "com.unity.shadergraph": "14.0.8" 127 | } 128 | }, 129 | "com.unity.scriptablebuildpipeline": { 130 | "version": "1.21.8", 131 | "depth": 2, 132 | "source": "registry", 133 | "dependencies": {}, 134 | "url": "https://packages.unity.com" 135 | }, 136 | "com.unity.searcher": { 137 | "version": "4.9.2", 138 | "depth": 2, 139 | "source": "registry", 140 | "dependencies": {}, 141 | "url": "https://packages.unity.com" 142 | }, 143 | "com.unity.serialization": { 144 | "version": "3.1.1", 145 | "depth": 2, 146 | "source": "registry", 147 | "dependencies": { 148 | "com.unity.collections": "2.1.4", 149 | "com.unity.burst": "1.7.2" 150 | }, 151 | "url": "https://packages.unity.com" 152 | }, 153 | "com.unity.shadergraph": { 154 | "version": "14.0.8", 155 | "depth": 1, 156 | "source": "builtin", 157 | "dependencies": { 158 | "com.unity.render-pipelines.core": "14.0.8", 159 | "com.unity.searcher": "4.9.2" 160 | } 161 | }, 162 | "com.unity.test-framework": { 163 | "version": "1.1.33", 164 | "depth": 3, 165 | "source": "registry", 166 | "dependencies": { 167 | "com.unity.ext.nunit": "1.0.6", 168 | "com.unity.modules.imgui": "1.0.0", 169 | "com.unity.modules.jsonserialize": "1.0.0" 170 | }, 171 | "url": "https://packages.unity.com" 172 | }, 173 | "com.unity.test-framework.performance": { 174 | "version": "3.0.2", 175 | "depth": 2, 176 | "source": "registry", 177 | "dependencies": { 178 | "com.unity.test-framework": "1.1.31", 179 | "com.unity.modules.jsonserialize": "1.0.0" 180 | }, 181 | "url": "https://packages.unity.com" 182 | }, 183 | "com.unity.ugui": { 184 | "version": "1.0.0", 185 | "depth": 2, 186 | "source": "builtin", 187 | "dependencies": { 188 | "com.unity.modules.ui": "1.0.0", 189 | "com.unity.modules.imgui": "1.0.0" 190 | } 191 | }, 192 | "jp.keijiro.klak.lineargradient": { 193 | "version": "1.0.2", 194 | "depth": 1, 195 | "source": "registry", 196 | "dependencies": {}, 197 | "url": "https://registry.npmjs.com" 198 | }, 199 | "jp.keijiro.metatex": { 200 | "version": "1.0.4", 201 | "depth": 0, 202 | "source": "registry", 203 | "dependencies": { 204 | "jp.keijiro.klak.lineargradient": "1.0.2" 205 | }, 206 | "url": "https://registry.npmjs.com" 207 | }, 208 | "com.unity.modules.assetbundle": { 209 | "version": "1.0.0", 210 | "depth": 2, 211 | "source": "builtin", 212 | "dependencies": {} 213 | }, 214 | "com.unity.modules.audio": { 215 | "version": "1.0.0", 216 | "depth": 2, 217 | "source": "builtin", 218 | "dependencies": {} 219 | }, 220 | "com.unity.modules.imgui": { 221 | "version": "1.0.0", 222 | "depth": 1, 223 | "source": "builtin", 224 | "dependencies": {} 225 | }, 226 | "com.unity.modules.jsonserialize": { 227 | "version": "1.0.0", 228 | "depth": 1, 229 | "source": "builtin", 230 | "dependencies": {} 231 | }, 232 | "com.unity.modules.particlesystem": { 233 | "version": "1.0.0", 234 | "depth": 1, 235 | "source": "builtin", 236 | "dependencies": {} 237 | }, 238 | "com.unity.modules.physics": { 239 | "version": "1.0.0", 240 | "depth": 1, 241 | "source": "builtin", 242 | "dependencies": {} 243 | }, 244 | "com.unity.modules.terrain": { 245 | "version": "1.0.0", 246 | "depth": 2, 247 | "source": "builtin", 248 | "dependencies": {} 249 | }, 250 | "com.unity.modules.ui": { 251 | "version": "1.0.0", 252 | "depth": 1, 253 | "source": "builtin", 254 | "dependencies": {} 255 | }, 256 | "com.unity.modules.uielements": { 257 | "version": "1.0.0", 258 | "depth": 0, 259 | "source": "builtin", 260 | "dependencies": { 261 | "com.unity.modules.ui": "1.0.0", 262 | "com.unity.modules.imgui": "1.0.0", 263 | "com.unity.modules.jsonserialize": "1.0.0" 264 | } 265 | }, 266 | "com.unity.modules.unityanalytics": { 267 | "version": "1.0.0", 268 | "depth": 3, 269 | "source": "builtin", 270 | "dependencies": { 271 | "com.unity.modules.unitywebrequest": "1.0.0", 272 | "com.unity.modules.jsonserialize": "1.0.0" 273 | } 274 | }, 275 | "com.unity.modules.unitywebrequest": { 276 | "version": "1.0.0", 277 | "depth": 2, 278 | "source": "builtin", 279 | "dependencies": {} 280 | } 281 | } 282 | } 283 | -------------------------------------------------------------------------------- /Assets/Main.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0, g: 0, b: 0, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 3 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 1 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_LightingSettings: {fileID: 0} 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 3 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | buildHeightMesh: 0 121 | maxJobWorkers: 0 122 | preserveTilesOutsideBounds: 0 123 | debug: 124 | m_Flags: 0 125 | m_NavMeshData: {fileID: 0} 126 | --- !u!1 &299294293 127 | GameObject: 128 | m_ObjectHideFlags: 0 129 | m_CorrespondingSourceObject: {fileID: 0} 130 | m_PrefabInstance: {fileID: 0} 131 | m_PrefabAsset: {fileID: 0} 132 | serializedVersion: 6 133 | m_Component: 134 | - component: {fileID: 299294295} 135 | - component: {fileID: 299294294} 136 | m_Layer: 0 137 | m_Name: Sub 138 | m_TagString: Untagged 139 | m_Icon: {fileID: 0} 140 | m_NavMeshLayer: 0 141 | m_StaticEditorFlags: 0 142 | m_IsActive: 1 143 | --- !u!114 &299294294 144 | MonoBehaviour: 145 | m_ObjectHideFlags: 0 146 | m_CorrespondingSourceObject: {fileID: 0} 147 | m_PrefabInstance: {fileID: 0} 148 | m_PrefabAsset: {fileID: 0} 149 | m_GameObject: {fileID: 299294293} 150 | m_Enabled: 1 151 | m_EditorHideFlags: 0 152 | m_Script: {fileID: 11500000, guid: 45a335734b1572644a6a5d09d87adc65, type: 3} 153 | m_Name: 154 | m_EditorClassIdentifier: 155 | _SceneAsset: {fileID: 102900000, guid: 1e97ba449cab001448a018fb1627b745, type: 3} 156 | _HierarchyColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 157 | AutoLoadScene: 1 158 | _SceneGUID: 159 | Value: 160 | x: 1152088545 161 | y: 1090566857 162 | z: 3212905092 163 | w: 1417376353 164 | --- !u!4 &299294295 165 | Transform: 166 | m_ObjectHideFlags: 0 167 | m_CorrespondingSourceObject: {fileID: 0} 168 | m_PrefabInstance: {fileID: 0} 169 | m_PrefabAsset: {fileID: 0} 170 | m_GameObject: {fileID: 299294293} 171 | serializedVersion: 2 172 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 173 | m_LocalPosition: {x: 0, y: 0, z: 0} 174 | m_LocalScale: {x: 1, y: 1, z: 1} 175 | m_ConstrainProportionsScale: 0 176 | m_Children: [] 177 | m_Father: {fileID: 0} 178 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 179 | --- !u!1 &1816233041 180 | GameObject: 181 | m_ObjectHideFlags: 0 182 | m_CorrespondingSourceObject: {fileID: 0} 183 | m_PrefabInstance: {fileID: 0} 184 | m_PrefabAsset: {fileID: 0} 185 | serializedVersion: 6 186 | m_Component: 187 | - component: {fileID: 1816233044} 188 | - component: {fileID: 1816233043} 189 | - component: {fileID: 1816233042} 190 | - component: {fileID: 1816233045} 191 | m_Layer: 0 192 | m_Name: Main Camera 193 | m_TagString: MainCamera 194 | m_Icon: {fileID: 0} 195 | m_NavMeshLayer: 0 196 | m_StaticEditorFlags: 0 197 | m_IsActive: 1 198 | --- !u!114 &1816233042 199 | MonoBehaviour: 200 | m_ObjectHideFlags: 0 201 | m_CorrespondingSourceObject: {fileID: 0} 202 | m_PrefabInstance: {fileID: 0} 203 | m_PrefabAsset: {fileID: 0} 204 | m_GameObject: {fileID: 1816233041} 205 | m_Enabled: 1 206 | m_EditorHideFlags: 0 207 | m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} 208 | m_Name: 209 | m_EditorClassIdentifier: 210 | m_RenderShadows: 1 211 | m_RequiresDepthTextureOption: 2 212 | m_RequiresOpaqueTextureOption: 2 213 | m_CameraType: 0 214 | m_Cameras: [] 215 | m_RendererIndex: -1 216 | m_VolumeLayerMask: 217 | serializedVersion: 2 218 | m_Bits: 1 219 | m_VolumeTrigger: {fileID: 0} 220 | m_VolumeFrameworkUpdateModeOption: 2 221 | m_RenderPostProcessing: 0 222 | m_Antialiasing: 0 223 | m_AntialiasingQuality: 2 224 | m_StopNaN: 0 225 | m_Dithering: 0 226 | m_ClearDepth: 1 227 | m_AllowXRRendering: 1 228 | m_AllowHDROutput: 1 229 | m_UseScreenCoordOverride: 0 230 | m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} 231 | m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} 232 | m_RequiresDepthTexture: 0 233 | m_RequiresColorTexture: 0 234 | m_Version: 2 235 | m_TaaSettings: 236 | quality: 3 237 | frameInfluence: 0.1 238 | jitterScale: 1 239 | mipBias: 0 240 | varianceClampScale: 0.9 241 | contrastAdaptiveSharpening: 0 242 | --- !u!20 &1816233043 243 | Camera: 244 | m_ObjectHideFlags: 0 245 | m_CorrespondingSourceObject: {fileID: 0} 246 | m_PrefabInstance: {fileID: 0} 247 | m_PrefabAsset: {fileID: 0} 248 | m_GameObject: {fileID: 1816233041} 249 | m_Enabled: 1 250 | serializedVersion: 2 251 | m_ClearFlags: 2 252 | m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} 253 | m_projectionMatrixMode: 1 254 | m_GateFitMode: 2 255 | m_FOVAxisMode: 0 256 | m_Iso: 200 257 | m_ShutterSpeed: 0.005 258 | m_Aperture: 16 259 | m_FocusDistance: 10 260 | m_FocalLength: 50 261 | m_BladeCount: 5 262 | m_Curvature: {x: 2, y: 11} 263 | m_BarrelClipping: 0.25 264 | m_Anamorphism: 0 265 | m_SensorSize: {x: 36, y: 24} 266 | m_LensShift: {x: 0, y: 0} 267 | m_NormalizedViewPortRect: 268 | serializedVersion: 2 269 | x: 0 270 | y: 0 271 | width: 1 272 | height: 1 273 | near clip plane: 0.3 274 | far clip plane: 100 275 | field of view: 36 276 | orthographic: 0 277 | orthographic size: 5 278 | m_Depth: 0 279 | m_CullingMask: 280 | serializedVersion: 2 281 | m_Bits: 4294967295 282 | m_RenderingPath: -1 283 | m_TargetTexture: {fileID: 0} 284 | m_TargetDisplay: 0 285 | m_TargetEye: 3 286 | m_HDR: 1 287 | m_AllowMSAA: 1 288 | m_AllowDynamicResolution: 0 289 | m_ForceIntoRT: 0 290 | m_OcclusionCulling: 1 291 | m_StereoConvergence: 10 292 | m_StereoSeparation: 0.022 293 | --- !u!4 &1816233044 294 | Transform: 295 | m_ObjectHideFlags: 0 296 | m_CorrespondingSourceObject: {fileID: 0} 297 | m_PrefabInstance: {fileID: 0} 298 | m_PrefabAsset: {fileID: 0} 299 | m_GameObject: {fileID: 1816233041} 300 | serializedVersion: 2 301 | m_LocalRotation: {x: 0, y: 0.99939084, z: -0.03489949, w: 0} 302 | m_LocalPosition: {x: 0, y: 0.6092694, z: 2.992692} 303 | m_LocalScale: {x: 1, y: 1, z: 1} 304 | m_ConstrainProportionsScale: 0 305 | m_Children: [] 306 | m_Father: {fileID: 0} 307 | m_LocalEulerAnglesHint: {x: 4, y: 180, z: 0} 308 | --- !u!114 &1816233045 309 | MonoBehaviour: 310 | m_ObjectHideFlags: 0 311 | m_CorrespondingSourceObject: {fileID: 0} 312 | m_PrefabInstance: {fileID: 0} 313 | m_PrefabAsset: {fileID: 0} 314 | m_GameObject: {fileID: 1816233041} 315 | m_Enabled: 1 316 | m_EditorHideFlags: 0 317 | m_Script: {fileID: 11500000, guid: ef98a7c3224c6704d976c8bd33dfc59e, type: 3} 318 | m_Name: 319 | m_EditorClassIdentifier: 320 | --- !u!1660057539 &9223372036854775807 321 | SceneRoots: 322 | m_ObjectHideFlags: 0 323 | m_Roots: 324 | - {fileID: 1816233044} 325 | - {fileID: 299294295} 326 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Prefabs/ThirdPersonCharacter.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &1692896102597148395 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 1692896102597148394} 12 | - component: {fileID: 8041698241194078798} 13 | - component: {fileID: 6689285571920954877} 14 | - component: {fileID: 7542772330835976783} 15 | m_Layer: 0 16 | m_Name: ThirdPersonCharacter 17 | m_TagString: Untagged 18 | m_Icon: {fileID: 0} 19 | m_NavMeshLayer: 0 20 | m_StaticEditorFlags: 0 21 | m_IsActive: 1 22 | --- !u!4 &1692896102597148394 23 | Transform: 24 | m_ObjectHideFlags: 0 25 | m_CorrespondingSourceObject: {fileID: 0} 26 | m_PrefabInstance: {fileID: 0} 27 | m_PrefabAsset: {fileID: 0} 28 | m_GameObject: {fileID: 1692896102597148395} 29 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 30 | m_LocalPosition: {x: 0, y: 0, z: 0} 31 | m_LocalScale: {x: 1, y: 1, z: 1} 32 | m_ConstrainProportionsScale: 0 33 | m_Children: 34 | - {fileID: 1692896103431116737} 35 | - {fileID: 2861637503494133750} 36 | m_Father: {fileID: 0} 37 | m_RootOrder: 0 38 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 39 | --- !u!136 &8041698241194078798 40 | CapsuleCollider: 41 | m_ObjectHideFlags: 0 42 | m_CorrespondingSourceObject: {fileID: 0} 43 | m_PrefabInstance: {fileID: 0} 44 | m_PrefabAsset: {fileID: 0} 45 | m_GameObject: {fileID: 1692896102597148395} 46 | m_Material: {fileID: 0} 47 | m_IncludeLayers: 48 | serializedVersion: 2 49 | m_Bits: 0 50 | m_ExcludeLayers: 51 | serializedVersion: 2 52 | m_Bits: 0 53 | m_LayerOverridePriority: 0 54 | m_IsTrigger: 0 55 | m_ProvidesContacts: 0 56 | m_Enabled: 1 57 | serializedVersion: 2 58 | m_Radius: 0.5 59 | m_Height: 2 60 | m_Direction: 1 61 | m_Center: {x: 0, y: 1, z: 0} 62 | --- !u!114 &6689285571920954877 63 | MonoBehaviour: 64 | m_ObjectHideFlags: 0 65 | m_CorrespondingSourceObject: {fileID: 0} 66 | m_PrefabInstance: {fileID: 0} 67 | m_PrefabAsset: {fileID: 0} 68 | m_GameObject: {fileID: 1692896102597148395} 69 | m_Enabled: 1 70 | m_EditorHideFlags: 0 71 | m_Script: {fileID: 11500000, guid: c854a728d43c7cf47bec103607a449f9, type: 3} 72 | m_Name: 73 | m_EditorClassIdentifier: 74 | CharacterProperties: 75 | CustomPhysicsBodyTags: 76 | Tag00: 0 77 | Tag01: 0 78 | Tag02: 0 79 | Tag03: 0 80 | Tag04: 0 81 | Tag05: 0 82 | Tag06: 0 83 | Tag07: 0 84 | InterpolatePosition: 1 85 | InterpolateRotation: 0 86 | EvaluateGrounding: 1 87 | SnapToGround: 1 88 | GroundSnappingDistance: 0.5 89 | EnhancedGroundPrecision: 0 90 | MaxGroundedSlopeAngle: 60 91 | DetectMovementCollisions: 1 92 | DecollideFromOverlaps: 1 93 | ProjectVelocityOnInitialOverlaps: 0 94 | MaxContinuousCollisionsIterations: 8 95 | MaxOverlapDecollisionIterations: 2 96 | DiscardMovementWhenExceedMaxIterations: 1 97 | KillVelocityWhenExceedMaxIterations: 1 98 | DetectObstructionsForParentBodyMovement: 0 99 | SimulateDynamicBody: 1 100 | Mass: 1 101 | Character: 102 | RotationSharpness: 25 103 | GroundMaxSpeed: 10 104 | GroundedMovementSharpness: 15 105 | AirAcceleration: 50 106 | AirMaxSpeed: 10 107 | AirDrag: 0 108 | JumpSpeed: 10 109 | Gravity: 110 | x: -0 111 | y: -30 112 | z: -0 113 | PreventAirAccelerationAgainstUngroundedHits: 1 114 | StepAndSlopeHandling: 115 | StepHandling: 0 116 | MaxStepHeight: 0.5 117 | ExtraStepChecksDistance: 0.1 118 | CharacterWidthForStepGroundingCheck: 1 119 | PreventGroundingWhenMovingTowardsNoGrounding: 1 120 | HasMaxDownwardSlopeChangeAngle: 0 121 | MaxDownwardSlopeChangeAngle: 90 122 | ConstrainVelocityToGroundPlane: 1 123 | --- !u!114 &7542772330835976783 124 | MonoBehaviour: 125 | m_ObjectHideFlags: 0 126 | m_CorrespondingSourceObject: {fileID: 0} 127 | m_PrefabInstance: {fileID: 0} 128 | m_PrefabAsset: {fileID: 0} 129 | m_GameObject: {fileID: 1692896102597148395} 130 | m_Enabled: 1 131 | m_EditorHideFlags: 0 132 | m_Script: {fileID: 11500000, guid: d3a88336df575c34e80048c54a815367, type: 3} 133 | m_Name: 134 | m_EditorClassIdentifier: 135 | Target: {fileID: 2861637503494133753} 136 | --- !u!1 &1692896103431116738 137 | GameObject: 138 | m_ObjectHideFlags: 0 139 | m_CorrespondingSourceObject: {fileID: 0} 140 | m_PrefabInstance: {fileID: 0} 141 | m_PrefabAsset: {fileID: 0} 142 | serializedVersion: 6 143 | m_Component: 144 | - component: {fileID: 1692896103431116737} 145 | - component: {fileID: 1692896103431116743} 146 | - component: {fileID: 1692896103431116736} 147 | m_Layer: 0 148 | m_Name: Capsule 149 | m_TagString: Untagged 150 | m_Icon: {fileID: 0} 151 | m_NavMeshLayer: 0 152 | m_StaticEditorFlags: 0 153 | m_IsActive: 1 154 | --- !u!4 &1692896103431116737 155 | Transform: 156 | m_ObjectHideFlags: 0 157 | m_CorrespondingSourceObject: {fileID: 0} 158 | m_PrefabInstance: {fileID: 0} 159 | m_PrefabAsset: {fileID: 0} 160 | m_GameObject: {fileID: 1692896103431116738} 161 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 162 | m_LocalPosition: {x: 0, y: 1, z: 0} 163 | m_LocalScale: {x: 1, y: 1, z: 1} 164 | m_ConstrainProportionsScale: 0 165 | m_Children: 166 | - {fileID: 6498846982015491111} 167 | m_Father: {fileID: 1692896102597148394} 168 | m_RootOrder: 0 169 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 170 | --- !u!33 &1692896103431116743 171 | MeshFilter: 172 | m_ObjectHideFlags: 0 173 | m_CorrespondingSourceObject: {fileID: 0} 174 | m_PrefabInstance: {fileID: 0} 175 | m_PrefabAsset: {fileID: 0} 176 | m_GameObject: {fileID: 1692896103431116738} 177 | m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} 178 | --- !u!23 &1692896103431116736 179 | MeshRenderer: 180 | m_ObjectHideFlags: 0 181 | m_CorrespondingSourceObject: {fileID: 0} 182 | m_PrefabInstance: {fileID: 0} 183 | m_PrefabAsset: {fileID: 0} 184 | m_GameObject: {fileID: 1692896103431116738} 185 | m_Enabled: 1 186 | m_CastShadows: 1 187 | m_ReceiveShadows: 1 188 | m_DynamicOccludee: 1 189 | m_StaticShadowCaster: 0 190 | m_MotionVectors: 1 191 | m_LightProbeUsage: 1 192 | m_ReflectionProbeUsage: 1 193 | m_RayTracingMode: 2 194 | m_RayTraceProcedural: 0 195 | m_RenderingLayerMask: 257 196 | m_RendererPriority: 0 197 | m_Materials: 198 | - {fileID: 2100000, guid: 70c3442346d77cb4781288146feb488a, type: 2} 199 | m_StaticBatchInfo: 200 | firstSubMesh: 0 201 | subMeshCount: 0 202 | m_StaticBatchRoot: {fileID: 0} 203 | m_ProbeAnchor: {fileID: 0} 204 | m_LightProbeVolumeOverride: {fileID: 0} 205 | m_ScaleInLightmap: 1 206 | m_ReceiveGI: 1 207 | m_PreserveUVs: 0 208 | m_IgnoreNormalsForChartDetection: 0 209 | m_ImportantGI: 0 210 | m_StitchLightmapSeams: 1 211 | m_SelectedEditorRenderState: 3 212 | m_MinimumChartSize: 4 213 | m_AutoUVMaxDistance: 0.5 214 | m_AutoUVMaxAngle: 89 215 | m_LightmapParameters: {fileID: 0} 216 | m_SortingLayerID: 0 217 | m_SortingLayer: 0 218 | m_SortingOrder: 0 219 | m_AdditionalVertexStreams: {fileID: 0} 220 | --- !u!1 &2787829476024719926 221 | GameObject: 222 | m_ObjectHideFlags: 0 223 | m_CorrespondingSourceObject: {fileID: 0} 224 | m_PrefabInstance: {fileID: 0} 225 | m_PrefabAsset: {fileID: 0} 226 | serializedVersion: 6 227 | m_Component: 228 | - component: {fileID: 6498846982015491111} 229 | - component: {fileID: 6362252827327739790} 230 | - component: {fileID: 1601238720869374913} 231 | m_Layer: 0 232 | m_Name: Cylinder 233 | m_TagString: Untagged 234 | m_Icon: {fileID: 0} 235 | m_NavMeshLayer: 0 236 | m_StaticEditorFlags: 0 237 | m_IsActive: 1 238 | --- !u!4 &6498846982015491111 239 | Transform: 240 | m_ObjectHideFlags: 0 241 | m_CorrespondingSourceObject: {fileID: 0} 242 | m_PrefabInstance: {fileID: 0} 243 | m_PrefabAsset: {fileID: 0} 244 | m_GameObject: {fileID: 2787829476024719926} 245 | m_LocalRotation: {x: -0.70710677, y: -0, z: -0, w: 0.7071068} 246 | m_LocalPosition: {x: 0, y: 0.487, z: 0.357} 247 | m_LocalScale: {x: 0.78007, y: 0.17738, z: 0.34445} 248 | m_ConstrainProportionsScale: 0 249 | m_Children: [] 250 | m_Father: {fileID: 1692896103431116737} 251 | m_RootOrder: 0 252 | m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} 253 | --- !u!33 &6362252827327739790 254 | MeshFilter: 255 | m_ObjectHideFlags: 0 256 | m_CorrespondingSourceObject: {fileID: 0} 257 | m_PrefabInstance: {fileID: 0} 258 | m_PrefabAsset: {fileID: 0} 259 | m_GameObject: {fileID: 2787829476024719926} 260 | m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} 261 | --- !u!23 &1601238720869374913 262 | MeshRenderer: 263 | m_ObjectHideFlags: 0 264 | m_CorrespondingSourceObject: {fileID: 0} 265 | m_PrefabInstance: {fileID: 0} 266 | m_PrefabAsset: {fileID: 0} 267 | m_GameObject: {fileID: 2787829476024719926} 268 | m_Enabled: 1 269 | m_CastShadows: 1 270 | m_ReceiveShadows: 1 271 | m_DynamicOccludee: 1 272 | m_StaticShadowCaster: 0 273 | m_MotionVectors: 1 274 | m_LightProbeUsage: 1 275 | m_ReflectionProbeUsage: 1 276 | m_RayTracingMode: 2 277 | m_RayTraceProcedural: 0 278 | m_RenderingLayerMask: 257 279 | m_RendererPriority: 0 280 | m_Materials: 281 | - {fileID: 2100000, guid: 70c3442346d77cb4781288146feb488a, type: 2} 282 | m_StaticBatchInfo: 283 | firstSubMesh: 0 284 | subMeshCount: 0 285 | m_StaticBatchRoot: {fileID: 0} 286 | m_ProbeAnchor: {fileID: 0} 287 | m_LightProbeVolumeOverride: {fileID: 0} 288 | m_ScaleInLightmap: 1 289 | m_ReceiveGI: 1 290 | m_PreserveUVs: 0 291 | m_IgnoreNormalsForChartDetection: 0 292 | m_ImportantGI: 0 293 | m_StitchLightmapSeams: 1 294 | m_SelectedEditorRenderState: 3 295 | m_MinimumChartSize: 4 296 | m_AutoUVMaxDistance: 0.5 297 | m_AutoUVMaxAngle: 89 298 | m_LightmapParameters: {fileID: 0} 299 | m_SortingLayerID: 0 300 | m_SortingLayer: 0 301 | m_SortingOrder: 0 302 | m_AdditionalVertexStreams: {fileID: 0} 303 | --- !u!1 &2861637503494133753 304 | GameObject: 305 | m_ObjectHideFlags: 0 306 | m_CorrespondingSourceObject: {fileID: 0} 307 | m_PrefabInstance: {fileID: 0} 308 | m_PrefabAsset: {fileID: 0} 309 | serializedVersion: 6 310 | m_Component: 311 | - component: {fileID: 2861637503494133750} 312 | m_Layer: 0 313 | m_Name: CameraTarget 314 | m_TagString: Untagged 315 | m_Icon: {fileID: 0} 316 | m_NavMeshLayer: 0 317 | m_StaticEditorFlags: 0 318 | m_IsActive: 1 319 | --- !u!4 &2861637503494133750 320 | Transform: 321 | m_ObjectHideFlags: 0 322 | m_CorrespondingSourceObject: {fileID: 0} 323 | m_PrefabInstance: {fileID: 0} 324 | m_PrefabAsset: {fileID: 0} 325 | m_GameObject: {fileID: 2861637503494133753} 326 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 327 | m_LocalPosition: {x: 0, y: 1.2, z: 0} 328 | m_LocalScale: {x: 1, y: 1, z: 1} 329 | m_ConstrainProportionsScale: 0 330 | m_Children: [] 331 | m_Father: {fileID: 1692896102597148394} 332 | m_RootOrder: 1 333 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 334 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/ThirdPerson/Scripts/ThirdPersonCharacterAspect.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.CompilerServices; 4 | using Unity.Burst; 5 | using Unity.Collections; 6 | using Unity.Entities; 7 | using Unity.CharacterController; 8 | using Unity.Jobs; 9 | using Unity.Mathematics; 10 | using Unity.Physics; 11 | using Unity.Physics.Authoring; 12 | using Unity.Physics.Extensions; 13 | using Unity.Physics.Systems; 14 | using Unity.Transforms; 15 | using UnityEngine; 16 | 17 | public struct ThirdPersonCharacterUpdateContext 18 | { 19 | // Here, you may add additional global data for your character updates, such as ComponentLookups, Singletons, NativeCollections, etc... 20 | // The data you add here will be accessible in your character updates and all of your character "callbacks". 21 | 22 | public void OnSystemCreate(ref SystemState state) 23 | { 24 | // Get lookups 25 | } 26 | 27 | public void OnSystemUpdate(ref SystemState state) 28 | { 29 | // Update lookups 30 | } 31 | } 32 | 33 | public readonly partial struct ThirdPersonCharacterAspect : IAspect, IKinematicCharacterProcessor 34 | { 35 | public readonly KinematicCharacterAspect CharacterAspect; 36 | public readonly RefRW CharacterComponent; 37 | public readonly RefRW CharacterControl; 38 | 39 | public void PhysicsUpdate(ref ThirdPersonCharacterUpdateContext context, ref KinematicCharacterUpdateContext baseContext) 40 | { 41 | ref ThirdPersonCharacterComponent characterComponent = ref CharacterComponent.ValueRW; 42 | ref KinematicCharacterBody characterBody = ref CharacterAspect.CharacterBody.ValueRW; 43 | ref float3 characterPosition = ref CharacterAspect.LocalTransform.ValueRW.Position; 44 | 45 | // First phase of default character update 46 | CharacterAspect.Update_Initialize(in this, ref context, ref baseContext, ref characterBody, baseContext.Time.DeltaTime); 47 | CharacterAspect.Update_ParentMovement(in this, ref context, ref baseContext, ref characterBody, ref characterPosition, characterBody.WasGroundedBeforeCharacterUpdate); 48 | CharacterAspect.Update_Grounding(in this, ref context, ref baseContext, ref characterBody, ref characterPosition); 49 | 50 | // Update desired character velocity after grounding was detected, but before doing additional processing that depends on velocity 51 | HandleVelocityControl(ref context, ref baseContext); 52 | 53 | // Second phase of default character update 54 | CharacterAspect.Update_PreventGroundingFromFutureSlopeChange(in this, ref context, ref baseContext, ref characterBody, in characterComponent.StepAndSlopeHandling); 55 | CharacterAspect.Update_GroundPushing(in this, ref context, ref baseContext, characterComponent.Gravity); 56 | CharacterAspect.Update_MovementAndDecollisions(in this, ref context, ref baseContext, ref characterBody, ref characterPosition); 57 | CharacterAspect.Update_MovingPlatformDetection(ref baseContext, ref characterBody); 58 | CharacterAspect.Update_ParentMomentum(ref baseContext, ref characterBody); 59 | CharacterAspect.Update_ProcessStatefulCharacterHits(); 60 | } 61 | 62 | private void HandleVelocityControl(ref ThirdPersonCharacterUpdateContext context, ref KinematicCharacterUpdateContext baseContext) 63 | { 64 | float deltaTime = baseContext.Time.DeltaTime; 65 | ref KinematicCharacterBody characterBody = ref CharacterAspect.CharacterBody.ValueRW; 66 | ref ThirdPersonCharacterComponent characterComponent = ref CharacterComponent.ValueRW; 67 | ref ThirdPersonCharacterControl characterControl = ref CharacterControl.ValueRW; 68 | 69 | // Rotate move input and velocity to take into account parent rotation 70 | if(characterBody.ParentEntity != Entity.Null) 71 | { 72 | characterControl.MoveVector = math.rotate(characterBody.RotationFromParent, characterControl.MoveVector); 73 | characterBody.RelativeVelocity = math.rotate(characterBody.RotationFromParent, characterBody.RelativeVelocity); 74 | } 75 | 76 | // Jump 77 | if (characterControl.Jump && (characterBody.IsGrounded || !characterComponent.DoubleJumped)) 78 | { 79 | characterComponent.DoubleJumped = !characterBody.IsGrounded; 80 | CharacterControlUtilities.StandardJump(ref characterBody, characterBody.GroundingUp * characterComponent.JumpSpeed, true, characterBody.GroundingUp); 81 | } 82 | 83 | if (characterBody.IsGrounded) 84 | { 85 | // Move on ground 86 | float3 targetVelocity = characterControl.MoveVector * characterComponent.GroundMaxSpeed; 87 | CharacterControlUtilities.StandardGroundMove_Interpolated(ref characterBody.RelativeVelocity, targetVelocity, characterComponent.GroundedMovementSharpness, deltaTime, characterBody.GroundingUp, characterBody.GroundHit.Normal); 88 | } 89 | else 90 | { 91 | // Move in air 92 | float3 airAcceleration = characterControl.MoveVector * characterComponent.AirAcceleration; 93 | if (math.lengthsq(airAcceleration) > 0f) 94 | { 95 | float3 tmpVelocity = characterBody.RelativeVelocity; 96 | CharacterControlUtilities.StandardAirMove(ref characterBody.RelativeVelocity, airAcceleration, characterComponent.AirMaxSpeed, characterBody.GroundingUp, deltaTime, false); 97 | 98 | // Cancel air acceleration from input if we would hit a non-grounded surface (prevents air-climbing slopes at high air accelerations) 99 | if (characterComponent.PreventAirAccelerationAgainstUngroundedHits && CharacterAspect.MovementWouldHitNonGroundedObstruction(in this, ref context, ref baseContext, characterBody.RelativeVelocity * deltaTime, out ColliderCastHit hit)) 100 | { 101 | characterBody.RelativeVelocity = tmpVelocity; 102 | } 103 | } 104 | 105 | // Gravity 106 | CharacterControlUtilities.AccelerateVelocity(ref characterBody.RelativeVelocity, characterComponent.Gravity, deltaTime); 107 | 108 | // Drag 109 | CharacterControlUtilities.ApplyDragToVelocity(ref characterBody.RelativeVelocity, deltaTime, characterComponent.AirDrag); 110 | } 111 | } 112 | 113 | public void VariableUpdate(ref ThirdPersonCharacterUpdateContext context, ref KinematicCharacterUpdateContext baseContext) 114 | { 115 | ref KinematicCharacterBody characterBody = ref CharacterAspect.CharacterBody.ValueRW; 116 | ref ThirdPersonCharacterComponent characterComponent = ref CharacterComponent.ValueRW; 117 | ref ThirdPersonCharacterControl characterControl = ref CharacterControl.ValueRW; 118 | ref quaternion characterRotation = ref CharacterAspect.LocalTransform.ValueRW.Rotation; 119 | 120 | // Add rotation from parent body to the character rotation 121 | // (this is for allowing a rotating moving platform to rotate your character as well, and handle interpolation properly) 122 | KinematicCharacterUtilities.AddVariableRateRotationFromFixedRateRotation(ref characterRotation, characterBody.RotationFromParent, baseContext.Time.DeltaTime, characterBody.LastPhysicsUpdateDeltaTime); 123 | 124 | // Rotate towards move direction 125 | if (math.lengthsq(characterControl.MoveVector) > 0f) 126 | { 127 | CharacterControlUtilities.SlerpRotationTowardsDirectionAroundUp(ref characterRotation, baseContext.Time.DeltaTime, math.normalizesafe(characterControl.MoveVector), MathUtilities.GetUpFromRotation(characterRotation), characterComponent.RotationSharpness); 128 | } 129 | } 130 | 131 | #region Character Processor Callbacks 132 | public void UpdateGroundingUp( 133 | ref ThirdPersonCharacterUpdateContext context, 134 | ref KinematicCharacterUpdateContext baseContext) 135 | { 136 | ref KinematicCharacterBody characterBody = ref CharacterAspect.CharacterBody.ValueRW; 137 | 138 | CharacterAspect.Default_UpdateGroundingUp(ref characterBody); 139 | } 140 | 141 | public bool CanCollideWithHit( 142 | ref ThirdPersonCharacterUpdateContext context, 143 | ref KinematicCharacterUpdateContext baseContext, 144 | in BasicHit hit) 145 | { 146 | return PhysicsUtilities.IsCollidable(hit.Material); 147 | } 148 | 149 | public bool IsGroundedOnHit( 150 | ref ThirdPersonCharacterUpdateContext context, 151 | ref KinematicCharacterUpdateContext baseContext, 152 | in BasicHit hit, 153 | int groundingEvaluationType) 154 | { 155 | ThirdPersonCharacterComponent characterComponent = CharacterComponent.ValueRO; 156 | 157 | return CharacterAspect.Default_IsGroundedOnHit( 158 | in this, 159 | ref context, 160 | ref baseContext, 161 | in hit, 162 | in characterComponent.StepAndSlopeHandling, 163 | groundingEvaluationType); 164 | } 165 | 166 | public void OnMovementHit( 167 | ref ThirdPersonCharacterUpdateContext context, 168 | ref KinematicCharacterUpdateContext baseContext, 169 | ref KinematicCharacterHit hit, 170 | ref float3 remainingMovementDirection, 171 | ref float remainingMovementLength, 172 | float3 originalVelocityDirection, 173 | float hitDistance) 174 | { 175 | ref KinematicCharacterBody characterBody = ref CharacterAspect.CharacterBody.ValueRW; 176 | ref float3 characterPosition = ref CharacterAspect.LocalTransform.ValueRW.Position; 177 | ThirdPersonCharacterComponent characterComponent = CharacterComponent.ValueRO; 178 | 179 | CharacterAspect.Default_OnMovementHit( 180 | in this, 181 | ref context, 182 | ref baseContext, 183 | ref characterBody, 184 | ref characterPosition, 185 | ref hit, 186 | ref remainingMovementDirection, 187 | ref remainingMovementLength, 188 | originalVelocityDirection, 189 | hitDistance, 190 | characterComponent.StepAndSlopeHandling.StepHandling, 191 | characterComponent.StepAndSlopeHandling.MaxStepHeight, 192 | characterComponent.StepAndSlopeHandling.CharacterWidthForStepGroundingCheck); 193 | } 194 | 195 | public void OverrideDynamicHitMasses( 196 | ref ThirdPersonCharacterUpdateContext context, 197 | ref KinematicCharacterUpdateContext baseContext, 198 | ref PhysicsMass characterMass, 199 | ref PhysicsMass otherMass, 200 | BasicHit hit) 201 | { 202 | // Custom mass overrides 203 | } 204 | 205 | public void ProjectVelocityOnHits( 206 | ref ThirdPersonCharacterUpdateContext context, 207 | ref KinematicCharacterUpdateContext baseContext, 208 | ref float3 velocity, 209 | ref bool characterIsGrounded, 210 | ref BasicHit characterGroundHit, 211 | in DynamicBuffer velocityProjectionHits, 212 | float3 originalVelocityDirection) 213 | { 214 | ThirdPersonCharacterComponent characterComponent = CharacterComponent.ValueRO; 215 | 216 | CharacterAspect.Default_ProjectVelocityOnHits( 217 | ref velocity, 218 | ref characterIsGrounded, 219 | ref characterGroundHit, 220 | in velocityProjectionHits, 221 | originalVelocityDirection, 222 | characterComponent.StepAndSlopeHandling.ConstrainVelocityToGroundPlane); 223 | } 224 | #endregion 225 | } 226 | -------------------------------------------------------------------------------- /Assets/Samples/Character Controller/1.0.0-exp.22/Standard Characters/FirstPerson/Scripts/FirstPersonCharacterAspect.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.CompilerServices; 4 | using Unity.Burst; 5 | using Unity.Collections; 6 | using Unity.Entities; 7 | using Unity.Jobs; 8 | using Unity.Mathematics; 9 | using Unity.Physics; 10 | using Unity.Physics.Authoring; 11 | using Unity.Physics.Extensions; 12 | using Unity.Physics.Systems; 13 | using Unity.Transforms; 14 | using Unity.CharacterController; 15 | using UnityEngine; 16 | 17 | public struct FirstPersonCharacterUpdateContext 18 | { 19 | // Here, you may add additional global data for your character updates, such as ComponentLookups, Singletons, NativeCollections, etc... 20 | // The data you add here will be accessible in your character updates and all of your character "callbacks". 21 | 22 | public void OnSystemCreate(ref SystemState state) 23 | { 24 | // Get lookups 25 | } 26 | 27 | public void OnSystemUpdate(ref SystemState state) 28 | { 29 | // Update lookups 30 | } 31 | } 32 | 33 | public readonly partial struct FirstPersonCharacterAspect : IAspect, IKinematicCharacterProcessor 34 | { 35 | public readonly KinematicCharacterAspect CharacterAspect; 36 | public readonly RefRW CharacterComponent; 37 | public readonly RefRW CharacterControl; 38 | 39 | public void PhysicsUpdate(ref FirstPersonCharacterUpdateContext context, ref KinematicCharacterUpdateContext baseContext) 40 | { 41 | ref FirstPersonCharacterComponent characterComponent = ref CharacterComponent.ValueRW; 42 | ref KinematicCharacterBody characterBody = ref CharacterAspect.CharacterBody.ValueRW; 43 | ref float3 characterPosition = ref CharacterAspect.LocalTransform.ValueRW.Position; 44 | 45 | // First phase of default character update 46 | CharacterAspect.Update_Initialize(in this, ref context, ref baseContext, ref characterBody, baseContext.Time.DeltaTime); 47 | CharacterAspect.Update_ParentMovement(in this, ref context, ref baseContext, ref characterBody, ref characterPosition, characterBody.WasGroundedBeforeCharacterUpdate); 48 | CharacterAspect.Update_Grounding(in this, ref context, ref baseContext, ref characterBody, ref characterPosition); 49 | 50 | // Update desired character velocity after grounding was detected, but before doing additional processing that depends on velocity 51 | HandleVelocityControl(ref context, ref baseContext); 52 | 53 | // Second phase of default character update 54 | CharacterAspect.Update_PreventGroundingFromFutureSlopeChange(in this, ref context, ref baseContext, ref characterBody, in characterComponent.StepAndSlopeHandling); 55 | CharacterAspect.Update_GroundPushing(in this, ref context, ref baseContext, characterComponent.Gravity); 56 | CharacterAspect.Update_MovementAndDecollisions(in this, ref context, ref baseContext, ref characterBody, ref characterPosition); 57 | CharacterAspect.Update_MovingPlatformDetection(ref baseContext, ref characterBody); 58 | CharacterAspect.Update_ParentMomentum(ref baseContext, ref characterBody); 59 | CharacterAspect.Update_ProcessStatefulCharacterHits(); 60 | } 61 | 62 | private void HandleVelocityControl(ref FirstPersonCharacterUpdateContext context, ref KinematicCharacterUpdateContext baseContext) 63 | { 64 | float deltaTime = baseContext.Time.DeltaTime; 65 | ref KinematicCharacterBody characterBody = ref CharacterAspect.CharacterBody.ValueRW; 66 | ref FirstPersonCharacterComponent characterComponent = ref CharacterComponent.ValueRW; 67 | ref FirstPersonCharacterControl characterControl = ref CharacterControl.ValueRW; 68 | 69 | // Rotate move input and velocity to take into account parent rotation 70 | if(characterBody.ParentEntity != Entity.Null) 71 | { 72 | characterControl.MoveVector = math.rotate(characterBody.RotationFromParent, characterControl.MoveVector); 73 | characterBody.RelativeVelocity = math.rotate(characterBody.RotationFromParent, characterBody.RelativeVelocity); 74 | } 75 | 76 | if (characterBody.IsGrounded) 77 | { 78 | // Move on ground 79 | float3 targetVelocity = characterControl.MoveVector * characterComponent.GroundMaxSpeed; 80 | CharacterControlUtilities.StandardGroundMove_Interpolated(ref characterBody.RelativeVelocity, targetVelocity, characterComponent.GroundedMovementSharpness, deltaTime, characterBody.GroundingUp, characterBody.GroundHit.Normal); 81 | 82 | // Jump 83 | if (characterControl.Jump) 84 | { 85 | CharacterControlUtilities.StandardJump(ref characterBody, characterBody.GroundingUp * characterComponent.JumpSpeed, true, characterBody.GroundingUp); 86 | } 87 | } 88 | else 89 | { 90 | // Move in air 91 | float3 airAcceleration = characterControl.MoveVector * characterComponent.AirAcceleration; 92 | if (math.lengthsq(airAcceleration) > 0f) 93 | { 94 | float3 tmpVelocity = characterBody.RelativeVelocity; 95 | CharacterControlUtilities.StandardAirMove(ref characterBody.RelativeVelocity, airAcceleration, characterComponent.AirMaxSpeed, characterBody.GroundingUp, deltaTime, false); 96 | 97 | // Cancel air acceleration from input if we would hit a non-grounded surface (prevents air-climbing slopes at high air accelerations) 98 | if (characterComponent.PreventAirAccelerationAgainstUngroundedHits && CharacterAspect.MovementWouldHitNonGroundedObstruction(in this, ref context, ref baseContext, characterBody.RelativeVelocity * deltaTime, out ColliderCastHit hit)) 99 | { 100 | characterBody.RelativeVelocity = tmpVelocity; 101 | } 102 | } 103 | 104 | // Gravity 105 | CharacterControlUtilities.AccelerateVelocity(ref characterBody.RelativeVelocity, characterComponent.Gravity, deltaTime); 106 | 107 | // Drag 108 | CharacterControlUtilities.ApplyDragToVelocity(ref characterBody.RelativeVelocity, deltaTime, characterComponent.AirDrag); 109 | } 110 | } 111 | 112 | public void VariableUpdate(ref FirstPersonCharacterUpdateContext context, ref KinematicCharacterUpdateContext baseContext) 113 | { 114 | ref KinematicCharacterBody characterBody = ref CharacterAspect.CharacterBody.ValueRW; 115 | ref FirstPersonCharacterComponent characterComponent = ref CharacterComponent.ValueRW; 116 | ref FirstPersonCharacterControl characterControl = ref CharacterControl.ValueRW; 117 | ref quaternion characterRotation = ref CharacterAspect.LocalTransform.ValueRW.Rotation; 118 | 119 | // Add rotation from parent body to the character rotation 120 | // (this is for allowing a rotating moving platform to rotate your character as well, and handle interpolation properly) 121 | KinematicCharacterUtilities.AddVariableRateRotationFromFixedRateRotation(ref characterRotation, characterBody.RotationFromParent, baseContext.Time.DeltaTime, characterBody.LastPhysicsUpdateDeltaTime); 122 | 123 | // Compute character & view rotations from rotation input 124 | FirstPersonCharacterUtilities.ComputeFinalRotationsFromRotationDelta( 125 | ref characterRotation, 126 | ref characterComponent.ViewPitchDegrees, 127 | characterControl.LookYawPitchDegrees, 128 | 0f, 129 | characterComponent.MinViewAngle, 130 | characterComponent.MaxViewAngle, 131 | out float canceledPitchDegrees, 132 | out characterComponent.ViewLocalRotation); 133 | } 134 | 135 | #region Character Processor Callbacks 136 | public void UpdateGroundingUp( 137 | ref FirstPersonCharacterUpdateContext context, 138 | ref KinematicCharacterUpdateContext baseContext) 139 | { 140 | ref KinematicCharacterBody characterBody = ref CharacterAspect.CharacterBody.ValueRW; 141 | 142 | CharacterAspect.Default_UpdateGroundingUp(ref characterBody); 143 | } 144 | 145 | public bool CanCollideWithHit( 146 | ref FirstPersonCharacterUpdateContext context, 147 | ref KinematicCharacterUpdateContext baseContext, 148 | in BasicHit hit) 149 | { 150 | return PhysicsUtilities.IsCollidable(hit.Material); 151 | } 152 | 153 | public bool IsGroundedOnHit( 154 | ref FirstPersonCharacterUpdateContext context, 155 | ref KinematicCharacterUpdateContext baseContext, 156 | in BasicHit hit, 157 | int groundingEvaluationType) 158 | { 159 | FirstPersonCharacterComponent characterComponent = CharacterComponent.ValueRO; 160 | 161 | return CharacterAspect.Default_IsGroundedOnHit( 162 | in this, 163 | ref context, 164 | ref baseContext, 165 | in hit, 166 | in characterComponent.StepAndSlopeHandling, 167 | groundingEvaluationType); 168 | } 169 | 170 | public void OnMovementHit( 171 | ref FirstPersonCharacterUpdateContext context, 172 | ref KinematicCharacterUpdateContext baseContext, 173 | ref KinematicCharacterHit hit, 174 | ref float3 remainingMovementDirection, 175 | ref float remainingMovementLength, 176 | float3 originalVelocityDirection, 177 | float hitDistance) 178 | { 179 | ref KinematicCharacterBody characterBody = ref CharacterAspect.CharacterBody.ValueRW; 180 | ref float3 characterPosition = ref CharacterAspect.LocalTransform.ValueRW.Position; 181 | FirstPersonCharacterComponent characterComponent = CharacterComponent.ValueRO; 182 | 183 | CharacterAspect.Default_OnMovementHit( 184 | in this, 185 | ref context, 186 | ref baseContext, 187 | ref characterBody, 188 | ref characterPosition, 189 | ref hit, 190 | ref remainingMovementDirection, 191 | ref remainingMovementLength, 192 | originalVelocityDirection, 193 | hitDistance, 194 | characterComponent.StepAndSlopeHandling.StepHandling, 195 | characterComponent.StepAndSlopeHandling.MaxStepHeight, 196 | characterComponent.StepAndSlopeHandling.CharacterWidthForStepGroundingCheck); 197 | } 198 | 199 | public void OverrideDynamicHitMasses( 200 | ref FirstPersonCharacterUpdateContext context, 201 | ref KinematicCharacterUpdateContext baseContext, 202 | ref PhysicsMass characterMass, 203 | ref PhysicsMass otherMass, 204 | BasicHit hit) 205 | { 206 | // Custom mass overrides 207 | } 208 | 209 | public void ProjectVelocityOnHits( 210 | ref FirstPersonCharacterUpdateContext context, 211 | ref KinematicCharacterUpdateContext baseContext, 212 | ref float3 velocity, 213 | ref bool characterIsGrounded, 214 | ref BasicHit characterGroundHit, 215 | in DynamicBuffer velocityProjectionHits, 216 | float3 originalVelocityDirection) 217 | { 218 | FirstPersonCharacterComponent characterComponent = CharacterComponent.ValueRO; 219 | 220 | CharacterAspect.Default_ProjectVelocityOnHits( 221 | ref velocity, 222 | ref characterIsGrounded, 223 | ref characterGroundHit, 224 | in velocityProjectionHits, 225 | originalVelocityDirection, 226 | characterComponent.StepAndSlopeHandling.ConstrainVelocityToGroundPlane); 227 | } 228 | #endregion 229 | } 230 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | - serializedVersion: 3 297 | m_Name: Enable Debug Button 1 298 | descriptiveName: 299 | descriptiveNegativeName: 300 | negativeButton: 301 | positiveButton: left ctrl 302 | altNegativeButton: 303 | altPositiveButton: joystick button 8 304 | gravity: 0 305 | dead: 0 306 | sensitivity: 0 307 | snap: 0 308 | invert: 0 309 | type: 0 310 | axis: 0 311 | joyNum: 0 312 | - serializedVersion: 3 313 | m_Name: Enable Debug Button 2 314 | descriptiveName: 315 | descriptiveNegativeName: 316 | negativeButton: 317 | positiveButton: backspace 318 | altNegativeButton: 319 | altPositiveButton: joystick button 9 320 | gravity: 0 321 | dead: 0 322 | sensitivity: 0 323 | snap: 0 324 | invert: 0 325 | type: 0 326 | axis: 0 327 | joyNum: 0 328 | - serializedVersion: 3 329 | m_Name: Debug Reset 330 | descriptiveName: 331 | descriptiveNegativeName: 332 | negativeButton: 333 | positiveButton: left alt 334 | altNegativeButton: 335 | altPositiveButton: joystick button 1 336 | gravity: 0 337 | dead: 0 338 | sensitivity: 0 339 | snap: 0 340 | invert: 0 341 | type: 0 342 | axis: 0 343 | joyNum: 0 344 | - serializedVersion: 3 345 | m_Name: Debug Next 346 | descriptiveName: 347 | descriptiveNegativeName: 348 | negativeButton: 349 | positiveButton: page down 350 | altNegativeButton: 351 | altPositiveButton: joystick button 5 352 | gravity: 0 353 | dead: 0 354 | sensitivity: 0 355 | snap: 0 356 | invert: 0 357 | type: 0 358 | axis: 0 359 | joyNum: 0 360 | - serializedVersion: 3 361 | m_Name: Debug Previous 362 | descriptiveName: 363 | descriptiveNegativeName: 364 | negativeButton: 365 | positiveButton: page up 366 | altNegativeButton: 367 | altPositiveButton: joystick button 4 368 | gravity: 0 369 | dead: 0 370 | sensitivity: 0 371 | snap: 0 372 | invert: 0 373 | type: 0 374 | axis: 0 375 | joyNum: 0 376 | - serializedVersion: 3 377 | m_Name: Debug Validate 378 | descriptiveName: 379 | descriptiveNegativeName: 380 | negativeButton: 381 | positiveButton: return 382 | altNegativeButton: 383 | altPositiveButton: joystick button 0 384 | gravity: 0 385 | dead: 0 386 | sensitivity: 0 387 | snap: 0 388 | invert: 0 389 | type: 0 390 | axis: 0 391 | joyNum: 0 392 | - serializedVersion: 3 393 | m_Name: Debug Persistent 394 | descriptiveName: 395 | descriptiveNegativeName: 396 | negativeButton: 397 | positiveButton: right shift 398 | altNegativeButton: 399 | altPositiveButton: joystick button 2 400 | gravity: 0 401 | dead: 0 402 | sensitivity: 0 403 | snap: 0 404 | invert: 0 405 | type: 0 406 | axis: 0 407 | joyNum: 0 408 | - serializedVersion: 3 409 | m_Name: Debug Multiplier 410 | descriptiveName: 411 | descriptiveNegativeName: 412 | negativeButton: 413 | positiveButton: left shift 414 | altNegativeButton: 415 | altPositiveButton: joystick button 3 416 | gravity: 0 417 | dead: 0 418 | sensitivity: 0 419 | snap: 0 420 | invert: 0 421 | type: 0 422 | axis: 0 423 | joyNum: 0 424 | - serializedVersion: 3 425 | m_Name: Debug Horizontal 426 | descriptiveName: 427 | descriptiveNegativeName: 428 | negativeButton: left 429 | positiveButton: right 430 | altNegativeButton: 431 | altPositiveButton: 432 | gravity: 1000 433 | dead: 0.001 434 | sensitivity: 1000 435 | snap: 0 436 | invert: 0 437 | type: 0 438 | axis: 0 439 | joyNum: 0 440 | - serializedVersion: 3 441 | m_Name: Debug Vertical 442 | descriptiveName: 443 | descriptiveNegativeName: 444 | negativeButton: down 445 | positiveButton: up 446 | altNegativeButton: 447 | altPositiveButton: 448 | gravity: 1000 449 | dead: 0.001 450 | sensitivity: 1000 451 | snap: 0 452 | invert: 0 453 | type: 0 454 | axis: 0 455 | joyNum: 0 456 | - serializedVersion: 3 457 | m_Name: Debug Vertical 458 | descriptiveName: 459 | descriptiveNegativeName: 460 | negativeButton: down 461 | positiveButton: up 462 | altNegativeButton: 463 | altPositiveButton: 464 | gravity: 1000 465 | dead: 0.001 466 | sensitivity: 1000 467 | snap: 0 468 | invert: 0 469 | type: 2 470 | axis: 6 471 | joyNum: 0 472 | - serializedVersion: 3 473 | m_Name: Debug Horizontal 474 | descriptiveName: 475 | descriptiveNegativeName: 476 | negativeButton: left 477 | positiveButton: right 478 | altNegativeButton: 479 | altPositiveButton: 480 | gravity: 1000 481 | dead: 0.001 482 | sensitivity: 1000 483 | snap: 0 484 | invert: 0 485 | type: 2 486 | axis: 5 487 | joyNum: 0 488 | m_UsePhysicalKeys: 1 489 | --------------------------------------------------------------------------------