update yooasset2.0

pull/189/head
hevinci 2023-09-20 16:10:37 +08:00
parent 01cf9ccd54
commit 6687d75090
253 changed files with 1859 additions and 9299 deletions

View File

@ -15,8 +15,8 @@ MonoBehaviour:
BuildPipeline: 0
BuildMode: 0
BuildPackage: DefaultPackage
CompressOption: 2
OutputNameStyle: 1
CopyBuildinFileOption: 1
CopyBuildinFileTags:
EncyptionClassName: FileStreamEncryption
CompressOption: 0
FileNameStyle: 1
BuildinFileCopyOption: 1
BuildinFileCopyParams:
EncyptionClassName: EncryptionNone

View File

@ -1,24 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<root Version="2.3">
<Common AutoAddressable="True" UniqueBundleName="False" ShowPackageView="False" ShowEditorAlias="False" />
<Package PackageName="DefaultPackage" PackageDesc="">
<Group GroupName="battle" GroupDesc="战斗" AssetTags="">
<root Version="v2.0.0">
<Common ShowPackageView="True" ShowEditorAlias="False" UniqueBundleName="True" />
<Package PackageName="DefaultPackage" PackageDesc="" AutoAddressable="True" LocationToLower="False" IncludeAssetGUID="False" IgnoreDefaultType="True">
<Group GroupActiveRule="EnableGroup" GroupName="battle" GroupDesc="战斗" AssetTags="">
<Collector CollectPath="Assets/Samples/Space Shooter/GameRes/Effect" CollectGUID="80d76514758554baaa96a9efffe9f3ef" CollectType="MainAssetCollector" AddressRule="AddressByFileName" PackRule="PackDirectory" FilterRule="CollectAll" UserData="" AssetTags="" />
<Collector CollectPath="Assets/Samples/Space Shooter/GameRes/Entity" CollectGUID="4d7c84745db8e884f8020a8c5356e67c" CollectType="MainAssetCollector" AddressRule="AddressByFileName" PackRule="PackDirectory" FilterRule="CollectAll" UserData="" AssetTags="" />
<Collector CollectPath="Assets/Samples/Space Shooter/GameRes/Audio" CollectGUID="306075fbe00b24251b6c889984a7a7d5" CollectType="MainAssetCollector" AddressRule="AddressByFileName" PackRule="PackDirectory" FilterRule="CollectAll" UserData="" AssetTags="" />
</Group>
<Group GroupName="shader" GroupDesc="着色器" AssetTags="">
<Group GroupActiveRule="EnableGroup" GroupName="shader" GroupDesc="着色器" AssetTags="">
<Collector CollectPath="Assets/Samples/Space Shooter/GameArt/ShaderVariants" CollectGUID="00781758c26692e40a9634ddeac838be" CollectType="MainAssetCollector" AddressRule="AddressByFileName" PackRule="PackShaderVariants" FilterRule="CollectShaderVariants" UserData="" AssetTags="" />
</Group>
<Group GroupName="scene" GroupDesc="场景" AssetTags="">
<Group GroupActiveRule="EnableGroup" GroupName="scene" GroupDesc="场景" AssetTags="">
<Collector CollectPath="Assets/Samples/Space Shooter/GameRes/Scene" CollectGUID="6070eae1192f2994887f2983a177d503" CollectType="MainAssetCollector" AddressRule="AddressByFileName" PackRule="PackSeparately" FilterRule="CollectAll" UserData="" AssetTags="" />
</Group>
<Group GroupName="ugui" GroupDesc="面板" AssetTags="">
<Group GroupActiveRule="EnableGroup" GroupName="ugui" GroupDesc="面板" AssetTags="">
<Collector CollectPath="Assets/Samples/Space Shooter/GameRes/UIImage" CollectGUID="30c57db62bb02a24590e7046d3a9e33a" CollectType="MainAssetCollector" AddressRule="AddressByFileName" PackRule="PackDirectory" FilterRule="CollectAll" UserData="" AssetTags="" />
<Collector CollectPath="Assets/Samples/Space Shooter/GameRes/UIPanel" CollectGUID="12d33f33f3a55224c9c747d7bffa1c68" CollectType="MainAssetCollector" AddressRule="AddressByFileName" PackRule="PackSeparately" FilterRule="CollectAll" UserData="" AssetTags="" />
<Collector CollectPath="Assets/Samples/Space Shooter/GameRes/UISprite" CollectGUID="01865ad6f7c806147b6cb37f2d83bc96" CollectType="MainAssetCollector" AddressRule="AddressByFileName" PackRule="PackTopDirectory" FilterRule="CollectAll" UserData="" AssetTags="" />
</Group>
<Group GroupName="config" GroupDesc="配置表" AssetTags="">
</Package>
<Package PackageName="RawPackage" PackageDesc="" AutoAddressable="True" LocationToLower="False" IncludeAssetGUID="False" IgnoreDefaultType="False">
<Group GroupActiveRule="EnableGroup" GroupName="config" GroupDesc="配表" AssetTags="">
<Collector CollectPath="Assets/Samples/Space Shooter/GameRes/Config" CollectGUID="1894d23646ddbf8479e579cc03261dde" CollectType="MainAssetCollector" AddressRule="AddressByFileName" PackRule="PackRawFile" FilterRule="CollectAll" UserData="" AssetTags="" />
</Group>
</Package>

View File

@ -12,13 +12,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 185f6993d5150494d98da50e26cb1c25, type: 3}
m_Name: AssetBundleCollectorSetting
m_EditorClassIdentifier:
ShowPackageView: 0
EnableAddressable: 1
UniqueBundleName: 0
ShowPackageView: 1
ShowEditorAlias: 0
UniqueBundleName: 1
Packages:
- PackageName: DefaultPackage
PackageDesc:
EnableAddressable: 1
LocationToLower: 0
IncludeAssetGUID: 0
IgnoreDefaultType: 1
Groups:
- GroupName: battle
GroupDesc: "\u6218\u6597"
@ -104,8 +107,15 @@ MonoBehaviour:
FilterRuleName: CollectAll
AssetTags:
UserData:
- PackageName: RawPackage
PackageDesc:
EnableAddressable: 1
LocationToLower: 0
IncludeAssetGUID: 0
IgnoreDefaultType: 0
Groups:
- GroupName: config
GroupDesc: "\u914D\u7F6E\u8868"
GroupDesc: "\u914D\u8868"
AssetTags:
ActiveRuleName: EnableGroup
Collectors:

View File

@ -43,7 +43,7 @@ RenderSettings:
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
@ -98,7 +98,7 @@ LightmapSettings:
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
m_LightingSettings: {fileID: 223974226}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
@ -118,9 +118,72 @@ NavMeshSettings:
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!850595691 &223974226
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Settings.lighting
serializedVersion: 3
m_GIWorkflowMode: 1
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 1
m_BakeBackend: 1
m_LightmapMaxSize: 1024
m_BakeResolution: 40
m_Padding: 2
m_TextureCompression: 1
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 2
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_FinalGather: 0
m_FinalGatherRayCount: 256
m_FinalGatherFiltering: 1
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentMIS: 0
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
--- !u!1 &1096367106
GameObject:
m_ObjectHideFlags: 0

View File

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

View File

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

View File

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

View File

@ -81,6 +81,8 @@ NavMeshSettings:
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
@ -463,6 +465,7 @@ MeshRenderer:
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
@ -487,6 +490,7 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!23 &34
MeshRenderer:
m_ObjectHideFlags: 0
@ -502,6 +506,7 @@ MeshRenderer:
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
@ -526,6 +531,7 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &35
MeshFilter:
m_ObjectHideFlags: 0
@ -644,6 +650,7 @@ Light:
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!108 &43
@ -705,6 +712,7 @@ Light:
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!108 &44
@ -766,12 +774,13 @@ Light:
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!157 &46
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
@ -826,7 +835,8 @@ LightmapSettings:
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 0
m_LightingSettings: {fileID: 4890085278179872738, guid: 269b07723b31d484e85034b9691f5d05,
type: 2}
--- !u!198 &47
ParticleSystem:
m_ObjectHideFlags: 0
@ -834,7 +844,7 @@ ParticleSystem:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2}
serializedVersion: 6
serializedVersion: 7
lengthInSec: 100
simulationSpeed: 1
stopAction: 0
@ -3271,6 +3281,62 @@ ParticleSystem:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
LifetimeByEmitterSpeedModule:
enabled: 0
m_Curve:
serializedVersion: 2
minMaxState: 1
scalar: 1
minScalar: 1
maxCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: -0.8
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0.2
inSlope: -0.8
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
minCurve:
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: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Range: {x: 0, y: 1}
ForceModule:
enabled: 0
x:
@ -4701,19 +4767,20 @@ ParticleSystem:
range: {x: 0, y: 1}
CollisionModule:
enabled: 0
serializedVersion: 3
serializedVersion: 4
type: 0
collisionMode: 0
colliderForce: 0
multiplyColliderForceByParticleSize: 0
multiplyColliderForceByParticleSpeed: 0
multiplyColliderForceByCollisionAngle: 1
plane0: {fileID: 0}
plane1: {fileID: 0}
plane2: {fileID: 0}
plane3: {fileID: 0}
plane4: {fileID: 0}
plane5: {fileID: 0}
m_Planes:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_Dampen:
serializedVersion: 2
minMaxState: 0
@ -4887,17 +4954,20 @@ ParticleSystem:
interiorCollisions: 0
TriggerModule:
enabled: 0
collisionShape0: {fileID: 0}
collisionShape1: {fileID: 0}
collisionShape2: {fileID: 0}
collisionShape3: {fileID: 0}
collisionShape4: {fileID: 0}
collisionShape5: {fileID: 0}
serializedVersion: 2
inside: 1
outside: 0
enter: 0
exit: 0
colliderQueryMode: 0
radiusScale: 1
primitives:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
SubModule:
serializedVersion: 2
enabled: 0
@ -5843,7 +5913,7 @@ ParticleSystem:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4}
serializedVersion: 6
serializedVersion: 7
lengthInSec: 100
simulationSpeed: 1
stopAction: 0
@ -8280,6 +8350,62 @@ ParticleSystem:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
LifetimeByEmitterSpeedModule:
enabled: 0
m_Curve:
serializedVersion: 2
minMaxState: 1
scalar: 1
minScalar: 1
maxCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: -0.8
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0.2
inSlope: -0.8
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
minCurve:
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: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Range: {x: 0, y: 1}
ForceModule:
enabled: 0
x:
@ -9710,19 +9836,20 @@ ParticleSystem:
range: {x: 0, y: 1}
CollisionModule:
enabled: 0
serializedVersion: 3
serializedVersion: 4
type: 0
collisionMode: 0
colliderForce: 0
multiplyColliderForceByParticleSize: 0
multiplyColliderForceByParticleSpeed: 0
multiplyColliderForceByCollisionAngle: 1
plane0: {fileID: 0}
plane1: {fileID: 0}
plane2: {fileID: 0}
plane3: {fileID: 0}
plane4: {fileID: 0}
plane5: {fileID: 0}
m_Planes:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_Dampen:
serializedVersion: 2
minMaxState: 0
@ -9896,17 +10023,20 @@ ParticleSystem:
interiorCollisions: 0
TriggerModule:
enabled: 0
collisionShape0: {fileID: 0}
collisionShape1: {fileID: 0}
collisionShape2: {fileID: 0}
collisionShape3: {fileID: 0}
collisionShape4: {fileID: 0}
collisionShape5: {fileID: 0}
serializedVersion: 2
inside: 1
outside: 0
enter: 0
exit: 0
colliderQueryMode: 0
radiusScale: 1
primitives:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
SubModule:
serializedVersion: 2
enabled: 0
@ -10861,6 +10991,7 @@ ParticleSystemRenderer:
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
@ -10903,6 +11034,8 @@ ParticleSystemRenderer:
m_EnableGPUInstancing: 0
m_ApplyActiveColorSpace: 0
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_VertexStreams: 0001030405
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
@ -10925,6 +11058,7 @@ ParticleSystemRenderer:
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
@ -10967,6 +11101,8 @@ ParticleSystemRenderer:
m_EnableGPUInstancing: 0
m_ApplyActiveColorSpace: 0
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_VertexStreams: 0001030405
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
@ -10987,6 +11123,50 @@ MonoBehaviour:
m_EditorClassIdentifier:
ScrollSpeed: -0.25
TileSizeZ: 30
--- !u!1 &1167420185
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1167420186}
- component: {fileID: 1167420187}
m_Layer: 0
m_Name: scene_battle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1167420186
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1167420185}
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!114 &1167420187
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1167420185}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 54061fd8bcab2344e87b0faf0464c179, type: 3}
m_Name:
m_EditorClassIdentifier:
CanvasDesktop: {fileID: 3071470527417989667}
--- !u!1 &1691764578
GameObject:
m_ObjectHideFlags: 0
@ -11031,6 +11211,142 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!223 &1457738501089579944
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1457738501089579947}
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 &1457738501089579945
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1457738501089579947}
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
m_PresetInfoIsWorld: 0
--- !u!114 &1457738501089579946
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1457738501089579947}
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 &1457738501089579947
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1457738501089579951}
- component: {fileID: 1457738501089579944}
- component: {fileID: 1457738501089579945}
- component: {fileID: 1457738501089579946}
m_Layer: 5
m_Name: UICanvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1457738501089579951
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1457738501089579947}
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: 4471021202677412472}
- {fileID: 3071470527417989666}
m_Father: {fileID: 0}
m_RootOrder: 7
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!224 &3071470527417989666
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3071470527417989667}
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: 1457738501089579951}
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 &3071470527417989667
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3071470527417989666}
m_Layer: 5
m_Name: Desktop
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &3992189574601221031
GameObject:
m_ObjectHideFlags: 0
@ -11114,3 +11430,69 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!114 &4471021202677412422
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4471021202677412423}
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!1 &4471021202677412423
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4471021202677412472}
- component: {fileID: 4471021202677412473}
- component: {fileID: 4471021202677412422}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4471021202677412472
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4471021202677412423}
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: 1457738501089579951}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4471021202677412473
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4471021202677412423}
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

