From 9739fe2b79e2729b00042f139a80721036eaea62 Mon Sep 17 00:00:00 2001 From: hevinci Date: Thu, 9 Mar 2023 17:28:40 +0800 Subject: [PATCH] update samples --- .../AssetBundleCollectorSetting.asset | 21 +++++++++++++++---- .../Space Shooter/GameRes/Config.meta | 8 +++++++ .../Space Shooter/GameRes/Config/about.txt | 1 + .../GameRes/Config/about.txt.meta | 7 +++++++ .../GameRes/Entity/asteroid01.prefab | 2 +- .../GameRes/Entity/asteroid02.prefab | 2 +- .../GameRes/Entity/asteroid03.prefab | 2 +- .../GameRes/Entity/enemy_bullet.prefab | 2 +- .../GameRes/Entity/enemy_ship.prefab | 2 +- .../GameRes/Entity/player_bullet.prefab | 2 +- .../GameRes/Entity/player_ship.prefab | 2 +- .../GameRes/Scene/scene_battle.unity | 4 ++-- .../GameRes/UIPanel/UIAbout.prefab | 4 ++-- .../BattleLogic/Entity/EntityAsteroid.cs | 6 ++++-- .../BattleLogic/Entity/EntityBullet.cs | 17 ++++++++------- .../Runtime/BattleLogic/Entity/EntityEnemy.cs | 6 ++++-- .../BattleLogic/Entity/EntityPlayer.cs | 3 ++- .../PatchLogic/FsmNode/FsmInitialize.cs | 2 +- .../Runtime/UIWindow/UIAboutWindow.cs | 14 +++++++++++++ 19 files changed, 79 insertions(+), 28 deletions(-) create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameRes/Config.meta create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameRes/Config/about.txt create mode 100644 Assets/YooAsset/Samples~/Space Shooter/GameRes/Config/about.txt.meta diff --git a/Assets/YooAsset/Samples~/Space Shooter/AssetSetting/AssetBundleCollectorSetting.asset b/Assets/YooAsset/Samples~/Space Shooter/AssetSetting/AssetBundleCollectorSetting.asset index de2414d..43f4a45 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/AssetSetting/AssetBundleCollectorSetting.asset +++ b/Assets/YooAsset/Samples~/Space Shooter/AssetSetting/AssetBundleCollectorSetting.asset @@ -21,7 +21,7 @@ MonoBehaviour: PackageDesc: Groups: - GroupName: battle - GroupDesc: + GroupDesc: "\u6218\u6597" AssetTags: ActiveRuleName: EnableGroup Collectors: @@ -50,7 +50,7 @@ MonoBehaviour: AssetTags: UserData: - GroupName: shader - GroupDesc: + GroupDesc: "\u7740\u8272\u5668" AssetTags: ActiveRuleName: EnableGroup Collectors: @@ -63,7 +63,7 @@ MonoBehaviour: AssetTags: UserData: - GroupName: scene - GroupDesc: + GroupDesc: "\u573A\u666F" AssetTags: ActiveRuleName: EnableGroup Collectors: @@ -76,7 +76,7 @@ MonoBehaviour: AssetTags: UserData: - GroupName: ugui - GroupDesc: + GroupDesc: "\u9762\u677F" AssetTags: ActiveRuleName: EnableGroup Collectors: @@ -104,3 +104,16 @@ MonoBehaviour: FilterRuleName: CollectAll AssetTags: UserData: + - GroupName: config + GroupDesc: "\u914D\u7F6E\u8868" + AssetTags: + ActiveRuleName: EnableGroup + Collectors: + - CollectPath: Assets/Samples/Space Shooter/GameRes/Config + CollectorGUID: 1894d23646ddbf8479e579cc03261dde + CollectorType: 0 + AddressRuleName: AddressByFileName + PackRuleName: PackRawFile + FilterRuleName: CollectAll + AssetTags: + UserData: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Config.meta b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Config.meta new file mode 100644 index 0000000..2df7e53 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Config.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1894d23646ddbf8479e579cc03261dde +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Config/about.txt b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Config/about.txt new file mode 100644 index 0000000..338f656 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Config/about.txt @@ -0,0 +1 @@ +Powered by YooAsset @tuyoogame \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Config/about.txt.meta b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Config/about.txt.meta new file mode 100644 index 0000000..2863db9 --- /dev/null +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Config/about.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 66ce1e032fc66694bb3fce32961d78d5 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/asteroid01.prefab b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/asteroid01.prefab index 0bf0c2c..f0843c1 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/asteroid01.prefab +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/asteroid01.prefab @@ -14,7 +14,7 @@ GameObject: - component: {fileID: 8153114547710269446} m_Layer: 0 m_Name: asteroid01 - m_TagString: Asteroid + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/asteroid02.prefab b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/asteroid02.prefab index fc1428e..24e4bc6 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/asteroid02.prefab +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/asteroid02.prefab @@ -93,7 +93,7 @@ GameObject: - component: {fileID: 6609967452740485438} m_Layer: 0 m_Name: asteroid02 - m_TagString: Asteroid + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/asteroid03.prefab b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/asteroid03.prefab index ba87ae4..7ce52f1 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/asteroid03.prefab +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/asteroid03.prefab @@ -93,7 +93,7 @@ GameObject: - component: {fileID: 4093119317317235419} m_Layer: 0 m_Name: asteroid03 - m_TagString: Asteroid + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/enemy_bullet.prefab b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/enemy_bullet.prefab index 0f4c048..4dac0c1 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/enemy_bullet.prefab +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/enemy_bullet.prefab @@ -14,7 +14,7 @@ GameObject: - component: {fileID: 7168776728617073029} m_Layer: 0 m_Name: enemy_bullet - m_TagString: EnemyBullet + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/enemy_ship.prefab b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/enemy_ship.prefab index 5da204b..b1638a0 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/enemy_ship.prefab +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/enemy_ship.prefab @@ -4714,7 +4714,7 @@ GameObject: - component: {fileID: 8046716069608073559} m_Layer: 0 m_Name: enemy_ship - m_TagString: Enemy + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/player_bullet.prefab b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/player_bullet.prefab index f04fabe..76c943b 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/player_bullet.prefab +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/player_bullet.prefab @@ -14,7 +14,7 @@ GameObject: - component: {fileID: 2296800368016434796} m_Layer: 0 m_Name: player_bullet - m_TagString: PlayerBullet + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/player_ship.prefab b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/player_ship.prefab index ca549e8..951800b 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/player_ship.prefab +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Entity/player_ship.prefab @@ -9481,7 +9481,7 @@ GameObject: - component: {fileID: 5342208951388308754} m_Layer: 0 m_Name: player_ship - m_TagString: Player + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_battle.unity b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_battle.unity index 0ee24e7..f7f063b 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_battle.unity +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/Scene/scene_battle.unity @@ -129,7 +129,7 @@ GameObject: - component: {fileID: 37} m_Layer: 0 m_Name: Boundary - m_TagString: Boundary + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -10999,7 +10999,7 @@ GameObject: - component: {fileID: 1691764579} m_Layer: 0 m_Name: BoundaryWorld - m_TagString: Boundary + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIAbout.prefab b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIAbout.prefab index 5a88831..bd2ce45 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIAbout.prefab +++ b/Assets/YooAsset/Samples~/Space Shooter/GameRes/UIPanel/UIAbout.prefab @@ -66,7 +66,7 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 12800000, guid: 8297a2bf97dbbba468bd2518d003a876, type: 3} - m_FontSize: 28 + m_FontSize: 22 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 2 @@ -77,7 +77,7 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: Powered by YooAsset + m_Text: --- !u!1 &4142826567245113227 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityAsteroid.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityAsteroid.cs index 8e4d8e6..289c30f 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityAsteroid.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityAsteroid.cs @@ -25,7 +25,8 @@ public class EntityAsteroid : MonoBehaviour } void OnTriggerEnter(Collider other) { - if (other.CompareTag("PlayerBullet")) + var name = other.gameObject.name; + if (name.StartsWith("player")) { BattleEventDefine.AsteroidExplosion.SendEventMessage(this.transform.position, this.transform.rotation); _handle.Restore(); @@ -34,7 +35,8 @@ public class EntityAsteroid : MonoBehaviour } void OnTriggerExit(Collider other) { - if (other.CompareTag("Boundary")) + var name = other.gameObject.name; + if (name.StartsWith("Boundary")) { _handle.Restore(); _handle = null; diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityBullet.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityBullet.cs index dc68fec..d94babe 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityBullet.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityBullet.cs @@ -19,25 +19,27 @@ public class EntityBullet : MonoBehaviour void Awake() { - _rigidbody = this.transform.GetComponent(); + _rigidbody = this.transform.GetComponent(); } void OnTriggerEnter(Collider other) { - if (other.CompareTag("Boundary")) + var name = other.gameObject.name; + if (name.StartsWith("Boundary")) return; - if (this.gameObject.CompareTag("EnemyBullet")) + var goName = this.gameObject.name; + if (goName.StartsWith("enemy_bullet")) { - if (other.CompareTag("Enemy") == false) + if (name.StartsWith("enemy") == false) { _handle.Restore(); _handle = null; } } - if (this.gameObject.CompareTag("PlayerBullet")) + if (goName.StartsWith("player_bullet")) { - if (other.CompareTag("Player") == false) + if (name.StartsWith("player") == false) { _handle.Restore(); _handle = null; @@ -46,7 +48,8 @@ public class EntityBullet : MonoBehaviour } void OnTriggerExit(Collider other) { - if (other.CompareTag("Boundary")) + var name = other.gameObject.name; + if (name.StartsWith("Boundary")) { _handle.Restore(); _handle = null; diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityEnemy.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityEnemy.cs index 3f72f74..c617f5f 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityEnemy.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityEnemy.cs @@ -68,7 +68,8 @@ public class EntityEnemy : MonoBehaviour } void OnTriggerEnter(Collider other) { - if (other.CompareTag("PlayerBullet")) + var name = other.gameObject.name; + if (name.StartsWith("player")) { BattleEventDefine.EnemyDead.SendEventMessage(this.transform.position, this.transform.rotation); _handle.Restore(); @@ -77,7 +78,8 @@ public class EntityEnemy : MonoBehaviour } void OnTriggerExit(Collider other) { - if (other.CompareTag("Boundary")) + var name = other.gameObject.name; + if (name.StartsWith("Boundary")) { _handle.Restore(); _handle = null; diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityPlayer.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityPlayer.cs index 716218e..209f5cd 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityPlayer.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/BattleLogic/Entity/EntityPlayer.cs @@ -54,7 +54,8 @@ public class EntityPlayer : MonoBehaviour } void OnTriggerEnter(Collider other) { - if (other.CompareTag("Enemy") || other.CompareTag("EnemyBullet") || other.CompareTag("Asteroid")) + var name = other.gameObject.name; + if (name.StartsWith("enemy") || name.StartsWith("asteroid")) { BattleEventDefine.PlayerDead.SendEventMessage(this.transform.position, this.transform.rotation); _handle.Restore(); diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmInitialize.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmInitialize.cs index 0439ac8..719328c 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmInitialize.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/PatchLogic/FsmNode/FsmInitialize.cs @@ -142,7 +142,7 @@ internal class FsmInitialize : IStateNode throw new NotImplementedException(); } - public FileStream LoadFromStream(DecryptFileInfo fileInfo) + public Stream LoadFromStream(DecryptFileInfo fileInfo) { BundleStream bundleStream = new BundleStream(fileInfo.FilePath, FileMode.Open); return bundleStream; diff --git a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/UIAboutWindow.cs b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/UIAboutWindow.cs index 417867d..1dea2c2 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/UIAboutWindow.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/GameScript/Runtime/UIWindow/UIAboutWindow.cs @@ -3,17 +3,26 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UniFramework.Window; +using YooAsset; [WindowAttribute(100, false)] public class UIAboutWindow : UIWindow { + private Text _info; + private RawFileOperationHandle _handle; + public override void OnCreate() { var maskBtn = this.transform.Find("mask").GetComponent