update samples

pull/82/head
hevinci 2023-03-09 17:28:40 +08:00
parent c976221cbb
commit 9739fe2b79
19 changed files with 79 additions and 28 deletions

View File

@ -21,7 +21,7 @@ MonoBehaviour:
PackageDesc: PackageDesc:
Groups: Groups:
- GroupName: battle - GroupName: battle
GroupDesc: GroupDesc: "\u6218\u6597"
AssetTags: AssetTags:
ActiveRuleName: EnableGroup ActiveRuleName: EnableGroup
Collectors: Collectors:
@ -50,7 +50,7 @@ MonoBehaviour:
AssetTags: AssetTags:
UserData: UserData:
- GroupName: shader - GroupName: shader
GroupDesc: GroupDesc: "\u7740\u8272\u5668"
AssetTags: AssetTags:
ActiveRuleName: EnableGroup ActiveRuleName: EnableGroup
Collectors: Collectors:
@ -63,7 +63,7 @@ MonoBehaviour:
AssetTags: AssetTags:
UserData: UserData:
- GroupName: scene - GroupName: scene
GroupDesc: GroupDesc: "\u573A\u666F"
AssetTags: AssetTags:
ActiveRuleName: EnableGroup ActiveRuleName: EnableGroup
Collectors: Collectors:
@ -76,7 +76,7 @@ MonoBehaviour:
AssetTags: AssetTags:
UserData: UserData:
- GroupName: ugui - GroupName: ugui
GroupDesc: GroupDesc: "\u9762\u677F"
AssetTags: AssetTags:
ActiveRuleName: EnableGroup ActiveRuleName: EnableGroup
Collectors: Collectors:
@ -104,3 +104,16 @@ MonoBehaviour:
FilterRuleName: CollectAll FilterRuleName: CollectAll
AssetTags: AssetTags:
UserData: 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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1894d23646ddbf8479e579cc03261dde
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1 @@
Powered by YooAsset @tuyoogame

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 66ce1e032fc66694bb3fce32961d78d5
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -14,7 +14,7 @@ GameObject:
- component: {fileID: 8153114547710269446} - component: {fileID: 8153114547710269446}
m_Layer: 0 m_Layer: 0
m_Name: asteroid01 m_Name: asteroid01
m_TagString: Asteroid m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0

View File

@ -93,7 +93,7 @@ GameObject:
- component: {fileID: 6609967452740485438} - component: {fileID: 6609967452740485438}
m_Layer: 0 m_Layer: 0
m_Name: asteroid02 m_Name: asteroid02
m_TagString: Asteroid m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0

View File

@ -93,7 +93,7 @@ GameObject:
- component: {fileID: 4093119317317235419} - component: {fileID: 4093119317317235419}
m_Layer: 0 m_Layer: 0
m_Name: asteroid03 m_Name: asteroid03
m_TagString: Asteroid m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0

View File

@ -14,7 +14,7 @@ GameObject:
- component: {fileID: 7168776728617073029} - component: {fileID: 7168776728617073029}
m_Layer: 0 m_Layer: 0
m_Name: enemy_bullet m_Name: enemy_bullet
m_TagString: EnemyBullet m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0

View File

@ -4714,7 +4714,7 @@ GameObject:
- component: {fileID: 8046716069608073559} - component: {fileID: 8046716069608073559}
m_Layer: 0 m_Layer: 0
m_Name: enemy_ship m_Name: enemy_ship
m_TagString: Enemy m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0

View File

@ -14,7 +14,7 @@ GameObject:
- component: {fileID: 2296800368016434796} - component: {fileID: 2296800368016434796}
m_Layer: 0 m_Layer: 0
m_Name: player_bullet m_Name: player_bullet
m_TagString: PlayerBullet m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0

View File

@ -9481,7 +9481,7 @@ GameObject:
- component: {fileID: 5342208951388308754} - component: {fileID: 5342208951388308754}
m_Layer: 0 m_Layer: 0
m_Name: player_ship m_Name: player_ship
m_TagString: Player m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0

View File

@ -129,7 +129,7 @@ GameObject:
- component: {fileID: 37} - component: {fileID: 37}
m_Layer: 0 m_Layer: 0
m_Name: Boundary m_Name: Boundary
m_TagString: Boundary m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
@ -10999,7 +10999,7 @@ GameObject:
- component: {fileID: 1691764579} - component: {fileID: 1691764579}
m_Layer: 0 m_Layer: 0
m_Name: BoundaryWorld m_Name: BoundaryWorld
m_TagString: Boundary m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0

View File