View File

@ -0,0 +1,63 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!850595691 &4890085278179872738
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: scene_battleSettings
serializedVersion: 3
m_GIWorkflowMode: 1
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 0
m_BakeBackend: 0
m_LightmapMaxSize: 1024
m_BakeResolution: 50
m_Padding: 2
m_TextureCompression: 0
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 0
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 1
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 1
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_FinalGather: 0
m_FinalGatherRayCount: 1024
m_FinalGatherFiltering: 1
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentMIS: 0
m_PVRFilteringMode: 0
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 269b07723b31d484e85034b9691f5d05
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4890085278179872738
userData:
assetBundleName:
assetBundleVariant:

View File

@ -43,7 +43,7 @@ RenderSettings:
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
serializedVersion: 12
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
@ -98,7 +98,8 @@ LightmapSettings:
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
m_LightingSettings: {fileID: 4890085278179872738, guid: ce19ad4aed57dde42b11449845f36731,
type: 2}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
@ -118,9 +119,257 @@ NavMeshSettings:
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &287634992
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 287634993}
m_Layer: 5
m_Name: Desktop
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &287634993
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 287634992}
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: 690216957}
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 &477624801
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 477624802}
- component: {fileID: 477624803}
m_Layer: 0
m_Name: scene_home
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &477624802
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 477624801}
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: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &477624803
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 477624801}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41730f8e5f2b6e64abc4a03035c61ea5, type: 3}
m_Name:
m_EditorClassIdentifier:
CanvasDesktop: {fileID: 287634992}
--- !u!1 &690216953
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 690216957}
- component: {fileID: 690216956}
- component: {fileID: 690216955}
- component: {fileID: 690216954}
m_Layer: 5
m_Name: UICanvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &690216954
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 690216953}
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 &690216955
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 690216953}
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
m_PresetInfoIsWorld: 0
--- !u!223 &690216956
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 690216953}
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 &690216957
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 690216953}
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: 1645250797}
- {fileID: 287634993}
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 &1645250796
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1645250797}
- component: {fileID: 1645250799}
- component: {fileID: 1645250798}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1645250797
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1645250796}
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: 690216957}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1645250798
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1645250796}
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 &1645250799
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1645250796}
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 &3517166543428106988
Transform:
m_ObjectHideFlags: 0
@ -233,6 +482,7 @@ MeshRenderer:
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
@ -257,6 +507,7 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!23 &6334945670468298450
MeshRenderer:
m_ObjectHideFlags: 0
@ -272,6 +523,7 @@ MeshRenderer:
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
@ -296,6 +548,7 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &6334945670468298451
MeshFilter:
m_ObjectHideFlags: 0

View File

@ -0,0 +1,63 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!850595691 &4890085278179872738
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: scene_homeSettings
serializedVersion: 3
m_GIWorkflowMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 1
m_BakeBackend: 1
m_LightmapMaxSize: 1024
m_BakeResolution: 40
m_Padding: 2
m_TextureCompression: 1
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 2
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_FinalGather: 0
m_FinalGatherRayCount: 256
m_FinalGatherFiltering: 1
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentMIS: 0
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ce19ad4aed57dde42b11449845f36731
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4890085278179872738
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,350 +0,0 @@
%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: 22
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:
--- !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

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 2e0f217747ebd544c82e9ddd1b47525e
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -61,6 +61,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 0.6509434, g: 0.19037023, b: 0.19037023, a: 0.23529412}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -77,7 +78,7 @@ MonoBehaviour:
m_PixelsPerUnitMultiplier: 1
--- !u!95 &351064950
Animator:
serializedVersion: 3
serializedVersion: 5
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -90,10 +91,12 @@ Animator:
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!1 &3460976928793779057
GameObject:
m_ObjectHideFlags: 0
@ -154,6 +157,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -187,7 +191,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &444825205667056620
RectTransform:
m_ObjectHideFlags: 0
@ -273,6 +277,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -301,6 +306,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
@ -341,6 +347,7 @@ GameObject:
- component: {fileID: 4142826567245113224}
- component: {fileID: 4142826567245113225}
- component: {fileID: 446002385128238495}
- component: {fileID: 3593489457066976788}
m_Layer: 5
m_Name: UIBattle
m_TagString: Untagged
@ -408,6 +415,18 @@ MonoBehaviour:
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &3593489457066976788
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
@ -468,6 +487,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -546,6 +566,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -624,6 +645,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -703,6 +725,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -731,6 +754,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
@ -821,6 +845,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -897,6 +922,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -925,6 +951,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
@ -1052,6 +1079,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -1080,6 +1108,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}

View File

@ -1,203 +0,0 @@
%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

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 1700631a871f2da418ca3815faed9394
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,5 +1,121 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2316646212898457076
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8803807611477594100}
- component: {fileID: 3916675095974121819}
- component: {fileID: 7616621098420649627}
m_Layer: 5
m_Name: info
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8803807611477594100
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2316646212898457076}
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: 3440699775385573697}
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 &3916675095974121819
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2316646212898457076}
m_CullTransparentMesh: 0
--- !u!114 &7616621098420649627
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2316646212898457076}
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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 8297a2bf97dbbba468bd2518d003a876, type: 3}
m_FontSize: 22
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 @tuyoogame
--- !u!1 &2430593153801103631
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2430593153801103628}
m_Layer: 5
m_Name: AboutView
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &2430593153801103628
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2430593153801103631}
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: 5972790550119875632}
- {fileID: 3440699775385573697}
m_Father: {fileID: 4142826567245113224}
m_RootOrder: 3
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 &2894094678118443804
GameObject:
m_ObjectHideFlags: 0
@ -60,6 +176,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -140,6 +257,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -168,6 +286,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
@ -208,6 +327,7 @@ GameObject:
- component: {fileID: 4142826567245113224}
- component: {fileID: 4142826567245113225}
- component: {fileID: 446002385128238495}
- component: {fileID: 761597478329303380}
m_Layer: 5
m_Name: UIHome
m_TagString: Untagged
@ -229,6 +349,7 @@ RectTransform:
- {fileID: 3112899034949946423}
- {fileID: 2165109262903650435}
- {fileID: 3005946438868630613}
- {fileID: 2430593153801103628}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -275,6 +396,18 @@ MonoBehaviour:
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &761597478329303380
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
@ -337,6 +470,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -365,6 +499,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
@ -454,6 +589,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -472,6 +608,202 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Start Game
--- !u!1 &5597857539391182649
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5972790550119875632}
- component: {fileID: 7845436718200411364}
- component: {fileID: 8829186808691376901}
- component: {fileID: 7129353201566141962}
m_Layer: 5
m_Name: mask
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5972790550119875632
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5597857539391182649}
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: 2430593153801103628}
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 &7845436718200411364
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5597857539391182649}
m_CullTransparentMesh: 0
--- !u!114 &8829186808691376901
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5597857539391182649}
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: 0.93333334}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
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 &7129353201566141962
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5597857539391182649}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
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: 8829186808691376901}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1 &7207183558982288608
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3440699775385573697}
- component: {fileID: 8234930948123640962}
- component: {fileID: 2692073516022215964}
m_Layer: 5
m_Name: bg
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3440699775385573697
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7207183558982288608}
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: 8803807611477594100}
m_Father: {fileID: 2430593153801103628}
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: 512, y: 256}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8234930948123640962
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7207183558982288608}
m_CullTransparentMesh: 0
--- !u!114 &2692073516022215964
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7207183558982288608}
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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
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
--- !u!1 &7948794194953386984
GameObject:
m_ObjectHideFlags: 0
@ -532,6 +864,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:

View File

@ -60,6 +60,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -134,6 +135,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -163,6 +165,7 @@ GameObject:
- component: {fileID: 4142826567245113224}
- component: {fileID: 4142826567245113225}
- component: {fileID: 446002385128238495}
- component: {fileID: 6653013303473587574}
m_Layer: 5
m_Name: UILoading
m_TagString: Untagged
@ -229,3 +232,15 @@ MonoBehaviour:
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &6653013303473587574
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: f2bfcc4f450a0b94bb7748fb4788630e, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

@ -3,6 +3,9 @@ using System.IO;
using System.Text;
using YooAsset;
/// <summary>
/// 文件偏移加密方式
/// </summary>
public class FileOffsetEncryption : IEncryptionServices
{
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
@ -15,24 +18,26 @@ public class FileOffsetEncryption : IEncryptionServices
Buffer.BlockCopy(fileData, 0, encryptedData, offset, fileData.Length);
EncryptResult result = new EncryptResult();
result.LoadMethod = EBundleLoadMethod.LoadFromFileOffset;
result.Encrypted = true;
result.EncryptedData = encryptedData;
return result;
}
else
{
EncryptResult result = new EncryptResult();
result.LoadMethod = EBundleLoadMethod.Normal;
result.Encrypted = false;
return result;
}
}
}
/// <summary>
/// 文件流加密方式
/// </summary>
public class FileStreamEncryption : IEncryptionServices
{
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
{
// LoadFromStream
if (fileInfo.BundleName.Contains("_gameres_audio"))
{
var fileData = File.ReadAllBytes(fileInfo.FilePath);
@ -42,15 +47,14 @@ public class FileStreamEncryption : IEncryptionServices
}
EncryptResult result = new EncryptResult();
result.LoadMethod = EBundleLoadMethod.LoadFromStream;
result.Encrypted = true;
result.EncryptedData = fileData;
return result;
}
// Normal
else
{
EncryptResult result = new EncryptResult();
result.LoadMethod = EBundleLoadMethod.Normal;
result.Encrypted = false;
return result;
}
}

View File

