diff options
| -rw-r--r-- | Assets/Scenes/Basic.unity | 50 | ||||
| -rw-r--r-- | Assets/Scenes/Fragments.unity | 137 | ||||
| -rw-r--r-- | Assets/Scenes/Scenes/PotatoRitualSite.unity | 171 | ||||
| -rw-r--r-- | Assets/Scripts/FragmentManager.cs | 10 | ||||
| -rw-r--r-- | Assets/Scripts/FragmentRequire.cs | 3 | ||||
| -rw-r--r-- | Assets/Scripts/PlayerPosition.cs | 4 |
6 files changed, 194 insertions, 181 deletions
diff --git a/Assets/Scenes/Basic.unity b/Assets/Scenes/Basic.unity index 24ecea4..1dc1af0 100644 --- a/Assets/Scenes/Basic.unity +++ b/Assets/Scenes/Basic.unity @@ -248,6 +248,55 @@ MonoBehaviour: members: - {fileID: 1254926231} - {fileID: 254036102} +--- !u!1 &1141117311 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1141117313} + - component: {fileID: 1141117312} + 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 &1141117312 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1141117311} + 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: 4ce4480c63fd26e4e847f39c561cb403, type: 2} +--- !u!4 &1141117313 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1141117311} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.013795227, y: 4.060099, z: -5.5652} + 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 &1254926230 PrefabInstance: m_ObjectHideFlags: 0 @@ -399,6 +448,7 @@ PrefabInstance: SceneRoots: m_ObjectHideFlags: 0 m_Roots: + - {fileID: 1141117313} - {fileID: 969856609} - {fileID: 1362498737} - {fileID: 1254926230} diff --git a/Assets/Scenes/Fragments.unity b/Assets/Scenes/Fragments.unity index ebdb76f..a23bdfd 100644 --- a/Assets/Scenes/Fragments.unity +++ b/Assets/Scenes/Fragments.unity @@ -14,26 +14,26 @@ OcclusionCullingSettings: RenderSettings: m_ObjectHideFlags: 0 serializedVersion: 9 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_Fog: 1 + m_FogColor: {r: 0.32156864, g: 0.3137255, b: 0.29803923, a: 1} m_FogMode: 3 - m_FogDensity: 0.01 + m_FogDensity: 0.02 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_AmbientIntensity: 0.81 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_SubtractiveShadowColor: {r: 0.13207549, g: 0.13207549, b: 0.13207549, a: 1} + m_SkyboxMaterial: {fileID: 2100000, guid: 64bc6ed66f427d849803b4dd2a0b4c87, type: 2} 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_DefaultReflectionResolution: 32 m_ReflectionBounces: 1 m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} @@ -122,6 +122,124 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &203844586 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 203844589} + - component: {fileID: 203844588} + - component: {fileID: 203844587} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 2147483647 + m_IsActive: 1 +--- !u!114 &203844587 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 203844586} + 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!108 &203844588 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 203844586} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.8583685, b: 0.7216981, a: 1} + m_Intensity: 2.69 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 1 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.1 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &203844589 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 203844586} + serializedVersion: 2 + m_LocalRotation: {x: 0.06679839, y: -0.90843624, z: 0.11923152, w: 0.39505115} + m_LocalPosition: {x: 0, y: -3.16, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 15.629, y: -133.216, z: -1.616} --- !u!1 &994204295 GameObject: m_ObjectHideFlags: 0 @@ -243,8 +361,8 @@ Transform: m_GameObject: {fileID: 1002791223} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 11.14} - m_LocalScale: {x: 2.9003, y: 2.9003, z: 2.9003} + m_LocalPosition: {x: 0, y: 3.38, z: 10.66} + m_LocalScale: {x: 11.130991, y: 11.604176, z: 26.93272} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} @@ -289,4 +407,5 @@ SceneRoots: m_ObjectHideFlags: 0 m_Roots: - {fileID: 994204296} + - {fileID: 203844589} - {fileID: 1002791224} diff --git a/Assets/Scenes/Scenes/PotatoRitualSite.unity b/Assets/Scenes/Scenes/PotatoRitualSite.unity index 1f5d1f0..ffa3f4b 100644 --- a/Assets/Scenes/Scenes/PotatoRitualSite.unity +++ b/Assets/Scenes/Scenes/PotatoRitualSite.unity @@ -26,7 +26,7 @@ RenderSettings: m_AmbientIntensity: 0.47 m_AmbientMode: 0 m_SubtractiveShadowColor: {r: 0.122641504, g: 0.122641504, b: 0.122641504, a: 1} - m_SkyboxMaterial: {fileID: 2100000, guid: 64bc6ed66f427d849803b4dd2a0b4c87, type: 2} + m_SkyboxMaterial: {fileID: 0} m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 @@ -597,124 +597,6 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: a00cf8ef81e92b14cadd28b0a110b16f, type: 3} ---- !u!1 &203844586 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 203844589} - - component: {fileID: 203844588} - - component: {fileID: 203844587} - m_Layer: 0 - m_Name: Directional Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 2147483647 - m_IsActive: 1 ---- !u!114 &203844587 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 203844586} - 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!108 &203844588 -Light: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 203844586} - m_Enabled: 1 - serializedVersion: 10 - m_Type: 1 - m_Shape: 0 - m_Color: {r: 1, g: 0.8583685, b: 0.7216981, a: 1} - m_Intensity: 2.69 - m_Range: 10 - m_SpotAngle: 30 - m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 - m_Shadows: - m_Type: 1 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 1 - m_Bias: 0.05 - m_NormalBias: 0.4 - m_NearPlane: 0.1 - m_CullingMatrixOverride: - e00: 1 - e01: 0 - e02: 0 - e03: 0 - e10: 0 - e11: 1 - e12: 0 - e13: 0 - e20: 0 - e21: 0 - e22: 1 - e23: 0 - e30: 0 - e31: 0 - e32: 0 - e33: 1 - m_UseCullingMatrixOverride: 0 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingLayerMask: 1 - m_Lightmapping: 4 - m_LightShadowCasterMode: 0 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 1 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} - m_UseBoundingSphereOverride: 0 - m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!4 &203844589 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 203844586} - serializedVersion: 2 - m_LocalRotation: {x: 0.06679839, y: -0.90843624, z: 0.11923152, w: 0.39505115} - m_LocalPosition: {x: 0, y: -3.16, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 15.629, y: -133.216, z: -1.616} --- !u!1001 &227560979 PrefabInstance: m_ObjectHideFlags: 0 @@ -1633,55 +1515,6 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 5afc051ea82884847b27233ef41ff811, type: 3} ---- !u!1 &1160234425 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1160234427} - - component: {fileID: 1160234426} - 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 &1160234426 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1160234425} - 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: 4ce4480c63fd26e4e847f39c561cb403, type: 2} ---- !u!4 &1160234427 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1160234425} - 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 &1190270118 PrefabInstance: m_ObjectHideFlags: 0 @@ -2462,8 +2295,6 @@ PrefabInstance: SceneRoots: m_ObjectHideFlags: 0 m_Roots: - - {fileID: 203844589} - - {fileID: 1160234427} - {fileID: 1813737234} - {fileID: 2131881850} - {fileID: 1190270118} diff --git a/Assets/Scripts/FragmentManager.cs b/Assets/Scripts/FragmentManager.cs index 3bac110..74e5a58 100644 --- a/Assets/Scripts/FragmentManager.cs +++ b/Assets/Scripts/FragmentManager.cs @@ -6,6 +6,14 @@ public class FragmentManager : MonoBehaviour { private static readonly HashSet<string> LoadedSceneNames = new(); + // 关键:在每次进入 Play Mode(且不重启域)时,重置静态集合 + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + private static void ResetStaticState() + { + LoadedSceneNames.Clear(); + // 如果有其他静态字段,也在这里一并重置 + } + /// <summary> /// 刷新场景需要列表(基于场景名称) /// </summary> @@ -91,6 +99,7 @@ public class FragmentManager : MonoBehaviour { foreach (var sceneName in sceneNames) { + Debug.Log("Unloading: " + sceneName); var asyncOp = SceneManager.UnloadSceneAsync(sceneName); if (asyncOp != null) { @@ -115,6 +124,7 @@ public class FragmentManager : MonoBehaviour { foreach (var sceneName in sceneNames) { + Debug.Log("Loading: " + sceneName); var asyncOp = SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Additive); if (asyncOp != null) { diff --git a/Assets/Scripts/FragmentRequire.cs b/Assets/Scripts/FragmentRequire.cs index 71ce602..cfe4120 100644 --- a/Assets/Scripts/FragmentRequire.cs +++ b/Assets/Scripts/FragmentRequire.cs @@ -20,6 +20,7 @@ public class FragmentRequire : MonoBehaviour private void OnTriggerEnter(Collider other) { + Debug.Log("Sync!"); var sceneName = new List<string>(); foreach (SceneAsset sceneAsset in requiredScenes) sceneName.Add(sceneAsset.name); @@ -39,7 +40,7 @@ public class FragmentRequire : MonoBehaviour var ts = Vector3.one; var size = new Vector3(cs.x * ts.x, cs.y * ts.y, cs.z * ts.z); - Gizmos.color = new Color(1f, 0.18f, 0.29f, 0.5f); + Gizmos.color = new Color(1f, 0.18f, 0.29f, 0.25f); Gizmos.matrix = transform.localToWorldMatrix; Gizmos.DrawCube(_boxCollider.center, size); } diff --git a/Assets/Scripts/PlayerPosition.cs b/Assets/Scripts/PlayerPosition.cs index 9b839f8..baf4e66 100644 --- a/Assets/Scripts/PlayerPosition.cs +++ b/Assets/Scripts/PlayerPosition.cs @@ -23,7 +23,9 @@ public class PlayerPosition : MonoBehaviour while (true) { yield return new WaitUntil(() => _playerLocomotion == null); - _playerLocomotion = GetComponent<PlayerLocomotion>(); + var list = Resources.FindObjectsOfTypeAll<PlayerLocomotion>(); + if (list.Length > 0) + _playerLocomotion = list[0]; yield return new WaitForSeconds(5f); } } |
