Merge pull request #26 from tverona1/misc
Memory optimization for large # of icons, support for large # of chinese characters
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c85e01b12adaaef42bfa2f8eaa8c6775
|
||||
timeCreated: 1512502617
|
||||
licenseType: Pro
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 4
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 10
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
@@ -12,6 +11,8 @@ TextureImporter:
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
@@ -20,6 +21,8 @@ TextureImporter:
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
@@ -27,10 +30,13 @@ TextureImporter:
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
@@ -39,46 +45,71 @@ TextureImporter:
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
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
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Standalone
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Android
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 08cab6c84d1d0f043a5496bc97a744da
|
||||
timeCreated: 1512502616
|
||||
licenseType: Pro
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 4
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 10
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
@@ -12,6 +11,8 @@ TextureImporter:
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
@@ -20,6 +21,8 @@ TextureImporter:
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
@@ -27,10 +30,13 @@ TextureImporter:
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
@@ -39,46 +45,71 @@ TextureImporter:
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
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
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Standalone
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Android
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d7b2d40a5fe539f4d9315528e230265c
|
||||
timeCreated: 1512502617
|
||||
licenseType: Pro
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 4
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 10
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
@@ -12,6 +11,8 @@ TextureImporter:
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
@@ -20,6 +21,8 @@ TextureImporter:
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
@@ -27,10 +30,13 @@ TextureImporter:
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
@@ -39,46 +45,71 @@ TextureImporter:
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
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
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Standalone
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Android
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27a7839379f859b44ae0f1e694c2995e
|
||||
timeCreated: 1512502616
|
||||
licenseType: Pro
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 4
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 10
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
@@ -12,6 +11,8 @@ TextureImporter:
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
@@ -20,6 +21,8 @@ TextureImporter:
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
@@ -27,10 +30,13 @@ TextureImporter:
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
@@ -39,46 +45,71 @@ TextureImporter:
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
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
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Standalone
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Android
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -1,54 +1,91 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce8f78b2b9292484e97f36ad9568fc4f
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 10
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: 16
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
allowsAlphaSplitting: 0
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 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
|
||||
buildTargetSettings: []
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 1024
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag: gui
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -1,33 +1,42 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a26663690a6580440963aa46e582c35b
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 10
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -2
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: 16
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
@@ -35,13 +44,48 @@ TextureImporter:
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 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
|
||||
buildTargetSettings: []
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 1024
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag: pointersui
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -273,7 +273,7 @@ public class AppInfo extends UnityPlayerActivity {
|
||||
}
|
||||
}
|
||||
|
||||
public static DecodedBitmap loadRawImage(String imagePath, int maxWidth, int maxHeight) {
|
||||
public static DecodedBitmap loadRawImage(String imagePath, int maxPixels) {
|
||||
Log.v(TAG, "Decoding image at " + imagePath);
|
||||
|
||||
try {
|
||||
@@ -290,8 +290,7 @@ public class AppInfo extends UnityPlayerActivity {
|
||||
// Calculate the largest inSampleSize value that is a power of 2 and keeps both
|
||||
// height and width smaller than the requested height and width.
|
||||
options.inSampleSize = 1;
|
||||
while ((height / options.inSampleSize) >= maxHeight
|
||||
|| (width / options.inSampleSize) >= maxWidth) {
|
||||
while (height / options.inSampleSize * width / options.inSampleSize > maxPixels) {
|
||||
options.inSampleSize *= 2;
|
||||
}
|
||||
Log.v(TAG, "Image sample size: " + options.inSampleSize);
|
||||
|
||||
@@ -64,8 +64,6 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
@@ -139,8 +137,6 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_text:
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
@@ -292,13 +288,11 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
@@ -398,7 +392,10 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
sprite: {fileID: 4032891918720229799}
|
||||
image: {fileID: 8091170928783170726}
|
||||
aspectRatioFitter: {fileID: 2431431278619055510}
|
||||
text: {fileID: 6771208205116626490}
|
||||
scrollViewTransform: {fileID: 0}
|
||||
packageId:
|
||||
appName:
|
||||
externalIconPath:
|
||||
@@ -467,8 +464,6 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_Sprite: {fileID: 21300000, guid: eb604cc485e242f47964afd8b57c3352, type: 3}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+149
-24
@@ -1,32 +1,157 @@
|
||||
using System.Collections;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class AppEntry : MonoBehaviour
|
||||
namespace QuestAppLauncher
|
||||
{
|
||||
// Sprite gameobject
|
||||
public GameObject sprite;
|
||||
|
||||
// TMP text
|
||||
public TextMeshProUGUI text;
|
||||
|
||||
// App entry contents
|
||||
public string packageId;
|
||||
public string appName;
|
||||
public string externalIconPath;
|
||||
public int installedApkIndex;
|
||||
public bool isRenameMode;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
public class AppEntry : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
// Sprite gameobject
|
||||
public GameObject sprite = null;
|
||||
public Image image = null;
|
||||
public AspectRatioFitter aspectRatioFitter = null;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
// TMP text
|
||||
public TextMeshProUGUI text;
|
||||
|
||||
// Scroll view transform
|
||||
public RectTransform scrollViewTransform;
|
||||
|
||||
// App entry contents
|
||||
public string packageId;
|
||||
public string appName;
|
||||
public string externalIconPath = null;
|
||||
public int installedApkIndex = -1;
|
||||
public bool isRenameMode;
|
||||
public bool dynamicallyLoadIcon;
|
||||
|
||||
const int MAX_FRAME_DELAYS = 35;
|
||||
private float lastPos = -1f;
|
||||
private bool isIconLoaded = false;
|
||||
private int curFrameDelay = 0;
|
||||
private int maxFrameDelays = 0;
|
||||
private float maxDistance = 0f;
|
||||
private System.Random rand = new System.Random();
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
// Calculate max distance outside the visible scroll area, beyond which we'll unload the icon to reduce memory
|
||||
this.maxDistance = 1.5f * this.scrollViewTransform.rect.size.y;
|
||||
|
||||
// Calculate the maximum frame delays when populating this icon; used to stagger loading of icons in the visible scroll area
|
||||
this.maxFrameDelays = this.rand.Next(MAX_FRAME_DELAYS);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
async void Update()
|
||||
{
|
||||
if (!this.dynamicallyLoadIcon || null == this.scrollViewTransform ||
|
||||
(this.externalIconPath == null && this.installedApkIndex == -1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var localPos = this.scrollViewTransform.InverseTransformPoint(this.transform.position).y;
|
||||
if (Mathf.Abs(localPos) < this.maxDistance)
|
||||
{
|
||||
// Don't bother loading icons while we're scrolling
|
||||
if (this.lastPos == -1)
|
||||
{
|
||||
this.lastPos = localPos;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.lastPos != localPos)
|
||||
{
|
||||
this.lastPos = localPos;
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
// We're within max distance, so show the icon after some delay (to stagger loading of icons)
|
||||
if (this.curFrameDelay < this.maxFrameDelays)
|
||||
{
|
||||
this.curFrameDelay++;
|
||||
return;
|
||||
}
|
||||
this.maxFrameDelays = this.rand.Next(MAX_FRAME_DELAYS);
|
||||
this.curFrameDelay = 0;
|
||||
|
||||
if (!this.isIconLoaded)
|
||||
{
|
||||
UnloadIcon();
|
||||
await LoadIcon();
|
||||
this.isIconLoaded = true;
|
||||
}
|
||||
}
|
||||
else if (this.isIconLoaded)
|
||||
{
|
||||
// We're outside max distance, so unload the icon
|
||||
UnloadIcon();
|
||||
this.isIconLoaded = false;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task LoadIcon()
|
||||
{
|
||||
var result = await AppProcessor.GetAppIconAsync(this.externalIconPath, this.installedApkIndex, 1024 * 1024);
|
||||
var image = result.Item1;
|
||||
var imageWidth = result.Item2;
|
||||
var imageHeight = result.Item3;
|
||||
|
||||
Texture2D texture = null;
|
||||
|
||||
// Set the icon image
|
||||
if (imageWidth == 0 || imageHeight == 0)
|
||||
{
|
||||
texture = new Texture2D(2, 2, TextureFormat.RGBA32, false);
|
||||
texture.filterMode = FilterMode.Trilinear;
|
||||
texture.anisoLevel = 16;
|
||||
texture.LoadImage(image);
|
||||
}
|
||||
else
|
||||
{
|
||||
texture = new Texture2D(imageWidth, imageHeight, TextureFormat.ARGB32, false);
|
||||
texture.filterMode = FilterMode.Trilinear;
|
||||
texture.anisoLevel = 16;
|
||||
texture.LoadRawTextureData(image);
|
||||
texture.Apply();
|
||||
}
|
||||
|
||||
var rect = new Rect(0, 0, texture.width, texture.height);
|
||||
this.image.sprite = Sprite.Create(texture, rect, new Vector2(0.5f, 0.5f));
|
||||
this.image.color = Color.white;
|
||||
|
||||
// Preserve icon's aspect ratio
|
||||
this.aspectRatioFitter.aspectRatio = (float)texture.width / (float)texture.height;
|
||||
}
|
||||
|
||||
private void UnloadIcon()
|
||||
{
|
||||
// We always manually create the sprite's texture object,
|
||||
// so we must explicitly destroy it.
|
||||
if (null != this.image.sprite)
|
||||
{
|
||||
if (null != this.image.sprite.texture)
|
||||
{
|
||||
DestroyImmediate(image.sprite.texture);
|
||||
}
|
||||
|
||||
DestroyImmediate(this.image.sprite);
|
||||
this.image.sprite = null;
|
||||
this.image.color = Color.clear;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
Debug.Log("AppEntry.OnDestroy");
|
||||
UnloadIcon();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+129
-16
@@ -482,17 +482,120 @@ namespace QuestAppLauncher
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] GetAppIcon(string iconPath, int appIndex)
|
||||
/// <summary>
|
||||
/// Loads an image from specified path. Scaled down if image is larger than max pixels.
|
||||
/// </summary>
|
||||
/// <param name="path">Image path</param>
|
||||
/// <param name="maxPixels">Max pixels</param>
|
||||
/// <param name="adjustForCubemap">If true, adjusts for cubemap by skipping invert if loading cube map</param>
|
||||
/// <returns>Image and dimensions</returns>
|
||||
public static async Task<(byte[], int, int)> LoadRawImageAsync(string path, int maxPixels, bool adjustForCubemap = false)
|
||||
{
|
||||
byte[] bytesIcon = null;
|
||||
bool useApkIcon = true;
|
||||
if (null != iconPath)
|
||||
int imageHeight = 0;
|
||||
int imageWidth = 0;
|
||||
byte[] image = null;
|
||||
|
||||
await Task.Run(() =>
|
||||
{
|
||||
// Use overridden icon
|
||||
AndroidJNI.AttachCurrentThread();
|
||||
|
||||
try
|
||||
{
|
||||
bytesIcon = File.ReadAllBytes(iconPath);
|
||||
useApkIcon = false;
|
||||
LoadRawImage(path, maxPixels, adjustForCubemap, out image, out imageWidth, out imageHeight);
|
||||
}
|
||||
finally
|
||||
{
|
||||
AndroidJNI.DetachCurrentThread();
|
||||
}
|
||||
});
|
||||
|
||||
return (image, imageWidth, imageHeight);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads an image from specified path. Scaled down if image is larger than max pixels.
|
||||
/// </summary>
|
||||
/// <param name="path">Image path</param>
|
||||
/// <param name="maxPixels">Max pixels</param>
|
||||
/// <param name="adjustForCubemap">If true, adjusts for cubemap by skipping invert if loading cube map</param>
|
||||
/// <param name="image">Output raw image byte array</param>
|
||||
/// <param name="imageWidth">Output width</param>
|
||||
/// <param name="imageHeight">Output height</param>
|
||||
public static void LoadRawImage(string path, int maxPixels, bool adjustForCubemap, out byte[] image, out int imageWidth, out int imageHeight)
|
||||
{
|
||||
image = null;
|
||||
imageWidth = 0;
|
||||
imageHeight = 0;
|
||||
|
||||
try
|
||||
{
|
||||
using (AndroidJavaClass unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject currentActivity = unity.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
// Call Android plugin to load the raw image.
|
||||
var jo = currentActivity.CallStatic<AndroidJavaObject>("loadRawImage", path, maxPixels);
|
||||
if (null == jo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the width, height and raw image data.
|
||||
imageWidth = jo.Get<int>("width");
|
||||
imageHeight = jo.Get<int>("height");
|
||||
var rawImage = (byte[])(Array)jo.Get<sbyte[]>("rawImage");
|
||||
|
||||
// The image is in ARGB_8888 format (Alpha, Red, Green, Blue - each 1 byte). In addition, (0, 0) coordinates are bottom-left.
|
||||
// Unity expects RGBA (with Alpha as the last byte) and origin at top-left. So we need to compensate for both.
|
||||
|
||||
// Shift alpha
|
||||
for (var i = 0; i < rawImage.Length / 4; i++)
|
||||
{
|
||||
var tmp = rawImage[i * 4 + 3];
|
||||
rawImage[i * 4 + 3] = rawImage[i * 4 + 2];
|
||||
rawImage[i * 4 + 2] = rawImage[i * 4 + 1];
|
||||
rawImage[i * 4 + 1] = rawImage[i * 4];
|
||||
rawImage[i * 4] = tmp;
|
||||
}
|
||||
|
||||
// Swap rows if needed
|
||||
if (!adjustForCubemap ||
|
||||
(4 * imageHeight != 3 * imageWidth && 6 * imageHeight != imageWidth))
|
||||
{
|
||||
var row = new byte[imageWidth * 4];
|
||||
for (var i = 0; i < imageHeight / 2; i++)
|
||||
{
|
||||
Buffer.BlockCopy(rawImage, i * imageWidth * 4, row, 0, imageWidth * 4);
|
||||
Buffer.BlockCopy(rawImage, (imageHeight - i - 1) * imageWidth * 4, rawImage, i * imageWidth * 4, imageWidth * 4);
|
||||
Buffer.BlockCopy(row, 0, rawImage, (imageHeight - i - 1) * imageWidth * 4, imageWidth * 4);
|
||||
}
|
||||
}
|
||||
|
||||
image = rawImage;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// Fall back to using the apk icon
|
||||
Debug.LogFormat("Error decoding image [{0}]: {1}", path, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads an app icon asynchronously, either from specified external icon path or, if path is not provided or fails to load,
|
||||
/// falls back to loading the icon from the apk itself.
|
||||
/// </summary>
|
||||
/// <param name="iconPath">External icon path</param>
|
||||
/// <param name="appIndex">App index (used when falling back to loading icon from APK)</param>
|
||||
/// <param name="maxPixels">Max pixels - image will be scaled down if larger than this size</param>
|
||||
/// <returns>Icon bytes and dimensions</returns>
|
||||
public static async Task<(byte[], int, int)> GetAppIconAsync(string iconPath, int appIndex, int maxPixels)
|
||||
{
|
||||
if (null != iconPath)
|
||||
{
|
||||
// Load icon from file path
|
||||
try
|
||||
{
|
||||
return await LoadRawImageAsync(iconPath, maxPixels);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -501,17 +604,27 @@ namespace QuestAppLauncher
|
||||
}
|
||||
}
|
||||
|
||||
if (useApkIcon)
|
||||
byte[] bytesIcon = null;
|
||||
await Task.Run(() =>
|
||||
{
|
||||
// Use built-in icon from the apk
|
||||
using (AndroidJavaClass unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject currentActivity = unity.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
bytesIcon = (byte[])(Array)currentActivity.Call<sbyte[]>("getIcon", appIndex);
|
||||
}
|
||||
}
|
||||
AndroidJNI.AttachCurrentThread();
|
||||
|
||||
return bytesIcon;
|
||||
try
|
||||
{
|
||||
// Use built-in icon from the apk
|
||||
using (AndroidJavaClass unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject currentActivity = unity.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
bytesIcon = (byte[])(Array)currentActivity.Call<sbyte[]>("getIcon", appIndex);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
AndroidJNI.DetachCurrentThread();
|
||||
}
|
||||
});
|
||||
|
||||
return (bytesIcon, 0, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -28,6 +28,11 @@ namespace QuestAppLauncher
|
||||
}
|
||||
}
|
||||
|
||||
// Max icons to initially populate. If we have more than this number,
|
||||
// then we fall back into dynamically loading icons as we scroll to conserve memory.
|
||||
const int MaxIconsOnInitialPopulation = 150;
|
||||
|
||||
|
||||
// Grid container game object
|
||||
public GameObject panelContainer;
|
||||
|
||||
@@ -211,29 +216,31 @@ namespace QuestAppLauncher
|
||||
ResizeTabContent(this.rightTabContainer.transform, size, rightTabs.Count, false);
|
||||
}
|
||||
|
||||
bool loadIcons = apps.Count <= MaxIconsOnInitialPopulation;
|
||||
|
||||
// Populate grid with app information (name & icon)
|
||||
// Sort by custom comparer
|
||||
foreach (var app in apps.OrderBy(key => key.Value, new AppComparer()))
|
||||
{
|
||||
// Add to all tab
|
||||
await AddCellToGridAsync(app.Value, gridContents[AppProcessor.Tab_All].transform);
|
||||
await AddCellToGridAsync(app.Value, gridContents[AppProcessor.Tab_All].transform, loadIcons);
|
||||
|
||||
// Add to auto (built-in) tabs
|
||||
if (gridContents.ContainsKey(app.Value.AutoTabName))
|
||||
{
|
||||
await AddCellToGridAsync(app.Value, gridContents[app.Value.AutoTabName].transform);
|
||||
await AddCellToGridAsync(app.Value, gridContents[app.Value.AutoTabName].transform, loadIcons);
|
||||
}
|
||||
|
||||
// Add to tab1
|
||||
if (null != app.Value.Tab1Name && gridContents.ContainsKey(app.Value.Tab1Name))
|
||||
{
|
||||
await AddCellToGridAsync(app.Value, gridContents[app.Value.Tab1Name].transform);
|
||||
await AddCellToGridAsync(app.Value, gridContents[app.Value.Tab1Name].transform, loadIcons);
|
||||
}
|
||||
|
||||
// Add to tab2
|
||||
if (null != app.Value.Tab2Name && gridContents.ContainsKey(app.Value.Tab2Name))
|
||||
{
|
||||
await AddCellToGridAsync(app.Value, gridContents[app.Value.Tab2Name].transform);
|
||||
await AddCellToGridAsync(app.Value, gridContents[app.Value.Tab2Name].transform, loadIcons);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -252,11 +259,13 @@ namespace QuestAppLauncher
|
||||
// Set panel size
|
||||
SetGridSize(this.renamePanelContainer, gridContent, config.gridSize.rows, config.gridSize.cols);
|
||||
|
||||
bool loadIcons = apps.Count <= MaxIconsOnInitialPopulation;
|
||||
|
||||
// Populate grid with app information (name & icon)
|
||||
// Sort alphabetically
|
||||
foreach (var app in apps.OrderBy(key => key.Value.AppName, StringComparer.InvariantCultureIgnoreCase))
|
||||
{
|
||||
await AddCellToGridAsync(app.Value, gridContent.transform, true);
|
||||
await AddCellToGridAsync(app.Value, gridContent.transform, loadIcons, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,7 +368,7 @@ namespace QuestAppLauncher
|
||||
}
|
||||
}
|
||||
|
||||
private async Task AddCellToGridAsync(ProcessedApp app, Transform transform, bool isRenameMode = false)
|
||||
private async Task AddCellToGridAsync(ProcessedApp app, Transform transform, bool loadIcon, bool isRenameMode = false)
|
||||
{
|
||||
if (app.Index == -1 && string.IsNullOrEmpty(app.IconPath))
|
||||
{
|
||||
@@ -367,46 +376,25 @@ namespace QuestAppLauncher
|
||||
return;
|
||||
}
|
||||
|
||||
// Get app icon in background
|
||||
var bytesIcon = await Task.Run(() =>
|
||||
{
|
||||
AndroidJNI.AttachCurrentThread();
|
||||
|
||||
try
|
||||
{
|
||||
return AppProcessor.GetAppIcon(app.IconPath, app.Index);
|
||||
}
|
||||
finally
|
||||
{
|
||||
AndroidJNI.DetachCurrentThread();
|
||||
}
|
||||
});
|
||||
|
||||
// Create new instances of our app info prefabCell
|
||||
var newObj = (GameObject)Instantiate(this.prefabCell, transform);
|
||||
|
||||
// Set app entry info
|
||||
var appEntry = newObj.GetComponent<AppEntry>();
|
||||
appEntry.scrollViewTransform = transform.parent.parent.gameObject.GetComponent<RectTransform>();
|
||||
appEntry.packageId = app.PackageName;
|
||||
appEntry.appName = app.AppName;
|
||||
appEntry.isRenameMode = isRenameMode;
|
||||
appEntry.installedApkIndex = app.Index;
|
||||
appEntry.externalIconPath = app.IconPath;
|
||||
|
||||
// Set the icon image
|
||||
if (null != bytesIcon)
|
||||
{
|
||||
var texture = new Texture2D(2, 2, TextureFormat.RGBA32, false);
|
||||
texture.filterMode = FilterMode.Trilinear;
|
||||
texture.anisoLevel = 16;
|
||||
texture.LoadImage(bytesIcon);
|
||||
var rect = new Rect(0, 0, texture.width, texture.height);
|
||||
var image = appEntry.sprite.GetComponent<Image>();
|
||||
image.sprite = Sprite.Create(texture, rect, new Vector2(0.5f, 0.5f));
|
||||
// Dynamically load icon if we're not loading the icon now
|
||||
appEntry.dynamicallyLoadIcon = !loadIcon;
|
||||
|
||||
// Preserve icon's aspect ratio
|
||||
var aspectRatioFitter = appEntry.sprite.GetComponent<AspectRatioFitter>();
|
||||
aspectRatioFitter.aspectRatio = (float)texture.width / (float)texture.height;
|
||||
// Set the icon image
|
||||
if (loadIcon)
|
||||
{
|
||||
await appEntry.LoadIcon();
|
||||
}
|
||||
|
||||
// Set app name in text
|
||||
|
||||
@@ -11,10 +11,9 @@ namespace QuestAppLauncher
|
||||
{
|
||||
public class SkyboxHandler : MonoBehaviour
|
||||
{
|
||||
// Max width and height of skybox image.
|
||||
// Max pixles of skybox image for both equirectangular and cubemap images.
|
||||
// Anything larger we'll scale down. We restrict it primarily due to memory constraints.
|
||||
const int MaxWidth = 4096;
|
||||
const int MaxHeight = 4096;
|
||||
const int MaxPixels = 4096 * 4096;
|
||||
|
||||
// Skybox selected callback
|
||||
public Action<string> OnSkyboxSelected;
|
||||
@@ -142,66 +141,26 @@ namespace QuestAppLauncher
|
||||
return;
|
||||
}
|
||||
|
||||
// Read the image
|
||||
int imageHeight = 0;
|
||||
int imageWidth = 0;
|
||||
var image = await Task.Run(() =>
|
||||
// Destroy existing skybox
|
||||
if (null != RenderSettings.skybox && RenderSettings.skybox != this.defaultSkybox)
|
||||
{
|
||||
AndroidJNI.AttachCurrentThread();
|
||||
|
||||
try
|
||||
// Destroy texture
|
||||
var oldTexture = RenderSettings.skybox.GetTexture("_Tex");
|
||||
if (null != oldTexture)
|
||||
{
|
||||
using (AndroidJavaClass unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject currentActivity = unity.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
// Call Android plugin to load the raw image.
|
||||
var jo = currentActivity.CallStatic<AndroidJavaObject>("loadRawImage", MakeAbsoluteSkymapPath(skyboxPath), MaxHeight, MaxWidth);
|
||||
if (null == jo)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Get the width, height and raw image data.
|
||||
imageWidth = jo.Get<int>("width");
|
||||
imageHeight = jo.Get<int>("height");
|
||||
var rawImage = (byte[])(Array)jo.Get<sbyte[]>("rawImage");
|
||||
|
||||
// The image is in ARGB_8888 format (Alpha, Red, Green, Blue - each 1 byte). In addition, (0, 0) coordinates are bottom-left.
|
||||
// Unity expects RGBA (with Alpha as the last byte) and origin at top-left. So we need to compensate for both.
|
||||
|
||||
// Shift alpha
|
||||
for (var i = 0; i < rawImage.Length / 4; i++)
|
||||
{
|
||||
var tmp = rawImage[i * 4 + 3];
|
||||
rawImage[i * 4 + 3] = rawImage[i * 4 + 2];
|
||||
rawImage[i * 4 + 2] = rawImage[i * 4 + 1];
|
||||
rawImage[i * 4 + 1] = rawImage[i * 4];
|
||||
rawImage[i * 4] = tmp;
|
||||
}
|
||||
|
||||
// Swap rows
|
||||
var row = new byte[imageWidth * 4];
|
||||
for (var i = 0; i < imageHeight / 2; i++)
|
||||
{
|
||||
Buffer.BlockCopy(rawImage, i * imageWidth * 4, row, 0, imageWidth * 4);
|
||||
Buffer.BlockCopy(rawImage, (imageHeight - i - 1) * imageWidth * 4, rawImage, i * imageWidth * 4, imageWidth * 4);
|
||||
Buffer.BlockCopy(row, 0, rawImage, (imageHeight - i - 1) * imageWidth * 4, imageWidth * 4);
|
||||
}
|
||||
|
||||
return rawImage;
|
||||
}
|
||||
DestroyImmediate(oldTexture);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// Fall back to using the apk icon
|
||||
Debug.LogFormat("Error decoding image [{0}]: {1}", skyboxPath, e.Message);
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
AndroidJNI.DetachCurrentThread();
|
||||
}
|
||||
});
|
||||
|
||||
// Destroy material
|
||||
DestroyImmediate(RenderSettings.skybox);
|
||||
RenderSettings.skybox = null;
|
||||
}
|
||||
|
||||
// Read the image
|
||||
var result = await AppProcessor.LoadRawImageAsync(MakeAbsoluteSkymapPath(skyboxPath), MaxPixels, true);
|
||||
var image = result.Item1;
|
||||
var imageWidth = result.Item2;
|
||||
var imageHeight = result.Item3;
|
||||
|
||||
if (null == image)
|
||||
{
|
||||
@@ -210,26 +169,39 @@ namespace QuestAppLauncher
|
||||
return;
|
||||
}
|
||||
|
||||
Texture2D texture = null;
|
||||
Material material = null;
|
||||
bool destroyTexture = false;
|
||||
|
||||
try
|
||||
{
|
||||
// Load the image into a 2D texture. We decode in background thread (above) in Java and load the raw image here
|
||||
// because Texture2D.LoadImage on the main thread can cause significant freezes since it is not async.
|
||||
var texture = new Texture2D(imageWidth, imageHeight, TextureFormat.ARGB32, false);
|
||||
texture = new Texture2D(imageWidth, imageHeight, TextureFormat.ARGB32, false);
|
||||
texture.filterMode = FilterMode.Trilinear;
|
||||
texture.anisoLevel = 16;
|
||||
texture.LoadRawTextureData(image);
|
||||
texture.Apply();
|
||||
|
||||
Material material;
|
||||
if (4 * texture.height == 3 * texture.width)
|
||||
{
|
||||
// Texture is a cube map (4:3 aspect ratio).
|
||||
// Texture is a horizontal cross cube map (4:3 aspect ratio).
|
||||
// Load cubemap shader. Also rotate x-axis by 180 degrees to compensate for platform-specific rendering differences
|
||||
// (see https://docs.unity3d.com/Manual/SL-PlatformDifferences.html).
|
||||
Debug.LogFormat("Setting cubemap skybox");
|
||||
Debug.LogFormat("Setting horizontal-cross cubemap skybox");
|
||||
destroyTexture = true;
|
||||
material = new Material(Shader.Find("skybox/cube"));
|
||||
material.SetFloat("_RotationX", 180);
|
||||
material.SetTexture("_Tex", CubemapFromTexture2D(texture));
|
||||
material.SetTexture("_Tex", CubemapFromHorizCrossTexture2D(texture));
|
||||
}
|
||||
else if (6 * texture.height == texture.width)
|
||||
{
|
||||
// Texture is a horizontal cube map (6:1 aspect ratio).
|
||||
// Load cubemap shader. Also rotate x-axis by 180 degrees to compensate for platform-specific rendering differences
|
||||
// (see https://docs.unity3d.com/Manual/SL-PlatformDifferences.html).
|
||||
Debug.LogFormat("Setting horizontal cubemap skybox");
|
||||
destroyTexture = true;
|
||||
material = new Material(Shader.Find("skybox/cube"));
|
||||
material.SetTexture("_Tex", CubemapFromHorizTexture2D(texture));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -248,14 +220,25 @@ namespace QuestAppLauncher
|
||||
Debug.LogFormat("Exception: {0}", e.Message);
|
||||
SetDefaultSkybox();
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (destroyTexture && null != texture)
|
||||
{
|
||||
DestroyImmediate(texture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets cubemap from a 2D texture (which represents 6-sided cube)
|
||||
/// Gets cubemap from a 2D texture that represents 6-sided cube as a horizontal cross:
|
||||
/// [ ] [ +y ] [ ]
|
||||
/// [ -x ] [ +z ] [ +x ]
|
||||
/// [ ] [ -y ] [ ]
|
||||
/// Note: This is less memory efficient than horizontal representation below.
|
||||
/// </summary>
|
||||
/// <param name="texture"></param>
|
||||
/// <returns></returns>
|
||||
private static Cubemap CubemapFromTexture2D(Texture2D texture)
|
||||
private static Cubemap CubemapFromHorizCrossTexture2D(Texture2D texture)
|
||||
{
|
||||
int cubedim = texture.width / 4;
|
||||
Cubemap cube = new Cubemap(cubedim, TextureFormat.ARGB32, false);
|
||||
@@ -269,6 +252,27 @@ namespace QuestAppLauncher
|
||||
return cube;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets cubemap from a 2D texture that represents 6-sided cube as a horizontal layout:
|
||||
/// [ +x ] [ -x ] [ +y ] [ -y ] [ +z ] [ -z ]
|
||||
/// Note: This is the recommended representation of cube map as it is more efficient in terms of memory.
|
||||
/// </summary>
|
||||
/// <param name="texture"></param>
|
||||
/// <returns></returns>
|
||||
private static Cubemap CubemapFromHorizTexture2D(Texture2D texture)
|
||||
{
|
||||
int cubedim = texture.height;
|
||||
Cubemap cube = new Cubemap(cubedim, TextureFormat.ARGB32, false);
|
||||
cube.SetPixels(texture.GetPixels(0, 0, cubedim, cubedim), CubemapFace.PositiveX);
|
||||
cube.SetPixels(texture.GetPixels(cubedim, 0, cubedim, cubedim), CubemapFace.NegativeX);
|
||||
cube.SetPixels(texture.GetPixels(2 * cubedim, 0, cubedim, cubedim), CubemapFace.PositiveY);
|
||||
cube.SetPixels(texture.GetPixels(3 * cubedim, 0, cubedim, cubedim), CubemapFace.NegativeY);
|
||||
cube.SetPixels(texture.GetPixels(4 * cubedim, 0, cubedim, cubedim), CubemapFace.PositiveZ);
|
||||
cube.SetPixels(texture.GetPixels(5 * cubedim, 0, cubedim, cubedim), CubemapFace.NegativeZ);
|
||||
cube.Apply();
|
||||
return cube;
|
||||
}
|
||||
|
||||
public void SetDefaultSkybox()
|
||||
{
|
||||
Debug.LogFormat("Setting default skybox");
|
||||
|
||||
+644
-9
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+24150
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a2e04df655b4be45aafb9f149961295
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because one or more lines are too long
@@ -3,12 +3,12 @@
|
||||
"com.unity.2d.sprite": "1.0.0",
|
||||
"com.unity.collab-proxy": "1.2.16",
|
||||
"com.unity.ext.nunit": "1.0.0",
|
||||
"com.unity.ide.rider": "1.0.8",
|
||||
"com.unity.ide.rider": "1.1.0",
|
||||
"com.unity.ide.visualstudio": "1.0.11",
|
||||
"com.unity.ide.vscode": "1.0.7",
|
||||
"com.unity.test-framework": "1.0.16",
|
||||
"com.unity.test-framework": "1.1.1",
|
||||
"com.unity.textmeshpro": "2.0.1",
|
||||
"com.unity.timeline": "1.1.0",
|
||||
"com.unity.timeline": "1.2.2",
|
||||
"com.unity.ugui": "1.0.0",
|
||||
"com.unity.xr.oculus.android": "1.36.0",
|
||||
"com.unity.modules.ai": "1.0.0",
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,7 +3,7 @@
|
||||
--- !u!129 &1
|
||||
PlayerSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 17
|
||||
serializedVersion: 20
|
||||
productGUID: e3d713ba598c59c439233f4da5f7221d
|
||||
AndroidProfiler: 0
|
||||
AndroidFilterTouchesWhenObscured: 0
|
||||
@@ -52,8 +52,7 @@ PlayerSettings:
|
||||
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
|
||||
iosShowActivityIndicatorOnLoading: -1
|
||||
androidShowActivityIndicatorOnLoading: -1
|
||||
iosAppInBackgroundBehavior: 0
|
||||
displayResolutionDialog: 0
|
||||
iosUseCustomAppBackgroundBehavior: 0
|
||||
iosAllowHTTPDownload: 1
|
||||
allowedAutorotateToPortrait: 1
|
||||
allowedAutorotateToPortraitUpsideDown: 1
|
||||
@@ -85,7 +84,6 @@ PlayerSettings:
|
||||
useMacAppStoreValidation: 0
|
||||
macAppStoreCategory: public.app-category.games
|
||||
gpuSkinning: 1
|
||||
graphicsJobs: 0
|
||||
xboxPIXTextureCapture: 0
|
||||
xboxEnableAvatar: 0
|
||||
xboxEnableKinect: 0
|
||||
@@ -93,7 +91,6 @@ PlayerSettings:
|
||||
xboxEnableFitness: 0
|
||||
visibleInBackground: 1
|
||||
allowFullscreenSwitch: 1
|
||||
graphicsJobMode: 0
|
||||
fullscreenMode: 1
|
||||
xboxSpeechDB: 0
|
||||
xboxEnableHeadOrientation: 0
|
||||
@@ -120,7 +117,7 @@ PlayerSettings:
|
||||
16:10: 1
|
||||
16:9: 1
|
||||
Others: 1
|
||||
bundleVersion: 0.10
|
||||
bundleVersion: 0.10.1
|
||||
preloadedAssets: []
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
@@ -151,9 +148,10 @@ PlayerSettings:
|
||||
sharedDepthBuffer: 1
|
||||
dashSupport: 1
|
||||
lowOverheadMode: 0
|
||||
protectedContext: 0
|
||||
v2Signing: 1
|
||||
enable360StereoCapture: 0
|
||||
isWsaHolographicRemotingEnabled: 0
|
||||
protectGraphicsMemory: 0
|
||||
enableFrameTimingStats: 0
|
||||
useHDRDisplay: 0
|
||||
D3DHDRBitDepth: 0
|
||||
@@ -274,7 +272,6 @@ PlayerSettings:
|
||||
androidGamepadSupportLevel: 0
|
||||
AndroidValidateAppBundleSize: 1
|
||||
AndroidAppBundleSizeToValidate: 150
|
||||
resolutionDialogBanner: {fileID: 0}
|
||||
m_BuildTargetIcons: []
|
||||
m_BuildTargetPlatformIcons:
|
||||
- m_BuildTarget: Android
|
||||
@@ -399,6 +396,38 @@ PlayerSettings:
|
||||
- m_BuildTarget: WebGL
|
||||
m_StaticBatching: 0
|
||||
m_DynamicBatching: 0
|
||||
m_BuildTargetGraphicsJobs:
|
||||
- m_BuildTarget: MacStandaloneSupport
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: Switch
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: MetroSupport
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: AppleTVSupport
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: BJMSupport
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: LinuxStandaloneSupport
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: PS4Player
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: iOSSupport
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: WindowsStandaloneSupport
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: XboxOnePlayer
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: LuminSupport
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: AndroidPlayer
|
||||
m_GraphicsJobs: 0
|
||||
- m_BuildTarget: WebGLSupport
|
||||
m_GraphicsJobs: 0
|
||||
m_BuildTargetGraphicsJobMode:
|
||||
- m_BuildTarget: PS4Player
|
||||
m_GraphicsJobMode: 0
|
||||
- m_BuildTarget: XboxOnePlayer
|
||||
m_GraphicsJobMode: 0
|
||||
m_BuildTargetGraphicsAPIs:
|
||||
- m_BuildTarget: AndroidPlayer
|
||||
m_APIs: 0b000000
|
||||
@@ -745,13 +774,6 @@ PlayerSettings:
|
||||
luminVersion:
|
||||
m_VersionCode: 1
|
||||
m_VersionName:
|
||||
facebookSdkVersion: 7.9.4
|
||||
facebookAppId:
|
||||
facebookCookies: 1
|
||||
facebookLogging: 1
|
||||
facebookStatus: 1
|
||||
facebookXfbml: 0
|
||||
facebookFrictionlessRequests: 1
|
||||
apiCompatibilityLevel: 6
|
||||
cloudProjectId:
|
||||
framebufferDepthMemorylessMode: 0
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
m_EditorVersion: 2019.3.0a8
|
||||
m_EditorVersionWithRevision: 2019.3.0a8 (8ea4afdbfa47)
|
||||
m_EditorVersion: 2019.3.0b4
|
||||
m_EditorVersionWithRevision: 2019.3.0b4 (3271e9fc5036)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user