@ -2,8 +2,6 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Window;
using UniFramework.Pooling;
using UniFramework.Event;
using UniFramework.Utility;
using YooAsset;
@ -24,16 +22,14 @@ public class BattleRoom
{
None,
Ready,
Spawn,
SpawnEnemy,
WaitSpawn,
WaitWave,
GameOver,
}
private EventGroup _eventGroup = new EventGroup();
private Spawner _entitySpawner;
private readonly EventGroup _eventGroup = new EventGroup();
private GameObject _roomRoot;
private AssetOperationHandle _musicHandle;
// 关卡参数
private const int EnemyCount = 10;
@ -49,29 +45,46 @@ public class BattleRoom
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);
private readonly UniTimer _startWaitTimer = UniTimer.CreateOnceTimer(1f);
private readonly UniTimer _spawnWaitTimer = UniTimer.CreateOnceTimer(0.75f);
private readonly UniTimer _waveWaitTimer = UniTimer.CreateOnceTimer(4f);
private readonly List<AssetHandle> _handles = new List<AssetHandle>(1000);
/// <summary>
/// 初始化房间
/// </summary>
public void IntRoom()
{
// 创建房间根对象
_roomRoot = new GameObject("BattleRoom");
// 监听游戏事件
_eventGroup.AddListener<BattleEventDefine.PlayerDead>(OnHandleEventMessage);
_eventGroup.AddListener<BattleEventDefine.EnemyDead>(OnHandleEventMessage);
_eventGroup.AddListener<BattleEventDefine.AsteroidExplosion>(OnHandleEventMessage);
_eventGroup.AddListener<BattleEventDefine.PlayerFireBullet>(OnHandleEventMessage);
_eventGroup.AddListener<BattleEventDefine.EnemyFireBullet>(OnHandleEventMessage);
_steps = ESteps.Ready;
}
/// <summary>
/// 销毁房间
/// </summary>
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<UIBattleWindow>();
foreach(var handle in _handles)
{
handle.Release();
}
_handles.Clear();
}
/// <summary>
@ -86,30 +99,30 @@ public class BattleRoom
{
if (_startWaitTimer.Update(Time.deltaTime))
{
_steps = ESteps.Spawn;
// 生成实体
var handle = YooAssets.LoadAssetAsync<GameObject>("player_ship");
handle.Completed += (AssetHandle handle) =>
{
handle.InstantiateSync(_roomRoot.transform);
};
_handles.Add(handle);
_steps = ESteps.SpawnEnemy;
}
}
if (_steps == ESteps.Spawn)
if (_steps == ESteps.SpawnEnemy)
{
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 = YooAssets.LoadAssetAsync<GameObject>(enemyLocation);
handle.Completed += (AssetHandle handle) =>
{
// 生成敌人实体
var handle = _entitySpawner.SpawnSync(enemyLocation, _roomRoot.transform, spawnPosition, spawnRotation);
var entity = handle.GameObj.GetComponent<EntityEnemy>();
entity.InitEntity(handle);
}
else
{
// 生成小行星实体
var handle = _entitySpawner.SpawnSync(enemyLocation, _roomRoot.transform, spawnPosition, spawnRotation);
var entity = handle.GameObj.GetComponent<EntityAsteroid>();
entity.InitEntity(handle);
}
handle.InstantiateSync(spawnPosition, spawnRotation, _roomRoot.transform);
};
_handles.Add(handle);
_waveSpawnCount++;
if (_waveSpawnCount >= EnemyCount)
@ -127,7 +140,7 @@ public class BattleRoom
if (_spawnWaitTimer.Update(Time.deltaTime))
{
_spawnWaitTimer.Reset();
_steps = ESteps.Spawn;
_steps = ESteps.SpawnEnemy;
}
}
@ -137,62 +150,11 @@ public class BattleRoom
{
_waveWaitTimer.Reset();
_waveSpawnCount = 0;
_steps = ESteps.Spawn;
_steps = ESteps.SpawnEnemy;
}
}
}
/// <summary>
/// 加载房间
/// </summary>
public IEnumerator LoadRoom()
{
// 创建房间根对象
_roomRoot = new GameObject("BattleRoom");
// 加载背景音乐
_musicHandle = YooAssets.LoadAssetAsync<AudioClip>("music_background");
yield return _musicHandle;
// 播放背景音乐
var audioSource = _roomRoot.AddComponent<AudioSource>();
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", _roomRoot.transform);
var entity = handle.GameObj.GetComponent<EntityPlayer>();
entity.InitEntity(handle);
// 显示战斗界面
yield return UniWindow.OpenWindowAsync<UIBattleWindow>("UIBattle");
// 监听游戏事件
_eventGroup.AddListener<BattleEventDefine.PlayerDead>(OnHandleEventMessage);
_eventGroup.AddListener<BattleEventDefine.EnemyDead>(OnHandleEventMessage);
_eventGroup.AddListener<BattleEventDefine.AsteroidExplosion>(OnHandleEventMessage);
_eventGroup.AddListener<BattleEventDefine.PlayerFireBullet>(OnHandleEventMessage);
_eventGroup.AddListener<BattleEventDefine.EnemyFireBullet>(OnHandleEventMessage);
_steps = ESteps.Ready;
}
/// <summary>
/// 接收事件
/// </summary>
@ -204,9 +166,12 @@ public class BattleRoom
var msg = message as BattleEventDefine.PlayerDead;
// 创建爆炸效果
var handle = _entitySpawner.SpawnSync("explosion_player", _roomRoot.transform, msg.Position, msg.Rotation);
var entity = handle.GameObj.GetComponent<EntityEffect>();
entity.InitEntity(handle);
var handle = YooAssets.LoadAssetAsync<GameObject>("explosion_player");
handle.Completed += (AssetHandle handle) =>
{
handle.InstantiateSync(msg.Position, msg.Rotation, _roomRoot.transform);
};
_handles.Add(handle);
_steps = ESteps.GameOver;
BattleEventDefine.GameOver.SendEventMessage();
@ -216,9 +181,12 @@ public class BattleRoom
var msg = message as BattleEventDefine.EnemyDead;
// 创建爆炸效果
var handle = _entitySpawner.SpawnSync("explosion_enemy", _roomRoot.transform, msg.Position, msg.Rotation);
var entity = handle.GameObj.GetComponent<EntityEffect>();
entity.InitEntity(handle);
var handle = YooAssets.LoadAssetAsync<GameObject>("explosion_enemy");
handle.Completed += (AssetHandle handle) =>
{
handle.InstantiateSync(msg.Position, msg.Rotation, _roomRoot.transform);
};
_handles.Add(handle);
_totalScore += EnemyScore;
BattleEventDefine.ScoreChange.SendEventMessage(_totalScore);
@ -228,9 +196,12 @@ public class BattleRoom
var msg = message as BattleEventDefine.AsteroidExplosion;
// 创建爆炸效果
var handle = _entitySpawner.SpawnSync("explosion_asteroid", _roomRoot.transform, msg.Position, msg.Rotation);
var entity = handle.GameObj.GetComponent<EntityEffect>();
entity.InitEntity(handle);
var handle = YooAssets.LoadAssetAsync<GameObject>("explosion_asteroid");
handle.Completed += (AssetHandle handle) =>
{
handle.InstantiateSync(msg.Position, msg.Rotation, _roomRoot.transform);
};
_handles.Add(handle);
_totalScore += AsteroidScore;
BattleEventDefine.ScoreChange.SendEventMessage(_totalScore);
@ -240,18 +211,24 @@ public class BattleRoom
var msg = message as BattleEventDefine.PlayerFireBullet;
// 创建子弹实体
var handle = _entitySpawner.SpawnSync("player_bullet", _roomRoot.transform, msg.Position, msg.Rotation);
var entity = handle.GameObj.GetComponent<EntityBullet>();
entity.InitEntity(handle);
var handle = YooAssets.LoadAssetAsync<GameObject>("player_bullet");
handle.Completed += (AssetHandle handle) =>
{
handle.InstantiateSync(msg.Position, msg.Rotation, _roomRoot.transform);
};
_handles.Add(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<EntityBullet>();
entity.InitEntity(handle);
var handle = YooAssets.LoadAssetAsync<GameObject>("enemy_bullet");
handle.Completed += (AssetHandle handle) =>
{
handle.InstantiateSync(msg.Position, msg.Rotation, _roomRoot.transform);
};
_handles.Add(handle);
}
}
}

View File

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

View File

@ -1,27 +1,19 @@
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<Rigidbody>();
_rigidbody.velocity = this.transform.forward * MoveSpeed;
_rigidbody.angularVelocity = Random.insideUnitSphere * Tumble;
}
void OnTriggerEnter(Collider other)
{
@ -29,8 +21,7 @@ public class EntityAsteroid : MonoBehaviour
if (name.StartsWith("player"))
{
BattleEventDefine.AsteroidExplosion.SendEventMessage(this.transform.position, this.transform.rotation);
_handle.Restore();
_handle = null;
GameObject.Destroy(this.gameObject);
}
}
void OnTriggerExit(Collider other)
@ -38,8 +29,7 @@ public class EntityAsteroid : MonoBehaviour
var name = other.gameObject.name;
if (name.StartsWith("Boundary"))
{
_handle.Restore();
_handle = null;
GameObject.Destroy(this.gameObject);
}
}
}

View File

@ -1,25 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Pooling;
public class EntityBullet : MonoBehaviour
{
public float MoveSpeed = 20f;
public float DelayDestroyTime = 5f;
private SpawnHandle _handle;
private Rigidbody _rigidbody;
public void InitEntity(SpawnHandle handle)
{
_handle = handle;
_rigidbody.velocity = this.transform.forward * MoveSpeed;
}
void Awake()
{
_rigidbody = this.transform.GetComponent<Rigidbody>();
_rigidbody.velocity = this.transform.forward * MoveSpeed;
}
void OnTriggerEnter(Collider other)
{
@ -32,8 +25,7 @@ public class EntityBullet : MonoBehaviour
{
if (name.StartsWith("enemy") == false)
{
_handle.Restore();
_handle = null;
GameObject.Destroy(this.gameObject);
}
}
@ -41,8 +33,7 @@ public class EntityBullet : MonoBehaviour
{
if (name.StartsWith("player") == false)
{
_handle.Restore();
_handle = null;
GameObject.Destroy(this.gameObject);
}
}
}
@ -51,8 +42,7 @@ public class EntityBullet : MonoBehaviour
var name = other.gameObject.name;
if (name.StartsWith("Boundary"))
{
_handle.Restore();
_handle = null;
GameObject.Destroy(this.gameObject);
}
}
}

View File

@ -1,23 +1,16 @@
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)
private void Awake()
{
_handle = handle;
Invoke(nameof(DelayDestroy), DelayDestroyTime);
}
private void DelayDestroy()
{
_handle.Restore();
_handle = null;
GameObject.Destroy(this.gameObject);
}
}

View File

@ -1,7 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Pooling;
using Random = UnityEngine.Random;
public class EntityEnemy : MonoBehaviour
@ -17,7 +16,6 @@ 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;
@ -26,22 +24,18 @@ public class EntityEnemy : MonoBehaviour
private float _targetManeuver;
public void InitEntity(SpawnHandle handle)
{
_handle = handle;
_rigidbody.velocity = this.transform.forward * -5f;
_lastFireTime = Time.time;
_currentSpeed = _rigidbody.velocity.z;
_targetManeuver = 0f;
StartCoroutine(Evade());
}
void Awake()
{
_rigidbody = this.gameObject.GetComponent<Rigidbody>();
_audioSource = this.gameObject.GetComponent<AudioSource>();
_shotSpawn = this.transform.Find("shot_spawn");
_rigidbody.velocity = this.transform.forward * -5f;
_lastFireTime = Time.time;
_currentSpeed = _rigidbody.velocity.z;
_targetManeuver = 0f;
StartCoroutine(Evade());
}
void Update()
{
@ -72,8 +66,7 @@ public class EntityEnemy : MonoBehaviour
if (name.StartsWith("player"))
{
BattleEventDefine.EnemyDead.SendEventMessage(this.transform.position, this.transform.rotation);
_handle.Restore();
_handle = null;
GameObject.Destroy(this.gameObject);
}
}
void OnTriggerExit(Collider other)
@ -81,8 +74,7 @@ public class EntityEnemy : MonoBehaviour
var name = other.gameObject.name;
if (name.StartsWith("Boundary"))
{
_handle.Restore();
_handle = null;
GameObject.Destroy(this.gameObject);
}
}

View File

