From 16b2521469618237d73d211ba52e05e1ff8d576b Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Tue, 23 Jul 2024 17:35:21 -0400 Subject: [PATCH 01/10] initial project commit --- .../Assets/NetworkPrefabs.asset | 16 + .../Assets/NetworkPrefabs.asset.meta | 8 + .../Assets/Prefabs.meta | 8 + .../Assets/Prefabs/Avatar.prefab | 168 +++ .../Assets/Prefabs/Avatar.prefab.meta | 7 + .../Assets/Prefabs/MainCamera.prefab | 139 +++ .../Assets/Prefabs/MainCamera.prefab.meta | 7 + .../Assets/Scenes.meta | 8 + .../Assets/Scenes/Bootstrap.unity | 276 +++++ .../Assets/Scenes/Bootstrap.unity.meta | 7 + .../Assets/Scenes/HubScene.unity | 354 +++++++ .../Assets/Scenes/HubScene.unity.meta | 7 + .../Assets/Scenes/MainMenu.unity | 124 +++ .../Assets/Scenes/MainMenu.unity.meta | 7 + .../Assets/Scripts.meta | 8 + .../Assets/Scripts/Temp.meta | 8 + .../Assets/Settings.meta | 8 + .../Settings/DefaultVolumeProfile.asset | 982 ++++++++++++++++++ .../Settings/DefaultVolumeProfile.asset.meta | 8 + .../Assets/Settings/Mobile_RPAsset.asset | 135 +++ .../Assets/Settings/Mobile_RPAsset.asset.meta | 8 + .../Assets/Settings/Mobile_Renderer.asset | 66 ++ .../Settings/Mobile_Renderer.asset.meta | 8 + .../Assets/Settings/PC_RPAsset.asset | 135 +++ .../Assets/Settings/PC_RPAsset.asset.meta | 8 + .../Assets/Settings/PC_Renderer.asset | 95 ++ .../Assets/Settings/PC_Renderer.asset.meta | 8 + .../Assets/Settings/SampleSceneProfile.asset | 159 +++ .../Settings/SampleSceneProfile.asset.meta | 8 + ...niversalRenderPipelineGlobalSettings.asset | 256 +++++ ...salRenderPipelineGlobalSettings.asset.meta | 8 + .../Packages/manifest.json | 52 + .../Packages/packages-lock.json | 610 +++++++++++ .../ProjectSettings/AudioManager.asset | 19 + .../ProjectSettings/ClusterInputManager.asset | 6 + .../ProjectSettings/DynamicsManager.asset | 37 + .../ProjectSettings/EditorBuildSettings.asset | 20 + .../ProjectSettings/EditorSettings.asset | 48 + .../ProjectSettings/GraphicsSettings.asset | 70 ++ .../ProjectSettings/InputManager.asset | 487 +++++++++ .../ProjectSettings/MemorySettings.asset | 35 + .../ProjectSettings/MultiplayerManager.asset | 7 + .../ProjectSettings/NavMeshAreas.asset | 91 ++ .../NetcodeForGameObjects.asset | 17 + .../PackageManagerSettings.asset | 43 + .../ProjectSettings/Physics2DSettings.asset | 56 + .../ProjectSettings/PresetManager.asset | 7 + .../ProjectSettings/ProjectSettings.asset | 944 +++++++++++++++++ .../ProjectSettings/ProjectVersion.txt | 2 + .../ProjectSettings/QualitySettings.asset | 134 +++ .../SceneTemplateSettings.json | 121 +++ .../ProjectSettings/ShaderGraphSettings.asset | 18 + .../ProjectSettings/TagManager.asset | 53 + .../ProjectSettings/TimeManager.asset | 9 + .../ProjectSettings/URPProjectSettings.asset | 15 + .../UnityConnectSettings.asset | 36 + .../ProjectSettings/VFXManager.asset | 12 + .../VersionControlSettings.asset | 8 + .../VirtualProjectsConfig.json | 4 + .../ProjectSettings/XRSettings.asset | 10 + 60 files changed, 6015 insertions(+) create mode 100644 Experimental/DistributedAuthoritySample/Assets/NetworkPrefabs.asset create mode 100644 Experimental/DistributedAuthoritySample/Assets/NetworkPrefabs.asset.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Prefabs.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab create mode 100644 Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Prefabs/MainCamera.prefab create mode 100644 Experimental/DistributedAuthoritySample/Assets/Prefabs/MainCamera.prefab.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scenes.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scenes/Bootstrap.unity create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scenes/Bootstrap.unity.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scenes/HubScene.unity create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scenes/HubScene.unity.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scenes/MainMenu.unity create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scenes/MainMenu.unity.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Temp.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/DefaultVolumeProfile.asset create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/DefaultVolumeProfile.asset.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_RPAsset.asset create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_RPAsset.asset.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_Renderer.asset create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_Renderer.asset.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/PC_RPAsset.asset create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/PC_RPAsset.asset.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/PC_Renderer.asset create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/PC_Renderer.asset.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/SampleSceneProfile.asset create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/SampleSceneProfile.asset.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset create mode 100644 Experimental/DistributedAuthoritySample/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset.meta create mode 100644 Experimental/DistributedAuthoritySample/Packages/manifest.json create mode 100644 Experimental/DistributedAuthoritySample/Packages/packages-lock.json create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/AudioManager.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/ClusterInputManager.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/DynamicsManager.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/EditorBuildSettings.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/EditorSettings.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/GraphicsSettings.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/InputManager.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/MemorySettings.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/MultiplayerManager.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/NavMeshAreas.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/NetcodeForGameObjects.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/PackageManagerSettings.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/Physics2DSettings.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/PresetManager.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/ProjectSettings.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/ProjectVersion.txt create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/QualitySettings.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/SceneTemplateSettings.json create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/ShaderGraphSettings.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/TagManager.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/TimeManager.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/URPProjectSettings.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/UnityConnectSettings.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/VFXManager.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/VersionControlSettings.asset create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/VirtualProjectsConfig.json create mode 100644 Experimental/DistributedAuthoritySample/ProjectSettings/XRSettings.asset diff --git a/Experimental/DistributedAuthoritySample/Assets/NetworkPrefabs.asset b/Experimental/DistributedAuthoritySample/Assets/NetworkPrefabs.asset new file mode 100644 index 000000000..63e14cc1b --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/NetworkPrefabs.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e651dbb3fbac04af2b8f5abf007ddc23, type: 3} + m_Name: NetworkPrefabs + m_EditorClassIdentifier: + IsDefault: 1 + List: [] diff --git a/Experimental/DistributedAuthoritySample/Assets/NetworkPrefabs.asset.meta b/Experimental/DistributedAuthoritySample/Assets/NetworkPrefabs.asset.meta new file mode 100644 index 000000000..b548d1277 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/NetworkPrefabs.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b886aec5f5a8245478d1b338218fbace +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Prefabs.meta b/Experimental/DistributedAuthoritySample/Assets/Prefabs.meta new file mode 100644 index 000000000..ec0a15875 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7736e6b77b6583d419a1aaca82eb69b7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab b/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab new file mode 100644 index 000000000..d1fce1f89 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab @@ -0,0 +1,168 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3998769334658168242 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 527982249900556139} + - component: {fileID: 5867719757342769277} + - component: {fileID: 8689654737478668655} + - component: {fileID: 817796967242824188} + m_Layer: 0 + m_Name: Capsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &527982249900556139 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3998769334658168242} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 378099091213283077} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &5867719757342769277 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3998769334658168242} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8689654737478668655 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3998769334658168242} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &817796967242824188 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3998769334658168242} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &5478015027486214707 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 378099091213283077} + - component: {fileID: 2864305741433477372} + m_Layer: 0 + m_Name: Avatar + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &378099091213283077 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5478015027486214707} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 527982249900556139} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2864305741433477372 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5478015027486214707} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 2473698027 + InScenePlacedSourceGlobalObjectIdHash: 0 + DeferredDespawnTick: 0 + Ownership: 0 + AlwaysReplicateAsRoot: 0 + SynchronizeTransform: 1 + ActiveSceneSynchronization: 0 + SceneMigrationSynchronization: 1 + SpawnWithObservers: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 diff --git a/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab.meta b/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab.meta new file mode 100644 index 000000000..7a4a5cf0c --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d53f3508611e54740befa6a8bf6a15c1 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Prefabs/MainCamera.prefab b/Experimental/DistributedAuthoritySample/Assets/Prefabs/MainCamera.prefab new file mode 100644 index 000000000..e0fafbd28 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Prefabs/MainCamera.prefab @@ -0,0 +1,139 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &8944336655422409498 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8944336655422409503} + - component: {fileID: 8944336655422409496} + - component: {fileID: 8944336655422409497} + - component: {fileID: -2947200286860187156} + m_Layer: 0 + m_Name: MainCamera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8944336655422409503 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8944336655422409498} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1.375, z: -4} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &8944336655422409496 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8944336655422409498} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.972549, g: 0.95686275, b: 0.92941177, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.2 + far clip plane: 500 + field of view: 40 + orthographic: 0 + orthographic size: 10 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &8944336655422409497 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8944336655422409498} + m_Enabled: 1 +--- !u!114 &-2947200286860187156 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8944336655422409498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_Version: 2 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 diff --git a/Experimental/DistributedAuthoritySample/Assets/Prefabs/MainCamera.prefab.meta b/Experimental/DistributedAuthoritySample/Assets/Prefabs/MainCamera.prefab.meta new file mode 100644 index 000000000..7f2b28ce3 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Prefabs/MainCamera.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: eb439f24fcad44d48b8231b7418345d0 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scenes.meta b/Experimental/DistributedAuthoritySample/Assets/Scenes.meta new file mode 100644 index 000000000..e59fb4597 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9c53962885c2c4f449125a979d6ad240 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scenes/Bootstrap.unity b/Experimental/DistributedAuthoritySample/Assets/Scenes/Bootstrap.unity new file mode 100644 index 000000000..b1bafbd5c --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scenes/Bootstrap.unity @@ -0,0 +1,276 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 1 + m_PVRFilteringGaussRadiusAO: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &340021860 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 340021862} + - component: {fileID: 340021861} + m_Layer: 0 + m_Name: ServicesHelper + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &340021861 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 340021860} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b5134217b751de44fb27f189c7ef29e2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_AutoAuthenticateOnStart: 1 + m_InitiateVivoxOnAuthentication: 1 +--- !u!4 &340021862 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 340021860} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &900326967 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 900326970} + - component: {fileID: 900326969} + - component: {fileID: 900326968} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &900326968 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 900326967} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6960e84d07fb87f47956e7a81d71c4e6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ProtocolType: 0 + m_UseWebSockets: 0 + m_UseEncryption: 0 + m_MaxPacketQueueSize: 128 + m_MaxPayloadSize: 6144 + m_HeartbeatTimeoutMS: 500 + m_ConnectTimeoutMS: 1000 + m_MaxConnectAttempts: 60 + m_DisconnectTimeoutMS: 30000 + ConnectionData: + Address: 127.0.0.1 + Port: 7777 + ServerListenAddress: 127.0.0.1 + DebugSimulator: + PacketDelayMS: 0 + PacketJitterMS: 0 + PacketDropRate: 0 +--- !u!114 &900326969 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 900326967} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 593a2fe42fa9d37498c96f9a383b6521, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkConfig: + ProtocolVersion: 0 + NetworkTransport: {fileID: 900326968} + PlayerPrefab: {fileID: 5478015027486214707, guid: d53f3508611e54740befa6a8bf6a15c1, type: 3} + Prefabs: + NetworkPrefabsLists: + - {fileID: 11400000, guid: b886aec5f5a8245478d1b338218fbace, type: 2} + TickRate: 30 + ClientConnectionBufferTimeout: 10 + ConnectionApproval: 0 + ConnectionData: + EnableTimeResync: 0 + TimeResyncInterval: 30 + EnsureNetworkVariableLengthSafety: 0 + EnableSceneManagement: 1 + ForceSamePrefabs: 1 + RecycleNetworkIds: 1 + NetworkIdRecycleDelay: 120 + RpcHashSize: 0 + LoadSceneTimeOut: 120 + SpawnTimeout: 10 + EnableNetworkLogs: 1 + NetworkTopology: 1 + UseCMBService: 0 + AutoSpawnPlayerPrefabClientSide: 1 + NetworkMessageMetrics: 1 + NetworkProfilingMetrics: 1 + OldPrefabList: [] + RunInBackground: 1 + LogLevel: 1 +--- !u!4 &900326970 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 900326967} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 340021862} + - {fileID: 900326970} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scenes/Bootstrap.unity.meta b/Experimental/DistributedAuthoritySample/Assets/Scenes/Bootstrap.unity.meta new file mode 100644 index 000000000..e932500eb --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scenes/Bootstrap.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7534441b329644ec98e40c12ec5e3575 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scenes/HubScene.unity b/Experimental/DistributedAuthoritySample/Assets/Scenes/HubScene.unity new file mode 100644 index 000000000..51c9a297f --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scenes/HubScene.unity @@ -0,0 +1,354 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &410087039 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 410087041} + - component: {fileID: 410087040} + - component: {fileID: 410087042} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &410087040 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 410087039} + m_Enabled: 1 + serializedVersion: 11 + m_Type: 1 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 2 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 5000 + m_UseColorTemperature: 1 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ForceVisible: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 +--- !u!4 &410087041 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 410087039} + serializedVersion: 2 + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!114 &410087042 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 410087039} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 3 + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_LightLayerMask: 1 + m_RenderingLayers: 1 + m_CustomShadowLayers: 0 + m_ShadowLayerMask: 1 + m_ShadowRenderingLayers: 1 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 1 +--- !u!1 &832575517 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 832575519} + - component: {fileID: 832575518} + m_Layer: 0 + m_Name: Global Volume + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &832575518 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832575517} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: 10fc4df2da32a41aaa32d77bc913491c, type: 2} +--- !u!4 &832575519 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832575517} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &2024073102 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 8944336655422409498, guid: eb439f24fcad44d48b8231b7418345d0, type: 3} + propertyPath: m_Name + value: MainCamera + objectReference: {fileID: 0} + - target: {fileID: 8944336655422409503, guid: eb439f24fcad44d48b8231b7418345d0, type: 3} + propertyPath: m_LocalPosition.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 8944336655422409503, guid: eb439f24fcad44d48b8231b7418345d0, type: 3} + propertyPath: m_LocalPosition.y + value: 1.375 + objectReference: {fileID: 0} + - target: {fileID: 8944336655422409503, guid: eb439f24fcad44d48b8231b7418345d0, type: 3} + propertyPath: m_LocalPosition.z + value: -4 + objectReference: {fileID: 0} + - target: {fileID: 8944336655422409503, guid: eb439f24fcad44d48b8231b7418345d0, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8944336655422409503, guid: eb439f24fcad44d48b8231b7418345d0, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8944336655422409503, guid: eb439f24fcad44d48b8231b7418345d0, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8944336655422409503, guid: eb439f24fcad44d48b8231b7418345d0, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8944336655422409503, guid: eb439f24fcad44d48b8231b7418345d0, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8944336655422409503, guid: eb439f24fcad44d48b8231b7418345d0, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8944336655422409503, guid: eb439f24fcad44d48b8231b7418345d0, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: eb439f24fcad44d48b8231b7418345d0, type: 3} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 410087041} + - {fileID: 832575519} + - {fileID: 2024073102} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scenes/HubScene.unity.meta b/Experimental/DistributedAuthoritySample/Assets/Scenes/HubScene.unity.meta new file mode 100644 index 000000000..9531828bc --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scenes/HubScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 99c9720ab356a0642a771bea13969a05 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scenes/MainMenu.unity b/Experimental/DistributedAuthoritySample/Assets/Scenes/MainMenu.unity new file mode 100644 index 000000000..8358a75be --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scenes/MainMenu.unity @@ -0,0 +1,124 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 1 + m_PVRFilteringGaussRadiusAO: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: [] diff --git a/Experimental/DistributedAuthoritySample/Assets/Scenes/MainMenu.unity.meta b/Experimental/DistributedAuthoritySample/Assets/Scenes/MainMenu.unity.meta new file mode 100644 index 000000000..51b66f755 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scenes/MainMenu.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 00dfb9d65b7674d4cae5dfd318611cbe +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts.meta new file mode 100644 index 000000000..eba08ff12 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 84260c05e5d77034fb908132c5290e71 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Temp.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Temp.meta new file mode 100644 index 000000000..1b8188bc6 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Temp.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: af3ce23e1360ba343a0591db9506b21c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings.meta b/Experimental/DistributedAuthoritySample/Assets/Settings.meta new file mode 100644 index 000000000..39b94dd76 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 709f11a7f3c4041caa4ef136ea32d874 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/DefaultVolumeProfile.asset b/Experimental/DistributedAuthoritySample/Assets/Settings/DefaultVolumeProfile.asset new file mode 100644 index 000000000..6fb182200 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/DefaultVolumeProfile.asset @@ -0,0 +1,982 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-9167874883656233139 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5485954d14dfb9a4c8ead8edb0ded5b1, type: 3} + m_Name: LiftGammaGain + m_EditorClassIdentifier: + active: 1 + lift: + m_OverrideState: 1 + m_Value: {x: 1, y: 1, z: 1, w: 0} + gamma: + m_OverrideState: 1 + m_Value: {x: 1, y: 1, z: 1, w: 0} + gain: + m_OverrideState: 1 + m_Value: {x: 1, y: 1, z: 1, w: 0} +--- !u!114 &-8270506406425502121 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70afe9e12c7a7ed47911bb608a23a8ff, type: 3} + m_Name: SplitToning + m_EditorClassIdentifier: + active: 1 + shadows: + m_OverrideState: 1 + m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} + highlights: + m_OverrideState: 1 + m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} + balance: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &-8104416584915340131 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: CopyPasteTestComponent2 + m_EditorClassIdentifier: Unity.RenderPipelines.Core.Editor.Tests:UnityEditor.Rendering.Tests:VolumeComponentCopyPasteTests/CopyPasteTestComponent2 + active: 1 + p1: + m_OverrideState: 1 + m_Value: 0 + p2: + m_OverrideState: 1 + m_Value: 0 + p21: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &-7750755424749557576 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 60f3b30c03e6ba64d9a27dc9dba8f28d, type: 3} + m_Name: OutlineVolumeComponent + m_EditorClassIdentifier: + active: 1 + Enabled: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &-7743500325797982168 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ccf1aba9553839d41ae37dd52e9ebcce, type: 3} + m_Name: MotionBlur + m_EditorClassIdentifier: + active: 1 + mode: + m_OverrideState: 1 + m_Value: 0 + quality: + m_OverrideState: 1 + m_Value: 0 + intensity: + m_OverrideState: 1 + m_Value: 0 + clamp: + m_OverrideState: 1 + m_Value: 0.05 +--- !u!114 &-7274224791359825572 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0fd9ee276a1023e439cf7a9c393195fa, type: 3} + m_Name: TestAnimationCurveVolumeComponent + m_EditorClassIdentifier: + active: 1 + testParameter: + m_OverrideState: 1 + m_Value: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0.5 + value: 10 + inSlope: 0 + outSlope: 10 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 15 + inSlope: 10 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!114 &-6335409530604852063 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f335fb1ffd8684294ad653bf1c7564, type: 3} + m_Name: ColorAdjustments + m_EditorClassIdentifier: + active: 1 + postExposure: + m_OverrideState: 1 + m_Value: 0 + contrast: + m_OverrideState: 1 + m_Value: 0 + colorFilter: + m_OverrideState: 1 + m_Value: {r: 1, g: 1, b: 1, a: 1} + hueShift: + m_OverrideState: 1 + m_Value: 0 + saturation: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &-6288072647309666549 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 29fa0085f50d5e54f8144f766051a691, type: 3} + m_Name: FilmGrain + m_EditorClassIdentifier: + active: 1 + type: + m_OverrideState: 1 + m_Value: 0 + intensity: + m_OverrideState: 1 + m_Value: 0 + response: + m_OverrideState: 1 + m_Value: 0.8 + texture: + m_OverrideState: 1 + m_Value: {fileID: 0} +--- !u!114 &-5520245016509672950 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 97c23e3b12dc18c42a140437e53d3951, type: 3} + m_Name: Tonemapping + m_EditorClassIdentifier: + active: 1 + mode: + m_OverrideState: 1 + m_Value: 0 + neutralHDRRangeReductionMode: + m_OverrideState: 1 + m_Value: 2 + acesPreset: + m_OverrideState: 1 + m_Value: 3 + hueShiftAmount: + m_OverrideState: 1 + m_Value: 0 + detectPaperWhite: + m_OverrideState: 1 + m_Value: 0 + paperWhite: + m_OverrideState: 1 + m_Value: 300 + detectBrightnessLimits: + m_OverrideState: 1 + m_Value: 1 + minNits: + m_OverrideState: 1 + m_Value: 0.005 + maxNits: + m_OverrideState: 1 + m_Value: 1000 +--- !u!114 &-5360449096862653589 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: VolumeComponentSupportedEverywhere + m_EditorClassIdentifier: Unity.RenderPipelines.Core.Editor.Tests:UnityEngine.Rendering.Tests:VolumeComponentEditorSupportedOnTests/VolumeComponentSupportedEverywhere + active: 1 +--- !u!114 &-5139089513906902183 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5a00a63fdd6bd2a45ab1f2d869305ffd, type: 3} + m_Name: OasisFogVolumeComponent + m_EditorClassIdentifier: + active: 1 + Density: + m_OverrideState: 1 + m_Value: 0 + StartDistance: + m_OverrideState: 1 + m_Value: 0 + HeightRange: + m_OverrideState: 1 + m_Value: {x: 0, y: 50} + Tint: + m_OverrideState: 1 + m_Value: {r: 1, g: 1, b: 1, a: 1} + SunScatteringIntensity: + m_OverrideState: 1 + m_Value: 2 +--- !u!114 &-4463884970436517307 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fb60a22f311433c4c962b888d1393f88, type: 3} + m_Name: PaniniProjection + m_EditorClassIdentifier: + active: 1 + distance: + m_OverrideState: 1 + m_Value: 0 + cropToFit: + m_OverrideState: 1 + m_Value: 1 +--- !u!114 &-1410297666881709256 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6bd486065ce11414fa40e631affc4900, type: 3} + m_Name: ProbeVolumesOptions + m_EditorClassIdentifier: + active: 1 + normalBias: + m_OverrideState: 1 + m_Value: 0.33 + viewBias: + m_OverrideState: 1 + m_Value: 0 + scaleBiasWithMinProbeDistance: + m_OverrideState: 1 + m_Value: 0 + samplingNoise: + m_OverrideState: 1 + m_Value: 0.1 + animateSamplingNoise: + m_OverrideState: 1 + m_Value: 1 + leakReductionMode: + m_OverrideState: 1 + m_Value: 1 + minValidDotProductValue: + m_OverrideState: 1 + m_Value: 0.1 + occlusionOnlyReflectionNormalization: + m_OverrideState: 1 + m_Value: 1 + intensityMultiplier: + m_OverrideState: 1 + m_Value: 1 + skyOcclusionIntensityMultiplier: + m_OverrideState: 1 + m_Value: 1 +--- !u!114 &-1216621516061285780 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3} + m_Name: Bloom + m_EditorClassIdentifier: + active: 1 + skipIterations: + m_OverrideState: 1 + m_Value: 1 + threshold: + m_OverrideState: 1 + m_Value: 0.9 + intensity: + m_OverrideState: 1 + m_Value: 0 + scatter: + m_OverrideState: 1 + m_Value: 0.7 + clamp: + m_OverrideState: 1 + m_Value: 65472 + tint: + m_OverrideState: 1 + m_Value: {r: 1, g: 1, b: 1, a: 1} + highQualityFiltering: + m_OverrideState: 1 + m_Value: 0 + downscale: + m_OverrideState: 1 + m_Value: 0 + maxIterations: + m_OverrideState: 1 + m_Value: 6 + dirtTexture: + m_OverrideState: 1 + m_Value: {fileID: 0} + dimension: 1 + dirtIntensity: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &-1170528603972255243 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 221518ef91623a7438a71fef23660601, type: 3} + m_Name: WhiteBalance + m_EditorClassIdentifier: + active: 1 + temperature: + m_OverrideState: 1 + m_Value: 0 + tint: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &-581120513425526550 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: CopyPasteTestComponent3 + m_EditorClassIdentifier: Unity.RenderPipelines.Core.Editor.Tests:UnityEditor.Rendering.Tests:VolumeComponentCopyPasteTests/CopyPasteTestComponent3 + active: 1 + p1: + m_OverrideState: 1 + m_Value: 0 + p2: + m_OverrideState: 1 + m_Value: 0 + p31: + m_OverrideState: 1 + m_Value: {r: 0, g: 0, b: 0, a: 1} +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: DefaultVolumeProfile + m_EditorClassIdentifier: + components: + - {fileID: -9167874883656233139} + - {fileID: 1918650496244738858} + - {fileID: 853819529557874667} + - {fileID: 1052315754049611418} + - {fileID: -1170528603972255243} + - {fileID: -8270506406425502121} + - {fileID: -5520245016509672950} + - {fileID: 7173750748008157695} + - {fileID: 1666464333004379222} + - {fileID: 9001657382290151224} + - {fileID: -6335409530604852063} + - {fileID: -1216621516061285780} + - {fileID: 3959858460715838825} + - {fileID: -7743500325797982168} + - {fileID: 4644742534064026673} + - {fileID: -4463884970436517307} + - {fileID: -6288072647309666549} + - {fileID: 7518938298396184218} + - {fileID: -1410297666881709256} + - {fileID: -7750755424749557576} + - {fileID: -5139089513906902183} +--- !u!114 &853819529557874667 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 06437c1ff663d574d9447842ba0a72e4, type: 3} + m_Name: ScreenSpaceLensFlare + m_EditorClassIdentifier: + active: 1 + intensity: + m_OverrideState: 1 + m_Value: 0 + tintColor: + m_OverrideState: 1 + m_Value: {r: 1, g: 1, b: 1, a: 1} + bloomMip: + m_OverrideState: 1 + m_Value: 1 + firstFlareIntensity: + m_OverrideState: 1 + m_Value: 1 + secondaryFlareIntensity: + m_OverrideState: 1 + m_Value: 1 + warpedFlareIntensity: + m_OverrideState: 1 + m_Value: 1 + warpedFlareScale: + m_OverrideState: 1 + m_Value: {x: 1, y: 1} + samples: + m_OverrideState: 1 + m_Value: 1 + sampleDimmer: + m_OverrideState: 1 + m_Value: 0.5 + vignetteEffect: + m_OverrideState: 1 + m_Value: 1 + startingPosition: + m_OverrideState: 1 + m_Value: 1.25 + scale: + m_OverrideState: 1 + m_Value: 1.5 + streaksIntensity: + m_OverrideState: 1 + m_Value: 0 + streaksLength: + m_OverrideState: 1 + m_Value: 0.5 + streaksOrientation: + m_OverrideState: 1 + m_Value: 0 + streaksThreshold: + m_OverrideState: 1 + m_Value: 0.25 + resolution: + m_OverrideState: 1 + m_Value: 4 + chromaticAbberationIntensity: + m_OverrideState: 1 + m_Value: 0.5 +--- !u!114 &1052315754049611418 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 558a8e2b6826cf840aae193990ba9f2e, type: 3} + m_Name: ShadowsMidtonesHighlights + m_EditorClassIdentifier: + active: 1 + shadows: + m_OverrideState: 1 + m_Value: {x: 1, y: 1, z: 1, w: 0} + midtones: + m_OverrideState: 1 + m_Value: {x: 1, y: 1, z: 1, w: 0} + highlights: + m_OverrideState: 1 + m_Value: {x: 1, y: 1, z: 1, w: 0} + shadowsStart: + m_OverrideState: 1 + m_Value: 0 + shadowsEnd: + m_OverrideState: 1 + m_Value: 0.3 + highlightsStart: + m_OverrideState: 1 + m_Value: 0.55 + highlightsEnd: + m_OverrideState: 1 + m_Value: 1 +--- !u!114 &1666464333004379222 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3eb4b772797da9440885e8bd939e9560, type: 3} + m_Name: ColorCurves + m_EditorClassIdentifier: + active: 1 + master: + m_OverrideState: 1 + m_Value: + k__BackingField: 2 + m_Loop: 0 + m_ZeroValue: 0 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + red: + m_OverrideState: 1 + m_Value: + k__BackingField: 2 + m_Loop: 0 + m_ZeroValue: 0 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + green: + m_OverrideState: 1 + m_Value: + k__BackingField: 2 + m_Loop: 0 + m_ZeroValue: 0 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + blue: + m_OverrideState: 1 + m_Value: + k__BackingField: 2 + m_Loop: 0 + m_ZeroValue: 0 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + hueVsHue: + m_OverrideState: 1 + m_Value: + k__BackingField: 0 + m_Loop: 1 + m_ZeroValue: 0.5 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + hueVsSat: + m_OverrideState: 1 + m_Value: + k__BackingField: 0 + m_Loop: 1 + m_ZeroValue: 0.5 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + satVsSat: + m_OverrideState: 1 + m_Value: + k__BackingField: 0 + m_Loop: 0 + m_ZeroValue: 0.5 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + lumVsSat: + m_OverrideState: 1 + m_Value: + k__BackingField: 0 + m_Loop: 0 + m_ZeroValue: 0.5 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!114 &1918650496244738858 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e021b4c809a781e468c2988c016ebbea, type: 3} + m_Name: ColorLookup + m_EditorClassIdentifier: + active: 1 + texture: + m_OverrideState: 1 + m_Value: {fileID: 0} + dimension: 1 + contribution: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &3959858460715838825 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c01700fd266d6914ababb731e09af2eb, type: 3} + m_Name: DepthOfField + m_EditorClassIdentifier: + active: 1 + mode: + m_OverrideState: 1 + m_Value: 0 + gaussianStart: + m_OverrideState: 1 + m_Value: 10 + gaussianEnd: + m_OverrideState: 1 + m_Value: 30 + gaussianMaxRadius: + m_OverrideState: 1 + m_Value: 1 + highQualitySampling: + m_OverrideState: 1 + m_Value: 0 + focusDistance: + m_OverrideState: 1 + m_Value: 10 + aperture: + m_OverrideState: 1 + m_Value: 5.6 + focalLength: + m_OverrideState: 1 + m_Value: 50 + bladeCount: + m_OverrideState: 1 + m_Value: 5 + bladeCurvature: + m_OverrideState: 1 + m_Value: 1 + bladeRotation: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &4251301726029935498 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 74955a4b0b4243bc87231e8b59ed9140, type: 3} + m_Name: TestVolume + m_EditorClassIdentifier: + active: 1 + param: + m_OverrideState: 1 + m_Value: 123 +--- !u!114 &4644742534064026673 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 81180773991d8724ab7f2d216912b564, type: 3} + m_Name: ChromaticAberration + m_EditorClassIdentifier: + active: 1 + intensity: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &6940869943325143175 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: VolumeComponentSupportedOnAnySRP + m_EditorClassIdentifier: Unity.RenderPipelines.Core.Editor.Tests:UnityEngine.Rendering.Tests:VolumeComponentEditorSupportedOnTests/VolumeComponentSupportedOnAnySRP + active: 1 +--- !u!114 &7173750748008157695 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 899c54efeace73346a0a16faa3afe726, type: 3} + m_Name: Vignette + m_EditorClassIdentifier: + active: 1 + color: + m_OverrideState: 1 + m_Value: {r: 0, g: 0, b: 0, a: 1} + center: + m_OverrideState: 1 + m_Value: {x: 0.5, y: 0.5} + intensity: + m_OverrideState: 1 + m_Value: 0 + smoothness: + m_OverrideState: 1 + m_Value: 0.2 + rounded: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &7518938298396184218 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c5e1dc532bcb41949b58bc4f2abfbb7e, type: 3} + m_Name: LensDistortion + m_EditorClassIdentifier: + active: 1 + intensity: + m_OverrideState: 1 + m_Value: 0 + xMultiplier: + m_OverrideState: 1 + m_Value: 1 + yMultiplier: + m_OverrideState: 1 + m_Value: 1 + center: + m_OverrideState: 1 + m_Value: {x: 0.5, y: 0.5} + scale: + m_OverrideState: 1 + m_Value: 1 +--- !u!114 &9001657382290151224 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cdfbdbb87d3286943a057f7791b43141, type: 3} + m_Name: ChannelMixer + m_EditorClassIdentifier: + active: 1 + redOutRedIn: + m_OverrideState: 1 + m_Value: 100 + redOutGreenIn: + m_OverrideState: 1 + m_Value: 0 + redOutBlueIn: + m_OverrideState: 1 + m_Value: 0 + greenOutRedIn: + m_OverrideState: 1 + m_Value: 0 + greenOutGreenIn: + m_OverrideState: 1 + m_Value: 100 + greenOutBlueIn: + m_OverrideState: 1 + m_Value: 0 + blueOutRedIn: + m_OverrideState: 1 + m_Value: 0 + blueOutGreenIn: + m_OverrideState: 1 + m_Value: 0 + blueOutBlueIn: + m_OverrideState: 1 + m_Value: 100 +--- !u!114 &9122958982931076880 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: CopyPasteTestComponent1 + m_EditorClassIdentifier: Unity.RenderPipelines.Core.Editor.Tests:UnityEditor.Rendering.Tests:VolumeComponentCopyPasteTests/CopyPasteTestComponent1 + active: 1 + p1: + m_OverrideState: 1 + m_Value: 0 + p2: + m_OverrideState: 1 + m_Value: 0 diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/DefaultVolumeProfile.asset.meta b/Experimental/DistributedAuthoritySample/Assets/Settings/DefaultVolumeProfile.asset.meta new file mode 100644 index 000000000..53b314adf --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/DefaultVolumeProfile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab09877e2e707104187f6f83e2f62510 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_RPAsset.asset b/Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_RPAsset.asset new file mode 100644 index 000000000..0fdefd13e --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_RPAsset.asset @@ -0,0 +1,135 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3} + m_Name: Mobile_RPAsset + m_EditorClassIdentifier: + k_AssetVersion: 12 + k_AssetPreviousVersion: 12 + m_RendererType: 1 + m_RendererData: {fileID: 0} + m_RendererDataList: + - {fileID: 11400000, guid: 65bc7dbf4170f435aa868c779acfb082, type: 2} + m_DefaultRendererIndex: 0 + m_RequireDepthTexture: 0 + m_RequireOpaqueTexture: 0 + m_OpaqueDownsampling: 0 + m_SupportsTerrainHoles: 1 + m_SupportsHDR: 1 + m_HDRColorBufferPrecision: 0 + m_MSAA: 1 + m_RenderScale: 0.8 + m_UpscalingFilter: 3 + m_FsrOverrideSharpness: 0 + m_FsrSharpness: 0.92 + m_EnableLODCrossFade: 1 + m_LODCrossFadeDitheringType: 1 + m_ShEvalMode: 0 + m_LightProbeSystem: 0 + m_ProbeVolumeMemoryBudget: 1024 + m_ProbeVolumeBlendingMemoryBudget: 256 + m_SupportProbeVolumeGPUStreaming: 0 + m_SupportProbeVolumeDiskStreaming: 0 + m_SupportProbeVolumeScenarios: 0 + m_SupportProbeVolumeScenarioBlending: 0 + m_ProbeVolumeSHBands: 1 + m_MainLightRenderingMode: 1 + m_MainLightShadowsSupported: 1 + m_MainLightShadowmapResolution: 1024 + m_AdditionalLightsRenderingMode: 1 + m_AdditionalLightsPerObjectLimit: 4 + m_AdditionalLightShadowsSupported: 0 + m_AdditionalLightsShadowmapResolution: 2048 + m_AdditionalLightsShadowResolutionTierLow: 256 + m_AdditionalLightsShadowResolutionTierMedium: 512 + m_AdditionalLightsShadowResolutionTierHigh: 1024 + m_ReflectionProbeBlending: 1 + m_ReflectionProbeBoxProjection: 1 + m_ShadowDistance: 50 + m_ShadowCascadeCount: 1 + m_Cascade2Split: 0.25 + m_Cascade3Split: {x: 0.1, y: 0.3} + m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} + m_CascadeBorder: 0.2 + m_ShadowDepthBias: 1 + m_ShadowNormalBias: 1 + m_AnyShadowsSupported: 1 + m_SoftShadowsSupported: 0 + m_ConservativeEnclosingSphere: 1 + m_NumIterationsEnclosingSphere: 64 + m_SoftShadowQuality: 2 + m_AdditionalLightsCookieResolution: 1024 + m_AdditionalLightsCookieFormat: 1 + m_UseSRPBatcher: 1 + m_SupportsDynamicBatching: 0 + m_MixedLightingSupported: 1 + m_SupportsLightCookies: 1 + m_SupportsLightLayers: 1 + m_DebugLevel: 0 + m_StoreActionsOptimization: 0 + m_UseAdaptivePerformance: 1 + m_ColorGradingMode: 0 + m_ColorGradingLutSize: 32 + m_UseFastSRGBLinearConversion: 1 + m_SupportDataDrivenLensFlare: 1 + m_SupportScreenSpaceLensFlare: 1 + m_GPUResidentDrawerMode: 0 + m_UseLegacyLightmaps: 0 + m_SmallMeshScreenPercentage: 0 + m_GPUResidentDrawerEnableOcclusionCullingInCameras: 0 + m_ShadowType: 1 + m_LocalShadowsSupported: 0 + m_LocalShadowsAtlasResolution: 256 + m_MaxPixelLights: 0 + m_ShadowAtlasResolution: 256 + m_VolumeFrameworkUpdateMode: 0 + m_VolumeProfile: {fileID: 11400000, guid: 10fc4df2da32a41aaa32d77bc913491c, type: 2} + apvScenesData: + obsoleteSceneBounds: + m_Keys: [] + m_Values: [] + obsoleteHasProbeVolumes: + m_Keys: [] + m_Values: + m_PrefilteringModeMainLightShadows: 3 + m_PrefilteringModeAdditionalLight: 4 + m_PrefilteringModeAdditionalLightShadows: 0 + m_PrefilterXRKeywords: 1 + m_PrefilteringModeForwardPlus: 1 + m_PrefilteringModeDeferredRendering: 0 + m_PrefilteringModeScreenSpaceOcclusion: 0 + m_PrefilterDebugKeywords: 1 + m_PrefilterWriteRenderingLayers: 1 + m_PrefilterHDROutput: 1 + m_PrefilterSSAODepthNormals: 1 + m_PrefilterSSAOSourceDepthLow: 1 + m_PrefilterSSAOSourceDepthMedium: 0 + m_PrefilterSSAOSourceDepthHigh: 1 + m_PrefilterSSAOInterleaved: 0 + m_PrefilterSSAOBlueNoise: 1 + m_PrefilterSSAOSampleCountLow: 1 + m_PrefilterSSAOSampleCountMedium: 0 + m_PrefilterSSAOSampleCountHigh: 1 + m_PrefilterDBufferMRT1: 1 + m_PrefilterDBufferMRT2: 1 + m_PrefilterDBufferMRT3: 1 + m_PrefilterSoftShadowsQualityLow: 1 + m_PrefilterSoftShadowsQualityMedium: 1 + m_PrefilterSoftShadowsQualityHigh: 1 + m_PrefilterSoftShadows: 0 + m_PrefilterScreenCoord: 1 + m_PrefilterNativeRenderPass: 1 + m_PrefilterUseLegacyLightmaps: 0 + m_ShaderVariantLogLevel: 0 + m_ShadowCascades: 0 + m_Textures: + blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3} + bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3} diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_RPAsset.asset.meta b/Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_RPAsset.asset.meta new file mode 100644 index 000000000..3660d1516 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_RPAsset.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5e6cbd92db86f4b18aec3ed561671858 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_Renderer.asset b/Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_Renderer.asset new file mode 100644 index 000000000..01e59d469 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_Renderer.asset @@ -0,0 +1,66 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} + m_Name: Mobile_Renderer + m_EditorClassIdentifier: + debugShaders: + debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, + type: 3} + hdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3} + probeVolumeSamplingDebugComputeShader: {fileID: 7200000, guid: 53626a513ea68ce47b59dc1299fe3959, + type: 3} + probeVolumeResources: + probeVolumeDebugShader: {fileID: 0} + probeVolumeFragmentationDebugShader: {fileID: 0} + probeVolumeOffsetDebugShader: {fileID: 0} + probeVolumeSamplingDebugShader: {fileID: 0} + probeSamplingDebugMesh: {fileID: 0} + probeSamplingDebugTexture: {fileID: 0} + probeVolumeBlendStatesCS: {fileID: 0} + m_RendererFeatures: [] + m_RendererFeatureMap: + m_UseNativeRenderPass: 1 + postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} + m_AssetVersion: 2 + m_OpaqueLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_TransparentLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_DefaultStencilState: + overrideStencilState: 0 + stencilReference: 0 + stencilCompareFunction: 8 + passOperation: 2 + failOperation: 0 + zFailOperation: 0 + m_ShadowTransparentReceive: 0 + m_RenderingMode: 2 + m_DepthPrimingMode: 0 + m_CopyDepthMode: 0 + m_AccurateGbufferNormals: 0 + m_IntermediateTextureMode: 0 +--- !u!114 &1002035807535710140 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a0ec52cecc795714f93f274c2e71e87b, type: 3} + m_Name: GlobalVolumeFeature + m_EditorClassIdentifier: + m_Active: 1 + _baseProfile: {fileID: 11400000, guid: f2d4d916a6612574cad220d125febbf2, type: 2} diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_Renderer.asset.meta b/Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_Renderer.asset.meta new file mode 100644 index 000000000..a3588b1a9 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/Mobile_Renderer.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 65bc7dbf4170f435aa868c779acfb082 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/PC_RPAsset.asset b/Experimental/DistributedAuthoritySample/Assets/Settings/PC_RPAsset.asset new file mode 100644 index 000000000..8b30a060d --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/PC_RPAsset.asset @@ -0,0 +1,135 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3} + m_Name: PC_RPAsset + m_EditorClassIdentifier: + k_AssetVersion: 12 + k_AssetPreviousVersion: 12 + m_RendererType: 1 + m_RendererData: {fileID: 0} + m_RendererDataList: + - {fileID: 11400000, guid: f288ae1f4751b564a96ac7587541f7a2, type: 2} + m_DefaultRendererIndex: 0 + m_RequireDepthTexture: 1 + m_RequireOpaqueTexture: 1 + m_OpaqueDownsampling: 1 + m_SupportsTerrainHoles: 1 + m_SupportsHDR: 1 + m_HDRColorBufferPrecision: 0 + m_MSAA: 1 + m_RenderScale: 1 + m_UpscalingFilter: 0 + m_FsrOverrideSharpness: 0 + m_FsrSharpness: 0.92 + m_EnableLODCrossFade: 1 + m_LODCrossFadeDitheringType: 1 + m_ShEvalMode: 0 + m_LightProbeSystem: 0 + m_ProbeVolumeMemoryBudget: 1024 + m_ProbeVolumeBlendingMemoryBudget: 256 + m_SupportProbeVolumeGPUStreaming: 0 + m_SupportProbeVolumeDiskStreaming: 0 + m_SupportProbeVolumeScenarios: 0 + m_SupportProbeVolumeScenarioBlending: 0 + m_ProbeVolumeSHBands: 1 + m_MainLightRenderingMode: 1 + m_MainLightShadowsSupported: 1 + m_MainLightShadowmapResolution: 2048 + m_AdditionalLightsRenderingMode: 1 + m_AdditionalLightsPerObjectLimit: 4 + m_AdditionalLightShadowsSupported: 1 + m_AdditionalLightsShadowmapResolution: 2048 + m_AdditionalLightsShadowResolutionTierLow: 256 + m_AdditionalLightsShadowResolutionTierMedium: 512 + m_AdditionalLightsShadowResolutionTierHigh: 1024 + m_ReflectionProbeBlending: 1 + m_ReflectionProbeBoxProjection: 1 + m_ShadowDistance: 50 + m_ShadowCascadeCount: 4 + m_Cascade2Split: 0.25 + m_Cascade3Split: {x: 0.1, y: 0.3} + m_Cascade4Split: {x: 0.12299999, y: 0.2926, z: 0.53599995} + m_CascadeBorder: 0.107758604 + m_ShadowDepthBias: 0.1 + m_ShadowNormalBias: 0.5 + m_AnyShadowsSupported: 1 + m_SoftShadowsSupported: 1 + m_ConservativeEnclosingSphere: 1 + m_NumIterationsEnclosingSphere: 64 + m_SoftShadowQuality: 3 + m_AdditionalLightsCookieResolution: 2048 + m_AdditionalLightsCookieFormat: 3 + m_UseSRPBatcher: 1 + m_SupportsDynamicBatching: 0 + m_MixedLightingSupported: 1 + m_SupportsLightCookies: 1 + m_SupportsLightLayers: 1 + m_DebugLevel: 0 + m_StoreActionsOptimization: 0 + m_UseAdaptivePerformance: 1 + m_ColorGradingMode: 0 + m_ColorGradingLutSize: 32 + m_UseFastSRGBLinearConversion: 0 + m_SupportDataDrivenLensFlare: 1 + m_SupportScreenSpaceLensFlare: 1 + m_GPUResidentDrawerMode: 0 + m_UseLegacyLightmaps: 0 + m_SmallMeshScreenPercentage: 0 + m_GPUResidentDrawerEnableOcclusionCullingInCameras: 0 + m_ShadowType: 1 + m_LocalShadowsSupported: 0 + m_LocalShadowsAtlasResolution: 256 + m_MaxPixelLights: 0 + m_ShadowAtlasResolution: 256 + m_VolumeFrameworkUpdateMode: 0 + m_VolumeProfile: {fileID: 11400000, guid: 10fc4df2da32a41aaa32d77bc913491c, type: 2} + apvScenesData: + obsoleteSceneBounds: + m_Keys: [] + m_Values: [] + obsoleteHasProbeVolumes: + m_Keys: [] + m_Values: + m_PrefilteringModeMainLightShadows: 3 + m_PrefilteringModeAdditionalLight: 4 + m_PrefilteringModeAdditionalLightShadows: 0 + m_PrefilterXRKeywords: 1 + m_PrefilteringModeForwardPlus: 1 + m_PrefilteringModeDeferredRendering: 0 + m_PrefilteringModeScreenSpaceOcclusion: 1 + m_PrefilterDebugKeywords: 1 + m_PrefilterWriteRenderingLayers: 0 + m_PrefilterHDROutput: 1 + m_PrefilterSSAODepthNormals: 0 + m_PrefilterSSAOSourceDepthLow: 1 + m_PrefilterSSAOSourceDepthMedium: 1 + m_PrefilterSSAOSourceDepthHigh: 1 + m_PrefilterSSAOInterleaved: 1 + m_PrefilterSSAOBlueNoise: 0 + m_PrefilterSSAOSampleCountLow: 1 + m_PrefilterSSAOSampleCountMedium: 0 + m_PrefilterSSAOSampleCountHigh: 1 + m_PrefilterDBufferMRT1: 1 + m_PrefilterDBufferMRT2: 1 + m_PrefilterDBufferMRT3: 0 + m_PrefilterSoftShadowsQualityLow: 0 + m_PrefilterSoftShadowsQualityMedium: 0 + m_PrefilterSoftShadowsQualityHigh: 0 + m_PrefilterSoftShadows: 0 + m_PrefilterScreenCoord: 1 + m_PrefilterNativeRenderPass: 1 + m_PrefilterUseLegacyLightmaps: 0 + m_ShaderVariantLogLevel: 0 + m_ShadowCascades: 0 + m_Textures: + blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3} + bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3} diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/PC_RPAsset.asset.meta b/Experimental/DistributedAuthoritySample/Assets/Settings/PC_RPAsset.asset.meta new file mode 100644 index 000000000..e286b2fdd --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/PC_RPAsset.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4b83569d67af61e458304325a23e5dfd +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/PC_Renderer.asset b/Experimental/DistributedAuthoritySample/Assets/Settings/PC_Renderer.asset new file mode 100644 index 000000000..475b02e55 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/PC_Renderer.asset @@ -0,0 +1,95 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} + m_Name: PC_Renderer + m_EditorClassIdentifier: + debugShaders: + debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, + type: 3} + hdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3} + probeVolumeSamplingDebugComputeShader: {fileID: 7200000, guid: 53626a513ea68ce47b59dc1299fe3959, + type: 3} + probeVolumeResources: + probeVolumeDebugShader: {fileID: 4800000, guid: e5c6678ed2aaa91408dd3df699057aae, + type: 3} + probeVolumeFragmentationDebugShader: {fileID: 4800000, guid: 03cfc4915c15d504a9ed85ecc404e607, + type: 3} + probeVolumeOffsetDebugShader: {fileID: 4800000, guid: 53a11f4ebaebf4049b3638ef78dc9664, + type: 3} + probeVolumeSamplingDebugShader: {fileID: 4800000, guid: 8f96cd657dc40064aa21efcc7e50a2e7, + type: 3} + probeSamplingDebugMesh: {fileID: -3555484719484374845, guid: 57d7c4c16e2765b47a4d2069b311bffe, + type: 3} + probeSamplingDebugTexture: {fileID: 2800000, guid: 24ec0e140fb444a44ab96ee80844e18e, + type: 3} + probeVolumeBlendStatesCS: {fileID: 7200000, guid: b9a23f869c4fd45f19c5ada54dd82176, + type: 3} + m_RendererFeatures: + - {fileID: 7833122117494664109} + m_RendererFeatureMap: ad6b866f10d7b46c + m_UseNativeRenderPass: 1 + postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} + m_AssetVersion: 2 + m_OpaqueLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_TransparentLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_DefaultStencilState: + overrideStencilState: 0 + stencilReference: 1 + stencilCompareFunction: 3 + passOperation: 2 + failOperation: 0 + zFailOperation: 0 + m_ShadowTransparentReceive: 1 + m_RenderingMode: 2 + m_DepthPrimingMode: 0 + m_CopyDepthMode: 0 + m_AccurateGbufferNormals: 0 + m_IntermediateTextureMode: 0 +--- !u!114 &7833122117494664109 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f62c9c65cf3354c93be831c8bc075510, type: 3} + m_Name: ScreenSpaceAmbientOcclusion + m_EditorClassIdentifier: + m_Active: 1 + m_Settings: + AOMethod: 0 + Downsample: 0 + AfterOpaque: 0 + Source: 1 + NormalSamples: 1 + Intensity: 0.4 + DirectLightingStrength: 0.25 + Radius: 0.3 + Samples: 1 + BlurQuality: 0 + Falloff: 100 + SampleCount: -1 + m_BlueNoise256Textures: + - {fileID: 2800000, guid: 36f118343fc974119bee3d09e2111500, type: 3} + - {fileID: 2800000, guid: 4b7b083e6b6734e8bb2838b0b50a0bc8, type: 3} + - {fileID: 2800000, guid: c06cc21c692f94f5fb5206247191eeee, type: 3} + - {fileID: 2800000, guid: cb76dd40fa7654f9587f6a344f125c9a, type: 3} + - {fileID: 2800000, guid: e32226222ff144b24bf3a5a451de54bc, type: 3} + - {fileID: 2800000, guid: 3302065f671a8450b82c9ddf07426f3a, type: 3} + - {fileID: 2800000, guid: 56a77a3e8d64f47b6afe9e3c95cb57d5, type: 3} + m_Shader: {fileID: 4800000, guid: 0849e84e3d62649e8882e9d6f056a017, type: 3} diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/PC_Renderer.asset.meta b/Experimental/DistributedAuthoritySample/Assets/Settings/PC_Renderer.asset.meta new file mode 100644 index 000000000..ddae6a5f0 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/PC_Renderer.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f288ae1f4751b564a96ac7587541f7a2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/SampleSceneProfile.asset b/Experimental/DistributedAuthoritySample/Assets/Settings/SampleSceneProfile.asset new file mode 100644 index 000000000..c1b0f6319 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/SampleSceneProfile.asset @@ -0,0 +1,159 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-7893295128165547882 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3} + m_Name: Bloom + m_EditorClassIdentifier: + active: 1 + skipIterations: + m_OverrideState: 1 + m_Value: 0 + threshold: + m_OverrideState: 1 + m_Value: 1 + intensity: + m_OverrideState: 1 + m_Value: 0.25 + scatter: + m_OverrideState: 1 + m_Value: 0.5 + clamp: + m_OverrideState: 0 + m_Value: 65472 + tint: + m_OverrideState: 0 + m_Value: {r: 1, g: 1, b: 1, a: 1} + highQualityFiltering: + m_OverrideState: 1 + m_Value: 1 + downscale: + m_OverrideState: 0 + m_Value: 0 + maxIterations: + m_OverrideState: 0 + m_Value: 6 + dirtTexture: + m_OverrideState: 0 + m_Value: {fileID: 0} + dimension: 1 + dirtIntensity: + m_OverrideState: 0 + m_Value: 0 +--- !u!114 &-3357603926938260329 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 899c54efeace73346a0a16faa3afe726, type: 3} + m_Name: Vignette + m_EditorClassIdentifier: + active: 1 + color: + m_OverrideState: 0 + m_Value: {r: 0, g: 0, b: 0, a: 1} + center: + m_OverrideState: 0 + m_Value: {x: 0.5, y: 0.5} + intensity: + m_OverrideState: 1 + m_Value: 0.2 + smoothness: + m_OverrideState: 0 + m_Value: 0.2 + rounded: + m_OverrideState: 0 + m_Value: 0 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: SampleSceneProfile + m_EditorClassIdentifier: + components: + - {fileID: 849379129802519247} + - {fileID: -7893295128165547882} + - {fileID: 7391319092446245454} + - {fileID: -3357603926938260329} +--- !u!114 &849379129802519247 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 97c23e3b12dc18c42a140437e53d3951, type: 3} + m_Name: Tonemapping + m_EditorClassIdentifier: + active: 1 + mode: + m_OverrideState: 1 + m_Value: 1 + neutralHDRRangeReductionMode: + m_OverrideState: 0 + m_Value: 2 + acesPreset: + m_OverrideState: 0 + m_Value: 3 + hueShiftAmount: + m_OverrideState: 0 + m_Value: 0 + detectPaperWhite: + m_OverrideState: 1 + m_Value: 0 + paperWhite: + m_OverrideState: 1 + m_Value: 234 + detectBrightnessLimits: + m_OverrideState: 1 + m_Value: 1 + minNits: + m_OverrideState: 1 + m_Value: 0.005 + maxNits: + m_OverrideState: 1 + m_Value: 647 +--- !u!114 &7391319092446245454 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ccf1aba9553839d41ae37dd52e9ebcce, type: 3} + m_Name: MotionBlur + m_EditorClassIdentifier: + active: 0 + mode: + m_OverrideState: 0 + m_Value: 0 + quality: + m_OverrideState: 1 + m_Value: 2 + intensity: + m_OverrideState: 1 + m_Value: 0.6 + clamp: + m_OverrideState: 0 + m_Value: 0.05 diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/SampleSceneProfile.asset.meta b/Experimental/DistributedAuthoritySample/Assets/Settings/SampleSceneProfile.asset.meta new file mode 100644 index 000000000..b82270c5b --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/SampleSceneProfile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 10fc4df2da32a41aaa32d77bc913491c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset b/Experimental/DistributedAuthoritySample/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset new file mode 100644 index 000000000..9c1a99874 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset @@ -0,0 +1,256 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2ec995e51a6e251468d2a3fd8a686257, type: 3} + m_Name: UniversalRenderPipelineGlobalSettings + m_EditorClassIdentifier: + m_ShaderStrippingSetting: + m_Version: 0 + m_ExportShaderVariants: 1 + m_ShaderVariantLogLevel: 0 + m_StripRuntimeDebugShaders: 1 + m_URPShaderStrippingSetting: + m_Version: 0 + m_StripUnusedPostProcessingVariants: 1 + m_StripUnusedVariants: 1 + m_StripScreenCoordOverrideVariants: 1 + m_ShaderVariantLogLevel: 0 + m_ExportShaderVariants: 1 + m_StripDebugVariants: 1 + m_StripUnusedPostProcessingVariants: 1 + m_StripUnusedVariants: 1 + m_StripScreenCoordOverrideVariants: 1 + supportRuntimeDebugDisplay: 0 + m_EnableRenderGraph: 0 + m_Settings: + m_SettingsList: + m_List: + - rid: 6852985685364965376 + - rid: 6852985685364965377 + - rid: 6852985685364965378 + - rid: 6852985685364965379 + - rid: 6852985685364965380 + - rid: 6852985685364965381 + - rid: 6852985685364965382 + - rid: 6852985685364965383 + - rid: 6852985685364965384 + - rid: 6852985685364965385 + - rid: 6852985685364965386 + - rid: 6852985685364965387 + - rid: 6852985685364965388 + - rid: 6852985685364965389 + - rid: 6852985685364965390 + - rid: 6852985685364965391 + - rid: 6852985685364965392 + - rid: 6852985685364965393 + - rid: 6852985685364965394 + - rid: 6794898504019345408 + - rid: 6794898504019345409 + m_RuntimeSettings: + m_List: [] + m_AssetVersion: 8 + m_ObsoleteDefaultVolumeProfile: {fileID: 0} + m_RenderingLayerNames: + - Light Layer default + - Light Layer 1 + - Light Layer 2 + - Light Layer 3 + - Light Layer 4 + - Light Layer 5 + - Light Layer 6 + - Light Layer 7 + m_ValidRenderingLayers: 0 + lightLayerName0: Light Layer default + lightLayerName1: Light Layer 1 + lightLayerName2: Light Layer 2 + lightLayerName3: Light Layer 3 + lightLayerName4: Light Layer 4 + lightLayerName5: Light Layer 5 + lightLayerName6: Light Layer 6 + lightLayerName7: Light Layer 7 + apvScenesData: + obsoleteSceneBounds: + m_Keys: [] + m_Values: [] + obsoleteHasProbeVolumes: + m_Keys: [] + m_Values: + references: + version: 2 + RefIds: + - rid: 6794898504019345408 + type: {class: UniversalRenderPipelineRuntimeXRResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} + data: + m_xrOcclusionMeshPS: {fileID: 4800000, guid: 4431b1f1f743fbf4eb310a967890cbea, type: 3} + m_xrMirrorViewPS: {fileID: 4800000, guid: d5a307c014552314b9f560906d708772, type: 3} + m_xrMotionVector: {fileID: 4800000, guid: f89aac1e4f84468418fe30e611dff395, type: 3} + - rid: 6794898504019345409 + type: {class: RenderGraphUtilsResources, ns: UnityEngine.Rendering.RenderGraphModule.Util, asm: Unity.RenderPipelines.Core.Runtime} + data: + m_Version: 0 + m_CoreCopyPS: {fileID: 4800000, guid: 12dc59547ea167a4ab435097dd0f9add, type: 3} + - rid: 6852985685364965376 + type: {class: URPShaderStrippingSetting, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} + data: + m_Version: 0 + m_StripUnusedPostProcessingVariants: 1 + m_StripUnusedVariants: 1 + m_StripScreenCoordOverrideVariants: 1 + - rid: 6852985685364965377 + type: {class: UniversalRenderPipelineEditorShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} + data: + m_AutodeskInteractive: {fileID: 4800000, guid: 0e9d5a909a1f7e84882a534d0d11e49f, type: 3} + m_AutodeskInteractiveTransparent: {fileID: 4800000, guid: 5c81372d981403744adbdda4433c9c11, type: 3} + m_AutodeskInteractiveMasked: {fileID: 4800000, guid: 80aa867ac363ac043847b06ad71604cd, type: 3} + m_TerrainDetailLit: {fileID: 4800000, guid: f6783ab646d374f94b199774402a5144, type: 3} + m_TerrainDetailGrassBillboard: {fileID: 4800000, guid: 29868e73b638e48ca99a19ea58c48d90, type: 3} + m_TerrainDetailGrass: {fileID: 4800000, guid: e507fdfead5ca47e8b9a768b51c291a1, type: 3} + m_DefaultSpeedTree7Shader: {fileID: 4800000, guid: 0f4122b9a743b744abe2fb6a0a88868b, type: 3} + m_DefaultSpeedTree8Shader: {fileID: -6465566751694194690, guid: 9920c1f1781549a46ba081a2a15a16ec, type: 3} + m_DefaultSpeedTree9Shader: {fileID: -6465566751694194690, guid: cbd3e1cc4ae141c42a30e33b4d666a61, type: 3} + - rid: 6852985685364965378 + type: {class: UniversalRendererResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} + data: + m_Version: 0 + m_CopyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} + m_CameraMotionVector: {fileID: 4800000, guid: c56b7e0d4c7cb484e959caeeedae9bbf, type: 3} + m_StencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3} + m_DBufferClear: {fileID: 4800000, guid: f056d8bd2a1c7e44e9729144b4c70395, type: 3} + - rid: 6852985685364965379 + type: {class: UniversalRenderPipelineDebugShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} + data: + m_DebugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, type: 3} + m_HdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3} + m_ProbeVolumeSamplingDebugComputeShader: {fileID: 7200000, guid: 53626a513ea68ce47b59dc1299fe3959, type: 3} + - rid: 6852985685364965380 + type: {class: UniversalRenderPipelineRuntimeShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} + data: + m_Version: 0 + m_FallbackErrorShader: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} + m_BlitHDROverlay: {fileID: 4800000, guid: a89bee29cffa951418fc1e2da94d1959, type: 3} + m_CoreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3} + m_CoreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, type: 3} + m_SamplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} + - rid: 6852985685364965381 + type: {class: UniversalRenderPipelineRuntimeTextures, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} + data: + m_Version: 1 + m_BlueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3} + m_BayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3} + m_DebugFontTex: {fileID: 2800000, guid: 26a413214480ef144b2915d6ff4d0beb, type: 3} + - rid: 6852985685364965382 + type: {class: Renderer2DResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} + data: + m_Version: 0 + m_LightShader: {fileID: 4800000, guid: 3f6c848ca3d7bca4bbe846546ac701a1, type: 3} + m_ProjectedShadowShader: {fileID: 4800000, guid: ce09d4a80b88c5a4eb9768fab4f1ee00, type: 3} + m_SpriteShadowShader: {fileID: 4800000, guid: 44fc62292b65ab04eabcf310e799ccf6, type: 3} + m_SpriteUnshadowShader: {fileID: 4800000, guid: de02b375720b5c445afe83cd483bedf3, type: 3} + m_GeometryShadowShader: {fileID: 4800000, guid: 19349a0f9a7ed4c48a27445bcf92e5e1, type: 3} + m_GeometryUnshadowShader: {fileID: 4800000, guid: 77774d9009bb81447b048c907d4c6273, type: 3} + m_FallOffLookup: {fileID: 2800000, guid: 5688ab254e4c0634f8d6c8e0792331ca, type: 3} + m_CopyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} + m_DefaultCustomMaterial: {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_DefaultLitMaterial: {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_DefaultUnlitMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2} + m_DefaultMaskMaterial: {fileID: 2100000, guid: 15d0c3709176029428a0da2f8cecf0b5, type: 2} + - rid: 6852985685364965383 + type: {class: UniversalRenderPipelineEditorMaterials, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} + data: + m_DefaultMaterial: {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_DefaultParticleMaterial: {fileID: 2100000, guid: e823cd5b5d27c0f4b8256e7c12ee3e6d, type: 2} + m_DefaultLineMaterial: {fileID: 2100000, guid: e823cd5b5d27c0f4b8256e7c12ee3e6d, type: 2} + m_DefaultTerrainMaterial: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e, type: 2} + m_DefaultDecalMaterial: {fileID: 2100000, guid: 31d0dcc6f2dd4e4408d18036a2c93862, type: 2} + - rid: 6852985685364965384 + type: {class: URPDefaultVolumeProfileSettings, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} + data: + m_Version: 0 + m_VolumeProfile: {fileID: 11400000, guid: ab09877e2e707104187f6f83e2f62510, type: 2} + - rid: 6852985685364965385 + type: {class: RenderGraphSettings, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} + data: + m_Version: 0 + m_EnableRenderCompatibilityMode: 0 + - rid: 6852985685364965386 + type: {class: GPUResidentDrawerResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.GPUDriven.Runtime} + data: + m_Version: 0 + m_InstanceDataBufferCopyKernels: {fileID: 7200000, guid: f984aeb540ded8b4fbb8a2047ab5b2e2, type: 3} + m_InstanceDataBufferUploadKernels: {fileID: 7200000, guid: 53864816eb00f2343b60e1a2c5a262ef, type: 3} + m_TransformUpdaterKernels: {fileID: 7200000, guid: 2a567b9b2733f8d47a700c3c85bed75b, type: 3} + m_WindDataUpdaterKernels: {fileID: 7200000, guid: fde76746e4fd0ed418c224f6b4084114, type: 3} + m_OccluderDepthPyramidKernels: {fileID: 7200000, guid: 08b2b5fb307b0d249860612774a987da, type: 3} + m_InstanceOcclusionCullingKernels: {fileID: 7200000, guid: f6d223acabc2f974795a5a7864b50e6c, type: 3} + m_OcclusionCullingDebugKernels: {fileID: 7200000, guid: b23e766bcf50ca4438ef186b174557df, type: 3} + m_DebugOcclusionTestPS: {fileID: 4800000, guid: d3f0849180c2d0944bc71060693df100, type: 3} + m_DebugOccluderPS: {fileID: 4800000, guid: b3c92426a88625841ab15ca6a7917248, type: 3} + - rid: 6852985685364965387 + type: {class: STP/RuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} + data: + m_setupCS: {fileID: 7200000, guid: 33be2e9a5506b2843bdb2bdff9cad5e1, type: 3} + m_preTaaCS: {fileID: 7200000, guid: a679dba8ec4d9ce45884a270b0e22dda, type: 3} + m_taaCS: {fileID: 7200000, guid: 3923900e2b41b5e47bc25bfdcbcdc9e6, type: 3} + - rid: 6852985685364965388 + type: {class: ProbeVolumeBakingResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} + data: + m_Version: 1 + dilationShader: {fileID: 7200000, guid: 6bb382f7de370af41b775f54182e491d, type: 3} + subdivideSceneCS: {fileID: 7200000, guid: bb86f1f0af829fd45b2ebddda1245c22, type: 3} + voxelizeSceneShader: {fileID: 4800000, guid: c8b6a681c7b4e2e4785ffab093907f9e, type: 3} + traceVirtualOffsetCS: {fileID: 7200000, guid: 805f10d263aac4b4098c0279cd37a4f3, type: 3} + traceVirtualOffsetRT: {fileID: 4807578003741378534, guid: b60511f4aa1443f4d8c0b18f4fec92f4, type: 3} + skyOcclusionCS: {fileID: 7200000, guid: 798f52ec82fa04048a12826bbbbcf7b4, type: 3} + skyOcclusionRT: {fileID: 4807578003741378534, guid: dfaf42b38dd001f49a72d8102b709f29, type: 3} + renderingLayerCS: {fileID: 7200000, guid: a63c9cf933e3d8f41ae680a372784ebf, type: 3} + renderingLayerRT: {fileID: 4807578003741378534, guid: c2be09c936362eb49a58f08aeb30627a, type: 3} + - rid: 6852985685364965389 + type: {class: ProbeVolumeGlobalSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} + data: + m_Version: 1 + m_ProbeVolumeDisableStreamingAssets: 0 + - rid: 6852985685364965390 + type: {class: ProbeVolumeDebugResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} + data: + m_Version: 1 + probeVolumeDebugShader: {fileID: 4800000, guid: 3b21275fd12d65f49babb5286f040f2d, type: 3} + probeVolumeFragmentationDebugShader: {fileID: 4800000, guid: 3a80877c579b9144ebdcc6d923bca303, type: 3} + probeVolumeSamplingDebugShader: {fileID: 4800000, guid: bf54e6528c79a224e96346799064c393, type: 3} + probeVolumeOffsetDebugShader: {fileID: 4800000, guid: db8bd7436dc2c5f4c92655307d198381, type: 3} + probeSamplingDebugMesh: {fileID: -3555484719484374845, guid: 20be25aac4e22ee49a7db76fb3df6de2, type: 3} + numbersDisplayTex: {fileID: 2800000, guid: 73fe53b428c5b3440b7e87ee830b608a, type: 3} + - rid: 6852985685364965391 + type: {class: IncludeAdditionalRPAssets, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} + data: + m_version: 0 + m_IncludeReferencedInScenes: 0 + m_IncludeAssetsByLabel: 0 + m_LabelToInclude: + - rid: 6852985685364965392 + type: {class: ShaderStrippingSetting, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} + data: + m_Version: 0 + m_ExportShaderVariants: 1 + m_ShaderVariantLogLevel: 0 + m_StripRuntimeDebugShaders: 1 + - rid: 6852985685364965393 + type: {class: ProbeVolumeRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} + data: + m_Version: 1 + probeVolumeBlendStatesCS: {fileID: 7200000, guid: a3f7b8c99de28a94684cb1daebeccf5d, type: 3} + probeVolumeUploadDataCS: {fileID: 7200000, guid: 0951de5992461754fa73650732c4954c, type: 3} + probeVolumeUploadDataL2CS: {fileID: 7200000, guid: 6196f34ed825db14b81fb3eb0ea8d931, type: 3} + - rid: 6852985685364965394 + type: {class: RenderGraphGlobalSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} + data: + m_version: 0 + m_EnableCompilationCaching: 1 + m_EnableValidityChecks: 1 diff --git a/Experimental/DistributedAuthoritySample/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset.meta b/Experimental/DistributedAuthoritySample/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset.meta new file mode 100644 index 000000000..81b84f2ae --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 18dc0cd2c080841dea60987a38ce93fa +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Packages/manifest.json b/Experimental/DistributedAuthoritySample/Packages/manifest.json new file mode 100644 index 000000000..8fc5f799d --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Packages/manifest.json @@ -0,0 +1,52 @@ +{ + "dependencies": { + "com.unity.ai.navigation": "2.0.0", + "com.unity.cinemachine": "2.10.1", + "com.unity.collab-proxy": "2.4.3", + "com.unity.ide.rider": "3.0.28", + "com.unity.ide.visualstudio": "2.0.22", + "com.unity.inputsystem": "1.8.2", + "com.unity.multiplayer.playmode": "1.2.0", + "com.unity.multiplayer.tools": "2.1.0", + "com.unity.netcode.gameobjects": "https://github.com/Unity-Technologies/com.unity.netcode.gameobjects.git?path=com.unity.netcode.gameobjects#develop-2.0.0", + "com.unity.render-pipelines.universal": "17.0.3", + "com.unity.services.multiplayer": "0.4.2", + "com.unity.services.vivox": "16.3.0", + "com.unity.test-framework": "1.4.4", + "com.unity.timeline": "1.8.7", + "com.unity.ugui": "2.0.0", + "com.unity.visualscripting": "1.9.4", + "com.unity.modules.accessibility": "1.0.0", + "com.unity.modules.ai": "1.0.0", + "com.unity.modules.androidjni": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.cloth": "1.0.0", + "com.unity.modules.director": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.physics2d": "1.0.0", + "com.unity.modules.screencapture": "1.0.0", + "com.unity.modules.terrain": "1.0.0", + "com.unity.modules.terrainphysics": "1.0.0", + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.uielements": "1.0.0", + "com.unity.modules.umbra": "1.0.0", + "com.unity.modules.unityanalytics": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.unitywebrequesttexture": "1.0.0", + "com.unity.modules.unitywebrequestwww": "1.0.0", + "com.unity.modules.vehicles": "1.0.0", + "com.unity.modules.video": "1.0.0", + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.wind": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } +} diff --git a/Experimental/DistributedAuthoritySample/Packages/packages-lock.json b/Experimental/DistributedAuthoritySample/Packages/packages-lock.json new file mode 100644 index 000000000..9a3bf4c32 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Packages/packages-lock.json @@ -0,0 +1,610 @@ +{ + "dependencies": { + "com.unity.ai.navigation": { + "version": "2.0.0", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.ai": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.burst": { + "version": "1.8.16", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.mathematics": "1.2.1", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.cinemachine": { + "version": "2.10.1", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.31" + }, + "url": "https://packages.unity.com" + }, + "com.unity.collab-proxy": { + "version": "2.4.3", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.collections": { + "version": "2.4.1", + "depth": 2, + "source": "registry", + "dependencies": { + "com.unity.burst": "1.8.13", + "com.unity.nuget.mono-cecil": "1.11.4", + "com.unity.test-framework": "1.4.3", + "com.unity.test-framework.performance": "3.0.3" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ext.nunit": { + "version": "2.0.5", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.ide.rider": { + "version": "3.0.28", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ide.visualstudio": { + "version": "2.0.22", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.9" + }, + "url": "https://packages.unity.com" + }, + "com.unity.inputsystem": { + "version": "1.8.2", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.uielements": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.mathematics": { + "version": "1.3.2", + "depth": 2, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.multiplayer.playmode": { + "version": "1.2.0", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.nuget.newtonsoft-json": "2.0.2" + }, + "url": "https://packages.unity.com" + }, + "com.unity.multiplayer.tools": { + "version": "2.1.0", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.profiling.core": "1.0.0-pre.1", + "com.unity.nuget.newtonsoft-json": "2.0.0", + "com.unity.nuget.mono-cecil": "1.10.1", + "com.unity.collections": "1.1.0", + "com.unity.modules.uielements": "1.0.0", + "com.unity.burst": "1.6.6", + "com.unity.mathematics": "1.2.6" + }, + "url": "https://packages.unity.com" + }, + "com.unity.netcode.gameobjects": { + "version": "https://github.com/Unity-Technologies/com.unity.netcode.gameobjects.git?path=com.unity.netcode.gameobjects#develop-2.0.0", + "depth": 0, + "source": "git", + "dependencies": { + "com.unity.nuget.mono-cecil": "1.11.4", + "com.unity.transport": "2.2.1" + }, + "hash": "8f71c14ce4c77d482a9204a1907e7139fefef673" + }, + "com.unity.nuget.mono-cecil": { + "version": "1.11.4", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.nuget.newtonsoft-json": { + "version": "3.2.1", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.profiling.core": { + "version": "1.0.2", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.render-pipelines.core": { + "version": "17.0.3", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.burst": "1.8.14", + "com.unity.mathematics": "1.3.2", + "com.unity.ugui": "2.0.0", + "com.unity.collections": "2.4.1", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.terrain": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.rendering.light-transport": "1.0.1" + } + }, + "com.unity.render-pipelines.universal": { + "version": "17.0.3", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.render-pipelines.core": "17.0.3", + "com.unity.shadergraph": "17.0.3", + "com.unity.render-pipelines.universal-config": "17.0.3" + } + }, + "com.unity.render-pipelines.universal-config": { + "version": "17.0.3", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.render-pipelines.core": "17.0.3" + } + }, + "com.unity.rendering.light-transport": { + "version": "1.0.1", + "depth": 2, + "source": "builtin", + "dependencies": { + "com.unity.collections": "2.2.0", + "com.unity.mathematics": "1.2.4", + "com.unity.modules.terrain": "1.0.0" + } + }, + "com.unity.searcher": { + "version": "4.9.2", + "depth": 2, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.services.authentication": { + "version": "3.3.3", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.nuget.newtonsoft-json": "3.2.1", + "com.unity.services.core": "1.13.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.ugui": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.services.core": { + "version": "1.13.0", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.nuget.newtonsoft-json": "3.2.1", + "com.unity.modules.androidjni": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.services.multiplayer": { + "version": "0.4.2", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.unitywebrequesttexture": "1.0.0", + "com.unity.modules.unitywebrequestwww": "1.0.0", + "com.unity.nuget.newtonsoft-json": "3.2.1", + "com.unity.services.authentication": "3.1.0", + "com.unity.services.core": "1.12.1", + "com.unity.services.qos": "1.3.0", + "com.unity.services.wire": "1.2.3", + "com.unity.transport": "1.4.1" + }, + "url": "https://packages.unity.com" + }, + "com.unity.services.qos": { + "version": "1.3.0", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.services.core": "1.12.4", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.nuget.newtonsoft-json": "3.0.2", + "com.unity.services.authentication": "2.0.0", + "com.unity.collections": "1.2.4" + }, + "url": "https://packages.unity.com" + }, + "com.unity.services.vivox": { + "version": "16.3.0", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.settings-manager": "1.0.3", + "com.unity.services.core": "1.12.5", + "com.unity.nuget.newtonsoft-json": "3.0.2", + "com.unity.modules.audio": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.services.wire": { + "version": "1.2.6", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.services.core": "1.12.5", + "com.unity.nuget.newtonsoft-json": "3.2.1", + "com.unity.services.authentication": "2.7.4" + }, + "url": "https://packages.unity.com" + }, + "com.unity.settings-manager": { + "version": "2.0.1", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.shadergraph": { + "version": "17.0.3", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.render-pipelines.core": "17.0.3", + "com.unity.searcher": "4.9.2" + } + }, + "com.unity.test-framework": { + "version": "1.4.4", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "2.0.3", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.test-framework.performance": { + "version": "3.0.3", + "depth": 2, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.31", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.timeline": { + "version": "1.8.7", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.director": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.transport": { + "version": "2.3.0", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.collections": "2.2.1", + "com.unity.burst": "1.8.12", + "com.unity.mathematics": "1.3.1" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ugui": { + "version": "2.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0" + } + }, + "com.unity.visualscripting": { + "version": "1.9.4", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.modules.accessibility": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.ai": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.androidjni": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.animation": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.assetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.audio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.cloth": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.director": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.animation": "1.0.0" + } + }, + "com.unity.modules.hierarchycore": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.imageconversion": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.imgui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.jsonserialize": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.particlesystem": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics2d": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.screencapture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.subsystems": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.terrain": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.terrainphysics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.terrain": "1.0.0" + } + }, + "com.unity.modules.tilemap": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics2d": "1.0.0" + } + }, + "com.unity.modules.ui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.uielements": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.hierarchycore": "1.0.0" + } + }, + "com.unity.modules.umbra": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unityanalytics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.unitywebrequest": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unitywebrequestassetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestaudio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.audio": "1.0.0" + } + }, + "com.unity.modules.unitywebrequesttexture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestwww": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.vehicles": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.video": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.vr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } + }, + "com.unity.modules.wind": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.xr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.subsystems": "1.0.0" + } + } + } +} diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/AudioManager.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/AudioManager.asset new file mode 100644 index 000000000..27287fec5 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/AudioManager.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!11 &1 +AudioManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Volume: 1 + Rolloff Scale: 1 + Doppler Factor: 1 + Default Speaker Mode: 2 + m_SampleRate: 0 + m_DSPBufferSize: 1024 + m_VirtualVoiceCount: 512 + m_RealVoiceCount: 32 + m_SpatializerPlugin: + m_AmbisonicDecoderPlugin: + m_DisableAudio: 0 + m_VirtualizeEffects: 1 + m_RequestedDSPBufferSize: 0 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/ClusterInputManager.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 000000000..e7886b266 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/ClusterInputManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!236 &1 +ClusterInputManager: + m_ObjectHideFlags: 0 + m_Inputs: [] diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/DynamicsManager.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/DynamicsManager.asset new file mode 100644 index 000000000..b644d1511 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/DynamicsManager.asset @@ -0,0 +1,37 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!55 &1 +PhysicsManager: + m_ObjectHideFlags: 0 + serializedVersion: 17 + m_Gravity: {x: 0, y: -9.81, z: 0} + m_DefaultMaterial: {fileID: 0} + m_BounceThreshold: 2 + m_DefaultMaxDepenetrationVelocity: 10 + m_SleepThreshold: 0.005 + m_DefaultContactOffset: 0.01 + m_DefaultSolverIterations: 6 + m_DefaultSolverVelocityIterations: 1 + m_QueriesHitBackfaces: 0 + m_QueriesHitTriggers: 1 + m_EnableAdaptiveForce: 0 + m_ClothInterCollisionDistance: 0.1 + m_ClothInterCollisionStiffness: 0.2 + m_LayerCollisionMatrix: bfffffffbfffffffbfffffffffffffffbfffffffbfffffff08ffffffbfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_SimulationMode: 0 + m_AutoSyncTransforms: 0 + m_ReuseCollisionCallbacks: 1 + m_InvokeCollisionCallbacks: 1 + m_ClothInterCollisionSettingsToggle: 0 + m_ClothGravity: {x: 0, y: -9.81, z: 0} + m_ContactPairsMode: 0 + m_BroadphaseType: 0 + m_FrictionType: 0 + m_EnableEnhancedDeterminism: 0 + m_EnableUnifiedHeightmaps: 1 + m_ImprovedPatchFriction: 0 + m_SolverType: 0 + m_DefaultMaxAngularSpeed: 50 + m_ScratchBufferChunkCount: 4 + m_CurrentBackendId: 4072204805 + m_FastMotionThreshold: 3.4028235e+38 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/EditorBuildSettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/EditorBuildSettings.asset new file mode 100644 index 000000000..067649b9f --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/EditorBuildSettings.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1045 &1 +EditorBuildSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Scenes: + - enabled: 1 + path: Assets/Scenes/Bootstrap.unity + guid: 7534441b329644ec98e40c12ec5e3575 + - enabled: 1 + path: Assets/Scenes/MainMenu.unity + guid: 00dfb9d65b7674d4cae5dfd318611cbe + - enabled: 1 + path: Assets/Scenes/HubScene.unity + guid: 99c9720ab356a0642a771bea13969a05 + m_configObjects: + com.unity.input.settings: {fileID: 11400000, guid: 9e7be553448fa2546aea5752021cbcf7, type: 2} + com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 7b30a29548072524e9f8362bcbe40502, type: 3} + m_UseUCBPForAssetBundles: 0 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/EditorSettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/EditorSettings.asset new file mode 100644 index 000000000..d85f86bce --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/EditorSettings.asset @@ -0,0 +1,48 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!159 &1 +EditorSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_SerializationMode: 2 + m_LineEndingsForNewScripts: 0 + m_DefaultBehaviorMode: 0 + m_PrefabRegularEnvironment: {fileID: 0} + m_PrefabUIEnvironment: {fileID: 0} + m_SpritePackerMode: 0 + m_SpritePackerCacheSize: 10 + m_SpritePackerPaddingPower: 1 + m_Bc7TextureCompressor: 0 + m_EtcTextureCompressorBehavior: 1 + m_EtcTextureFastCompressor: 1 + m_EtcTextureNormalCompressor: 2 + m_EtcTextureBestCompressor: 4 + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref + m_ProjectGenerationRootNamespace: + m_EnableTextureStreamingInEditMode: 1 + m_EnableTextureStreamingInPlayMode: 1 + m_EnableEditorAsyncCPUTextureLoading: 0 + m_AsyncShaderCompilation: 1 + m_PrefabModeAllowAutoSave: 1 + m_EnterPlayModeOptionsEnabled: 1 + m_EnterPlayModeOptions: 0 + m_GameObjectNamingDigits: 1 + m_GameObjectNamingScheme: 0 + m_AssetNamingUsesSpace: 1 + m_InspectorUseIMGUIDefaultInspector: 0 + m_UseLegacyProbeSampleCount: 0 + m_SerializeInlineMappingsOnOneLine: 1 + m_DisableCookiesInLightmapper: 0 + m_AssetPipelineMode: 1 + m_RefreshImportMode: 0 + m_CacheServerMode: 0 + m_CacheServerEndpoint: + m_CacheServerNamespacePrefix: default + m_CacheServerEnableDownload: 1 + m_CacheServerEnableUpload: 1 + m_CacheServerEnableAuth: 0 + m_CacheServerEnableTls: 0 + m_CacheServerValidationMode: 2 + m_CacheServerDownloadBatchSize: 128 + m_EnableEnlightenBakedGI: 0 + m_ReferencedClipsExactNaming: 1 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/GraphicsSettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/GraphicsSettings.asset new file mode 100644 index 000000000..aa5a1c3e3 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/GraphicsSettings.asset @@ -0,0 +1,70 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!30 &1 +GraphicsSettings: + m_ObjectHideFlags: 0 + serializedVersion: 16 + m_Deferred: + m_Mode: 1 + m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} + m_DeferredReflections: + m_Mode: 1 + m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} + m_ScreenSpaceShadows: + m_Mode: 1 + m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} + m_DepthNormals: + m_Mode: 1 + m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} + m_MotionVectors: + m_Mode: 1 + m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} + m_LightHalo: + m_Mode: 1 + m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} + m_LensFlare: + m_Mode: 1 + m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} + m_VideoShadersIncludeMode: 2 + m_AlwaysIncludedShaders: + - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} + m_PreloadedShaders: [] + m_PreloadShadersBatchTimeLimit: -1 + m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, + type: 0} + m_CustomRenderPipeline: {fileID: 11400000, guid: 4b83569d67af61e458304325a23e5dfd, + type: 2} + m_TransparencySortMode: 0 + m_TransparencySortAxis: {x: 0, y: 0, z: 1} + m_DefaultRenderingPath: 1 + m_DefaultMobileRenderingPath: 1 + m_TierSettings: [] + m_LightmapStripping: 0 + m_FogStripping: 0 + m_InstancingStripping: 0 + m_BrgStripping: 0 + m_LightmapKeepPlain: 1 + m_LightmapKeepDirCombined: 1 + m_LightmapKeepDynamicPlain: 1 + m_LightmapKeepDynamicDirCombined: 1 + m_LightmapKeepShadowMask: 1 + m_LightmapKeepSubtractive: 1 + m_FogKeepLinear: 1 + m_FogKeepExp: 1 + m_FogKeepExp2: 1 + m_AlbedoSwatchInfos: [] + m_RenderPipelineGlobalSettingsMap: + UnityEngine.Rendering.Universal.UniversalRenderPipeline: {fileID: 11400000, guid: 18dc0cd2c080841dea60987a38ce93fa, + type: 2} + m_LightsUseLinearIntensity: 1 + m_LightsUseColorTemperature: 1 + m_LogWhenShaderIsCompiled: 0 + m_LightProbeOutsideHullStrategy: 0 + m_CameraRelativeLightCulling: 0 + m_CameraRelativeShadowCulling: 0 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/InputManager.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/InputManager.asset new file mode 100644 index 000000000..b16147e95 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/InputManager.asset @@ -0,0 +1,487 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!13 &1 +InputManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Axes: + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: a + altPositiveButton: d + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: s + altPositiveButton: w + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left ctrl + altNegativeButton: + altPositiveButton: mouse 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left alt + altNegativeButton: + altPositiveButton: mouse 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left shift + altNegativeButton: + altPositiveButton: mouse 2 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: space + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse X + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse Y + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse ScrollWheel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 2 + joyNum: 0 + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 1 + type: 2 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 0 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 1 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 2 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 3 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: return + altNegativeButton: + altPositiveButton: joystick button 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: enter + altNegativeButton: + altPositiveButton: space + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Cancel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: escape + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Enable Debug Button 1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left ctrl + altNegativeButton: + altPositiveButton: joystick button 8 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Enable Debug Button 2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: backspace + altNegativeButton: + altPositiveButton: joystick button 9 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Reset + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left alt + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Next + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: page down + altNegativeButton: + altPositiveButton: joystick button 5 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Previous + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: page up + altNegativeButton: + altPositiveButton: joystick button 4 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Validate + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: return + altNegativeButton: + altPositiveButton: joystick button 0 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Persistent + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: right shift + altNegativeButton: + altPositiveButton: joystick button 2 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Multiplier + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left shift + altNegativeButton: + altPositiveButton: joystick button 3 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 2 + axis: 6 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 2 + axis: 5 + joyNum: 0 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/MemorySettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/MemorySettings.asset new file mode 100644 index 000000000..5b5faceca --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/MemorySettings.asset @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!387306366 &1 +MemorySettings: + m_ObjectHideFlags: 0 + m_EditorMemorySettings: + m_MainAllocatorBlockSize: -1 + m_ThreadAllocatorBlockSize: -1 + m_MainGfxBlockSize: -1 + m_ThreadGfxBlockSize: -1 + m_CacheBlockSize: -1 + m_TypetreeBlockSize: -1 + m_ProfilerBlockSize: -1 + m_ProfilerEditorBlockSize: -1 + m_BucketAllocatorGranularity: -1 + m_BucketAllocatorBucketsCount: -1 + m_BucketAllocatorBlockSize: -1 + m_BucketAllocatorBlockCount: -1 + m_ProfilerBucketAllocatorGranularity: -1 + m_ProfilerBucketAllocatorBucketsCount: -1 + m_ProfilerBucketAllocatorBlockSize: -1 + m_ProfilerBucketAllocatorBlockCount: -1 + m_TempAllocatorSizeMain: -1 + m_JobTempAllocatorBlockSize: -1 + m_BackgroundJobTempAllocatorBlockSize: -1 + m_JobTempAllocatorReducedBlockSize: -1 + m_TempAllocatorSizeGIBakingWorker: -1 + m_TempAllocatorSizeNavMeshWorker: -1 + m_TempAllocatorSizeAudioWorker: -1 + m_TempAllocatorSizeCloudWorker: -1 + m_TempAllocatorSizeGfx: -1 + m_TempAllocatorSizeJobWorker: -1 + m_TempAllocatorSizeBackgroundWorker: -1 + m_TempAllocatorSizePreloadManager: -1 + m_PlatformMemorySettings: {} diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/MultiplayerManager.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/MultiplayerManager.asset new file mode 100644 index 000000000..2a936644e --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/MultiplayerManager.asset @@ -0,0 +1,7 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!655991488 &1 +MultiplayerManager: + m_ObjectHideFlags: 0 + m_EnableMultiplayerRoles: 0 + m_StrippingTypes: {} diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/NavMeshAreas.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/NavMeshAreas.asset new file mode 100644 index 000000000..3b0b7c3d1 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/NavMeshAreas.asset @@ -0,0 +1,91 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!126 &1 +NavMeshProjectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + areas: + - name: Walkable + cost: 1 + - name: Not Walkable + cost: 1 + - name: Jump + cost: 2 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + m_LastAgentTypeID: -887442657 + m_Settings: + - serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.75 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_SettingNames: + - Humanoid diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/NetcodeForGameObjects.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/NetcodeForGameObjects.asset new file mode 100644 index 000000000..0f6578c3f --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/NetcodeForGameObjects.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 53 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2727d53a542a4c1aa312905c3a02d807, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkPrefabsPath: Assets/DefaultNetworkPrefabs.asset + TempNetworkPrefabsPath: Assets/DefaultNetworkPrefabs.asset + GenerateDefaultNetworkPrefabs: 0 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/PackageManagerSettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/PackageManagerSettings.asset new file mode 100644 index 000000000..be4a7974e --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/PackageManagerSettings.asset @@ -0,0 +1,43 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_EnablePreviewPackages: 0 + m_EnablePackageDependencies: 0 + m_AdvancedSettingsExpanded: 1 + m_ScopedRegistriesSettingsExpanded: 1 + oneTimeWarningShown: 0 + m_Registries: + - m_Id: main + m_Name: + m_Url: https://packages.unity.com + m_Scopes: [] + m_IsDefault: 1 + m_Capabilities: 7 + m_UserSelectedRegistryName: + m_UserAddingNewScopedRegistry: 0 + m_RegistryInfoDraft: + m_ErrorMessage: + m_Original: + m_Id: + m_Name: + m_Url: + m_Scopes: [] + m_IsDefault: 0 + m_Capabilities: 0 + m_Modified: 0 + m_Name: + m_Url: + m_Scopes: + - + m_SelectedScopeIndex: 0 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/Physics2DSettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/Physics2DSettings.asset new file mode 100644 index 000000000..6c5cf8a00 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/Physics2DSettings.asset @@ -0,0 +1,56 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!19 &1 +Physics2DSettings: + m_ObjectHideFlags: 0 + serializedVersion: 4 + m_Gravity: {x: 0, y: -9.81} + m_DefaultMaterial: {fileID: 0} + m_VelocityIterations: 8 + m_PositionIterations: 3 + m_VelocityThreshold: 1 + m_MaxLinearCorrection: 0.2 + m_MaxAngularCorrection: 8 + m_MaxTranslationSpeed: 100 + m_MaxRotationSpeed: 360 + m_BaumgarteScale: 0.2 + m_BaumgarteTimeOfImpactScale: 0.75 + m_TimeToSleep: 0.5 + m_LinearSleepTolerance: 0.01 + m_AngularSleepTolerance: 2 + m_DefaultContactOffset: 0.01 + m_JobOptions: + serializedVersion: 2 + useMultithreading: 0 + useConsistencySorting: 0 + m_InterpolationPosesPerJob: 100 + m_NewContactsPerJob: 30 + m_CollideContactsPerJob: 100 + m_ClearFlagsPerJob: 200 + m_ClearBodyForcesPerJob: 200 + m_SyncDiscreteFixturesPerJob: 50 + m_SyncContinuousFixturesPerJob: 50 + m_FindNearestContactsPerJob: 100 + m_UpdateTriggerContactsPerJob: 100 + m_IslandSolverCostThreshold: 100 + m_IslandSolverBodyCostScale: 1 + m_IslandSolverContactCostScale: 10 + m_IslandSolverJointCostScale: 10 + m_IslandSolverBodiesPerJob: 50 + m_IslandSolverContactsPerJob: 50 + m_AutoSimulation: 1 + m_QueriesHitTriggers: 1 + m_QueriesStartInColliders: 1 + m_CallbacksOnDisable: 1 + m_ReuseCollisionCallbacks: 0 + m_AutoSyncTransforms: 0 + m_AlwaysShowColliders: 0 + m_ShowColliderSleep: 1 + m_ShowColliderContacts: 0 + m_ShowColliderAABB: 0 + m_ContactArrowScale: 0.2 + m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} + m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} + m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} + m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/PresetManager.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/PresetManager.asset new file mode 100644 index 000000000..67a94daef --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/PresetManager.asset @@ -0,0 +1,7 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1386491679 &1 +PresetManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_DefaultPresets: {} diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/ProjectSettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/ProjectSettings.asset new file mode 100644 index 000000000..90becf57c --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/ProjectSettings.asset @@ -0,0 +1,944 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!129 &1 +PlayerSettings: + m_ObjectHideFlags: 0 + serializedVersion: 28 + productGUID: 56d81165b0e8dd6478d2862a7ee60719 + AndroidProfiler: 0 + AndroidFilterTouchesWhenObscured: 0 + AndroidEnableSustainedPerformanceMode: 0 + defaultScreenOrientation: 4 + targetDevice: 2 + useOnDemandResources: 0 + accelerometerFrequency: 60 + companyName: DefaultCompany + productName: DistributedAuthoritySample + defaultCursor: {fileID: 0} + cursorHotspot: {x: 0, y: 0} + m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} + m_ShowUnitySplashScreen: 1 + m_ShowUnitySplashLogo: 1 + m_SplashScreenOverlayOpacity: 1 + m_SplashScreenAnimation: 1 + m_SplashScreenLogoStyle: 1 + m_SplashScreenDrawMode: 0 + m_SplashScreenBackgroundAnimationZoom: 1 + m_SplashScreenLogoAnimationZoom: 1 + m_SplashScreenBackgroundLandscapeAspect: 1 + m_SplashScreenBackgroundPortraitAspect: 1 + m_SplashScreenBackgroundLandscapeUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenBackgroundPortraitUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenLogos: [] + m_VirtualRealitySplashScreen: {fileID: 0} + m_HolographicTrackingLossScreen: {fileID: 0} + defaultScreenWidth: 1024 + defaultScreenHeight: 768 + defaultScreenWidthWeb: 960 + defaultScreenHeightWeb: 600 + m_StereoRenderingPath: 0 + m_ActiveColorSpace: 1 + unsupportedMSAAFallback: 0 + m_SpriteBatchVertexThreshold: 300 + m_MTRendering: 1 + mipStripping: 0 + numberOfMipsStripped: 0 + numberOfMipsStrippedPerMipmapLimitGroup: {} + m_StackTraceTypes: 010000000100000001000000010000000100000001000000 + iosShowActivityIndicatorOnLoading: -1 + androidShowActivityIndicatorOnLoading: -1 + iosUseCustomAppBackgroundBehavior: 0 + allowedAutorotateToPortrait: 1 + allowedAutorotateToPortraitUpsideDown: 1 + allowedAutorotateToLandscapeRight: 1 + allowedAutorotateToLandscapeLeft: 1 + useOSAutorotation: 1 + use32BitDisplayBuffer: 1 + preserveFramebufferAlpha: 0 + disableDepthAndStencilBuffers: 0 + androidStartInFullscreen: 1 + androidRenderOutsideSafeArea: 1 + androidUseSwappy: 0 + androidBlitType: 0 + androidResizeableActivity: 1 + androidDefaultWindowWidth: 1920 + androidDefaultWindowHeight: 1080 + androidMinimumWindowWidth: 400 + androidMinimumWindowHeight: 300 + androidFullscreenMode: 1 + androidAutoRotationBehavior: 1 + androidPredictiveBackSupport: 0 + androidApplicationEntry: 2 + defaultIsNativeResolution: 1 + macRetinaSupport: 1 + runInBackground: 0 + captureSingleScreen: 0 + muteOtherAudioSources: 0 + Prepare IOS For Recording: 0 + Force IOS Speakers When Recording: 0 + deferSystemGesturesMode: 0 + hideHomeButton: 0 + submitAnalytics: 1 + usePlayerLog: 1 + dedicatedServerOptimizations: 1 + bakeCollisionMeshes: 0 + forceSingleInstance: 0 + useFlipModelSwapchain: 1 + resizableWindow: 0 + useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games + gpuSkinning: 1 + meshDeformation: 2 + xboxPIXTextureCapture: 0 + xboxEnableAvatar: 0 + xboxEnableKinect: 0 + xboxEnableKinectAutoTracking: 0 + xboxEnableFitness: 0 + visibleInBackground: 1 + allowFullscreenSwitch: 1 + fullscreenMode: 1 + xboxSpeechDB: 0 + xboxEnableHeadOrientation: 0 + xboxEnableGuest: 0 + xboxEnablePIXSampling: 0 + metalFramebufferOnly: 0 + xboxOneResolution: 0 + xboxOneSResolution: 0 + xboxOneXResolution: 3 + xboxOneMonoLoggingLevel: 0 + xboxOneLoggingLevel: 1 + xboxOneDisableEsram: 0 + xboxOneEnableTypeOptimization: 0 + xboxOnePresentImmediateThreshold: 0 + switchQueueCommandMemory: 1048576 + switchQueueControlMemory: 16384 + switchQueueComputeMemory: 262144 + switchNVNShaderPoolsGranularity: 33554432 + switchNVNDefaultPoolsGranularity: 16777216 + switchNVNOtherPoolsGranularity: 16777216 + switchGpuScratchPoolGranularity: 2097152 + switchAllowGpuScratchShrinking: 0 + switchNVNMaxPublicTextureIDCount: 0 + switchNVNMaxPublicSamplerIDCount: 0 + switchMaxWorkerMultiple: 8 + switchNVNGraphicsFirmwareMemory: 32 + vulkanNumSwapchainBuffers: 3 + vulkanEnableSetSRGBWrite: 0 + vulkanEnablePreTransform: 1 + vulkanEnableLateAcquireNextImage: 0 + vulkanEnableCommandBufferRecycling: 1 + loadStoreDebugModeEnabled: 0 + visionOSBundleVersion: 1.0 + tvOSBundleVersion: 1.0 + bundleVersion: 0.1.0 + preloadedAssets: [] + metroInputSource: 0 + wsaTransparentSwapchain: 0 + m_HolographicPauseOnTrackingLoss: 1 + xboxOneDisableKinectGpuReservation: 1 + xboxOneEnable7thCore: 1 + vrSettings: + enable360StereoCapture: 0 + isWsaHolographicRemotingEnabled: 0 + enableFrameTimingStats: 0 + enableOpenGLProfilerGPURecorders: 1 + allowHDRDisplaySupport: 0 + useHDRDisplay: 0 + hdrBitDepth: 0 + m_ColorGamuts: 00000000 + targetPixelDensity: 30 + resolutionScalingMode: 0 + resetResolutionOnWindowResize: 0 + androidSupportedAspectRatio: 1 + androidMaxAspectRatio: 2.1 + androidMinAspectRatio: 1 + applicationIdentifier: + Android: com.UnityTechnologies.com.unity.template.urpblank + Standalone: com.Unity-Technologies.com.unity.template.urp-blank + iPhone: com.Unity-Technologies.com.unity.template.urp-blank + buildNumber: + Standalone: 0 + VisionOS: 0 + iPhone: 0 + tvOS: 0 + overrideDefaultApplicationIdentifier: 1 + AndroidBundleVersionCode: 1 + AndroidMinSdkVersion: 23 + AndroidTargetSdkVersion: 0 + AndroidPreferredInstallLocation: 1 + aotOptions: + stripEngineCode: 1 + iPhoneStrippingLevel: 0 + iPhoneScriptCallOptimization: 0 + ForceInternetPermission: 0 + ForceSDCardPermission: 0 + CreateWallpaper: 0 + androidSplitApplicationBinary: 0 + keepLoadedShadersAlive: 0 + StripUnusedMeshComponents: 0 + strictShaderVariantMatching: 0 + VertexChannelCompressionMask: 4054 + iPhoneSdkVersion: 988 + iOSSimulatorArchitecture: 0 + iOSTargetOSVersionString: 13.0 + tvOSSdkVersion: 0 + tvOSSimulatorArchitecture: 0 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 13.0 + VisionOSSdkVersion: 0 + VisionOSTargetOSVersionString: 1.0 + uIPrerenderedIcon: 0 + uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 + uIStatusBarHidden: 1 + uIExitOnSuspend: 0 + uIStatusBarStyle: 0 + appleTVSplashScreen: {fileID: 0} + appleTVSplashScreen2x: {fileID: 0} + tvOSSmallIconLayers: [] + tvOSSmallIconLayers2x: [] + tvOSLargeIconLayers: [] + tvOSLargeIconLayers2x: [] + tvOSTopShelfImageLayers: [] + tvOSTopShelfImageLayers2x: [] + tvOSTopShelfImageWideLayers: [] + tvOSTopShelfImageWideLayers2x: [] + iOSLaunchScreenType: 0 + iOSLaunchScreenPortrait: {fileID: 0} + iOSLaunchScreenLandscape: {fileID: 0} + iOSLaunchScreenBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreenFillPct: 100 + iOSLaunchScreenSize: 100 + iOSLaunchScreeniPadType: 0 + iOSLaunchScreeniPadImage: {fileID: 0} + iOSLaunchScreeniPadBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreeniPadFillPct: 100 + iOSLaunchScreeniPadSize: 100 + iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: + iOSDeviceRequirements: [] + iOSURLSchemes: [] + macOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 + metalEditorSupport: 1 + metalAPIValidation: 1 + metalCompileShaderBinary: 0 + iOSRenderExtraFrameOnPause: 0 + iosCopyPluginsCodeInsteadOfSymlink: 0 + appleDeveloperTeamID: + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + VisionOSManualSigningProvisioningProfileID: + iOSManualSigningProvisioningProfileType: 0 + tvOSManualSigningProvisioningProfileType: 0 + VisionOSManualSigningProvisioningProfileType: 0 + appleEnableAutomaticSigning: 0 + iOSRequireARKit: 0 + iOSAutomaticallyDetectAndAddCapabilities: 1 + appleEnableProMotion: 0 + shaderPrecisionModel: 0 + clonedFromGUID: 3c72c65a16f0acb438eed22b8b16c24a + templatePackageId: com.unity.template.urp-blank@17.0.10 + templateDefaultScene: Assets/Scenes/SampleScene.unity + useCustomMainManifest: 0 + useCustomLauncherManifest: 0 + useCustomMainGradleTemplate: 0 + useCustomLauncherGradleManifest: 0 + useCustomBaseGradleTemplate: 0 + useCustomGradlePropertiesTemplate: 0 + useCustomGradleSettingsTemplate: 0 + useCustomProguardFile: 0 + AndroidTargetArchitectures: 2 + AndroidSplashScreenScale: 0 + androidSplashScreen: {fileID: 0} + AndroidKeystoreName: + AndroidKeyaliasName: + AndroidEnableArmv9SecurityFeatures: 0 + AndroidEnableArm64MTE: 0 + AndroidBuildApkPerCpuArchitecture: 0 + AndroidTVCompatibility: 0 + AndroidIsGame: 1 + AndroidEnableTango: 0 + androidEnableBanner: 1 + androidUseLowAccuracyLocation: 0 + androidUseCustomKeystore: 0 + m_AndroidBanners: + - width: 320 + height: 180 + banner: {fileID: 0} + androidGamepadSupportLevel: 0 + AndroidMinifyRelease: 0 + AndroidMinifyDebug: 0 + AndroidValidateAppBundleSize: 1 + AndroidAppBundleSizeToValidate: 150 + AndroidReportGooglePlayAppDependencies: 1 + androidSymbolsSizeThreshold: 800 + m_BuildTargetIcons: [] + m_BuildTargetPlatformIcons: + - m_BuildTarget: iPhone + m_Icons: + - m_Textures: [] + m_Width: 180 + m_Height: 180 + m_Kind: 0 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 120 + m_Height: 120 + m_Kind: 0 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 167 + m_Height: 167 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 152 + m_Height: 152 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 76 + m_Height: 76 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 120 + m_Height: 120 + m_Kind: 3 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 80 + m_Height: 80 + m_Kind: 3 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 80 + m_Height: 80 + m_Kind: 3 + m_SubKind: iPad + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 3 + m_SubKind: iPad + - m_Textures: [] + m_Width: 87 + m_Height: 87 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 58 + m_Height: 58 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 29 + m_Height: 29 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 58 + m_Height: 58 + m_Kind: 1 + m_SubKind: iPad + - m_Textures: [] + m_Width: 29 + m_Height: 29 + m_Kind: 1 + m_SubKind: iPad + - m_Textures: [] + m_Width: 60 + m_Height: 60 + m_Kind: 2 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 2 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 2 + m_SubKind: iPad + - m_Textures: [] + m_Width: 20 + m_Height: 20 + m_Kind: 2 + m_SubKind: iPad + - m_Textures: [] + m_Width: 1024 + m_Height: 1024 + m_Kind: 4 + m_SubKind: App Store + - m_BuildTarget: Android + m_Icons: + - m_Textures: [] + m_Width: 432 + m_Height: 432 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 324 + m_Height: 324 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 216 + m_Height: 216 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 162 + m_Height: 162 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 108 + m_Height: 108 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 81 + m_Height: 81 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 0 + m_SubKind: + - m_BuildTarget: tvOS + m_Icons: + - m_Textures: [] + m_Width: 1280 + m_Height: 768 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 800 + m_Height: 480 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 400 + m_Height: 240 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 4640 + m_Height: 1440 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 2320 + m_Height: 720 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 3840 + m_Height: 1440 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 1920 + m_Height: 720 + m_Kind: 1 + m_SubKind: + m_BuildTargetBatching: [] + m_BuildTargetShaderSettings: [] + m_BuildTargetGraphicsJobs: [] + m_BuildTargetGraphicsJobMode: [] + m_BuildTargetGraphicsAPIs: + - m_BuildTarget: iOSSupport + m_APIs: 10000000 + m_Automatic: 1 + - m_BuildTarget: AndroidPlayer + m_APIs: 150000000b000000 + m_Automatic: 0 + m_BuildTargetVRSettings: [] + m_DefaultShaderChunkSizeInMB: 16 + m_DefaultShaderChunkCount: 0 + openGLRequireES31: 0 + openGLRequireES31AEP: 0 + openGLRequireES32: 0 + m_TemplateCustomTags: {} + mobileMTRendering: + Android: 1 + iPhone: 1 + tvOS: 1 + m_BuildTargetGroupLightmapEncodingQuality: + - serializedVersion: 2 + m_BuildTarget: Android + m_EncodingQuality: 1 + m_BuildTargetGroupLightmapSettings: [] + m_BuildTargetGroupLoadStoreDebugModeSettings: [] + m_BuildTargetNormalMapEncoding: + - m_BuildTarget: Android + m_Encoding: 1 + m_BuildTargetDefaultTextureCompressionFormat: + - serializedVersion: 3 + m_BuildTarget: Android + m_Formats: 03000000 + playModeTestRunnerEnabled: 0 + runPlayModeTestAsEditModeTest: 0 + actionOnDotNetUnhandledException: 1 + enableInternalProfiler: 0 + logObjCUncaughtExceptions: 1 + enableCrashReportAPI: 0 + cameraUsageDescription: + locationUsageDescription: + microphoneUsageDescription: + bluetoothUsageDescription: + macOSTargetOSVersion: 11.0 + switchNMETAOverride: + switchNetLibKey: + switchSocketMemoryPoolSize: 6144 + switchSocketAllocatorPoolSize: 128 + switchSocketConcurrencyLimit: 14 + switchScreenResolutionBehavior: 2 + switchUseCPUProfiler: 0 + switchEnableFileSystemTrace: 0 + switchLTOSetting: 0 + switchApplicationID: 0x01004b9000490000 + switchNSODependencies: + switchCompilerFlags: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchTitleNames_12: + switchTitleNames_13: + switchTitleNames_14: + switchTitleNames_15: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchPublisherNames_12: + switchPublisherNames_13: + switchPublisherNames_14: + switchPublisherNames_15: + switchIcons_0: {fileID: 0} + switchIcons_1: {fileID: 0} + switchIcons_2: {fileID: 0} + switchIcons_3: {fileID: 0} + switchIcons_4: {fileID: 0} + switchIcons_5: {fileID: 0} + switchIcons_6: {fileID: 0} + switchIcons_7: {fileID: 0} + switchIcons_8: {fileID: 0} + switchIcons_9: {fileID: 0} + switchIcons_10: {fileID: 0} + switchIcons_11: {fileID: 0} + switchIcons_12: {fileID: 0} + switchIcons_13: {fileID: 0} + switchIcons_14: {fileID: 0} + switchIcons_15: {fileID: 0} + switchSmallIcons_0: {fileID: 0} + switchSmallIcons_1: {fileID: 0} + switchSmallIcons_2: {fileID: 0} + switchSmallIcons_3: {fileID: 0} + switchSmallIcons_4: {fileID: 0} + switchSmallIcons_5: {fileID: 0} + switchSmallIcons_6: {fileID: 0} + switchSmallIcons_7: {fileID: 0} + switchSmallIcons_8: {fileID: 0} + switchSmallIcons_9: {fileID: 0} + switchSmallIcons_10: {fileID: 0} + switchSmallIcons_11: {fileID: 0} + switchSmallIcons_12: {fileID: 0} + switchSmallIcons_13: {fileID: 0} + switchSmallIcons_14: {fileID: 0} + switchSmallIcons_15: {fileID: 0} + switchManualHTML: + switchAccessibleURLs: + switchLegalInformation: + switchMainThreadStackSize: 1048576 + switchPresenceGroupId: + switchLogoHandling: 0 + switchReleaseVersion: 0 + switchDisplayVersion: 1.0.0 + switchStartupUserAccount: 0 + switchSupportedLanguagesMask: 0 + switchLogoType: 0 + switchApplicationErrorCodeCategory: + switchUserAccountSaveDataSize: 0 + switchUserAccountSaveDataJournalSize: 0 + switchApplicationAttribute: 0 + switchCardSpecSize: -1 + switchCardSpecClock: -1 + switchRatingsMask: 0 + switchRatingsInt_0: 0 + switchRatingsInt_1: 0 + switchRatingsInt_2: 0 + switchRatingsInt_3: 0 + switchRatingsInt_4: 0 + switchRatingsInt_5: 0 + switchRatingsInt_6: 0 + switchRatingsInt_7: 0 + switchRatingsInt_8: 0 + switchRatingsInt_9: 0 + switchRatingsInt_10: 0 + switchRatingsInt_11: 0 + switchRatingsInt_12: 0 + switchLocalCommunicationIds_0: + switchLocalCommunicationIds_1: + switchLocalCommunicationIds_2: + switchLocalCommunicationIds_3: + switchLocalCommunicationIds_4: + switchLocalCommunicationIds_5: + switchLocalCommunicationIds_6: + switchLocalCommunicationIds_7: + switchParentalControl: 0 + switchAllowsScreenshot: 1 + switchAllowsVideoCapturing: 1 + switchAllowsRuntimeAddOnContentInstall: 0 + switchDataLossConfirmation: 0 + switchUserAccountLockEnabled: 0 + switchSystemResourceMemory: 16777216 + switchSupportedNpadStyles: 22 + switchNativeFsCacheSize: 32 + switchIsHoldTypeHorizontal: 0 + switchSupportedNpadCount: 8 + switchEnableTouchScreen: 1 + switchSocketConfigEnabled: 0 + switchTcpInitialSendBufferSize: 32 + switchTcpInitialReceiveBufferSize: 64 + switchTcpAutoSendBufferSizeMax: 256 + switchTcpAutoReceiveBufferSizeMax: 256 + switchUdpSendBufferSize: 9 + switchUdpReceiveBufferSize: 42 + switchSocketBufferEfficiency: 4 + switchSocketInitializeEnabled: 1 + switchNetworkInterfaceManagerInitializeEnabled: 1 + switchDisableHTCSPlayerConnection: 0 + switchUseNewStyleFilepaths: 0 + switchUseLegacyFmodPriorities: 0 + switchUseMicroSleepForYield: 1 + switchEnableRamDiskSupport: 0 + switchMicroSleepForYieldTime: 25 + switchRamDiskSpaceSize: 12 + switchUpgradedPlayerSettingsToNMETA: 0 + ps4NPAgeRating: 12 + ps4NPTitleSecret: + ps4NPTrophyPackPath: + ps4ParentalLevel: 11 + ps4ContentID: ED1633-NPXX51362_00-0000000000000000 + ps4Category: 0 + ps4MasterVersion: 01.00 + ps4AppVersion: 01.00 + ps4AppType: 0 + ps4ParamSfxPath: + ps4VideoOutPixelFormat: 0 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 60 + ps4PronunciationXMLPath: + ps4PronunciationSIGPath: + ps4BackgroundImagePath: + ps4StartupImagePath: + ps4StartupImagesFolder: + ps4IconImagesFolder: + ps4SaveDataImagePath: + ps4SdkOverride: + ps4BGMPath: + ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: + ps4ExtraSceSysFile: + ps4NPtitleDatPath: + ps4RemotePlayKeyAssignment: -1 + ps4RemotePlayKeyMappingDir: + ps4PlayTogetherPlayerCount: 0 + ps4EnterButtonAssignment: 2 + ps4ApplicationParam1: 0 + ps4ApplicationParam2: 0 + ps4ApplicationParam3: 0 + ps4ApplicationParam4: 0 + ps4DownloadDataSize: 0 + ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 + playerPrefsMaxSize: 32768 + ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ + ps4pnSessions: 1 + ps4pnPresence: 1 + ps4pnFriends: 1 + ps4pnGameCustomData: 1 + playerPrefsSupport: 0 + enableApplicationExit: 0 + resetTempFolder: 1 + restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 + ps4ReprojectionSupport: 0 + ps4UseAudio3dBackend: 0 + ps4UseLowGarlicFragmentationMode: 1 + ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 2 + ps4Audio3dVirtualSpeakerCount: 14 + ps4attribCpuUsage: 0 + ps4PatchPkgPath: + ps4PatchLatestPkgPath: + ps4PatchChangeinfoPath: + ps4PatchDayOne: 0 + ps4attribUserManagement: 0 + ps4attribMoveSupport: 0 + ps4attrib3DSupport: 0 + ps4attribShareSupport: 0 + ps4attribExclusiveVR: 0 + ps4disableAutoHideSplash: 0 + ps4videoRecordingFeaturesUsed: 0 + ps4contentSearchFeaturesUsed: 0 + ps4CompatibilityPS5: 0 + ps4AllowPS5Detection: 0 + ps4GPU800MHz: 1 + ps4attribEyeToEyeDistanceSettingVR: 0 + ps4IncludedModules: [] + ps4attribVROutputEnabled: 0 + monoEnv: + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} + blurSplashScreenBackground: 1 + spritePackerPolicy: + webGLMemorySize: 32 + webGLExceptionSupport: 1 + webGLNameFilesAsHashes: 0 + webGLShowDiagnostics: 0 + webGLDataCaching: 1 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLCompressionFormat: 0 + webGLWasmArithmeticExceptions: 0 + webGLLinkerTarget: 1 + webGLThreadsSupport: 0 + webGLDecompressionFallback: 0 + webGLInitialMemorySize: 32 + webGLMaximumMemorySize: 2048 + webGLMemoryGrowthMode: 2 + webGLMemoryLinearGrowthStep: 16 + webGLMemoryGeometricGrowthStep: 0.2 + webGLMemoryGeometricGrowthCap: 96 + webGLEnableWebGPU: 0 + webGLPowerPreference: 2 + webGLWebAssemblyTable: 0 + webGLWebAssemblyBigInt: 0 + webGLCloseOnQuit: 0 + webWasm2023: 0 + scriptingDefineSymbols: + Standalone: ENABLE_INPUT_SYSTEM;STARTER_ASSETS_PACKAGES_CHECKED + additionalCompilerArguments: {} + platformArchitecture: {} + scriptingBackend: + Android: 1 + il2cppCompilerConfiguration: {} + il2cppCodeGeneration: {} + il2cppStacktraceInformation: {} + managedStrippingLevel: + Android: 1 + EmbeddedLinux: 1 + GameCoreScarlett: 1 + GameCoreXboxOne: 1 + Nintendo Switch: 1 + PS4: 1 + PS5: 1 + QNX: 1 + VisionOS: 1 + WebGL: 1 + Windows Store Apps: 1 + XboxOne: 1 + iPhone: 1 + tvOS: 1 + incrementalIl2cppBuild: {} + suppressCommonWarnings: 1 + allowUnsafeCode: 0 + useDeterministicCompilation: 1 + additionalIl2CppArgs: + scriptingRuntimeVersion: 1 + gcIncremental: 1 + gcWBarrierValidation: 0 + apiCompatibilityLevelPerPlatform: {} + editorAssembliesCompatibilityLevel: 1 + m_RenderingPath: 1 + m_MobileRenderingPath: 1 + metroPackageName: DistributedAuthoritySample + metroPackageVersion: + metroCertificatePath: + metroCertificatePassword: + metroCertificateSubject: + metroCertificateIssuer: + metroCertificateNotAfter: 0000000000000000 + metroApplicationDescription: DistributedAuthoritySample + wsaImages: {} + metroTileShortName: + metroTileShowName: 0 + metroMediumTileShowName: 0 + metroLargeTileShowName: 0 + metroWideTileShowName: 0 + metroSupportStreamingInstall: 0 + metroLastRequiredScene: 0 + metroDefaultTileSize: 1 + metroTileForegroundText: 2 + metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} + metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} + metroSplashScreenUseBackgroundColor: 0 + syncCapabilities: 0 + platformCapabilities: {} + metroTargetDeviceFamilies: {} + metroFTAName: + metroFTAFileTypes: [] + metroProtocolName: + vcxProjDefaultLanguage: + XboxOneProductId: + XboxOneUpdateKey: + XboxOneSandboxId: + XboxOneContentId: + XboxOneTitleId: + XboxOneSCId: + XboxOneGameOsOverridePath: + XboxOnePackagingOverridePath: + XboxOneAppManifestOverridePath: + XboxOneVersion: 1.0.0.0 + XboxOnePackageEncryption: 0 + XboxOnePackageUpdateGranularity: 2 + XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} + XboxOneIsContentPackage: 0 + XboxOneEnhancedXboxCompatibilityMode: 0 + XboxOneEnableGPUVariability: 1 + XboxOneSockets: {} + XboxOneSplashScreen: {fileID: 0} + XboxOneAllowedProductIds: [] + XboxOnePersistentLocalStorageSize: 0 + XboxOneXTitleMemory: 8 + XboxOneOverrideIdentityName: + XboxOneOverrideIdentityPublisher: + vrEditorSettings: {} + cloudServicesEnabled: {} + luminIcon: + m_Name: + m_ModelFolderPath: + m_PortalFolderPath: + luminCert: + m_CertPath: + m_SignPackage: 1 + luminIsChannelApp: 0 + luminVersion: + m_VersionCode: 1 + m_VersionName: + hmiPlayerDataPath: + hmiForceSRGBBlit: 1 + embeddedLinuxEnableGamepadInput: 0 + hmiCpuConfiguration: + hmiLogStartupTiming: 0 + qnxGraphicConfPath: + apiCompatibilityLevel: 6 + captureStartupLogs: {} + activeInputHandler: 2 + windowsGamepadBackendHint: 0 + cloudProjectId: + framebufferDepthMemorylessMode: 0 + qualitySettingsNames: [] + projectName: + organizationId: + cloudEnabled: 0 + legacyClampBlendShapeWeights: 0 + hmiLoadingImage: {fileID: 0} + platformRequiresReadableAssets: 0 + virtualTexturingSupportEnabled: 0 + insecureHttpOption: 0 + androidVulkanDenyFilterList: [] + androidVulkanAllowFilterList: [] diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/ProjectVersion.txt b/Experimental/DistributedAuthoritySample/ProjectSettings/ProjectVersion.txt new file mode 100644 index 000000000..160a67701 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/ProjectVersion.txt @@ -0,0 +1,2 @@ +m_EditorVersion: 6000.0.11f1 +m_EditorVersionWithRevision: 6000.0.11f1 (fa01dd6b76d5) diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/QualitySettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/QualitySettings.asset new file mode 100644 index 000000000..f55198a74 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/QualitySettings.asset @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!47 &1 +QualitySettings: + m_ObjectHideFlags: 0 + serializedVersion: 5 + m_CurrentQuality: 1 + m_QualitySettings: + - serializedVersion: 4 + name: Mobile + pixelLightCount: 2 + shadows: 2 + shadowResolution: 1 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 40 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + skinWeights: 2 + globalTextureMipmapLimit: 0 + textureMipmapLimitSettings: [] + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 1 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 1 + useLegacyDetailDistribution: 1 + adaptiveVsync: 0 + vSyncCount: 0 + realtimeGICPUUsage: 100 + adaptiveVsyncExtraA: 0 + adaptiveVsyncExtraB: 0 + lodBias: 1 + maximumLODLevel: 0 + enableLODCrossFade: 1 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 256 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 11400000, guid: 5e6cbd92db86f4b18aec3ed561671858, + type: 2} + terrainQualityOverrides: 0 + terrainPixelError: 1 + terrainDetailDensityScale: 1 + terrainBasemapDistance: 1000 + terrainDetailDistance: 80 + terrainTreeDistance: 5000 + terrainBillboardStart: 50 + terrainFadeLength: 5 + terrainMaxTrees: 50 + excludedTargetPlatforms: + - Standalone + - serializedVersion: 4 + name: PC + pixelLightCount: 2 + shadows: 2 + shadowResolution: 1 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 40 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + skinWeights: 4 + globalTextureMipmapLimit: 0 + textureMipmapLimitSettings: [] + anisotropicTextures: 2 + antiAliasing: 0 + softParticles: 0 + softVegetation: 1 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 1 + useLegacyDetailDistribution: 1 + adaptiveVsync: 0 + vSyncCount: 0 + realtimeGICPUUsage: 100 + adaptiveVsyncExtraA: 0 + adaptiveVsyncExtraB: 0 + lodBias: 2 + maximumLODLevel: 0 + enableLODCrossFade: 1 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 256 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 11400000, guid: 4b83569d67af61e458304325a23e5dfd, + type: 2} + terrainQualityOverrides: 0 + terrainPixelError: 1 + terrainDetailDensityScale: 1 + terrainBasemapDistance: 1000 + terrainDetailDistance: 80 + terrainTreeDistance: 5000 + terrainBillboardStart: 50 + terrainFadeLength: 5 + terrainMaxTrees: 50 + excludedTargetPlatforms: + - Android + - iPhone + m_TextureMipmapLimitGroupNames: [] + m_PerPlatformDefaultQuality: + Android: 0 + GameCoreScarlett: 1 + GameCoreXboxOne: 1 + Lumin: 0 + Nintendo Switch: 1 + PS4: 1 + PS5: 1 + Server: 0 + Stadia: 0 + Standalone: 1 + WebGL: 0 + Windows Store Apps: 0 + XboxOne: 0 + iPhone: 0 + tvOS: 0 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/SceneTemplateSettings.json b/Experimental/DistributedAuthoritySample/ProjectSettings/SceneTemplateSettings.json new file mode 100644 index 000000000..ede5887b3 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/SceneTemplateSettings.json @@ -0,0 +1,121 @@ +{ + "templatePinStates": [], + "dependencyTypeInfos": [ + { + "userAdded": false, + "type": "UnityEngine.AnimationClip", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.Animations.AnimatorController", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.AnimatorOverrideController", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.Audio.AudioMixerController", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.ComputeShader", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.Cubemap", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.GameObject", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.LightingDataAsset", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.LightingSettings", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Material", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.MonoScript", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicsMaterial", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicsMaterial2D", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.VolumeProfile", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEditor.SceneAsset", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.Shader", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.ShaderVariantCollection", + "defaultInstantiationMode": 1 + }, + { + "userAdded": false, + "type": "UnityEngine.Texture", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Texture2D", + "defaultInstantiationMode": 0 + }, + { + "userAdded": false, + "type": "UnityEngine.Timeline.TimelineAsset", + "defaultInstantiationMode": 0 + } + ], + "defaultDependencyTypeInfo": { + "userAdded": false, + "type": "", + "defaultInstantiationMode": 1 + }, + "newSceneOverride": 0 +} \ No newline at end of file diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/ShaderGraphSettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/ShaderGraphSettings.asset new file mode 100644 index 000000000..e66042a7c --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/ShaderGraphSettings.asset @@ -0,0 +1,18 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: de02f9e1d18f588468e474319d09a723, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderVariantLimit: 128 + customInterpolatorErrorThreshold: 32 + customInterpolatorWarningThreshold: 16 + customHeatmapValues: {fileID: 0} diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/TagManager.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/TagManager.asset new file mode 100644 index 000000000..148ab95f6 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/TagManager.asset @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!78 &1 +TagManager: + serializedVersion: 3 + tags: + - CinemachineTarget + layers: + - Default + - TransparentFX + - Ignore Raycast + - + - Water + - UI + - '[Empty Slot]' + - Ground + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + m_SortingLayers: + - name: Default + uniqueID: 0 + locked: 0 + m_RenderingLayers: + - Default + - Light Layer 1 + - Light Layer 2 + - Light Layer 3 + - Light Layer 4 + - Light Layer 5 + - Light Layer 6 + - Light Layer 7 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/TimeManager.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/TimeManager.asset new file mode 100644 index 000000000..558a017e1 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/TimeManager.asset @@ -0,0 +1,9 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!5 &1 +TimeManager: + m_ObjectHideFlags: 0 + Fixed Timestep: 0.02 + Maximum Allowed Timestep: 0.33333334 + m_TimeScale: 1 + Maximum Particle Timestep: 0.03 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/URPProjectSettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/URPProjectSettings.asset new file mode 100644 index 000000000..08faf0336 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/URPProjectSettings.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 247994e1f5a72c2419c26a37e9334c01, type: 3} + m_Name: + m_EditorClassIdentifier: + m_LastMaterialVersion: 9 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/UnityConnectSettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 000000000..a88bee0f1 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/UnityConnectSettings.asset @@ -0,0 +1,36 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!310 &1 +UnityConnectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 1 + m_Enabled: 0 + m_TestMode: 0 + m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events + m_EventUrl: https://cdp.cloud.unity3d.com/v1/events + m_ConfigUrl: https://config.uca.cloud.unity3d.com + m_DashboardUrl: https://dashboard.unity3d.com + m_TestInitMode: 0 + CrashReportingSettings: + m_EventUrl: https://perf-events.cloud.unity3d.com + m_Enabled: 0 + m_LogBufferSize: 10 + m_CaptureEditorExceptions: 1 + UnityPurchasingSettings: + m_Enabled: 0 + m_TestMode: 0 + UnityAnalyticsSettings: + m_Enabled: 0 + m_TestMode: 0 + m_InitializeOnStartup: 1 + m_PackageRequiringCoreStatsPresent: 0 + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_IosGameId: + m_AndroidGameId: + m_GameIds: {} + m_GameId: + PerformanceReportingSettings: + m_Enabled: 0 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/VFXManager.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/VFXManager.asset new file mode 100644 index 000000000..3a95c98be --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/VFXManager.asset @@ -0,0 +1,12 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!937362698 &1 +VFXManager: + m_ObjectHideFlags: 0 + m_IndirectShader: {fileID: 0} + m_CopyBufferShader: {fileID: 0} + m_SortShader: {fileID: 0} + m_StripUpdateShader: {fileID: 0} + m_RenderPipeSettingsPath: + m_FixedTimeStep: 0.016666668 + m_MaxDeltaTime: 0.05 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/VersionControlSettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/VersionControlSettings.asset new file mode 100644 index 000000000..dca288142 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/VersionControlSettings.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!890905787 &1 +VersionControlSettings: + m_ObjectHideFlags: 0 + m_Mode: Visible Meta Files + m_CollabEditorSettings: + inProgressEnabled: 1 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/VirtualProjectsConfig.json b/Experimental/DistributedAuthoritySample/ProjectSettings/VirtualProjectsConfig.json new file mode 100644 index 000000000..911d2c6cd --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/VirtualProjectsConfig.json @@ -0,0 +1,4 @@ +{ + "PlayerTags": [], + "version": "1.2.0" +} \ No newline at end of file diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/XRSettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/XRSettings.asset new file mode 100644 index 000000000..482590c19 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/XRSettings.asset @@ -0,0 +1,10 @@ +{ + "m_SettingKeys": [ + "VR Device Disabled", + "VR Device User Alert" + ], + "m_SettingValues": [ + "False", + "False" + ] +} \ No newline at end of file From 5dc657004550e14925cd773764f6fa5054f415c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elfi=20K=C3=BChndorf?= Date: Wed, 24 Jul 2024 14:55:55 +0200 Subject: [PATCH 02/10] Added: proposed folder structure from TDD --- .../DistributedAuthoritySample/Assets/Editor.meta | 8 ++++++++ .../Assets/Editor/InEditorTutorials.meta | 8 ++++++++ .../DistributedAuthoritySample/Assets/Materials.meta | 8 ++++++++ .../DistributedAuthoritySample/Assets/Models.meta | 8 ++++++++ .../Assets/ProjectSettings.meta | 8 ++++++++ .../DistributedAuthoritySample/Assets/Scripts/Camera.meta | 8 ++++++++ .../Assets/Scripts/ConnectionManagement.meta | 8 ++++++++ .../Assets/Scripts/GameManagement.meta | 8 ++++++++ .../Assets/Scripts/Gameplay.meta | 8 ++++++++ .../DistributedAuthoritySample/Assets/Scripts/Misc.meta | 8 ++++++++ .../Assets/Scripts/Physics.meta | 8 ++++++++ .../DistributedAuthoritySample/Assets/Scripts/Player.meta | 8 ++++++++ .../Assets/Scripts/Services.meta | 8 ++++++++ .../DistributedAuthoritySample/Assets/Scripts/UI.meta | 8 ++++++++ .../DistributedAuthoritySample/Assets/Shaders.meta | 8 ++++++++ .../DistributedAuthoritySample/Assets/Textures.meta | 8 ++++++++ 16 files changed, 128 insertions(+) create mode 100644 Experimental/DistributedAuthoritySample/Assets/Editor.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Editor/InEditorTutorials.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Materials.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Models.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/ProjectSettings.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Camera.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/ConnectionManagement.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/GameManagement.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Misc.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Physics.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Player.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Services.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/UI.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Shaders.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Textures.meta diff --git a/Experimental/DistributedAuthoritySample/Assets/Editor.meta b/Experimental/DistributedAuthoritySample/Assets/Editor.meta new file mode 100644 index 000000000..90c5bf101 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1bf4ff1ff9c1c0c4d95ba47363089de9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Editor/InEditorTutorials.meta b/Experimental/DistributedAuthoritySample/Assets/Editor/InEditorTutorials.meta new file mode 100644 index 000000000..a2c3dc372 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Editor/InEditorTutorials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f8031861e8a07264c9ab006de4a1d67d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Materials.meta b/Experimental/DistributedAuthoritySample/Assets/Materials.meta new file mode 100644 index 000000000..56df05502 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c02b96aaa9af22b46a06dafacbdbef33 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Models.meta b/Experimental/DistributedAuthoritySample/Assets/Models.meta new file mode 100644 index 000000000..c3d41bb8c --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Models.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a28dae6b90dd62840a33e7a9ad2f9b6f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/ProjectSettings.meta b/Experimental/DistributedAuthoritySample/Assets/ProjectSettings.meta new file mode 100644 index 000000000..b426d824c --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/ProjectSettings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8de94158c52046c43a91a81f73c61efe +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Camera.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Camera.meta new file mode 100644 index 000000000..5d2e1ca1a --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Camera.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e95df95d8d9e16b449494bda27458880 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/ConnectionManagement.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/ConnectionManagement.meta new file mode 100644 index 000000000..0071fb469 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/ConnectionManagement.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 609c429d38beb0f48814c7f74a08cf83 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/GameManagement.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/GameManagement.meta new file mode 100644 index 000000000..865c31b76 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/GameManagement.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c6043b283fae00340baf1d2122fa906b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay.meta new file mode 100644 index 000000000..4c8240829 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 40c9839f2ad7eb3418dfbfdfbe200684 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Misc.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Misc.meta new file mode 100644 index 000000000..7bd753ccd --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Misc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab9236e31df39da40b0f7d047179c704 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics.meta new file mode 100644 index 000000000..4ca411720 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9a94909e41780254dafcbd4d5b662b44 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Player.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player.meta new file mode 100644 index 000000000..dfa561134 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b1a00b4bd6908e84cb36b6014be2b07e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Services.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Services.meta new file mode 100644 index 000000000..fc04aeb2c --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Services.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 891ac322e4aedbc40ba345a5fd7bddac +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/UI.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/UI.meta new file mode 100644 index 000000000..73e6d6074 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/UI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bae5cc40c7af8504ba38e47eb1a86213 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Shaders.meta b/Experimental/DistributedAuthoritySample/Assets/Shaders.meta new file mode 100644 index 000000000..da1b29bfa --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9077147cd90221743b4415a2612c018e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Textures.meta b/Experimental/DistributedAuthoritySample/Assets/Textures.meta new file mode 100644 index 000000000..63a58c214 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eedfa86dd4ad2214ba0b443f7dccd5a4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From d9edbd114f4744ceaa71137b8a638530a762e224 Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Wed, 24 Jul 2024 14:34:21 -0400 Subject: [PATCH 03/10] consolidating settings folders --- .../Assets/ProjectSettings.meta | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 Experimental/DistributedAuthoritySample/Assets/ProjectSettings.meta diff --git a/Experimental/DistributedAuthoritySample/Assets/ProjectSettings.meta b/Experimental/DistributedAuthoritySample/Assets/ProjectSettings.meta deleted file mode 100644 index b426d824c..000000000 --- a/Experimental/DistributedAuthoritySample/Assets/ProjectSettings.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8de94158c52046c43a91a81f73c61efe -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: From 5e8b0f907f70c306526cf3d0477a17bc68ac2ba0 Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Thu, 25 Jul 2024 11:12:35 -0400 Subject: [PATCH 04/10] adding ignored temp script for testing connection --- .../Assets/Scripts/Temp/ServicesHelper.cs | 148 ++++++++++++++++++ .../Scripts/Temp/ServicesHelper.cs.meta | 2 + 2 files changed, 150 insertions(+) create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Temp/ServicesHelper.cs create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Temp/ServicesHelper.cs.meta diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Temp/ServicesHelper.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Temp/ServicesHelper.cs new file mode 100644 index 000000000..0f9e5fa90 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Temp/ServicesHelper.cs @@ -0,0 +1,148 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using Unity.Netcode; +using Unity.Services.Authentication; +using Unity.Services.Core; +using Unity.Services.Multiplayer; +using Unity.Services.Vivox; +using UnityEngine; +using UnityEngine.SceneManagement; +using Random = System.Random; + +public class ServicesHelper : MonoBehaviour +{ + [SerializeField] + bool m_AutoAuthenticateOnStart; + + [SerializeField] + bool m_InitiateVivoxOnAuthentication; + + string m_SessionName; + + Task m_SessionTask; + + ISession m_LastSession; + + void Awake() + { + DontDestroyOnLoad(this); + } + + async void Start() + { + if (m_AutoAuthenticateOnStart) + { + await UnityServices.InitializeAsync(); + + if (!AuthenticationService.Instance.IsSignedIn) + { + AuthenticationService.Instance.SignInFailed += SignInFailed; + AuthenticationService.Instance.SignedIn += SignedIn; + AuthenticationService.Instance.SwitchProfile(GetRandomString(5)); + await AuthenticationService.Instance.SignInAnonymouslyAsync(); + } + } + } + + void SignInFailed(RequestFailedException obj) + { + Debug.LogWarning($"{nameof(SignedIn)} obj.ErrorCode {obj.ErrorCode}"); + } + + void SignedIn() + { + Debug.Log(nameof(SignedIn)); + if (m_InitiateVivoxOnAuthentication) + { + Login(); + } + + LoadMenuScene(); + } + + void LoadMenuScene() + { + SceneManager.LoadScene("MainMenu"); + } + + void LoadHubScene() + { + SceneManager.LoadScene("HubScene"); + } + + async void Login() + { + await VivoxService.Instance.InitializeAsync(); + + var options = new LoginOptions + { + DisplayName = AuthenticationService.Instance.Profile, + EnableTTS = true + }; + VivoxService.Instance.LoggedIn += LoggedInToVivox; + await VivoxService.Instance.LoginAsync(options); + } + + void LoggedInToVivox() + { + Debug.Log(nameof(LoggedInToVivox)); + } + + static string GetRandomString(int length) + { + var r = new Random(); + return new string(Enumerable.Range(0, length).Select(_ => (Char)r.Next('a', 'z')).ToArray()); + } + + async Task ConnectThroughLiveService(string sessionName) + { + try + { + var options = new CreateSessionOptions(100) + { + Name = sessionName, + MaxPlayers = 100, + }; + + if (m_LastSession == null) + { + m_LastSession = await MultiplayerService.Instance.CreateOrJoinSessionAsync(sessionName, options.WithDistributedConnection()); + } + else + { + await MultiplayerService.Instance.JoinSessionByIdAsync(m_LastSession.Id); + } + + LoadHubScene(); + + // DA TODO: m_NetworkManager.OnClientStopped += OnNetworkManagerStopped; + } + catch (Exception e) + { + Debug.LogException(e); + } + } + + void OnGUI() + { + if (AuthenticationService.Instance == null || !AuthenticationService.Instance.IsSignedIn) + { + return; + } + + if (!NetworkManager.Singleton.IsClient && !NetworkManager.Singleton.IsServer) + { + GUI.enabled = m_SessionTask == null || m_SessionTask.IsCompleted; + + GUILayout.Label("Session Name", GUILayout.Width(100)); + m_SessionName = GUILayout.TextField(m_SessionName); + if (GUILayout.Button("Connect")) + { + m_SessionTask = ConnectThroughLiveService(m_SessionName); + } + + GUI.enabled = true; + } + } +} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Temp/ServicesHelper.cs.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Temp/ServicesHelper.cs.meta new file mode 100644 index 000000000..14c019b1f --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Temp/ServicesHelper.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b5134217b751de44fb27f189c7ef29e2 \ No newline at end of file From 3c8b8ac11ffaaa8fbd474f401ad9e93f29ba0784 Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Fri, 26 Jul 2024 17:49:50 -0400 Subject: [PATCH 05/10] importing asteroids base classes & locomotion controller wip --- .../Assets/InputSystem.meta | 8 + .../InputSystem/AvatarActions.inputactions | 1057 +++++++++++++++++ .../AvatarActions.inputactions.meta | 14 + .../Assets/Prefabs/Avatar.prefab | 275 ++++- .../Assets/Scenes/HubScene.unity | 155 +++ .../Gameplay/BaseObjectMotionHandler.cs | 591 +++++++++ .../Gameplay/BaseObjectMotionHandler.cs.meta | 11 + .../Assets/Scripts/Gameplay/IDamageHandler.cs | 19 + .../Scripts/Gameplay/IDamageHandler.cs.meta | 11 + .../Assets/Scripts/Input.meta | 8 + .../Assets/Scripts/Input/AvatarInputs.cs | 73 ++ .../Assets/Scripts/Input/AvatarInputs.cs.meta | 2 + .../Scripts/Physics/CollisionMessageInfo.cs | 148 +++ .../Physics/CollisionMessageInfo.cs.meta | 11 + .../Scripts/Physics/PhysicsObjectMotion.cs | 662 +++++++++++ .../Physics/PhysicsObjectMotion.cs.meta | 11 + .../Assets/Scripts/Player/AvatarTransform.cs | 230 ++++ .../Scripts/Player/AvatarTransform.cs.meta | 2 + .../ProjectSettings/EditorBuildSettings.asset | 2 +- .../ProjectSettings/ProjectSettings.asset | 294 ++--- 20 files changed, 3434 insertions(+), 150 deletions(-) create mode 100644 Experimental/DistributedAuthoritySample/Assets/InputSystem.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/InputSystem/AvatarActions.inputactions create mode 100644 Experimental/DistributedAuthoritySample/Assets/InputSystem/AvatarActions.inputactions.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Input.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs.meta diff --git a/Experimental/DistributedAuthoritySample/Assets/InputSystem.meta b/Experimental/DistributedAuthoritySample/Assets/InputSystem.meta new file mode 100644 index 000000000..c99e9995b --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/InputSystem.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4712f1f593c284efd924c2fd58555653 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/InputSystem/AvatarActions.inputactions b/Experimental/DistributedAuthoritySample/Assets/InputSystem/AvatarActions.inputactions new file mode 100644 index 000000000..05274d353 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/InputSystem/AvatarActions.inputactions @@ -0,0 +1,1057 @@ +{ + "name": "AvatarActions", + "maps": [ + { + "name": "Player", + "id": "df70fa95-8a34-4494-b137-73ab6b9c7d37", + "actions": [ + { + "name": "Move", + "type": "Value", + "id": "351f2ccd-1f9f-44bf-9bec-d62ac5c5f408", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Look", + "type": "Value", + "id": "6b444451-8a00-4d00-a97e-f47457f736a8", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Attack", + "type": "Button", + "id": "6c2ab1b8-8984-453a-af3d-a3c78ae1679a", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Interact", + "type": "Button", + "id": "852140f2-7766-474d-8707-702459ba45f3", + "expectedControlType": "Button", + "processors": "", + "interactions": "Hold", + "initialStateCheck": false + }, + { + "name": "Crouch", + "type": "Button", + "id": "27c5f898-bc57-4ee1-8800-db469aca5fe3", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Jump", + "type": "Button", + "id": "f1ba0d36-48eb-4cd5-b651-1c94a6531f70", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Previous", + "type": "Button", + "id": "2776c80d-3c14-4091-8c56-d04ced07a2b0", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Next", + "type": "Button", + "id": "b7230bb6-fc9b-4f52-8b25-f5e19cb2c2ba", + "expectedControlType": "", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Sprint", + "type": "PassThrough", + "id": "641cd816-40e6-41b4-8c3d-04687c349290", + "expectedControlType": "", + "processors": "", + "interactions": "", + "initialStateCheck": false + } + ], + "bindings": [ + { + "name": "", + "id": "978bfe49-cc26-4a3d-ab7b-7d7a29327403", + "path": "/leftStick", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "WASD", + "id": "00ca640b-d935-4593-8157-c05846ea39b3", + "path": "Dpad", + "interactions": "", + "processors": "", + "groups": "", + "action": "Move", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "e2062cb9-1b15-46a2-838c-2f8d72a0bdd9", + "path": "/w", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "8180e8bd-4097-4f4e-ab88-4523101a6ce9", + "path": "/upArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "320bffee-a40b-4347-ac70-c210eb8bc73a", + "path": "/s", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "1c5327b5-f71c-4f60-99c7-4e737386f1d1", + "path": "/downArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "d2581a9b-1d11-4566-b27d-b92aff5fabbc", + "path": "/a", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "2e46982e-44cc-431b-9f0b-c11910bf467a", + "path": "/leftArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "fcfe95b8-67b9-4526-84b5-5d0bc98d6400", + "path": "/d", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "77bff152-3580-4b21-b6de-dcd0c7e41164", + "path": "/rightArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "1635d3fe-58b6-4ba9-a4e2-f4b964f6b5c8", + "path": "/{Primary2DAxis}", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "3ea4d645-4504-4529-b061-ab81934c3752", + "path": "/stick", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "c1f7a91b-d0fd-4a62-997e-7fb9b69bf235", + "path": "/rightStick", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8c8e490b-c610-4785-884f-f04217b23ca4", + "path": "/delta", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse;Touch", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "3e5f5442-8668-4b27-a940-df99bad7e831", + "path": "/{Hatswitch}", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "143bb1cd-cc10-4eca-a2f0-a3664166fe91", + "path": "/buttonWest", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "05f6913d-c316-48b2-a6bb-e225f14c7960", + "path": "/leftButton", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "886e731e-7071-4ae4-95c0-e61739dad6fd", + "path": "/primaryTouch/tap", + "interactions": "", + "processors": "", + "groups": ";Touch", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "ee3d0cd2-254e-47a7-a8cb-bc94d9658c54", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8255d333-5683-4943-a58a-ccb207ff1dce", + "path": "/{PrimaryAction}", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "b3c1c7f0-bd20-4ee7-a0f1-899b24bca6d7", + "path": "/enter", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "cbac6039-9c09-46a1-b5f2-4e5124ccb5ed", + "path": "/2", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Next", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "e15ca19d-e649-4852-97d5-7fe8ccc44e94", + "path": "/dpad/right", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Next", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "f2e9ba44-c423-42a7-ad56-f20975884794", + "path": "/leftShift", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Sprint", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8cbb2f4b-a784-49cc-8d5e-c010b8c7f4e6", + "path": "/leftStickPress", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Sprint", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "d8bf24bf-3f2f-4160-a97c-38ec1eb520ba", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Sprint", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "eb40bb66-4559-4dfa-9a2f-820438abb426", + "path": "/space", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "daba33a1-ad0c-4742-a909-43ad1cdfbeb6", + "path": "/buttonSouth", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "603f3daf-40bd-4854-8724-93e8017f59e3", + "path": "/secondaryButton", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "1534dc16-a6aa-499d-9c3a-22b47347b52a", + "path": "/1", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Previous", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "25060bbd-a3a6-476e-8fba-45ae484aad05", + "path": "/dpad/left", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Previous", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "1c04ea5f-b012-41d1-a6f7-02e963b52893", + "path": "/e", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Interact", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "b3f66d0b-7751-423f-908b-a11c5bd95930", + "path": "/buttonNorth", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Interact", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4f4649ac-64a8-4a73-af11-b3faef356a4d", + "path": "/buttonEast", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Crouch", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "36e52cba-0905-478e-a818-f4bfcb9f3b9a", + "path": "/c", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Crouch", + "isComposite": false, + "isPartOfComposite": false + } + ] + }, + { + "name": "UI", + "id": "272f6d14-89ba-496f-b7ff-215263d3219f", + "actions": [ + { + "name": "Navigate", + "type": "PassThrough", + "id": "c95b2375-e6d9-4b88-9c4c-c5e76515df4b", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Submit", + "type": "Button", + "id": "7607c7b6-cd76-4816-beef-bd0341cfe950", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Cancel", + "type": "Button", + "id": "15cef263-9014-4fd5-94d9-4e4a6234a6ef", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Point", + "type": "PassThrough", + "id": "32b35790-4ed0-4e9a-aa41-69ac6d629449", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Click", + "type": "PassThrough", + "id": "3c7022bf-7922-4f7c-a998-c437916075ad", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "RightClick", + "type": "PassThrough", + "id": "44b200b1-1557-4083-816c-b22cbdf77ddf", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "MiddleClick", + "type": "PassThrough", + "id": "dad70c86-b58c-4b17-88ad-f5e53adf419e", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "ScrollWheel", + "type": "PassThrough", + "id": "0489e84a-4833-4c40-bfae-cea84b696689", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "TrackedDevicePosition", + "type": "PassThrough", + "id": "24908448-c609-4bc3-a128-ea258674378a", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "TrackedDeviceOrientation", + "type": "PassThrough", + "id": "9caa3d8a-6b2f-4e8e-8bad-6ede561bd9be", + "expectedControlType": "Quaternion", + "processors": "", + "interactions": "", + "initialStateCheck": false + } + ], + "bindings": [ + { + "name": "Gamepad", + "id": "809f371f-c5e2-4e7a-83a1-d867598f40dd", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "14a5d6e8-4aaf-4119-a9ef-34b8c2c548bf", + "path": "/leftStick/up", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "9144cbe6-05e1-4687-a6d7-24f99d23dd81", + "path": "/rightStick/up", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "2db08d65-c5fb-421b-983f-c71163608d67", + "path": "/leftStick/down", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "58748904-2ea9-4a80-8579-b500e6a76df8", + "path": "/rightStick/down", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "8ba04515-75aa-45de-966d-393d9bbd1c14", + "path": "/leftStick/left", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "712e721c-bdfb-4b23-a86c-a0d9fcfea921", + "path": "/rightStick/left", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "fcd248ae-a788-4676-a12e-f4d81205600b", + "path": "/leftStick/right", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "1f04d9bc-c50b-41a1-bfcc-afb75475ec20", + "path": "/rightStick/right", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "fb8277d4-c5cd-4663-9dc7-ee3f0b506d90", + "path": "/dpad", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "Joystick", + "id": "e25d9774-381c-4a61-b47c-7b6b299ad9f9", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "3db53b26-6601-41be-9887-63ac74e79d19", + "path": "/stick/up", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "0cb3e13e-3d90-4178-8ae6-d9c5501d653f", + "path": "/stick/down", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "0392d399-f6dd-4c82-8062-c1e9c0d34835", + "path": "/stick/left", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "942a66d9-d42f-43d6-8d70-ecb4ba5363bc", + "path": "/stick/right", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "Keyboard", + "id": "ff527021-f211-4c02-933e-5976594c46ed", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "563fbfdd-0f09-408d-aa75-8642c4f08ef0", + "path": "/w", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "eb480147-c587-4a33-85ed-eb0ab9942c43", + "path": "/upArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "2bf42165-60bc-42ca-8072-8c13ab40239b", + "path": "/s", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "85d264ad-e0a0-4565-b7ff-1a37edde51ac", + "path": "/downArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "74214943-c580-44e4-98eb-ad7eebe17902", + "path": "/a", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "cea9b045-a000-445b-95b8-0c171af70a3b", + "path": "/leftArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "8607c725-d935-4808-84b1-8354e29bab63", + "path": "/d", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "4cda81dc-9edd-4e03-9d7c-a71a14345d0b", + "path": "/rightArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "9e92bb26-7e3b-4ec4-b06b-3c8f8e498ddc", + "path": "*/{Submit}", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR", + "action": "Submit", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "82627dcc-3b13-4ba9-841d-e4b746d6553e", + "path": "*/{Cancel}", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR", + "action": "Cancel", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "c52c8e0b-8179-41d3-b8a1-d149033bbe86", + "path": "/position", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "e1394cbc-336e-44ce-9ea8-6007ed6193f7", + "path": "/position", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "5693e57a-238a-46ed-b5ae-e64e6e574302", + "path": "/touch*/position", + "interactions": "", + "processors": "", + "groups": "Touch", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4faf7dc9-b979-4210-aa8c-e808e1ef89f5", + "path": "/leftButton", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8d66d5ba-88d7-48e6-b1cd-198bbfef7ace", + "path": "/tip", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "47c2a644-3ebc-4dae-a106-589b7ca75b59", + "path": "/touch*/press", + "interactions": "", + "processors": "", + "groups": "Touch", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "bb9e6b34-44bf-4381-ac63-5aa15d19f677", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "38c99815-14ea-4617-8627-164d27641299", + "path": "/scroll", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "ScrollWheel", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4c191405-5738-4d4b-a523-c6a301dbf754", + "path": "/rightButton", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "RightClick", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "24066f69-da47-44f3-a07e-0015fb02eb2e", + "path": "/middleButton", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "MiddleClick", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "7236c0d9-6ca3-47cf-a6ee-a97f5b59ea77", + "path": "/devicePosition", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "TrackedDevicePosition", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "23e01e3a-f935-4948-8d8b-9bcac77714fb", + "path": "/deviceRotation", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "TrackedDeviceOrientation", + "isComposite": false, + "isPartOfComposite": false + } + ] + } + ], + "controlSchemes": [ + { + "name": "Keyboard&Mouse", + "bindingGroup": "Keyboard&Mouse", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + }, + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "Gamepad", + "bindingGroup": "Gamepad", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "Touch", + "bindingGroup": "Touch", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "Joystick", + "bindingGroup": "Joystick", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "XR", + "bindingGroup": "XR", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + } + ] +} \ No newline at end of file diff --git a/Experimental/DistributedAuthoritySample/Assets/InputSystem/AvatarActions.inputactions.meta b/Experimental/DistributedAuthoritySample/Assets/InputSystem/AvatarActions.inputactions.meta new file mode 100644 index 000000000..f3e4723a7 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/InputSystem/AvatarActions.inputactions.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: dcd1b4eb76b964f40afe6c0a3ca65c82 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} + generateWrapperCode: 0 + wrapperCodePath: + wrapperClassName: + wrapperCodeNamespace: diff --git a/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab b/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab index d1fce1f89..55313c00c 100644 --- a/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab +++ b/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab @@ -1,5 +1,113 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!1 &2971605785670457434 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 370971123281630519} + - component: {fileID: 3081239909905841813} + - component: {fileID: 5988919140179887555} + - component: {fileID: 1049656444021924520} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &370971123281630519 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2971605785670457434} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0.5} + m_LocalScale: {x: 0.5, y: 0.2, z: 0.54218} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 527982249900556139} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3081239909905841813 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2971605785670457434} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5988919140179887555 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2971605785670457434} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &1049656444021924520 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2971605785670457434} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} --- !u!1 &3998769334658168242 GameObject: m_ObjectHideFlags: 0 @@ -31,7 +139,8 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 370971123281630519} m_Father: {fileID: 378099091213283077} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!33 &5867719757342769277 @@ -120,6 +229,11 @@ GameObject: m_Component: - component: {fileID: 378099091213283077} - component: {fileID: 2864305741433477372} + - component: {fileID: 5446307037829169848} + - component: {fileID: 4745766379562620470} + - component: {fileID: -8100831418301897270} + - component: {fileID: 4903152183366241606} + - component: {fileID: 8197190117666738524} m_Layer: 0 m_Name: Avatar m_TagString: Untagged @@ -155,7 +269,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} m_Name: m_EditorClassIdentifier: - GlobalObjectIdHash: 2473698027 + GlobalObjectIdHash: 3001504883 InScenePlacedSourceGlobalObjectIdHash: 0 DeferredDespawnTick: 0 Ownership: 0 @@ -166,3 +280,160 @@ MonoBehaviour: SpawnWithObservers: 1 DontDestroyWithOwner: 0 AutoObjectParentSync: 1 +--- !u!114 &5446307037829169848 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5478015027486214707} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5e253f865ab604b12a7f84e3d97704d8, type: 3} + m_Name: + m_EditorClassIdentifier: + AuthorityMode: 1 + UseUnreliableDeltas: 0 + SyncPositionX: 1 + SyncPositionY: 1 + SyncPositionZ: 1 + SyncRotAngleX: 0 + SyncRotAngleY: 1 + SyncRotAngleZ: 0 + SyncScaleX: 0 + SyncScaleY: 0 + SyncScaleZ: 0 + PositionThreshold: 0.001 + RotAngleThreshold: 0.01 + ScaleThreshold: 0.01 + UseQuaternionSynchronization: 0 + UseQuaternionCompression: 0 + UseHalfFloatPrecision: 0 + InLocalSpace: 0 + Interpolate: 1 + SlerpPosition: 0 + BaseObjectMotionHandlerPropertiesVisible: 1 + NetworkTransformPropertiesVisible: 1 + IsPooled: 1 + CollisionType: 0 + CollisionDamage: 0 + DebugBoundaryCheck: 0 + DebugCollisions: 0 + DebugDamage: 0 + IsPhysicsBody: 0 + EnableBoundary: 1 + Colliders: [] + PhysicsObjectMotionPropertiesVisible: 1 + CollisionImpulseEntries: [] + MaxAngularVelocity: 30 + MaxVelocity: 30 + StartingMass: 1 + MinMaxStartingTorque: + Min: 5 + Max: 15 + MinMaxStartingForce: + Min: 5 + Max: 30 + PropertiesVisible: 1 + PlayerInput: {fileID: 4903152183366241606} + AvatarInputs: {fileID: 8197190117666738524} + WalkSpeed: 5 + SprintSpeed: 10 + Acceleration: 50 + Deceleration: 25 + AirControlFactor: 0.5 + JumpImpusle: 7 + CustomGravityMultiplier: 2 + RotationSpeed: 700 + GroundCheckDistance: 1.1 +--- !u!54 &4745766379562620470 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5478015027486214707} + serializedVersion: 4 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &-8100831418301897270 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5478015027486214707} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f6c0be61502bb534f922ebb746851216, type: 3} + m_Name: + m_EditorClassIdentifier: + UseRigidBodyForMotion: 1 + AutoUpdateKinematicState: 1 + AutoSetKinematicOnDespawn: 1 +--- !u!114 &4903152183366241606 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5478015027486214707} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Actions: {fileID: -944628639613478452, guid: dcd1b4eb76b964f40afe6c0a3ca65c82, type: 3} + m_NotificationBehavior: 0 + m_UIInputModule: {fileID: 0} + m_DeviceLostEvent: + m_PersistentCalls: + m_Calls: [] + m_DeviceRegainedEvent: + m_PersistentCalls: + m_Calls: [] + m_ControlsChangedEvent: + m_PersistentCalls: + m_Calls: [] + m_ActionEvents: [] + m_NeverAutoSwitchControlSchemes: 0 + m_DefaultControlScheme: + m_DefaultActionMap: Player + m_SplitScreenIndex: -1 + m_Camera: {fileID: 0} +--- !u!114 &8197190117666738524 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5478015027486214707} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7e9f71718dd134b14b300e378e98c718, type: 3} + m_Name: + m_EditorClassIdentifier: + move: {x: 0, y: 0} + look: {x: 0, y: 0} + jump: 0 + sprint: 0 + analogMovement: 0 + cursorLocked: 1 + cursorInputForLook: 1 diff --git a/Experimental/DistributedAuthoritySample/Assets/Scenes/HubScene.unity b/Experimental/DistributedAuthoritySample/Assets/Scenes/HubScene.unity index 51c9a297f..59c32d26d 100644 --- a/Experimental/DistributedAuthoritySample/Assets/Scenes/HubScene.unity +++ b/Experimental/DistributedAuthoritySample/Assets/Scenes/HubScene.unity @@ -288,6 +288,159 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1305680749 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1305680751} + - component: {fileID: 1305680750} + m_Layer: 0 + m_Name: RigidbodyContactEventManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1305680750 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1305680749} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 739e5cee846b6384988f9a47e4691836, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1305680751 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1305680749} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1888825843 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1888825847} + - component: {fileID: 1888825846} + - component: {fileID: 1888825845} + - component: {fileID: 1888825844} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &1888825844 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1888825843} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1888825845 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1888825843} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1888825846 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1888825843} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1888825847 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1888825843} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 100, y: 1, z: 100} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &2024073102 PrefabInstance: m_ObjectHideFlags: 0 @@ -352,3 +505,5 @@ SceneRoots: - {fileID: 410087041} - {fileID: 832575519} - {fileID: 2024073102} + - {fileID: 1888825847} + - {fileID: 1305680751} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs new file mode 100644 index 000000000..812df5a71 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs @@ -0,0 +1,591 @@ +using System; +using System.Runtime.CompilerServices; +using Unity.Netcode; +using Unity.Netcode.Components; +using UnityEngine; +using Random = UnityEngine.Random; +using System.Collections.Generic; + +#if UNITY_EDITOR +using Unity.Netcode.Editor; +using UnityEditor; +/// +/// The custom editor for the component. +/// +[CustomEditor(typeof(BaseObjectMotionHandler), true)] +public class BaseObjectMotionHandlerEditor : NetworkTransformEditor +{ + private SerializedProperty m_IsPooled; + private SerializedProperty m_CollisionType; + private SerializedProperty m_CollisionDamage; + private SerializedProperty m_DebugCollisions; + private SerializedProperty m_DebugDamage; + private SerializedProperty m_EnableBoundary; + private SerializedProperty m_Colliders; + + public override void OnEnable() + { + m_IsPooled = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.IsPooled)); + m_Colliders = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.Colliders)); + m_CollisionType = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.CollisionType)); + m_CollisionDamage = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.CollisionDamage)); + m_DebugCollisions = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.DebugCollisions)); + m_DebugDamage = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.DebugDamage)); + m_EnableBoundary = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.EnableBoundary)); + + base.OnEnable(); + } + + public override void OnInspectorGUI() + { + var baseObject = target as BaseObjectMotionHandler; + baseObject.BaseObjectMotionHandlerPropertiesVisible = EditorGUILayout.BeginFoldoutHeaderGroup(baseObject.BaseObjectMotionHandlerPropertiesVisible, $"{nameof(BaseObjectMotionHandler)} Properties"); + if (baseObject.BaseObjectMotionHandlerPropertiesVisible) + { + // End the header group since m_Colliders is a header group + EditorGUILayout.EndFoldoutHeaderGroup(); + EditorGUILayout.PropertyField(m_IsPooled); + EditorGUILayout.PropertyField(m_Colliders); + EditorGUILayout.PropertyField(m_CollisionType); + EditorGUILayout.PropertyField(m_CollisionDamage); + EditorGUILayout.PropertyField(m_DebugCollisions); + EditorGUILayout.PropertyField(m_DebugDamage); + EditorGUILayout.PropertyField(m_EnableBoundary); + } + else + { + EditorGUILayout.EndFoldoutHeaderGroup(); + } + + EditorGUILayout.Space(); + + baseObject.NetworkTransformPropertiesVisible = EditorGUILayout.BeginFoldoutHeaderGroup(baseObject.NetworkTransformPropertiesVisible, $"{nameof(NetworkTransform)} Properties"); + if (baseObject.NetworkTransformPropertiesVisible) + { + base.OnInspectorGUI(); + } + else + { + serializedObject.ApplyModifiedProperties(); + } + EditorGUILayout.EndFoldoutHeaderGroup(); + } +} +#endif + +/// +/// Projectiles will be owner driven +/// +public partial class BaseObjectMotionHandler : NetworkTransform, ICollisionHandler, IContactEventHandler +{ + +#if UNITY_EDITOR + public bool BaseObjectMotionHandlerPropertiesVisible = false; + public bool NetworkTransformPropertiesVisible = false; +#endif + private static GameObject WorldBoundary; + + // Defaults to 1024 but can be updated by adding a GameObject named WorldBoundary and adding a SphereCollider to that. + private static float WorldBoundaryRadius = 1024.0f; + + public bool IsPooled = true; + public CollisionTypes CollisionType; + public ushort CollisionDamage; + + public Action OnNetworkObjectDespawned; + + public bool DebugBoundaryCheck; + + protected CollisionMessageInfo CollisionMessage = new CollisionMessageInfo(); + private Rigidbody m_Rigidbody; + private NetworkRigidbody m_NetworkRigidbody; + + public Rigidbody Rigidbody => m_Rigidbody; + public NetworkRigidbody NetworkRigidbody => m_NetworkRigidbody; + + [Tooltip("Enables/Disables collision logging (based on per derived type)")] + public bool DebugCollisions; + + [Tooltip("Enables/Disables damage logging (based on per derived type)")] + public bool DebugDamage; + + [HideInInspector] + public bool IsPhysicsBody; + + [Tooltip("When enabled, all physics bodies will head back towards the center once they reach the boundary limits.")] + public bool EnableBoundary = true; + + [Tooltip("Add all colliders to this list that will be used to detect collisions (exclude triggers).")] + public List Colliders; + + private Dictionary ColliderScales = new Dictionary(); + + protected void EnableColliders(bool enable) + { + foreach (var collider in Colliders) + { + collider.enabled = enable; + } + } + + private const float k_BoundaryCheckFrequency = 0.06667f; + private const int k_BoundaryCheckDistributionRes = 10; + private static int s_BoundaryOffsetCount = 1; + private float m_NextBoundaryCheck; + + public Rigidbody GetRigidbody() { return m_Rigidbody; } + + protected virtual Vector3 OnGetObjectVelocity(bool getReference = false) + { + if (m_Rigidbody != null) + { +#if UNITY_2023_3_OR_NEWER + return m_Rigidbody.linearVelocity; +#else + return m_Rigidbody.velocity; +#endif + } + return Vector3.zero; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Vector3 GetObjectVelocity(bool getReference = false) + { + return OnGetObjectVelocity(getReference); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetObjectVelocity(Vector3 velocity) + { + if (m_Rigidbody != null) + { +#if UNITY_2023_3_OR_NEWER + m_Rigidbody.linearVelocity = velocity; +#else + m_Rigidbody.velocity = velocity; +#endif + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected virtual Vector3 OnGetObjectAngularVelocity() + { + if (m_Rigidbody != null) + { + return m_Rigidbody.angularVelocity; + } + return Vector3.zero; + } + + public Vector3 GetObjectAngularVelocity() + { + return OnGetObjectAngularVelocity(); + } + + + protected void IgnoreCollision(GameObject objectA, GameObject objectB, bool shouldIgnore) + { + if (objectA == null || objectB == null) + { + return; + } + + var rootA = objectA.transform.root.gameObject; + var rootB = objectB.transform.root.gameObject; + + var collidersA = rootA.GetComponentsInChildren(); + var collidersB = rootB.GetComponentsInChildren(); + + foreach (var colliderA in collidersA) + { + foreach (var colliderB in collidersB) + { + Physics.IgnoreCollision(colliderA, colliderB, shouldIgnore); + } + } + } + + public override void OnNetworkDespawn() + { + base.OnNetworkDespawn(); + OnNetworkObjectDespawned?.Invoke(); + OnNetworkObjectDespawned = null; + + /*var fxObjects = GetComponentsInChildren(); + foreach (var fxObject in fxObjects) + { + fxObject.transform.SetParent(null); + }*/ + } + + /// + /// Override this method to make adjustments for wrapping + /// + protected virtual bool OnBoundaryReached() + { + return true; + } + + // Distribute the boundary check processing evenly amongst all instances + private void SetNextBoundaryCheck(float timeOffset = k_BoundaryCheckFrequency, bool init = false) + { + if (init) + { + s_BoundaryOffsetCount++; + m_NextBoundaryCheck = Time.realtimeSinceStartup + (timeOffset * (s_BoundaryOffsetCount % k_BoundaryCheckDistributionRes)); + } + else + { + m_NextBoundaryCheck = Time.realtimeSinceStartup + timeOffset; + } + } + + private void CheckBoundary() + { + if (Rigidbody == null || Rigidbody != null && Rigidbody.isKinematic) + { + return; + } + if (EnableBoundary && m_NextBoundaryCheck < Time.realtimeSinceStartup) + { + var distance = Vector3.Distance(Vector3.zero, transform.position); + // if we reached the maximum boundary, then reverse the velocity of the Rigidbody if it has one + if (distance >= WorldBoundaryRadius && OnBoundaryReached()) + { + + var dir = Vector3.zero - transform.position; + var velocity = GetObjectVelocity(); + velocity = velocity.magnitude * dir; + SetObjectVelocity(velocity); + } + else + { + SetNextBoundaryCheck(); + } + } + } + + protected override void Awake() + { + if (WorldBoundary == null) + { + WorldBoundary = GameObject.Find("WorldBoundary"); + if (WorldBoundary != null) + { + var sphereCollider = WorldBoundary.GetComponent(); + WorldBoundaryRadius = sphereCollider.radius; + } + } + + m_Rigidbody = GetComponent(); + m_NetworkRigidbody = GetComponent(); + + SetNextBoundaryCheck(init: true); + + base.Awake(); + } + + protected virtual void Start() + { + CollisionMessage.Damage = CollisionDamage; + CollisionMessage.SetFlag(true, (uint)CollisionType); + } + + /// + /// Invoked every network tick if this instance has sent a update. + /// + /// + protected override void OnAuthorityPushTransformState(ref NetworkTransformState networkTransformState) + { + CheckBoundary(); + base.OnAuthorityPushTransformState(ref networkTransformState); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static public GameObject GetRootParent(GameObject parent) + { + return parent.transform.root.gameObject; + } + + /// + /// This method provides the ability to make adjustments to the collision message as well as apply damage locally if needed + /// + /// + /// + protected virtual bool OnPrepareCollisionMessage(Vector3 averagedCollisionNormal, BaseObjectMotionHandler targetBaseObjectMotionHandler) + { + return true; + } + + protected virtual void OnHandleCollision(CollisionMessageInfo collisionMessage, bool isLocal = false, bool applyImmediately = false) + { + } + + public void HandleCollision(CollisionMessageInfo collisionMessage, bool isLocal = false, bool applyImmediately = false) + { + OnHandleCollision(collisionMessage, isLocal, applyImmediately); + // Hanlding is invoked before logging so logging can determine the end result. + if (DebugCollisions) + { + LogHandleCollision(collisionMessage); + } + } + + /// + /// Used to communicate collisions + /// + /// + /// + [Rpc(SendTo.Authority, RequireOwnership = false)] + public void HandleCollisionRpc(CollisionMessageInfo collisionMessage, RpcParams rpcParams = default) + { + // If authority changes while this message is in flight, forward it to the new authority + if (!HasAuthority) + { + LogMessage($"[HandleCollisionRpc][Not Owner][Routing Collision][{name}] Routing to Client-{OwnerClientId}"); + SendCollisionMessage(CollisionMessage); + return; + } + + CollisionMessage.SourceOwner = rpcParams.Receive.SenderClientId; + CollisionMessage.TargetOwner = OwnerClientId; + HandleCollision(collisionMessage); + } + + /// + /// Invoked by the owner of the object inflicting damage, this will handle the RPC routing + /// of the message to the appropriate targeted owner of the object taking damage + /// + /// + public void SendCollisionMessage(CollisionMessageInfo collisionMessage) + { + LogDamage(collisionMessage); + HandleCollisionRpc(collisionMessage); + } + + /// + /// Override this method if you have registerd the instance with and + /// want to customize collision. + /// + /// + /// Only automatically handles collisions. For an example of a customized contact event + /// handler look over . + /// + /// The average normal of the collisions contacts + /// The that collided with this object. + protected virtual void OnContactEvent(ulong eventId, Vector3 averagedCollisionNormal, Rigidbody collidingBody, Vector3 contactPoint, bool hasCollisionStay = false, Vector3 averagedCollisionStayNormal = default) + { + + } + + protected ulong LastEventId { get; private set; } + /// + /// Invoked from when a non-kinematic body collides + /// with another registered . + /// + /// The averaged normal of the collision + /// The this objects collided with + public void ContactEvent(ulong eventId, Vector3 averageNormal, Rigidbody collidingBody, Vector3 contactPoint, bool hasCollisionStay = false, Vector3 averagedCollisionStayNormal = default) + { + if (!IsSpawned) + { + return; + } + OnContactEvent(eventId, averageNormal, collidingBody, contactPoint, hasCollisionStay, averagedCollisionStayNormal); + LastEventId = eventId; + } + + + /// + /// Invoked this to send a collision message to the authoritative instance. + /// + /// + /// + protected void EventCollision(Vector3 averagedCollisionNormal, BaseObjectMotionHandler collidingBodyBaseObject) + { +#if DEBUG || UNITY_EDITOR + if (DebugCollisions) + { + LogCollision(ref collidingBodyBaseObject); + } +#endif + + if (OnPrepareCollisionMessage(averagedCollisionNormal, collidingBodyBaseObject)) + { + CollisionId++; + CollisionMessage.CollisionId = CollisionId; + CollisionMessage.Time = Time.realtimeSinceStartup; + CollisionMessage.Source = OwnerClientId; + CollisionMessage.SourceId = NetworkObjectId; + CollisionMessage.Destination = collidingBodyBaseObject.OwnerClientId; + CollisionMessage.DestNetworkObjId = collidingBodyBaseObject.NetworkObjectId; + CollisionMessage.DestBehaviourId = collidingBodyBaseObject.NetworkBehaviourId; + + // Otherwise, send the collision message to the owner of the object + collidingBodyBaseObject.SendCollisionMessage(CollisionMessage); + } + } + + #region DEBUG CONSOLE LOGGING METHODS + + /// + /// Override to handle local collisions generating an outbound message + /// + /// + /// + protected virtual string OnLogCollision(ref BaseObjectMotionHandler objectHit) + { + return "[LocalCollision-End]"; + } + + private static int CollisionId = 0; + private void LogCollision(ref BaseObjectMotionHandler objectHit) + { + if (!DebugCollisions) + { + return; + } + var distance = Vector3.Distance(transform.position, objectHit.transform.position); + /*NetworkManagerHelper.Instance.*/LogMessage($"[{Time.realtimeSinceStartup}][LocalCollision][{name}][collided with][{objectHit.name}][Collider:{name}][Distance: {distance}]" + + $"{OnLogCollision(ref objectHit)}."); + } + + protected virtual string OnLogDamage(CollisionMessageInfo collisionMessage) + { + return string.Empty; + } + + protected void LogDamage(CollisionMessageInfo collisionMessage) + { + if (!DebugDamage || collisionMessage.Damage == 0) + { + return; + } + var additionalInfo = OnLogDamage(collisionMessage); + /*NetworkManagerHelper.Instance.*/LogMessage($"[{name}][++Damaged++][Client-{collisionMessage.TargetOwner}][{collisionMessage.GetCollisionType()}][Dmg:{collisionMessage.Damage}] {additionalInfo}"); + } + + /// + /// Override to log incoming collision messages + /// + /// + protected virtual string OnLogHandleCollision(ref CollisionMessageInfo collisionMessage) + { + return "[CollisionMessage-End]"; + } + + private void LogHandleCollision(CollisionMessageInfo collisionMessage, bool isLocal = false) + { + var distance = -1.0f; + if (NetworkManager.SpawnManager.SpawnedObjects.ContainsKey(collisionMessage.DestNetworkObjId)) + { + distance = Vector3.Distance(transform.position, NetworkManager.SpawnManager.SpawnedObjects[collisionMessage.DestNetworkObjId].transform.position); + } + var distStr = distance == -1.0f ? $"{collisionMessage.DestNetworkObjId} DNE!!" : $"Distance: {distance}"; + /*NetworkManagerHelper.Instance.*/LogMessage($"[{collisionMessage.CollisionId}][{collisionMessage.Time}][CollisionMessage][IsLocal: {isLocal}][{name}][Src:{collisionMessage.Source}][Dest:{collisionMessage.Destination}]" + + $"[NObjId:{collisionMessage.DestNetworkObjId}][NBvrId:{collisionMessage.DestBehaviourId}][{distStr}]{OnLogHandleCollision(ref collisionMessage)}."); + } + + protected void LogMessage(string msg, bool forceMessage = false, float messageTime = 10.0f) + { + /*NetworkManagerHelper.Instance.LogMessage*/ + Debug.Log($"[{name}]{msg}");/*, messageTime, forceMessage);*/ + } + + #endregion + + #region VECTOR AND EULER HELPER METHODS + /// + /// Enable this to get 6 decimal precision when logging Vector3 values + /// + private bool m_HigPrecisionDecimals = false; + protected string GetVector3Values(ref Vector3 vector3) + { + if (m_HigPrecisionDecimals) + { + return $"({vector3.x:F6},{vector3.y:F6},{vector3.z:F6})"; + } + else + { + return $"({vector3.x:F2},{vector3.y:F2},{vector3.z:F2})"; + } + } + + protected string GetVector3Values(Vector3 vector3) + { + return GetVector3Values(ref vector3); + } + + protected Vector3 GetRandomVector3(float min, float max, Vector3 baseLine, bool randomlyApplySign = false) + { + var retValue = new Vector3(baseLine.x * Random.Range(min, max), baseLine.y * Random.Range(min, max), baseLine.z * Random.Range(min, max)); + if (!randomlyApplySign) + { + return retValue; + } + + retValue.x *= Random.Range(1, 100) >= 50 ? -1 : 1; + retValue.y *= Random.Range(1, 100) >= 50 ? -1 : 1; + retValue.z *= Random.Range(1, 100) >= 50 ? -1 : 1; + return retValue; + } + + protected Vector3 GetRandomVector3(MinMaxVector2Physics minMax, Vector3 baseLine, bool randomlyApplySign = false) + { + return GetRandomVector3(minMax.Min, minMax.Max, baseLine, randomlyApplySign); + } + + private const float k_DefaultThreshold = 0.0025f; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected bool Approximately(float a, float b, float threshold = k_DefaultThreshold) + { + return Math.Round(Mathf.Abs(a - b), 4) <= threshold; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected bool Approximately(Vector3 a, Vector3 b, float threshold = k_DefaultThreshold) + { + return Approximately(a.x, b.x) && Approximately(a.y, b.y) && Approximately(a.z, b.z); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected bool Approximately(Quaternion a, Quaternion b, float threshold = k_DefaultThreshold) + { + return Approximately(a.x, b.x) && Approximately(a.y, b.y) && Approximately(a.z, b.z) && Approximately(a.w, b.w); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected float EulerDelta(float a, float b) + { + return Mathf.DeltaAngle(a, b); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected bool ApproximatelyEuler(float a, float b, float threshold = k_DefaultThreshold) + { + return Mathf.Abs(EulerDelta(a, b)) <= threshold; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected bool ApproximatelyEuler(Vector3 a, Vector3 b, float threshold = k_DefaultThreshold) + { + return ApproximatelyEuler(a.x, b.x, threshold) && ApproximatelyEuler(a.y, b.y, threshold) && ApproximatelyEuler(a.z, b.z, threshold); + } + #endregion +} + +[Serializable] +public class MinMaxVector2Physics +{ + [Range(1.0f, 200.0f)] + public float Min; + [Range(1.0f, 200.0f)] + public float Max; + + public MinMaxVector2Physics(float min, float max) + { + Min = min; + Max = max; + } +} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs.meta new file mode 100644 index 000000000..d016b1d61 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d97f2549555383847a36d4dc0a26a53f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs new file mode 100644 index 000000000..46bf76df5 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs @@ -0,0 +1,19 @@ +using Unity.Netcode; + +public interface ICollisionHandler +{ + /// + /// Invoked by non-authority objects detecting a collision, this determines the + /// appropriate targeted authority of the object being collided with. If the local + /// instance is authority it handles collision locally + /// + void SendCollisionMessage(CollisionMessageInfo collisionMessage); + + /// + /// Authority instances receive collision messages from non-authority instances via this implemented method + /// + /// + /// + [Rpc(SendTo.Authority, DeferLocal = true)] + void HandleCollisionRpc(CollisionMessageInfo collisionMessage, RpcParams rpcParams = default); +} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs.meta new file mode 100644 index 000000000..675c74f2c --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e77960601117fe644a32bd9dc9a9a34d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Input.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Input.meta new file mode 100644 index 000000000..fa74144a8 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Input.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: db21498511bd04a938d047c45c5de887 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs new file mode 100644 index 000000000..c06ae1f3a --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs @@ -0,0 +1,73 @@ +using UnityEngine; +using UnityEngine.InputSystem; + +public class AvatarInputs : MonoBehaviour +{ + [Header("Character Input Values")] + public Vector2 move; + public Vector2 look; + public bool jump; + public bool sprint; + + [Header("Movement Settings")] + public bool analogMovement; + + [Header("Mouse Cursor Settings")] + public bool cursorLocked = true; + public bool cursorInputForLook = true; + +#if ENABLE_INPUT_SYSTEM + public void OnMove(InputValue value) + { + MoveInput(value.Get()); + } + + public void OnLook(InputValue value) + { + if(cursorInputForLook) + { + LookInput(value.Get()); + } + } + + public void OnJump(InputValue value) + { + JumpInput(value.isPressed); + } + + public void OnSprint(InputValue value) + { + SprintInput(value.isPressed); + } +#endif + + public void MoveInput(Vector2 newMoveDirection) + { + move = newMoveDirection; + } + + public void LookInput(Vector2 newLookDirection) + { + look = newLookDirection; + } + + public void JumpInput(bool newJumpState) + { + jump = newJumpState; + } + + public void SprintInput(bool newSprintState) + { + sprint = newSprintState; + } + + private void OnApplicationFocus(bool hasFocus) + { + SetCursorState(cursorLocked); + } + + private void SetCursorState(bool newState) + { + Cursor.lockState = newState ? CursorLockMode.Locked : CursorLockMode.None; + } +} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs.meta new file mode 100644 index 000000000..2bda164f8 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7e9f71718dd134b14b300e378e98c718 \ No newline at end of file diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs new file mode 100644 index 000000000..fcfcfa038 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs @@ -0,0 +1,148 @@ +using System.Runtime.CompilerServices; +using Unity.Netcode; +using UnityEngine; + +/// +/// Only 15 types are allowed. +/// Applied to the first byte of +/// +public enum CollisionTypes +{ + TBD0 = 0x01, + TBD1 = 0x02, + TBD2 = 0x03, + TBD3 = 0x04, + TBD4 = 0x05, + DebugCollision = 0x0F, + // Maximum value for collision types is 15 - 0x0E +} + +/// +/// Flags to be used with +/// 16, 32, 64, and 128 are used for flags +/// +public enum CollisionCategoryFlags +{ + // Four flags are reserved + Standard = 0x10, + CollisionForce = 0x20, + CollisionPoint = 0x40, +} + +public struct CollisionMessageInfo : INetworkSerializable +{ + /// + /// Flags are serialized and determine the collision type + /// + public byte Flags; + + /// + /// Damage is serialized and is set based on the type + /// + public ushort Damage; + + /// + /// Collision force is serialized only if the flags contains the + /// flag. + /// + public Vector3 CollisionForce; + + /// + /// Collision force is serialized only if the flags contains the + /// flag. + /// + public Vector3 CollisionPoint; + + /// + /// Never serialized, only used locally to determine if + /// we are + /// + public bool DebugCollisionEnabled; + + public int CollisionId; + public float Time; + public ulong Source; + public ulong Destination; + public ulong DestNetworkObjId; + public ushort DestBehaviourId; + + /// + /// Never serialized, only used locally + /// + public ulong SourceId; + + /// + /// Never serialized, only used locally + /// + public ulong SourceOwner; + + /// + /// Never serialized, only used locally + /// + public ulong TargetOwner; + + public CollisionTypes GetCollisionType() + { + return (CollisionTypes)(Flags & 0x0F); + } + + public bool HasCollisionForce() + { + return (Flags & (uint)CollisionCategoryFlags.CollisionForce) == (byte)CollisionCategoryFlags.CollisionForce; + } + + private bool DebugCollisionsEnabled + { + get + { + return GetFlag((uint)CollisionTypes.DebugCollision); + } + + set + { + SetFlag(value, (uint)CollisionTypes.DebugCollision); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetFlag(bool set, uint flag) + { + var flags = (uint)Flags; + if (set) { flags = flags | flag; } + else { flags = flags & ~flag; } + Flags = (byte)flags; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool GetFlag(uint flag) + { + var flags = (uint)Flags; + return (flags & flag) != 0; + } + + public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter + { + serializer.SerializeValue(ref Flags); + serializer.SerializeValue(ref Damage); + // only if we have a collision force should we serialize it (read and write) + if (GetFlag((uint)CollisionCategoryFlags.CollisionForce)) + { + serializer.SerializeValue(ref CollisionForce); + } + + if (GetFlag((uint)CollisionCategoryFlags.CollisionPoint)) + { + serializer.SerializeValue(ref CollisionForce); + } + + if (DebugCollisionsEnabled) + { + serializer.SerializeValue(ref CollisionId); + serializer.SerializeValue(ref Time); + serializer.SerializeValue(ref Source); + serializer.SerializeValue(ref Destination); + serializer.SerializeValue(ref DestNetworkObjId); + serializer.SerializeValue(ref DestBehaviourId); + } + } +} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs.meta new file mode 100644 index 000000000..dcd19bebc --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c2fd728083c5b4740926d76679851317 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs new file mode 100644 index 000000000..a97338d6c --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs @@ -0,0 +1,662 @@ +using System; +using System.Collections.Generic; +using Unity.Netcode; +using Unity.Netcode.Components; +using UnityEngine; + +#if UNITY_EDITOR +using UnityEditor; +/// +/// The custom editor for the component. +/// +[CustomEditor(typeof(PhysicsObjectMotion), true)] +public class PhysicsObjectMotionEditor : BaseObjectMotionHandlerEditor +{ + private SerializedProperty m_CollisionImpulseEntries; + private SerializedProperty m_MaxAngularVelocity; + private SerializedProperty m_MaxVelocity; + private SerializedProperty m_MinMaxStartingTorque; + private SerializedProperty m_MinMaxStartingForce; + + public override void OnEnable() + { + m_CollisionImpulseEntries = serializedObject.FindProperty(nameof(PhysicsObjectMotion.CollisionImpulseEntries)); + m_MaxAngularVelocity = serializedObject.FindProperty(nameof(PhysicsObjectMotion.MaxAngularVelocity)); + m_MaxVelocity = serializedObject.FindProperty(nameof(PhysicsObjectMotion.MaxVelocity)); + m_MinMaxStartingTorque = serializedObject.FindProperty(nameof(PhysicsObjectMotion.MinMaxStartingTorque)); + m_MinMaxStartingForce = serializedObject.FindProperty(nameof(PhysicsObjectMotion.MinMaxStartingForce)); + base.OnEnable(); + } + + public override void OnInspectorGUI() + { + var physicsObject = target as PhysicsObjectMotion; + + physicsObject.PhysicsObjectMotionPropertiesVisible = EditorGUILayout.BeginFoldoutHeaderGroup(physicsObject.PhysicsObjectMotionPropertiesVisible, $"{nameof(PhysicsObjectMotion)} Properties"); + if (physicsObject.PhysicsObjectMotionPropertiesVisible) + { + // End the header group since m_MinMaxStartingTorque and m_MinMaxStartingForce both use header groups + EditorGUILayout.EndFoldoutHeaderGroup(); + EditorGUILayout.PropertyField(m_CollisionImpulseEntries); + EditorGUILayout.PropertyField(m_MaxAngularVelocity); + EditorGUILayout.PropertyField(m_MaxVelocity); + EditorGUILayout.PropertyField(m_MinMaxStartingTorque); + EditorGUILayout.PropertyField(m_MinMaxStartingForce); + } + else + { + EditorGUILayout.EndFoldoutHeaderGroup(); + } + + EditorGUILayout.Space(); + + base.OnInspectorGUI(); + } +} +#endif + + +public partial class PhysicsObjectMotion : BaseObjectMotionHandler +{ +#if UNITY_EDITOR + public bool PhysicsObjectMotionPropertiesVisible = false; +#endif + + [Serializable] + public struct CollisionImpulseMultiplierEntry + { + public CollisionTypes CollisionType; + public float MaxCollisionForce; + } + public List CollisionImpulseEntries; + private Dictionary CollisionImpulseTable; + + public float MaxAngularVelocity = 30; + public float MaxVelocity = 30; + [HideInInspector] + public float StartingMass = 1.0f; + + public const float MaxMass = 5.0f; + public const float MinMass = 0.10f; + + public MinMaxVector2Physics MinMaxStartingTorque = new MinMaxVector2Physics(5.0f, 15.0f); + public MinMaxVector2Physics MinMaxStartingForce = new MinMaxVector2Physics(5.0f, 30.0f); + + + protected NetworkVariable BeenInitialized = new NetworkVariable(false, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner); + /// + /// All of the below values keep the physics objects synchronized between clients so when ownership changes the local Rigidbody can be configured to mirror + /// the last known physics related states. + /// + protected NetworkVariable Mass = new NetworkVariable(1.0f, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner); + protected NetworkVariable AngularVelocity = new NetworkVariable(default, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner); + protected NetworkVariable Velocity = new NetworkVariable(default, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner); + protected NetworkVariable Torque = new NetworkVariable(default, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner); + protected NetworkVariable Force = new NetworkVariable(default, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner); + + + + protected override void Awake() + { + base.Awake(); + CollisionImpulseTable = new Dictionary(); + foreach (var entry in CollisionImpulseEntries) + { + if (!CollisionImpulseTable.ContainsKey(entry.CollisionType)) + { + CollisionImpulseTable.Add(entry.CollisionType, entry); + } + else + { + Debug.LogWarning($"[Duplicate Entry] A duplicate {nameof(CollisionImpulseMultiplierEntry)} of type {entry.CollisionType} was detected! Ignoring entry."); + } + } + + StartingMass = Rigidbody.mass; + } + + protected override Vector3 OnGetObjectVelocity(bool getReference = false) + { + if (getReference) + { + return Velocity.Value; + } + return base.OnGetObjectVelocity(getReference); + } + + protected override Vector3 OnGetObjectAngularVelocity() + { + return AngularVelocity.Value; + } + + protected void UpdateVelocity(Vector3 velocity, bool updateObjectVelocity = true) + { + if (HasAuthority) + { + if (updateObjectVelocity) + { + SetObjectVelocity(velocity); + } + Velocity.Value = velocity; + } + } + + protected void UpdateAngularVelocity(Vector3 angularVelocity) + { + if (HasAuthority) + { + Rigidbody.angularVelocity = angularVelocity; + AngularVelocity.Value = angularVelocity; + } + } + + protected void UpdateTorque(Vector3 torque) + { + if (HasAuthority) + { + Rigidbody.AddTorque(torque); + Torque.Value = torque; + } + } + + protected void UpdateImpulseForce(Vector3 impulseForce) + { + if (HasAuthority) + { + Rigidbody.AddForce(impulseForce, ForceMode.Impulse); + Force.Value = impulseForce; + } + } + + protected void UpdateMass(float mass) + { + if (HasAuthority) + { + if (mass > MinMass && mass < MaxMass) + { + Rigidbody.mass = mass; + } + else + { + NetworkLog.LogWarningServer($"[{name}] Trying to assign mass of {mass} which is outside the mass boundary of {MinMass} to {MaxMass}! Clamping."); + Rigidbody.mass = Mathf.Clamp(mass, MinMass, MaxMass); + } + } + } + + /// + /// Invoked when authority pushes state, we keep track whether the most recent state + /// had rotation or position deltas. + /// + /// + /// This keeps track of angular and motion velocities in order to keep objects synchronized + /// when ownership changes. + /// + /// + protected override void OnAuthorityPushTransformState(ref NetworkTransformState networkTransformState) + { + // If we haven't already initialized for the first time or haven't initialized previous state values during spawn then exit early + if (!BeenInitialized.Value) + { + return; + } + + if (networkTransformState.HasRotAngleChange && !Rigidbody.isKinematic) + { + if (Vector3.Distance(GetObjectAngularVelocity(), Rigidbody.angularVelocity) > RotAngleThreshold) + { + UpdateAngularVelocity(Rigidbody.angularVelocity); + } + } + + if (networkTransformState.HasPositionChange && !Rigidbody.isKinematic) + { + var velocity = GetObjectVelocity(); + if (Vector3.Distance(GetObjectVelocity(true), velocity) > PositionThreshold) + { + UpdateVelocity(velocity, false); + } + } + + base.OnAuthorityPushTransformState(ref networkTransformState); + } + + public override void OnNetworkSpawn() + { + + // When creating customized NetworkTransform behaviors, you must always invoke the base OnNetworkSpawn + // method if you override it in any child derive generation (i.e. always assure the NetworkTransform.OnNetworkSpawn + // method is invoked) + base.OnNetworkSpawn(); + + IsPhysicsBody = true; + // Assure all colliders are enabled (authority and non-authority) + EnableColliders(true); + + // Register for contact events (authority and non-authority) + RigidbodyContactEventManager.Instance.RegisterHandler(this); + + // Clamp the linear and angular velocities + Rigidbody.maxAngularVelocity = MaxAngularVelocity; + Rigidbody.maxLinearVelocity = MaxVelocity; + if (HasAuthority) + { + + // Assure we are not still in kinematic mode + NetworkRigidbody.SetIsKinematic(false); + + // Since state can be preserved during a CMB service connection when there are no clients connected, + // this section determines whether we need to initialize the physics object or just apply the last + // known velocities. + if (!BeenInitialized.Value) + { + BeenInitialized.Value = true; + var torque = GetRandomVector3(MinMaxStartingTorque, Vector3.one, true); + Rigidbody.AddTorque(torque, ForceMode.Impulse); + UpdateTorque(torque); + var force = GetRandomVector3(MinMaxStartingForce, Vector3.one, true); + force.y = 0f; + Rigidbody.AddForce(force, ForceMode.Impulse); + UpdateImpulseForce(force); + } + else + { + Rigidbody.angularVelocity = Vector3.ClampMagnitude(GetObjectAngularVelocity(), MaxAngularVelocity); + SetObjectVelocity(Vector3.ClampMagnitude(GetObjectVelocity(), MaxVelocity)); + } + } + } + + public override void OnNetworkDespawn() + { + RigidbodyContactEventManager.Instance.RegisterHandler(this, false); + // Invoke the base before applying any additional adjustments + base.OnNetworkDespawn(); + + // If we are pooled and not shutting down, then reset the physics object for re-use later + // ** Important to do this ** + if (IsPooled) + { + EnableColliders(false); + if (!Rigidbody.isKinematic) + { + Rigidbody.angularVelocity = Vector3.zero; + SetObjectVelocity(Vector3.zero); + NetworkRigidbody.SetIsKinematic(true); + } + Rigidbody.mass = StartingMass; + BeenInitialized.Reset(); + AngularVelocity.Reset(); + Velocity.Reset(); + Torque.Reset(); + Force.Reset(); + Mass.Reset(); + } + } + + /// + /// When ownership changes, we apply the last known angular and motion velocities. + /// Otherwise, + /// + protected override void OnOwnershipChanged(ulong previous, ulong current) + { + if (NetworkManager.LocalClientId == current) + { + NetworkRigidbody.SetIsKinematic(false); + if (BeenInitialized.Value) + { + Rigidbody.angularVelocity = Vector3.ClampMagnitude(GetObjectAngularVelocity(), MaxAngularVelocity); + SetObjectVelocity(Vector3.ClampMagnitude(GetObjectVelocity(true), MaxVelocity)); + } + else + { + Rigidbody.AddTorque(Torque.Value, ForceMode.Impulse); + Rigidbody.AddForce(Force.Value, ForceMode.Impulse); + } + } + else + { + NetworkRigidbody.SetIsKinematic(true); + } + base.OnOwnershipChanged(previous, current); + } + + private struct RemoteForce + { + public float EndOfLife; + public Vector3 TargetForce; + public Vector3 AppliedForce; + } + + private List m_RemoteAppliedForce = new List(); + private Dictionary m_CollisionLatency = new Dictionary(); + + /// + /// Handles queuing up incoming collisions (remote and local) to be processed + /// + protected override void OnHandleCollision(CollisionMessageInfo collisionMessage, bool isLocal = false, bool applyImmediately = false) + { + if (collisionMessage.HasCollisionForce()) + { + AddForceDirect(collisionMessage.CollisionForce); + } + base.OnHandleCollision(collisionMessage); + } + + public void AddForceDirect(Vector3 force) + { + var remoteForce = new RemoteForce() + { + TargetForce = force, + AppliedForce = Vector3.zero, + }; + + + m_RemoteAppliedForce.Add(remoteForce); + } + + /// + /// TODO: + /// - Track body collisions and the recent kineticForce applied. + /// - Cap the total applied kineticForce to (n) value. + /// - Only update the delta kineticForce relative to recent collision messages sent to another body + /// - This should help with the "sudden" bursts of force when colliding against other bodies. + /// + protected void OnContactEventOld(ulong eventId, Vector3 averagedCollisionNormal, Rigidbody collidingBody, Vector3 contactPoint, bool hasCollisionStay = false, Vector3 averagedCollisionStayNormal = default) + { + // TODO: Possibly come up with a better way to route contact events at this level. + // For now, since lasers are always kinematic and send damage messages we divert contact events to the LaserMotion child class + var collidingBaseObjectMotion = collidingBody.GetComponent(); + var collidingBodyPhys = collidingBaseObjectMotion as PhysicsObjectMotion; + // If we don't have authority over either object or we are doing a second FixedUpdate pass, then exit early + if (eventId == LastEventId || collidingBaseObjectMotion == null || (!HasAuthority && !collidingBaseObjectMotion.HasAuthority)) + { + return; + } + /*if (collidingBaseObjectMotion.CollisionType == CollisionTypes.Laser) + { + var laserMotion = collidingBaseObjectMotion as LaserMotion; + laserMotion.ContactEvent(eventId, averagedCollisionNormal, Rigidbody, contactPoint); + return; + }*/ + + if (collidingBodyPhys == null) + { + return; + } + + var collisionNormal = hasCollisionStay ? averagedCollisionStayNormal : averagedCollisionNormal; + var velocity = 0.0f; + var kineticForce = Vector3.zero; + var massRatio = 0.0f; + + if (!Rigidbody.isKinematic && collidingBody.isKinematic) + { + // Handle kinematic to non-kinematic local collisions + /*if (collidingBodyPhys.CollisionType == CollisionTypes.Ship && hasCollisionStay) + { + velocity = collidingBodyPhys.MaxVelocity * 0.85f * (collidingBodyPhys as ShipController).GetPrimaryThrusterScale(); + } + else + { + velocity = collidingBodyPhys.GetObjectVelocity(true).sqrMagnitude * 0.5f; + }*/ + + if (velocity > 0.01f) + { + // Get the mass ratio between the non-kinematic and kinematic when applying to local Rigidbody + massRatio = (Rigidbody.mass / collidingBody.mass); + // Get the over-all kinetic force to appply + // Use the original normal when applying to the local physics body + kineticForce = massRatio * velocity * collisionNormal; + Rigidbody.AddForce(kineticForce, ForceMode.Impulse); + if (DebugCollisions) + { + if (kineticForce.magnitude < 1.0f) + { + /*NetworkManagerHelper.Instance.LogMessage($"[{name}][FirstBody] Mass Ratio: {massRatio} | Collision Normal:{GetVector3Values(-collisionNormal)} | {velocity}");*/ + } + /*NetworkManagerHelper.Instance.LogMessage($"[{name}][FirstBody][Collision Stay: {hasCollisionStay}] Collided with {collidingBody.name} that is locally applying {GetVector3Values(kineticForce)} impulse force to {name}.");*/ + } + } + + // Handle non-kinematic to kinematic remote collisions + if (hasCollisionStay) + { + /*if (CollisionType == CollisionTypes.Ship && hasCollisionStay) + { + velocity = MaxVelocity * (this as ShipController).GetPrimaryThrusterScale(); + } + else + { + velocity = Rigidbody.linearVelocity.sqrMagnitude * 0.5f; + }*/ + + if (velocity > 0.01f) + { + // Get the mass ratio between the kinematic and non-kinematic when sending to remote Rigidbody + massRatio = (collidingBody.mass / Rigidbody.mass); + // Get the over-all kinetic force to appply + // Invert normal when applying to the colliding physics body + kineticForce = velocity * massRatio * -collisionNormal * 0.0333333f; + CollisionMessage.CollisionForce = kineticForce; + CollisionMessage.SetFlag(true, (uint)CollisionCategoryFlags.CollisionForce); + if (DebugCollisions) + { + if (kineticForce.magnitude < 1.0f) + { + /*NetworkManagerHelper.Instance.LogMessage($"[{name}][SecondBody] Mass Ratio: {massRatio} | Collision Normal:{GetVector3Values(-collisionNormal)} | {velocity}");*/ + } + /*NetworkManagerHelper.Instance.LogMessage($"[{name}][SecondBody][Collision Stay: {hasCollisionStay}] Sending impulse thrust {GetVector3Values(kineticForce)} to {collidingBody.name}.");*/ + } + // Send collision to owner of kinematic body + EventCollision(averagedCollisionNormal, collidingBodyPhys); + } + } + } + if (Rigidbody.isKinematic && !collidingBody.isKinematic) + { + /*if (CollisionType == CollisionTypes.Ship && hasCollisionStay) + { + velocity = MaxVelocity * (this as ShipController).GetPrimaryThrusterScale(); + } + else + { + velocity = GetObjectVelocity(true).sqrMagnitude * 0.5f; + }*/ + + if (velocity > 0.01f) + { + // Get the mass ratio between the kinematic and non-kinematic when sending to remote Rigidbody + massRatio = (Rigidbody.mass / collidingBody.mass); + // Invert normal when applying to the colliding physics body + kineticForce = massRatio * velocity * -collisionNormal; + collidingBody.AddForce(kineticForce, ForceMode.Impulse); + if (DebugCollisions) + { + if (kineticForce.magnitude < 1.0f) + { + /*NetworkManagerHelper.Instance.LogMessage($"[{collidingBody.name}][SecondBody] Mass Ratio: {massRatio} | Collision Normal:{GetVector3Values(-collisionNormal)} | {velocity}");*/ + } + /*NetworkManagerHelper.Instance.LogMessage($"[{collidingBody.name}][SecondBody][Collision Stay: {hasCollisionStay}] Collided with {name} that is locally applying {GetVector3Values(kineticForce)} impulse force to {collidingBody.name}.");*/ + } + } + + if (hasCollisionStay) + { + /*if (collidingBodyPhys.CollisionType == CollisionTypes.Ship && hasCollisionStay) + { + velocity = collidingBodyPhys.MaxVelocity * (collidingBodyPhys as ShipController).GetPrimaryThrusterScale(); + } + else + { + velocity = collidingBody.linearVelocity.sqrMagnitude * 0.5f; + }*/ + + if (velocity > 0.01f) + { + massRatio = (Rigidbody.mass / collidingBody.mass); + // Get the over-all kinetic force to appply + // Use the original normal when applying to the local physics body + kineticForce = massRatio * velocity * collisionNormal * 0.0333333f; + collidingBodyPhys.CollisionMessage.CollisionForce = kineticForce; + collidingBodyPhys.CollisionMessage.SetFlag(true, (uint)CollisionCategoryFlags.CollisionForce); + collidingBodyPhys.EventCollision(averagedCollisionNormal, this); + if (DebugCollisions) + { + if (kineticForce.magnitude < 1.0f) + { + /*NetworkManagerHelper.Instance.LogMessage($"[{collidingBody.name}][FirstBody] Mass Ratio: {massRatio} | Collision Normal:{GetVector3Values(-collisionNormal)} | {velocity}");*/ + } + /*NetworkManagerHelper.Instance.LogMessage($"[{collidingBodyPhys.name}][FirstBody][Collision Stay: {hasCollisionStay}] Sending impulse thrust {GetVector3Values(kineticForce)} to {name}.");*/ + } + } + } + } + base.OnContactEvent(eventId, averagedCollisionNormal, collidingBody, contactPoint); + } + + protected override void OnContactEvent(ulong eventId, Vector3 averagedCollisionNormal, Rigidbody collidingBody, Vector3 contactPoint, bool hasCollisionStay = false, Vector3 averagedCollisionStayNormal = default) + { + // TODO: Possibly come up with a better way to route contact events at this level. + // For now, since lasers are always kinematic and send damage messages we divert contact events to the LaserMotion child class + var collidingBaseObjectMotion = collidingBody.GetComponent(); + var collidingBodyPhys = collidingBaseObjectMotion as PhysicsObjectMotion; + // If we don't have authority over either object or we are doing a second FixedUpdate pass, then exit early + if (eventId == LastEventId || collidingBaseObjectMotion == null || (!HasAuthority && !collidingBaseObjectMotion.HasAuthority)) + { + return; + } + /*if (collidingBaseObjectMotion.CollisionType == CollisionTypes.Laser) + { + var laserMotion = collidingBaseObjectMotion as LaserMotion; + laserMotion.ContactEvent(eventId, averagedCollisionNormal, Rigidbody, contactPoint); + return; + }*/ + + if (collidingBodyPhys == null) + { + return; + } + + var collisionNormal = hasCollisionStay ? averagedCollisionStayNormal : averagedCollisionNormal; + + var thisVelocity = (!Rigidbody.isKinematic ? Rigidbody.linearVelocity.sqrMagnitude : GetObjectVelocity().sqrMagnitude) * 0.5f; + var otherVelocity = (!collidingBody.isKinematic ? collidingBody.linearVelocity.sqrMagnitude : collidingBodyPhys.GetObjectVelocity().sqrMagnitude) * 0.5f; + var thisKineticForce = (Rigidbody.mass / collidingBody.mass) * -collisionNormal * thisVelocity; + var otherKineticForce = (collidingBody.mass / Rigidbody.mass) * collisionNormal * otherVelocity; + + if (!Rigidbody.isKinematic && collidingBody.isKinematic && thisVelocity > 0.01f) + { + CollisionMessage.CollisionForce = thisKineticForce; + CollisionMessage.SetFlag(true, (uint)CollisionCategoryFlags.CollisionForce); + if (DebugCollisions) + { + /*NetworkManagerHelper.Instance.LogMessage($"[{name}][SecondBody][Collision Stay: {hasCollisionStay}] Sending impulse thrust {GetVector3Values(thisKineticForce)} to {collidingBody.name}.");*/ + } + // Send collision to owner of kinematic body + EventCollision(averagedCollisionNormal, collidingBodyPhys); + } + else if (Rigidbody.isKinematic && !collidingBody.isKinematic && otherVelocity > 0.01f) + { + collidingBodyPhys.CollisionMessage.CollisionForce = otherKineticForce; + collidingBodyPhys.CollisionMessage.SetFlag(true, (uint)CollisionCategoryFlags.CollisionForce); + collidingBodyPhys.EventCollision(averagedCollisionNormal, this); + if (DebugCollisions) + { + /*NetworkManagerHelper.Instance.LogMessage($"[{collidingBodyPhys.name}][FirstBody][Collision Stay: {hasCollisionStay}] Sending impulse thrust {GetVector3Values(otherKineticForce)} to {name}.");*/ + } + } + base.OnContactEvent(eventId, averagedCollisionNormal, collidingBody, contactPoint); + } + + /// + /// Accumulatively apply the resultant collision force + /// + /// + private void ApplyCollisionForce(Vector3 force) + { + Rigidbody.AddForce(force, ForceMode.Impulse); + Rigidbody.AddTorque(force * 0.25f, ForceMode.Impulse); + } + + /// + /// Processes the queued collisions forces + /// + private void ProcessRemoteForces() + { + if (m_RemoteAppliedForce.Count == 0) + { + return; + } + var accumulativeForce = Vector3.zero; + for (int i = m_RemoteAppliedForce.Count - 1; i >= 0; i--) + { + var remoteForce = m_RemoteAppliedForce[i]; + accumulativeForce += remoteForce.TargetForce; + if (Approximately(remoteForce.TargetForce, Vector3.zero)) + { + m_RemoteAppliedForce.RemoveAt(i); + } + else + { + m_RemoteAppliedForce[i] = remoteForce; + } + } + ApplyCollisionForce(accumulativeForce); + m_RemoteAppliedForce.Clear(); + } + + /// + /// Hijack the FixedUpdate to assure physics simulation is always + /// taking into consideration the queued collisions to process + /// + /// + /// Override this method to apply additional forces to your physics object + /// + protected virtual void FixedUpdate() + { + if (!IsSpawned || !HasAuthority || Rigidbody != null && Rigidbody.isKinematic) + { + return; + } + + // Process any queued collisions + ProcessRemoteForces(); + } + + /// + /// When is enabled, this will log locally + /// generated collision info for the derived component + /// + /// the hit + /// log string + protected override string OnLogCollision(ref BaseObjectMotionHandler objectHit) + { + return $"[CF: {GetVector3Values(ref CollisionMessage.CollisionForce)}]-{base.OnLogCollision(ref objectHit)}"; + } + + /// + /// When is enabled, this will log remotely + /// received collision info for the derived component + /// + /// the message received + /// log string + protected override string OnLogHandleCollision(ref CollisionMessageInfo collisionMessage) + { + var sourceCollider = $"{collisionMessage.SourceOwner}"; + if (NetworkManager.SpawnManager.SpawnedObjects.ContainsKey(collisionMessage.SourceOwner)) + { + sourceCollider = NetworkManager.SpawnManager.SpawnedObjects[collisionMessage.SourceOwner].name; + } + var resLinearVel = string.Empty; + var resAngularVel = string.Empty; + if (Rigidbody != null) + { + resLinearVel = GetVector3Values(GetObjectVelocity()); + resAngularVel = GetVector3Values(Rigidbody.angularVelocity); + } + return $"[**Collision-Info**][To: {name}][By:{sourceCollider}][Force:{GetVector3Values(ref collisionMessage.CollisionForce)}]" + + $"[LinVel: {resLinearVel}][AngVel: {resAngularVel}]-{base.OnLogHandleCollision(ref collisionMessage)}"; + } +} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs.meta new file mode 100644 index 000000000..2785f4cca --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d3f561fb09787c42abad1ab0a51da2f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs new file mode 100644 index 000000000..70f2c1213 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs @@ -0,0 +1,230 @@ +using UnityEngine; +using UnityEngine.InputSystem; + +#if UNITY_EDITOR +using UnityEditor; + +/// +/// The custom editor for the component. +/// +[CustomEditor(typeof(AvatarTransform), true)] +public class AvatarTransformEditor : PhysicsObjectMotionEditor +{ + SerializedProperty m_PlayerInput; + SerializedProperty m_AvatarInputs; + SerializedProperty m_WalkSpeed; + SerializedProperty m_SprintSpeed; + SerializedProperty m_Acceleration; + SerializedProperty m_Deceleration; + SerializedProperty m_AirControlFactor; + SerializedProperty m_JumpImpulse; + SerializedProperty m_CustomGravityMultiplier; + SerializedProperty m_RotationSpeed; + SerializedProperty m_GroundCheckDistance; + + public override void OnEnable() + { + m_PlayerInput = serializedObject.FindProperty(nameof(AvatarTransform.PlayerInput)); + m_AvatarInputs = serializedObject.FindProperty(nameof(AvatarTransform.AvatarInputs)); + m_WalkSpeed = serializedObject.FindProperty(nameof(AvatarTransform.WalkSpeed)); + m_SprintSpeed = serializedObject.FindProperty(nameof(AvatarTransform.SprintSpeed)); + m_Acceleration = serializedObject.FindProperty(nameof(AvatarTransform.Acceleration)); + m_Deceleration = serializedObject.FindProperty(nameof(AvatarTransform.Deceleration)); + m_AirControlFactor = serializedObject.FindProperty(nameof(AvatarTransform.AirControlFactor)); + m_JumpImpulse = serializedObject.FindProperty(nameof(AvatarTransform.JumpImpusle)); + m_CustomGravityMultiplier = serializedObject.FindProperty(nameof(AvatarTransform.CustomGravityMultiplier)); + m_RotationSpeed = serializedObject.FindProperty(nameof(AvatarTransform.RotationSpeed)); + m_GroundCheckDistance = serializedObject.FindProperty(nameof(AvatarTransform.GroundCheckDistance)); + + base.OnEnable(); + } + + public override void OnInspectorGUI() + { + var avatarTransform = target as AvatarTransform; + avatarTransform.PropertiesVisible = EditorGUILayout.BeginFoldoutHeaderGroup(avatarTransform.PropertiesVisible, $"{nameof(AvatarTransform)} Properties"); + if (avatarTransform.PropertiesVisible) + { + EditorGUILayout.EndFoldoutHeaderGroup(); + EditorGUILayout.PropertyField(m_PlayerInput); + EditorGUILayout.PropertyField(m_AvatarInputs); + EditorGUILayout.PropertyField(m_WalkSpeed); + EditorGUILayout.PropertyField(m_SprintSpeed); + EditorGUILayout.PropertyField(m_Acceleration); + EditorGUILayout.PropertyField(m_Deceleration); + EditorGUILayout.PropertyField(m_AirControlFactor); + EditorGUILayout.PropertyField(m_JumpImpulse); + EditorGUILayout.PropertyField(m_CustomGravityMultiplier); + EditorGUILayout.PropertyField(m_RotationSpeed); + EditorGUILayout.PropertyField(m_GroundCheckDistance); + } + else + { + EditorGUILayout.EndFoldoutHeaderGroup(); + } + EditorGUILayout.Space(); + base.OnInspectorGUI(); + } +} +#endif + +[RequireComponent(typeof(Rigidbody))] +public class AvatarTransform : PhysicsObjectMotion +{ +#if UNITY_EDITOR + public bool PropertiesVisible = false; +#endif + + public PlayerInput PlayerInput; + public AvatarInputs AvatarInputs; + public float WalkSpeed; + public float SprintSpeed; + public float Acceleration; + public float Deceleration; + public float AirControlFactor; + public float JumpImpusle; + public float CustomGravityMultiplier; + public float RotationSpeed; + public float GroundCheckDistance; + + Vector3 m_Movement; + + // grab jump state from input and clear after consumed + bool m_Jump; + + // cached grounded check + bool m_IsGrounded; + + RaycastHit[] m_RaycastHits = new RaycastHit[1]; + Ray m_Ray; + + public override void OnNetworkSpawn() + { + base.OnNetworkSpawn(); + + if (!IsOwner) + { + //enabled = false; + return; + } + + PlayerInput.enabled = true; + + // Freeze rotation on the x and z axes to prevent toppling + Rigidbody.freezeRotation = true; + + transform.SetPositionAndRotation(position: Vector3.up, rotation: Quaternion.identity); + Rigidbody.position = Vector3.up; + UpdateVelocity(Vector3.zero); + UpdateAngularVelocity(Vector3.zero); + } + + void Update() + { + if (!IsOwner) + { + return; + } + + m_Movement = new Vector3(AvatarInputs.move.x, 0, AvatarInputs.move.y).normalized; + + // Handle rotation based on input direction + if (m_Movement.magnitude >= 0.1f) + { + var targetAngle = Mathf.Atan2(m_Movement.x, m_Movement.z) * Mathf.Rad2Deg; + var targetRotation = Quaternion.Euler(0, targetAngle, 0); + transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, Time.deltaTime * RotationSpeed); + } + + if (AvatarInputs.jump && IsGrounded()) + { + m_Jump = true; + AvatarInputs.jump = false; + } + } + + void ApplyMovement() + { + var velocity = GetObjectVelocity(); + var desiredVelocity = m_Movement * (AvatarInputs.sprint ? SprintSpeed : WalkSpeed); + var targetVelocity = new Vector3(desiredVelocity.x, velocity.y, desiredVelocity.z); + var velocityChange = targetVelocity - velocity; + + if (m_IsGrounded) + { + // Apply force proportional to acceleration while grounded + var force = velocityChange * Acceleration; + Rigidbody.AddForce(force, ForceMode.Acceleration); + + if (m_Jump) + { + Rigidbody.AddForce(Vector3.up * JumpImpusle, ForceMode.Impulse); + m_Jump = false; + } + } + else + { + // Apply reduced force in the air for air control + var force = velocityChange * (Acceleration * AirControlFactor); + Rigidbody.AddForce(force, ForceMode.Acceleration); + } + + ApplyDeceleration(); + } + + void UpdateGroundedStatus() + { + m_IsGrounded = IsGrounded(); + } + + bool IsGrounded() + { + // Perform a raycast to check if the character is grounded + m_Ray.origin = transform.position; + m_Ray.direction = Vector3.down; + return Physics.RaycastNonAlloc(m_Ray, m_RaycastHits, GroundCheckDistance) > 0; + } + + /// + /// This applies the local player's thruster values to the ship in both + /// linear and angular velocity values + /// + protected override void FixedUpdate() + { + if (!IsSpawned || !HasAuthority || Rigidbody != null && Rigidbody.isKinematic) + { + base.FixedUpdate(); + return; + } + + UpdateGroundedStatus(); + + ApplyMovement(); + + ApplyCustomGravity(); + + base.FixedUpdate(); + } + + void ApplyDeceleration() + { + var velocity = GetObjectVelocity(); + if (m_Movement.magnitude < 0.1f && velocity.magnitude > 0) + { + // Apply deceleration force to stop movement + var horizontalVelocity = new Vector3(velocity.x, 0, velocity.z); + var decelerationForce = -horizontalVelocity.normalized * Deceleration; + Rigidbody.AddForce(decelerationForce, ForceMode.Acceleration); + } + } + + void ApplyCustomGravity() + { + // custom gravity + if (!m_IsGrounded) + { + var customGravity = Physics.gravity * (CustomGravityMultiplier - 1); + Rigidbody.AddForce(customGravity, ForceMode.Acceleration); + } + } +} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs.meta new file mode 100644 index 000000000..d93fbcd53 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5e253f865ab604b12a7f84e3d97704d8 \ No newline at end of file diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/EditorBuildSettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/EditorBuildSettings.asset index 067649b9f..9987862b0 100644 --- a/Experimental/DistributedAuthoritySample/ProjectSettings/EditorBuildSettings.asset +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/EditorBuildSettings.asset @@ -16,5 +16,5 @@ EditorBuildSettings: guid: 99c9720ab356a0642a771bea13969a05 m_configObjects: com.unity.input.settings: {fileID: 11400000, guid: 9e7be553448fa2546aea5752021cbcf7, type: 2} - com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 7b30a29548072524e9f8362bcbe40502, type: 3} + com.unity.input.settings.actions: {fileID: -944628639613478452, guid: dcd1b4eb76b964f40afe6c0a3ca65c82, type: 3} m_UseUCBPForAssetBundles: 0 diff --git a/Experimental/DistributedAuthoritySample/ProjectSettings/ProjectSettings.asset b/Experimental/DistributedAuthoritySample/ProjectSettings/ProjectSettings.asset index 90becf57c..dada3c276 100644 --- a/Experimental/DistributedAuthoritySample/ProjectSettings/ProjectSettings.asset +++ b/Experimental/DistributedAuthoritySample/ProjectSettings/ProjectSettings.asset @@ -176,7 +176,7 @@ PlayerSettings: AndroidMinSdkVersion: 23 AndroidTargetSdkVersion: 0 AndroidPreferredInstallLocation: 1 - aotOptions: + aotOptions: stripEngineCode: 1 iPhoneStrippingLevel: 0 iPhoneScriptCallOptimization: 0 @@ -228,8 +228,8 @@ PlayerSettings: rgba: 0 iOSLaunchScreeniPadFillPct: 100 iOSLaunchScreeniPadSize: 100 - iOSLaunchScreenCustomStoryboardPath: - iOSLaunchScreeniPadCustomStoryboardPath: + iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: iOSDeviceRequirements: [] iOSURLSchemes: [] macOSURLSchemes: [] @@ -240,10 +240,10 @@ PlayerSettings: metalCompileShaderBinary: 0 iOSRenderExtraFrameOnPause: 0 iosCopyPluginsCodeInsteadOfSymlink: 0 - appleDeveloperTeamID: - iOSManualSigningProvisioningProfileID: - tvOSManualSigningProvisioningProfileID: - VisionOSManualSigningProvisioningProfileID: + appleDeveloperTeamID: + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + VisionOSManualSigningProvisioningProfileID: iOSManualSigningProvisioningProfileType: 0 tvOSManualSigningProvisioningProfileType: 0 VisionOSManualSigningProvisioningProfileType: 0 @@ -266,8 +266,8 @@ PlayerSettings: AndroidTargetArchitectures: 2 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} - AndroidKeystoreName: - AndroidKeyaliasName: + AndroidKeystoreName: + AndroidKeyaliasName: AndroidEnableArmv9SecurityFeatures: 0 AndroidEnableArm64MTE: 0 AndroidBuildApkPerCpuArchitecture: 0 @@ -393,129 +393,129 @@ PlayerSettings: m_Width: 432 m_Height: 432 m_Kind: 2 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 324 m_Height: 324 m_Kind: 2 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 216 m_Height: 216 m_Kind: 2 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 162 m_Height: 162 m_Kind: 2 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 108 m_Height: 108 m_Kind: 2 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 81 m_Height: 81 m_Kind: 2 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 192 m_Height: 192 m_Kind: 1 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 144 m_Height: 144 m_Kind: 1 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 96 m_Height: 96 m_Kind: 1 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 72 m_Height: 72 m_Kind: 1 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 48 m_Height: 48 m_Kind: 1 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 36 m_Height: 36 m_Kind: 1 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 192 m_Height: 192 m_Kind: 0 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 144 m_Height: 144 m_Kind: 0 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 96 m_Height: 96 m_Kind: 0 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 72 m_Height: 72 m_Kind: 0 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 48 m_Height: 48 m_Kind: 0 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 36 m_Height: 36 m_Kind: 0 - m_SubKind: + m_SubKind: - m_BuildTarget: tvOS m_Icons: - m_Textures: [] m_Width: 1280 m_Height: 768 m_Kind: 0 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 800 m_Height: 480 m_Kind: 0 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 400 m_Height: 240 m_Kind: 0 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 4640 m_Height: 1440 m_Kind: 1 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 2320 m_Height: 720 m_Kind: 1 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 3840 m_Height: 1440 m_Kind: 1 - m_SubKind: + m_SubKind: - m_Textures: [] m_Width: 1920 m_Height: 720 m_Kind: 1 - m_SubKind: + m_SubKind: m_BuildTargetBatching: [] m_BuildTargetShaderSettings: [] m_BuildTargetGraphicsJobs: [] @@ -557,13 +557,13 @@ PlayerSettings: enableInternalProfiler: 0 logObjCUncaughtExceptions: 1 enableCrashReportAPI: 0 - cameraUsageDescription: - locationUsageDescription: - microphoneUsageDescription: - bluetoothUsageDescription: + cameraUsageDescription: + locationUsageDescription: + microphoneUsageDescription: + bluetoothUsageDescription: macOSTargetOSVersion: 11.0 - switchNMETAOverride: - switchNetLibKey: + switchNMETAOverride: + switchNetLibKey: switchSocketMemoryPoolSize: 6144 switchSocketAllocatorPoolSize: 128 switchSocketConcurrencyLimit: 14 @@ -572,40 +572,40 @@ PlayerSettings: switchEnableFileSystemTrace: 0 switchLTOSetting: 0 switchApplicationID: 0x01004b9000490000 - switchNSODependencies: - switchCompilerFlags: - switchTitleNames_0: - switchTitleNames_1: - switchTitleNames_2: - switchTitleNames_3: - switchTitleNames_4: - switchTitleNames_5: - switchTitleNames_6: - switchTitleNames_7: - switchTitleNames_8: - switchTitleNames_9: - switchTitleNames_10: - switchTitleNames_11: - switchTitleNames_12: - switchTitleNames_13: - switchTitleNames_14: - switchTitleNames_15: - switchPublisherNames_0: - switchPublisherNames_1: - switchPublisherNames_2: - switchPublisherNames_3: - switchPublisherNames_4: - switchPublisherNames_5: - switchPublisherNames_6: - switchPublisherNames_7: - switchPublisherNames_8: - switchPublisherNames_9: - switchPublisherNames_10: - switchPublisherNames_11: - switchPublisherNames_12: - switchPublisherNames_13: - switchPublisherNames_14: - switchPublisherNames_15: + switchNSODependencies: + switchCompilerFlags: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchTitleNames_12: + switchTitleNames_13: + switchTitleNames_14: + switchTitleNames_15: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchPublisherNames_12: + switchPublisherNames_13: + switchPublisherNames_14: + switchPublisherNames_15: switchIcons_0: {fileID: 0} switchIcons_1: {fileID: 0} switchIcons_2: {fileID: 0} @@ -638,18 +638,18 @@ PlayerSettings: switchSmallIcons_13: {fileID: 0} switchSmallIcons_14: {fileID: 0} switchSmallIcons_15: {fileID: 0} - switchManualHTML: - switchAccessibleURLs: - switchLegalInformation: + switchManualHTML: + switchAccessibleURLs: + switchLegalInformation: switchMainThreadStackSize: 1048576 - switchPresenceGroupId: + switchPresenceGroupId: switchLogoHandling: 0 switchReleaseVersion: 0 switchDisplayVersion: 1.0.0 switchStartupUserAccount: 0 switchSupportedLanguagesMask: 0 switchLogoType: 0 - switchApplicationErrorCodeCategory: + switchApplicationErrorCodeCategory: switchUserAccountSaveDataSize: 0 switchUserAccountSaveDataJournalSize: 0 switchApplicationAttribute: 0 @@ -669,14 +669,14 @@ PlayerSettings: switchRatingsInt_10: 0 switchRatingsInt_11: 0 switchRatingsInt_12: 0 - switchLocalCommunicationIds_0: - switchLocalCommunicationIds_1: - switchLocalCommunicationIds_2: - switchLocalCommunicationIds_3: - switchLocalCommunicationIds_4: - switchLocalCommunicationIds_5: - switchLocalCommunicationIds_6: - switchLocalCommunicationIds_7: + switchLocalCommunicationIds_0: + switchLocalCommunicationIds_1: + switchLocalCommunicationIds_2: + switchLocalCommunicationIds_3: + switchLocalCommunicationIds_4: + switchLocalCommunicationIds_5: + switchLocalCommunicationIds_6: + switchLocalCommunicationIds_7: switchParentalControl: 0 switchAllowsScreenshot: 1 switchAllowsVideoCapturing: 1 @@ -708,35 +708,35 @@ PlayerSettings: switchRamDiskSpaceSize: 12 switchUpgradedPlayerSettingsToNMETA: 0 ps4NPAgeRating: 12 - ps4NPTitleSecret: - ps4NPTrophyPackPath: + ps4NPTitleSecret: + ps4NPTrophyPackPath: ps4ParentalLevel: 11 ps4ContentID: ED1633-NPXX51362_00-0000000000000000 ps4Category: 0 ps4MasterVersion: 01.00 ps4AppVersion: 01.00 ps4AppType: 0 - ps4ParamSfxPath: + ps4ParamSfxPath: ps4VideoOutPixelFormat: 0 ps4VideoOutInitialWidth: 1920 ps4VideoOutBaseModeInitialWidth: 1920 ps4VideoOutReprojectionRate: 60 - ps4PronunciationXMLPath: - ps4PronunciationSIGPath: - ps4BackgroundImagePath: - ps4StartupImagePath: - ps4StartupImagesFolder: - ps4IconImagesFolder: - ps4SaveDataImagePath: - ps4SdkOverride: - ps4BGMPath: - ps4ShareFilePath: - ps4ShareOverlayImagePath: - ps4PrivacyGuardImagePath: - ps4ExtraSceSysFile: - ps4NPtitleDatPath: + ps4PronunciationXMLPath: + ps4PronunciationSIGPath: + ps4BackgroundImagePath: + ps4StartupImagePath: + ps4StartupImagesFolder: + ps4IconImagesFolder: + ps4SaveDataImagePath: + ps4SdkOverride: + ps4BGMPath: + ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: + ps4ExtraSceSysFile: + ps4NPtitleDatPath: ps4RemotePlayKeyAssignment: -1 - ps4RemotePlayKeyMappingDir: + ps4RemotePlayKeyMappingDir: ps4PlayTogetherPlayerCount: 0 ps4EnterButtonAssignment: 2 ps4ApplicationParam1: 0 @@ -764,9 +764,9 @@ PlayerSettings: ps4ScriptOptimizationLevel: 2 ps4Audio3dVirtualSpeakerCount: 14 ps4attribCpuUsage: 0 - ps4PatchPkgPath: - ps4PatchLatestPkgPath: - ps4PatchChangeinfoPath: + ps4PatchPkgPath: + ps4PatchLatestPkgPath: + ps4PatchChangeinfoPath: ps4PatchDayOne: 0 ps4attribUserManagement: 0 ps4attribMoveSupport: 0 @@ -782,19 +782,19 @@ PlayerSettings: ps4attribEyeToEyeDistanceSettingVR: 0 ps4IncludedModules: [] ps4attribVROutputEnabled: 0 - monoEnv: + monoEnv: splashScreenBackgroundSourceLandscape: {fileID: 0} splashScreenBackgroundSourcePortrait: {fileID: 0} blurSplashScreenBackground: 1 - spritePackerPolicy: + spritePackerPolicy: webGLMemorySize: 32 webGLExceptionSupport: 1 webGLNameFilesAsHashes: 0 webGLShowDiagnostics: 0 webGLDataCaching: 1 webGLDebugSymbols: 0 - webGLEmscriptenArgs: - webGLModulesDirectory: + webGLEmscriptenArgs: + webGLModulesDirectory: webGLTemplate: APPLICATION:Default webGLAnalyzeBuildSize: 0 webGLUseEmbeddedResources: 0 @@ -816,7 +816,7 @@ PlayerSettings: webGLCloseOnQuit: 0 webWasm2023: 0 scriptingDefineSymbols: - Standalone: ENABLE_INPUT_SYSTEM;STARTER_ASSETS_PACKAGES_CHECKED + Standalone: ENABLE_INPUT_SYSTEM additionalCompilerArguments: {} platformArchitecture: {} scriptingBackend: @@ -843,7 +843,7 @@ PlayerSettings: suppressCommonWarnings: 1 allowUnsafeCode: 0 useDeterministicCompilation: 1 - additionalIl2CppArgs: + additionalIl2CppArgs: scriptingRuntimeVersion: 1 gcIncremental: 1 gcWBarrierValidation: 0 @@ -852,15 +852,15 @@ PlayerSettings: m_RenderingPath: 1 m_MobileRenderingPath: 1 metroPackageName: DistributedAuthoritySample - metroPackageVersion: - metroCertificatePath: - metroCertificatePassword: - metroCertificateSubject: - metroCertificateIssuer: + metroPackageVersion: + metroCertificatePath: + metroCertificatePassword: + metroCertificateSubject: + metroCertificateIssuer: metroCertificateNotAfter: 0000000000000000 metroApplicationDescription: DistributedAuthoritySample wsaImages: {} - metroTileShortName: + metroTileShortName: metroTileShowName: 0 metroMediumTileShowName: 0 metroLargeTileShowName: 0 @@ -875,23 +875,23 @@ PlayerSettings: syncCapabilities: 0 platformCapabilities: {} metroTargetDeviceFamilies: {} - metroFTAName: + metroFTAName: metroFTAFileTypes: [] - metroProtocolName: - vcxProjDefaultLanguage: - XboxOneProductId: - XboxOneUpdateKey: - XboxOneSandboxId: - XboxOneContentId: - XboxOneTitleId: - XboxOneSCId: - XboxOneGameOsOverridePath: - XboxOnePackagingOverridePath: - XboxOneAppManifestOverridePath: + metroProtocolName: + vcxProjDefaultLanguage: + XboxOneProductId: + XboxOneUpdateKey: + XboxOneSandboxId: + XboxOneContentId: + XboxOneTitleId: + XboxOneSCId: + XboxOneGameOsOverridePath: + XboxOnePackagingOverridePath: + XboxOneAppManifestOverridePath: XboxOneVersion: 1.0.0.0 XboxOnePackageEncryption: 0 XboxOnePackageUpdateGranularity: 2 - XboxOneDescription: + XboxOneDescription: XboxOneLanguage: - enus XboxOneCapability: [] @@ -904,36 +904,36 @@ PlayerSettings: XboxOneAllowedProductIds: [] XboxOnePersistentLocalStorageSize: 0 XboxOneXTitleMemory: 8 - XboxOneOverrideIdentityName: - XboxOneOverrideIdentityPublisher: + XboxOneOverrideIdentityName: + XboxOneOverrideIdentityPublisher: vrEditorSettings: {} cloudServicesEnabled: {} luminIcon: - m_Name: - m_ModelFolderPath: - m_PortalFolderPath: + m_Name: + m_ModelFolderPath: + m_PortalFolderPath: luminCert: - m_CertPath: + m_CertPath: m_SignPackage: 1 luminIsChannelApp: 0 luminVersion: m_VersionCode: 1 - m_VersionName: - hmiPlayerDataPath: + m_VersionName: + hmiPlayerDataPath: hmiForceSRGBBlit: 1 embeddedLinuxEnableGamepadInput: 0 - hmiCpuConfiguration: + hmiCpuConfiguration: hmiLogStartupTiming: 0 - qnxGraphicConfPath: + qnxGraphicConfPath: apiCompatibilityLevel: 6 captureStartupLogs: {} - activeInputHandler: 2 + activeInputHandler: 1 windowsGamepadBackendHint: 0 - cloudProjectId: + cloudProjectId: framebufferDepthMemorylessMode: 0 qualitySettingsNames: [] - projectName: - organizationId: + projectName: + organizationId: cloudEnabled: 0 legacyClampBlendShapeWeights: 0 hmiLoadingImage: {fileID: 0} From db679d477f2e641f76b43a2442b3703b014b4717 Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Mon, 29 Jul 2024 00:14:53 -0400 Subject: [PATCH 06/10] reworked drag, inheriting from baseobject movement --- .../Assets/Prefabs/Avatar.prefab | 8 +-- .../Assets/Scripts/Player/AvatarTransform.cs | 72 ++++++++++--------- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab b/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab index 55313c00c..3593d3732 100644 --- a/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab +++ b/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab @@ -269,7 +269,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} m_Name: m_EditorClassIdentifier: - GlobalObjectIdHash: 3001504883 + GlobalObjectIdHash: 2473698027 InScenePlacedSourceGlobalObjectIdHash: 0 DeferredDespawnTick: 0 Ownership: 0 @@ -337,10 +337,10 @@ MonoBehaviour: PropertiesVisible: 1 PlayerInput: {fileID: 4903152183366241606} AvatarInputs: {fileID: 8197190117666738524} - WalkSpeed: 5 + WalkSpeed: 6 SprintSpeed: 10 Acceleration: 50 - Deceleration: 25 + DragCoefficient: 4 AirControlFactor: 0.5 JumpImpusle: 7 CustomGravityMultiplier: 2 @@ -369,7 +369,7 @@ Rigidbody: m_ImplicitCom: 1 m_ImplicitTensor: 1 m_UseGravity: 1 - m_IsKinematic: 0 + m_IsKinematic: 1 m_Interpolate: 0 m_Constraints: 0 m_CollisionDetection: 0 diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs index 70f2c1213..40d574f0a 100644 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs @@ -8,14 +8,14 @@ /// The custom editor for the component. /// [CustomEditor(typeof(AvatarTransform), true)] -public class AvatarTransformEditor : PhysicsObjectMotionEditor +public class AvatarTransformEditor : BaseObjectMotionHandlerEditor { SerializedProperty m_PlayerInput; SerializedProperty m_AvatarInputs; SerializedProperty m_WalkSpeed; SerializedProperty m_SprintSpeed; SerializedProperty m_Acceleration; - SerializedProperty m_Deceleration; + SerializedProperty m_DragCoefficient; SerializedProperty m_AirControlFactor; SerializedProperty m_JumpImpulse; SerializedProperty m_CustomGravityMultiplier; @@ -29,7 +29,7 @@ public override void OnEnable() m_WalkSpeed = serializedObject.FindProperty(nameof(AvatarTransform.WalkSpeed)); m_SprintSpeed = serializedObject.FindProperty(nameof(AvatarTransform.SprintSpeed)); m_Acceleration = serializedObject.FindProperty(nameof(AvatarTransform.Acceleration)); - m_Deceleration = serializedObject.FindProperty(nameof(AvatarTransform.Deceleration)); + m_DragCoefficient = serializedObject.FindProperty(nameof(AvatarTransform.DragCoefficient)); m_AirControlFactor = serializedObject.FindProperty(nameof(AvatarTransform.AirControlFactor)); m_JumpImpulse = serializedObject.FindProperty(nameof(AvatarTransform.JumpImpusle)); m_CustomGravityMultiplier = serializedObject.FindProperty(nameof(AvatarTransform.CustomGravityMultiplier)); @@ -51,7 +51,7 @@ public override void OnInspectorGUI() EditorGUILayout.PropertyField(m_WalkSpeed); EditorGUILayout.PropertyField(m_SprintSpeed); EditorGUILayout.PropertyField(m_Acceleration); - EditorGUILayout.PropertyField(m_Deceleration); + EditorGUILayout.PropertyField(m_DragCoefficient); EditorGUILayout.PropertyField(m_AirControlFactor); EditorGUILayout.PropertyField(m_JumpImpulse); EditorGUILayout.PropertyField(m_CustomGravityMultiplier); @@ -69,7 +69,7 @@ public override void OnInspectorGUI() #endif [RequireComponent(typeof(Rigidbody))] -public class AvatarTransform : PhysicsObjectMotion +public class AvatarTransform : BaseObjectMotionHandler { #if UNITY_EDITOR public bool PropertiesVisible = false; @@ -80,7 +80,7 @@ public class AvatarTransform : PhysicsObjectMotion public float WalkSpeed; public float SprintSpeed; public float Acceleration; - public float Deceleration; + public float DragCoefficient; public float AirControlFactor; public float JumpImpusle; public float CustomGravityMultiplier; @@ -102,26 +102,27 @@ public override void OnNetworkSpawn() { base.OnNetworkSpawn(); - if (!IsOwner) + if (!HasAuthority) { - //enabled = false; return; } PlayerInput.enabled = true; + Rigidbody.isKinematic = false; + // Freeze rotation on the x and z axes to prevent toppling Rigidbody.freezeRotation = true; - transform.SetPositionAndRotation(position: Vector3.up, rotation: Quaternion.identity); - Rigidbody.position = Vector3.up; - UpdateVelocity(Vector3.zero); - UpdateAngularVelocity(Vector3.zero); + var spawnPosition = new Vector3(0f, 1.5f, 0f); + transform.SetPositionAndRotation(position: spawnPosition, rotation: Quaternion.identity); + Rigidbody.position = spawnPosition; + SetObjectVelocity(Vector3.zero); } void Update() { - if (!IsOwner) + if (!HasAuthority) { return; } @@ -145,6 +146,11 @@ void Update() void ApplyMovement() { + if (Mathf.Approximately(m_Movement.magnitude, 0f)) + { + return; + } + var velocity = GetObjectVelocity(); var desiredVelocity = m_Movement * (AvatarInputs.sprint ? SprintSpeed : WalkSpeed); var targetVelocity = new Vector3(desiredVelocity.x, velocity.y, desiredVelocity.z); @@ -155,12 +161,6 @@ void ApplyMovement() // Apply force proportional to acceleration while grounded var force = velocityChange * Acceleration; Rigidbody.AddForce(force, ForceMode.Acceleration); - - if (m_Jump) - { - Rigidbody.AddForce(Vector3.up * JumpImpusle, ForceMode.Impulse); - m_Jump = false; - } } else { @@ -168,8 +168,15 @@ void ApplyMovement() var force = velocityChange * (Acceleration * AirControlFactor); Rigidbody.AddForce(force, ForceMode.Acceleration); } + } - ApplyDeceleration(); + void ApplyJump() + { + if (m_IsGrounded && m_Jump) + { + Rigidbody.AddForce(Vector3.up * JumpImpusle, ForceMode.Impulse); + m_Jump = false; + } } void UpdateGroundedStatus() @@ -185,15 +192,10 @@ bool IsGrounded() return Physics.RaycastNonAlloc(m_Ray, m_RaycastHits, GroundCheckDistance) > 0; } - /// - /// This applies the local player's thruster values to the ship in both - /// linear and angular velocity values - /// - protected override void FixedUpdate() + void FixedUpdate() { if (!IsSpawned || !HasAuthority || Rigidbody != null && Rigidbody.isKinematic) { - base.FixedUpdate(); return; } @@ -201,20 +203,22 @@ protected override void FixedUpdate() ApplyMovement(); - ApplyCustomGravity(); + ApplyJump(); - base.FixedUpdate(); + ApplyDrag(); + + ApplyCustomGravity(); } - void ApplyDeceleration() + void ApplyDrag() { - var velocity = GetObjectVelocity(); - if (m_Movement.magnitude < 0.1f && velocity.magnitude > 0) + var groundVelocity = GetObjectVelocity(); + groundVelocity.y = 0f; + if (groundVelocity.magnitude > 0f) { // Apply deceleration force to stop movement - var horizontalVelocity = new Vector3(velocity.x, 0, velocity.z); - var decelerationForce = -horizontalVelocity.normalized * Deceleration; - Rigidbody.AddForce(decelerationForce, ForceMode.Acceleration); + var dragForce = -DragCoefficient * groundVelocity.magnitude * groundVelocity; + Rigidbody.AddForce(dragForce, ForceMode.Acceleration); } } From 777072525521394abba06ce271cde763eb6b7c4c Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Tue, 30 Jul 2024 17:07:55 -0400 Subject: [PATCH 07/10] cleanup, avatar set with AvatarTransform --- .../Assets/Prefabs/Avatar.prefab | 67 +- .../Gameplay/BaseObjectMotionHandler.cs | 591 ---------------- .../Gameplay/BaseObjectMotionHandler.cs.meta | 11 - .../Assets/Scripts/Gameplay/IDamageHandler.cs | 19 - .../Scripts/Gameplay/IDamageHandler.cs.meta | 11 - .../Assets/Scripts/Input/AvatarInputs.cs | 105 +-- .../Scripts/Physics/CollisionMessageInfo.cs | 148 ---- .../Physics/CollisionMessageInfo.cs.meta | 11 - .../Scripts/Physics/PhysicsObjectMotion.cs | 662 ------------------ .../Physics/PhysicsObjectMotion.cs.meta | 11 - .../Assets/Scripts/Player/AvatarTransform.cs | 382 +++++----- 11 files changed, 275 insertions(+), 1743 deletions(-) delete mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs delete mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs.meta delete mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs delete mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs.meta delete mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs delete mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs.meta delete mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs delete mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs.meta diff --git a/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab b/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab index 3593d3732..5bac5aa18 100644 --- a/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab +++ b/Experimental/DistributedAuthoritySample/Assets/Prefabs/Avatar.prefab @@ -11,7 +11,6 @@ GameObject: - component: {fileID: 370971123281630519} - component: {fileID: 3081239909905841813} - component: {fileID: 5988919140179887555} - - component: {fileID: 1049656444021924520} m_Layer: 0 m_Name: Cube m_TagString: Untagged @@ -87,27 +86,6 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!65 &1049656444021924520 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2971605785670457434} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 0 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} --- !u!1 &3998769334658168242 GameObject: m_ObjectHideFlags: 0 @@ -312,40 +290,19 @@ MonoBehaviour: InLocalSpace: 0 Interpolate: 1 SlerpPosition: 0 - BaseObjectMotionHandlerPropertiesVisible: 1 - NetworkTransformPropertiesVisible: 1 - IsPooled: 1 - CollisionType: 0 - CollisionDamage: 0 - DebugBoundaryCheck: 0 - DebugCollisions: 0 - DebugDamage: 0 - IsPhysicsBody: 0 - EnableBoundary: 1 - Colliders: [] - PhysicsObjectMotionPropertiesVisible: 1 - CollisionImpulseEntries: [] - MaxAngularVelocity: 30 - MaxVelocity: 30 - StartingMass: 1 - MinMaxStartingTorque: - Min: 5 - Max: 15 - MinMaxStartingForce: - Min: 5 - Max: 30 PropertiesVisible: 1 - PlayerInput: {fileID: 4903152183366241606} - AvatarInputs: {fileID: 8197190117666738524} - WalkSpeed: 6 - SprintSpeed: 10 - Acceleration: 50 - DragCoefficient: 4 - AirControlFactor: 0.5 - JumpImpusle: 7 - CustomGravityMultiplier: 2 - RotationSpeed: 700 - GroundCheckDistance: 1.1 + m_Rigidbody: {fileID: 4745766379562620470} + m_PlayerInput: {fileID: 4903152183366241606} + m_AvatarInputs: {fileID: 8197190117666738524} + m_WalkSpeed: 6 + m_SprintSpeed: 10 + m_Acceleration: 50 + m_DragCoefficient: 4 + m_AirControlFactor: 0.5 + m_JumpImpusle: 7 + m_CustomGravityMultiplier: 2 + m_RotationSpeed: 700 + m_GroundCheckDistance: 1.1 --- !u!54 &4745766379562620470 Rigidbody: m_ObjectHideFlags: 0 diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs deleted file mode 100644 index 812df5a71..000000000 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs +++ /dev/null @@ -1,591 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using Unity.Netcode; -using Unity.Netcode.Components; -using UnityEngine; -using Random = UnityEngine.Random; -using System.Collections.Generic; - -#if UNITY_EDITOR -using Unity.Netcode.Editor; -using UnityEditor; -/// -/// The custom editor for the component. -/// -[CustomEditor(typeof(BaseObjectMotionHandler), true)] -public class BaseObjectMotionHandlerEditor : NetworkTransformEditor -{ - private SerializedProperty m_IsPooled; - private SerializedProperty m_CollisionType; - private SerializedProperty m_CollisionDamage; - private SerializedProperty m_DebugCollisions; - private SerializedProperty m_DebugDamage; - private SerializedProperty m_EnableBoundary; - private SerializedProperty m_Colliders; - - public override void OnEnable() - { - m_IsPooled = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.IsPooled)); - m_Colliders = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.Colliders)); - m_CollisionType = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.CollisionType)); - m_CollisionDamage = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.CollisionDamage)); - m_DebugCollisions = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.DebugCollisions)); - m_DebugDamage = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.DebugDamage)); - m_EnableBoundary = serializedObject.FindProperty(nameof(BaseObjectMotionHandler.EnableBoundary)); - - base.OnEnable(); - } - - public override void OnInspectorGUI() - { - var baseObject = target as BaseObjectMotionHandler; - baseObject.BaseObjectMotionHandlerPropertiesVisible = EditorGUILayout.BeginFoldoutHeaderGroup(baseObject.BaseObjectMotionHandlerPropertiesVisible, $"{nameof(BaseObjectMotionHandler)} Properties"); - if (baseObject.BaseObjectMotionHandlerPropertiesVisible) - { - // End the header group since m_Colliders is a header group - EditorGUILayout.EndFoldoutHeaderGroup(); - EditorGUILayout.PropertyField(m_IsPooled); - EditorGUILayout.PropertyField(m_Colliders); - EditorGUILayout.PropertyField(m_CollisionType); - EditorGUILayout.PropertyField(m_CollisionDamage); - EditorGUILayout.PropertyField(m_DebugCollisions); - EditorGUILayout.PropertyField(m_DebugDamage); - EditorGUILayout.PropertyField(m_EnableBoundary); - } - else - { - EditorGUILayout.EndFoldoutHeaderGroup(); - } - - EditorGUILayout.Space(); - - baseObject.NetworkTransformPropertiesVisible = EditorGUILayout.BeginFoldoutHeaderGroup(baseObject.NetworkTransformPropertiesVisible, $"{nameof(NetworkTransform)} Properties"); - if (baseObject.NetworkTransformPropertiesVisible) - { - base.OnInspectorGUI(); - } - else - { - serializedObject.ApplyModifiedProperties(); - } - EditorGUILayout.EndFoldoutHeaderGroup(); - } -} -#endif - -/// -/// Projectiles will be owner driven -/// -public partial class BaseObjectMotionHandler : NetworkTransform, ICollisionHandler, IContactEventHandler -{ - -#if UNITY_EDITOR - public bool BaseObjectMotionHandlerPropertiesVisible = false; - public bool NetworkTransformPropertiesVisible = false; -#endif - private static GameObject WorldBoundary; - - // Defaults to 1024 but can be updated by adding a GameObject named WorldBoundary and adding a SphereCollider to that. - private static float WorldBoundaryRadius = 1024.0f; - - public bool IsPooled = true; - public CollisionTypes CollisionType; - public ushort CollisionDamage; - - public Action OnNetworkObjectDespawned; - - public bool DebugBoundaryCheck; - - protected CollisionMessageInfo CollisionMessage = new CollisionMessageInfo(); - private Rigidbody m_Rigidbody; - private NetworkRigidbody m_NetworkRigidbody; - - public Rigidbody Rigidbody => m_Rigidbody; - public NetworkRigidbody NetworkRigidbody => m_NetworkRigidbody; - - [Tooltip("Enables/Disables collision logging (based on per derived type)")] - public bool DebugCollisions; - - [Tooltip("Enables/Disables damage logging (based on per derived type)")] - public bool DebugDamage; - - [HideInInspector] - public bool IsPhysicsBody; - - [Tooltip("When enabled, all physics bodies will head back towards the center once they reach the boundary limits.")] - public bool EnableBoundary = true; - - [Tooltip("Add all colliders to this list that will be used to detect collisions (exclude triggers).")] - public List Colliders; - - private Dictionary ColliderScales = new Dictionary(); - - protected void EnableColliders(bool enable) - { - foreach (var collider in Colliders) - { - collider.enabled = enable; - } - } - - private const float k_BoundaryCheckFrequency = 0.06667f; - private const int k_BoundaryCheckDistributionRes = 10; - private static int s_BoundaryOffsetCount = 1; - private float m_NextBoundaryCheck; - - public Rigidbody GetRigidbody() { return m_Rigidbody; } - - protected virtual Vector3 OnGetObjectVelocity(bool getReference = false) - { - if (m_Rigidbody != null) - { -#if UNITY_2023_3_OR_NEWER - return m_Rigidbody.linearVelocity; -#else - return m_Rigidbody.velocity; -#endif - } - return Vector3.zero; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Vector3 GetObjectVelocity(bool getReference = false) - { - return OnGetObjectVelocity(getReference); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetObjectVelocity(Vector3 velocity) - { - if (m_Rigidbody != null) - { -#if UNITY_2023_3_OR_NEWER - m_Rigidbody.linearVelocity = velocity; -#else - m_Rigidbody.velocity = velocity; -#endif - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected virtual Vector3 OnGetObjectAngularVelocity() - { - if (m_Rigidbody != null) - { - return m_Rigidbody.angularVelocity; - } - return Vector3.zero; - } - - public Vector3 GetObjectAngularVelocity() - { - return OnGetObjectAngularVelocity(); - } - - - protected void IgnoreCollision(GameObject objectA, GameObject objectB, bool shouldIgnore) - { - if (objectA == null || objectB == null) - { - return; - } - - var rootA = objectA.transform.root.gameObject; - var rootB = objectB.transform.root.gameObject; - - var collidersA = rootA.GetComponentsInChildren(); - var collidersB = rootB.GetComponentsInChildren(); - - foreach (var colliderA in collidersA) - { - foreach (var colliderB in collidersB) - { - Physics.IgnoreCollision(colliderA, colliderB, shouldIgnore); - } - } - } - - public override void OnNetworkDespawn() - { - base.OnNetworkDespawn(); - OnNetworkObjectDespawned?.Invoke(); - OnNetworkObjectDespawned = null; - - /*var fxObjects = GetComponentsInChildren(); - foreach (var fxObject in fxObjects) - { - fxObject.transform.SetParent(null); - }*/ - } - - /// - /// Override this method to make adjustments for wrapping - /// - protected virtual bool OnBoundaryReached() - { - return true; - } - - // Distribute the boundary check processing evenly amongst all instances - private void SetNextBoundaryCheck(float timeOffset = k_BoundaryCheckFrequency, bool init = false) - { - if (init) - { - s_BoundaryOffsetCount++; - m_NextBoundaryCheck = Time.realtimeSinceStartup + (timeOffset * (s_BoundaryOffsetCount % k_BoundaryCheckDistributionRes)); - } - else - { - m_NextBoundaryCheck = Time.realtimeSinceStartup + timeOffset; - } - } - - private void CheckBoundary() - { - if (Rigidbody == null || Rigidbody != null && Rigidbody.isKinematic) - { - return; - } - if (EnableBoundary && m_NextBoundaryCheck < Time.realtimeSinceStartup) - { - var distance = Vector3.Distance(Vector3.zero, transform.position); - // if we reached the maximum boundary, then reverse the velocity of the Rigidbody if it has one - if (distance >= WorldBoundaryRadius && OnBoundaryReached()) - { - - var dir = Vector3.zero - transform.position; - var velocity = GetObjectVelocity(); - velocity = velocity.magnitude * dir; - SetObjectVelocity(velocity); - } - else - { - SetNextBoundaryCheck(); - } - } - } - - protected override void Awake() - { - if (WorldBoundary == null) - { - WorldBoundary = GameObject.Find("WorldBoundary"); - if (WorldBoundary != null) - { - var sphereCollider = WorldBoundary.GetComponent(); - WorldBoundaryRadius = sphereCollider.radius; - } - } - - m_Rigidbody = GetComponent(); - m_NetworkRigidbody = GetComponent(); - - SetNextBoundaryCheck(init: true); - - base.Awake(); - } - - protected virtual void Start() - { - CollisionMessage.Damage = CollisionDamage; - CollisionMessage.SetFlag(true, (uint)CollisionType); - } - - /// - /// Invoked every network tick if this instance has sent a update. - /// - /// - protected override void OnAuthorityPushTransformState(ref NetworkTransformState networkTransformState) - { - CheckBoundary(); - base.OnAuthorityPushTransformState(ref networkTransformState); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - static public GameObject GetRootParent(GameObject parent) - { - return parent.transform.root.gameObject; - } - - /// - /// This method provides the ability to make adjustments to the collision message as well as apply damage locally if needed - /// - /// - /// - protected virtual bool OnPrepareCollisionMessage(Vector3 averagedCollisionNormal, BaseObjectMotionHandler targetBaseObjectMotionHandler) - { - return true; - } - - protected virtual void OnHandleCollision(CollisionMessageInfo collisionMessage, bool isLocal = false, bool applyImmediately = false) - { - } - - public void HandleCollision(CollisionMessageInfo collisionMessage, bool isLocal = false, bool applyImmediately = false) - { - OnHandleCollision(collisionMessage, isLocal, applyImmediately); - // Hanlding is invoked before logging so logging can determine the end result. - if (DebugCollisions) - { - LogHandleCollision(collisionMessage); - } - } - - /// - /// Used to communicate collisions - /// - /// - /// - [Rpc(SendTo.Authority, RequireOwnership = false)] - public void HandleCollisionRpc(CollisionMessageInfo collisionMessage, RpcParams rpcParams = default) - { - // If authority changes while this message is in flight, forward it to the new authority - if (!HasAuthority) - { - LogMessage($"[HandleCollisionRpc][Not Owner][Routing Collision][{name}] Routing to Client-{OwnerClientId}"); - SendCollisionMessage(CollisionMessage); - return; - } - - CollisionMessage.SourceOwner = rpcParams.Receive.SenderClientId; - CollisionMessage.TargetOwner = OwnerClientId; - HandleCollision(collisionMessage); - } - - /// - /// Invoked by the owner of the object inflicting damage, this will handle the RPC routing - /// of the message to the appropriate targeted owner of the object taking damage - /// - /// - public void SendCollisionMessage(CollisionMessageInfo collisionMessage) - { - LogDamage(collisionMessage); - HandleCollisionRpc(collisionMessage); - } - - /// - /// Override this method if you have registerd the instance with and - /// want to customize collision. - /// - /// - /// Only automatically handles collisions. For an example of a customized contact event - /// handler look over . - /// - /// The average normal of the collisions contacts - /// The that collided with this object. - protected virtual void OnContactEvent(ulong eventId, Vector3 averagedCollisionNormal, Rigidbody collidingBody, Vector3 contactPoint, bool hasCollisionStay = false, Vector3 averagedCollisionStayNormal = default) - { - - } - - protected ulong LastEventId { get; private set; } - /// - /// Invoked from when a non-kinematic body collides - /// with another registered . - /// - /// The averaged normal of the collision - /// The this objects collided with - public void ContactEvent(ulong eventId, Vector3 averageNormal, Rigidbody collidingBody, Vector3 contactPoint, bool hasCollisionStay = false, Vector3 averagedCollisionStayNormal = default) - { - if (!IsSpawned) - { - return; - } - OnContactEvent(eventId, averageNormal, collidingBody, contactPoint, hasCollisionStay, averagedCollisionStayNormal); - LastEventId = eventId; - } - - - /// - /// Invoked this to send a collision message to the authoritative instance. - /// - /// - /// - protected void EventCollision(Vector3 averagedCollisionNormal, BaseObjectMotionHandler collidingBodyBaseObject) - { -#if DEBUG || UNITY_EDITOR - if (DebugCollisions) - { - LogCollision(ref collidingBodyBaseObject); - } -#endif - - if (OnPrepareCollisionMessage(averagedCollisionNormal, collidingBodyBaseObject)) - { - CollisionId++; - CollisionMessage.CollisionId = CollisionId; - CollisionMessage.Time = Time.realtimeSinceStartup; - CollisionMessage.Source = OwnerClientId; - CollisionMessage.SourceId = NetworkObjectId; - CollisionMessage.Destination = collidingBodyBaseObject.OwnerClientId; - CollisionMessage.DestNetworkObjId = collidingBodyBaseObject.NetworkObjectId; - CollisionMessage.DestBehaviourId = collidingBodyBaseObject.NetworkBehaviourId; - - // Otherwise, send the collision message to the owner of the object - collidingBodyBaseObject.SendCollisionMessage(CollisionMessage); - } - } - - #region DEBUG CONSOLE LOGGING METHODS - - /// - /// Override to handle local collisions generating an outbound message - /// - /// - /// - protected virtual string OnLogCollision(ref BaseObjectMotionHandler objectHit) - { - return "[LocalCollision-End]"; - } - - private static int CollisionId = 0; - private void LogCollision(ref BaseObjectMotionHandler objectHit) - { - if (!DebugCollisions) - { - return; - } - var distance = Vector3.Distance(transform.position, objectHit.transform.position); - /*NetworkManagerHelper.Instance.*/LogMessage($"[{Time.realtimeSinceStartup}][LocalCollision][{name}][collided with][{objectHit.name}][Collider:{name}][Distance: {distance}]" + - $"{OnLogCollision(ref objectHit)}."); - } - - protected virtual string OnLogDamage(CollisionMessageInfo collisionMessage) - { - return string.Empty; - } - - protected void LogDamage(CollisionMessageInfo collisionMessage) - { - if (!DebugDamage || collisionMessage.Damage == 0) - { - return; - } - var additionalInfo = OnLogDamage(collisionMessage); - /*NetworkManagerHelper.Instance.*/LogMessage($"[{name}][++Damaged++][Client-{collisionMessage.TargetOwner}][{collisionMessage.GetCollisionType()}][Dmg:{collisionMessage.Damage}] {additionalInfo}"); - } - - /// - /// Override to log incoming collision messages - /// - /// - protected virtual string OnLogHandleCollision(ref CollisionMessageInfo collisionMessage) - { - return "[CollisionMessage-End]"; - } - - private void LogHandleCollision(CollisionMessageInfo collisionMessage, bool isLocal = false) - { - var distance = -1.0f; - if (NetworkManager.SpawnManager.SpawnedObjects.ContainsKey(collisionMessage.DestNetworkObjId)) - { - distance = Vector3.Distance(transform.position, NetworkManager.SpawnManager.SpawnedObjects[collisionMessage.DestNetworkObjId].transform.position); - } - var distStr = distance == -1.0f ? $"{collisionMessage.DestNetworkObjId} DNE!!" : $"Distance: {distance}"; - /*NetworkManagerHelper.Instance.*/LogMessage($"[{collisionMessage.CollisionId}][{collisionMessage.Time}][CollisionMessage][IsLocal: {isLocal}][{name}][Src:{collisionMessage.Source}][Dest:{collisionMessage.Destination}]" + - $"[NObjId:{collisionMessage.DestNetworkObjId}][NBvrId:{collisionMessage.DestBehaviourId}][{distStr}]{OnLogHandleCollision(ref collisionMessage)}."); - } - - protected void LogMessage(string msg, bool forceMessage = false, float messageTime = 10.0f) - { - /*NetworkManagerHelper.Instance.LogMessage*/ - Debug.Log($"[{name}]{msg}");/*, messageTime, forceMessage);*/ - } - - #endregion - - #region VECTOR AND EULER HELPER METHODS - /// - /// Enable this to get 6 decimal precision when logging Vector3 values - /// - private bool m_HigPrecisionDecimals = false; - protected string GetVector3Values(ref Vector3 vector3) - { - if (m_HigPrecisionDecimals) - { - return $"({vector3.x:F6},{vector3.y:F6},{vector3.z:F6})"; - } - else - { - return $"({vector3.x:F2},{vector3.y:F2},{vector3.z:F2})"; - } - } - - protected string GetVector3Values(Vector3 vector3) - { - return GetVector3Values(ref vector3); - } - - protected Vector3 GetRandomVector3(float min, float max, Vector3 baseLine, bool randomlyApplySign = false) - { - var retValue = new Vector3(baseLine.x * Random.Range(min, max), baseLine.y * Random.Range(min, max), baseLine.z * Random.Range(min, max)); - if (!randomlyApplySign) - { - return retValue; - } - - retValue.x *= Random.Range(1, 100) >= 50 ? -1 : 1; - retValue.y *= Random.Range(1, 100) >= 50 ? -1 : 1; - retValue.z *= Random.Range(1, 100) >= 50 ? -1 : 1; - return retValue; - } - - protected Vector3 GetRandomVector3(MinMaxVector2Physics minMax, Vector3 baseLine, bool randomlyApplySign = false) - { - return GetRandomVector3(minMax.Min, minMax.Max, baseLine, randomlyApplySign); - } - - private const float k_DefaultThreshold = 0.0025f; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected bool Approximately(float a, float b, float threshold = k_DefaultThreshold) - { - return Math.Round(Mathf.Abs(a - b), 4) <= threshold; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected bool Approximately(Vector3 a, Vector3 b, float threshold = k_DefaultThreshold) - { - return Approximately(a.x, b.x) && Approximately(a.y, b.y) && Approximately(a.z, b.z); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected bool Approximately(Quaternion a, Quaternion b, float threshold = k_DefaultThreshold) - { - return Approximately(a.x, b.x) && Approximately(a.y, b.y) && Approximately(a.z, b.z) && Approximately(a.w, b.w); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected float EulerDelta(float a, float b) - { - return Mathf.DeltaAngle(a, b); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected bool ApproximatelyEuler(float a, float b, float threshold = k_DefaultThreshold) - { - return Mathf.Abs(EulerDelta(a, b)) <= threshold; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected bool ApproximatelyEuler(Vector3 a, Vector3 b, float threshold = k_DefaultThreshold) - { - return ApproximatelyEuler(a.x, b.x, threshold) && ApproximatelyEuler(a.y, b.y, threshold) && ApproximatelyEuler(a.z, b.z, threshold); - } - #endregion -} - -[Serializable] -public class MinMaxVector2Physics -{ - [Range(1.0f, 200.0f)] - public float Min; - [Range(1.0f, 200.0f)] - public float Max; - - public MinMaxVector2Physics(float min, float max) - { - Min = min; - Max = max; - } -} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs.meta deleted file mode 100644 index d016b1d61..000000000 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/BaseObjectMotionHandler.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d97f2549555383847a36d4dc0a26a53f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs deleted file mode 100644 index 46bf76df5..000000000 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Unity.Netcode; - -public interface ICollisionHandler -{ - /// - /// Invoked by non-authority objects detecting a collision, this determines the - /// appropriate targeted authority of the object being collided with. If the local - /// instance is authority it handles collision locally - /// - void SendCollisionMessage(CollisionMessageInfo collisionMessage); - - /// - /// Authority instances receive collision messages from non-authority instances via this implemented method - /// - /// - /// - [Rpc(SendTo.Authority, DeferLocal = true)] - void HandleCollisionRpc(CollisionMessageInfo collisionMessage, RpcParams rpcParams = default); -} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs.meta deleted file mode 100644 index 675c74f2c..000000000 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Gameplay/IDamageHandler.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e77960601117fe644a32bd9dc9a9a34d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs index c06ae1f3a..a1aa37b76 100644 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs @@ -1,73 +1,76 @@ using UnityEngine; using UnityEngine.InputSystem; -public class AvatarInputs : MonoBehaviour +namespace com.unity.multiplayer.samples.distributed_authority.input { - [Header("Character Input Values")] - public Vector2 move; - public Vector2 look; - public bool jump; - public bool sprint; + public class AvatarInputs : MonoBehaviour + { + [Header("Character Input Values")] + public Vector2 move; + public Vector2 look; + public bool jump; + public bool sprint; - [Header("Movement Settings")] - public bool analogMovement; + [Header("Movement Settings")] + public bool analogMovement; - [Header("Mouse Cursor Settings")] - public bool cursorLocked = true; - public bool cursorInputForLook = true; + [Header("Mouse Cursor Settings")] + public bool cursorLocked = true; + public bool cursorInputForLook = true; #if ENABLE_INPUT_SYSTEM - public void OnMove(InputValue value) - { - MoveInput(value.Get()); - } + public void OnMove(InputValue value) + { + MoveInput(value.Get()); + } - public void OnLook(InputValue value) - { - if(cursorInputForLook) + public void OnLook(InputValue value) { - LookInput(value.Get()); + if (cursorInputForLook) + { + LookInput(value.Get()); + } } - } - public void OnJump(InputValue value) - { - JumpInput(value.isPressed); - } + public void OnJump(InputValue value) + { + JumpInput(value.isPressed); + } - public void OnSprint(InputValue value) - { - SprintInput(value.isPressed); - } + public void OnSprint(InputValue value) + { + SprintInput(value.isPressed); + } #endif - public void MoveInput(Vector2 newMoveDirection) - { - move = newMoveDirection; - } + public void MoveInput(Vector2 newMoveDirection) + { + move = newMoveDirection; + } - public void LookInput(Vector2 newLookDirection) - { - look = newLookDirection; - } + public void LookInput(Vector2 newLookDirection) + { + look = newLookDirection; + } - public void JumpInput(bool newJumpState) - { - jump = newJumpState; - } + public void JumpInput(bool newJumpState) + { + jump = newJumpState; + } - public void SprintInput(bool newSprintState) - { - sprint = newSprintState; - } + public void SprintInput(bool newSprintState) + { + sprint = newSprintState; + } - private void OnApplicationFocus(bool hasFocus) - { - SetCursorState(cursorLocked); - } + void OnApplicationFocus(bool hasFocus) + { + SetCursorState(cursorLocked); + } - private void SetCursorState(bool newState) - { - Cursor.lockState = newState ? CursorLockMode.Locked : CursorLockMode.None; + void SetCursorState(bool newState) + { + Cursor.lockState = newState ? CursorLockMode.Locked : CursorLockMode.None; + } } } diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs deleted file mode 100644 index fcfcfa038..000000000 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs +++ /dev/null @@ -1,148 +0,0 @@ -using System.Runtime.CompilerServices; -using Unity.Netcode; -using UnityEngine; - -/// -/// Only 15 types are allowed. -/// Applied to the first byte of -/// -public enum CollisionTypes -{ - TBD0 = 0x01, - TBD1 = 0x02, - TBD2 = 0x03, - TBD3 = 0x04, - TBD4 = 0x05, - DebugCollision = 0x0F, - // Maximum value for collision types is 15 - 0x0E -} - -/// -/// Flags to be used with -/// 16, 32, 64, and 128 are used for flags -/// -public enum CollisionCategoryFlags -{ - // Four flags are reserved - Standard = 0x10, - CollisionForce = 0x20, - CollisionPoint = 0x40, -} - -public struct CollisionMessageInfo : INetworkSerializable -{ - /// - /// Flags are serialized and determine the collision type - /// - public byte Flags; - - /// - /// Damage is serialized and is set based on the type - /// - public ushort Damage; - - /// - /// Collision force is serialized only if the flags contains the - /// flag. - /// - public Vector3 CollisionForce; - - /// - /// Collision force is serialized only if the flags contains the - /// flag. - /// - public Vector3 CollisionPoint; - - /// - /// Never serialized, only used locally to determine if - /// we are - /// - public bool DebugCollisionEnabled; - - public int CollisionId; - public float Time; - public ulong Source; - public ulong Destination; - public ulong DestNetworkObjId; - public ushort DestBehaviourId; - - /// - /// Never serialized, only used locally - /// - public ulong SourceId; - - /// - /// Never serialized, only used locally - /// - public ulong SourceOwner; - - /// - /// Never serialized, only used locally - /// - public ulong TargetOwner; - - public CollisionTypes GetCollisionType() - { - return (CollisionTypes)(Flags & 0x0F); - } - - public bool HasCollisionForce() - { - return (Flags & (uint)CollisionCategoryFlags.CollisionForce) == (byte)CollisionCategoryFlags.CollisionForce; - } - - private bool DebugCollisionsEnabled - { - get - { - return GetFlag((uint)CollisionTypes.DebugCollision); - } - - set - { - SetFlag(value, (uint)CollisionTypes.DebugCollision); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetFlag(bool set, uint flag) - { - var flags = (uint)Flags; - if (set) { flags = flags | flag; } - else { flags = flags & ~flag; } - Flags = (byte)flags; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool GetFlag(uint flag) - { - var flags = (uint)Flags; - return (flags & flag) != 0; - } - - public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter - { - serializer.SerializeValue(ref Flags); - serializer.SerializeValue(ref Damage); - // only if we have a collision force should we serialize it (read and write) - if (GetFlag((uint)CollisionCategoryFlags.CollisionForce)) - { - serializer.SerializeValue(ref CollisionForce); - } - - if (GetFlag((uint)CollisionCategoryFlags.CollisionPoint)) - { - serializer.SerializeValue(ref CollisionForce); - } - - if (DebugCollisionsEnabled) - { - serializer.SerializeValue(ref CollisionId); - serializer.SerializeValue(ref Time); - serializer.SerializeValue(ref Source); - serializer.SerializeValue(ref Destination); - serializer.SerializeValue(ref DestNetworkObjId); - serializer.SerializeValue(ref DestBehaviourId); - } - } -} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs.meta deleted file mode 100644 index dcd19bebc..000000000 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/CollisionMessageInfo.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c2fd728083c5b4740926d76679851317 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs deleted file mode 100644 index a97338d6c..000000000 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs +++ /dev/null @@ -1,662 +0,0 @@ -using System; -using System.Collections.Generic; -using Unity.Netcode; -using Unity.Netcode.Components; -using UnityEngine; - -#if UNITY_EDITOR -using UnityEditor; -/// -/// The custom editor for the component. -/// -[CustomEditor(typeof(PhysicsObjectMotion), true)] -public class PhysicsObjectMotionEditor : BaseObjectMotionHandlerEditor -{ - private SerializedProperty m_CollisionImpulseEntries; - private SerializedProperty m_MaxAngularVelocity; - private SerializedProperty m_MaxVelocity; - private SerializedProperty m_MinMaxStartingTorque; - private SerializedProperty m_MinMaxStartingForce; - - public override void OnEnable() - { - m_CollisionImpulseEntries = serializedObject.FindProperty(nameof(PhysicsObjectMotion.CollisionImpulseEntries)); - m_MaxAngularVelocity = serializedObject.FindProperty(nameof(PhysicsObjectMotion.MaxAngularVelocity)); - m_MaxVelocity = serializedObject.FindProperty(nameof(PhysicsObjectMotion.MaxVelocity)); - m_MinMaxStartingTorque = serializedObject.FindProperty(nameof(PhysicsObjectMotion.MinMaxStartingTorque)); - m_MinMaxStartingForce = serializedObject.FindProperty(nameof(PhysicsObjectMotion.MinMaxStartingForce)); - base.OnEnable(); - } - - public override void OnInspectorGUI() - { - var physicsObject = target as PhysicsObjectMotion; - - physicsObject.PhysicsObjectMotionPropertiesVisible = EditorGUILayout.BeginFoldoutHeaderGroup(physicsObject.PhysicsObjectMotionPropertiesVisible, $"{nameof(PhysicsObjectMotion)} Properties"); - if (physicsObject.PhysicsObjectMotionPropertiesVisible) - { - // End the header group since m_MinMaxStartingTorque and m_MinMaxStartingForce both use header groups - EditorGUILayout.EndFoldoutHeaderGroup(); - EditorGUILayout.PropertyField(m_CollisionImpulseEntries); - EditorGUILayout.PropertyField(m_MaxAngularVelocity); - EditorGUILayout.PropertyField(m_MaxVelocity); - EditorGUILayout.PropertyField(m_MinMaxStartingTorque); - EditorGUILayout.PropertyField(m_MinMaxStartingForce); - } - else - { - EditorGUILayout.EndFoldoutHeaderGroup(); - } - - EditorGUILayout.Space(); - - base.OnInspectorGUI(); - } -} -#endif - - -public partial class PhysicsObjectMotion : BaseObjectMotionHandler -{ -#if UNITY_EDITOR - public bool PhysicsObjectMotionPropertiesVisible = false; -#endif - - [Serializable] - public struct CollisionImpulseMultiplierEntry - { - public CollisionTypes CollisionType; - public float MaxCollisionForce; - } - public List CollisionImpulseEntries; - private Dictionary CollisionImpulseTable; - - public float MaxAngularVelocity = 30; - public float MaxVelocity = 30; - [HideInInspector] - public float StartingMass = 1.0f; - - public const float MaxMass = 5.0f; - public const float MinMass = 0.10f; - - public MinMaxVector2Physics MinMaxStartingTorque = new MinMaxVector2Physics(5.0f, 15.0f); - public MinMaxVector2Physics MinMaxStartingForce = new MinMaxVector2Physics(5.0f, 30.0f); - - - protected NetworkVariable BeenInitialized = new NetworkVariable(false, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner); - /// - /// All of the below values keep the physics objects synchronized between clients so when ownership changes the local Rigidbody can be configured to mirror - /// the last known physics related states. - /// - protected NetworkVariable Mass = new NetworkVariable(1.0f, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner); - protected NetworkVariable AngularVelocity = new NetworkVariable(default, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner); - protected NetworkVariable Velocity = new NetworkVariable(default, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner); - protected NetworkVariable Torque = new NetworkVariable(default, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner); - protected NetworkVariable Force = new NetworkVariable(default, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner); - - - - protected override void Awake() - { - base.Awake(); - CollisionImpulseTable = new Dictionary(); - foreach (var entry in CollisionImpulseEntries) - { - if (!CollisionImpulseTable.ContainsKey(entry.CollisionType)) - { - CollisionImpulseTable.Add(entry.CollisionType, entry); - } - else - { - Debug.LogWarning($"[Duplicate Entry] A duplicate {nameof(CollisionImpulseMultiplierEntry)} of type {entry.CollisionType} was detected! Ignoring entry."); - } - } - - StartingMass = Rigidbody.mass; - } - - protected override Vector3 OnGetObjectVelocity(bool getReference = false) - { - if (getReference) - { - return Velocity.Value; - } - return base.OnGetObjectVelocity(getReference); - } - - protected override Vector3 OnGetObjectAngularVelocity() - { - return AngularVelocity.Value; - } - - protected void UpdateVelocity(Vector3 velocity, bool updateObjectVelocity = true) - { - if (HasAuthority) - { - if (updateObjectVelocity) - { - SetObjectVelocity(velocity); - } - Velocity.Value = velocity; - } - } - - protected void UpdateAngularVelocity(Vector3 angularVelocity) - { - if (HasAuthority) - { - Rigidbody.angularVelocity = angularVelocity; - AngularVelocity.Value = angularVelocity; - } - } - - protected void UpdateTorque(Vector3 torque) - { - if (HasAuthority) - { - Rigidbody.AddTorque(torque); - Torque.Value = torque; - } - } - - protected void UpdateImpulseForce(Vector3 impulseForce) - { - if (HasAuthority) - { - Rigidbody.AddForce(impulseForce, ForceMode.Impulse); - Force.Value = impulseForce; - } - } - - protected void UpdateMass(float mass) - { - if (HasAuthority) - { - if (mass > MinMass && mass < MaxMass) - { - Rigidbody.mass = mass; - } - else - { - NetworkLog.LogWarningServer($"[{name}] Trying to assign mass of {mass} which is outside the mass boundary of {MinMass} to {MaxMass}! Clamping."); - Rigidbody.mass = Mathf.Clamp(mass, MinMass, MaxMass); - } - } - } - - /// - /// Invoked when authority pushes state, we keep track whether the most recent state - /// had rotation or position deltas. - /// - /// - /// This keeps track of angular and motion velocities in order to keep objects synchronized - /// when ownership changes. - /// - /// - protected override void OnAuthorityPushTransformState(ref NetworkTransformState networkTransformState) - { - // If we haven't already initialized for the first time or haven't initialized previous state values during spawn then exit early - if (!BeenInitialized.Value) - { - return; - } - - if (networkTransformState.HasRotAngleChange && !Rigidbody.isKinematic) - { - if (Vector3.Distance(GetObjectAngularVelocity(), Rigidbody.angularVelocity) > RotAngleThreshold) - { - UpdateAngularVelocity(Rigidbody.angularVelocity); - } - } - - if (networkTransformState.HasPositionChange && !Rigidbody.isKinematic) - { - var velocity = GetObjectVelocity(); - if (Vector3.Distance(GetObjectVelocity(true), velocity) > PositionThreshold) - { - UpdateVelocity(velocity, false); - } - } - - base.OnAuthorityPushTransformState(ref networkTransformState); - } - - public override void OnNetworkSpawn() - { - - // When creating customized NetworkTransform behaviors, you must always invoke the base OnNetworkSpawn - // method if you override it in any child derive generation (i.e. always assure the NetworkTransform.OnNetworkSpawn - // method is invoked) - base.OnNetworkSpawn(); - - IsPhysicsBody = true; - // Assure all colliders are enabled (authority and non-authority) - EnableColliders(true); - - // Register for contact events (authority and non-authority) - RigidbodyContactEventManager.Instance.RegisterHandler(this); - - // Clamp the linear and angular velocities - Rigidbody.maxAngularVelocity = MaxAngularVelocity; - Rigidbody.maxLinearVelocity = MaxVelocity; - if (HasAuthority) - { - - // Assure we are not still in kinematic mode - NetworkRigidbody.SetIsKinematic(false); - - // Since state can be preserved during a CMB service connection when there are no clients connected, - // this section determines whether we need to initialize the physics object or just apply the last - // known velocities. - if (!BeenInitialized.Value) - { - BeenInitialized.Value = true; - var torque = GetRandomVector3(MinMaxStartingTorque, Vector3.one, true); - Rigidbody.AddTorque(torque, ForceMode.Impulse); - UpdateTorque(torque); - var force = GetRandomVector3(MinMaxStartingForce, Vector3.one, true); - force.y = 0f; - Rigidbody.AddForce(force, ForceMode.Impulse); - UpdateImpulseForce(force); - } - else - { - Rigidbody.angularVelocity = Vector3.ClampMagnitude(GetObjectAngularVelocity(), MaxAngularVelocity); - SetObjectVelocity(Vector3.ClampMagnitude(GetObjectVelocity(), MaxVelocity)); - } - } - } - - public override void OnNetworkDespawn() - { - RigidbodyContactEventManager.Instance.RegisterHandler(this, false); - // Invoke the base before applying any additional adjustments - base.OnNetworkDespawn(); - - // If we are pooled and not shutting down, then reset the physics object for re-use later - // ** Important to do this ** - if (IsPooled) - { - EnableColliders(false); - if (!Rigidbody.isKinematic) - { - Rigidbody.angularVelocity = Vector3.zero; - SetObjectVelocity(Vector3.zero); - NetworkRigidbody.SetIsKinematic(true); - } - Rigidbody.mass = StartingMass; - BeenInitialized.Reset(); - AngularVelocity.Reset(); - Velocity.Reset(); - Torque.Reset(); - Force.Reset(); - Mass.Reset(); - } - } - - /// - /// When ownership changes, we apply the last known angular and motion velocities. - /// Otherwise, - /// - protected override void OnOwnershipChanged(ulong previous, ulong current) - { - if (NetworkManager.LocalClientId == current) - { - NetworkRigidbody.SetIsKinematic(false); - if (BeenInitialized.Value) - { - Rigidbody.angularVelocity = Vector3.ClampMagnitude(GetObjectAngularVelocity(), MaxAngularVelocity); - SetObjectVelocity(Vector3.ClampMagnitude(GetObjectVelocity(true), MaxVelocity)); - } - else - { - Rigidbody.AddTorque(Torque.Value, ForceMode.Impulse); - Rigidbody.AddForce(Force.Value, ForceMode.Impulse); - } - } - else - { - NetworkRigidbody.SetIsKinematic(true); - } - base.OnOwnershipChanged(previous, current); - } - - private struct RemoteForce - { - public float EndOfLife; - public Vector3 TargetForce; - public Vector3 AppliedForce; - } - - private List m_RemoteAppliedForce = new List(); - private Dictionary m_CollisionLatency = new Dictionary(); - - /// - /// Handles queuing up incoming collisions (remote and local) to be processed - /// - protected override void OnHandleCollision(CollisionMessageInfo collisionMessage, bool isLocal = false, bool applyImmediately = false) - { - if (collisionMessage.HasCollisionForce()) - { - AddForceDirect(collisionMessage.CollisionForce); - } - base.OnHandleCollision(collisionMessage); - } - - public void AddForceDirect(Vector3 force) - { - var remoteForce = new RemoteForce() - { - TargetForce = force, - AppliedForce = Vector3.zero, - }; - - - m_RemoteAppliedForce.Add(remoteForce); - } - - /// - /// TODO: - /// - Track body collisions and the recent kineticForce applied. - /// - Cap the total applied kineticForce to (n) value. - /// - Only update the delta kineticForce relative to recent collision messages sent to another body - /// - This should help with the "sudden" bursts of force when colliding against other bodies. - /// - protected void OnContactEventOld(ulong eventId, Vector3 averagedCollisionNormal, Rigidbody collidingBody, Vector3 contactPoint, bool hasCollisionStay = false, Vector3 averagedCollisionStayNormal = default) - { - // TODO: Possibly come up with a better way to route contact events at this level. - // For now, since lasers are always kinematic and send damage messages we divert contact events to the LaserMotion child class - var collidingBaseObjectMotion = collidingBody.GetComponent(); - var collidingBodyPhys = collidingBaseObjectMotion as PhysicsObjectMotion; - // If we don't have authority over either object or we are doing a second FixedUpdate pass, then exit early - if (eventId == LastEventId || collidingBaseObjectMotion == null || (!HasAuthority && !collidingBaseObjectMotion.HasAuthority)) - { - return; - } - /*if (collidingBaseObjectMotion.CollisionType == CollisionTypes.Laser) - { - var laserMotion = collidingBaseObjectMotion as LaserMotion; - laserMotion.ContactEvent(eventId, averagedCollisionNormal, Rigidbody, contactPoint); - return; - }*/ - - if (collidingBodyPhys == null) - { - return; - } - - var collisionNormal = hasCollisionStay ? averagedCollisionStayNormal : averagedCollisionNormal; - var velocity = 0.0f; - var kineticForce = Vector3.zero; - var massRatio = 0.0f; - - if (!Rigidbody.isKinematic && collidingBody.isKinematic) - { - // Handle kinematic to non-kinematic local collisions - /*if (collidingBodyPhys.CollisionType == CollisionTypes.Ship && hasCollisionStay) - { - velocity = collidingBodyPhys.MaxVelocity * 0.85f * (collidingBodyPhys as ShipController).GetPrimaryThrusterScale(); - } - else - { - velocity = collidingBodyPhys.GetObjectVelocity(true).sqrMagnitude * 0.5f; - }*/ - - if (velocity > 0.01f) - { - // Get the mass ratio between the non-kinematic and kinematic when applying to local Rigidbody - massRatio = (Rigidbody.mass / collidingBody.mass); - // Get the over-all kinetic force to appply - // Use the original normal when applying to the local physics body - kineticForce = massRatio * velocity * collisionNormal; - Rigidbody.AddForce(kineticForce, ForceMode.Impulse); - if (DebugCollisions) - { - if (kineticForce.magnitude < 1.0f) - { - /*NetworkManagerHelper.Instance.LogMessage($"[{name}][FirstBody] Mass Ratio: {massRatio} | Collision Normal:{GetVector3Values(-collisionNormal)} | {velocity}");*/ - } - /*NetworkManagerHelper.Instance.LogMessage($"[{name}][FirstBody][Collision Stay: {hasCollisionStay}] Collided with {collidingBody.name} that is locally applying {GetVector3Values(kineticForce)} impulse force to {name}.");*/ - } - } - - // Handle non-kinematic to kinematic remote collisions - if (hasCollisionStay) - { - /*if (CollisionType == CollisionTypes.Ship && hasCollisionStay) - { - velocity = MaxVelocity * (this as ShipController).GetPrimaryThrusterScale(); - } - else - { - velocity = Rigidbody.linearVelocity.sqrMagnitude * 0.5f; - }*/ - - if (velocity > 0.01f) - { - // Get the mass ratio between the kinematic and non-kinematic when sending to remote Rigidbody - massRatio = (collidingBody.mass / Rigidbody.mass); - // Get the over-all kinetic force to appply - // Invert normal when applying to the colliding physics body - kineticForce = velocity * massRatio * -collisionNormal * 0.0333333f; - CollisionMessage.CollisionForce = kineticForce; - CollisionMessage.SetFlag(true, (uint)CollisionCategoryFlags.CollisionForce); - if (DebugCollisions) - { - if (kineticForce.magnitude < 1.0f) - { - /*NetworkManagerHelper.Instance.LogMessage($"[{name}][SecondBody] Mass Ratio: {massRatio} | Collision Normal:{GetVector3Values(-collisionNormal)} | {velocity}");*/ - } - /*NetworkManagerHelper.Instance.LogMessage($"[{name}][SecondBody][Collision Stay: {hasCollisionStay}] Sending impulse thrust {GetVector3Values(kineticForce)} to {collidingBody.name}.");*/ - } - // Send collision to owner of kinematic body - EventCollision(averagedCollisionNormal, collidingBodyPhys); - } - } - } - if (Rigidbody.isKinematic && !collidingBody.isKinematic) - { - /*if (CollisionType == CollisionTypes.Ship && hasCollisionStay) - { - velocity = MaxVelocity * (this as ShipController).GetPrimaryThrusterScale(); - } - else - { - velocity = GetObjectVelocity(true).sqrMagnitude * 0.5f; - }*/ - - if (velocity > 0.01f) - { - // Get the mass ratio between the kinematic and non-kinematic when sending to remote Rigidbody - massRatio = (Rigidbody.mass / collidingBody.mass); - // Invert normal when applying to the colliding physics body - kineticForce = massRatio * velocity * -collisionNormal; - collidingBody.AddForce(kineticForce, ForceMode.Impulse); - if (DebugCollisions) - { - if (kineticForce.magnitude < 1.0f) - { - /*NetworkManagerHelper.Instance.LogMessage($"[{collidingBody.name}][SecondBody] Mass Ratio: {massRatio} | Collision Normal:{GetVector3Values(-collisionNormal)} | {velocity}");*/ - } - /*NetworkManagerHelper.Instance.LogMessage($"[{collidingBody.name}][SecondBody][Collision Stay: {hasCollisionStay}] Collided with {name} that is locally applying {GetVector3Values(kineticForce)} impulse force to {collidingBody.name}.");*/ - } - } - - if (hasCollisionStay) - { - /*if (collidingBodyPhys.CollisionType == CollisionTypes.Ship && hasCollisionStay) - { - velocity = collidingBodyPhys.MaxVelocity * (collidingBodyPhys as ShipController).GetPrimaryThrusterScale(); - } - else - { - velocity = collidingBody.linearVelocity.sqrMagnitude * 0.5f; - }*/ - - if (velocity > 0.01f) - { - massRatio = (Rigidbody.mass / collidingBody.mass); - // Get the over-all kinetic force to appply - // Use the original normal when applying to the local physics body - kineticForce = massRatio * velocity * collisionNormal * 0.0333333f; - collidingBodyPhys.CollisionMessage.CollisionForce = kineticForce; - collidingBodyPhys.CollisionMessage.SetFlag(true, (uint)CollisionCategoryFlags.CollisionForce); - collidingBodyPhys.EventCollision(averagedCollisionNormal, this); - if (DebugCollisions) - { - if (kineticForce.magnitude < 1.0f) - { - /*NetworkManagerHelper.Instance.LogMessage($"[{collidingBody.name}][FirstBody] Mass Ratio: {massRatio} | Collision Normal:{GetVector3Values(-collisionNormal)} | {velocity}");*/ - } - /*NetworkManagerHelper.Instance.LogMessage($"[{collidingBodyPhys.name}][FirstBody][Collision Stay: {hasCollisionStay}] Sending impulse thrust {GetVector3Values(kineticForce)} to {name}.");*/ - } - } - } - } - base.OnContactEvent(eventId, averagedCollisionNormal, collidingBody, contactPoint); - } - - protected override void OnContactEvent(ulong eventId, Vector3 averagedCollisionNormal, Rigidbody collidingBody, Vector3 contactPoint, bool hasCollisionStay = false, Vector3 averagedCollisionStayNormal = default) - { - // TODO: Possibly come up with a better way to route contact events at this level. - // For now, since lasers are always kinematic and send damage messages we divert contact events to the LaserMotion child class - var collidingBaseObjectMotion = collidingBody.GetComponent(); - var collidingBodyPhys = collidingBaseObjectMotion as PhysicsObjectMotion; - // If we don't have authority over either object or we are doing a second FixedUpdate pass, then exit early - if (eventId == LastEventId || collidingBaseObjectMotion == null || (!HasAuthority && !collidingBaseObjectMotion.HasAuthority)) - { - return; - } - /*if (collidingBaseObjectMotion.CollisionType == CollisionTypes.Laser) - { - var laserMotion = collidingBaseObjectMotion as LaserMotion; - laserMotion.ContactEvent(eventId, averagedCollisionNormal, Rigidbody, contactPoint); - return; - }*/ - - if (collidingBodyPhys == null) - { - return; - } - - var collisionNormal = hasCollisionStay ? averagedCollisionStayNormal : averagedCollisionNormal; - - var thisVelocity = (!Rigidbody.isKinematic ? Rigidbody.linearVelocity.sqrMagnitude : GetObjectVelocity().sqrMagnitude) * 0.5f; - var otherVelocity = (!collidingBody.isKinematic ? collidingBody.linearVelocity.sqrMagnitude : collidingBodyPhys.GetObjectVelocity().sqrMagnitude) * 0.5f; - var thisKineticForce = (Rigidbody.mass / collidingBody.mass) * -collisionNormal * thisVelocity; - var otherKineticForce = (collidingBody.mass / Rigidbody.mass) * collisionNormal * otherVelocity; - - if (!Rigidbody.isKinematic && collidingBody.isKinematic && thisVelocity > 0.01f) - { - CollisionMessage.CollisionForce = thisKineticForce; - CollisionMessage.SetFlag(true, (uint)CollisionCategoryFlags.CollisionForce); - if (DebugCollisions) - { - /*NetworkManagerHelper.Instance.LogMessage($"[{name}][SecondBody][Collision Stay: {hasCollisionStay}] Sending impulse thrust {GetVector3Values(thisKineticForce)} to {collidingBody.name}.");*/ - } - // Send collision to owner of kinematic body - EventCollision(averagedCollisionNormal, collidingBodyPhys); - } - else if (Rigidbody.isKinematic && !collidingBody.isKinematic && otherVelocity > 0.01f) - { - collidingBodyPhys.CollisionMessage.CollisionForce = otherKineticForce; - collidingBodyPhys.CollisionMessage.SetFlag(true, (uint)CollisionCategoryFlags.CollisionForce); - collidingBodyPhys.EventCollision(averagedCollisionNormal, this); - if (DebugCollisions) - { - /*NetworkManagerHelper.Instance.LogMessage($"[{collidingBodyPhys.name}][FirstBody][Collision Stay: {hasCollisionStay}] Sending impulse thrust {GetVector3Values(otherKineticForce)} to {name}.");*/ - } - } - base.OnContactEvent(eventId, averagedCollisionNormal, collidingBody, contactPoint); - } - - /// - /// Accumulatively apply the resultant collision force - /// - /// - private void ApplyCollisionForce(Vector3 force) - { - Rigidbody.AddForce(force, ForceMode.Impulse); - Rigidbody.AddTorque(force * 0.25f, ForceMode.Impulse); - } - - /// - /// Processes the queued collisions forces - /// - private void ProcessRemoteForces() - { - if (m_RemoteAppliedForce.Count == 0) - { - return; - } - var accumulativeForce = Vector3.zero; - for (int i = m_RemoteAppliedForce.Count - 1; i >= 0; i--) - { - var remoteForce = m_RemoteAppliedForce[i]; - accumulativeForce += remoteForce.TargetForce; - if (Approximately(remoteForce.TargetForce, Vector3.zero)) - { - m_RemoteAppliedForce.RemoveAt(i); - } - else - { - m_RemoteAppliedForce[i] = remoteForce; - } - } - ApplyCollisionForce(accumulativeForce); - m_RemoteAppliedForce.Clear(); - } - - /// - /// Hijack the FixedUpdate to assure physics simulation is always - /// taking into consideration the queued collisions to process - /// - /// - /// Override this method to apply additional forces to your physics object - /// - protected virtual void FixedUpdate() - { - if (!IsSpawned || !HasAuthority || Rigidbody != null && Rigidbody.isKinematic) - { - return; - } - - // Process any queued collisions - ProcessRemoteForces(); - } - - /// - /// When is enabled, this will log locally - /// generated collision info for the derived component - /// - /// the hit - /// log string - protected override string OnLogCollision(ref BaseObjectMotionHandler objectHit) - { - return $"[CF: {GetVector3Values(ref CollisionMessage.CollisionForce)}]-{base.OnLogCollision(ref objectHit)}"; - } - - /// - /// When is enabled, this will log remotely - /// received collision info for the derived component - /// - /// the message received - /// log string - protected override string OnLogHandleCollision(ref CollisionMessageInfo collisionMessage) - { - var sourceCollider = $"{collisionMessage.SourceOwner}"; - if (NetworkManager.SpawnManager.SpawnedObjects.ContainsKey(collisionMessage.SourceOwner)) - { - sourceCollider = NetworkManager.SpawnManager.SpawnedObjects[collisionMessage.SourceOwner].name; - } - var resLinearVel = string.Empty; - var resAngularVel = string.Empty; - if (Rigidbody != null) - { - resLinearVel = GetVector3Values(GetObjectVelocity()); - resAngularVel = GetVector3Values(Rigidbody.angularVelocity); - } - return $"[**Collision-Info**][To: {name}][By:{sourceCollider}][Force:{GetVector3Values(ref collisionMessage.CollisionForce)}]" + - $"[LinVel: {resLinearVel}][AngVel: {resAngularVel}]-{base.OnLogHandleCollision(ref collisionMessage)}"; - } -} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs.meta deleted file mode 100644 index 2785f4cca..000000000 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Physics/PhysicsObjectMotion.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5d3f561fb09787c42abad1ab0a51da2f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs index 40d574f0a..269af6e6d 100644 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs @@ -1,234 +1,270 @@ +using Unity.Netcode.Components; +using Unity.Netcode.Editor; using UnityEngine; using UnityEngine.InputSystem; - +using com.unity.multiplayer.samples.distributed_authority.input; #if UNITY_EDITOR using UnityEditor; +#endif -/// -/// The custom editor for the component. -/// -[CustomEditor(typeof(AvatarTransform), true)] -public class AvatarTransformEditor : BaseObjectMotionHandlerEditor +namespace com.unity.multiplayer.samples.distributed_authority.gameplay { - SerializedProperty m_PlayerInput; - SerializedProperty m_AvatarInputs; - SerializedProperty m_WalkSpeed; - SerializedProperty m_SprintSpeed; - SerializedProperty m_Acceleration; - SerializedProperty m_DragCoefficient; - SerializedProperty m_AirControlFactor; - SerializedProperty m_JumpImpulse; - SerializedProperty m_CustomGravityMultiplier; - SerializedProperty m_RotationSpeed; - SerializedProperty m_GroundCheckDistance; - - public override void OnEnable() - { - m_PlayerInput = serializedObject.FindProperty(nameof(AvatarTransform.PlayerInput)); - m_AvatarInputs = serializedObject.FindProperty(nameof(AvatarTransform.AvatarInputs)); - m_WalkSpeed = serializedObject.FindProperty(nameof(AvatarTransform.WalkSpeed)); - m_SprintSpeed = serializedObject.FindProperty(nameof(AvatarTransform.SprintSpeed)); - m_Acceleration = serializedObject.FindProperty(nameof(AvatarTransform.Acceleration)); - m_DragCoefficient = serializedObject.FindProperty(nameof(AvatarTransform.DragCoefficient)); - m_AirControlFactor = serializedObject.FindProperty(nameof(AvatarTransform.AirControlFactor)); - m_JumpImpulse = serializedObject.FindProperty(nameof(AvatarTransform.JumpImpusle)); - m_CustomGravityMultiplier = serializedObject.FindProperty(nameof(AvatarTransform.CustomGravityMultiplier)); - m_RotationSpeed = serializedObject.FindProperty(nameof(AvatarTransform.RotationSpeed)); - m_GroundCheckDistance = serializedObject.FindProperty(nameof(AvatarTransform.GroundCheckDistance)); - - base.OnEnable(); - } - - public override void OnInspectorGUI() +#if UNITY_EDITOR + /// + /// The custom editor for the component. + /// + [CustomEditor(typeof(AvatarTransform), true)] + public class AvatarTransformEditor : NetworkTransformEditor { - var avatarTransform = target as AvatarTransform; - avatarTransform.PropertiesVisible = EditorGUILayout.BeginFoldoutHeaderGroup(avatarTransform.PropertiesVisible, $"{nameof(AvatarTransform)} Properties"); - if (avatarTransform.PropertiesVisible) + SerializedProperty m_Rigidbody; + SerializedProperty m_PlayerInput; + SerializedProperty m_AvatarInputs; + SerializedProperty m_WalkSpeed; + SerializedProperty m_SprintSpeed; + SerializedProperty m_Acceleration; + SerializedProperty m_DragCoefficient; + SerializedProperty m_AirControlFactor; + SerializedProperty m_JumpImpulse; + SerializedProperty m_CustomGravityMultiplier; + SerializedProperty m_RotationSpeed; + SerializedProperty m_GroundCheckDistance; + + public override void OnEnable() { - EditorGUILayout.EndFoldoutHeaderGroup(); - EditorGUILayout.PropertyField(m_PlayerInput); - EditorGUILayout.PropertyField(m_AvatarInputs); - EditorGUILayout.PropertyField(m_WalkSpeed); - EditorGUILayout.PropertyField(m_SprintSpeed); - EditorGUILayout.PropertyField(m_Acceleration); - EditorGUILayout.PropertyField(m_DragCoefficient); - EditorGUILayout.PropertyField(m_AirControlFactor); - EditorGUILayout.PropertyField(m_JumpImpulse); - EditorGUILayout.PropertyField(m_CustomGravityMultiplier); - EditorGUILayout.PropertyField(m_RotationSpeed); - EditorGUILayout.PropertyField(m_GroundCheckDistance); + m_Rigidbody = serializedObject.FindProperty(nameof(AvatarTransform.m_Rigidbody)); + m_PlayerInput = serializedObject.FindProperty(nameof(AvatarTransform.m_PlayerInput)); + m_AvatarInputs = serializedObject.FindProperty(nameof(AvatarTransform.m_AvatarInputs)); + m_WalkSpeed = serializedObject.FindProperty(nameof(AvatarTransform.m_WalkSpeed)); + m_SprintSpeed = serializedObject.FindProperty(nameof(AvatarTransform.m_SprintSpeed)); + m_Acceleration = serializedObject.FindProperty(nameof(AvatarTransform.m_Acceleration)); + m_DragCoefficient = serializedObject.FindProperty(nameof(AvatarTransform.m_DragCoefficient)); + m_AirControlFactor = serializedObject.FindProperty(nameof(AvatarTransform.m_AirControlFactor)); + m_JumpImpulse = serializedObject.FindProperty(nameof(AvatarTransform.m_JumpImpusle)); + m_CustomGravityMultiplier = serializedObject.FindProperty(nameof(AvatarTransform.m_CustomGravityMultiplier)); + m_RotationSpeed = serializedObject.FindProperty(nameof(AvatarTransform.m_RotationSpeed)); + m_GroundCheckDistance = serializedObject.FindProperty(nameof(AvatarTransform.m_GroundCheckDistance)); + + base.OnEnable(); } - else + + public override void OnInspectorGUI() { - EditorGUILayout.EndFoldoutHeaderGroup(); + var avatarTransform = target as AvatarTransform; + avatarTransform.PropertiesVisible = EditorGUILayout.BeginFoldoutHeaderGroup(avatarTransform.PropertiesVisible, $"{nameof(AvatarTransform)} Properties"); + if (avatarTransform.PropertiesVisible) + { + EditorGUILayout.EndFoldoutHeaderGroup(); + EditorGUILayout.PropertyField(m_Rigidbody); + EditorGUILayout.PropertyField(m_PlayerInput); + EditorGUILayout.PropertyField(m_AvatarInputs); + EditorGUILayout.PropertyField(m_WalkSpeed); + EditorGUILayout.PropertyField(m_SprintSpeed); + EditorGUILayout.PropertyField(m_Acceleration); + EditorGUILayout.PropertyField(m_DragCoefficient); + EditorGUILayout.PropertyField(m_AirControlFactor); + EditorGUILayout.PropertyField(m_JumpImpulse); + EditorGUILayout.PropertyField(m_CustomGravityMultiplier); + EditorGUILayout.PropertyField(m_RotationSpeed); + EditorGUILayout.PropertyField(m_GroundCheckDistance); + } + else + { + EditorGUILayout.EndFoldoutHeaderGroup(); + } + + EditorGUILayout.Space(); + base.OnInspectorGUI(); } - EditorGUILayout.Space(); - base.OnInspectorGUI(); } -} #endif -[RequireComponent(typeof(Rigidbody))] -public class AvatarTransform : BaseObjectMotionHandler -{ + [RequireComponent(typeof(Rigidbody))] + public class AvatarTransform : NetworkTransform + { #if UNITY_EDITOR - public bool PropertiesVisible = false; + public bool PropertiesVisible = false; #endif - public PlayerInput PlayerInput; - public AvatarInputs AvatarInputs; - public float WalkSpeed; - public float SprintSpeed; - public float Acceleration; - public float DragCoefficient; - public float AirControlFactor; - public float JumpImpusle; - public float CustomGravityMultiplier; - public float RotationSpeed; - public float GroundCheckDistance; + [SerializeField] + internal Rigidbody m_Rigidbody; - Vector3 m_Movement; + [SerializeField] + internal PlayerInput m_PlayerInput; - // grab jump state from input and clear after consumed - bool m_Jump; + [SerializeField] + internal AvatarInputs m_AvatarInputs; - // cached grounded check - bool m_IsGrounded; + [SerializeField] + internal float m_WalkSpeed; - RaycastHit[] m_RaycastHits = new RaycastHit[1]; - Ray m_Ray; + [SerializeField] + internal float m_SprintSpeed; - public override void OnNetworkSpawn() - { - base.OnNetworkSpawn(); + [SerializeField] + internal float m_Acceleration; - if (!HasAuthority) - { - return; - } + [SerializeField] + internal float m_DragCoefficient; - PlayerInput.enabled = true; + [SerializeField] + internal float m_AirControlFactor; - Rigidbody.isKinematic = false; + [SerializeField] + internal float m_JumpImpusle; - // Freeze rotation on the x and z axes to prevent toppling - Rigidbody.freezeRotation = true; + [SerializeField] + internal float m_CustomGravityMultiplier; - var spawnPosition = new Vector3(0f, 1.5f, 0f); - transform.SetPositionAndRotation(position: spawnPosition, rotation: Quaternion.identity); - Rigidbody.position = spawnPosition; - SetObjectVelocity(Vector3.zero); - } + [SerializeField] + internal float m_RotationSpeed; - void Update() - { - if (!HasAuthority) - { - return; - } + [SerializeField] + internal float m_GroundCheckDistance; + + Vector3 m_Movement; - m_Movement = new Vector3(AvatarInputs.move.x, 0, AvatarInputs.move.y).normalized; + // grab jump state from input and clear after consumed + bool m_Jump; - // Handle rotation based on input direction - if (m_Movement.magnitude >= 0.1f) + // cached grounded check + bool m_IsGrounded; + + RaycastHit[] m_RaycastHits = new RaycastHit[1]; + + Ray m_Ray; + + public override void OnNetworkSpawn() { - var targetAngle = Mathf.Atan2(m_Movement.x, m_Movement.z) * Mathf.Rad2Deg; - var targetRotation = Quaternion.Euler(0, targetAngle, 0); - transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, Time.deltaTime * RotationSpeed); + base.OnNetworkSpawn(); + + if (!HasAuthority) + { + return; + } + + m_PlayerInput.enabled = true; + + m_Rigidbody.isKinematic = false; + + // Freeze rotation on the x and z axes to prevent toppling + m_Rigidbody.freezeRotation = true; + + var spawnPosition = new Vector3(0f, 1.5f, 0f); + transform.SetPositionAndRotation(position: spawnPosition, rotation: Quaternion.identity); + m_Rigidbody.position = spawnPosition; + m_Rigidbody.linearVelocity = Vector3.zero; } - if (AvatarInputs.jump && IsGrounded()) + void Update() { - m_Jump = true; - AvatarInputs.jump = false; + if (!IsSpawned || !HasAuthority) + { + return; + } + + m_Movement = new Vector3(m_AvatarInputs.move.x, 0, m_AvatarInputs.move.y).normalized; + + // Handle rotation based on input direction + if (m_Movement.magnitude >= 0.1f) + { + var targetAngle = Mathf.Atan2(m_Movement.x, m_Movement.z) * Mathf.Rad2Deg; + var targetRotation = Quaternion.Euler(0, targetAngle, 0); + transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, Time.deltaTime * m_RotationSpeed); + } + + if (IsGrounded() && m_AvatarInputs.jump) + { + m_Jump = true; + m_AvatarInputs.jump = false; + } } - } - void ApplyMovement() - { - if (Mathf.Approximately(m_Movement.magnitude, 0f)) + void ApplyMovement() { - return; + if (Mathf.Approximately(m_Movement.magnitude, 0f)) + { + return; + } + + var velocity = m_Rigidbody.linearVelocity; + var desiredVelocity = m_Movement * (m_AvatarInputs.sprint ? m_SprintSpeed : m_WalkSpeed); + var targetVelocity = new Vector3(desiredVelocity.x, velocity.y, desiredVelocity.z); + var velocityChange = targetVelocity - velocity; + + if (m_IsGrounded) + { + // Apply force proportional to acceleration while grounded + var force = velocityChange * m_Acceleration; + m_Rigidbody.AddForce(force, ForceMode.Acceleration); + } + else + { + // Apply reduced force in the air for air control + var force = velocityChange * (m_Acceleration * m_AirControlFactor); + m_Rigidbody.AddForce(force, ForceMode.Acceleration); + } } - var velocity = GetObjectVelocity(); - var desiredVelocity = m_Movement * (AvatarInputs.sprint ? SprintSpeed : WalkSpeed); - var targetVelocity = new Vector3(desiredVelocity.x, velocity.y, desiredVelocity.z); - var velocityChange = targetVelocity - velocity; - - if (m_IsGrounded) + void ApplyJump() { - // Apply force proportional to acceleration while grounded - var force = velocityChange * Acceleration; - Rigidbody.AddForce(force, ForceMode.Acceleration); + if (m_IsGrounded && m_Jump) + { + m_Rigidbody.AddForce(Vector3.up * m_JumpImpusle, ForceMode.Impulse); + m_Jump = false; + } } - else + + void UpdateGroundedStatus() { - // Apply reduced force in the air for air control - var force = velocityChange * (Acceleration * AirControlFactor); - Rigidbody.AddForce(force, ForceMode.Acceleration); + m_IsGrounded = IsGrounded(); } - } - void ApplyJump() - { - if (m_IsGrounded && m_Jump) + bool IsGrounded() { - Rigidbody.AddForce(Vector3.up * JumpImpusle, ForceMode.Impulse); - m_Jump = false; + // Perform a raycast to check if the character is grounded + m_Ray.origin = m_Rigidbody.worldCenterOfMass; + m_Ray.direction = Vector3.down; + return Physics.RaycastNonAlloc(m_Ray, m_RaycastHits, m_GroundCheckDistance) > 0; } - } - void UpdateGroundedStatus() - { - m_IsGrounded = IsGrounded(); - } - - bool IsGrounded() - { - // Perform a raycast to check if the character is grounded - m_Ray.origin = transform.position; - m_Ray.direction = Vector3.down; - return Physics.RaycastNonAlloc(m_Ray, m_RaycastHits, GroundCheckDistance) > 0; - } - - void FixedUpdate() - { - if (!IsSpawned || !HasAuthority || Rigidbody != null && Rigidbody.isKinematic) + void FixedUpdate() { - return; - } + if (!IsSpawned || !HasAuthority || m_Rigidbody != null && m_Rigidbody.isKinematic) + { + return; + } - UpdateGroundedStatus(); + UpdateGroundedStatus(); - ApplyMovement(); + ApplyMovement(); - ApplyJump(); + ApplyJump(); - ApplyDrag(); + ApplyDrag(); - ApplyCustomGravity(); - } + ApplyCustomGravity(); + } - void ApplyDrag() - { - var groundVelocity = GetObjectVelocity(); - groundVelocity.y = 0f; - if (groundVelocity.magnitude > 0f) + void ApplyDrag() { - // Apply deceleration force to stop movement - var dragForce = -DragCoefficient * groundVelocity.magnitude * groundVelocity; - Rigidbody.AddForce(dragForce, ForceMode.Acceleration); + var groundVelocity = m_Rigidbody.linearVelocity; + groundVelocity.y = 0f; + if (groundVelocity.magnitude > 0f) + { + // Apply deceleration force to stop movement + var dragForce = -m_DragCoefficient * groundVelocity.magnitude * groundVelocity; + m_Rigidbody.AddForce(dragForce, ForceMode.Acceleration); + } } - } - void ApplyCustomGravity() - { - // custom gravity - if (!m_IsGrounded) + void ApplyCustomGravity() { - var customGravity = Physics.gravity * (CustomGravityMultiplier - 1); - Rigidbody.AddForce(customGravity, ForceMode.Acceleration); + // custom gravity + if (!m_IsGrounded) + { + var customGravity = Physics.gravity * (m_CustomGravityMultiplier - 1); + m_Rigidbody.AddForce(customGravity, ForceMode.Acceleration); + } } } } From d5244f6c84d00242e1ca28701d1d1a9de8e2895e Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Tue, 30 Jul 2024 17:17:17 -0400 Subject: [PATCH 08/10] distinguishing spawmed players with name in hierarchy --- .../Assets/Scripts/Player/AvatarTransform.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs index 269af6e6d..ab321b43c 100644 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs @@ -137,6 +137,8 @@ public override void OnNetworkSpawn() { base.OnNetworkSpawn(); + gameObject.name = $"[Client-{OwnerClientId}]{name}"; + if (!HasAuthority) { return; From f878e5f7b33dd5869193a01728b64d2bf917385d Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Wed, 31 Jul 2024 14:19:47 -0400 Subject: [PATCH 09/10] moving AvatarTransformEditor to own Editor subdirectory class, cleanup --- .../Assets/Scripts/Editor.meta | 8 ++ .../Scripts/Editor/AvatarTransformEditor.cs | 32 +++++ .../Editor/AvatarTransformEditor.cs.meta | 2 + .../Assets/Scripts/Input/AvatarInputs.cs | 39 +++--- .../Assets/Scripts/Player/AvatarTransform.cs | 117 ++---------------- 5 files changed, 77 insertions(+), 121 deletions(-) create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Editor.meta create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Editor/AvatarTransformEditor.cs create mode 100644 Experimental/DistributedAuthoritySample/Assets/Scripts/Editor/AvatarTransformEditor.cs.meta diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Editor.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Editor.meta new file mode 100644 index 000000000..4e4fd4d4a --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 76f900e572a03416bbb376adc24c438e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Editor/AvatarTransformEditor.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Editor/AvatarTransformEditor.cs new file mode 100644 index 000000000..f2282a912 --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Editor/AvatarTransformEditor.cs @@ -0,0 +1,32 @@ +using com.unity.multiplayer.samples.distributed_authority.gameplay; +using UnityEditor; +using UnityEditor.UIElements; +using UnityEngine; +using UnityEngine.UIElements; + +namespace com.unity.multiplayer.samples.distributed_authority.editor +{ + [CustomEditor(typeof(AvatarTransform))] + class DerivedComponentEditor : Editor + { + public override VisualElement CreateInspectorGUI() + { + // Create a new VisualElement to be the root of the inspector UI + var root = new VisualElement(); + + // Generate default inspector for AvatarTransform + serializedObject.Update(); + SerializedProperty property = serializedObject.GetIterator(); + property.NextVisible(true); // Skip the script field + while (property.NextVisible(false)) + { + var propertyField = new PropertyField(property); + root.Add(propertyField); + } + + serializedObject.ApplyModifiedProperties(); + + return root; + } + } +} diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Editor/AvatarTransformEditor.cs.meta b/Experimental/DistributedAuthoritySample/Assets/Scripts/Editor/AvatarTransformEditor.cs.meta new file mode 100644 index 000000000..8f91d7dee --- /dev/null +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Editor/AvatarTransformEditor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2ad6787b48af94939adc8213c08bd3eb \ No newline at end of file diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs index a1aa37b76..bc74ce319 100644 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs @@ -3,28 +3,35 @@ namespace com.unity.multiplayer.samples.distributed_authority.input { - public class AvatarInputs : MonoBehaviour + class AvatarInputs : MonoBehaviour { [Header("Character Input Values")] - public Vector2 move; - public Vector2 look; - public bool jump; - public bool sprint; + [SerializeField] + internal Vector2 move; + [SerializeField] + internal Vector2 look; + [SerializeField] + internal bool jump; + [SerializeField] + internal bool sprint; [Header("Movement Settings")] - public bool analogMovement; + [SerializeField] + internal bool analogMovement; [Header("Mouse Cursor Settings")] - public bool cursorLocked = true; - public bool cursorInputForLook = true; + [SerializeField] + internal bool cursorLocked = true; + [SerializeField] + internal bool cursorInputForLook = true; #if ENABLE_INPUT_SYSTEM - public void OnMove(InputValue value) + void OnMove(InputValue value) { MoveInput(value.Get()); } - public void OnLook(InputValue value) + void OnLook(InputValue value) { if (cursorInputForLook) { @@ -32,33 +39,33 @@ public void OnLook(InputValue value) } } - public void OnJump(InputValue value) + void OnJump(InputValue value) { JumpInput(value.isPressed); } - public void OnSprint(InputValue value) + void OnSprint(InputValue value) { SprintInput(value.isPressed); } #endif - public void MoveInput(Vector2 newMoveDirection) + void MoveInput(Vector2 newMoveDirection) { move = newMoveDirection; } - public void LookInput(Vector2 newLookDirection) + void LookInput(Vector2 newLookDirection) { look = newLookDirection; } - public void JumpInput(bool newJumpState) + void JumpInput(bool newJumpState) { jump = newJumpState; } - public void SprintInput(bool newSprintState) + void SprintInput(bool newSprintState) { sprint = newSprintState; } diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs index ab321b43c..ea9f4d739 100644 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs @@ -1,136 +1,44 @@ using Unity.Netcode.Components; -using Unity.Netcode.Editor; using UnityEngine; using UnityEngine.InputSystem; using com.unity.multiplayer.samples.distributed_authority.input; -#if UNITY_EDITOR -using UnityEditor; -#endif namespace com.unity.multiplayer.samples.distributed_authority.gameplay { -#if UNITY_EDITOR - /// - /// The custom editor for the component. - /// - [CustomEditor(typeof(AvatarTransform), true)] - public class AvatarTransformEditor : NetworkTransformEditor - { - SerializedProperty m_Rigidbody; - SerializedProperty m_PlayerInput; - SerializedProperty m_AvatarInputs; - SerializedProperty m_WalkSpeed; - SerializedProperty m_SprintSpeed; - SerializedProperty m_Acceleration; - SerializedProperty m_DragCoefficient; - SerializedProperty m_AirControlFactor; - SerializedProperty m_JumpImpulse; - SerializedProperty m_CustomGravityMultiplier; - SerializedProperty m_RotationSpeed; - SerializedProperty m_GroundCheckDistance; - - public override void OnEnable() - { - m_Rigidbody = serializedObject.FindProperty(nameof(AvatarTransform.m_Rigidbody)); - m_PlayerInput = serializedObject.FindProperty(nameof(AvatarTransform.m_PlayerInput)); - m_AvatarInputs = serializedObject.FindProperty(nameof(AvatarTransform.m_AvatarInputs)); - m_WalkSpeed = serializedObject.FindProperty(nameof(AvatarTransform.m_WalkSpeed)); - m_SprintSpeed = serializedObject.FindProperty(nameof(AvatarTransform.m_SprintSpeed)); - m_Acceleration = serializedObject.FindProperty(nameof(AvatarTransform.m_Acceleration)); - m_DragCoefficient = serializedObject.FindProperty(nameof(AvatarTransform.m_DragCoefficient)); - m_AirControlFactor = serializedObject.FindProperty(nameof(AvatarTransform.m_AirControlFactor)); - m_JumpImpulse = serializedObject.FindProperty(nameof(AvatarTransform.m_JumpImpusle)); - m_CustomGravityMultiplier = serializedObject.FindProperty(nameof(AvatarTransform.m_CustomGravityMultiplier)); - m_RotationSpeed = serializedObject.FindProperty(nameof(AvatarTransform.m_RotationSpeed)); - m_GroundCheckDistance = serializedObject.FindProperty(nameof(AvatarTransform.m_GroundCheckDistance)); - - base.OnEnable(); - } - - public override void OnInspectorGUI() - { - var avatarTransform = target as AvatarTransform; - avatarTransform.PropertiesVisible = EditorGUILayout.BeginFoldoutHeaderGroup(avatarTransform.PropertiesVisible, $"{nameof(AvatarTransform)} Properties"); - if (avatarTransform.PropertiesVisible) - { - EditorGUILayout.EndFoldoutHeaderGroup(); - EditorGUILayout.PropertyField(m_Rigidbody); - EditorGUILayout.PropertyField(m_PlayerInput); - EditorGUILayout.PropertyField(m_AvatarInputs); - EditorGUILayout.PropertyField(m_WalkSpeed); - EditorGUILayout.PropertyField(m_SprintSpeed); - EditorGUILayout.PropertyField(m_Acceleration); - EditorGUILayout.PropertyField(m_DragCoefficient); - EditorGUILayout.PropertyField(m_AirControlFactor); - EditorGUILayout.PropertyField(m_JumpImpulse); - EditorGUILayout.PropertyField(m_CustomGravityMultiplier); - EditorGUILayout.PropertyField(m_RotationSpeed); - EditorGUILayout.PropertyField(m_GroundCheckDistance); - } - else - { - EditorGUILayout.EndFoldoutHeaderGroup(); - } - - EditorGUILayout.Space(); - base.OnInspectorGUI(); - } - } -#endif - [RequireComponent(typeof(Rigidbody))] public class AvatarTransform : NetworkTransform { -#if UNITY_EDITOR - public bool PropertiesVisible = false; -#endif - [SerializeField] - internal Rigidbody m_Rigidbody; - + Rigidbody m_Rigidbody; [SerializeField] - internal PlayerInput m_PlayerInput; - + PlayerInput m_PlayerInput; [SerializeField] - internal AvatarInputs m_AvatarInputs; - + AvatarInputs m_AvatarInputs; [SerializeField] - internal float m_WalkSpeed; - + float m_WalkSpeed; [SerializeField] - internal float m_SprintSpeed; - + float m_SprintSpeed; [SerializeField] - internal float m_Acceleration; - + float m_Acceleration; [SerializeField] - internal float m_DragCoefficient; - + float m_DragCoefficient; [SerializeField] - internal float m_AirControlFactor; - + float m_AirControlFactor; [SerializeField] - internal float m_JumpImpusle; - + float m_JumpImpusle; [SerializeField] - internal float m_CustomGravityMultiplier; - + float m_CustomGravityMultiplier; [SerializeField] - internal float m_RotationSpeed; - + float m_RotationSpeed; [SerializeField] - internal float m_GroundCheckDistance; + float m_GroundCheckDistance; Vector3 m_Movement; - // grab jump state from input and clear after consumed bool m_Jump; - // cached grounded check bool m_IsGrounded; - RaycastHit[] m_RaycastHits = new RaycastHit[1]; - Ray m_Ray; public override void OnNetworkSpawn() @@ -145,7 +53,6 @@ public override void OnNetworkSpawn() } m_PlayerInput.enabled = true; - m_Rigidbody.isKinematic = false; // Freeze rotation on the x and z axes to prevent toppling From e31383ddcbc524a4b3ebae9882ccb92a06d3285d Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Thu, 1 Aug 2024 20:11:30 -0400 Subject: [PATCH 10/10] formatting changes --- .../Assets/Scripts/Input/AvatarInputs.cs | 26 +++++++++---------- .../Assets/Scripts/Player/AvatarTransform.cs | 8 +++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs index bc74ce319..4289c30dd 100644 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Input/AvatarInputs.cs @@ -7,23 +7,23 @@ class AvatarInputs : MonoBehaviour { [Header("Character Input Values")] [SerializeField] - internal Vector2 move; + internal Vector2 Move; [SerializeField] - internal Vector2 look; + internal Vector2 Look; [SerializeField] - internal bool jump; + internal bool Jump; [SerializeField] - internal bool sprint; + internal bool Sprint; [Header("Movement Settings")] [SerializeField] - internal bool analogMovement; + internal bool AnalogMovement; [Header("Mouse Cursor Settings")] [SerializeField] - internal bool cursorLocked = true; + internal bool CursorLocked = true; [SerializeField] - internal bool cursorInputForLook = true; + internal bool CursorInputForLook = true; #if ENABLE_INPUT_SYSTEM void OnMove(InputValue value) @@ -33,7 +33,7 @@ void OnMove(InputValue value) void OnLook(InputValue value) { - if (cursorInputForLook) + if (CursorInputForLook) { LookInput(value.Get()); } @@ -52,27 +52,27 @@ void OnSprint(InputValue value) void MoveInput(Vector2 newMoveDirection) { - move = newMoveDirection; + Move = newMoveDirection; } void LookInput(Vector2 newLookDirection) { - look = newLookDirection; + Look = newLookDirection; } void JumpInput(bool newJumpState) { - jump = newJumpState; + Jump = newJumpState; } void SprintInput(bool newSprintState) { - sprint = newSprintState; + Sprint = newSprintState; } void OnApplicationFocus(bool hasFocus) { - SetCursorState(cursorLocked); + SetCursorState(CursorLocked); } void SetCursorState(bool newState) diff --git a/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs index ea9f4d739..b8ea334aa 100644 --- a/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs +++ b/Experimental/DistributedAuthoritySample/Assets/Scripts/Player/AvatarTransform.cs @@ -71,7 +71,7 @@ void Update() return; } - m_Movement = new Vector3(m_AvatarInputs.move.x, 0, m_AvatarInputs.move.y).normalized; + m_Movement = new Vector3(m_AvatarInputs.Move.x, 0, m_AvatarInputs.Move.y).normalized; // Handle rotation based on input direction if (m_Movement.magnitude >= 0.1f) @@ -81,10 +81,10 @@ void Update() transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, Time.deltaTime * m_RotationSpeed); } - if (IsGrounded() && m_AvatarInputs.jump) + if (IsGrounded() && m_AvatarInputs.Jump) { m_Jump = true; - m_AvatarInputs.jump = false; + m_AvatarInputs.Jump = false; } } @@ -96,7 +96,7 @@ void ApplyMovement() } var velocity = m_Rigidbody.linearVelocity; - var desiredVelocity = m_Movement * (m_AvatarInputs.sprint ? m_SprintSpeed : m_WalkSpeed); + var desiredVelocity = m_Movement * (m_AvatarInputs.Sprint ? m_SprintSpeed : m_WalkSpeed); var targetVelocity = new Vector3(desiredVelocity.x, velocity.y, desiredVelocity.z); var velocityChange = targetVelocity - velocity;