王琪诚

【任务】TAPD#

功能详情 朋友圈
配置文件 否
提交作者 QiCheng.Wang
评审人员

6.72 KB | W: | H:

1.64 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

5.49 KB | W: | H:

930 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin

4.49 KB | W: | H:

934 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin
fileFormatVersion: 2
guid: 7a419cbf6ed6240c7b3884642cb6d8d3
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
... ...

925 Bytes | W: | H:

1.12 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -189,7 +189,7 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: c6a71e3121d16464388401e56edb98c6, type: 3}
m_FontSize: 39
m_FontSize: 35
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 3
... ... @@ -318,7 +318,7 @@ RectTransform:
m_GameObject: {fileID: 124841737}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.95, y: 0.95, z: 1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 936019489}
... ... @@ -326,7 +326,7 @@ RectTransform:
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_SizeDelta: {x: -40, y: -40}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &124841739
MonoBehaviour:
... ... @@ -400,7 +400,7 @@ RectTransform:
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: -480, y: 60}
m_AnchoredPosition: {x: -444, y: 60}
m_SizeDelta: {x: 210.91, y: 59.647}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &131210203
... ... @@ -450,8 +450,8 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 49
m_fontSizeBase: 49
m_fontSize: 45
m_fontSizeBase: 45
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
... ... @@ -1079,81 +1079,6 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &781940172
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 781940173}
- component: {fileID: 781940175}
- component: {fileID: 781940174}
m_Layer: 5
m_Name: Logo
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &781940173
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 781940172}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.9, y: 0.9, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 936019489}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 305, y: -143}
m_SizeDelta: {x: 273.848, y: 207.68982}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &781940174
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 781940172}
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: 0}
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!222 &781940175
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 781940172}
m_CullTransparentMesh: 1
--- !u!1 &836977636
GameObject:
m_ObjectHideFlags: 0
... ... @@ -1188,8 +1113,8 @@ RectTransform:
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: 249.82, y: 4}
m_SizeDelta: {x: 1100.4, y: 151.5492}
m_AnchoredPosition: {x: 267.81, y: 4}
m_SizeDelta: {x: 1064.4, y: 151.5492}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &836977638
MonoBehaviour:
... ... @@ -1319,8 +1244,8 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 124841738}
- {fileID: 781940173}
- {fileID: 1936008334}
- {fileID: 1015053100}
- {fileID: 1480902996}
m_Father: {fileID: 1150663700}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
... ... @@ -1562,6 +1487,81 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 990358361}
m_CullTransparentMesh: 1
--- !u!1 &1015053099
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1015053100}
- component: {fileID: 1015053102}
- component: {fileID: 1015053101}
m_Layer: 5
m_Name: Logo
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1015053100
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1015053099}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.9, y: 0.9, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 936019489}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -144, y: -139}
m_SizeDelta: {x: 230, y: 195}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1015053101
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1015053099}
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: 0}
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!222 &1015053102
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1015053099}
m_CullTransparentMesh: 1
--- !u!1 &1118089996
GameObject:
m_ObjectHideFlags: 0
... ... @@ -1934,7 +1934,7 @@ RectTransform:
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: -233, y: -981}
m_AnchoredPosition: {x: -202, y: -981}
m_SizeDelta: {x: 1080, y: 111}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1272724534
... ... @@ -2218,7 +2218,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 121, y: -135}
m_AnchoredPosition: {x: 82, y: -135}
m_SizeDelta: {x: 31, y: 58}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1345160285
... ... @@ -2319,7 +2319,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &1347929217
RectTransform:
m_ObjectHideFlags: 0
... ... @@ -2396,8 +2396,8 @@ RectTransform:
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: -428.1069, y: -4}
m_SizeDelta: {x: 314.7062, y: 73.59}
m_AnchoredPosition: {x: -406.92, y: -5.8525}
m_SizeDelta: {x: 285.07, y: 77.295}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1447955075
MonoBehaviour:
... ... @@ -2428,8 +2428,8 @@ MonoBehaviour:
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
rgba: 4290427578
m_fontColor: {r: 0.7294118, g: 0.7294118, b: 0.7294118, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
... ... @@ -2446,8 +2446,8 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 35
m_fontSizeBase: 35
m_fontSize: 30
m_fontSizeBase: 30
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
... ... @@ -2649,6 +2649,77 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &1480902995
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1480902996}
- component: {fileID: 1480902998}
- component: {fileID: 1480902997}
m_Layer: 5
m_Name: TimeContainer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1480902996
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1480902995}
m_LocalRotation: {x: -0, y: -0, z: -0.043619405, w: 0.9990483}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 936019489}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -5}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -165, y: -273}
m_SizeDelta: {x: 241, y: 81}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1480902997
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1480902995}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 1
m_ChildControlHeight: 1
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!222 &1480902998
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1480902995}
m_CullTransparentMesh: 1
--- !u!1 &1539898517
GameObject:
m_ObjectHideFlags: 0
... ... @@ -2793,8 +2864,8 @@ MonoBehaviour:
imageContainer: {fileID: 936019490}
fullImage: {fileID: 124841739}
contentTextMeshProUGUI: {fileID: 990358363}
logoImage: {fileID: 781940174}
timeGrid: {fileID: 1936008334}
logoImage: {fileID: 1015053101}
timeGrid: {fileID: 1480902996}
timePrefab: {fileID: 1843196218304166739, guid: 710868c67f85d4fa0842d7f459d3172c, type: 3}
--- !u!114 &1539898524
MonoBehaviour:
... ... @@ -3041,7 +3112,7 @@ Light:
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: NaN, z: 1.02e-43, w: 1.4e-43}
m_BoundingSphereOverride: {x: 0, y: 6e-44, z: 6.7e-44, w: 4.428e-42}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
... ... @@ -3143,77 +3214,6 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1 &1936008333
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1936008334}
- component: {fileID: 1936008336}
- component: {fileID: 1936008335}
m_Layer: 5
m_Name: TimeContainer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1936008334
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1936008333}
m_LocalRotation: {x: -0, y: -0, z: -0.043619405, w: 0.9990483}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 936019489}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -5}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 300, y: -284}
m_SizeDelta: {x: 280.1069, y: 71.40619}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1936008335
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1936008333}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 1
m_ChildControlHeight: 1
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!222 &1936008336
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1936008333}
m_CullTransparentMesh: 1
--- !u!1 &2081063374
GameObject:
m_ObjectHideFlags: 0
... ... @@ -3248,7 +3248,7 @@ RectTransform:
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: -692, y: 27}
m_AnchoredPosition: {x: -656, y: 27}
m_SizeDelta: {x: 143, y: 143}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2081063376
... ...
using System;
using System.Collections;
using System.IO;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
using System.Collections;
/**
* 功能描述: 网络图片加载器
* @author wangQc
* @date 2025/6/4 09:16
*/
public static class ImageLoader
{
public static IEnumerator LoadImage(string url, Image targetImage, System.Action<int, int> onSizeReady = null)
/// <summary>
/// 加载图片,支持本地缓存
/// </summary>
/// <param name="url">图片地址</param>
/// <param name="targetImage">目标 Image</param>
/// <param name="onSizeReady">图片宽高回调</param>
/// <returns></returns>
public static IEnumerator LoadImage(string url, Image targetImage, Action<int, int> onSizeReady = null)
{
using (UnityWebRequest uwr = UnityWebRequestTexture.GetTexture(url))
// 生成缓存文件名
string fileName = GetFileNameFromUrl(url);
string cachePath = Path.Combine(Application.temporaryCachePath, fileName);
Texture2D tex = null;
// 1️⃣ 本地有缓存?
if (File.Exists(cachePath))
{
Debug.Log($"[ImageLoader] 加载本地缓存图片: {cachePath}");
byte[] fileData = File.ReadAllBytes(cachePath);
tex = new Texture2D(2, 2); // 临时大小,LoadImage 会自动调整
tex.LoadImage(fileData);
}
else
{
yield return uwr.SendWebRequest();
Debug.Log($"[ImageLoader] 下载图片: {url}");
if (uwr.result == UnityWebRequest.Result.Success)
using (UnityWebRequest uwr = UnityWebRequestTexture.GetTexture(url))
{
Texture2D tex = DownloadHandlerTexture.GetContent(uwr);
yield return uwr.SendWebRequest();
if (uwr.result == UnityWebRequest.Result.Success)
{
tex = DownloadHandlerTexture.GetContent(uwr);
targetImage.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f));
// 保存到本地缓存
byte[] pngData = tex.EncodeToPNG();
File.WriteAllBytes(cachePath, pngData);
// 回调宽高
onSizeReady?.Invoke(tex.width, tex.height);
Debug.Log($"[ImageLoader] 下载完成,已缓存到: {cachePath}");
}
else
{
Debug.LogError($"[ImageLoader] 下载失败: {uwr.error}");
yield break;
}
}
}
// 2️⃣ 应用到 UI
if (tex != null && targetImage != null)
{
targetImage.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(1f, 1f));
// 回调宽高
onSizeReady?.Invoke(tex.width, tex.height);
}
}
/// <summary>
/// 从 URL 生成缓存文件名
/// </summary>
private static string GetFileNameFromUrl(string url)
{
if (string.IsNullOrEmpty(url))
return Guid.NewGuid().ToString("N"); // 万一 URL 空,防止报错
// 取最后一个 "/" 后面的部分
string fileName = Path.GetFileName(url);
// 可能带参数?比如 xxx.jpg?abc=123,去掉参数
int index = fileName.IndexOf("?", StringComparison.Ordinal);
if (index >= 0)
{
fileName = fileName.Substring(0, index);
}
// 防止奇怪 URL 没扩展名,补个默认
if (string.IsNullOrEmpty(Path.GetExtension(fileName)))
{
fileName += ".png"; // 默认 .png
}
return fileName;
}
}
\ No newline at end of file
}
... ...
... ... @@ -58,20 +58,50 @@ public class ImageViewerManager : MonoBehaviour
//清空
fullImage.sprite = null;
panel.SetActive(true);
StartCoroutine(ImageLoader.LoadImage(url, fullImage, (width, height) => {
Debug.Log($"图片宽高 = {width} x {height}");
//三倍图
width /= 2;
height /= 2;
imageContainer.rectTransform.sizeDelta = new Vector2(width, height);
Debug.Log($"图片原始宽高 = {width} x {height}");
float targetWidth = 1160f; // 目标参考宽度
float maxHeight = 2000f; // 高度最大不超过 2000
// 原图比例
float aspectRatio = (float)height / width;
// 计算按目标宽度缩放后的高度
float scaledHeight = targetWidth * aspectRatio;
// 当前缩放系数(默认按 targetWidth 缩放)
float scale = targetWidth / width;
// 如果缩放后的高度 > 2000,高度优先限制
if (scaledHeight > maxHeight)
{
// 按高度 2000 缩放
scale = maxHeight / height;
}
// 如果图片原图宽度 < 1160,放大
else if (width < targetWidth)
{
scale = targetWidth / width;
}
// 最终缩放后的宽高
float finalWidth = width * scale;
float finalHeight = height * scale;
// 应用 sizeDelta
imageContainer.rectTransform.sizeDelta = new Vector2(finalWidth, finalHeight);
Debug.Log($"最终显示宽高 = {finalWidth} x {finalHeight}");
// 加载 logo
StartCoroutine(ImageLoader.LoadImage(logo, logoImage));
//logo根据图片大小缩放比例
// logoImage.rectTransform.sizeDelta = new Vector2(finalHeight * 0.2f, finalHeight * 0.1f);
}));
//时间
foreach (Transform child in timeGrid)
... ...
... ... @@ -356,7 +356,7 @@ public class MomentItem : MonoBehaviour
LoadComments(moment.comments);
momentHeight+= moment.comments.Count*line;
return momentHeight+400;
return momentHeight+500;
}
... ...
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
using System.IO;
//朋友圈动态管理器
public class MomentManager : MonoBehaviour
... ... @@ -62,7 +63,32 @@ public class MomentManager : MonoBehaviour
RectTransform scrollContentRt = contentParent.parent.GetComponent<RectTransform>();
scrollContentRt.sizeDelta =
new Vector2(scrollContentRt.sizeDelta.x, coverHeight + momentListHeight + bottomHeight);
}
private void OnApplicationQuit()
{
ClearTemporaryCache();
}
private void ClearTemporaryCache()
{
string cachePath = Application.temporaryCachePath;
if (Directory.Exists(cachePath))
{
try
{
Directory.Delete(cachePath, true);
Debug.Log($"[CacheCleaner] 清空缓存目录成功: {cachePath}");
}
catch (System.Exception e)
{
Debug.LogError($"[CacheCleaner] 清空缓存目录失败: {e.Message}");
}
}
else
{
Debug.Log($"[CacheCleaner] 缓存目录不存在: {cachePath}");
}
}
}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
"cover": "https://h5.edcc.cn/FriendCircle/image/cover.png",
"bottom": "https://h5.edcc.cn/FriendCircle/image/bottom.png",
"logo": "https://h5.edcc.cn/FriendCircle/image/logo.png",
"likeIcon": "https://h5.edcc.cn/FriendCircle/image/likeIcon.png?a=1",
"likeIcon": "https://h5.edcc.cn/FriendCircle/image/likeIcon.png?a=2",
"likeList":[
{ "icon": "<sprite name=\"Smile\">", "bullet": "加油加油!", "name": "Smile"},
{ "icon": "<sprite name=\"LaughCry\">", "bullet": "哈哈哈哈哈", "name": "LaughCry"},
... ... @@ -20,8 +20,8 @@
"from": "来自:火星",
"time": "2021年5月19日",
"imageUrls": [
"https://h5.edcc.cn/FriendCircle/image/1-1.png",
"https://h5.edcc.cn/FriendCircle/image/1-2.png"
"https://h5.edcc.cn/FriendCircle/image/1-1.jpg",
"https://h5.edcc.cn/FriendCircle/image/1-2.jpg"
],
"likeNameList": ["天和核心舱", "天问一号环绕器","好奇号","毅力号","阿联酋希望号"],
"comments": [
... ... @@ -54,8 +54,8 @@
"from": "来自:火星",
"time": "2021年6月11日",
"imageUrls": [
"https://h5.edcc.cn/FriendCircle/image/3-1.png",
"https://h5.edcc.cn/FriendCircle/image/3-2.png"
"https://h5.edcc.cn/FriendCircle/image/3-1.jpg",
"https://h5.edcc.cn/FriendCircle/image/3-2.jpg"
],
"likeNameList": ["天和核心舱", "嫦娥五号","北斗三号","玉兔二号"],
"comments": [
... ... @@ -73,7 +73,7 @@
"from": "来自:火星",
"time": "2021年6月11日",
"imageUrls": [
"https://h5.edcc.cn/FriendCircle/image/4-1.png"
"https://h5.edcc.cn/FriendCircle/image/4-1.jpg"
],
"likeNameList": ["天和核心舱", "玉兔二号","阿联酋希望号","天问一号环绕器"],
"comments": [
... ... @@ -92,7 +92,7 @@
"from": "来自:火星",
"time": "2021年7月9日",
"imageUrls": [
"https://h5.edcc.cn/FriendCircle/image/5-1.png",
"https://h5.edcc.cn/FriendCircle/image/5-1.jpg",
"https://h5.edcc.cn/FriendCircle/image/5-2.png"
],
"likeNameList": ["玉兔二号", "天问一号环绕器","天和核心舱","嫦娥五号"],
... ... @@ -110,7 +110,7 @@
"from": "来自:火星",
"time": "2021年7月15日",
"imageUrls": [
"https://h5.edcc.cn/FriendCircle/image/6-1.png"
"https://h5.edcc.cn/FriendCircle/image/6-1.jpg"
],
"likeNameList": ["天和核心舱", "玉兔二号","北斗三号","神舟十二号"],
"comments": [
... ... @@ -147,7 +147,7 @@
"from": "来自:火星",
"time": "2021年7月30日",
"imageUrls": [
"https://h5.edcc.cn/FriendCircle/image/8-1.png"
"https://h5.edcc.cn/FriendCircle/image/8-1.jpg"
],
"likeNameList": ["玉兔二号", "天问一号环绕器"],
"comments": [
... ... @@ -165,7 +165,7 @@
"from": "来自:火星",
"time": "2021年8月6日",
"imageUrls": [
"https://h5.edcc.cn/FriendCircle/image/9-1.png"
"https://h5.edcc.cn/FriendCircle/image/9-1.jpg"
],
"likeNameList": ["天和核心舱", "玉兔二号","北斗三号","神舟十二号"],
"comments": [
... ... @@ -184,7 +184,7 @@
"from": "来自:火星",
"time": "2021年8月15日",
"imageUrls": [
"https://h5.edcc.cn/FriendCircle/image/10-1.png"
"https://h5.edcc.cn/FriendCircle/image/10-1.jpg"
],
"likeNameList": ["天和核心舱", "天问一号环绕器","玉兔二号","嫦娥五号","北斗三号"],
"comments": [
... ...
... ... @@ -36,7 +36,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1141.1294, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4867507668132122837
CanvasRenderer:
... ... @@ -129,7 +129,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 3.3396606, y: 0, z: 23.896545, w: 0}
m_margin: {x: 3.3396606, y: 0, z: 6.735901, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
... ... @@ -324,13 +324,13 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 40
m_fontSizeBase: 40
m_fontSize: 45
m_fontSizeBase: 45
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_fontStyle: 1
m_HorizontalAlignment: 32
m_VerticalAlignment: 4096
m_textAlignment: 65535
... ... @@ -722,7 +722,7 @@ RectTransform:
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: -153, y: 0}
m_AnchoredPosition: {x: -202, y: 0}
m_SizeDelta: {x: 400, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2023033134325749515
... ... @@ -853,13 +853,15 @@ GameObject:
- component: {fileID: 3108337084099359238}
- component: {fileID: 7585877598886442541}
- component: {fileID: 7086642667860821389}
- component: {fileID: 7866903808712037280}
- component: {fileID: 7548172600992697048}
m_Layer: 5
m_Name: BottomContainer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &3108337084099359238
RectTransform:
m_ObjectHideFlags: 0
... ... @@ -874,10 +876,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 5137047804386020533}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 411.90024, y: -1270}
m_SizeDelta: {x: 823.8005, y: 100}
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.5, y: 0.5}
--- !u!114 &7585877598886442541
MonoBehaviour:
... ... @@ -893,7 +895,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_IgnoreLayout: 0
m_MinWidth: -1
m_MinHeight: 100
m_MinHeight: 50
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: -1
... ... @@ -925,6 +927,44 @@ MonoBehaviour:
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!222 &7866903808712037280
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2517860416192966601}
m_CullTransparentMesh: 1
--- !u!114 &7548172600992697048
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2517860416192966601}
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: 2aee09e01c54c4e4eaeab3cd2addc256, 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 &3024470403460670727
GameObject:
m_ObjectHideFlags: 0
... ... @@ -1097,6 +1137,81 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1 &3695463578648953055
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4973245662616750736}
- component: {fileID: 6439733017192194499}
- component: {fileID: 4276570476397375809}
m_Layer: 5
m_Name: DividingLine
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4973245662616750736
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3695463578648953055}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4702000847190666268}
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.5, y: 0.5}
--- !u!222 &6439733017192194499
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3695463578648953055}
m_CullTransparentMesh: 1
--- !u!114 &4276570476397375809
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3695463578648953055}
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: 7a419cbf6ed6240c7b3884642cb6d8d3, 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 &3888947954386717641
GameObject:
m_ObjectHideFlags: 0
... ... @@ -1375,14 +1490,14 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.92156863, g: 0.9254902, b: 0.92156863, a: 1}
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: 0}
m_Sprite: {fileID: 21300000, guid: 22f78cb9278c144079b8f60abc9acbb5, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
... ... @@ -1425,15 +1540,15 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 0
m_Left: 15
m_Right: 0
m_Top: 10
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_Spacing: 20
m_ChildForceExpandWidth: 0
m_ChildForceExpandHeight: 0
m_ChildControlWidth: 0
m_ChildControlWidth: 1
m_ChildControlHeight: 1
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
... ... @@ -1472,8 +1587,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 27, y: -24}
m_SizeDelta: {x: 35, y: 30}
m_AnchoredPosition: {x: 27, y: -31}
m_SizeDelta: {x: 51, y: 42}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &888018792828137858
CanvasRenderer:
... ... @@ -1928,7 +2043,7 @@ MonoBehaviour:
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_margin: {x: 20, y: 0, z: 20, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
... ... @@ -2256,6 +2371,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4973245662616750736}
- {fileID: 3052796486179379442}
m_Father: {fileID: 5137047804386020533}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
... ... @@ -2285,14 +2401,14 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.92156863, g: 0.9254902, b: 0.92156863, a: 1}
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: 0}
m_Sprite: {fileID: 21300000, guid: 8b5c00664fb2c49f89a5bac8f8f3a212, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
... ... @@ -2335,10 +2451,10 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 20
m_Right: 0
m_Left: 5
m_Right: 5
m_Top: 0
m_Bottom: 20
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 0
m_ChildForceExpandWidth: 1
... ... @@ -2383,7 +2499,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 52.323, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &7917989825231092027
MonoBehaviour:
... ...
... ... @@ -12,8 +12,8 @@ PlayerSettings:
targetDevice: 2
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: DefaultCompany
productName: My project
companyName: EDCC
productName: FriendCircle
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
... ... @@ -162,7 +162,7 @@ PlayerSettings:
androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1
applicationIdentifier:
Android: com.DefaultCompany.Myproject
Android: com.EDCC.FriendCircle
Standalone: com.DefaultCompany.My-project
buildNumber:
Standalone: 0
... ...