@ -1,7 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Pooling;
public class EntityPlayer : MonoBehaviour
{
@ -9,17 +8,11 @@ public class EntityPlayer : MonoBehaviour
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(SpawnHandle handle)
{
_handle = handle;
}
void Awake()
{
_rigidbody = this.gameObject.GetComponent<Rigidbody>();
@ -58,8 +51,7 @@ public class EntityPlayer : MonoBehaviour
if (name.StartsWith("enemy") || name.StartsWith("asteroid"))
{
BattleEventDefine.PlayerDead.SendEventMessage(this.transform.position, this.transform.rotation);
_handle.Restore();
_handle = null;
GameObject.Destroy(this.gameObject);
}
}
}

View File

@ -2,7 +2,7 @@
using UnityEngine;
using YooAsset;
public class BhvApplicationQuit : MonoBehaviour
public class ApplicationQuit : MonoBehaviour
{
private void Awake()
{

View File

@ -1,7 +1,7 @@
using System;
using UnityEngine;
public class BhvBackgroundScroller : MonoBehaviour
public class BackgroundScroller : MonoBehaviour
{
public float ScrollSpeed;
public float TileSizeZ;

View File

@ -1,6 +1,8 @@
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Event;
using UniFramework.Singleton;
using YooAsset;
public class Boot : MonoBehaviour
@ -15,23 +17,33 @@ public class Boot : MonoBehaviour
Debug.Log($"资源系统运行模式:{PlayMode}");
Application.targetFrameRate = 60;
Application.runInBackground = true;
DontDestroyOnLoad(this.gameObject);
}
void Start()
IEnumerator Start()
{
// 游戏管理器
GameManager.Instance.Behaviour = this;
// 初始化事件系统
UniEvent.Initalize();
// 初始化单例系统
UniSingleton.Initialize();
// 初始化资源系统
YooAssets.Initialize();
YooAssets.SetOperationSystemMaxTimeSlice(30);
// 创建补丁管理器
UniSingleton.CreateSingleton<PatchManager>();
// 加载更新页面
var go = Resources.Load<GameObject>("PatchWindow");
GameObject.Instantiate(go);
// 开始补丁更新流程
PatchManager.Instance.Run(PlayMode);
PatchOperation operation = new PatchOperation("DefaultPackage", DefaultBuildPipeline.BuiltinBuildPipelineName, PlayMode);
YooAssets.StartOperation(operation);
yield return operation;
// 设置默认的资源包
var gamePackage = YooAssets.GetPackage("DefaultPackage");
YooAssets.SetDefaultPackage(gamePackage);
// 切换到主页面场景
SceneEventDefine.ChangeToHomeScene.SendEventMessage();
}
}

View File

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

View File

@ -1,45 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Pooling;
using UniFramework.Window;
using UniFramework.Machine;
using UniFramework.Singleton;
using YooAsset;
internal class FsmInitGame : IStateNode
{
private StateMachine _machine;
void IStateNode.OnCreate(StateMachine machine)
{
_machine = machine;
}
void IStateNode.OnEnter()
{
UniSingleton.StartCoroutine(Prepare());
}
void IStateNode.OnUpdate()
{
}
void IStateNode.OnExit()
{
}
private IEnumerator Prepare()
{
var handle = YooAssets.LoadAssetAsync<GameObject>("UICanvas");
yield return handle;
var canvas = handle.InstantiateSync();
var desktop = canvas.transform.Find("Desktop").gameObject;
GameObject.DontDestroyOnLoad(canvas);
// 初始化窗口系统
UniWindow.Initalize(desktop);
// 初始化对象池系统
UniPooling.Initalize();
_machine.ChangeState<FsmSceneHome>();
}
}

View File

@ -1,47 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Window;
using UniFramework.Event;
using UniFramework.Machine;
using UniFramework.Singleton;
using YooAsset;
internal class FsmSceneBattle : IStateNode
{
private BattleRoom _battleRoom;
void IStateNode.OnCreate(StateMachine machine)
{
}
void IStateNode.OnEnter()
{
UniSingleton.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();
// 释放资源
var package = YooAssets.GetPackage("DefaultPackage");
package.UnloadUnusedAssets();
}
}

View File

@ -1,38 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Machine;
using UniFramework.Window;
using UniFramework.Singleton;
using YooAsset;
internal class FsmSceneHome : IStateNode
{
private StateMachine _machine;
void IStateNode.OnCreate(StateMachine machine)
{
_machine = machine;
}
void IStateNode.OnEnter()
{
UniSingleton.StartCoroutine(Prepare());
}
void IStateNode.OnUpdate()
{
}
void IStateNode.OnExit()
{
UniWindow.CloseWindow<UIHomeWindow>();
}
private IEnumerator Prepare()
{
yield return YooAssets.LoadSceneAsync("scene_home");
yield return UniWindow.OpenWindowAsync<UIHomeWindow>("UIHome");
// 释放资源
var package = YooAssets.GetPackage("DefaultPackage");
package.UnloadUnusedAssets();
}
}

View File

@ -2,49 +2,42 @@
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Event;
using UniFramework.Machine;
using UniFramework.Singleton;
using YooAsset;
public class GameManager : SingletonInstance<GameManager>, ISingleton
public class GameManager
{
private bool _isRun = false;
private EventGroup _eventGroup = new EventGroup();
private StateMachine _machine;
void ISingleton.OnCreate(object createParam)
private static GameManager _instance;
public static GameManager Instance
{
get
{
if (_instance == null)
_instance = new GameManager();
return _instance;
}
void ISingleton.OnDestroy()
{
_eventGroup.RemoveAllListener();
}
void ISingleton.OnUpdate()
{
if (_machine != null)
_machine.Update();
}
public void Run()
{
if (_isRun == false)
{
_isRun = true;
private readonly EventGroup _eventGroup = new EventGroup();
/// <summary>
/// 协程启动器
/// </summary>
public MonoBehaviour Behaviour;
private GameManager()
{
// 注册监听事件
_eventGroup.AddListener<SceneEventDefine.ChangeToHomeScene>(OnHandleEventMessage);
_eventGroup.AddListener<SceneEventDefine.ChangeToBattleScene>(OnHandleEventMessage);
}
Debug.Log("开启游戏流程...");
_machine = new StateMachine(this);
_machine.AddNode<FsmInitGame>();
_machine.AddNode<FsmSceneHome>();
_machine.AddNode<FsmSceneBattle>();
_machine.Run<FsmInitGame>();
}
else
/// <summary>
/// 开启一个协程
/// </summary>
public void StartCoroutine(IEnumerator enumerator)
{
Debug.LogWarning("补丁更新已经正在进行中!");
}
Behaviour.StartCoroutine(enumerator);
}
/// <summary>
@ -54,11 +47,11 @@ public class GameManager : SingletonInstance<GameManager>, ISingleton
{
if (message is SceneEventDefine.ChangeToHomeScene)
{
_machine.ChangeState<FsmSceneHome>();
YooAssets.LoadSceneAsync("scene_home");
}
else if (message is SceneEventDefine.ChangeToBattleScene)
{
_machine.ChangeState<FsmSceneBattle>();
YooAssets.LoadSceneAsync("scene_battle");
}
}
}

View File

@ -0,0 +1,67 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Event;
using UniFramework.Machine;
using YooAsset;
internal class SceneBattle : MonoBehaviour
{
public GameObject CanvasDesktop;
private AssetHandle _windowHandle;
private AssetHandle _musicHandle;
private BattleRoom _battleRoom;
private IEnumerator Start()
{
// 加载战斗页面
_windowHandle = YooAssets.LoadAssetAsync<GameObject>("UIBattle");
yield return _windowHandle;
_windowHandle.InstantiateSync(CanvasDesktop.transform);
// 加载背景音乐
var package = YooAssets.GetPackage("DefaultPackage");
_musicHandle = package.LoadAssetAsync<AudioClip>("music_background");
yield return _musicHandle;
// 播放背景音乐
var audioSource = this.gameObject.AddComponent<AudioSource>();
audioSource.loop = true;
audioSource.clip = _musicHandle.AssetObject as AudioClip;
audioSource.Play();
_battleRoom = new BattleRoom();
_battleRoom.IntRoom();
}
private void OnDestroy()
{
if (_windowHandle != null)
{
_windowHandle.Release();
_windowHandle = null;
}
if (_musicHandle != null)
{
_musicHandle.Release();
_musicHandle = null;
}
if (_battleRoom != null)
{
_battleRoom.DestroyRoom();
_battleRoom = null;
}
// 切换场景的时候释放资源
var package = YooAssets.GetPackage("DefaultPackage");
package.UnloadUnusedAssets();
}
private void Update()
{
if (_battleRoom != null)
_battleRoom.UpdateRoom();
}
}

View File

@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using YooAsset;
public class SceneHome : MonoBehaviour
{
public GameObject CanvasDesktop;
private AssetHandle _windowHandle;
private IEnumerator Start()
{
// 加载登录页面
_windowHandle = YooAssets.LoadAssetAsync<GameObject>("UIHome");
yield return _windowHandle;
_windowHandle.InstantiateSync(CanvasDesktop.transform);
}
private void OnDestroy()
{
if (_windowHandle != null)
{
_windowHandle.Release();
_windowHandle = null;
}
// 切换场景的时候释放资源
var package = YooAssets.GetPackage("DefaultPackage");
package.UnloadUnusedAssets();
}
}

View File

@ -1,27 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
public class BundleStream : FileStream
{
public const byte KEY = 64;
public BundleStream(string path, FileMode mode, FileAccess access, FileShare share) : base(path, mode, access, share)
{
}
public BundleStream(string path, FileMode mode) : base(path, mode)
{
}
public override int Read(byte[] array, int offset, int count)
{
var index = base.Read(array, offset, count);
for (int i = 0; i < array.Length; i++)
{
array[i] ^= KEY;
}
return index;
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 7da6bc93686626a4cb248691891073ac
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -2,11 +2,12 @@
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Machine;
using YooAsset;
/// <summary>
/// 清理未使用的缓存文件
/// </summary>
internal class FsmClearCache : IStateNode
internal class FsmClearPackageCache : IStateNode
{
private StateMachine _machine;
@ -17,7 +18,8 @@ internal class FsmClearCache : IStateNode
void IStateNode.OnEnter()
{
PatchEventDefine.PatchStatesChange.SendEventMessage("清理未使用的缓存文件!");
var package = YooAsset.YooAssets.GetPackage("DefaultPackage");
var packageName = (string)_machine.GetBlackboardValue("PackageName");
var package = YooAssets.GetPackage(packageName);
var operation = package.ClearUnusedCacheFilesAsync();
operation.Completed += Operation_Completed;
}
@ -30,6 +32,6 @@ internal class FsmClearCache : IStateNode
private void Operation_Completed(YooAsset.AsyncOperationBase obj)
{
_machine.ChangeState<FsmPatchDone>();
_machine.ChangeState<FsmUpdaterDone>();
}
}

View File

@ -2,13 +2,12 @@
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Machine;
using UniFramework.Singleton;
using YooAsset;
/// <summary>
/// 创建文件下载器
/// </summary>
public class FsmCreateDownloader : IStateNode
public class FsmCreatePackageDownloader : IStateNode
{
private StateMachine _machine;
@ -19,7 +18,7 @@ public class FsmCreateDownloader : IStateNode
void IStateNode.OnEnter()
{
PatchEventDefine.PatchStatesChange.SendEventMessage("创建补丁下载器!");
UniSingleton.StartCoroutine(CreateDownloader());
GameManager.Instance.StartCoroutine(CreateDownloader());
}
void IStateNode.OnUpdate()
{
@ -32,21 +31,20 @@ public class FsmCreateDownloader : IStateNode
{
yield return new WaitForSecondsRealtime(0.5f);
var packageName = (string)_machine.GetBlackboardValue("PackageName");
var package = YooAssets.GetPackage(packageName);
int downloadingMaxNum = 10;
int failedTryAgain = 3;
var downloader = YooAssets.CreateResourceDownloader(downloadingMaxNum, failedTryAgain);
PatchManager.Instance.Downloader = downloader;
var downloader = package.CreateResourceDownloader(downloadingMaxNum, failedTryAgain);
_machine.SetBlackboardValue("Downloader", downloader);
if (downloader.TotalDownloadCount == 0)
{
Debug.Log("Not found any download files !");
_machine.ChangeState<FsmDownloadOver>();
_machine.ChangeState<FsmUpdaterDone>();
}
else
{
//A total of 10 files were found that need to be downloaded
Debug.Log($"Found total {downloader.TotalDownloadCount} files that need download ");
// 发现新更新文件后,挂起流程系统
// 注意:开发者需要在下载前检测磁盘空间不足
int totalDownloadCount = downloader.TotalDownloadCount;

View File

@ -1,13 +1,12 @@
using System.Collections;
using UnityEngine;
using UniFramework.Machine;
using UniFramework.Singleton;
using YooAsset;
/// <summary>
/// 下载更新文件
/// </summary>
public class FsmDownloadFiles : IStateNode
public class FsmDownloadPackageFiles : IStateNode
{
private StateMachine _machine;
@ -18,7 +17,7 @@ public class FsmDownloadFiles : IStateNode
void IStateNode.OnEnter()
{
PatchEventDefine.PatchStatesChange.SendEventMessage("开始下载补丁文件!");
UniSingleton.StartCoroutine(BeginDownload());
GameManager.Instance.StartCoroutine(BeginDownload());
}
void IStateNode.OnUpdate()
{
@ -29,9 +28,7 @@ public class FsmDownloadFiles : IStateNode
private IEnumerator BeginDownload()
{
var downloader = PatchManager.Instance.Downloader;
// 注册下载回调
var downloader = (ResourceDownloaderOperation)_machine.GetBlackboardValue("Downloader");
downloader.OnDownloadErrorCallback = PatchEventDefine.WebFileDownloadFailed.SendEventMessage;
downloader.OnDownloadProgressCallback = PatchEventDefine.DownloadProgressUpdate.SendEventMessage;
downloader.BeginDownload();
@ -41,6 +38,6 @@ public class FsmDownloadFiles : IStateNode
if (downloader.Status != EOperationStatus.Succeed)
yield break;
_machine.ChangeState<FsmPatchDone>();
_machine.ChangeState<FsmDownloadPackageOver>();
}
}

View File

@ -6,7 +6,7 @@ using UniFramework.Machine;
/// <summary>
/// 下载完毕
/// </summary>
internal class FsmDownloadOver : IStateNode
internal class FsmDownloadPackageOver : IStateNode
{
private StateMachine _machine;
@ -16,7 +16,7 @@ internal class FsmDownloadOver : IStateNode
}
void IStateNode.OnEnter()
{
_machine.ChangeState<FsmClearCache>();
_machine.ChangeState<FsmClearPackageCache>();
}
void IStateNode.OnUpdate()
{

View File

@ -4,13 +4,12 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Machine;
using UniFramework.Singleton;
using YooAsset;
/// <summary>
/// 初始化资源包
/// </summary>
internal class FsmInitialize : IStateNode
internal class FsmInitializePackage : IStateNode
{
private StateMachine _machine;
@ -21,7 +20,7 @@ internal class FsmInitialize : IStateNode
void IStateNode.OnEnter()
{
PatchEventDefine.PatchStatesChange.SendEventMessage("初始化资源包!");
UniSingleton.StartCoroutine(InitPackage());
GameManager.Instance.StartCoroutine(InitPackage());
}
void IStateNode.OnUpdate()
{
@ -32,25 +31,21 @@ internal class FsmInitialize : IStateNode
private IEnumerator InitPackage()
{
yield return new WaitForSeconds(1f);
var playMode = (EPlayMode)_machine.GetBlackboardValue("PlayMode");
var packageName = (string)_machine.GetBlackboardValue("PackageName");
var buildPipeline = (string)_machine.GetBlackboardValue("BuildPipeline");
var playMode = PatchManager.Instance.PlayMode;
// 创建默认的资源包
string packageName = "DefaultPackage";
// 创建资源包裹类
var package = YooAssets.TryGetPackage(packageName);
if (package == null)
{
package = YooAssets.CreatePackage(packageName);
YooAssets.SetDefaultPackage(package);
}
// 编辑器下的模拟模式
InitializationOperation initializationOperation = null;
if (playMode == EPlayMode.EditorSimulateMode)
{
var createParameters = new EditorSimulateModeParameters();
createParameters.SimulateManifestFilePath = EditorSimulateModeHelper.SimulateBuild(packageName);
createParameters.SimulateManifestFilePath = EditorSimulateModeHelper.SimulateBuild(buildPipeline, packageName);
initializationOperation = package.InitializeAsync(createParameters);
}
@ -58,7 +53,7 @@ internal class FsmInitialize : IStateNode
if (playMode == EPlayMode.OfflinePlayMode)
{
var createParameters = new OfflinePlayModeParameters();
createParameters.DecryptionServices = new GameDecryptionServices();
createParameters.DecryptionServices = new FileStreamDecryption();
initializationOperation = package.InitializeAsync(createParameters);
}
@ -68,9 +63,8 @@ internal class FsmInitialize : IStateNode
string defaultHostServer = GetHostServerURL();
string fallbackHostServer = GetHostServerURL();
var createParameters = new HostPlayModeParameters();
createParameters.DecryptionServices = new GameDecryptionServices();
createParameters.DecryptionServices = new FileStreamDecryption();
createParameters.BuildinQueryServices = new GameQueryServices();
createParameters.DeliveryQueryServices = new DefaultDeliveryQueryServices();
createParameters.RemoteServices = new RemoteServices(defaultHostServer, fallbackHostServer);
initializationOperation = package.InitializeAsync(createParameters);
}
@ -81,22 +75,24 @@ internal class FsmInitialize : IStateNode
string defaultHostServer = GetHostServerURL();
string fallbackHostServer = GetHostServerURL();
var createParameters = new WebPlayModeParameters();
createParameters.DecryptionServices = new GameDecryptionServices();
createParameters.DecryptionServices = new FileStreamDecryption();
createParameters.BuildinQueryServices = new GameQueryServices();
createParameters.RemoteServices = new RemoteServices(defaultHostServer, fallbackHostServer);
initializationOperation = package.InitializeAsync(createParameters);
}
yield return initializationOperation;
if (initializationOperation.Status == EOperationStatus.Succeed)
{
_machine.ChangeState<FsmUpdateVersion>();
}
else
// 如果初始化失败弹出提示界面
if (initializationOperation.Status != EOperationStatus.Succeed)
{
Debug.LogWarning($"{initializationOperation.Error}");
PatchEventDefine.InitializeFailed.SendEventMessage();
}
else
{
_machine.ChangeState<FsmUpdatePackageVersion>();
}
}
/// <summary>
@ -129,7 +125,6 @@ internal class FsmInitialize : IStateNode
#endif
}
/// <summary>
/// 远端资源地址查询服务类
/// </summary>
@ -154,44 +149,91 @@ internal class FsmInitialize : IStateNode
}
/// <summary>
/// 资源文件解密服务
/// 资源文件流加载解密类
/// </summary>
private class GameDecryptionServices : IDecryptionServices
private class FileStreamDecryption : IDecryptionServices
{
public ulong LoadFromFileOffset(DecryptFileInfo fileInfo)
/// <summary>
/// 同步方式获取解密的资源包对象
/// 注意:加载流对象在资源包对象释放的时候会自动释放
/// </summary>
AssetBundle IDecryptionServices.LoadAssetBundle(DecryptFileInfo fileInfo, out Stream managedStream)
{
return 32;
BundleStream bundleStream = new BundleStream(fileInfo.FileLoadPath, FileMode.Open, FileAccess.Read, FileShare.Read);
managedStream = bundleStream;
return AssetBundle.LoadFromStream(bundleStream, fileInfo.ConentCRC, GetManagedReadBufferSize());
}
public byte[] LoadFromMemory(DecryptFileInfo fileInfo)
/// <summary>
/// 异步方式获取解密的资源包对象
/// 注意:加载流对象在资源包对象释放的时候会自动释放
/// </summary>
AssetBundleCreateRequest IDecryptionServices.LoadAssetBundleAsync(DecryptFileInfo fileInfo, out Stream managedStream)
{
throw new NotImplementedException();
BundleStream bundleStream = new BundleStream(fileInfo.FileLoadPath, FileMode.Open, FileAccess.Read, FileShare.Read);
managedStream = bundleStream;
return AssetBundle.LoadFromStreamAsync(bundleStream, fileInfo.ConentCRC, GetManagedReadBufferSize());
}
public Stream LoadFromStream(DecryptFileInfo fileInfo)
{
BundleStream bundleStream = new BundleStream(fileInfo.FilePath, FileMode.Open, FileAccess.Read, FileShare.Read);
return bundleStream;
}
public uint GetManagedReadBufferSize()
private static uint GetManagedReadBufferSize()
{
return 1024;
}
}
/// <summary>
/// 默认的分发资源查询服务
/// 资源文件偏移加载解密
/// </summary>
private class DefaultDeliveryQueryServices : IDeliveryQueryServices
private class FileOffsetDecryption : IDecryptionServices
{
public DeliveryFileInfo GetDeliveryFileInfo(string packageName, string fileName)
/// <summary>
/// 同步方式获取解密的资源包对象
/// 注意:加载流对象在资源包对象释放的时候会自动释放
/// </summary>
AssetBundle IDecryptionServices.LoadAssetBundle(DecryptFileInfo fileInfo, out Stream managedStream)
{
throw new NotImplementedException();
managedStream = null;
return AssetBundle.LoadFromFile(fileInfo.FileLoadPath, fileInfo.ConentCRC, GetFileOffset());
}
public bool QueryDeliveryFiles(string packageName, string fileName)
/// <summary>
/// 异步方式获取解密的资源包对象
/// 注意:加载流对象在资源包对象释放的时候会自动释放
/// </summary>
AssetBundleCreateRequest IDecryptionServices.LoadAssetBundleAsync(DecryptFileInfo fileInfo, out Stream managedStream)
{
return false;
managedStream = null;
return AssetBundle.LoadFromFileAsync(fileInfo.FileLoadPath, fileInfo.ConentCRC, GetFileOffset());
}
private static ulong GetFileOffset()
{
return 32;
}
}
}
/// <summary>
/// 资源文件解密流
/// </summary>
public class BundleStream : FileStream
{
public const byte KEY = 64;
public BundleStream(string path, FileMode mode, FileAccess access, FileShare share) : base(path, mode, access, share)
{
}
public BundleStream(string path, FileMode mode) : base(path, mode)
{
}
public override int Read(byte[] array, int offset, int count)
{
var index = base.Read(array, offset, count);
for (int i = 0; i < array.Length; i++)
{
array[i] ^= KEY;
}
return index;
}
}

View File

@ -1,34 +0,0 @@
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Machine;
using UniFramework.Singleton;
/// <summary>
/// 流程准备工作
/// </summary>
internal class FsmPatchPrepare : IStateNode
{
private StateMachine _machine;
void IStateNode.OnCreate(StateMachine machine)
{
_machine = machine;
}
void IStateNode.OnEnter()
{
// 加载更新面板
var go = Resources.Load<GameObject>("PatchWindow");
GameObject.Instantiate(go);
_machine.ChangeState<FsmInitialize>();
}
void IStateNode.OnUpdate()
{
}
void IStateNode.OnExit()
{
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 8998f67b4187d404eb26190f5cd5ac86
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: b4b6ef49759dcf14d80c5aa2d360f597
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -2,13 +2,12 @@
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Machine;
using UniFramework.Singleton;
using YooAsset;
/// <summary>
/// 更新资源清单
/// </summary>
public class FsmUpdateManifest : IStateNode
public class FsmUpdatePackageManifest : IStateNode
{
private StateMachine _machine;
@ -19,7 +18,7 @@ public class FsmUpdateManifest : IStateNode
void IStateNode.OnEnter()
{
PatchEventDefine.PatchStatesChange.SendEventMessage("更新资源清单!");
UniSingleton.StartCoroutine(UpdateManifest());
GameManager.Instance.StartCoroutine(UpdateManifest());
}
void IStateNode.OnUpdate()
{
@ -32,19 +31,22 @@ public class FsmUpdateManifest : IStateNode
{
yield return new WaitForSecondsRealtime(0.5f);
var packageName = (string)_machine.GetBlackboardValue("PackageName");
var packageVersion = (string)_machine.GetBlackboardValue("PackageVersion");
var package = YooAssets.GetPackage(packageName);
bool savePackageVersion = true;
var package = YooAssets.GetPackage("DefaultPackage");
var operation = package.UpdatePackageManifestAsync(PatchManager.Instance.PackageVersion, savePackageVersion);
var operation = package.UpdatePackageManifestAsync(packageVersion, savePackageVersion);
yield return operation;
if(operation.Status == EOperationStatus.Succeed)
{
_machine.ChangeState<FsmCreateDownloader>();
}
else
if (operation.Status != EOperationStatus.Succeed)
{
Debug.LogWarning(operation.Error);
PatchEventDefine.PatchManifestUpdateFailed.SendEventMessage();
yield break;
}
else
{
_machine.ChangeState<FsmCreatePackageDownloader>();
}
}
}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 35d459ebb0d7dc947b7b62d1f64a412f
guid: 13faaa12de67f5e4db31cd8a44563089
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@ -2,13 +2,12 @@
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Machine;
using UniFramework.Singleton;
using YooAsset;
/// <summary>
/// 更新资源版本号
/// </summary>
internal class FsmUpdateVersion : IStateNode
internal class FsmUpdatePackageVersion : IStateNode
{
private StateMachine _machine;
@ -19,7 +18,7 @@ internal class FsmUpdateVersion : IStateNode
void IStateNode.OnEnter()
{
PatchEventDefine.PatchStatesChange.SendEventMessage("获取最新的资源版本 !");
UniSingleton.StartCoroutine(GetStaticVersion());
GameManager.Instance.StartCoroutine(UpdatePackageVersion());
}
void IStateNode.OnUpdate()
{
@ -28,24 +27,24 @@ internal class FsmUpdateVersion : IStateNode
{
}
private IEnumerator GetStaticVersion()
private IEnumerator UpdatePackageVersion()
{
yield return new WaitForSecondsRealtime(0.5f);
var package = YooAssets.GetPackage("DefaultPackage");
var packageName = (string)_machine.GetBlackboardValue("PackageName");
var package = YooAssets.GetPackage(packageName);
var operation = package.UpdatePackageVersionAsync();
yield return operation;
if (operation.Status == EOperationStatus.Succeed)
{
PatchManager.Instance.PackageVersion = operation.PackageVersion;
Debug.Log($"远端最新版本为: {operation.PackageVersion}");
_machine.ChangeState<FsmUpdateManifest>();
}
else
if (operation.Status != EOperationStatus.Succeed)
{
Debug.LogWarning(operation.Error);
PatchEventDefine.PackageVersionUpdateFailed.SendEventMessage();
}
else
{
_machine.SetBlackboardValue("PackageVersion", operation.PackageVersion);
_machine.ChangeState<FsmUpdatePackageManifest>();
}
}
}

View File

@ -2,25 +2,17 @@
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Machine;
using UniFramework.Singleton;
/// <summary>
/// 流程更新完毕
/// </summary>
internal class FsmPatchDone : IStateNode
internal class FsmUpdaterDone : IStateNode
{
void IStateNode.OnCreate(StateMachine machine)
{
}
void IStateNode.OnEnter()
{
PatchEventDefine.PatchStatesChange.SendEventMessage("开始游戏!");
// 创建游戏管理器
UniSingleton.CreateSingleton<GameManager>();
// 开启游戏流程
GameManager.Instance.Run();
}
void IStateNode.OnUpdate()
{

View File

@ -1,111 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Machine;
using UniFramework.Event;
using UniFramework.Singleton;
using YooAsset;
public class PatchManager : SingletonInstance<PatchManager>, ISingleton
{
/// <summary>
/// 运行模式
/// </summary>
public EPlayMode PlayMode { private set; get; }
/// <summary>
/// 包裹的版本信息
/// </summary>
public string PackageVersion { set; get; }
/// <summary>
/// 下载器
/// </summary>
public ResourceDownloaderOperation Downloader { set; get; }
private bool _isRun = false;
private EventGroup _eventGroup = new EventGroup();
private StateMachine _machine;
void ISingleton.OnCreate(object createParam)
{
}
void ISingleton.OnDestroy()
{
_eventGroup.RemoveAllListener();
}
void ISingleton.OnUpdate()
{
if (_machine != null)
_machine.Update();
}
/// <summary>
/// 开启流程
/// </summary>
public void Run(EPlayMode playMode)
{
if (_isRun == false)
{
_isRun = true;
PlayMode = playMode;
// 注册监听事件
_eventGroup.AddListener<UserEventDefine.UserTryInitialize>(OnHandleEventMessage);
_eventGroup.AddListener<UserEventDefine.UserBeginDownloadWebFiles>(OnHandleEventMessage);
_eventGroup.AddListener<UserEventDefine.UserTryUpdatePackageVersion>(OnHandleEventMessage);
_eventGroup.AddListener<UserEventDefine.UserTryUpdatePatchManifest>(OnHandleEventMessage);
_eventGroup.AddListener<UserEventDefine.UserTryDownloadWebFiles>(OnHandleEventMessage);
Debug.Log("开启补丁更新流程...");
_machine = new StateMachine(this);
_machine.AddNode<FsmPatchPrepare>();
_machine.AddNode<FsmInitialize>();
_machine.AddNode<FsmUpdateVersion>();
_machine.AddNode<FsmUpdateManifest>();
_machine.AddNode<FsmCreateDownloader>();
_machine.AddNode<FsmDownloadFiles>();
_machine.AddNode<FsmDownloadOver>();
_machine.AddNode<FsmClearCache>();
_machine.AddNode<FsmPatchDone>();
_machine.Run<FsmPatchPrepare>();
}
else
{
Debug.LogWarning("补丁更新已经正在进行中!");
}
}
/// <summary>
/// 接收事件
/// </summary>
private void OnHandleEventMessage(IEventMessage message)
{
if (message is UserEventDefine.UserTryInitialize)
{
_machine.ChangeState<FsmInitialize>();
}
else if (message is UserEventDefine.UserBeginDownloadWebFiles)
{
_machine.ChangeState<FsmDownloadFiles>();
}
else if (message is UserEventDefine.UserTryUpdatePackageVersion)
{
_machine.ChangeState<FsmUpdateVersion>();
}
else if (message is UserEventDefine.UserTryUpdatePatchManifest)
{
_machine.ChangeState<FsmUpdateManifest>();
}
else if (message is UserEventDefine.UserTryDownloadWebFiles)
{
_machine.ChangeState<FsmCreateDownloader>();
}
else
{
throw new System.NotImplementedException($"{message.GetType()}");
}
}
}

View File

@ -0,0 +1,98 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniFramework.Machine;
using UniFramework.Event;
using YooAsset;
public class PatchOperation : GameAsyncOperation
{
private enum ESteps
{
None,
Update,
Done,
}
private readonly EventGroup _eventGroup = new EventGroup();
private readonly StateMachine _machine;
private ESteps _steps = ESteps.None;
public PatchOperation(string packageName, string buildPipeline, EPlayMode playMode)
{
// 注册监听事件
_eventGroup.AddListener<UserEventDefine.UserTryInitialize>(OnHandleEventMessage);
_eventGroup.AddListener<UserEventDefine.UserBeginDownloadWebFiles>(OnHandleEventMessage);
_eventGroup.AddListener<UserEventDefine.UserTryUpdatePackageVersion>(OnHandleEventMessage);
_eventGroup.AddListener<UserEventDefine.UserTryUpdatePatchManifest>(OnHandleEventMessage);
_eventGroup.AddListener<UserEventDefine.UserTryDownloadWebFiles>(OnHandleEventMessage);
// 创建状态机
_machine = new StateMachine(this);
_machine.AddNode<FsmInitializePackage>();
_machine.AddNode<FsmUpdatePackageVersion>();
_machine.AddNode<FsmUpdatePackageManifest>();
_machine.AddNode<FsmCreatePackageDownloader>();
_machine.AddNode<FsmDownloadPackageFiles>();
_machine.AddNode<FsmDownloadPackageOver>();
_machine.AddNode<FsmClearPackageCache>();
_machine.AddNode<FsmUpdaterDone>();
_machine.SetBlackboardValue("PackageName", packageName);
_machine.SetBlackboardValue("PlayMode", playMode);
_machine.SetBlackboardValue("BuildPipeline", buildPipeline);
}
protected override void OnStart()
{
_steps = ESteps.Update;
_machine.Run<FsmInitializePackage>();
}
protected override void OnUpdate()
{
if (_steps == ESteps.None || _steps == ESteps.Done)
return;
if(_steps == ESteps.Update)
{
_machine.Update();
if(_machine.CurrentNode == typeof(FsmUpdaterDone).FullName)
{
_eventGroup.RemoveAllListener();
Status = EOperationStatus.Succeed;
_steps = ESteps.Done;
}
}
}
/// <summary>
/// 接收事件
/// </summary>
private void OnHandleEventMessage(IEventMessage message)
{
if (message is UserEventDefine.UserTryInitialize)
{
_machine.ChangeState<FsmInitializePackage>();
}
else if (message is UserEventDefine.UserBeginDownloadWebFiles)
{
_machine.ChangeState<FsmDownloadPackageFiles>();
}
else if (message is UserEventDefine.UserTryUpdatePackageVersion)
{
_machine.ChangeState<FsmUpdatePackageVersion>();
}
else if (message is UserEventDefine.UserTryUpdatePatchManifest)
{
_machine.ChangeState<FsmUpdatePackageManifest>();
}
else if (message is UserEventDefine.UserTryDownloadWebFiles)
{
_machine.ChangeState<FsmCreatePackageDownloader>();
}
else
{
throw new System.NotImplementedException($"{message.GetType()}");
}
}
}

View File

@ -1,43 +0,0 @@
using System.Collections;
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<Button>();
maskBtn.onClick.AddListener(OnClicMaskBtn);
_info = this.transform.Find("bg/info").GetComponent<Text>();
_handle = YooAssets.LoadRawFileAsync("about");
_handle.Completed += _handle_Completed;
}
public override void OnDestroy()
{
_handle.Release();
}
public override void OnRefresh()
{
}
public override void OnUpdate()
{
}
private void _handle_Completed(RawFileOperationHandle obj)
{
_info.text = _handle.GetRawFileText();
}
private void OnClicMaskBtn()
{
UniWindow.CloseWindow<UIAboutWindow>();
}
}

View File

@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UIAboutWindow : MonoBehaviour
{
private void Awake()
{
var maskBtn = this.transform.Find("mask").GetComponent<Button>();
maskBtn.onClick.AddListener(OnClicMaskBtn);
}
private void OnClicMaskBtn()
{
GameObject.Destroy(this.gameObject);
}
}

View File

@ -2,18 +2,17 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UniFramework.Window;
using UniFramework.Event;
[WindowAttribute(100, false)]
public class UIBattleWindow : UIWindow
public class UIBattleWindow : MonoBehaviour
{
private EventGroup _eventGroup = new EventGroup();
private Text _scoreLabel;
private readonly EventGroup _eventGroup = new EventGroup();
private GameObject _overView;
private Text _scoreLabel;
public override void OnCreate()
private void Awake()
{
_overView = this.transform.Find("OverView").gameObject;
_scoreLabel = this.transform.Find("ScoreView/Score").GetComponent<Text>();
_scoreLabel.text = "Score : 0";
@ -23,22 +22,13 @@ public class UIBattleWindow : UIWindow
var homeBtn = this.transform.Find("OverView/Home").GetComponent<Button>();
homeBtn.onClick.AddListener(OnClickHomeBtn);
_overView = this.transform.Find("OverView").gameObject;
_eventGroup.AddListener<BattleEventDefine.ScoreChange>(OnHandleEventMessage);
_eventGroup.AddListener<BattleEventDefine.GameOver>(OnHandleEventMessage);
}
public override void OnDestroy()
private void OnDestroy()
{
_eventGroup.RemoveAllListener();
}
public override void OnRefresh()
{
_overView.SetActive(false);
}
public override void OnUpdate()
{
}
private void OnClickRestartBtn()
{

View File

@ -2,34 +2,32 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UniFramework.Window;
[WindowAttribute(100, false)]
public class UIHomeWindow : UIWindow
public class UIHomeWindow : MonoBehaviour
{
private Text _version;
private GameObject _aboutView;
public override void OnCreate()
private void Awake()
{
_version = this.transform.Find("version").GetComponent<Text>();
_aboutView = this.transform.Find("AboutView").gameObject;
var loginBtn = this.transform.Find("Start").GetComponent<Button>();
loginBtn.onClick.AddListener(OnClickLoginBtn);
var aboutBtn = this.transform.Find("About").GetComponent<Button>();
aboutBtn.onClick.AddListener(OnClicAboutBtn);
var maskBtn = this.transform.Find("AboutView/mask").GetComponent<Button>();
maskBtn.onClick.AddListener(OnClickMaskBtn);
}
public override void OnDestroy()
{
}
public override void OnRefresh()
private void Start()
{
var package = YooAsset.YooAssets.GetPackage("DefaultPackage");
_version.text = "Ver : " + package.GetPackageVersion();
}
public override void OnUpdate()
{
}
private void OnClickLoginBtn()
{
@ -37,6 +35,10 @@ public class UIHomeWindow : UIWindow
}
private void OnClicAboutBtn()
{
UniWindow.OpenWindowAsync<UIAboutWindow>("UIAbout");
_aboutView.SetActive(true);
}
private void OnClickMaskBtn()
{
_aboutView.SetActive(false);
}
}

View File

@ -2,30 +2,25 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UniFramework.Window;
using UniFramework.Utility;
[WindowAttribute(1000, true)]
public class UILoadingWindow : UIWindow
public class UILoadingWindow : MonoBehaviour
{
private Text _info;
private int _countdown;
private UniTimer _timer = UniTimer.CreatePepeatTimer(0, 0.2f);
public override void OnCreate()
private void Awake()
{
_info = this.transform.Find("info").GetComponent<Text>();
}
public override void OnDestroy()
{
}
public override void OnRefresh()
private void Start()
{
_info.text = "Loading";
_timer.Reset();
_countdown = 0;
}
public override void OnUpdate()
private void Update()
{
if(_timer.Update(Time.deltaTime))
{

View File

@ -96,6 +96,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -174,6 +175,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -252,6 +254,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0.9607843, b: 0.5785788, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -326,6 +329,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 0.7735849, g: 0.1715023, b: 0.1715023, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -402,6 +406,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0.7924528, b: 0.43976885, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -430,6 +435,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
@ -519,6 +525,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0.6511245, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -593,6 +600,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -672,6 +680,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 0.5019608}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -700,6 +709,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
@ -848,6 +858,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
@ -872,7 +883,7 @@ MonoBehaviour:
m_PressedTrigger: Pressed
m_SelectedTrigger: Highlighted
m_DisabledTrigger: Disabled
m_Interactable: 1
m_Interactable: 0
m_TargetGraphic: {fileID: 0}
m_FillRect: {fileID: 1114061940513655482}
m_HandleRect: {fileID: 0}
@ -1102,6 +1113,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -1212,6 +1224,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -1315,6 +1328,7 @@ MonoBehaviour:
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
--- !u!114 &8460747169798259904
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -8,7 +8,7 @@ using YooAsset;
/// </summary>
public class GameQueryServices : IBuildinQueryServices
{
public bool QueryStreamingAssets(string packageName, string fileName)
public bool Query(string packageName, string fileName)
{
// 注意fileName包含文件格式
return StreamingAssetsHelper.FileExists(packageName, fileName);

View File

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

View File

@ -1,5 +0,0 @@
# UniFramework.Animation
一个轻量级的高效率的动画系统。
支持新的动画文件格式不再依赖Animator文件来驱动动画使用方式非常类似于老的Animation系统。

View File

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

View File

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

View File

@ -1,106 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Animations;
namespace UniFramework.Animation
{
internal sealed class AnimClip : AnimNode
{
public readonly string Name;
private readonly AnimationClip _clip;
public AnimationClipPlayable _clipPlayable;
/// <summary>
/// 动画层级
/// </summary>
public int Layer = 0;
/// <summary>
/// 动画长度
/// </summary>
public float ClipLength
{
get
{
if (_clip == null)
return 0f;
if (Speed == 0f)
return Mathf.Infinity;
return _clip.length / Speed;
}
}
/// <summary>
/// 归一化时间轴
/// </summary>
public float NormalizedTime
{
set
{
if (_clip == null)
return;
Time = _clip.length * value;
}
get
{
if (_clip == null)
return 1f;
return Time / _clip.length;
}
}
/// <summary>
/// 动画模式
/// </summary>
public WrapMode WrapMode
{
set
{
if (_clip != null)
_clip.wrapMode = value;
}
get
{
if (_clip == null)
return WrapMode.Default;
return _clip.wrapMode;
}
}
/// <summary>
/// 动画状态
/// </summary>
public AnimState State { private set; get; }
public AnimClip(PlayableGraph graph, AnimationClip clip, string name, int layer) : base(graph)
{
_clip = clip;
Name = name;
Layer = layer;
_clipPlayable = AnimationClipPlayable.Create(graph, clip);
_clipPlayable.SetApplyFootIK(false);
_clipPlayable.SetApplyPlayableIK(false);
SetSourcePlayable(_clipPlayable);
if (clip.wrapMode == WrapMode.Once)
{
_clipPlayable.SetDuration(clip.length);
}
State = new AnimState(this);
}
public override void PlayNode()
{
if (_clip.wrapMode == WrapMode.Once || _clip.wrapMode == WrapMode.ClampForever)
{
Time = 0;
}
base.PlayNode();
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 606e5729d04cc8742a38f58e595c02f9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,196 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Animations;
namespace UniFramework.Animation
{
internal sealed class AnimMixer : AnimNode
{
private const float HIDE_DURATION = 0.25f;
private readonly List<AnimClip> _animClips = new List<AnimClip>(10);
private AnimationMixerPlayable _mixer;
private bool _isQuiting = false;
/// <summary>
/// 动画层级
/// </summary>
public int Layer { private set; get; }
public AnimMixer(PlayableGraph graph, int layer) : base(graph)
{
Layer = layer;
_mixer = AnimationMixerPlayable.Create(graph);
SetSourcePlayable(_mixer);
}
public override void Update(float deltaTime)
{
base.Update(deltaTime);
for (int i = 0; i < _animClips.Count; i++)
{
var animClip = _animClips[i];
if (animClip != null)
animClip.Update(deltaTime);
}
bool isAllDone = true;
for (int i = 0; i < _animClips.Count; i++)
{
var animClip = _animClips[i];
if (animClip != null)
{
if (animClip.IsDone == false)
isAllDone = false;
}
}
// 当子节点都已经完成的时候断开连接
if (isAllDone && _isQuiting == false)
{
_isQuiting = true;
StartWeightFade(0, HIDE_DURATION);
}
if (_isQuiting)
{
if (Mathf.Approximately(Weight, 0f))
DisconnectMixer();
}
}
/// <summary>
/// 播放指定动画
/// </summary>
public void Play(AnimClip newAnimClip, float fadeDuration)
{
// 重新激活混合器
_isQuiting = false;
StartWeightFade(1f, 0);
if (IsContains(newAnimClip) == false)
{
// 优先插入到一个空位
int index = _animClips.FindIndex(s => s == null);
if (index == -1)
{
// Increase input count
int inputCount = _mixer.GetInputCount();
_mixer.SetInputCount(inputCount + 1);
newAnimClip.Connect(_mixer, inputCount);
_animClips.Add(newAnimClip);
}
else
{
newAnimClip.Connect(_mixer, index);
_animClips[index] = newAnimClip;
}
}
for (int i = 0; i < _animClips.Count; i++)
{
var animClip = _animClips[i];
if (animClip == null)
continue;
if (animClip == newAnimClip)
{
animClip.StartWeightFade(1f, fadeDuration);
animClip.PlayNode();
}
else
{
animClip.StartWeightFade(0f, fadeDuration);
animClip.PauseNode();
}
}
}
/// <summary>
/// 停止指定动画,恢复为初始状态
/// </summary>
public void Stop(string name)
{
AnimClip animClip = FindClip(name);
if (animClip == null)
return;
animClip.PauseNode();
animClip.ResetNode();
}
/// <summary>
/// 暂停所有动画
/// </summary>
public void PauseAll()
{
for (int i = 0; i < _animClips.Count; i++)
{
var animClip = _animClips[i];
if (animClip == null)
continue;
animClip.PauseNode();
}
}
/// <summary>
/// 是否包含该动画
/// </summary>
public bool IsContains(AnimClip clip)
{
foreach (var animClip in _animClips)
{
if (animClip == clip)
return true;
}
return false;
}
/// <summary>
/// 移除一个动画
/// </summary>
public void RemoveClip(string name)
{
var animClip = FindClip(name);
if (animClip == null)
return;
_animClips[animClip.InputPort] = null;
animClip.Destroy();
}
/// <summary>
/// 获取指定的动画
/// </summary>
/// <returns>如果没有返回NULL</returns>
private AnimClip FindClip(string name)
{
foreach (var animClip in _animClips)
{
if (animClip != null && animClip.Name == name)
return animClip;
}
UniLogger.Warning($"${nameof(AnimClip)} doesn't exist : {name}");
return null;
}
private void DisconnectMixer()
{
for (int i = 0; i < _animClips.Count; i++)
{
var animClip = _animClips[i];
if (animClip == null)
continue;
animClip.Disconnect();
_animClips[i] = null;
}
Disconnect();
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: b33204afd07c00c4f8b425276778b8bf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,221 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Animations;
namespace UniFramework.Animation
{
internal abstract class AnimNode
{
private readonly PlayableGraph _graph;
private Playable _source;
private Playable _parent;
private float _fadeSpeed = 0f;
private float _fadeWeight = 0f;
private bool _isFading = false;
/// <summary>
/// 是否已经连接
/// </summary>
public bool IsConnect { get; private set; } = false;
/// <summary>
/// 输入端口
/// </summary>
public int InputPort { private set; get; }
/// <summary>
/// 是否已经完成
/// If the duration of the playable is set, when the time of the playable reaches its duration during playback this flag will be set to true.
/// </summary>
public bool IsDone
{
get
{
return _source.IsDone();
}
}
/// <summary>
/// 是否有效
/// if the Playable is properly constructed by the PlayableGraph and has not been destroyed, false otherwise.
/// </summary>
public bool IsValid
{
get
{
return _source.IsValid();
}
}
/// <summary>
/// 是否正在播放中
/// </summary>
public bool IsPlaying
{
get
{
return _source.GetPlayState() == PlayState.Playing;
}
}
/// <summary>
/// 时间轴
/// </summary>
public float Time
{
set
{
_source.SetTime(value);
}
get
{
return (float)_source.GetTime();
}
}
/// <summary>
/// 播放速度
/// </summary>
public float Speed
{
set
{
_source.SetSpeed(value);
}
get
{
return (float)_source.GetSpeed();
}
}
/// <summary>
/// 权重值
/// </summary>
public float Weight
{
set
{
_parent.SetInputWeight(InputPort, value);
}
get
{
return _parent.GetInputWeight(InputPort);
}
}
public AnimNode(PlayableGraph graph)
{
_graph = graph;
}
public virtual void Update(float deltaTime)
{
if (_isFading)
{
Weight = Mathf.MoveTowards(Weight, _fadeWeight, _fadeSpeed * deltaTime);
if (Mathf.Approximately(Weight, _fadeWeight))
{
_isFading = false;
}
}
}
public virtual void Destroy()
{
if (IsValid)
{
_graph.DestroySubgraph(_source);
}
}
public virtual void PlayNode()
{
// NOTE : When playing, the local time of this Playable will be updated during the evaluation of the PlayableGraph.
_source.Play();
// NOTE : Changes a flag indicating that a playable has completed its operation.
// Playable that reach the end of their duration are automatically marked as done.
_source.SetDone(false);
}
public virtual void PauseNode()
{
// NOTE : When paused, the local time of this Playable will not be updated during the evaluation of the PlayableGraph.
_source.Pause();
// NOTE : Changes a flag indicating that a playable has completed its operation.
// Playable that reach the end of their duration are automatically marked as done.
_source.SetDone(true);
}
public virtual void ResetNode()
{
_fadeSpeed = 0;
_fadeWeight = 0;
_isFading = false;
Time = 0;
Speed = 1;
Weight = 0;
}
/// <summary>
/// 连接到父节点
/// </summary>
/// <param name="parent">父节点对象</param>
/// <param name="inputPort">父节点上的输入端口</param>
public void Connect(Playable parent, int parentInputPort)
{
if (IsConnect)
throw new System.Exception("AnimNode is connected.");
_parent = parent;
InputPort = parentInputPort;
// 重置节点
ResetNode();
// 连接
_graph.Connect(_source, 0, parent, parentInputPort);
IsConnect = true;
}
/// <summary>
/// 同父节点断开连接
/// </summary>
public void Disconnect()
{
if (IsConnect == false)
throw new System.Exception("AnimNode is disconnected.");
// 断开
_graph.Disconnect(_parent, InputPort);
IsConnect = false;
}
/// <summary>
/// 开始权重值过渡
/// </summary>
/// <param name="destWeight">目标权重值</param>
/// <param name="fadeDuration">过渡时间</param>
public void StartWeightFade(float destWeight, float fadeDuration)
{
if (fadeDuration <= 0)
{
Weight = destWeight;
_isFading = false;
return;
}
//注意:保持统一的渐变速度
_fadeSpeed = 1f / fadeDuration;
_fadeWeight = destWeight;
_isFading = true;
}
protected void SetSourcePlayable(Playable playable)
{
_source = playable;
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: b6928afd60ab2ed489e492e00d9ddaba
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,238 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Animations;
namespace UniFramework.Animation
{
internal class AnimPlayable
{
private readonly List<AnimClip> _animClips = new List<AnimClip>(10);
private readonly List<AnimMixer> _animMixers = new List<AnimMixer>(10);
private PlayableGraph _graph;
private AnimationPlayableOutput _output;
private AnimationLayerMixerPlayable _mixerRoot;
public void Create(Animator animator)
{
string name = animator.gameObject.name;
_graph = PlayableGraph.Create(name);
_graph.SetTimeUpdateMode(DirectorUpdateMode.Manual);
_mixerRoot = AnimationLayerMixerPlayable.Create(_graph);
_output = AnimationPlayableOutput.Create(_graph, name, animator);
_output.SetSourcePlayable(_mixerRoot);
}
public void Update(float deltaTime)
{
_graph.Evaluate(deltaTime);
// 更新所有层级
for (int i = 0; i < _animMixers.Count; i++)
{
var mixer = _animMixers[i];
if(mixer.IsConnect)
mixer.Update(deltaTime);
}
}
public void Destroy()
{
_graph.Destroy();
}
/// <summary>
/// Play the graph
/// </summary>
public void PlayGraph()
{
_graph.Play();
}
/// <summary>
/// Stop the graph
/// </summary>
public void StopGraph()
{
_graph.Stop();
}
/// <summary>
/// 获取动画的状态
/// </summary>
/// <param name="name">动画名称</param>
/// <returns>如果动画不存在返回空</returns>
public AnimState GetAnimState(string name)
{
for (int i = 0; i < _animClips.Count; i++)
{
if (_animClips[i].Name == name)
return _animClips[i].State;
}
return null;
}
/// <summary>
/// 检测动画是否正在播放
/// </summary>
/// <param name="name">动画名称</param>
public bool IsPlaying(string name)
{
AnimClip animClip = GetAnimClip(name);
if (animClip == null)
return false;
return animClip.IsConnect && animClip.IsPlaying;
}
/// <summary>
/// 播放一个动画
/// </summary>
/// <param name="name">动画名称</param>
/// <param name="fadeLength">融合时间</param>
public void Play(string name, float fadeLength)
{
var animClip = GetAnimClip(name);
if (animClip == null)
{
UniLogger.Warning($"Not found animation {name}");
return;
}
int layer = animClip.Layer;
var animMixer = GetAnimMixer(layer);
if (animMixer == null)
animMixer = CreateAnimMixer(layer);
if(animMixer.IsConnect == false)
animMixer.Connect(_mixerRoot, animMixer.Layer);
animMixer.Play(animClip, fadeLength);
}
/// <summary>
/// 停止一个动画
/// </summary>
/// <param name="name">动画名称</param>
public void Stop(string name)
{
var animClip = GetAnimClip(name);
if (animClip == null)
{
UniLogger.Warning($"Not found animation {name}");
return;
}
if (animClip.IsConnect == false)
return;
var animMixer = GetAnimMixer(animClip.Layer);
if (animMixer == null)
throw new System.Exception("Should never get here.");
animMixer.Stop(animClip.Name);
}
/// <summary>
/// 添加一个动画片段
/// </summary>
/// <param name="name">动画名称</param>
/// <param name="clip">动画片段</param>
/// <param name="layer">动画层级</param>
public bool AddAnimation(string name, AnimationClip clip, int layer = 0)
{
if (string.IsNullOrEmpty(name))
throw new System.ArgumentException("Name is null or empty.");
if (clip == null)
throw new System.ArgumentNullException();
if (layer < 0)
throw new System.Exception("Layer must be greater than zero.");
if (IsContains(name))
{
UniLogger.Warning($"Animation already exists : {name}");
return false;
}
AnimClip animClip = new AnimClip(_graph, clip, name, layer);
_animClips.Add(animClip);
return true;
}
/// <summary>
/// 移除一个动画片段
/// </summary>
/// <param name="name">动画名称</param>
public bool RemoveAnimation(string name)
{
if (IsContains(name) == false)
{
UniLogger.Warning($"Not found Animation : {name}");
return false;
}
AnimClip animClip = GetAnimClip(name);
AnimMixer animMixer = GetAnimMixer(animClip.Layer);
if(animMixer != null)
animMixer.RemoveClip(animClip.Name);
animClip.Destroy();
_animClips.Remove(animClip);
return true;
}
/// <summary>
/// 是否包含一个动画状态
/// </summary>
/// <param name="name">动画名称</param>
public bool IsContains(string name)
{
for (int i = 0; i < _animClips.Count; i++)
{
if (_animClips[i].Name == name)
return true;
}
return false;
}
private AnimClip GetAnimClip(string name)
{
for (int i = 0; i < _animClips.Count; i++)
{
if (_animClips[i].Name == name)
return _animClips[i];
}
return null;
}
private AnimMixer GetAnimMixer(int layer)
{
for (int i = 0; i < _animMixers.Count; i++)
{
if (_animMixers[i].Layer == layer)
return _animMixers[i];
}
return null;
}
private AnimMixer CreateAnimMixer(int layer)
{
// Increase input count
int inputCount = _mixerRoot.GetInputCount();
if(layer == 0 && inputCount == 0)
{
_mixerRoot.SetInputCount(1);
}
else
{
if (layer > inputCount - 1)
{
_mixerRoot.SetInputCount(layer + 1);
}
}
var animMixer = new AnimMixer(_graph, layer);
_animMixers.Add(animMixer);
return animMixer;
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 772b8a9edd8466646bab12d6f5ba1084
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,126 +0,0 @@
using System.Collections;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Animations;
namespace UniFramework.Animation
{
public class AnimState
{
private readonly AnimClip _animClip;
private AnimState()
{
}
internal AnimState(AnimClip animClip)
{
_animClip = animClip;
}
/// <summary>
/// The name of animation.
/// </summary>
public string Name
{
get
{
return _animClip.Name;
}
}
/// <summary>
/// The length of the animation clip in seconds.
/// </summary>
public float Length
{
get
{
return _animClip.ClipLength;
}
}
/// <summary>
/// The layer of animation.
/// </summary>
public int Layer
{
get
{
return _animClip.Layer;
}
}
/// <summary>
/// Wrapping mode of the animation.
/// </summary>
public WrapMode WrapMode
{
get
{
return _animClip.WrapMode;
}
}
/// <summary>
/// The weight of animation.
/// </summary>
public float Weight
{
get
{
return _animClip.Weight;
}
set
{
_animClip.Weight = value;
}
}
/// <summary>
/// The current time of the animation.
/// </summary>
public float Time
{
get
{
return _animClip.Time;
}
set
{
_animClip.Time = value;
}
}
/// <summary>
/// The normalized time of the animation.
/// </summary>
public float NormalizedTime
{
get
{
return _animClip.NormalizedTime;
}
set
{
_animClip.NormalizedTime = value;
}
}
/// <summary>
/// The playback speed of the animation. 1 is normal playback speed.
/// </summary>
public float Speed
{
get
{
return _animClip.Speed;
}
set
{
_animClip.Speed = value;
}
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 5660d9e37e5c2a44f818506c9fe76624
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,182 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UniFramework.Animation
{
[RequireComponent(typeof(Animator))]
public class UniAnimation : MonoBehaviour
{
[Serializable]
public class AnimationWrapper
{
public int Layer;
public WrapMode Mode;
public AnimationClip Clip;
}
private AnimPlayable _animPlayable;
private Animator _animator;
[SerializeField]
private AnimationWrapper[] _animations;
[SerializeField]
private bool _playAutomatically = true;
[SerializeField]
private bool _animatePhysics = false;
/// <summary>
/// 自动播放动画
/// </summary>
public bool PlayAutomatically
{
get
{
return _playAutomatically;
}
set
{
_playAutomatically = value;
}
}
/// <summary>
/// 物理更新模式
/// </summary>
public bool AnimatePhysics
{
get
{
return _animatePhysics;
}
set
{
_animatePhysics = value;
_animator.updateMode = _animatePhysics ? AnimatorUpdateMode.AnimatePhysics : AnimatorUpdateMode.Normal;
}
}
public void Awake()
{
_animator = GetComponent<Animator>();
_animator.updateMode = _animatePhysics ? AnimatorUpdateMode.AnimatePhysics : AnimatorUpdateMode.Normal;
_animPlayable = new AnimPlayable();
_animPlayable.Create(_animator);
// 添加列表动作
for (int i = 0; i < _animations.Length; i++)
{
var wrapper = _animations[i];
if (wrapper == null || wrapper.Clip == null)
continue;
wrapper.Clip.wrapMode = wrapper.Mode;
_animPlayable.AddAnimation(wrapper.Clip.name, wrapper.Clip, wrapper.Layer);
}
}
public void OnEnable()
{
_animPlayable.PlayGraph();
if (PlayAutomatically)
{
var wrapper = GetDefaultWrapper();
if (wrapper != null)
{
Play(wrapper.Clip.name, 0f);
}
}
_animPlayable.Update(float.MaxValue);
}
public void OnDisable()
{
_animPlayable.StopGraph();
}
public void OnDestroy()
{
_animPlayable.Destroy();
}
public void Update()
{
_animPlayable.Update(Time.deltaTime);
}
/// <summary>
/// 添加一个动画
/// </summary>
/// <param name="clip">动画片段</param>
/// <param name="layer">动画层级</param>
public bool AddAnimation(AnimationClip clip, int layer = 0)
{
return _animPlayable.AddAnimation(clip.name, clip, layer);
}
/// <summary>
/// 移除动画
/// </summary>
/// <param name="name">动画名称</param>
public bool RemoveAnimation(string name)
{
return _animPlayable.RemoveAnimation(name);
}
/// <summary>
/// 获取动画状态
/// </summary>
public AnimState GetState(string name)
{
return _animPlayable.GetAnimState(name);
}
/// <summary>
/// 动画是否在播放中
/// </summary>
public bool IsPlaying(string name)
{
return _animPlayable.IsPlaying(name);
}
/// <summary>
/// 是否包含动画片段
/// </summary>
public bool IsContains(string name)
{
return _animPlayable.IsContains(name);
}
/// <summary>
/// 播放动画
/// </summary>
public void Play(string name, float fadeLength = 0.25f)
{
_animPlayable.Play(name, fadeLength);
}
/// <summary>
/// 停止动画
/// </summary>
public void Stop(string name)
{
_animPlayable.Stop(name);
}
private AnimationWrapper GetDefaultWrapper()
{
for (int i = 0; i < _animations.Length; i++)
{
var wrapper = _animations[i];
if (wrapper == null || wrapper.Clip == null)
continue;
return wrapper;
}
return null;
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ef52174816df6104587b15c5b250201a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,14 +0,0 @@
{
"name": "UniFramework.Animation",
"rootNamespace": "",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

Some files were not shown because too many files have changed in this diff Show More