From 5718d57b8855f1adeec4fccc94437fcb02cc0be1 Mon Sep 17 00:00:00 2001 From: hevinci Date: Fri, 25 Nov 2022 21:40:54 +0800 Subject: [PATCH] update sample --- .../AssetBundleCollectorSetting.asset | 2 +- .../Samples~/Space Shooter/Boot.unity | 166 ++--- .../{scene_game.unity => scene_battle.unity} | 568 ++++++------------ ...ame.unity.meta => scene_battle.unity.meta} | 0 .../GameRes/Scene/scene_home.unity | 384 +----------- .../GameRes/UIPanel/UIAbout.prefab | 350 +++++++++++ .../GameRes/UIPanel/UIAbout.prefab.meta | 7 + .../GameRes/UIPanel/UIBattle.prefab | 21 +- .../GameRes/UIPanel/UICanvas.prefab | 203 +++++++ .../GameRes/UIPanel/UICanvas.prefab.meta | 7 + .../UIPanel/{UILogin.prefab => UIHome.prefab} | 19 +- ...UILogin.prefab.meta => UIHome.prefab.meta} | 0 .../GameRes/UIPanel/UILoading.prefab | 231 +++++++ .../GameRes/UIPanel/UILoading.prefab.meta | 7 + .../common/window/window_transparent.png.meta | 2 +- .../window/window_transparent1.png.meta | 2 +- .../Runtime/BattleLogic/BattleEventDefine.cs | 15 - .../BattleLogic/BattleEventDispatcher.cs | 19 - .../Runtime/BattleLogic/BattleRoom.cs | 110 ---- .../Runtime/BattleLogic/EntityAsteroid.cs | 52 -- .../Runtime/BattleLogic/EntityEffect.cs | 34 -- .../FsmManager.meta => Behaviour.meta} | 2 +- .../BhvBackgroundScroller.cs} | 2 +- .../BhvBackgroundScroller.cs.meta} | 0 .../Space Shooter/GameScript/Runtime/Boot.cs | 39 ++ .../{GameBoot.cs.meta => Boot.cs.meta} | 0 .../{Manager.meta => EventDefine.meta} | 2 +- .../Runtime/EventDefine/BattleEventDefine.cs | 119 ++++ .../BattleEventDefine.cs.meta | 0 .../Runtime/EventDefine/PatchEventDefine.cs | 98 +++ .../PatchEventDefine.cs.meta | 0 .../Runtime/EventDefine/SceneEventDefine.cs | 22 + .../SceneEventDefine.cs.meta} | 2 +- .../Runtime/EventDefine/UserEventDefine.cs | 52 ++ .../UserEventDefine.cs.meta} | 2 +- .../{BattleLogic.meta => GameLogic.meta} | 0 .../Entity.meta} | 2 +- .../GameLogic/Entity/EntityAsteroid.cs | 43 ++ .../Entity}/EntityAsteroid.cs.meta | 0 .../Entity}/EntityBullet.cs | 36 +- .../Entity}/EntityBullet.cs.meta | 0 .../Runtime/GameLogic/Entity/EntityEffect.cs | 23 + .../Entity}/EntityEffect.cs.meta | 0 .../Entity}/EntityEnemy.cs | 61 +- .../Entity}/EntityEnemy.cs.meta | 0 .../Entity}/EntityPlayer.cs | 37 +- .../Entity}/EntityPlayer.cs.meta | 0 .../Runtime/GameLogic/FsmNode.meta} | 2 +- .../Runtime/GameLogic/FsmNode/FsmInitGame.cs | 38 ++ .../FsmNode/FsmInitGame.cs.meta} | 2 +- .../GameLogic/FsmNode/FsmSceneBattle.cs | 48 ++ .../FsmNode/FsmSceneBattle.cs.meta} | 2 +- .../Runtime/GameLogic/FsmNode/FsmSceneHome.cs | 41 ++ .../GameLogic/FsmNode/FsmSceneHome.cs.meta | 11 + .../Runtime/GameLogic/GameManager.cs | 64 ++ .../Runtime/GameLogic/GameManager.cs.meta | 11 + .../GameScript/Runtime/GameLogic/Room.meta | 8 + .../Runtime/GameLogic/Room/BattleRoom.cs | 257 ++++++++ .../Room}/BattleRoom.cs.meta | 2 +- .../Manager/EventManager/EventGroup.cs | 45 -- .../Manager/EventManager/EventManager.cs | 171 ------ .../Manager/EventManager/IEventMessage.cs | 4 - .../Runtime/Manager/FsmManager/FsmManager.cs | 121 ---- .../Runtime/Manager/FsmManager/IFsmNode.cs | 12 - .../{PatchUpdater.meta => PatchLogic.meta} | 0 .../Runtime/{ => PatchLogic}/FileStream.cs | 0 .../{ => PatchLogic}/FileStream.cs.meta | 0 .../{PatchUpdater => PatchLogic}/FsmNode.meta | 0 .../FsmNode/FsmClearCache.cs | 28 +- .../FsmNode/FsmClearCache.cs.meta | 0 .../PatchLogic/FsmNode/FsmCreateDownloader.cs | 56 ++ .../FsmNode/FsmCreateDownloader.cs.meta | 0 .../PatchLogic/FsmNode/FsmDownloadFiles.cs | 46 ++ .../FsmNode/FsmDownloadFiles.cs.meta | 0 .../PatchLogic/FsmNode/FsmDownloadOver.cs | 27 + .../FsmNode/FsmDownloadOver.cs.meta | 11 + .../PatchLogic/FsmNode/FsmPatchDone.cs | 31 + .../FsmNode/FsmPatchDone.cs.meta | 0 .../FsmNode/FsmPatchInit.cs} | 77 ++- .../FsmNode/FsmPatchInit.cs.meta | 0 .../PatchLogic/FsmNode/FsmUpdateManifest.cs | 49 ++ .../FsmNode/FsmUpdateManifest.cs.meta | 0 .../PatchLogic/FsmNode/FsmUpdateVersion.cs | 50 ++ .../FsmNode/FsmUpdateVersion.cs.meta | 0 .../Runtime/PatchLogic/PatchManager.cs | 105 ++++ .../PatchManager.cs.meta | 0 .../PatchWindow.cs | 72 +-- .../PatchWindow.cs.meta | 0 .../Runtime/PatchUpdater/EPatchOperation.cs | 26 - .../PatchUpdater/EPatchOperation.cs.meta | 11 - .../Runtime/PatchUpdater/EPatchStates.cs | 31 - .../Runtime/PatchUpdater/EPatchStates.cs.meta | 11 - .../FsmNode/FsmCreateDownloader.cs | 49 -- .../PatchUpdater/FsmNode/FsmDownloadFiles.cs | 41 -- .../PatchUpdater/FsmNode/FsmPatchDone.cs | 24 - .../PatchUpdater/FsmNode/FsmPatchInit.cs | 26 - .../PatchUpdater/FsmNode/FsmStartGame.cs | 23 - .../PatchUpdater/FsmNode/FsmStartGame.cs.meta | 11 - .../PatchUpdater/FsmNode/FsmUpdateManifest.cs | 44 -- .../PatchUpdater/FsmNode/FsmUpdateVersion.cs | 45 -- .../Runtime/PatchUpdater/PatchEventDefine.cs | 54 -- .../PatchUpdater/PatchEventDispatcher.cs | 43 -- .../PatchUpdater/PatchEventDispatcher.cs.meta | 11 - .../Runtime/PatchUpdater/PatchManager.cs | 75 --- .../Runtime/UIWindow/UIAboutWindow.cs | 29 + .../Runtime/UIWindow/UIAboutWindow.cs.meta | 11 + .../Runtime/UIWindow/UIBattleWindow.cs | 36 +- .../Runtime/UIWindow/UIHomeWindow.cs | 36 ++ ...ginWindow.cs.meta => UIHomeWindow.cs.meta} | 0 .../Runtime/UIWindow/UILoadingWindow.cs | 45 ++ .../Runtime/UIWindow/UILoadingWindow.cs.meta | 11 + .../Runtime/UIWindow/UILoginWindow.cs | 19 - .../Samples~/Space Shooter/ThirdParty.meta | 8 + .../BetterStreamingAssets.meta | 0 .../BetterStreamingAssets/.gitignore | 0 .../BetterStreamingAssets/LICENSE.md | 0 .../BetterStreamingAssets/LICENSE.md.meta | 0 .../BetterStreamingAssets/README.md | 0 .../BetterStreamingAssets/README.md.meta | 0 .../BetterStreamingAssets/Runtime.meta | 0 .../Runtime/BSA_BetterStreamingAssets.cs | 0 .../Runtime/BSA_BetterStreamingAssets.cs.meta | 0 .../Runtime/BSA_PathUtil.cs | 0 .../Runtime/BSA_PathUtil.cs.meta | 0 .../Runtime/BSA_SubReadOnlyStream.cs | 0 .../Runtime/BSA_SubReadOnlyStream.cs.meta | 0 .../Runtime/BSA_ZipArchive.cs | 0 .../Runtime/BSA_ZipArchive.cs.meta | 0 .../Runtime/BetterStreamingAssets.asmdef | 0 .../Runtime/BetterStreamingAssets.asmdef.meta | 0 .../BetterStreamingAssets/package.json | 0 .../BetterStreamingAssets/package.json.meta | 0 .../ThirdParty/UniFramework.meta | 8 + .../ThirdParty/UniFramework/UniEvent.meta | 8 + .../UniFramework/UniEvent/README.md | 4 + .../UniFramework/UniEvent/README.md.meta | 7 + .../UniFramework/UniEvent/Runtime.meta | 8 + .../UniEvent/Runtime/EventGroup.cs | 48 ++ .../UniEvent/Runtime}/EventGroup.cs.meta | 2 +- .../UniEvent/Runtime/IEventMessage.cs | 7 + .../UniEvent/Runtime}/IEventMessage.cs.meta | 2 +- .../UniEvent/Runtime/UniEvent.asmdef | 16 + .../UniEvent/Runtime/UniEvent.asmdef.meta | 7 + .../UniFramework/UniEvent/Runtime/UniEvent.cs | 203 +++++++ .../UniEvent/Runtime/UniEvent.cs.meta | 11 + .../UniEvent/Runtime/UniEventDriver.cs | 17 + .../UniEvent/Runtime/UniEventDriver.cs.meta | 11 + .../UniEvent/Runtime/UniLogger.cs | 21 + .../UniEvent/Runtime/UniLogger.cs.meta | 11 + .../ThirdParty/UniFramework/UniMachine.meta | 8 + .../UniFramework/UniMachine/README.md | 3 + .../UniFramework/UniMachine/README.md.meta | 7 + .../UniFramework/UniMachine/Runtime.meta | 8 + .../UniMachine/Runtime/IStateNode.cs | 11 + .../UniMachine/Runtime/IStateNode.cs.meta | 11 + .../UniMachine/Runtime/StateMachine.cs | 142 +++++ .../UniMachine/Runtime/StateMachine.cs.meta | 11 + .../UniMachine/Runtime/UniLogger.cs | 21 + .../UniMachine/Runtime/UniLogger.cs.meta | 11 + .../UniMachine/Runtime/UniMachine.asmdef | 16 + .../UniMachine/Runtime/UniMachine.asmdef.meta | 7 + .../ThirdParty/UniFramework/UniModule.meta | 8 + .../UniFramework/UniModule/README.md | 3 + .../UniFramework/UniModule/README.md.meta | 7 + .../UniFramework/UniModule/Runtime.meta | 8 + .../UniFramework/UniModule/Runtime/IModule.cs | 21 + .../UniModule/Runtime/IModule.cs.meta | 11 + .../UniModule/Runtime/ModuleSingleton.cs | 28 + .../UniModule/Runtime/ModuleSingleton.cs.meta | 11 + .../UniModule/Runtime/UniLogger.cs | 21 + .../UniModule/Runtime/UniLogger.cs.meta | 11 + .../UniModule/Runtime/UniModule.asmdef | 16 + .../UniModule/Runtime/UniModule.asmdef.meta | 7 + .../UniModule/Runtime/UniModule.cs | 222 +++++++ .../UniModule/Runtime/UniModule.cs.meta | 11 + .../UniModule/Runtime/UniModuleDriver.cs | 17 + .../UniModule/Runtime/UniModuleDriver.cs.meta | 11 + .../ThirdParty/UniFramework/UniPooling.meta | 8 + .../UniFramework/UniPooling/README.md | 36 ++ .../UniFramework/UniPooling/README.md.meta | 7 + .../UniFramework/UniPooling/Runtime.meta | 8 + .../UniPooling/Runtime/CreatePoolOperation.cs | 70 +++ .../Runtime/CreatePoolOperation.cs.meta | 11 + .../UniPooling/Runtime/GameObjectPool.cs | 215 +++++++ .../UniPooling/Runtime/GameObjectPool.cs.meta | 11 + .../UniPooling/Runtime/SpawnHandle.cs | 148 +++++ .../UniPooling/Runtime/SpawnHandle.cs.meta | 11 + .../UniPooling/Runtime/Spawner.cs | 259 ++++++++ .../UniPooling/Runtime/Spawner.cs.meta | 11 + .../UniPooling/Runtime/UniLogger.cs | 21 + .../UniPooling/Runtime/UniLogger.cs.meta | 11 + .../UniPooling/Runtime/UniPooling.asmdef | 16 + .../UniPooling/Runtime/UniPooling.asmdef.meta | 7 + .../UniPooling/Runtime/UniPooling.cs | 125 ++++ .../UniPooling/Runtime/UniPooling.cs.meta | 11 + .../UniPooling/Runtime/UniPoolingDriver.cs | 17 + .../Runtime/UniPoolingDriver.cs.meta | 11 + .../ThirdParty/UniFramework/UniUtility.meta | 8 + .../UniFramework/UniUtility/README.md | 3 + .../UniFramework/UniUtility/README.md.meta | 7 + .../UniFramework/UniUtility/Runtime.meta | 8 + .../UniUtility/Runtime/UniTimer.cs | 199 ++++++ .../UniUtility/Runtime/UniTimer.cs.meta | 11 + .../UniUtility/Runtime/UniUtility.asmdef | 14 + .../UniUtility/Runtime/UniUtility.asmdef.meta | 7 + .../ThirdParty/UniFramework/UniWindow.meta | 8 + .../UniFramework/UniWindow/README.md | 4 + .../UniFramework/UniWindow/README.md.meta | 7 + .../UniFramework/UniWindow/Runtime.meta | 8 + .../UniWindow/Runtime/OpenWindowOperation.cs | 70 +++ .../Runtime/OpenWindowOperation.cs.meta | 11 + .../UniWindow/Runtime/UIWindow.cs | 325 ++++++++++ .../UniWindow/Runtime/UIWindow.cs.meta | 11 + .../UniWindow/Runtime/UniLogger.cs | 21 + .../UniWindow/Runtime/UniLogger.cs.meta | 11 + .../UniWindow/Runtime/UniWindow.asmdef | 16 + .../UniWindow/Runtime/UniWindow.asmdef.meta | 7 + .../UniWindow/Runtime/UniWindow.cs | 410 +++++++++++++ .../UniWindow/Runtime/UniWindow.cs.meta | 11 + .../UniWindow/Runtime/UniWindowDriver.cs | 17 + .../UniWindow/Runtime/UniWindowDriver.cs.meta | 11 + .../UniWindow/Runtime/WindowAttribute.cs | 24 + .../UniWindow/Runtime/WindowAttribute.cs.meta | 11 + 223 files changed, 5950 insertions(+), 2216 deletions(-) rename Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/{scene_game.unity => scene_battle.unity} (97%) rename Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/{scene_game.unity.meta => scene_battle.unity.meta} (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIAbout.prefab create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIAbout.prefab.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UICanvas.prefab create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UICanvas.prefab.meta rename Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/{UILogin.prefab => UIHome.prefab} (96%) rename Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/{UILogin.prefab.meta => UIHome.prefab.meta} (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UILoading.prefab create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UILoading.prefab.meta delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleEventDefine.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleEventDispatcher.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleRoom.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityAsteroid.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityEffect.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{Manager/FsmManager.meta => Behaviour.meta} (77%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic/BackgroundScroller.cs => Behaviour/BhvBackgroundScroller.cs} (87%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic/BackgroundScroller.cs.meta => Behaviour/BhvBackgroundScroller.cs.meta} (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Boot.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{GameBoot.cs.meta => Boot.cs.meta} (100%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{Manager.meta => EventDefine.meta} (77%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/BattleEventDefine.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic => EventDefine}/BattleEventDefine.cs.meta (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/PatchEventDefine.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater => EventDefine}/PatchEventDefine.cs.meta (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/SceneEventDefine.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic/BattleEventDispatcher.cs.meta => EventDefine/SceneEventDefine.cs.meta} (83%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/UserEventDefine.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{Manager/FsmManager/FsmManager.cs.meta => EventDefine/UserEventDefine.cs.meta} (83%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic.meta => GameLogic.meta} (100%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{Manager/EventManager.meta => GameLogic/Entity.meta} (77%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityAsteroid.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic => GameLogic/Entity}/EntityAsteroid.cs.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic => GameLogic/Entity}/EntityBullet.cs (54%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic => GameLogic/Entity}/EntityBullet.cs.meta (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityEffect.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic => GameLogic/Entity}/EntityEffect.cs.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic => GameLogic/Entity}/EntityEnemy.cs (63%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic => GameLogic/Entity}/EntityEnemy.cs.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic => GameLogic/Entity}/EntityPlayer.cs (63%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic => GameLogic/Entity}/EntityPlayer.cs.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins.meta => GameScript/Runtime/GameLogic/FsmNode.meta} (77%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmInitGame.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{Manager/FsmManager/IFsmNode.cs.meta => GameLogic/FsmNode/FsmInitGame.cs.meta} (83%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneBattle.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{Manager/EventManager/EventManager.cs.meta => GameLogic/FsmNode/FsmSceneBattle.cs.meta} (83%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneHome.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneHome.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/GameManager.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/GameManager.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Room.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Room/BattleRoom.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{BattleLogic => GameLogic/Room}/BattleRoom.cs.meta (83%) delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/EventGroup.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/EventManager.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/IEventMessage.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/FsmManager.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/IFsmNode.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater.meta => PatchLogic.meta} (100%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{ => PatchLogic}/FileStream.cs (100%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{ => PatchLogic}/FileStream.cs.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater => PatchLogic}/FsmNode.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater => PatchLogic}/FsmNode/FsmClearCache.cs (51%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater => PatchLogic}/FsmNode/FsmClearCache.cs.meta (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmCreateDownloader.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater => PatchLogic}/FsmNode/FsmCreateDownloader.cs.meta (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadFiles.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater => PatchLogic}/FsmNode/FsmDownloadFiles.cs.meta (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadOver.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadOver.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmPatchDone.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater => PatchLogic}/FsmNode/FsmPatchDone.cs.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{GameBoot.cs => PatchLogic/FsmNode/FsmPatchInit.cs} (75%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater => PatchLogic}/FsmNode/FsmPatchInit.cs.meta (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmUpdateManifest.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater => PatchLogic}/FsmNode/FsmUpdateManifest.cs.meta (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmUpdateVersion.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater => PatchLogic}/FsmNode/FsmUpdateVersion.cs.meta (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/PatchManager.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater => PatchLogic}/PatchManager.cs.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater => PatchLogic}/PatchWindow.cs (58%) rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/{PatchUpdater => PatchLogic}/PatchWindow.cs.meta (100%) delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchOperation.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchOperation.cs.meta delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchStates.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchStates.cs.meta delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmCreateDownloader.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmDownloadFiles.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmPatchDone.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmPatchInit.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmStartGame.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmStartGame.cs.meta delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmUpdateManifest.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmUpdateVersion.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDefine.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDispatcher.cs delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDispatcher.cs.meta delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchManager.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/UIAboutWindow.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/UIAboutWindow.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/UIHomeWindow.cs rename Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/{UILoginWindow.cs.meta => UIHomeWindow.cs.meta} (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/UILoadingWindow.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/UILoadingWindow.cs.meta delete mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/UILoginWindow.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty.meta rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/.gitignore (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/LICENSE.md (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/LICENSE.md.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/README.md (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/README.md.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/Runtime.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/Runtime/BSA_BetterStreamingAssets.cs (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/Runtime/BSA_BetterStreamingAssets.cs.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/Runtime/BSA_PathUtil.cs (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/Runtime/BSA_PathUtil.cs.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/Runtime/BSA_SubReadOnlyStream.cs (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/Runtime/BSA_SubReadOnlyStream.cs.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/Runtime/BSA_ZipArchive.cs (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/Runtime/BSA_ZipArchive.cs.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/Runtime/BetterStreamingAssets.asmdef (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/Runtime/BetterStreamingAssets.asmdef.meta (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/package.json (100%) rename Assets/YooAsset/Samples~/Space Shooter/{Plugins => ThirdParty}/BetterStreamingAssets/package.json.meta (100%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent/README.md create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent/README.md.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent/Runtime.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent/Runtime/EventGroup.cs rename Assets/YooAsset/Samples~/Space Shooter/{GameScript/Runtime/Manager/EventManager => ThirdParty/UniFramework/UniEvent/Runtime}/EventGroup.cs.meta (83%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent/Runtime/IEventMessage.cs rename Assets/YooAsset/Samples~/Space Shooter/{GameScript/Runtime/Manager/EventManager => ThirdParty/UniFramework/UniEvent/Runtime}/IEventMessage.cs.meta (83%) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent/Runtime/UniEvent.asmdef create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent/Runtime/UniEvent.asmdef.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent/Runtime/UniEvent.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent/Runtime/UniEvent.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent/Runtime/UniEventDriver.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent/Runtime/UniEventDriver.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent/Runtime/UniLogger.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniEvent/Runtime/UniLogger.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniMachine.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniMachine/README.md create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniMachine/README.md.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniMachine/Runtime.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniMachine/Runtime/IStateNode.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniMachine/Runtime/IStateNode.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniMachine/Runtime/StateMachine.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniMachine/Runtime/StateMachine.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniMachine/Runtime/UniLogger.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniMachine/Runtime/UniLogger.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniMachine/Runtime/UniMachine.asmdef create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniMachine/Runtime/UniMachine.asmdef.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/README.md create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/README.md.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/Runtime.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/Runtime/IModule.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/Runtime/IModule.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/Runtime/ModuleSingleton.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/Runtime/ModuleSingleton.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/Runtime/UniLogger.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/Runtime/UniLogger.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/Runtime/UniModule.asmdef create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/Runtime/UniModule.asmdef.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/Runtime/UniModule.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/Runtime/UniModule.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/Runtime/UniModuleDriver.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniModule/Runtime/UniModuleDriver.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/README.md create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/README.md.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/CreatePoolOperation.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/CreatePoolOperation.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/GameObjectPool.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/GameObjectPool.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/SpawnHandle.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/SpawnHandle.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/Spawner.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/Spawner.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/UniLogger.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/UniLogger.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/UniPooling.asmdef create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/UniPooling.asmdef.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/UniPooling.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/UniPooling.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/UniPoolingDriver.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniPooling/Runtime/UniPoolingDriver.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniUtility.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniUtility/README.md create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniUtility/README.md.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniUtility/Runtime.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniUtility/Runtime/UniTimer.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniUtility/Runtime/UniTimer.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniUtility/Runtime/UniUtility.asmdef create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniUtility/Runtime/UniUtility.asmdef.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/README.md create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/README.md.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/OpenWindowOperation.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/OpenWindowOperation.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/UIWindow.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/UIWindow.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/UniLogger.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/UniLogger.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/UniWindow.asmdef create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/UniWindow.asmdef.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/UniWindow.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/UniWindow.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/UniWindowDriver.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/UniWindowDriver.cs.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/WindowAttribute.cs create mode 100644 Assets/YooAsset/Samples~/Space Shooter/ThirdParty/UniFramework/UniWindow/Runtime/WindowAttribute.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/AssetSetting/AssetBundleCollectorSetting.asset b/Assets/YooAsset/Samples~/Space Shooter/AssetSetting/AssetBundleCollectorSetting.asset index be10e71..154436e 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/AssetSetting/AssetBundleCollectorSetting.asset +++ b/Assets/YooAsset/Samples~/Space Shooter/AssetSetting/AssetBundleCollectorSetting.asset @@ -85,7 +85,7 @@ MonoBehaviour: CollectorGUID: 12d33f33f3a55224c9c747d7bffa1c68 CollectorType: 0 AddressRuleName: AddressByFileName - PackRuleName: PackDirectory + PackRuleName: PackSeparately FilterRuleName: CollectAll AssetTags: - CollectPath: Assets/Samples/Space Shooter/GameRes/UISprite diff --git a/Assets/YooAsset/Samples~/Space Shooter/Boot.unity b/Assets/YooAsset/Samples~/Space Shooter/Boot.unity index 5fd7139..0531645 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/Boot.unity +++ b/Assets/YooAsset/Samples~/Space Shooter/Boot.unity @@ -121,89 +121,6 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &882660809 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 882660812} - - component: {fileID: 882660811} - - component: {fileID: 882660810} - m_Layer: 0 - m_Name: Camera - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &882660810 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 882660809} - m_Enabled: 1 ---- !u!20 &882660811 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 882660809} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 2 - m_BackGroundColor: {r: 0, g: 0, b: 0, 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: 0 - orthographic size: 5 - m_Depth: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &882660812 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 882660809} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.09431402, y: 0.086022705, z: -11.001953} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1281760859 GameObject: m_ObjectHideFlags: 0 @@ -248,3 +165,86 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6920458660802423023 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6920458660802423026} + - component: {fileID: 6920458660802423025} + - component: {fileID: 6920458660802423024} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &6920458660802423024 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6920458660802423023} + m_Enabled: 1 +--- !u!20 &6920458660802423025 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6920458660802423023} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0.043137256} + 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: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &6920458660802423026 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6920458660802423023} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 10, z: 5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_game.unity b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_battle.unity similarity index 97% rename from Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_game.unity rename to Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_battle.unity index 6859d0b..0ee24e7 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_game.unity +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_battle.unity @@ -168,24 +168,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &15 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 28} - - component: {fileID: 61} - - component: {fileID: 69} - m_Layer: 0 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &16 GameObject: m_ObjectHideFlags: 0 @@ -198,6 +180,7 @@ GameObject: - component: {fileID: 35} - component: {fileID: 33} - component: {fileID: 70} + - component: {fileID: 18} m_Layer: 0 m_Name: Background m_TagString: Untagged @@ -223,24 +206,102 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &18 -GameObject: +--- !u!82 &18 +AudioSource: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 31} - - component: {fileID: 39} - - component: {fileID: 26} - m_Layer: 0 - m_Name: BattleRoom - m_TagString: GameController - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 + m_GameObject: {fileID: 16} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: 7b04c59dd84f14039b601e1abbe7b884, type: 3} + m_PlayOnAwake: 1 + m_Volume: 0.5 + m_Pitch: 1 + Loop: 1 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 --- !u!4 &19 Transform: m_ObjectHideFlags: 0 @@ -328,7 +389,7 @@ Transform: m_LocalScale: {x: 15, y: 2, z: 40} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &25 Transform: @@ -344,23 +405,6 @@ Transform: m_Father: {fileID: 20} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &26 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 18} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 43ab5a1b8ae5c2b4a8995952e7e01f3f, type: 3} - m_Name: - m_EditorClassIdentifier: - SpawnValues: {x: 6, y: 0, z: 20} - EnemyCount: 10 - SpawnWait: 0.75 - StartWait: 1 - WaveWait: 4 --- !u!4 &27 Transform: m_ObjectHideFlags: 0 @@ -375,20 +419,6 @@ Transform: m_Father: {fileID: 20} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &28 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 15} - 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_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &29 Transform: m_ObjectHideFlags: 0 @@ -418,20 +448,6 @@ Transform: m_Father: {fileID: 29} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &31 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 18} - 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_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &33 MeshRenderer: m_ObjectHideFlags: 0 @@ -539,102 +555,6 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 1, y: 5.8, z: 1} m_Center: {x: 0, y: 0.15, z: 0} ---- !u!82 &39 -AudioSource: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 18} - m_Enabled: 1 - serializedVersion: 4 - OutputAudioMixerGroup: {fileID: 0} - m_audioClip: {fileID: 8300000, guid: 7b04c59dd84f14039b601e1abbe7b884, type: 3} - m_PlayOnAwake: 1 - m_Volume: 0.5 - m_Pitch: 1 - Loop: 1 - Mute: 0 - Spatialize: 0 - SpatializePostEffects: 0 - Priority: 128 - DopplerLevel: 1 - MinDistance: 1 - MaxDistance: 500 - Pan2D: 0 - rolloffMode: 0 - BypassEffects: 0 - BypassListenerEffects: 0 - BypassReverbZones: 0 - rolloffCustomCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 1 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - panLevelCustomCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 0 - spreadCustomCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 0 - reverbZoneMixCustomCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 0 --- !u!104 &41 RenderSettings: m_ObjectHideFlags: 0 @@ -11053,119 +10973,6 @@ ParticleSystemRenderer: m_Mesh2: {fileID: 0} m_Mesh3: {fileID: 0} m_MaskInteraction: 0 ---- !u!223 &55 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1657258425} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!224 &57 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1657258425} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!114 &61 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 15} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 - m_DragThreshold: 5 ---- !u!114 &63 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1657258425} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &64 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1657258425} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 ---- !u!114 &69 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 15} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 0 --- !u!114 &70 MonoBehaviour: m_ObjectHideFlags: 0 @@ -11180,108 +10987,6 @@ MonoBehaviour: m_EditorClassIdentifier: ScrollSpeed: -0.25 TileSizeZ: 30 ---- !u!1 &8321295 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8321298} - - component: {fileID: 8321297} - - component: {fileID: 8321296} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &8321296 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8321295} - m_Enabled: 1 ---- !u!20 &8321297 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8321295} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 2 - m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0.043137256} - 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: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &8321298 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8321295} - m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 10, z: 5} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} ---- !u!1 &1657258425 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 57} - - component: {fileID: 55} - - component: {fileID: 64} - - component: {fileID: 63} - m_Layer: 5 - m_Name: Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1691764578 GameObject: m_ObjectHideFlags: 0 @@ -11324,5 +11029,88 @@ Transform: m_LocalScale: {x: 38.1, y: 7.1, z: 105.4} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 8 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3992189574601221031 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3992189574601221050} + - component: {fileID: 3992189574601221049} + - component: {fileID: 3992189574601221048} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &3992189574601221048 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3992189574601221031} + m_Enabled: 1 +--- !u!20 &3992189574601221049 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3992189574601221031} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0.043137256} + 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: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &3992189574601221050 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3992189574601221031} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 10, z: 5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_game.unity.meta b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_battle.unity.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_game.unity.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_battle.unity.meta 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 e74ff47..6995887 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_home.unity +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_home.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -121,388 +121,6 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &916616400 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 916616404} - - component: {fileID: 916616403} - - component: {fileID: 916616402} - - component: {fileID: 916616401} - m_Layer: 5 - m_Name: Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &916616401 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 916616400} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &916616402 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 916616400} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 ---- !u!223 &916616403 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 916616400} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!224 &916616404 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 916616400} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 2129969559} - m_Father: {fileID: 0} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!1 &1221815198 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1221815201} - - component: {fileID: 1221815200} - - component: {fileID: 1221815199} - m_Layer: 0 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1221815199 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1221815198} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 0 ---- !u!114 &1221815200 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1221815198} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 - m_DragThreshold: 10 ---- !u!4 &1221815201 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1221815198} - 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_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1334075221 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1334075223} - - component: {fileID: 1334075222} - 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 &1334075222 -Light: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1334075221} - m_Enabled: 1 - serializedVersion: 10 - m_Type: 1 - m_Shape: 0 - m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 1 - m_Range: 10 - m_SpotAngle: 30 - m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 - m_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: 6570 - m_UseColorTemperature: 0 - m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} - m_UseBoundingSphereOverride: 0 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!4 &1334075223 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1334075221} - m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1001 &2129969558 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 916616404} - m_Modifications: - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_AnchorMax.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4142826567245113227, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - propertyPath: m_Name - value: UILogin - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: f33f75c4ce22cf248abf851242ac4363, type: 3} ---- !u!224 &2129969559 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 4142826567245113224, guid: f33f75c4ce22cf248abf851242ac4363, - type: 3} - m_PrefabInstance: {fileID: 2129969558} - m_PrefabAsset: {fileID: 0} --- !u!4 &3517166543428106988 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIAbout.prefab b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIAbout.prefab new file mode 100644 index 0000000..5a88831 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIAbout.prefab @@ -0,0 +1,350 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4099142336341904240 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7126978470340264304} + - component: {fileID: 3359586880618602463} + - component: {fileID: 8175961594734719007} + m_Layer: 5 + m_Name: info + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7126978470340264304 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4099142336341904240} + 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_Children: [] + m_Father: {fileID: 3997691783514560453} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3359586880618602463 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4099142336341904240} + m_CullTransparentMesh: 0 +--- !u!114 &8175961594734719007 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4099142336341904240} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 8297a2bf97dbbba468bd2518d003a876, type: 3} + m_FontSize: 28 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Powered by YooAsset +--- !u!1 &4142826567245113227 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4142826567245113224} + - component: {fileID: 4142826567245113225} + - component: {fileID: 446002385128238495} + m_Layer: 5 + m_Name: UIAbout + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4142826567245113224 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4142826567245113227} + 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_Children: + - {fileID: 5343213182511549108} + - {fileID: 3997691783514560453} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &4142826567245113225 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4142826567245113227} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 1 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &446002385128238495 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4142826567245113227} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!1 &6154978740135451069 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5343213182511549108} + - component: {fileID: 8369344421515876960} + - component: {fileID: 7080476478489546113} + - component: {fileID: 8806219243094360206} + m_Layer: 5 + m_Name: mask + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5343213182511549108 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6154978740135451069} + 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_Children: [] + m_Father: {fileID: 4142826567245113224} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8369344421515876960 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6154978740135451069} + m_CullTransparentMesh: 0 +--- !u!114 &7080476478489546113 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6154978740135451069} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &8806219243094360206 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6154978740135451069} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 7080476478489546113} + m_OnClick: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &8989319042809547364 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3997691783514560453} + - component: {fileID: 7677845000641202694} + - component: {fileID: 4438684259955260312} + m_Layer: 5 + m_Name: bg + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3997691783514560453 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8989319042809547364} + 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_Children: + - {fileID: 7126978470340264304} + m_Father: {fileID: 4142826567245113224} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 520, y: 286.62195} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &7677845000641202694 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8989319042809547364} + m_CullTransparentMesh: 0 +--- !u!114 &4438684259955260312 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8989319042809547364} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 06edc4e02f9c48647adfed0a778cb8aa, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIAbout.prefab.meta b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIAbout.prefab.meta new file mode 100644 index 0000000..a51b8f0 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIAbout.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2e0f217747ebd544c82e9ddd1b47525e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIBattle.prefab b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIBattle.prefab index 674990c..0006ea7 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIBattle.prefab +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIBattle.prefab @@ -36,7 +36,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 620, y: 924} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1168652661830625159 CanvasRenderer: @@ -206,10 +206,10 @@ RectTransform: m_Father: {fileID: 4142826567245113224} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 100, y: 100} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &3580699901832812969 GameObject: @@ -341,7 +341,6 @@ GameObject: - component: {fileID: 4142826567245113224} - component: {fileID: 4142826567245113225} - component: {fileID: 446002385128238495} - - component: {fileID: 3910061912146487027} m_Layer: 5 m_Name: UIBattle m_TagString: Untagged @@ -409,18 +408,6 @@ MonoBehaviour: m_BlockingMask: serializedVersion: 2 m_Bits: 4294967295 ---- !u!114 &3910061912146487027 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4142826567245113227} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9776c197a7f86e94c9484946495616bb, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!1 &5051316305113654670 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UICanvas.prefab b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UICanvas.prefab new file mode 100644 index 0000000..06de56b --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UICanvas.prefab @@ -0,0 +1,203 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1457738500883128975 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1457738500883128971} + - component: {fileID: 1457738500883128972} + - component: {fileID: 1457738500883128973} + - component: {fileID: 1457738500883128974} + m_Layer: 5 + m_Name: UICanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1457738500883128971 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1457738500883128975} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 4471021202605196124} + - {fileID: 3071470527211293446} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &1457738500883128972 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1457738500883128975} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &1457738500883128973 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1457738500883128975} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &1457738500883128974 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1457738500883128975} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!1 &3071470527211293447 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3071470527211293446} + m_Layer: 5 + m_Name: Desktop + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3071470527211293446 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3071470527211293447} + 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_Children: [] + m_Father: {fileID: 1457738500883128971} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &4471021202605196131 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4471021202605196124} + - component: {fileID: 4471021202605196125} + - component: {fileID: 4471021202605196130} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4471021202605196124 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4471021202605196131} + 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_Children: [] + m_Father: {fileID: 1457738500883128971} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4471021202605196125 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4471021202605196131} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!114 &4471021202605196130 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4471021202605196131} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UICanvas.prefab.meta b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UICanvas.prefab.meta new file mode 100644 index 0000000..0f388e5 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UICanvas.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1700631a871f2da418ca3815faed9394 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UILogin.prefab b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIHome.prefab similarity index 96% rename from Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UILogin.prefab rename to Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIHome.prefab index dbea87e..ff25f71 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UILogin.prefab +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIHome.prefab @@ -130,9 +130,8 @@ GameObject: - component: {fileID: 4142826567245113224} - component: {fileID: 4142826567245113225} - component: {fileID: 446002385128238495} - - component: {fileID: -4265997780860394554} m_Layer: 5 - m_Name: UILogin + m_Name: UIHome m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -197,18 +196,6 @@ MonoBehaviour: m_BlockingMask: serializedVersion: 2 m_Bits: 4294967295 ---- !u!114 &-4265997780860394554 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4142826567245113227} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4792d7c57be85c845bc50d7215160853, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!1 &4691699994207377690 GameObject: m_ObjectHideFlags: 0 @@ -222,7 +209,7 @@ GameObject: - component: {fileID: 1411896437987713300} - component: {fileID: 6457600995492259680} m_Layer: 5 - m_Name: Setting + m_Name: About m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -483,4 +470,4 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: Setting + m_Text: About diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UILogin.prefab.meta b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIHome.prefab.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UILogin.prefab.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIHome.prefab.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UILoading.prefab b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UILoading.prefab new file mode 100644 index 0000000..9b6e1fd --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UILoading.prefab @@ -0,0 +1,231 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &213995007158037226 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2380612195453094903} + - component: {fileID: 95677582635961211} + - component: {fileID: 5262699309239441798} + m_Layer: 5 + m_Name: bg + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2380612195453094903 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 213995007158037226} + 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_Children: [] + m_Father: {fileID: 4142826567245113224} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &95677582635961211 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 213995007158037226} + m_CullTransparentMesh: 0 +--- !u!114 &5262699309239441798 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 213995007158037226} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: b76b8b216adf64f4bbdb78f7977f0310, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &867898397607806311 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6184545274827739511} + - component: {fileID: 6671564359713877752} + - component: {fileID: 5054946357839069556} + m_Layer: 5 + m_Name: info + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6184545274827739511 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 867898397607806311} + 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_Children: [] + m_Father: {fileID: 4142826567245113224} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 113.6, y: 0} + m_SizeDelta: {x: 372.8026, y: 60} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6671564359713877752 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 867898397607806311} + m_CullTransparentMesh: 0 +--- !u!114 &5054946357839069556 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 867898397607806311} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 8297a2bf97dbbba468bd2518d003a876, type: 3} + m_FontSize: 36 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Loading... +--- !u!1 &4142826567245113227 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4142826567245113224} + - component: {fileID: 4142826567245113225} + - component: {fileID: 446002385128238495} + m_Layer: 5 + m_Name: UILoading + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4142826567245113224 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4142826567245113227} + 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_Children: + - {fileID: 2380612195453094903} + - {fileID: 6184545274827739511} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &4142826567245113225 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4142826567245113227} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 1 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &446002385128238495 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4142826567245113227} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UILoading.prefab.meta b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UILoading.prefab.meta new file mode 100644 index 0000000..35e40ac --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UILoading.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 79ae622f4c23c47449fc3ea70abaca51 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UISprite/common/window/window_transparent.png.meta b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UISprite/common/window/window_transparent.png.meta index c76fb84..f84fb21 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UISprite/common/window/window_transparent.png.meta +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UISprite/common/window/window_transparent.png.meta @@ -46,7 +46,7 @@ TextureImporter: alignment: 0 spritePivot: {x: 0.5, y: 0.5} spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteBorder: {x: 142, y: 145, z: 148, w: 165} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 alphaIsTransparency: 1 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UISprite/common/window/window_transparent1.png.meta b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UISprite/common/window/window_transparent1.png.meta index babe56d..bac19b2 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UISprite/common/window/window_transparent1.png.meta +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UISprite/common/window/window_transparent1.png.meta @@ -46,7 +46,7 @@ TextureImporter: alignment: 0 spritePivot: {x: 0.5, y: 0.5} spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteBorder: {x: 157, y: 139, z: 154, w: 157} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 alphaIsTransparency: 1 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleEventDefine.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleEventDefine.cs deleted file mode 100644 index 5d6ed5d..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleEventDefine.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class BattleEventDefine -{ - public class ScoreChange : IEventMessage - { - public int CurrentScores; - } - - public class GameOver : IEventMessage - { - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleEventDispatcher.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleEventDispatcher.cs deleted file mode 100644 index 3121d51..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleEventDispatcher.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public static class BattleEventDispatcher -{ - public static void SendScoreChangeMsg(int currentScores) - { - BattleEventDefine.ScoreChange msg = new BattleEventDefine.ScoreChange(); - msg.CurrentScores = currentScores; - EventManager.SendMessage(msg); - } - - public static void SendGameOverMsg() - { - BattleEventDefine.GameOver msg = new BattleEventDefine.GameOver(); - EventManager.SendMessage(msg); - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleRoom.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleRoom.cs deleted file mode 100644 index ab4eeca..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleRoom.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System; -using UnityEngine; -using YooAsset; -using Random = UnityEngine.Random; - -[Serializable] -public class RoomBoundary -{ - public float xMin, xMax, zMin, zMax; -} - -public class BattleRoom : MonoBehaviour -{ - public static BattleRoom Instance; - - public Vector3 SpawnValues; - public int EnemyCount = 10; - public float SpawnWait = 0.75f; - public float StartWait = 1f; - public float WaveWait = 4f; - - private int _totalScore = 0; - private bool _gameOver = false; - private string[] _enemyLocations = new string[] - { - "asteroid01", "asteroid02", "asteroid03", "enemy_ship" - }; - - private AssetOperationHandle _panelHandle; - - void Awake() - { - Instance = this; - - var canvas = GameObject.Find("Canvas"); - _panelHandle = YooAssets.LoadAssetSync("UIBattle"); - var go = _panelHandle.InstantiateSync(canvas.transform); - go.transform.localPosition = Vector3.zero; - } - void Start() - { - var handle = YooAssets.LoadAssetSync("player_ship"); - var go = handle.InstantiateSync(); - var bhv = go.GetComponent(); - bhv.InitEntity(handle); - - StartCoroutine(SpawnWaves()); - } - void OnDestroy() - { - Instance = null; - - if(_panelHandle != null) - { - _panelHandle.Release(); - _panelHandle = null; - } - } - - IEnumerator SpawnWaves() - { - yield return new WaitForSeconds(StartWait); - while (true) - { - for (int i = 0; i < EnemyCount; i++) - { - var enemyLocation= _enemyLocations[Random.Range(0, 4)]; - Vector3 spawnPosition = new Vector3(Random.Range(-SpawnValues.x, SpawnValues.x), SpawnValues.y, SpawnValues.z); - Quaternion spawnRotation = Quaternion.identity; - - if(enemyLocation == "enemy_ship") - { - var handle = YooAssets.LoadAssetSync(enemyLocation); - var go = handle.InstantiateSync(spawnPosition, spawnRotation); - var bhv = go.GetComponent(); - bhv.InitEntity(handle); - } - else - { - var handle = YooAssets.LoadAssetSync(enemyLocation); - var go = handle.InstantiateSync(spawnPosition, spawnRotation); - var bhv = go.GetComponent(); - bhv.InitEntity(handle); - } - - yield return new WaitForSeconds(SpawnWait); - } - yield return new WaitForSeconds(WaveWait); - - if (_gameOver) - { - break; - } - } - } - - public void GameOver() - { - _gameOver = true; - BattleEventDispatcher.SendGameOverMsg(); - } - - public void AddScore(int score) - { - _totalScore += score; - BattleEventDispatcher.SendScoreChangeMsg(_totalScore); - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityAsteroid.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityAsteroid.cs deleted file mode 100644 index 214f095..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityAsteroid.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using YooAsset; - -public class EntityAsteroid : MonoBehaviour -{ - private AssetOperationHandle _ownerHandle; - - public float MoveSpeed = -5f; - public float Tumble = 5f; - - public void InitEntity(AssetOperationHandle ownerHandle) - { - _ownerHandle = ownerHandle; - } - - void Awake() - { - var rigidBody = this.transform.GetComponent(); - rigidBody.velocity = this.transform.forward * MoveSpeed; - rigidBody.angularVelocity = Random.insideUnitSphere * Tumble; - } - void OnDestroy() - { - if (_ownerHandle != null) - { - _ownerHandle.Release(); - _ownerHandle = null; - } - } - void OnTriggerEnter(Collider other) - { - if (other.CompareTag("PlayerBullet")) - { - var handle = YooAssets.LoadAssetSync("explosion_asteroid"); - var go = handle.InstantiateSync(other.transform.position, Quaternion.identity); - var bhv = go.GetComponent(); - bhv.InitEntity(handle); - - BattleRoom.Instance.AddScore(1); - GameObject.Destroy(this.gameObject); - } - } - void OnTriggerExit(Collider other) - { - if (other.CompareTag("Boundary")) - { - GameObject.Destroy(this.gameObject); - } - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityEffect.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityEffect.cs deleted file mode 100644 index 80b3438..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityEffect.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using YooAsset; - -public class EntityEffect : MonoBehaviour -{ - private AssetOperationHandle _ownerHandle; - - public float DelayDestroyTime = 1f; - - public void InitEntity(AssetOperationHandle ownerHandle) - { - _ownerHandle = ownerHandle; - } - - void Awake() - { - Invoke(nameof(DelayDestroy), DelayDestroyTime); - } - void OnDestroy() - { - if (_ownerHandle != null) - { - _ownerHandle.Release(); - _ownerHandle = null; - } - } - - private void DelayDestroy() - { - GameObject.Destroy(this.gameObject); - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Behaviour.meta similarity index 77% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Behaviour.meta index c8b310d..ffcf78e 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager.meta +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Behaviour.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: cb1f2313c4b23304f9257ac58c1024f8 +guid: e2f6bcc746b3d984e81caafa7d25467b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BackgroundScroller.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Behaviour/BhvBackgroundScroller.cs similarity index 87% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BackgroundScroller.cs rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Behaviour/BhvBackgroundScroller.cs index 1b87509..941fcca 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BackgroundScroller.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Behaviour/BhvBackgroundScroller.cs @@ -1,7 +1,7 @@ using System; using UnityEngine; -public class BackgroundScroller : MonoBehaviour +public class BhvBackgroundScroller : MonoBehaviour { public float ScrollSpeed; public float TileSizeZ; diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BackgroundScroller.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Behaviour/BhvBackgroundScroller.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BackgroundScroller.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Behaviour/BhvBackgroundScroller.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Boot.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Boot.cs new file mode 100644 index 0000000..0bb9d32 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Boot.cs @@ -0,0 +1,39 @@ +using UnityEngine; +using UniFramework.Event; +using UniFramework.Module; +using YooAsset; + +public class Boot : MonoBehaviour +{ + /// + /// 资源系统运行模式 + /// + public EPlayMode PlayMode = EPlayMode.EditorSimulateMode; + + void Awake() + { + Debug.Log($"资源系统运行模式:{PlayMode}"); + Application.targetFrameRate = 60; + Application.runInBackground = true; + } + void Start() + { + // 初始化BetterStreaming + BetterStreamingAssets.Initialize(); + + // 初始化事件系统 + UniEvent.Initalize(); + + // 初始化管理系统 + UniModule.Initialize(); + + // 初始化资源系统 + YooAssets.Initialize(); + + // 创建补丁管理器 + UniModule.CreateModule(); + + // 开始补丁更新流程 + PatchManager.Instance.Run(PlayMode); + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameBoot.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Boot.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameBoot.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Boot.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine.meta similarity index 77% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine.meta index fd9be57..8e5f58f 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager.meta +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c64420b3b1ae37943b4565f458c10b7d +guid: 8428e7a0bb96bf946aa3034281990090 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/BattleEventDefine.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/BattleEventDefine.cs new file mode 100644 index 0000000..5482a50 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/BattleEventDefine.cs @@ -0,0 +1,119 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Event; + +public class BattleEventDefine +{ + /// + /// 分数改变 + /// + public class ScoreChange : IEventMessage + { + public int CurrentScores; + + public static void SendEventMessage(int currentScores) + { + var msg = new ScoreChange(); + msg.CurrentScores = currentScores; + UniEvent.SendMessage(msg); + } + } + + /// + /// 游戏结束 + /// + public class GameOver : IEventMessage + { + public static void SendEventMessage() + { + var msg = new GameOver(); + UniEvent.SendMessage(msg); + } + } + + /// + /// 敌人死亡 + /// + public class EnemyDead : IEventMessage + { + public Vector3 Position; + public Quaternion Rotation; + + public static void SendEventMessage(Vector3 position, Quaternion rotation) + { + var msg = new EnemyDead(); + msg.Position = position; + msg.Rotation = rotation; + UniEvent.SendMessage(msg); + } + } + + /// + /// 玩家死亡 + /// + public class PlayerDead : IEventMessage + { + public Vector3 Position; + public Quaternion Rotation; + + public static void SendEventMessage(Vector3 position, Quaternion rotation) + { + var msg = new PlayerDead(); + msg.Position = position; + msg.Rotation = rotation; + UniEvent.SendMessage(msg); + } + } + + /// + /// 小行星爆炸 + /// + public class AsteroidExplosion : IEventMessage + { + public Vector3 Position; + public Quaternion Rotation; + + public static void SendEventMessage(Vector3 position, Quaternion rotation) + { + var msg = new AsteroidExplosion(); + msg.Position = position; + msg.Rotation = rotation; + UniEvent.SendMessage(msg); + } + } + + /// + /// 敌人发射子弹 + /// + public class EnemyFireBullet : IEventMessage + { + public Vector3 Position; + public Quaternion Rotation; + + public static void SendEventMessage(Vector3 position, Quaternion rotation) + { + var msg = new EnemyFireBullet(); + msg.Position = position; + msg.Rotation = rotation; + UniEvent.SendMessage(msg); + } + } + + /// + /// 玩家发射子弹 + /// + public class PlayerFireBullet : IEventMessage + { + public Vector3 Position; + public Quaternion Rotation; + + public static void SendEventMessage(Vector3 position, Quaternion rotation) + { + var msg = new PlayerFireBullet(); + msg.Position = position; + msg.Rotation = rotation; + UniEvent.SendMessage(msg); + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleEventDefine.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/BattleEventDefine.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleEventDefine.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/BattleEventDefine.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/PatchEventDefine.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/PatchEventDefine.cs new file mode 100644 index 0000000..af865d8 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/PatchEventDefine.cs @@ -0,0 +1,98 @@ +using UniFramework.Event; + +public class PatchEventDefine +{ + /// + /// 补丁流程步骤改变 + /// + public class PatchStatesChange : IEventMessage + { + public string Tips; + + public static void SendEventMessage(string tips) + { + var msg = new PatchStatesChange(); + msg.Tips = tips; + UniEvent.SendMessage(msg); + } + } + + /// + /// 发现更新文件 + /// + public class FoundUpdateFiles : IEventMessage + { + public int TotalCount; + public long TotalSizeBytes; + + public static void SendEventMessage(int totalCount, long totalSizeBytes) + { + var msg = new FoundUpdateFiles(); + msg.TotalCount = totalCount; + msg.TotalSizeBytes = totalSizeBytes; + UniEvent.SendMessage(msg); + } + } + + /// + /// 下载进度更新 + /// + public class DownloadProgressUpdate : IEventMessage + { + public int TotalDownloadCount; + public int CurrentDownloadCount; + public long TotalDownloadSizeBytes; + public long CurrentDownloadSizeBytes; + + public static void SendEventMessage(int totalDownloadCount, int currentDownloadCount, long totalDownloadSizeBytes, long currentDownloadSizeBytes) + { + var msg = new DownloadProgressUpdate(); + msg.TotalDownloadCount = totalDownloadCount; + msg.CurrentDownloadCount = currentDownloadCount; + msg.TotalDownloadSizeBytes = totalDownloadSizeBytes; + msg.CurrentDownloadSizeBytes = currentDownloadSizeBytes; + UniEvent.SendMessage(msg); + } + } + + /// + /// 资源版本号更新失败 + /// + public class PackageVersionUpdateFailed : IEventMessage + { + public static void SendEventMessage() + { + var msg = new PackageVersionUpdateFailed(); + UniEvent.SendMessage(msg); + } + } + + /// + /// 补丁清单更新失败 + /// + public class PatchManifestUpdateFailed : IEventMessage + { + public static void SendEventMessage() + { + var msg = new PatchManifestUpdateFailed(); + UniEvent.SendMessage(msg); + } + } + + /// + /// 网络文件下载失败 + /// + public class WebFileDownloadFailed : IEventMessage + { + public string FileName; + public string Error; + + public static void SendEventMessage(string fileName, string error) + { + var msg = new WebFileDownloadFailed(); + msg.FileName = fileName; + msg.Error = error; + UniEvent.SendMessage(msg); + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDefine.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/PatchEventDefine.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDefine.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/PatchEventDefine.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/SceneEventDefine.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/SceneEventDefine.cs new file mode 100644 index 0000000..eb71d8f --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/SceneEventDefine.cs @@ -0,0 +1,22 @@ +using UniFramework.Event; + +public class SceneEventDefine +{ + public class ChangeToHomeScene : IEventMessage + { + public static void SendEventMessage() + { + var msg = new ChangeToHomeScene(); + UniEvent.SendMessage(msg); + } + } + + public class ChangeToBattleScene : IEventMessage + { + public static void SendEventMessage() + { + var msg = new ChangeToBattleScene(); + UniEvent.SendMessage(msg); + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleEventDispatcher.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/SceneEventDefine.cs.meta similarity index 83% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleEventDispatcher.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/SceneEventDefine.cs.meta index 1d4012f..b143cb2 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleEventDispatcher.cs.meta +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/SceneEventDefine.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5915c7b5006a8384dbefdf32da34a3e6 +guid: c56a83939686d3a4aa76b7d4ec704889 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/UserEventDefine.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/UserEventDefine.cs new file mode 100644 index 0000000..4f41298 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/UserEventDefine.cs @@ -0,0 +1,52 @@ +using UniFramework.Event; + +public class UserEventDefine +{ + /// + /// 用户开始下载网络文件 + /// + public class UserBeginDownloadWebFiles : IEventMessage + { + public static void SendEventMessage() + { + var msg = new UserBeginDownloadWebFiles(); + UniEvent.SendMessage(msg); + } + } + + /// + /// 用户尝试再次更新静态版本 + /// + public class UserTryUpdatePackageVersion : IEventMessage + { + public static void SendEventMessage() + { + var msg = new UserTryUpdatePackageVersion(); + UniEvent.SendMessage(msg); + } + } + + /// + /// 用户尝试再次更新补丁清单 + /// + public class UserTryUpdatePatchManifest : IEventMessage + { + public static void SendEventMessage() + { + var msg = new UserTryUpdatePatchManifest(); + UniEvent.SendMessage(msg); + } + } + + /// + /// 用户尝试再次下载网络文件 + /// + public class UserTryDownloadWebFiles : IEventMessage + { + public static void SendEventMessage() + { + var msg = new UserTryDownloadWebFiles(); + UniEvent.SendMessage(msg); + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/FsmManager.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/UserEventDefine.cs.meta similarity index 83% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/FsmManager.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/UserEventDefine.cs.meta index a63a247..bd45d49 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/FsmManager.cs.meta +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/EventDefine/UserEventDefine.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: bcbf86a86eb115a41b6aa61fb0945d43 +guid: 1bfe7ffc460fb234da96624844ab7e51 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity.meta similarity index 77% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity.meta index 4353c02..056c09c 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager.meta +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1a79eedc3fa88c8429b085954a7e9093 +guid: 2673676235c2ebf4790768011d015d1d folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityAsteroid.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityAsteroid.cs new file mode 100644 index 0000000..8e4d8e6 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityAsteroid.cs @@ -0,0 +1,43 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Pooling; + +public class EntityAsteroid : MonoBehaviour +{ + public float MoveSpeed = -5f; + public float Tumble = 5f; + + private SpawnHandle _handle; + private Rigidbody _rigidbody; + + public void InitEntity(SpawnHandle handle) + { + _handle = handle; + + _rigidbody.velocity = this.transform.forward * MoveSpeed; + _rigidbody.angularVelocity = Random.insideUnitSphere * Tumble; + } + + void Awake() + { + _rigidbody = this.transform.GetComponent(); + } + void OnTriggerEnter(Collider other) + { + if (other.CompareTag("PlayerBullet")) + { + BattleEventDefine.AsteroidExplosion.SendEventMessage(this.transform.position, this.transform.rotation); + _handle.Restore(); + _handle = null; + } + } + void OnTriggerExit(Collider other) + { + if (other.CompareTag("Boundary")) + { + _handle.Restore(); + _handle = null; + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityAsteroid.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityAsteroid.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityAsteroid.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityAsteroid.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityBullet.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityBullet.cs similarity index 54% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityBullet.cs rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityBullet.cs index c96caa3..dc68fec 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityBullet.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityBullet.cs @@ -1,32 +1,25 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -using YooAsset; +using UniFramework.Pooling; public class EntityBullet : MonoBehaviour { - private AssetOperationHandle _ownerHandle; - public float MoveSpeed = 20f; public float DelayDestroyTime = 5f; - public void InitEntity(AssetOperationHandle ownerHandle) + private SpawnHandle _handle; + private Rigidbody _rigidbody; + + public void InitEntity(SpawnHandle handle) { - _ownerHandle = ownerHandle; + _handle = handle; + _rigidbody.velocity = this.transform.forward * MoveSpeed; } void Awake() { - var rigidBody = this.transform.GetComponent(); - rigidBody.velocity = this.transform.forward * MoveSpeed; - } - void OnDestroy() - { - if (_ownerHandle != null) - { - _ownerHandle.Release(); - _ownerHandle = null; - } + _rigidbody = this.transform.GetComponent(); } void OnTriggerEnter(Collider other) { @@ -36,20 +29,27 @@ public class EntityBullet : MonoBehaviour if (this.gameObject.CompareTag("EnemyBullet")) { if (other.CompareTag("Enemy") == false) - GameObject.Destroy(this.gameObject); + { + _handle.Restore(); + _handle = null; + } } if (this.gameObject.CompareTag("PlayerBullet")) { if (other.CompareTag("Player") == false) - GameObject.Destroy(this.gameObject); + { + _handle.Restore(); + _handle = null; + } } } void OnTriggerExit(Collider other) { if (other.CompareTag("Boundary")) { - GameObject.Destroy(this.gameObject); + _handle.Restore(); + _handle = null; } } } \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityBullet.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityBullet.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityBullet.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityBullet.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityEffect.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityEffect.cs new file mode 100644 index 0000000..ef8da64 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityEffect.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Pooling; + +public class EntityEffect : MonoBehaviour +{ + public float DelayDestroyTime = 1f; + + private SpawnHandle _handle; + + public void InitEntity(SpawnHandle handle) + { + _handle = handle; + + Invoke(nameof(DelayDestroy), DelayDestroyTime); + } + private void DelayDestroy() + { + _handle.Restore(); + _handle = null; + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityEffect.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityEffect.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityEffect.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityEffect.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityEnemy.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityEnemy.cs similarity index 63% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityEnemy.cs rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityEnemy.cs index 48ad761..3f72f74 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityEnemy.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityEnemy.cs @@ -1,7 +1,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -using YooAsset; +using UniFramework.Pooling; using Random = UnityEngine.Random; public class EntityEnemy : MonoBehaviour @@ -9,8 +9,6 @@ public class EntityEnemy : MonoBehaviour private const float Dodge = 5f; private const float Smoothing = 7.5f; - private AssetOperationHandle _ownerHandle; - public RoomBoundary Boundary; public float MoveSpeed = 20f; public float FireInterval = 2f; @@ -19,17 +17,24 @@ public class EntityEnemy : MonoBehaviour public Vector2 ManeuverTime = new Vector2(1, 2); public Vector2 ManeuverWait = new Vector2(1, 2); + private SpawnHandle _handle; private Transform _shotSpawn; private Rigidbody _rigidbody; private AudioSource _audioSource; private float _lastFireTime = 0f; + private float _currentSpeed; + private float _targetManeuver; - float _currentSpeed; - float targetManeuver; - public void InitEntity(AssetOperationHandle ownerHandle) + public void InitEntity(SpawnHandle handle) { - _ownerHandle = ownerHandle; + _handle = handle; + + _rigidbody.velocity = this.transform.forward * -5f; + _lastFireTime = Time.time; + _currentSpeed = _rigidbody.velocity.z; + _targetManeuver = 0f; + StartCoroutine(Evade()); } void Awake() @@ -37,40 +42,19 @@ public class EntityEnemy : MonoBehaviour _rigidbody = this.gameObject.GetComponent(); _audioSource = this.gameObject.GetComponent(); _shotSpawn = this.transform.Find("shot_spawn"); - - _rigidbody.velocity = this.transform.forward * -5f; - _currentSpeed = _rigidbody.velocity.z; - StartCoroutine(Evade()); - } - void Start() - { - _lastFireTime = Time.time; - } - void OnDestroy() - { - if (_ownerHandle != null) - { - _ownerHandle.Release(); - _ownerHandle = null; - } } void Update() { if (Time.time - _lastFireTime >= FireInterval) { _lastFireTime = Time.time; - - var handle = YooAssets.LoadAssetSync("enemy_bullet"); - var go = handle.InstantiateSync(_shotSpawn.position, _shotSpawn.rotation); - var bhv = go.GetComponent(); - bhv.InitEntity(handle); - _audioSource.Play(); + BattleEventDefine.EnemyFireBullet.SendEventMessage(_shotSpawn.position, _shotSpawn.rotation); } } void FixedUpdate() { - float newManeuver = Mathf.MoveTowards(_rigidbody.velocity.x, targetManeuver, Smoothing * Time.deltaTime); + float newManeuver = Mathf.MoveTowards(_rigidbody.velocity.x, _targetManeuver, Smoothing * Time.deltaTime); _rigidbody.velocity = new Vector3(newManeuver, 0.0f, _currentSpeed); _rigidbody.position = new Vector3 ( @@ -86,20 +70,17 @@ public class EntityEnemy : MonoBehaviour { if (other.CompareTag("PlayerBullet")) { - var handle = YooAssets.LoadAssetSync("explosion_enemy"); - var go = handle.InstantiateSync(this.transform.position, this.transform.rotation); - var bhv = go.GetComponent(); - bhv.InitEntity(handle); - - BattleRoom.Instance.AddScore(10); - GameObject.Destroy(this.gameObject); + BattleEventDefine.EnemyDead.SendEventMessage(this.transform.position, this.transform.rotation); + _handle.Restore(); + _handle = null; } } void OnTriggerExit(Collider other) { if (other.CompareTag("Boundary")) { - GameObject.Destroy(this.gameObject); + _handle.Restore(); + _handle = null; } } @@ -108,9 +89,9 @@ public class EntityEnemy : MonoBehaviour yield return new WaitForSeconds(Random.Range(StartWait.x, StartWait.y)); while (true) { - targetManeuver = Random.Range(1, Dodge) * -Mathf.Sign(transform.position.x); + _targetManeuver = Random.Range(1, Dodge) * -Mathf.Sign(transform.position.x); yield return new WaitForSeconds(Random.Range(ManeuverTime.x, ManeuverTime.y)); - targetManeuver = 0; + _targetManeuver = 0; yield return new WaitForSeconds(Random.Range(ManeuverWait.x, ManeuverWait.y)); } } diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityEnemy.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityEnemy.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityEnemy.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityEnemy.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityPlayer.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityPlayer.cs similarity index 63% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityPlayer.cs rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityPlayer.cs index 35589d6..716218e 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityPlayer.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityPlayer.cs @@ -1,24 +1,23 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -using YooAsset; +using UniFramework.Pooling; public class EntityPlayer : MonoBehaviour -{ - private AssetOperationHandle _ownerHandle; - +{ public RoomBoundary Boundary; public float MoveSpeed = 10f; public float FireRate = 0.25f; + private SpawnHandle _handle; private float _nextFireTime = 0f; private Transform _shotSpawn; private Rigidbody _rigidbody; private AudioSource _audioSource; - public void InitEntity(AssetOperationHandle ownerHandle) + public void InitEntity(SpawnHandle handle) { - _ownerHandle = ownerHandle; + _handle = handle; } void Awake() @@ -27,26 +26,13 @@ public class EntityPlayer : MonoBehaviour _audioSource = this.gameObject.GetComponent(); _shotSpawn = this.transform.Find("shot_spawn"); } - void OnDestroy() - { - if (_ownerHandle != null) - { - _ownerHandle.Release(); - _ownerHandle = null; - } - } void Update() { if (Input.GetButton("Fire1") && Time.time > _nextFireTime) { _nextFireTime = Time.time + FireRate; - - var handle = YooAssets.LoadAssetSync("player_bullet"); - var go = handle.InstantiateSync(_shotSpawn.position, _shotSpawn.rotation); - var bhv = go.GetComponent(); - bhv.InitEntity(handle); - _audioSource.Play(); + BattleEventDefine.PlayerFireBullet.SendEventMessage(_shotSpawn.position, _shotSpawn.rotation); } } void FixedUpdate() @@ -56,7 +42,6 @@ public class EntityPlayer : MonoBehaviour Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical); _rigidbody.velocity = movement * MoveSpeed; - _rigidbody.position = new Vector3 ( Mathf.Clamp(GetComponent().position.x, Boundary.xMin, Boundary.xMax), @@ -71,13 +56,9 @@ public class EntityPlayer : MonoBehaviour { if (other.CompareTag("Enemy") || other.CompareTag("EnemyBullet") || other.CompareTag("Asteroid")) { - var explosionHandle = YooAssets.LoadAssetSync("explosion_player"); - var go = explosionHandle.InstantiateSync(this.transform.position, this.transform.rotation); - var bhv = go.GetComponent(); - bhv.InitEntity(explosionHandle); - - BattleRoom.Instance.GameOver(); - GameObject.Destroy(this.gameObject); + BattleEventDefine.PlayerDead.SendEventMessage(this.transform.position, this.transform.rotation); + _handle.Restore(); + _handle = null; } } } \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityPlayer.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityPlayer.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/EntityPlayer.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Entity/EntityPlayer.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/Plugins.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode.meta similarity index 77% rename from Assets/YooAsset/Samples~/Space Shooter/Plugins.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode.meta index 570cec6..73bda8f 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/Plugins.meta +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e214524cdc329d646b50bf3e8ba8e7a0 +guid: beab7f759234b61469afb94f517f959b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmInitGame.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmInitGame.cs new file mode 100644 index 0000000..763eb76 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmInitGame.cs @@ -0,0 +1,38 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Pooling; +using UniFramework.Window; +using UniFramework.Machine; +using YooAsset; + +internal class FsmInitGame : IStateNode +{ + private StateMachine _machine; + + void IStateNode.OnCreate(StateMachine machine) + { + _machine = machine; + } + void IStateNode.OnEnter() + { + var handle = YooAssets.LoadAssetSync("UICanvas"); + var canvas = handle.InstantiateSync(); + var desktop = canvas.transform.Find("Desktop").gameObject; + GameObject.DontDestroyOnLoad(canvas); + + // 初始化窗口系统 + UniWindow.Initalize(desktop); + + // 初始化对象池系统 + UniPooling.Initalize(); + + _machine.ChangeState(); + } + void IStateNode.OnUpdate() + { + } + void IStateNode.OnExit() + { + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/IFsmNode.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmInitGame.cs.meta similarity index 83% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/IFsmNode.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmInitGame.cs.meta index 2d5a76a..97c7022 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/IFsmNode.cs.meta +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmInitGame.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 40fe73297598be84fb8dadedd4dd17e6 +guid: 35d459ebb0d7dc947b7b62d1f64a412f MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneBattle.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneBattle.cs new file mode 100644 index 0000000..3f8fba3 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneBattle.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Window; +using UniFramework.Event; +using UniFramework.Machine; +using UniFramework.Module; +using YooAsset; + +internal class FsmSceneBattle : IStateNode +{ + private BattleRoom _battleRoom; + + void IStateNode.OnCreate(StateMachine machine) + { + } + void IStateNode.OnEnter() + { + UniWindow.OpenWindowSync("UILoading"); + + UniModule.StartCoroutine(Prepare()); + } + void IStateNode.OnUpdate() + { + if(_battleRoom != null) + _battleRoom.UpdateRoom(); + } + void IStateNode.OnExit() + { + if(_battleRoom != null) + { + _battleRoom.DestroyRoom(); + _battleRoom = null; + } + } + + private IEnumerator Prepare() + { + yield return YooAssets.LoadSceneAsync("scene_battle"); + + _battleRoom = new BattleRoom(); + yield return _battleRoom.LoadRoom(); + + // 等所有数据准备完毕后,关闭加载界面。 + UniWindow.CloseWindow(); + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/EventManager.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneBattle.cs.meta similarity index 83% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/EventManager.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneBattle.cs.meta index b8fac93..c76778b 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/EventManager.cs.meta +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneBattle.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 195a0b4317373b44d9289d7b0529eb7c +guid: 54061fd8bcab2344e87b0faf0464c179 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneHome.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneHome.cs new file mode 100644 index 0000000..3260bef --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneHome.cs @@ -0,0 +1,41 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Machine; +using UniFramework.Window; +using UniFramework.Module; +using YooAsset; + +internal class FsmSceneHome : IStateNode +{ + private StateMachine _machine; + + void IStateNode.OnCreate(StateMachine machine) + { + _machine = machine; + } + void IStateNode.OnEnter() + { + if (_machine.PreviousNode != typeof(FsmInitGame).FullName) + UniWindow.OpenWindowSync("UILoading"); + + UniModule.StartCoroutine(Prepare()); + } + void IStateNode.OnUpdate() + { + } + void IStateNode.OnExit() + { + UniWindow.CloseWindow(); + } + + private IEnumerator Prepare() + { + yield return YooAssets.LoadSceneAsync("scene_home"); + yield return UniWindow.OpenWindowAsync("UIHome"); + yield return new WaitForSeconds(0.5f); + + // 等所有数据准备完毕后,关闭加载界面。 + UniWindow.CloseWindow(); + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneHome.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneHome.cs.meta new file mode 100644 index 0000000..87243c7 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/FsmNode/FsmSceneHome.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 41730f8e5f2b6e64abc4a03035c61ea5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/GameManager.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/GameManager.cs new file mode 100644 index 0000000..1625773 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/GameManager.cs @@ -0,0 +1,64 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Event; +using UniFramework.Machine; +using UniFramework.Module; + +public class GameManager : ModuleSingleton, IModule +{ + private bool _isRun = false; + private EventGroup _eventGroup = new EventGroup(); + private StateMachine _machine; + + void IModule.OnCreate(object createParam) + { + } + void IModule.OnDestroy() + { + _eventGroup.RemoveAllListener(); + } + void IModule.OnUpdate() + { + if (_machine != null) + _machine.Update(); + } + + public void Run() + { + if (_isRun == false) + { + _isRun = true; + + // 注册监听事件 + _eventGroup.AddListener(OnHandleEventMessage); + _eventGroup.AddListener(OnHandleEventMessage); + + Debug.Log("开启游戏流程..."); + _machine = new StateMachine(this); + _machine.AddNode(); + _machine.AddNode(); + _machine.AddNode(); + _machine.Run(); + } + else + { + Debug.LogWarning("补丁更新已经正在进行中!"); + } + } + + /// + /// 接收事件 + /// + private void OnHandleEventMessage(IEventMessage message) + { + if(message is SceneEventDefine.ChangeToHomeScene) + { + _machine.ChangeState(); + } + else if(message is SceneEventDefine.ChangeToBattleScene) + { + _machine.ChangeState(); + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/GameManager.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/GameManager.cs.meta new file mode 100644 index 0000000..f3a007a --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/GameManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f6630e7de79efb24b9263519ba4282e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Room.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Room.meta new file mode 100644 index 0000000..9536a61 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Room.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7866629ff257c6d4d84cd9dab5d0b000 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Room/BattleRoom.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Room/BattleRoom.cs new file mode 100644 index 0000000..863a26c --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Room/BattleRoom.cs @@ -0,0 +1,257 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Window; +using UniFramework.Pooling; +using UniFramework.Event; +using UniFramework.Utility; +using YooAsset; +using Random = UnityEngine.Random; + +[Serializable] +public class RoomBoundary +{ + public float xMin, xMax, zMin, zMax; +} + +/// +/// 战斗房间 +/// +public class BattleRoom +{ + private enum ESteps + { + None, + Ready, + Spawn, + WaitSpawn, + WaitWave, + GameOver, + } + + private EventGroup _eventGroup = new EventGroup(); + private Spawner _entitySpawner; + private GameObject _roomRoot; + private AssetOperationHandle _musicHandle; + + // 关卡参数 + private const int EnemyCount = 10; + private const int EnemyScore = 10; + private const int AsteroidScore = 1; + private readonly Vector3 _spawnValues = new Vector3(6, 0, 20); + private readonly string[] _entityLocations = new string[] + { + "asteroid01", "asteroid02", "asteroid03", "enemy_ship" + }; + + private ESteps _steps = ESteps.None; + private int _totalScore = 0; + private int _waveSpawnCount = 0; + + private UniTimer _startWaitTimer = UniTimer.CreateOnceTimer(1f); + private UniTimer _spawnWaitTimer = UniTimer.CreateOnceTimer(0.75f); + private UniTimer _waveWaitTimer = UniTimer.CreateOnceTimer(4f); + + + /// + /// 销毁房间 + /// + public void DestroyRoom() + { + if (_musicHandle != null) + _musicHandle.Release(); + + if (_eventGroup != null) + _eventGroup.RemoveAllListener(); + + if (_entitySpawner != null) + _entitySpawner.DestroyAll(true); + + if (_roomRoot != null) + GameObject.Destroy(_roomRoot); + + UniWindow.CloseWindow(); + } + + /// + /// 更新房间 + /// + public void UpdateRoom() + { + if (_steps == ESteps.None || _steps == ESteps.GameOver) + return; + + if (_steps == ESteps.Ready) + { + if (_startWaitTimer.Update(Time.deltaTime)) + { + _steps = ESteps.Spawn; + } + } + + if (_steps == ESteps.Spawn) + { + var enemyLocation = _entityLocations[Random.Range(0, 4)]; + Vector3 spawnPosition = new Vector3(Random.Range(-_spawnValues.x, _spawnValues.x), _spawnValues.y, _spawnValues.z); + Quaternion spawnRotation = Quaternion.identity; + + if (enemyLocation == "enemy_ship") + { + // 生成敌人实体 + var handle = _entitySpawner.SpawnSync(enemyLocation, _roomRoot.transform, spawnPosition, spawnRotation); + var entity = handle.GameObj.GetComponent(); + entity.InitEntity(handle); + } + else + { + // 生成小行星实体 + var handle = _entitySpawner.SpawnSync(enemyLocation, _roomRoot.transform, spawnPosition, spawnRotation); + var entity = handle.GameObj.GetComponent(); + entity.InitEntity(handle); + } + + _waveSpawnCount++; + if (_waveSpawnCount >= EnemyCount) + { + _steps = ESteps.WaitWave; + } + else + { + _steps = ESteps.WaitSpawn; + } + } + + if (_steps == ESteps.WaitSpawn) + { + if (_spawnWaitTimer.Update(Time.deltaTime)) + { + _spawnWaitTimer.Reset(); + _steps = ESteps.Spawn; + } + } + + if (_steps == ESteps.WaitWave) + { + if (_waveWaitTimer.Update(Time.deltaTime)) + { + _waveWaitTimer.Reset(); + _waveSpawnCount = 0; + _steps = ESteps.Spawn; + } + } + } + + /// + /// 加载房间 + /// + public IEnumerator LoadRoom() + { + // 创建房间根对象 + _roomRoot = new GameObject("BattleRoom"); + + // 加载背景音乐 + _musicHandle = YooAssets.LoadAssetAsync("music_background"); + yield return _musicHandle; + + // 播放背景音乐 + var audioSource = _roomRoot.AddComponent(); + audioSource.loop = true; + audioSource.clip = _musicHandle.AssetObject as AudioClip; + audioSource.Play(); + + // 创建游戏对象发生器 + _entitySpawner = UniPooling.CreateSpawner("DefaultPackage"); + + // 创建游戏对象池 + yield return _entitySpawner.CreateGameObjectPoolAsync("player_ship"); + yield return _entitySpawner.CreateGameObjectPoolAsync("player_bullet"); + yield return _entitySpawner.CreateGameObjectPoolAsync("enemy_ship"); + yield return _entitySpawner.CreateGameObjectPoolAsync("enemy_bullet"); + yield return _entitySpawner.CreateGameObjectPoolAsync("asteroid01"); + yield return _entitySpawner.CreateGameObjectPoolAsync("asteroid02"); + yield return _entitySpawner.CreateGameObjectPoolAsync("asteroid03"); + yield return _entitySpawner.CreateGameObjectPoolAsync("explosion_asteroid"); + yield return _entitySpawner.CreateGameObjectPoolAsync("explosion_enemy"); + yield return _entitySpawner.CreateGameObjectPoolAsync("explosion_player"); + + // 创建玩家实体对象 + var handle = _entitySpawner.SpawnSync("player_ship"); + var entity = handle.GameObj.GetComponent(); + entity.InitEntity(handle); + + // 显示战斗界面 + yield return UniWindow.OpenWindowAsync("UIBattle"); + + // 监听游戏事件 + _eventGroup.AddListener(OnHandleEventMessage); + _eventGroup.AddListener(OnHandleEventMessage); + _eventGroup.AddListener(OnHandleEventMessage); + _eventGroup.AddListener(OnHandleEventMessage); + _eventGroup.AddListener(OnHandleEventMessage); + + _steps = ESteps.Ready; + } + + /// + /// 接收事件 + /// + /// + private void OnHandleEventMessage(IEventMessage message) + { + if (message is BattleEventDefine.PlayerDead) + { + var msg = message as BattleEventDefine.PlayerDead; + + // 创建爆炸效果 + var handle = _entitySpawner.SpawnSync("explosion_player", _roomRoot.transform, msg.Position, msg.Rotation); + var entity = handle.GameObj.GetComponent(); + entity.InitEntity(handle); + + _steps = ESteps.GameOver; + BattleEventDefine.GameOver.SendEventMessage(); + } + else if (message is BattleEventDefine.EnemyDead) + { + var msg = message as BattleEventDefine.EnemyDead; + + // 创建爆炸效果 + var handle = _entitySpawner.SpawnSync("explosion_enemy", _roomRoot.transform, msg.Position, msg.Rotation); + var entity = handle.GameObj.GetComponent(); + entity.InitEntity(handle); + + _totalScore += EnemyScore; + BattleEventDefine.ScoreChange.SendEventMessage(_totalScore); + } + else if (message is BattleEventDefine.AsteroidExplosion) + { + var msg = message as BattleEventDefine.AsteroidExplosion; + + // 创建爆炸效果 + var handle = _entitySpawner.SpawnSync("explosion_asteroid", _roomRoot.transform, msg.Position, msg.Rotation); + var entity = handle.GameObj.GetComponent(); + entity.InitEntity(handle); + + _totalScore += AsteroidScore; + BattleEventDefine.ScoreChange.SendEventMessage(_totalScore); + } + else if (message is BattleEventDefine.PlayerFireBullet) + { + var msg = message as BattleEventDefine.PlayerFireBullet; + + // 创建子弹实体 + var handle = _entitySpawner.SpawnSync("player_bullet", _roomRoot.transform, msg.Position, msg.Rotation); + var entity = handle.GameObj.GetComponent(); + entity.InitEntity(handle); + } + else if (message is BattleEventDefine.EnemyFireBullet) + { + var msg = message as BattleEventDefine.EnemyFireBullet; + + // 创建子弹实体 + var handle = _entitySpawner.SpawnSync("enemy_bullet", _roomRoot.transform, msg.Position, msg.Rotation); + var entity = handle.GameObj.GetComponent(); + entity.InitEntity(handle); + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleRoom.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Room/BattleRoom.cs.meta similarity index 83% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleRoom.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Room/BattleRoom.cs.meta index 731db92..72cdce6 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/BattleRoom.cs.meta +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameLogic/Room/BattleRoom.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 43ab5a1b8ae5c2b4a8995952e7e01f3f +guid: d4dfc5f1cace4e8469e496d83b254ac7 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/EventGroup.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/EventGroup.cs deleted file mode 100644 index 8857b8a..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/EventGroup.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -public class EventGroup -{ - private readonly Dictionary>> _cachedListener = new Dictionary>>(); - - /// - /// 添加一个监听 - /// - public void AddListener(System.Action listener) where TEvent : IEventMessage - { - System.Type eventType = typeof(TEvent); - if (_cachedListener.ContainsKey(eventType) == false) - _cachedListener.Add(eventType, new List>()); - - if (_cachedListener[eventType].Contains(listener) == false) - { - _cachedListener[eventType].Add(listener); - EventManager.AddListener(eventType, listener); - } - else - { - UnityEngine.Debug.LogWarning($"Event listener is exist : {eventType}"); - } - } - - /// - /// 移除所有缓存的监听 - /// - public void RemoveAllListener() - { - foreach (var pair in _cachedListener) - { - System.Type eventType = pair.Key; - for (int i = 0; i < pair.Value.Count; i++) - { - EventManager.RemoveListener(eventType, pair.Value[i]); - } - pair.Value.Clear(); - } - _cachedListener.Clear(); - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/EventManager.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/EventManager.cs deleted file mode 100644 index 3741d3e..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/EventManager.cs +++ /dev/null @@ -1,171 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -/// -/// 事件管理器 -/// -public static class EventManager -{ - private class PostWrapper - { - public int PostFrame; - public int EventID; - public IEventMessage Message; - - public void OnRelease() - { - PostFrame = 0; - EventID = 0; - Message = null; - } - } - - private static readonly Dictionary>> _listeners = new Dictionary>>(1000); - private static readonly List _postWrappers = new List(1000); - - - public static void Update() - { - for (int i = _postWrappers.Count - 1; i >= 0; i--) - { - var wrapper = _postWrappers[i]; - if (UnityEngine.Time.frameCount > wrapper.PostFrame) - { - SendMessage(wrapper.EventID, wrapper.Message); - _postWrappers.RemoveAt(i); - } - } - } - - - /// - /// 添加监听 - /// - public static void AddListener(System.Action listener) where TEvent : IEventMessage - { - AddListener(typeof(TEvent), listener); - } - - /// - /// 添加监听 - /// - public static void AddListener(System.Type eventType, System.Action listener) - { - int eventId = eventType.GetHashCode(); - AddListener(eventId, listener); - } - - /// - /// 添加监听 - /// - public static void AddListener(int eventId, System.Action listener) - { - if (_listeners.ContainsKey(eventId) == false) - _listeners.Add(eventId, new List>()); - if (_listeners[eventId].Contains(listener) == false) - _listeners[eventId].Add(listener); - } - - - /// - /// 移除监听 - /// - public static void RemoveListener(System.Action listener) where TEvent : IEventMessage - { - RemoveListener(typeof(TEvent), listener); - } - - /// - /// 移除监听 - /// - public static void RemoveListener(System.Type eventType, System.Action listener) - { - int eventId = eventType.GetHashCode(); - RemoveListener(eventId, listener); - } - - /// - /// 移除监听 - /// - public static void RemoveListener(int eventId, System.Action listener) - { - if (_listeners.ContainsKey(eventId)) - { - if (_listeners[eventId].Contains(listener)) - _listeners[eventId].Remove(listener); - } - } - - - /// - /// 实时广播事件 - /// - public static void SendMessage(IEventMessage message) - { - int eventId = message.GetType().GetHashCode(); - SendMessage(eventId, message); - } - - /// - /// 实时广播事件 - /// - public static void SendMessage(int eventId, IEventMessage message) - { - if (_listeners.ContainsKey(eventId) == false) - return; - - List> listeners = _listeners[eventId]; - for (int i = listeners.Count - 1; i >= 0; i--) - { - listeners[i].Invoke(message); - } - } - - /// - /// 延迟广播事件 - /// - public static void PostMessage(IEventMessage message) - { - int eventId = message.GetType().GetHashCode(); - PostMessage(eventId, message); - } - - /// - /// 延迟广播事件 - /// - public static void PostMessage(int eventId, IEventMessage message) - { - var wrapper = new PostWrapper(); - wrapper.PostFrame = UnityEngine.Time.frameCount; - wrapper.EventID = eventId; - wrapper.Message = message; - _postWrappers.Add(wrapper); - } - - - /// - /// 清空所有监听 - /// - public static void ClearListeners() - { - foreach (int eventId in _listeners.Keys) - { - _listeners[eventId].Clear(); - } - _listeners.Clear(); - } - - /// - /// 获取监听者总数 - /// - private static int GetAllListenerCount() - { - int count = 0; - foreach (var list in _listeners) - { - count += list.Value.Count; - } - return count; - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/IEventMessage.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/IEventMessage.cs deleted file mode 100644 index ccce464..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/EventManager/IEventMessage.cs +++ /dev/null @@ -1,4 +0,0 @@ - -public interface IEventMessage -{ -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/FsmManager.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/FsmManager.cs deleted file mode 100644 index 7630ad9..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/FsmManager.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -/// -/// 有限状态机 -/// -public static class FsmManager -{ - private static readonly List _nodes = new List(); - private static IFsmNode _curNode; - private static IFsmNode _preNode; - - /// - /// 当前运行的节点名称 - /// - public static string CurrentNodeName - { - get { return _curNode != null ? _curNode.Name : string.Empty; } - } - - /// - /// 之前运行的节点名称 - /// - public static string PreviousNodeName - { - get { return _preNode != null ? _preNode.Name : string.Empty; } - } - - - /// - /// 启动状态机 - /// - /// 入口节点 - public static void Run(string entryNode) - { - _curNode = GetNode(entryNode); - _preNode = GetNode(entryNode); - - if (_curNode != null) - _curNode.OnEnter(); - else - UnityEngine.Debug.LogError($"Not found entry node : {entryNode}"); - } - - /// - /// 更新状态机 - /// - public static void Update() - { - if (_curNode != null) - _curNode.OnUpdate(); - } - - /// - /// 加入一个节点 - /// - public static void AddNode(IFsmNode node) - { - if (node == null) - throw new ArgumentNullException(); - - if (_nodes.Contains(node) == false) - { - _nodes.Add(node); - } - else - { - UnityEngine.Debug.LogWarning($"Node {node.Name} already existed"); - } - } - - /// - /// 转换节点 - /// - public static void Transition(string nodeName) - { - if (string.IsNullOrEmpty(nodeName)) - throw new ArgumentNullException(); - - IFsmNode node = GetNode(nodeName); - if (node == null) - { - UnityEngine.Debug.LogError($"Can not found node {nodeName}"); - return; - } - - UnityEngine.Debug.Log($"FSM change {_curNode.Name} to {node.Name}"); - _preNode = _curNode; - _curNode.OnExit(); - _curNode = node; - _curNode.OnEnter(); - } - - /// - /// 返回到之前的节点 - /// - public static void RevertToPreviousNode() - { - Transition(PreviousNodeName); - } - - private static bool IsContains(string nodeName) - { - for (int i = 0; i < _nodes.Count; i++) - { - if (_nodes[i].Name == nodeName) - return true; - } - return false; - } - private static IFsmNode GetNode(string nodeName) - { - for (int i = 0; i < _nodes.Count; i++) - { - if (_nodes[i].Name == nodeName) - return _nodes[i]; - } - return null; - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/IFsmNode.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/IFsmNode.cs deleted file mode 100644 index fe0086e..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/Manager/FsmManager/IFsmNode.cs +++ /dev/null @@ -1,12 +0,0 @@ - -public interface IFsmNode -{ - /// - /// 节点名称 - /// - string Name { get; } - - void OnEnter(); - void OnUpdate(); - void OnExit(); -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/FileStream.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FileStream.cs similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/FileStream.cs rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FileStream.cs diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/FileStream.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FileStream.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/FileStream.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FileStream.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmClearCache.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmClearCache.cs similarity index 51% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmClearCache.cs rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmClearCache.cs index 1785f9e..68f5aa9 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmClearCache.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmClearCache.cs @@ -1,31 +1,35 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UniFramework.Machine; /// /// 清理未使用的缓存文件 /// -internal class FsmClearCache : IFsmNode +internal class FsmClearCache : IStateNode { - public string Name { private set; get; } = nameof(FsmClearCache); + private StateMachine _machine; - void IFsmNode.OnEnter() + void IStateNode.OnCreate(StateMachine machine) { - Debug.Log("开始清理未使用的缓存文件!"); + _machine = machine; + } + void IStateNode.OnEnter() + { + PatchEventDefine.PatchStatesChange.SendEventMessage("清理未使用的缓存文件!"); var package = YooAsset.YooAssets.GetAssetsPackage("DefaultPackage"); var operation = package.ClearPackageUnusedCacheFilesAsync(); operation.Completed += Operation_Completed; } + void IStateNode.OnUpdate() + { + } + void IStateNode.OnExit() + { + } private void Operation_Completed(YooAsset.AsyncOperationBase obj) { - FsmManager.Transition(nameof(FsmStartGame)); - } - - void IFsmNode.OnUpdate() - { - } - void IFsmNode.OnExit() - { + _machine.ChangeState(); } } \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmClearCache.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmClearCache.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmClearCache.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmClearCache.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmCreateDownloader.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmCreateDownloader.cs new file mode 100644 index 0000000..632e85c --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmCreateDownloader.cs @@ -0,0 +1,56 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Machine; +using UniFramework.Module; +using YooAsset; + +/// +/// 创建文件下载器 +/// +public class FsmCreateDownloader : IStateNode +{ + private StateMachine _machine; + + void IStateNode.OnCreate(StateMachine machine) + { + _machine = machine; + } + void IStateNode.OnEnter() + { + PatchEventDefine.PatchStatesChange.SendEventMessage("创建补丁下载器!"); + UniModule.StartCoroutine(CreateDownloader()); + } + void IStateNode.OnUpdate() + { + } + void IStateNode.OnExit() + { + } + + IEnumerator CreateDownloader() + { + yield return new WaitForSecondsRealtime(0.5f); + + int downloadingMaxNum = 10; + int failedTryAgain = 3; + var downloader = YooAssets.CreatePatchDownloader(downloadingMaxNum, failedTryAgain); + PatchManager.Instance.Downloader = downloader; + + if (downloader.TotalDownloadCount == 0) + { + Debug.Log("没有发现需要下载的资源!"); + _machine.ChangeState(); + } + else + { + Debug.Log($"一共发现了{downloader.TotalDownloadCount}个资源需要更新下载!"); + + // 发现新更新文件后,挂起流程系统 + // 注意:开发者需要在下载前检测磁盘空间不足 + int totalDownloadCount = downloader.TotalDownloadCount; + long totalDownloadBytes = downloader.TotalDownloadBytes; + PatchEventDefine.FoundUpdateFiles.SendEventMessage(totalDownloadCount, totalDownloadBytes); + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmCreateDownloader.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmCreateDownloader.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmCreateDownloader.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmCreateDownloader.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadFiles.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadFiles.cs new file mode 100644 index 0000000..b5c6058 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadFiles.cs @@ -0,0 +1,46 @@ +using System.Collections; +using UnityEngine; +using UniFramework.Machine; +using UniFramework.Module; +using YooAsset; + +/// +/// 下载更新文件 +/// +public class FsmDownloadFiles : IStateNode +{ + private StateMachine _machine; + + void IStateNode.OnCreate(StateMachine machine) + { + _machine = machine; + } + void IStateNode.OnEnter() + { + PatchEventDefine.PatchStatesChange.SendEventMessage("开始下载补丁文件!"); + UniModule.StartCoroutine(BeginDownload()); + } + void IStateNode.OnUpdate() + { + } + void IStateNode.OnExit() + { + } + + private IEnumerator BeginDownload() + { + var downloader = PatchManager.Instance.Downloader; + + // 注册下载回调 + downloader.OnDownloadErrorCallback = PatchEventDefine.WebFileDownloadFailed.SendEventMessage; + downloader.OnDownloadProgressCallback = PatchEventDefine.DownloadProgressUpdate.SendEventMessage; + downloader.BeginDownload(); + yield return downloader; + + // 检测下载结果 + if (downloader.Status != EOperationStatus.Succeed) + yield break; + + _machine.ChangeState(); + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmDownloadFiles.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadFiles.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmDownloadFiles.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadFiles.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadOver.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadOver.cs new file mode 100644 index 0000000..8a886f2 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadOver.cs @@ -0,0 +1,27 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Machine; + +/// +/// 下载完毕 +/// +internal class FsmDownloadOver : IStateNode +{ + private StateMachine _machine; + + void IStateNode.OnCreate(StateMachine machine) + { + _machine = machine; + } + void IStateNode.OnEnter() + { + _machine.ChangeState(); + } + void IStateNode.OnUpdate() + { + } + void IStateNode.OnExit() + { + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadOver.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadOver.cs.meta new file mode 100644 index 0000000..5a73c9b --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmDownloadOver.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c96c57c65f74bb3469dc71b13ef78c84 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmPatchDone.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmPatchDone.cs new file mode 100644 index 0000000..d2c35d5 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmPatchDone.cs @@ -0,0 +1,31 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Machine; +using UniFramework.Module; + +/// +/// 更新完毕 +/// +internal class FsmPatchDone : IStateNode +{ + void IStateNode.OnCreate(StateMachine machine) + { + } + void IStateNode.OnEnter() + { + PatchEventDefine.PatchStatesChange.SendEventMessage("开始游戏!"); + + // 创建游戏管理器 + UniModule.CreateModule(); + + // 开启游戏流程 + GameManager.Instance.Run(); + } + void IStateNode.OnUpdate() + { + } + void IStateNode.OnExit() + { + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmPatchDone.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmPatchDone.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmPatchDone.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmPatchDone.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameBoot.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmPatchInit.cs similarity index 75% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameBoot.cs rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmPatchInit.cs index ebb1292..e9b499b 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/GameBoot.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmPatchInit.cs @@ -1,45 +1,49 @@ using System; -using System.Collections; -using UnityEngine; -using YooAsset; -using Better.StreamingAssets; using System.IO; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Machine; +using UniFramework.Module; +using YooAsset; -public class GameBoot : MonoBehaviour +/// +/// 初始化工作 +/// +internal class FsmPatchInit : IStateNode { - public static GameBoot Instance; + private StateMachine _machine; - public EPlayMode PlayMode = EPlayMode.EditorSimulateMode; - - void Awake() + void IStateNode.OnCreate(StateMachine machine) { - Debug.Log($"资源系统运行模式:{PlayMode}"); - Instance = this; - Application.targetFrameRate = 60; - Application.runInBackground = true; - - DontDestroyOnLoad(this.gameObject); + _machine = machine; } - void Update() + void IStateNode.OnEnter() { - EventManager.Update(); - FsmManager.Update(); - } - - IEnumerator Start() - { - // 初始化BetterStreaming - BetterStreamingAssets.Initialize(); + // 加载更新面板 + var go = Resources.Load("PatchWindow"); + GameObject.Instantiate(go); // 初始化资源系统 - YooAssets.Initialize(); + UniModule.StartCoroutine(InitYooAsset()); + } + void IStateNode.OnUpdate() + { + } + void IStateNode.OnExit() + { + } - // 创建默认的资源包 + private IEnumerator InitYooAsset() + { + var playMode = PatchManager.Instance.PlayMode; + + // 创建默认的资源包 var package = YooAssets.CreateAssetsPackage("DefaultPackage"); YooAssets.SetDefaultAssetsPackage(package); // 编辑器下的模拟模式 - if (PlayMode == EPlayMode.EditorSimulateMode) + if (playMode == EPlayMode.EditorSimulateMode) { var createParameters = new EditorSimulateModeParameters(); createParameters.SimulatePatchManifestPath = EditorSimulateModeHelper.SimulateBuild("DefaultPackage"); @@ -47,7 +51,7 @@ public class GameBoot : MonoBehaviour } // 单机运行模式 - if (PlayMode == EPlayMode.OfflinePlayMode) + if (playMode == EPlayMode.OfflinePlayMode) { var createParameters = new OfflinePlayModeParameters(); createParameters.DecryptionServices = new GameDecryptionServices(); @@ -55,7 +59,7 @@ public class GameBoot : MonoBehaviour } // 联机运行模式 - if (PlayMode == EPlayMode.HostPlayMode) + if (playMode == EPlayMode.HostPlayMode) { var createParameters = new HostPlayModeParameters(); createParameters.DecryptionServices = new GameDecryptionServices(); @@ -65,10 +69,12 @@ public class GameBoot : MonoBehaviour yield return package.InitializeAsync(createParameters); } - // 运行资源更新流程 - PatchManager.Run(); + _machine.ChangeState(); } + /// + /// 获取资源服务器地址 + /// private string GetHostServerURL() { //string hostServerIP = "http://10.0.2.2"; //安卓模拟器地址 @@ -95,7 +101,10 @@ public class GameBoot : MonoBehaviour return $"{hostServerIP}/CDN/PC/{gameVersion}"; #endif } - + + /// + /// 内置文件查询服务类 + /// private class GameQueryServices : IQueryServices { public bool QueryStreamingAssets(string fileName) @@ -105,6 +114,10 @@ public class GameBoot : MonoBehaviour return BetterStreamingAssets.FileExists($"{buildinFolderName}/{fileName}"); } } + + /// + /// 资源文件解密服务类 + /// private class GameDecryptionServices : IDecryptionServices { public ulong LoadFromFileOffset(DecryptFileInfo fileInfo) diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmPatchInit.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmPatchInit.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmPatchInit.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmPatchInit.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmUpdateManifest.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmUpdateManifest.cs new file mode 100644 index 0000000..8b221a7 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmUpdateManifest.cs @@ -0,0 +1,49 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Machine; +using UniFramework.Module; +using YooAsset; + +/// +/// 更新资源清单 +/// +public class FsmUpdateManifest : IStateNode +{ + private StateMachine _machine; + + void IStateNode.OnCreate(StateMachine machine) + { + _machine = machine; + } + void IStateNode.OnEnter() + { + PatchEventDefine.PatchStatesChange.SendEventMessage("更新资源清单!"); + UniModule.StartCoroutine(UpdateManifest()); + } + void IStateNode.OnUpdate() + { + } + void IStateNode.OnExit() + { + } + + private IEnumerator UpdateManifest() + { + yield return new WaitForSecondsRealtime(0.5f); + + var package = YooAssets.GetAssetsPackage("DefaultPackage"); + var operation = package.UpdatePackageManifestAsync(PatchManager.Instance.PackageVersion, 30); + yield return operation; + + if(operation.Status == EOperationStatus.Succeed) + { + _machine.ChangeState(); + } + else + { + Debug.LogWarning(operation.Error); + PatchEventDefine.PatchManifestUpdateFailed.SendEventMessage(); + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmUpdateManifest.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmUpdateManifest.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmUpdateManifest.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmUpdateManifest.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmUpdateVersion.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmUpdateVersion.cs new file mode 100644 index 0000000..8fbb7e3 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmUpdateVersion.cs @@ -0,0 +1,50 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Machine; +using UniFramework.Module; +using YooAsset; + +/// +/// 更新资源版本号 +/// +internal class FsmUpdateVersion : IStateNode +{ + private StateMachine _machine; + + void IStateNode.OnCreate(StateMachine machine) + { + _machine = machine; + } + void IStateNode.OnEnter() + { + PatchEventDefine.PatchStatesChange.SendEventMessage("获取最新的资源版本 !"); + UniModule.StartCoroutine(GetStaticVersion()); + } + void IStateNode.OnUpdate() + { + } + void IStateNode.OnExit() + { + } + + private IEnumerator GetStaticVersion() + { + yield return new WaitForSecondsRealtime(0.5f); + + var package = YooAssets.GetAssetsPackage("DefaultPackage"); + var operation = package.UpdatePackageVersionAsync(30); + yield return operation; + + if (operation.Status == EOperationStatus.Succeed) + { + PatchManager.Instance.PackageVersion = operation.PackageVersion; + _machine.ChangeState(); + } + else + { + Debug.LogWarning(operation.Error); + PatchEventDefine.PackageVersionUpdateFailed.SendEventMessage(); + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmUpdateVersion.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmUpdateVersion.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmUpdateVersion.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmUpdateVersion.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/PatchManager.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/PatchManager.cs new file mode 100644 index 0000000..e57566f --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/PatchManager.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniFramework.Machine; +using UniFramework.Event; +using UniFramework.Module; +using YooAsset; + +public class PatchManager : ModuleSingleton, IModule +{ + /// + /// 运行模式 + /// + public EPlayMode PlayMode { private set; get; } + + /// + /// 包裹的版本信息 + /// + public string PackageVersion { set; get; } + + /// + /// 下载器 + /// + public PatchDownloaderOperation Downloader { set; get; } + + + private bool _isRun = false; + private EventGroup _eventGroup = new EventGroup(); + private StateMachine _machine; + + void IModule.OnCreate(object createParam) + { + } + void IModule.OnDestroy() + { + _eventGroup.RemoveAllListener(); + } + void IModule.OnUpdate() + { + if (_machine != null) + _machine.Update(); + } + + /// + /// 开启流程 + /// + public void Run(EPlayMode playMode) + { + if (_isRun == false) + { + _isRun = true; + PlayMode = playMode; + + // 注册监听事件 + _eventGroup.AddListener(OnHandleEventMessage); + _eventGroup.AddListener(OnHandleEventMessage); + _eventGroup.AddListener(OnHandleEventMessage); + _eventGroup.AddListener(OnHandleEventMessage); + + Debug.Log("开启补丁更新流程..."); + _machine = new StateMachine(this); + _machine.AddNode(); + _machine.AddNode(); + _machine.AddNode(); + _machine.AddNode(); + _machine.AddNode(); + _machine.AddNode(); + _machine.AddNode(); + _machine.AddNode(); + _machine.Run(); + } + else + { + Debug.LogWarning("补丁更新已经正在进行中!"); + } + } + + /// + /// 接收事件 + /// + private void OnHandleEventMessage(IEventMessage message) + { + if (message is UserEventDefine.UserBeginDownloadWebFiles) + { + _machine.ChangeState(); + } + else if (message is UserEventDefine.UserTryUpdatePackageVersion) + { + _machine.ChangeState(); + } + else if (message is UserEventDefine.UserTryUpdatePatchManifest) + { + _machine.ChangeState(); + } + else if (message is UserEventDefine.UserTryDownloadWebFiles) + { + _machine.ChangeState(); + } + else + { + throw new System.NotImplementedException($"{message.GetType()}"); + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchManager.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/PatchManager.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchManager.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/PatchManager.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchWindow.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/PatchWindow.cs similarity index 58% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchWindow.cs rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/PatchWindow.cs index 256f01f..e2778f2 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchWindow.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/PatchWindow.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; +using UniFramework.Event; public class PatchWindow : MonoBehaviour { @@ -69,12 +70,12 @@ public class PatchWindow : MonoBehaviour _messageBoxObj = transform.Find("UIWindow/MessgeBox").gameObject; _messageBoxObj.SetActive(false); - _eventGroup.AddListener(OnHandleEvent); - _eventGroup.AddListener(OnHandleEvent); - _eventGroup.AddListener(OnHandleEvent); - _eventGroup.AddListener(OnHandleEvent); - _eventGroup.AddListener(OnHandleEvent); - _eventGroup.AddListener(OnHandleEvent); + _eventGroup.AddListener(OnHandleEventMessage); + _eventGroup.AddListener(OnHandleEventMessage); + _eventGroup.AddListener(OnHandleEventMessage); + _eventGroup.AddListener(OnHandleEventMessage); + _eventGroup.AddListener(OnHandleEventMessage); + _eventGroup.AddListener(OnHandleEventMessage); } void OnDestroy() { @@ -84,72 +85,61 @@ public class PatchWindow : MonoBehaviour /// /// 接收事件 /// - private void OnHandleEvent(IEventMessage msg) + private void OnHandleEventMessage(IEventMessage message) { - if (msg is PatchEventDefine.PatchStatesChange) + if (message is PatchEventDefine.PatchStatesChange) { - var message = msg as PatchEventDefine.PatchStatesChange; - if (message.CurrentStates == EPatchStates.UpdateStaticVersion) - _tips.text = "Update static version."; - else if (message.CurrentStates == EPatchStates.UpdateManifest) - _tips.text = "Update patch manifest."; - else if (message.CurrentStates == EPatchStates.CreateDownloader) - _tips.text = "Check download contents."; - else if (message.CurrentStates == EPatchStates.DownloadWebFiles) - _tips.text = "Downloading patch files."; - else if (message.CurrentStates == EPatchStates.PatchDone) - _tips.text = "Welcome to game world !"; - else - throw new NotImplementedException(message.CurrentStates.ToString()); + var msg = message as PatchEventDefine.PatchStatesChange; + _tips.text = msg.Tips; } - else if (msg is PatchEventDefine.FoundUpdateFiles) + else if (message is PatchEventDefine.FoundUpdateFiles) { - var message = msg as PatchEventDefine.FoundUpdateFiles; + var msg = message as PatchEventDefine.FoundUpdateFiles; System.Action callback = () => { - PatchManager.HandleOperation(EPatchOperation.BeginDownloadWebFiles); + UserEventDefine.UserBeginDownloadWebFiles.SendEventMessage(); }; - float sizeMB = message.TotalSizeBytes / 1048576f; + float sizeMB = msg.TotalSizeBytes / 1048576f; sizeMB = Mathf.Clamp(sizeMB, 0.1f, float.MaxValue); string totalSizeMB = sizeMB.ToString("f1"); - ShowMessageBox($"Found update patch files, Total count {message.TotalCount} Total szie {totalSizeMB}MB", callback); + ShowMessageBox($"Found update patch files, Total count {msg.TotalCount} Total szie {totalSizeMB}MB", callback); } - else if (msg is PatchEventDefine.DownloadProgressUpdate) + else if (message is PatchEventDefine.DownloadProgressUpdate) { - var message = msg as PatchEventDefine.DownloadProgressUpdate; - _slider.value = (float)message.CurrentDownloadCount / message.TotalDownloadCount; - string currentSizeMB = (message.CurrentDownloadSizeBytes / 1048576f).ToString("f1"); - string totalSizeMB = (message.TotalDownloadSizeBytes / 1048576f).ToString("f1"); - _tips.text = $"{message.CurrentDownloadCount}/{message.TotalDownloadCount} {currentSizeMB}MB/{totalSizeMB}MB"; + var msg = message as PatchEventDefine.DownloadProgressUpdate; + _slider.value = (float)msg.CurrentDownloadCount / msg.TotalDownloadCount; + string currentSizeMB = (msg.CurrentDownloadSizeBytes / 1048576f).ToString("f1"); + string totalSizeMB = (msg.TotalDownloadSizeBytes / 1048576f).ToString("f1"); + _tips.text = $"{msg.CurrentDownloadCount}/{msg.TotalDownloadCount} {currentSizeMB}MB/{totalSizeMB}MB"; } - else if (msg is PatchEventDefine.StaticVersionUpdateFailed) + else if (message is PatchEventDefine.PackageVersionUpdateFailed) { System.Action callback = () => { - PatchManager.HandleOperation(EPatchOperation.TryUpdateStaticVersion); + UserEventDefine.UserTryUpdatePackageVersion.SendEventMessage(); }; ShowMessageBox($"Failed to update static version, please check the network status.", callback); } - else if (msg is PatchEventDefine.PatchManifestUpdateFailed) + else if (message is PatchEventDefine.PatchManifestUpdateFailed) { System.Action callback = () => { - PatchManager.HandleOperation(EPatchOperation.TryUpdatePatchManifest); + UserEventDefine.UserTryUpdatePatchManifest.SendEventMessage(); }; ShowMessageBox($"Failed to update patch manifest, please check the network status.", callback); } - else if (msg is PatchEventDefine.WebFileDownloadFailed) + else if (message is PatchEventDefine.WebFileDownloadFailed) { - var message = msg as PatchEventDefine.WebFileDownloadFailed; + var msg = message as PatchEventDefine.WebFileDownloadFailed; System.Action callback = () => { - PatchManager.HandleOperation(EPatchOperation.TryDownloadWebFiles); + UserEventDefine.UserTryDownloadWebFiles.SendEventMessage(); }; - ShowMessageBox($"Failed to download file : {message.FileName}", callback); + ShowMessageBox($"Failed to download file : {msg.FileName}", callback); } else { - throw new System.NotImplementedException($"{msg.GetType()}"); + throw new System.NotImplementedException($"{message.GetType()}"); } } diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchWindow.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/PatchWindow.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchWindow.cs.meta rename to Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/PatchWindow.cs.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchOperation.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchOperation.cs deleted file mode 100644 index 2462829..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchOperation.cs +++ /dev/null @@ -1,26 +0,0 @@ - -/// -/// 用户层反馈的操作方式 -/// -public enum EPatchOperation -{ - /// - /// 开始下载网络文件 - /// - BeginDownloadWebFiles, - - /// - /// 尝试再次更新静态版本 - /// - TryUpdateStaticVersion, - - /// - /// 尝试再次更新补丁清单 - /// - TryUpdatePatchManifest, - - /// - /// 尝试再次下载网络文件 - /// - TryDownloadWebFiles, -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchOperation.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchOperation.cs.meta deleted file mode 100644 index 9d16e3c..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchOperation.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 219b7f0e5d04432429b5fcb2207fa23b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchStates.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchStates.cs deleted file mode 100644 index 64399e4..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchStates.cs +++ /dev/null @@ -1,31 +0,0 @@ - -/// -/// 补丁系统更新状态 -/// -public enum EPatchStates -{ - /// - /// 更新静态的资源版本 - /// - UpdateStaticVersion, - - /// - /// 更新补丁清单 - /// - UpdateManifest, - - /// - /// 创建下载器 - /// - CreateDownloader, - - /// - /// 下载远端文件 - /// - DownloadWebFiles, - - /// - /// 补丁流程完毕 - /// - PatchDone, -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchStates.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchStates.cs.meta deleted file mode 100644 index b7e0783..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/EPatchStates.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6f1f35b77d2285045b35f588be8f7236 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmCreateDownloader.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmCreateDownloader.cs deleted file mode 100644 index 7737cee..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmCreateDownloader.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using YooAsset; - -/// -/// 创建文件下载器 -/// -public class FsmCreateDownloader : IFsmNode -{ - public string Name { private set; get; } = nameof(FsmCreateDownloader); - - void IFsmNode.OnEnter() - { - Debug.Log("创建补丁下载器!"); - PatchEventDispatcher.SendPatchStepsChangeMsg(EPatchStates.CreateDownloader); - GameBoot.Instance.StartCoroutine(CreateDownloader()); - } - void IFsmNode.OnUpdate() - { - } - void IFsmNode.OnExit() - { - } - - IEnumerator CreateDownloader() - { - yield return new WaitForSecondsRealtime(0.5f); - - int downloadingMaxNum = 10; - int failedTryAgain = 3; - PatchManager.Downloader = YooAssets.CreatePatchDownloader(downloadingMaxNum, failedTryAgain); - if (PatchManager.Downloader.TotalDownloadCount == 0) - { - Debug.Log("没有发现需要下载的资源"); - FsmManager.Transition(nameof(FsmPatchDone)); - } - else - { - Debug.Log($"一共发现了{PatchManager.Downloader.TotalDownloadCount}个资源需要更新下载。"); - - // 发现新更新文件后,挂起流程系统 - // 注意:开发者需要在下载前检测磁盘空间不足 - int totalDownloadCount = PatchManager.Downloader.TotalDownloadCount; - long totalDownloadBytes = PatchManager.Downloader.TotalDownloadBytes; - PatchEventDispatcher.SendFoundUpdateFilesMsg(totalDownloadCount, totalDownloadBytes); - } - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmDownloadFiles.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmDownloadFiles.cs deleted file mode 100644 index fbcacba..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmDownloadFiles.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Collections; -using UnityEngine; -using YooAsset; - -/// -/// 下载更新文件 -/// -public class FsmDownloadFiles : IFsmNode -{ - public string Name { private set; get; } = nameof(FsmDownloadFiles); - - void IFsmNode.OnEnter() - { - Debug.Log("开始下载补丁文件!"); - PatchEventDispatcher.SendPatchStepsChangeMsg(EPatchStates.DownloadWebFiles); - GameBoot.Instance.StartCoroutine(BeginDownload()); - } - void IFsmNode.OnUpdate() - { - } - void IFsmNode.OnExit() - { - } - - private IEnumerator BeginDownload() - { - var downloader = PatchManager.Downloader; - - // 注册下载回调 - downloader.OnDownloadErrorCallback = PatchEventDispatcher.SendWebFileDownloadFailedMsg; - downloader.OnDownloadProgressCallback = PatchEventDispatcher.SendDownloadProgressUpdateMsg; - downloader.BeginDownload(); - yield return downloader; - - // 检测下载结果 - if (downloader.Status != EOperationStatus.Succeed) - yield break; - - FsmManager.Transition(nameof(FsmPatchDone)); - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmPatchDone.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmPatchDone.cs deleted file mode 100644 index c1968c4..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmPatchDone.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -/// -/// 更新完毕 -/// -internal class FsmPatchDone : IFsmNode -{ - public string Name { private set; get; } = nameof(FsmPatchDone); - - void IFsmNode.OnEnter() - { - Debug.Log("补丁流程更新完毕!"); - PatchEventDispatcher.SendPatchStepsChangeMsg(EPatchStates.PatchDone); - FsmManager.Transition(nameof(FsmClearCache)); - } - void IFsmNode.OnUpdate() - { - } - void IFsmNode.OnExit() - { - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmPatchInit.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmPatchInit.cs deleted file mode 100644 index 0f2aec8..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmPatchInit.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -/// -/// 初始化工作 -/// -internal class FsmPatchInit : IFsmNode -{ - public string Name { private set; get; } = nameof(FsmPatchInit); - - void IFsmNode.OnEnter() - { - // 加载更新面板 - var go = Resources.Load("PatchWindow"); - GameObject.Instantiate(go); - - FsmManager.Transition(nameof(FsmUpdateVersion)); - } - void IFsmNode.OnUpdate() - { - } - void IFsmNode.OnExit() - { - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmStartGame.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmStartGame.cs deleted file mode 100644 index 2385c89..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmStartGame.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -/// -/// 开始游戏 -/// -internal class FsmStartGame : IFsmNode -{ - public string Name { private set; get; } = nameof(FsmStartGame); - - void IFsmNode.OnEnter() - { - Debug.Log("开始游戏!"); - YooAsset.YooAssets.LoadSceneAsync("scene_home"); - } - void IFsmNode.OnUpdate() - { - } - void IFsmNode.OnExit() - { - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmStartGame.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmStartGame.cs.meta deleted file mode 100644 index 722b278..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmStartGame.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 1c01a6c3b0dbdaf43ad5e31634eef386 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmUpdateManifest.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmUpdateManifest.cs deleted file mode 100644 index 1cc8ffa..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmUpdateManifest.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using YooAsset; - -/// -/// 更新补丁清单 -/// -public class FsmUpdateManifest : IFsmNode -{ - public string Name { private set; get; } = nameof(FsmUpdateManifest); - - void IFsmNode.OnEnter() - { - Debug.Log("开始更新资源版本清单!"); - PatchEventDispatcher.SendPatchStepsChangeMsg(EPatchStates.UpdateManifest); - GameBoot.Instance.StartCoroutine(UpdateManifest()); - } - void IFsmNode.OnUpdate() - { - } - void IFsmNode.OnExit() - { - } - - private IEnumerator UpdateManifest() - { - yield return new WaitForSecondsRealtime(0.5f); - - var package = YooAssets.GetAssetsPackage("DefaultPackage"); - var operation = package.UpdatePackageManifestAsync(PatchManager.PackageVersion, 30); - yield return operation; - - if(operation.Status == EOperationStatus.Succeed) - { - FsmManager.Transition(nameof(FsmCreateDownloader)); - } - else - { - Debug.LogWarning(operation.Error); - PatchEventDispatcher.SendPatchManifestUpdateFailedMsg(); - } - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmUpdateVersion.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmUpdateVersion.cs deleted file mode 100644 index 8f4bea8..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/FsmNode/FsmUpdateVersion.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using YooAsset; - -/// -/// 更新资源版本号 -/// -internal class FsmUpdateVersion : IFsmNode -{ - public string Name { private set; get; } = nameof(FsmUpdateVersion); - - void IFsmNode.OnEnter() - { - Debug.Log("开始获取资源版本号!"); - PatchEventDispatcher.SendPatchStepsChangeMsg(EPatchStates.UpdateStaticVersion); - GameBoot.Instance.StartCoroutine(GetStaticVersion()); - } - void IFsmNode.OnUpdate() - { - } - void IFsmNode.OnExit() - { - } - - private IEnumerator GetStaticVersion() - { - yield return new WaitForSecondsRealtime(0.5f); - - var package = YooAssets.GetAssetsPackage("DefaultPackage"); - var operation = package.UpdatePackageVersionAsync(30); - yield return operation; - - if (operation.Status == EOperationStatus.Succeed) - { - PatchManager.PackageVersion = operation.PackageVersion; - FsmManager.Transition(nameof(FsmUpdateManifest)); - } - else - { - Debug.LogWarning(operation.Error); - PatchEventDispatcher.SendStaticVersionUpdateFailedMsg(); - } - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDefine.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDefine.cs deleted file mode 100644 index e04b5e2..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDefine.cs +++ /dev/null @@ -1,54 +0,0 @@ - -public class PatchEventDefine -{ - /// - /// 补丁流程步骤改变 - /// - public class PatchStatesChange : IEventMessage - { - public EPatchStates CurrentStates; - } - - /// - /// 发现更新文件 - /// - public class FoundUpdateFiles : IEventMessage - { - public int TotalCount; - public long TotalSizeBytes; - } - - /// - /// 下载进度更新 - /// - public class DownloadProgressUpdate : IEventMessage - { - public int TotalDownloadCount; - public int CurrentDownloadCount; - public long TotalDownloadSizeBytes; - public long CurrentDownloadSizeBytes; - } - - /// - /// 资源版本号更新失败 - /// - public class StaticVersionUpdateFailed : IEventMessage - { - } - - /// - /// 补丁清单更新失败 - /// - public class PatchManifestUpdateFailed : IEventMessage - { - } - - /// - /// 网络文件下载失败 - /// - public class WebFileDownloadFailed : IEventMessage - { - public string FileName; - public string Error; - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDispatcher.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDispatcher.cs deleted file mode 100644 index 3754a3e..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDispatcher.cs +++ /dev/null @@ -1,43 +0,0 @@ - -public static class PatchEventDispatcher -{ - public static void SendPatchStepsChangeMsg(EPatchStates currentStates) - { - PatchEventDefine.PatchStatesChange msg = new PatchEventDefine.PatchStatesChange(); - msg.CurrentStates = currentStates; - EventManager.SendMessage(msg); - } - public static void SendFoundUpdateFilesMsg(int totalCount, long totalSizeBytes) - { - PatchEventDefine.FoundUpdateFiles msg = new PatchEventDefine.FoundUpdateFiles(); - msg.TotalCount = totalCount; - msg.TotalSizeBytes = totalSizeBytes; - EventManager.SendMessage(msg); - } - public static void SendDownloadProgressUpdateMsg(int totalDownloadCount, int currentDownloadCount, long totalDownloadSizeBytes, long currentDownloadSizeBytes) - { - PatchEventDefine.DownloadProgressUpdate msg = new PatchEventDefine.DownloadProgressUpdate(); - msg.TotalDownloadCount = totalDownloadCount; - msg.CurrentDownloadCount = currentDownloadCount; - msg.TotalDownloadSizeBytes = totalDownloadSizeBytes; - msg.CurrentDownloadSizeBytes = currentDownloadSizeBytes; - EventManager.SendMessage(msg); - } - public static void SendStaticVersionUpdateFailedMsg() - { - PatchEventDefine.StaticVersionUpdateFailed msg = new PatchEventDefine.StaticVersionUpdateFailed(); - EventManager.SendMessage(msg); - } - public static void SendPatchManifestUpdateFailedMsg() - { - PatchEventDefine.PatchManifestUpdateFailed msg = new PatchEventDefine.PatchManifestUpdateFailed(); - EventManager.SendMessage(msg); - } - public static void SendWebFileDownloadFailedMsg(string fileName, string error) - { - PatchEventDefine.WebFileDownloadFailed msg = new PatchEventDefine.WebFileDownloadFailed(); - msg.FileName = fileName; - msg.Error = error; - EventManager.SendMessage(msg); - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDispatcher.cs.meta b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDispatcher.cs.meta deleted file mode 100644 index d8e0fba..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchEventDispatcher.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fe1971e74e4881641b59485f977219dc -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchManager.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchManager.cs deleted file mode 100644 index 45ff7ca..0000000 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchUpdater/PatchManager.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using YooAsset; - -public static class PatchManager -{ - private static bool _isRun = false; - - /// - /// 下载器 - /// - public static PatchDownloaderOperation Downloader { set; get; } - - /// - /// 包裹的版本信息 - /// - public static string PackageVersion { set; get; } - - /// - /// 开启初始化流程 - /// - public static void Run() - { - if (_isRun == false) - { - _isRun = true; - - Debug.Log("开启补丁更新流程..."); - - // 注意:按照先后顺序添加流程节点 - FsmManager.AddNode(new FsmPatchInit()); - FsmManager.AddNode(new FsmUpdateVersion()); - FsmManager.AddNode(new FsmUpdateManifest()); - FsmManager.AddNode(new FsmCreateDownloader()); - FsmManager.AddNode(new FsmDownloadFiles()); - FsmManager.AddNode(new FsmPatchDone()); - FsmManager.AddNode(new FsmClearCache()); - FsmManager.AddNode(new FsmStartGame()); - FsmManager.Run(nameof(FsmPatchInit)); - } - else - { - Debug.LogWarning("补丁更新已经正在进行中!"); - } - } - - /// - /// 处理请求操作 - /// - public static void HandleOperation(EPatchOperation operation) - { - if (operation == EPatchOperation.BeginDownloadWebFiles) - { - FsmManager.Transition(nameof(FsmDownloadFiles)); - } - else if(operation == EPatchOperation.TryUpdateStaticVersion) - { - FsmManager.Transition(nameof(FsmUpdateVersion)); - } - else if (operation == EPatchOperation.TryUpdatePatchManifest) - { - FsmManager.Transition(nameof(FsmUpdateManifest)); - } - else if (operation == EPatchOperation.TryDownloadWebFiles) - { - FsmManager.Transition(nameof(FsmCreateDownloader)); - } - else - { - throw new NotImplementedException($"{operation}"); - } - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/UIAboutWindow.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/UIAboutWindow.cs new file mode 100644 index 0000000..417867d --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/UIAboutWindow.cs @@ -0,0 +1,29 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using UniFramework.Window; + +[WindowAttribute(100, false)] +public class UIAboutWindow : UIWindow +{ + public override void OnCreate() + { + var maskBtn = this.transform.Find("mask").GetComponent