diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_home.unity b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_home.unity index 9d8ec1b..f575679 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_home.unity +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_home.unity @@ -271,8 +271,8 @@ Canvas: m_GameObject: {fileID: 690216953} m_Enabled: 1 serializedVersion: 3 - m_RenderMode: 0 - m_Camera: {fileID: 0} + m_RenderMode: 1 + m_Camera: {fileID: 1631979429} m_PlaneDistance: 100 m_PixelPerfect: 0 m_ReceivesEvents: 1 @@ -296,6 +296,7 @@ RectTransform: m_Children: - {fileID: 1645250797} - {fileID: 287634993} + - {fileID: 1631979431} m_Father: {fileID: 0} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -304,6 +305,80 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} +--- !u!1 &1631979428 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1631979431} + - component: {fileID: 1631979429} + m_Layer: 0 + m_Name: UICamera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!20 &1631979429 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1631979428} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 3 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 10 + m_Depth: 1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 32 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1631979431 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1631979428} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -100} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 690216957} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1645250796 GameObject: m_ObjectHideFlags: 0 @@ -423,7 +498,7 @@ Camera: m_Depth: 0 m_CullingMask: serializedVersion: 2 - m_Bits: 4294967295 + m_Bits: 23 m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/SceneBattle.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/SceneBattle.cs index 6689293..82e4165 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/SceneBattle.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/SceneBattle.cs @@ -56,8 +56,11 @@ internal class SceneBattle : MonoBehaviour } // 切换场景的时候释放资源 - var package = YooAssets.GetPackage("DefaultPackage"); - package.UnloadUnusedAssets(); + if (YooAssets.Initialized) + { + var package = YooAssets.GetPackage("DefaultPackage"); + package.UnloadUnusedAssets(); + } } private void Update() { diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/SceneHome.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/SceneHome.cs index 5112c99..2138ab5 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/SceneHome.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/SceneHome.cs @@ -25,7 +25,10 @@ public class SceneHome : MonoBehaviour } // 切换场景的时候释放资源 - var package = YooAssets.GetPackage("DefaultPackage"); - package.UnloadUnusedAssets(); + if (YooAssets.Initialized) + { + var package = YooAssets.GetPackage("DefaultPackage"); + package.UnloadUnusedAssets(); + } } } \ No newline at end of file