@ -66,7 +66,7 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: 8297a2bf97dbbba468bd2518d003a876, type: 3} m_Font: {fileID: 12800000, guid: 8297a2bf97dbbba468bd2518d003a876, type: 3}
m_FontSize: 28 m_FontSize: 22
m_FontStyle: 0 m_FontStyle: 0
m_BestFit: 0 m_BestFit: 0
m_MinSize: 2 m_MinSize: 2
@ -77,7 +77,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0 m_HorizontalOverflow: 0
m_VerticalOverflow: 0 m_VerticalOverflow: 0
m_LineSpacing: 1 m_LineSpacing: 1
m_Text: Powered by YooAsset m_Text:
--- !u!1 &4142826567245113227 --- !u!1 &4142826567245113227
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -25,7 +25,8 @@ public class EntityAsteroid : MonoBehaviour
} }
void OnTriggerEnter(Collider other) 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); BattleEventDefine.AsteroidExplosion.SendEventMessage(this.transform.position, this.transform.rotation);
_handle.Restore(); _handle.Restore();
@ -34,7 +35,8 @@ public class EntityAsteroid : MonoBehaviour
} }
void OnTriggerExit(Collider other) void OnTriggerExit(Collider other)
{ {
if (other.CompareTag("Boundary")) var name = other.gameObject.name;
if (name.StartsWith("Boundary"))
{ {
_handle.Restore(); _handle.Restore();
_handle = null; _handle = null;

View File

@ -19,25 +19,27 @@ public class EntityBullet : MonoBehaviour
void Awake() void Awake()
{ {
_rigidbody = this.transform.GetComponent<Rigidbody>(); _rigidbody = this.transform.GetComponent<Rigidbody>();
} }
void OnTriggerEnter(Collider other) void OnTriggerEnter(Collider other)
{ {
if (other.CompareTag("Boundary")) var name = other.gameObject.name;
if (name.StartsWith("Boundary"))
return; 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.Restore();
_handle = null; _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.Restore();
_handle = null; _handle = null;
@ -46,7 +48,8 @@ public class EntityBullet : MonoBehaviour
} }
void OnTriggerExit(Collider other) void OnTriggerExit(Collider other)
{ {
if (other.CompareTag("Boundary")) var name = other.gameObject.name;
if (name.StartsWith("Boundary"))
{ {
_handle.Restore(); _handle.Restore();
_handle = null; _handle = null;

View File

@ -68,7 +68,8 @@ public class EntityEnemy : MonoBehaviour
} }
void OnTriggerEnter(Collider other) 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); BattleEventDefine.EnemyDead.SendEventMessage(this.transform.position, this.transform.rotation);
_handle.Restore(); _handle.Restore();
@ -77,7 +78,8 @@ public class EntityEnemy : MonoBehaviour
} }
void OnTriggerExit(Collider other) void OnTriggerExit(Collider other)
{ {
if (other.CompareTag("Boundary")) var name = other.gameObject.name;
if (name.StartsWith("Boundary"))
{ {
_handle.Restore(); _handle.Restore();
_handle = null; _handle = null;

View File

@ -54,7 +54,8 @@ public class EntityPlayer : MonoBehaviour
} }
void OnTriggerEnter(Collider other) 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); BattleEventDefine.PlayerDead.SendEventMessage(this.transform.position, this.transform.rotation);
_handle.Restore(); _handle.Restore();

View File

@ -142,7 +142,7 @@ internal class FsmInitialize : IStateNode
throw new NotImplementedException(); throw new NotImplementedException();
} }
public FileStream LoadFromStream(DecryptFileInfo fileInfo) public Stream LoadFromStream(DecryptFileInfo fileInfo)
{ {
BundleStream bundleStream = new BundleStream(fileInfo.FilePath, FileMode.Open); BundleStream bundleStream = new BundleStream(fileInfo.FilePath, FileMode.Open);
return bundleStream; return bundleStream;

View File

@ -3,17 +3,26 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using UniFramework.Window; using UniFramework.Window;
using YooAsset;
[WindowAttribute(100, false)] [WindowAttribute(100, false)]
public class UIAboutWindow : UIWindow public class UIAboutWindow : UIWindow
{ {
private Text _info;
private RawFileOperationHandle _handle;
public override void OnCreate() public override void OnCreate()
{ {
var maskBtn = this.transform.Find("mask").GetComponent<Button>(); var maskBtn = this.transform.Find("mask").GetComponent<Button>();
maskBtn.onClick.AddListener(OnClicMaskBtn); maskBtn.onClick.AddListener(OnClicMaskBtn);
_info = this.transform.Find("bg/info").GetComponent<Text>();
_handle = YooAssets.LoadRawFileAsync("about");
_handle.Completed += _handle_Completed;
} }
public override void OnDestroy() public override void OnDestroy()
{ {
_handle.Release();
} }
public override void OnRefresh() public override void OnRefresh()
{ {
@ -22,6 +31,11 @@ public class UIAboutWindow : UIWindow
{ {
} }
private void _handle_Completed(RawFileOperationHandle obj)
{
_info.text = _handle.GetRawFileText();
}
private void OnClicMaskBtn() private void OnClicMaskBtn()
{ {
UniWindow.CloseWindow<UIAboutWindow>(); UniWindow.CloseWindow<UIAboutWindow>();