diff --git a/Assets/Art/Main_Page/Main_AdvertisingButton.png b/Assets/Art/Main_Page/Main_AdvertisingButton.png deleted file mode 100644 index 1f473fe..0000000 Binary files a/Assets/Art/Main_Page/Main_AdvertisingButton.png and /dev/null differ diff --git a/Assets/Art/Main_Page/Main_Coals_Add.png b/Assets/Art/Main_Page/Main_Coals_Add.png deleted file mode 100644 index f9018fe..0000000 Binary files a/Assets/Art/Main_Page/Main_Coals_Add.png and /dev/null differ diff --git a/Assets/Art/Main_Page/Main_Coals_Card.png b/Assets/Art/Main_Page/Main_Coals_Card.png deleted file mode 100644 index c1c337a..0000000 Binary files a/Assets/Art/Main_Page/Main_Coals_Card.png and /dev/null differ diff --git a/Assets/Art/Main_Page/Main_Coins_Add.png b/Assets/Art/Main_Page/Main_Coins_Add.png deleted file mode 100644 index fb7fe16..0000000 Binary files a/Assets/Art/Main_Page/Main_Coins_Add.png and /dev/null differ diff --git a/Assets/Art/Main_Page/Main_Coins_Card.png b/Assets/Art/Main_Page/Main_Coins_Card.png deleted file mode 100644 index bc158e3..0000000 Binary files a/Assets/Art/Main_Page/Main_Coins_Card.png and /dev/null differ diff --git a/Assets/Art/Main_Page/Main_SetButton.png b/Assets/Art/Main_Page/Main_SetButton.png deleted file mode 100644 index 9d18631..0000000 Binary files a/Assets/Art/Main_Page/Main_SetButton.png and /dev/null differ diff --git a/Assets/Art/Main_Page/Main_TaskButton.png b/Assets/Art/Main_Page/Main_TaskButton.png deleted file mode 100644 index 07d924c..0000000 Binary files a/Assets/Art/Main_Page/Main_TaskButton.png and /dev/null differ diff --git a/Assets/Plugins/Easy Save 3.meta b/Assets/Art/UI_Texture.meta similarity index 77% rename from Assets/Plugins/Easy Save 3.meta rename to Assets/Art/UI_Texture.meta index 42f40ae..ce75699 100644 --- a/Assets/Plugins/Easy Save 3.meta +++ b/Assets/Art/UI_Texture.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c62843c57c147904b9ebffefca974d04 +guid: 2c0cf1c76f7395d4a88c048aee0842ed folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Plugins/Easy Save 3/Change Log.meta b/Assets/Art/UI_Texture/Advertisement_Panel.meta similarity index 77% rename from Assets/Plugins/Easy Save 3/Change Log.meta rename to Assets/Art/UI_Texture/Advertisement_Panel.meta index d3a1e9a..f065f40 100644 --- a/Assets/Plugins/Easy Save 3/Change Log.meta +++ b/Assets/Art/UI_Texture/Advertisement_Panel.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3115cc2dd2d49d742b3cfe0b237788ce +guid: c11ca0775cdf21e4bb3d0cf378f162fd folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Background.png b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Background.png new file mode 100644 index 0000000..7f40a88 Binary files /dev/null and b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Background.png differ diff --git a/Assets/Plugins/Easy Save 3/Editor/es3Logo16x16-bw.png.meta b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Background.png.meta similarity index 58% rename from Assets/Plugins/Easy Save 3/Editor/es3Logo16x16-bw.png.meta rename to Assets/Art/UI_Texture/Advertisement_Panel/Ad_Background.png.meta index 94cb944..4ea5162 100644 --- a/Assets/Plugins/Easy Save 3/Editor/es3Logo16x16-bw.png.meta +++ b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Background.png.meta @@ -1,9 +1,9 @@ fileFormatVersion: 2 -guid: 3ae63f85ae558634d83caaf5a332d1ba +guid: e0cf9da9d9c60da4f9e8f6541f479704 TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 11 + serializedVersion: 12 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +20,12 @@ TextureImporter: 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 @@ -31,16 +34,16 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 + filterMode: 1 aniso: 1 - mipBias: -100 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 1 nPOTScale: 0 lightmap: 0 compressionQuality: 50 - spriteMode: 0 + spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 @@ -51,13 +54,18 @@ TextureImporter: alphaUsage: 1 alphaIsTransparency: 1 spriteTessellationDetail: -1 - textureType: 2 + 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 @@ -69,6 +77,20 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + 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 @@ -81,6 +103,33 @@ TextureImporter: 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 + - serializedVersion: 3 + buildTarget: Server + 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: @@ -89,16 +138,16 @@ TextureImporter: outline: [] physicsShape: [] bones: [] - spriteID: + spriteID: 5e97eb03825dee720800000000000000 internalID: 0 vertices: [] indices: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_CantClick_Button.png b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_CantClick_Button.png new file mode 100644 index 0000000..f56c60e Binary files /dev/null and b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_CantClick_Button.png differ diff --git a/Assets/Plugins/Easy Save 3/Editor/es3Logo16x16.png.meta b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_CantClick_Button.png.meta similarity index 50% rename from Assets/Plugins/Easy Save 3/Editor/es3Logo16x16.png.meta rename to Assets/Art/UI_Texture/Advertisement_Panel/Ad_CantClick_Button.png.meta index fc64722..5e2a26b 100644 --- a/Assets/Plugins/Easy Save 3/Editor/es3Logo16x16.png.meta +++ b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_CantClick_Button.png.meta @@ -1,17 +1,18 @@ fileFormatVersion: 2 -guid: 4697547d67ec24040b678d7b35835286 -timeCreated: 1495455081 -licenseType: Store +guid: 155f84b692145d54faf5e8962c5cdd39 TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 mipmaps: mipMapMode: 0 enableMipMap: 0 - sRGBTexture: 0 + sRGBTexture: 1 linearTexture: 0 fadeOut: 0 borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: @@ -19,7 +20,12 @@ TextureImporter: 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 @@ -27,98 +33,121 @@ TextureImporter: textureFormat: 1 maxTextureSize: 2048 textureSettings: - filterMode: -1 + serializedVersion: 2 + filterMode: 1 aniso: 1 - mipBias: -1 - wrapMode: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 nPOTScale: 0 lightmap: 0 compressionQuality: 50 - spriteMode: 0 + spriteMode: 1 spriteExtrude: 1 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: 2 + 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: - - buildTarget: DefaultTexturePlatform + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform maxTextureSize: 2048 + resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - - buildTarget: Standalone + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL maxTextureSize: 2048 + resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - - buildTarget: iPhone + 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 - - buildTarget: tvOS + 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 - - buildTarget: Android - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Tizen - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: WebGL - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Samsung TV + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server 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: [] - spritePackingTag: + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Cant_Card_Background.png b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Cant_Card_Background.png new file mode 100644 index 0000000..cdf058a Binary files /dev/null and b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Cant_Card_Background.png differ diff --git a/Assets/Plugins/Easy Save 3/Editor/checkmark.png.meta b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Cant_Card_Background.png.meta similarity index 50% rename from Assets/Plugins/Easy Save 3/Editor/checkmark.png.meta rename to Assets/Art/UI_Texture/Advertisement_Panel/Ad_Cant_Card_Background.png.meta index e4cf356..ec0a0b6 100644 --- a/Assets/Plugins/Easy Save 3/Editor/checkmark.png.meta +++ b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Cant_Card_Background.png.meta @@ -1,17 +1,18 @@ fileFormatVersion: 2 -guid: 9d92f481545af4a45b06e8fe44778d93 -timeCreated: 1484046036 -licenseType: Store +guid: 170220eb976e24840b2578c4e58a2449 TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 mipmaps: mipMapMode: 0 enableMipMap: 0 - sRGBTexture: 0 + sRGBTexture: 1 linearTexture: 0 fadeOut: 0 borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: @@ -19,7 +20,12 @@ TextureImporter: 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 @@ -27,98 +33,121 @@ TextureImporter: textureFormat: 1 maxTextureSize: 2048 textureSettings: - filterMode: -1 + serializedVersion: 2 + filterMode: 1 aniso: 1 - mipBias: -1 - wrapMode: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 nPOTScale: 0 lightmap: 0 compressionQuality: 50 - spriteMode: 0 + spriteMode: 1 spriteExtrude: 1 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: 2 + 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: - - buildTarget: DefaultTexturePlatform + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform maxTextureSize: 2048 + resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - - buildTarget: Standalone + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL maxTextureSize: 2048 + resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - - buildTarget: iPhone + 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 - - buildTarget: tvOS + 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 - - buildTarget: Android - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Tizen - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: WebGL - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Samsung TV + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server 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: [] - spritePackingTag: + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Background.png b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Background.png new file mode 100644 index 0000000..460fe3d Binary files /dev/null and b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Background.png differ diff --git a/Assets/Plugins/Easy Save 3/Editor/checkmarkSmall.png.meta b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Background.png.meta similarity index 50% rename from Assets/Plugins/Easy Save 3/Editor/checkmarkSmall.png.meta rename to Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Background.png.meta index 32ece54..d397ed0 100644 --- a/Assets/Plugins/Easy Save 3/Editor/checkmarkSmall.png.meta +++ b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Background.png.meta @@ -1,17 +1,18 @@ fileFormatVersion: 2 -guid: ca44f6eb870d244cfb1c83054a69ffc3 -timeCreated: 1484046036 -licenseType: Store +guid: 6bcff93716d795743a79c0df9179c1a1 TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 mipmaps: mipMapMode: 0 enableMipMap: 0 - sRGBTexture: 0 + sRGBTexture: 1 linearTexture: 0 fadeOut: 0 borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: @@ -19,7 +20,12 @@ TextureImporter: 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 @@ -27,98 +33,121 @@ TextureImporter: textureFormat: 1 maxTextureSize: 2048 textureSettings: - filterMode: -1 + serializedVersion: 2 + filterMode: 1 aniso: 1 - mipBias: -1 - wrapMode: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 nPOTScale: 0 lightmap: 0 compressionQuality: 50 - spriteMode: 0 + spriteMode: 1 spriteExtrude: 1 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: 2 + 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: - - buildTarget: DefaultTexturePlatform + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform maxTextureSize: 2048 + resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - - buildTarget: Standalone + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL maxTextureSize: 2048 + resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - - buildTarget: iPhone + 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 - - buildTarget: tvOS + 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 - - buildTarget: Android - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Tizen - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: WebGL - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Samsung TV + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server 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: [] - spritePackingTag: + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content1.png b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content1.png new file mode 100644 index 0000000..7b0b274 Binary files /dev/null and b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content1.png differ diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content1.png.meta b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content1.png.meta new file mode 100644 index 0000000..8e5b83f --- /dev/null +++ b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content1.png.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: ad71f422f6b2ced41857efbb713f7261 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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: 1 + 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: WebGL + 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 + - serializedVersion: 3 + buildTarget: Server + 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: diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content2.png b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content2.png new file mode 100644 index 0000000..f59ce1f Binary files /dev/null and b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content2.png differ diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content2.png.meta b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content2.png.meta new file mode 100644 index 0000000..edbf2b3 --- /dev/null +++ b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content2.png.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: bc735b46f88f4204287d6270438f8121 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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: 1 + 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: WebGL + 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 + - serializedVersion: 3 + buildTarget: Server + 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: diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content3.png b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content3.png new file mode 100644 index 0000000..49bc5dd Binary files /dev/null and b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content3.png differ diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content3.png.meta b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content3.png.meta new file mode 100644 index 0000000..5c4badf --- /dev/null +++ b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Card_Content3.png.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: 13d8b9166d5e73841b45d5faf30ba7af +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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: 1 + 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: WebGL + 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 + - serializedVersion: 3 + buildTarget: Server + 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: diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Click_Button.png b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Click_Button.png new file mode 100644 index 0000000..75525ca Binary files /dev/null and b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Click_Button.png differ diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Click_Button.png.meta b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Click_Button.png.meta new file mode 100644 index 0000000..2fc8449 --- /dev/null +++ b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Click_Button.png.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: 1de2a1864218dd747803b1d42b98e6f9 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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: 1 + 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: WebGL + 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 + - serializedVersion: 3 + buildTarget: Server + 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: diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Close_Button.png b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Close_Button.png new file mode 100644 index 0000000..531fe0f Binary files /dev/null and b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Close_Button.png differ diff --git a/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Close_Button.png.meta b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Close_Button.png.meta new file mode 100644 index 0000000..8b49ee8 --- /dev/null +++ b/Assets/Art/UI_Texture/Advertisement_Panel/Ad_Close_Button.png.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: 02287eb21367fe44a84ce41ea02b4142 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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: 1 + 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: WebGL + 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 + - serializedVersion: 3 + buildTarget: Server + 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: diff --git a/Assets/Art/Common.meta b/Assets/Art/UI_Texture/Common.meta similarity index 77% rename from Assets/Art/Common.meta rename to Assets/Art/UI_Texture/Common.meta index 3320f48..c705be4 100644 --- a/Assets/Art/Common.meta +++ b/Assets/Art/UI_Texture/Common.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 146d00a25b06b40bbb9fe5d19f86c1a7 +guid: a1ddd2fd47c22dc42b518fcdb37846b8 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Art/Common/Common_Background.png b/Assets/Art/UI_Texture/Common/Common_Background.png similarity index 100% rename from Assets/Art/Common/Common_Background.png rename to Assets/Art/UI_Texture/Common/Common_Background.png diff --git a/Assets/Art/Common/Common_Background.png.meta b/Assets/Art/UI_Texture/Common/Common_Background.png.meta similarity index 90% rename from Assets/Art/Common/Common_Background.png.meta rename to Assets/Art/UI_Texture/Common/Common_Background.png.meta index d251fdf..dc3f7ca 100644 --- a/Assets/Art/Common/Common_Background.png.meta +++ b/Assets/Art/UI_Texture/Common/Common_Background.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0484d213daa7f4607a761eafc522e0f8 +guid: 92487f7207006c94f965bb75bf2df685 TextureImporter: internalIDToNameTable: [] externalObjects: {} @@ -106,19 +106,6 @@ TextureImporter: ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: iPhone - 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 diff --git a/Assets/Art/UI_Texture/Common/Common_Icon_Coals.png b/Assets/Art/UI_Texture/Common/Common_Icon_Coals.png new file mode 100644 index 0000000..2ef47d3 Binary files /dev/null and b/Assets/Art/UI_Texture/Common/Common_Icon_Coals.png differ diff --git a/Assets/Art/UI_Texture/Common/Common_Icon_Coals.png.meta b/Assets/Art/UI_Texture/Common/Common_Icon_Coals.png.meta new file mode 100644 index 0000000..80663b2 --- /dev/null +++ b/Assets/Art/UI_Texture/Common/Common_Icon_Coals.png.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: 97181ab7ca4fb024e80666a1f3ed33b8 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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: 1 + 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: WebGL + 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 + - serializedVersion: 3 + buildTarget: Server + 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: diff --git a/Assets/Art/UI_Texture/Common/Common_Icon_Coins.png b/Assets/Art/UI_Texture/Common/Common_Icon_Coins.png new file mode 100644 index 0000000..8c6ff6b Binary files /dev/null and b/Assets/Art/UI_Texture/Common/Common_Icon_Coins.png differ diff --git a/Assets/Art/UI_Texture/Common/Common_Icon_Coins.png.meta b/Assets/Art/UI_Texture/Common/Common_Icon_Coins.png.meta new file mode 100644 index 0000000..3010a56 --- /dev/null +++ b/Assets/Art/UI_Texture/Common/Common_Icon_Coins.png.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: 05cd9560a34033344a85ce0efea8eb6e +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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: 1 + 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: WebGL + 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 + - serializedVersion: 3 + buildTarget: Server + 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: diff --git a/Assets/Art/Load_Page.meta b/Assets/Art/UI_Texture/Load_Page.meta similarity index 77% rename from Assets/Art/Load_Page.meta rename to Assets/Art/UI_Texture/Load_Page.meta index e4f4787..a06cd45 100644 --- a/Assets/Art/Load_Page.meta +++ b/Assets/Art/UI_Texture/Load_Page.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9608d6b6ad9c7402cb3c106aae954ba2 +guid: c5cafceb21bb2e14486a017253b7777f folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif.meta similarity index 77% rename from Assets/Art/Load_Page/Load_Gif.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif.meta index 2e5b66c..a7bb5ac 100644 --- a/Assets/Art/Load_Page/Load_Gif.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9ca9b870c4f26496ca99741d171a0e7e +guid: 12522986922042d459276ea1150f8390 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00000.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00000.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00000.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00000.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00000.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00000.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00000.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00000.png.meta index d14b674..3f4a328 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00000.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00000.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d9e3d3e2bf8b05f4fb76cc2500a18dc1 +guid: 5ae8110a1e5fe804791e37ccfe43f996 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00001.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00001.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00001.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00001.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00001.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00001.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00001.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00001.png.meta index c81d646..96e73d1 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00001.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00001.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e710b833113eb0041a91a0c1dcfc76b3 +guid: f3ad507e54fadfe4da96b231fe1ab64d TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00002.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00002.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00002.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00002.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00002.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00002.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00002.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00002.png.meta index 2d75d0e..ac76fa0 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00002.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00002.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 06a18d0a81151ab4d889d93c41d3da7b +guid: 9dc7523fb58c4f44095735a0509ac0e1 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00003.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00003.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00003.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00003.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00003.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00003.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00003.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00003.png.meta index 641d20d..7648415 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00003.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00003.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9656adb861df2ed4f9c70b0277f1be60 +guid: 56b35e85b31d5d24380d17684495de21 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00004.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00004.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00004.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00004.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00004.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00004.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00004.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00004.png.meta index 0fb3feb..4854942 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00004.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00004.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 166776a7a433b294687089cdbb4d60da +guid: de4bbc0ed244269428ac660722f26286 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00005.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00005.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00005.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00005.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00005.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00005.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00005.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00005.png.meta index 3744176..80fe282 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00005.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00005.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6a932a0b493dda74fab31b34451d6a8f +guid: c618e8b94c0df044ca5163d33b3ab9e2 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00006.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00006.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00006.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00006.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00006.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00006.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00006.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00006.png.meta index 0d737db..b5fc276 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00006.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00006.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 42b21e9f4113d4d46a3d7506952bffc7 +guid: 53c7072871e5dd34dad2c1d5df83f127 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00007.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00007.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00007.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00007.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00007.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00007.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00007.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00007.png.meta index 379f489..47d9553 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00007.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00007.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9de8b16aa706b0744a889cc413727929 +guid: 4c725a596a3720f4391a906763e80035 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00008.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00008.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00008.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00008.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00008.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00008.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00008.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00008.png.meta index 3c3608e..d151080 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00008.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00008.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2c64369fbeeda2f4e9733cc6648a6d86 +guid: 7f26845d76effc04c88dfd2055ce8152 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00009.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00009.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00009.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00009.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00009.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00009.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00009.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00009.png.meta index 6f0b04e..e9677d0 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00009.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00009.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6614d8abc47bb4544b8f9e1c7683d801 +guid: 5d35b3143a9f4604b8be0ffd3f2cde85 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00010.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00010.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00010.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00010.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00010.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00010.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00010.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00010.png.meta index 25d1b7e..ffada43 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00010.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00010.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b93b4d7c1e5d21c429c9b6d42c77be71 +guid: f7908d2520425fd4ba34a38b8bda0056 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00011.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00011.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00011.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00011.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00011.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00011.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00011.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00011.png.meta index 386faa5..31a5985 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00011.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00011.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f720e06c1a4feba4489956fa20b8885e +guid: 1e41b869a7a287648b72623cf75be86c TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00012.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00012.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00012.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00012.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00012.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00012.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00012.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00012.png.meta index e77c10f..f74dd9f 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00012.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00012.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 944970b4a0177fb439fbe95e14393de1 +guid: 81a3e63b168a483489fccda94b05cb25 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00013.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00013.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00013.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00013.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00013.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00013.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00013.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00013.png.meta index 4757a2d..7b555c8 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00013.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00013.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b77ccba3b03f47342ad4af2b054b2531 +guid: 936ba86fb8184d84098472a114d2ef2f TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00014.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00014.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00014.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00014.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00014.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00014.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00014.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00014.png.meta index e588e58..ee1c92e 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00014.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00014.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 27e903f6e45d1764c83ac334d03c0355 +guid: 6de0cd7dde37bad408a943fd51f087b1 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00015.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00015.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00015.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00015.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00015.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00015.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00015.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00015.png.meta index 9542551..07d4751 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00015.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00015.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 37314d17d3193b54e98c71ce8ebb144f +guid: e00a0d8663283a74282552b1dd1ba9d3 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00016.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00016.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00016.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00016.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00016.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00016.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00016.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00016.png.meta index 57affad..c403785 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00016.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00016.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7c3f8bef007632345b49aa4e6053b1ba +guid: 9158c959af1c56148b45c0561419b368 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00017.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00017.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00017.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00017.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00017.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00017.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00017.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00017.png.meta index fc11292..6639e6c 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00017.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00017.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: cc61a258e74d70549a0c4cfb51f57e9c +guid: 6ec509f9533215a41bf12eb6cf211633 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00018.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00018.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00018.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00018.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00018.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00018.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00018.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00018.png.meta index d72c86d..9663d1e 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00018.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00018.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8664da2c7cdb523488f747bb38a1a5d8 +guid: dc4ed08756b15f346b0867394b3e4fab TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00019.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00019.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00019.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00019.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00019.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00019.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00019.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00019.png.meta index 5aafcda..536e2d8 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00019.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00019.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ce6b3f40616a283429629d14ce6b0f96 +guid: d234eb447c1e1934497cce91fd8844f2 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00020.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00020.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00020.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00020.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00020.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00020.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00020.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00020.png.meta index 18dc383..3d2ccf2 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00020.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00020.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: dd10dc9f007b1c84da1cb67f33edbc2c +guid: 354414c8e3df2a445b9176282505a1b0 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00021.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00021.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00021.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00021.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00021.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00021.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00021.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00021.png.meta index cd884ca..e22b440 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00021.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00021.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 944fdff4c5a470548b996a757c22f1ac +guid: 61d329a9a82723042a687ccb5bd7c3d3 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00022.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00022.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00022.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00022.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00022.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00022.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00022.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00022.png.meta index cf4a7c2..5841dee 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00022.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00022.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ab317645fac4ddc4fb5c5896199d9736 +guid: dfee0ff9c4679854081d511b95d94979 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00023.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00023.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00023.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00023.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00023.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00023.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00023.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00023.png.meta index 388fd0f..9a331f9 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00023.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00023.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3c601e420debebe408a9796208d200c3 +guid: e39bc33cf5fc49d46b2dd58e6041d79b TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00024.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00024.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00024.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00024.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00024.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00024.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00024.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00024.png.meta index 60d26a9..15f7774 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00024.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00024.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 052a6af37bcec8441a333e392221dbab +guid: a5274461a59bb494ba219cc3af537a0d TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00025.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00025.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00025.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00025.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00025.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00025.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00025.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00025.png.meta index 548c880..88215b3 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00025.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00025.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 160e339fe4ad3934ba5323e03e0ab599 +guid: ba6c46292adb4314498abdc0cda58dee TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00026.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00026.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00026.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00026.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00026.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00026.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00026.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00026.png.meta index a3018f1..a702e55 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00026.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00026.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b2b58e66b652a884097a005e0a70352c +guid: fc6eee397c538a647a43cff6005dbd3c TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00027.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00027.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00027.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00027.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00027.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00027.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00027.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00027.png.meta index 735f015..0639ea6 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00027.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00027.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: fe31b92b2c0a0a04dbfa6f12889a2611 +guid: b828173b0e2901c4780631c35dd9f062 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00028.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00028.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00028.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00028.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00028.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00028.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00028.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00028.png.meta index 066f80e..59b3a89 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00028.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00028.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f2ee0447c86dcf740b1492fcf0e5bfd4 +guid: c3505219f63db38448789f67d3af944d TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00029.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00029.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00029.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00029.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00029.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00029.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00029.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00029.png.meta index 8829150..af99a8d 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00029.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00029.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f83f3869377eeff4d995549350c10526 +guid: 59a56460c5532fb45a04906dbf81d8fd TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00030.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00030.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00030.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00030.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00030.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00030.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00030.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00030.png.meta index 5e36fb2..db0793f 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00030.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00030.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 39a7480d9738a9542909a7efc951dd13 +guid: ee334db7bd9a09b458ee34586d33334c TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00031.png b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00031.png similarity index 100% rename from Assets/Art/Load_Page/Load_Gif/加载页_00031.png rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00031.png diff --git a/Assets/Art/Load_Page/Load_Gif/加载页_00031.png.meta b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00031.png.meta similarity index 98% rename from Assets/Art/Load_Page/Load_Gif/加载页_00031.png.meta rename to Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00031.png.meta index 918eef4..6f10052 100644 --- a/Assets/Art/Load_Page/Load_Gif/加载页_00031.png.meta +++ b/Assets/Art/UI_Texture/Load_Page/Load_Gif/加载页_00031.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 62c6a3d8d8d1e3342854d620f5c01790 +guid: 750ab96de40a1444aa541f9c36d4acae TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/UI_Texture/Load_Page/load.gif b/Assets/Art/UI_Texture/Load_Page/load.gif new file mode 100644 index 0000000..86ff35c Binary files /dev/null and b/Assets/Art/UI_Texture/Load_Page/load.gif differ diff --git a/Assets/Art/UI_Texture/Load_Page/load.gif.meta b/Assets/Art/UI_Texture/Load_Page/load.gif.meta new file mode 100644 index 0000000..d4f09f1 --- /dev/null +++ b/Assets/Art/UI_Texture/Load_Page/load.gif.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: 403b869a4bf1a764687f7b39ee395149 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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: 1 + 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: WebGL + 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 + - serializedVersion: 3 + buildTarget: Server + 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: diff --git a/Assets/Art/Main_Page.meta b/Assets/Art/UI_Texture/Main_Page.meta similarity index 77% rename from Assets/Art/Main_Page.meta rename to Assets/Art/UI_Texture/Main_Page.meta index 7894c00..cbff31d 100644 --- a/Assets/Art/Main_Page.meta +++ b/Assets/Art/UI_Texture/Main_Page.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4e0ebea314b07504098c9aae4eec947a +guid: 0e11fb747128d4b459b4dcf38c27a34b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Art/UI_Texture/Main_Page/Main_AdvertisingButton.png b/Assets/Art/UI_Texture/Main_Page/Main_AdvertisingButton.png new file mode 100644 index 0000000..b236fd0 Binary files /dev/null and b/Assets/Art/UI_Texture/Main_Page/Main_AdvertisingButton.png differ diff --git a/Assets/Art/Main_Page/Main_AdvertisingButton.png.meta b/Assets/Art/UI_Texture/Main_Page/Main_AdvertisingButton.png.meta similarity index 98% rename from Assets/Art/Main_Page/Main_AdvertisingButton.png.meta rename to Assets/Art/UI_Texture/Main_Page/Main_AdvertisingButton.png.meta index c843dfb..3cc3aee 100644 --- a/Assets/Art/Main_Page/Main_AdvertisingButton.png.meta +++ b/Assets/Art/UI_Texture/Main_Page/Main_AdvertisingButton.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 16f808b591fa9bd479bcea65f74196db +guid: 21cb31a2edc91324dbb82da9a5645e08 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/UI_Texture/Main_Page/Main_Coals_Add.png b/Assets/Art/UI_Texture/Main_Page/Main_Coals_Add.png new file mode 100644 index 0000000..adb2b0a Binary files /dev/null and b/Assets/Art/UI_Texture/Main_Page/Main_Coals_Add.png differ diff --git a/Assets/Art/Main_Page/Main_Coals_Add.png.meta b/Assets/Art/UI_Texture/Main_Page/Main_Coals_Add.png.meta similarity index 98% rename from Assets/Art/Main_Page/Main_Coals_Add.png.meta rename to Assets/Art/UI_Texture/Main_Page/Main_Coals_Add.png.meta index 28dc9ed..6f6abe0 100644 --- a/Assets/Art/Main_Page/Main_Coals_Add.png.meta +++ b/Assets/Art/UI_Texture/Main_Page/Main_Coals_Add.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7ea702f19b411334d91b848b7b3ec0fc +guid: 634d1608ed32bd24fb7d64884c3094d8 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/UI_Texture/Main_Page/Main_Coals_Card.png b/Assets/Art/UI_Texture/Main_Page/Main_Coals_Card.png new file mode 100644 index 0000000..bab32a5 Binary files /dev/null and b/Assets/Art/UI_Texture/Main_Page/Main_Coals_Card.png differ diff --git a/Assets/Art/Main_Page/Main_Coals_Card.png.meta b/Assets/Art/UI_Texture/Main_Page/Main_Coals_Card.png.meta similarity index 98% rename from Assets/Art/Main_Page/Main_Coals_Card.png.meta rename to Assets/Art/UI_Texture/Main_Page/Main_Coals_Card.png.meta index 9c19f06..5effece 100644 --- a/Assets/Art/Main_Page/Main_Coals_Card.png.meta +++ b/Assets/Art/UI_Texture/Main_Page/Main_Coals_Card.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 48add8a53e11aac4b934d54914826d07 +guid: 36f4d1b64c7371542858276327a894f2 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/UI_Texture/Main_Page/Main_Coins_Add.png b/Assets/Art/UI_Texture/Main_Page/Main_Coins_Add.png new file mode 100644 index 0000000..4ec6e34 Binary files /dev/null and b/Assets/Art/UI_Texture/Main_Page/Main_Coins_Add.png differ diff --git a/Assets/Art/Main_Page/Main_Coins_Add.png.meta b/Assets/Art/UI_Texture/Main_Page/Main_Coins_Add.png.meta similarity index 98% rename from Assets/Art/Main_Page/Main_Coins_Add.png.meta rename to Assets/Art/UI_Texture/Main_Page/Main_Coins_Add.png.meta index 60c1b25..eb7a846 100644 --- a/Assets/Art/Main_Page/Main_Coins_Add.png.meta +++ b/Assets/Art/UI_Texture/Main_Page/Main_Coins_Add.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 837f2c1a74e21a240b893f3b458b745d +guid: a7bac09c842a9ba4b92d1b6851cdb150 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/UI_Texture/Main_Page/Main_Coins_Card.png b/Assets/Art/UI_Texture/Main_Page/Main_Coins_Card.png new file mode 100644 index 0000000..295e3a2 Binary files /dev/null and b/Assets/Art/UI_Texture/Main_Page/Main_Coins_Card.png differ diff --git a/Assets/Art/Main_Page/Main_Coins_Card.png.meta b/Assets/Art/UI_Texture/Main_Page/Main_Coins_Card.png.meta similarity index 98% rename from Assets/Art/Main_Page/Main_Coins_Card.png.meta rename to Assets/Art/UI_Texture/Main_Page/Main_Coins_Card.png.meta index cd8e93d..925b897 100644 --- a/Assets/Art/Main_Page/Main_Coins_Card.png.meta +++ b/Assets/Art/UI_Texture/Main_Page/Main_Coins_Card.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 71ae26d4019bb534aa08454df7d69c54 +guid: a8750981f3112184b8cf44ef19a6900a TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Main_Page/Main_Map.jpg b/Assets/Art/UI_Texture/Main_Page/Main_Map.jpg similarity index 100% rename from Assets/Art/Main_Page/Main_Map.jpg rename to Assets/Art/UI_Texture/Main_Page/Main_Map.jpg diff --git a/Assets/Art/Main_Page/Main_Map.jpg.meta b/Assets/Art/UI_Texture/Main_Page/Main_Map.jpg.meta similarity index 98% rename from Assets/Art/Main_Page/Main_Map.jpg.meta rename to Assets/Art/UI_Texture/Main_Page/Main_Map.jpg.meta index 9ca2f5c..442744b 100644 --- a/Assets/Art/Main_Page/Main_Map.jpg.meta +++ b/Assets/Art/UI_Texture/Main_Page/Main_Map.jpg.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0f16435046975d149be0b60fa9f77324 +guid: 25af8d63e2675d340a8fedd1d24d5349 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Main_Page/Main_Map_GzSite.png b/Assets/Art/UI_Texture/Main_Page/Main_Map_GzSite.png similarity index 100% rename from Assets/Art/Main_Page/Main_Map_GzSite.png rename to Assets/Art/UI_Texture/Main_Page/Main_Map_GzSite.png diff --git a/Assets/Art/Main_Page/Main_Map_GzSite.png.meta b/Assets/Art/UI_Texture/Main_Page/Main_Map_GzSite.png.meta similarity index 98% rename from Assets/Art/Main_Page/Main_Map_GzSite.png.meta rename to Assets/Art/UI_Texture/Main_Page/Main_Map_GzSite.png.meta index ed886a9..b1d11e6 100644 --- a/Assets/Art/Main_Page/Main_Map_GzSite.png.meta +++ b/Assets/Art/UI_Texture/Main_Page/Main_Map_GzSite.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ed04e97120ef2484891243f6e7d954be +guid: 25126b0717f31f74095cc8b62842e8f0 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/UI_Texture/Main_Page/Main_SetButton.png b/Assets/Art/UI_Texture/Main_Page/Main_SetButton.png new file mode 100644 index 0000000..12d56c6 Binary files /dev/null and b/Assets/Art/UI_Texture/Main_Page/Main_SetButton.png differ diff --git a/Assets/Art/Main_Page/Main_SetButton.png.meta b/Assets/Art/UI_Texture/Main_Page/Main_SetButton.png.meta similarity index 98% rename from Assets/Art/Main_Page/Main_SetButton.png.meta rename to Assets/Art/UI_Texture/Main_Page/Main_SetButton.png.meta index 23b8597..ae0d5df 100644 --- a/Assets/Art/Main_Page/Main_SetButton.png.meta +++ b/Assets/Art/UI_Texture/Main_Page/Main_SetButton.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1c7cf7fa0e9dcdd4fb27f6bc153e57be +guid: 625297520d92c0c47ba8d2cc49c3b1ee TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/UI_Texture/Main_Page/Main_TaskButton.png b/Assets/Art/UI_Texture/Main_Page/Main_TaskButton.png new file mode 100644 index 0000000..c8cf3e8 Binary files /dev/null and b/Assets/Art/UI_Texture/Main_Page/Main_TaskButton.png differ diff --git a/Assets/Art/Main_Page/Main_TaskButton.png.meta b/Assets/Art/UI_Texture/Main_Page/Main_TaskButton.png.meta similarity index 98% rename from Assets/Art/Main_Page/Main_TaskButton.png.meta rename to Assets/Art/UI_Texture/Main_Page/Main_TaskButton.png.meta index 6914975..faacc3e 100644 --- a/Assets/Art/Main_Page/Main_TaskButton.png.meta +++ b/Assets/Art/UI_Texture/Main_Page/Main_TaskButton.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 253bc12f6e4dfff4d99af78dc6558cd4 +guid: eb7bb2e7fe0203a4ebec6273d03e9033 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Art/Manufacturer_Page.meta b/Assets/Art/UI_Texture/Manufacturer_Page.meta similarity index 77% rename from Assets/Art/Manufacturer_Page.meta rename to Assets/Art/UI_Texture/Manufacturer_Page.meta index 7db4700..0402427 100644 --- a/Assets/Art/Manufacturer_Page.meta +++ b/Assets/Art/UI_Texture/Manufacturer_Page.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b743d752181c447d1841198eaec547a3 +guid: 88adbd12eeccc1c47957d77d62e68adc folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Art/Manufacturer_Page/Mp_Logo.png b/Assets/Art/UI_Texture/Manufacturer_Page/Mp_Logo.png similarity index 100% rename from Assets/Art/Manufacturer_Page/Mp_Logo.png rename to Assets/Art/UI_Texture/Manufacturer_Page/Mp_Logo.png diff --git a/Assets/Art/Manufacturer_Page/Mp_Logo.png.meta b/Assets/Art/UI_Texture/Manufacturer_Page/Mp_Logo.png.meta similarity index 90% rename from Assets/Art/Manufacturer_Page/Mp_Logo.png.meta rename to Assets/Art/UI_Texture/Manufacturer_Page/Mp_Logo.png.meta index 84207c8..e166977 100644 --- a/Assets/Art/Manufacturer_Page/Mp_Logo.png.meta +++ b/Assets/Art/UI_Texture/Manufacturer_Page/Mp_Logo.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4941a2eb153ce41679f524531e48e627 +guid: a8807547c4cfb394f8e1f817327f176a TextureImporter: internalIDToNameTable: [] externalObjects: {} @@ -106,19 +106,6 @@ TextureImporter: ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: iPhone - 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 diff --git a/Assets/Plugins/Easy Save 3/Resources.meta b/Assets/Art/UI_Texture/Task_Panel.meta similarity index 77% rename from Assets/Plugins/Easy Save 3/Resources.meta rename to Assets/Art/UI_Texture/Task_Panel.meta index 0f3e576..a45bc05 100644 --- a/Assets/Plugins/Easy Save 3/Resources.meta +++ b/Assets/Art/UI_Texture/Task_Panel.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a18eb8f299f37b5419db08959a01a818 +guid: 8301c355a0975754c969f72ec995609a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Art/UI_Texture/Task_Panel/Task_Card.png b/Assets/Art/UI_Texture/Task_Panel/Task_Card.png new file mode 100644 index 0000000..5d8ab84 Binary files /dev/null and b/Assets/Art/UI_Texture/Task_Panel/Task_Card.png differ diff --git a/Assets/Art/UI_Texture/Task_Panel/Task_Card.png.meta b/Assets/Art/UI_Texture/Task_Panel/Task_Card.png.meta new file mode 100644 index 0000000..2cce4af --- /dev/null +++ b/Assets/Art/UI_Texture/Task_Panel/Task_Card.png.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: ef1f1d5dfbfb23c46ab57b7970ef56ba +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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: 1 + 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: WebGL + 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 + - serializedVersion: 3 + buildTarget: Server + 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: diff --git a/Assets/Art/UI_Texture/Task_Panel/Task_Card_Stripe.png b/Assets/Art/UI_Texture/Task_Panel/Task_Card_Stripe.png new file mode 100644 index 0000000..ea829c7 Binary files /dev/null and b/Assets/Art/UI_Texture/Task_Panel/Task_Card_Stripe.png differ diff --git a/Assets/Art/UI_Texture/Task_Panel/Task_Card_Stripe.png.meta b/Assets/Art/UI_Texture/Task_Panel/Task_Card_Stripe.png.meta new file mode 100644 index 0000000..0109ccd --- /dev/null +++ b/Assets/Art/UI_Texture/Task_Panel/Task_Card_Stripe.png.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: cda95c6d6c1a6d540a1cd89e7e82f348 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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: 1 + 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: WebGL + 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 + - serializedVersion: 3 + buildTarget: Server + 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: diff --git a/Assets/Art/UI_Texture/Task_Panel/Task_Card_Top1.png b/Assets/Art/UI_Texture/Task_Panel/Task_Card_Top1.png new file mode 100644 index 0000000..3067d27 Binary files /dev/null and b/Assets/Art/UI_Texture/Task_Panel/Task_Card_Top1.png differ diff --git a/Assets/Art/UI_Texture/Task_Panel/Task_Card_Top1.png.meta b/Assets/Art/UI_Texture/Task_Panel/Task_Card_Top1.png.meta new file mode 100644 index 0000000..a5ba70c --- /dev/null +++ b/Assets/Art/UI_Texture/Task_Panel/Task_Card_Top1.png.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: cb4bea8371fcbb54589349edf3d99570 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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: 1 + 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: WebGL + 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 + - serializedVersion: 3 + buildTarget: Server + 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: diff --git a/Assets/Art/UI_Texture/Task_Panel/Task_Card_Top2.png b/Assets/Art/UI_Texture/Task_Panel/Task_Card_Top2.png new file mode 100644 index 0000000..65cf8e1 Binary files /dev/null and b/Assets/Art/UI_Texture/Task_Panel/Task_Card_Top2.png differ diff --git a/Assets/Art/UI_Texture/Task_Panel/Task_Card_Top2.png.meta b/Assets/Art/UI_Texture/Task_Panel/Task_Card_Top2.png.meta new file mode 100644 index 0000000..fcdf514 --- /dev/null +++ b/Assets/Art/UI_Texture/Task_Panel/Task_Card_Top2.png.meta @@ -0,0 +1,153 @@ +fileFormatVersion: 2 +guid: 6b54d655f1e64cb43a13ab36bfff6ab6 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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: 1 + 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: WebGL + 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 + - serializedVersion: 3 + buildTarget: Server + 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: diff --git a/Assets/Editor/StarkBuilderSetting.asset b/Assets/Editor/StarkBuilderSetting.asset index 7063087..a2aeb5a 100644 --- a/Assets/Editor/StarkBuilderSetting.asset +++ b/Assets/Editor/StarkBuilderSetting.asset @@ -9,11 +9,11 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1315287583, guid: 8386d9a715053e1498df905f82208097, type: 3} + m_Script: {fileID: 1315287583, guid: be35a1463e7be704caa166b4af434f5c, type: 3} m_Name: StarkBuilderSetting m_EditorClassIdentifier: wasmResourceUrl: http:// - webGLOutputDir: /Users/yyl/Desktop/wasm + webGLOutputDir: C:/Users/PDean/Desktop/wasm useByteAudioAPI: 0 wasmMemorySize: 128 isWebGL2: 0 @@ -22,6 +22,9 @@ MonoBehaviour: profiling: 0 buildOptions: 0 optimizeWebGLMemoryInBackground: 1 + assetBundleFSEnabled: 1 + assetBundleBufferCapacity: 128 + assetBundleBufferTTL: 5 urlCacheList: [] dontCacheFileNames: [] isDevBuild: 0 @@ -41,9 +44,9 @@ MonoBehaviour: a: version: autoVersion: 0 - b: /Users/yyl/Desktop/wasm/webgl_package-20240812_172358.zip + b: C:\Users\PDean\Desktop\wasm\webgl_package-20240903_015435.zip c: 0 d: 0 e: 0 publishDesc: - idePath: "/Applications/\u6296\u97F3\u5F00\u53D1\u8005\u5DE5\u5177.app" + idePath: "D:/DeveloperTools/@bytedminiprogram-ide/\u6296\u97F3\u5F00\u53D1\u8005\u5DE5\u5177.exe" diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Editor/starksdk_tools.dll b/Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Editor/starksdk_tools.dll index c4a6559..b45f562 100644 Binary files a/Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Editor/starksdk_tools.dll and b/Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Editor/starksdk_tools.dll differ diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Editor/starksdk_tools.dll.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Editor/starksdk_tools.dll.meta index 203fb84..4ebb9f7 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Editor/starksdk_tools.dll.meta +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Editor/starksdk_tools.dll.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8386d9a715053e1498df905f82208097 +guid: be35a1463e7be704caa166b4af434f5c PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/package.json b/Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/package.json index 480f326..6f482c0 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/package.json +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/package.json @@ -1,17 +1,18 @@ + { - "displayName": "Stark SDK - Unity Tools", - "name": "com.bytedance.starksdk.unitytools", - "version": "3.30.4", - "description": "Stark SDK Unity Tools\\n\u7528\u4E8E\u6784\u5EFAUnity Apk\u3001WebGL\u4EE5\u53CA\u53D1\u5E03\u6E38\u620F\u5230\u6296\u97F3\u5E73\u53F0\u7684\u5DE5\u5177", - "keywords": [ - ], - "category": "Libraries", - "links": [ - { - "label": "View Document", - "url": "https://bytedance.feishu.cn/docs/doccnGEsOm0yquys4iAgtVi7nKh#" - } - ], - "unitySinceBuild": "2021.3", - "unityUntilBuild": "*" + "displayName" : "Stark SDK - Unity Tools", + "name" : "com.bytedance.starksdk.unitytools", + "version" : "3.31.2", + "description" : "Stark SDK Unity Tools\\n\u7528\u4E8E\u6784\u5EFAUnity Apk\u3001WebGL\u4EE5\u53CA\u53D1\u5E03\u6E38\u620F\u5230\u6296\u97F3\u5E73\u53F0\u7684\u5DE5\u5177", + "keywords" : [ + ], + "category" : "Libraries", + "links" : [ + { + "label" : "View Document", + "url" : "https://bytedance.feishu.cn/docs/doccnGEsOm0yquys4iAgtVi7nKh#" + } + ], + "unitySinceBuild" : "2021.3", + "unityUntilBuild" : "*" } \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson.meta index 8af93c5..208ead5 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson.meta +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 599e249c9b6e740e8839ab2d6b466c19 +guid: 99507e13f88414c8895c47539f155fcb folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/IJsonWrapper.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/IJsonWrapper.cs index e791c1c..dcc40a5 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/IJsonWrapper.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/IJsonWrapper.cs @@ -1,5 +1,4 @@ #region Header - /** * IJsonWrapper.cs * Interface that represents a type capable of handling all kinds of JSON @@ -9,13 +8,13 @@ * The authors disclaim copyright to this source code. For more details, see * the COPYING file included with this distribution. **/ - #endregion using System.Collections; using System.Collections.Specialized; + namespace StarkSDKSpace.UNBridgeLib.LitJson { public enum JsonType @@ -33,29 +32,29 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson public interface IJsonWrapper : IList, IOrderedDictionary { - bool IsArray { get; } + bool IsArray { get; } bool IsBoolean { get; } - bool IsDouble { get; } - bool IsInt { get; } - bool IsLong { get; } - bool IsObject { get; } - bool IsString { get; } + bool IsDouble { get; } + bool IsInt { get; } + bool IsLong { get; } + bool IsObject { get; } + bool IsString { get; } - bool GetBoolean(); - double GetDouble(); - int GetInt(); - JsonType GetJsonType(); - long GetLong(); - string GetString(); + bool GetBoolean (); + double GetDouble (); + int GetInt (); + JsonType GetJsonType (); + long GetLong (); + string GetString (); - void SetBoolean(bool val); - void SetDouble(double val); - void SetInt(int val); - void SetJsonType(JsonType type); - void SetLong(long val); - void SetString(string val); + void SetBoolean (bool val); + void SetDouble (double val); + void SetInt (int val); + void SetJsonType (JsonType type); + void SetLong (long val); + void SetString (string val); - string ToJson(); - void ToJson(JsonWriter writer); + string ToJson (); + void ToJson (JsonWriter writer); } -} \ No newline at end of file +} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonData.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonData.cs index f88daed..54a0a19 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonData.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonData.cs @@ -1,5 +1,4 @@ #region Header - /** * JsonData.cs * Generic type to hold JSON data (objects, arrays, and so on). This is @@ -8,7 +7,6 @@ * The authors disclaim copyright to this source code. For more details, see * the COPYING file included with this distribution. **/ - #endregion @@ -18,702 +16,297 @@ using System.Collections.Generic; using System.Collections.Specialized; using System.IO; + namespace StarkSDKSpace.UNBridgeLib.LitJson { public class JsonData : IJsonWrapper, IEquatable { + #region Fields + private IList inst_array; + private bool inst_boolean; + private double inst_double; + private int inst_int; + private long inst_long; + private IDictionary inst_object; + private string inst_string; + private string json; + private JsonType type; - public bool Equals(JsonData x) - { - if (x == null) - return false; + // Used to implement the IOrderedDictionary interface + private IList> object_list; + #endregion - if (x.type != type) - { - // further check to see if this is a long to int comparison - if (x.type != JsonType.Int && x.type != JsonType.Long - || type != JsonType.Int && type != JsonType.Long) - { - return false; - } - } - switch (type) - { - case JsonType.None: - return true; - - case JsonType.Object: - return inst_object.Equals(x.inst_object); - - case JsonType.Array: - return inst_array.Equals(x.inst_array); - - case JsonType.String: - return inst_string.Equals(x.inst_string); - - case JsonType.Int: - { - if (x.IsLong) - { - if (x.inst_long < int.MinValue || x.inst_long > int.MaxValue) - return false; - return inst_int.Equals((int)x.inst_long); - } - return inst_int.Equals(x.inst_int); - } - - case JsonType.Long: - { - if (x.IsInt) - { - if (inst_long < int.MinValue || inst_long > int.MaxValue) - return false; - return x.inst_int.Equals((int)inst_long); - } - return inst_long.Equals(x.inst_long); - } - - case JsonType.Double: - return inst_double.Equals(x.inst_double); - - case JsonType.Boolean: - return inst_boolean.Equals(x.inst_boolean); - } - - return false; + #region Properties + public int Count { + get { return EnsureCollection ().Count; } } + public bool IsArray { + get { return type == JsonType.Array; } + } + + public bool IsBoolean { + get { return type == JsonType.Boolean; } + } + + public bool IsDouble { + get { return type == JsonType.Double; } + } + + public bool IsInt { + get { return type == JsonType.Int; } + } + + public bool IsLong { + get { return type == JsonType.Long; } + } + + public bool IsObject { + get { return type == JsonType.Object; } + } + + public bool IsString { + get { return type == JsonType.String; } + } + + public ICollection Keys { + get { EnsureDictionary (); return inst_object.Keys; } + } + + /// + /// Determines whether the json contains an element that has the specified key. + /// + /// The key to locate in the json. + /// true if the json contains an element that has the specified key; otherwise, false. + public Boolean ContainsKey(String key) { + EnsureDictionary(); + return this.inst_object.Keys.Contains(key); + } + #endregion + + + #region ICollection Properties + int ICollection.Count { + get { + return Count; + } + } + + bool ICollection.IsSynchronized { + get { + return EnsureCollection ().IsSynchronized; + } + } + + object ICollection.SyncRoot { + get { + return EnsureCollection ().SyncRoot; + } + } + #endregion + + + #region IDictionary Properties + bool IDictionary.IsFixedSize { + get { + return EnsureDictionary ().IsFixedSize; + } + } + + bool IDictionary.IsReadOnly { + get { + return EnsureDictionary ().IsReadOnly; + } + } + + ICollection IDictionary.Keys { + get { + EnsureDictionary (); + IList keys = new List (); + + foreach (KeyValuePair entry in + object_list) { + keys.Add (entry.Key); + } + + return (ICollection) keys; + } + } + + ICollection IDictionary.Values { + get { + EnsureDictionary (); + IList values = new List (); + + foreach (KeyValuePair entry in + object_list) { + values.Add (entry.Value); + } + + return (ICollection) values; + } + } + #endregion + + + + #region IJsonWrapper Properties + bool IJsonWrapper.IsArray { + get { return IsArray; } + } + + bool IJsonWrapper.IsBoolean { + get { return IsBoolean; } + } + + bool IJsonWrapper.IsDouble { + get { return IsDouble; } + } + + bool IJsonWrapper.IsInt { + get { return IsInt; } + } + + bool IJsonWrapper.IsLong { + get { return IsLong; } + } + + bool IJsonWrapper.IsObject { + get { return IsObject; } + } + + bool IJsonWrapper.IsString { + get { return IsString; } + } + #endregion + + + #region IList Properties + bool IList.IsFixedSize { + get { + return EnsureList ().IsFixedSize; + } + } + + bool IList.IsReadOnly { + get { + return EnsureList ().IsReadOnly; + } + } + #endregion + #region IDictionary Indexer - - object IDictionary.this[object key] - { - get - { - return EnsureDictionary()[key]; + object IDictionary.this[object key] { + get { + return EnsureDictionary ()[key]; } - set - { - if (!(key is string)) - throw new ArgumentException( + set { + if (! (key is String)) + throw new ArgumentException ( "The key has to be a string"); - var data = ToJsonData(value); + JsonData data = ToJsonData (value); - this[(string)key] = data; + this[(string) key] = data; } } - #endregion #region IOrderedDictionary Indexer - - object IOrderedDictionary.this[int idx] - { - get - { - EnsureDictionary(); + object IOrderedDictionary.this[int idx] { + get { + EnsureDictionary (); return object_list[idx].Value; } - set - { - EnsureDictionary(); - var data = ToJsonData(value); + set { + EnsureDictionary (); + JsonData data = ToJsonData (value); KeyValuePair old_entry = object_list[idx]; inst_object[old_entry.Key] = data; KeyValuePair entry = - new KeyValuePair(old_entry.Key, data); + new KeyValuePair (old_entry.Key, data); object_list[idx] = entry; } } - #endregion #region IList Indexer - - object IList.this[int index] - { - get - { - return EnsureList()[index]; + object IList.this[int index] { + get { + return EnsureList ()[index]; } - set - { - EnsureList(); - var data = ToJsonData(value); + set { + EnsureList (); + JsonData data = ToJsonData (value); this[index] = data; } } - - #endregion - - - #region ICollection Methods - - void ICollection.CopyTo(Array array, int index) - { - EnsureCollection().CopyTo(array, index); - } - - #endregion - - - #region IEnumerable Methods - - IEnumerator IEnumerable.GetEnumerator() - { - return EnsureCollection().GetEnumerator(); - } - - #endregion - - public JsonType GetJsonType() - { - return type; - } - - public void SetJsonType(JsonType type) - { - if (this.type == type) - return; - - switch (type) - { - case JsonType.None: - break; - - case JsonType.Object: - inst_object = new Dictionary(); - object_list = new List>(); - break; - - case JsonType.Array: - inst_array = new List(); - break; - - case JsonType.String: - inst_string = default (string); - break; - - case JsonType.Int: - inst_int = default (int); - break; - - case JsonType.Long: - inst_long = default (long); - break; - - case JsonType.Double: - inst_double = default (double); - break; - - case JsonType.Boolean: - inst_boolean = default (bool); - break; - } - - this.type = type; - } - - - public int Add(object value) - { - var data = ToJsonData(value); - - json = null; - - return EnsureList().Add(data); - } - - public bool Remove(object obj) - { - json = null; - if (IsObject) - { - JsonData value = null; - if (inst_object.TryGetValue((string)obj, out value)) - return inst_object.Remove((string)obj) && object_list.Remove(new KeyValuePair((string)obj, value)); - throw new KeyNotFoundException("The specified key was not found in the JsonData object."); - } - if (IsArray) - { - return inst_array.Remove(ToJsonData(obj)); - } - throw new InvalidOperationException( - "Instance of JsonData is not an object or a list."); - } - - public void Clear() - { - if (IsObject) - { - ((IDictionary)this).Clear(); - return; - } - - if (IsArray) - { - ((IList)this).Clear(); - } - } - - public string ToJson() - { - if (json != null) - return json; - - var sw = new StringWriter(); - var writer = new JsonWriter(sw); - writer.Validate = false; - - WriteJson(this, writer); - json = sw.ToString(); - - return json; - } - - public string ToEJson() - { - if (json != null) - return json; - - var sw = new StringWriter(); - var writer = new JsonWriter(sw); - writer.Validate = false; - - WriteEJson(this, writer); - json = sw.ToString(); - - return json; - } - private static void WriteEJson(IJsonWrapper obj, JsonWriter writer) - { - if (obj == null) - { - writer.Write(null); - return; - } - - if (obj.IsString) - { - writer.Write(obj.GetString()); - return; - } - - if (obj.IsBoolean) - { - writer.Write(obj.GetBoolean()); - return; - } - - if (obj.IsDouble) - { - var tmpData = new JsonData(); - tmpData["$numberDouble"] = obj.GetDouble().ToString(); - writer.WriteObjectStart(); - foreach (DictionaryEntry entry in (IDictionary)tmpData) - { - writer.WritePropertyName((string)entry.Key); - WriteEJson((JsonData)entry.Value, writer); - } - writer.WriteObjectEnd(); - - // writer.Write (obj.GetDouble ()); - return; - } - - if (obj.IsInt) - { - var tmpData = new JsonData(); - tmpData["$numberInt"] = obj.GetInt().ToString(); - writer.WriteObjectStart(); - foreach (DictionaryEntry entry in (IDictionary)tmpData) - { - writer.WritePropertyName((string)entry.Key); - WriteEJson((JsonData)entry.Value, writer); - } - writer.WriteObjectEnd(); - return; - } - - if (obj.IsLong) - { - var tmpData = new JsonData(); - tmpData["$numberLong"] = obj.GetLong().ToString(); - writer.WriteObjectStart(); - foreach (DictionaryEntry entry in (IDictionary)tmpData) - { - writer.WritePropertyName((string)entry.Key); - WriteEJson((JsonData)entry.Value, writer); - } - writer.WriteObjectEnd(); - - // writer.Write (obj.GetLong ()); - return; - } - - if (obj.IsArray) - { - writer.WriteArrayStart(); - foreach (object elem in (IList)obj) - WriteEJson((JsonData)elem, writer); - writer.WriteArrayEnd(); - - return; - } - - if (obj.IsObject) - { - writer.WriteObjectStart(); - - foreach (DictionaryEntry entry in (IDictionary)obj) - { - writer.WritePropertyName((string)entry.Key); - WriteEJson((JsonData)entry.Value, writer); - } - writer.WriteObjectEnd(); - - } - } - - - public void ToJson(JsonWriter writer) - { - bool old_validate = writer.Validate; - - writer.Validate = false; - - WriteJson(this, writer); - - writer.Validate = old_validate; - } - - public override string ToString() - { - switch (type) - { - case JsonType.Array: - return ToJson(); - - case JsonType.Boolean: - return inst_boolean.ToString(); - - case JsonType.Double: - return inst_double.ToString(); - - case JsonType.Int: - return inst_int.ToString(); - - case JsonType.Long: - return inst_long.ToString(); - - case JsonType.Object: - return ToJson(); - - case JsonType.String: - return inst_string; - } - - return "Uninitialized JsonData"; - } - #region Fields - - private System.Collections.Generic.IList inst_array; - private bool inst_boolean; - private double inst_double; - private int inst_int; - private long inst_long; - private System.Collections.Generic.IDictionary inst_object; - private string inst_string; - private string json; - private JsonType type; - - // Used to implement the IOrderedDictionary interface - private IList> object_list; - - #endregion - - - #region Properties - - public int Count - { - get { return EnsureCollection().Count; } - } - - public bool IsArray - { - get { return type == JsonType.Array; } - } - - public bool IsBoolean - { - get { return type == JsonType.Boolean; } - } - - public bool IsDouble - { - get { return type == JsonType.Double; } - } - - public bool IsInt - { - get { return type == JsonType.Int; } - } - - public bool IsLong - { - get { return type == JsonType.Long; } - } - - public bool IsObject - { - get { return type == JsonType.Object; } - } - - public bool IsString - { - get { return type == JsonType.String; } - } - - public ICollection Keys - { - get - { - EnsureDictionary(); - return inst_object.Keys; - } - } - - /// - /// Determines whether the json contains an element that has the specified key. - /// - /// The key to locate in the json. - /// true if the json contains an element that has the specified key; otherwise, false. - public bool ContainsKey(string key) - { - EnsureDictionary(); - return inst_object.Keys.Contains(key); - } - - #endregion - - - #region ICollection Properties - - int ICollection.Count - { - get - { - return Count; - } - } - - bool ICollection.IsSynchronized - { - get - { - return EnsureCollection().IsSynchronized; - } - } - - object ICollection.SyncRoot - { - get - { - return EnsureCollection().SyncRoot; - } - } - - #endregion - - - #region IDictionary Properties - - bool IDictionary.IsFixedSize - { - get - { - return EnsureDictionary().IsFixedSize; - } - } - - bool IDictionary.IsReadOnly - { - get - { - return EnsureDictionary().IsReadOnly; - } - } - - ICollection IDictionary.Keys - { - get - { - EnsureDictionary(); - IList keys = new List(); - - foreach (KeyValuePair entry in - object_list) - { - keys.Add(entry.Key); - } - - return (ICollection)keys; - } - } - - ICollection IDictionary.Values - { - get - { - EnsureDictionary(); - IList values = new List(); - - foreach (KeyValuePair entry in - object_list) - { - values.Add(entry.Value); - } - - return (ICollection)values; - } - } - - #endregion - - - - #region IJsonWrapper Properties - - bool IJsonWrapper.IsArray - { - get { return IsArray; } - } - - bool IJsonWrapper.IsBoolean - { - get { return IsBoolean; } - } - - bool IJsonWrapper.IsDouble - { - get { return IsDouble; } - } - - bool IJsonWrapper.IsInt - { - get { return IsInt; } - } - - bool IJsonWrapper.IsLong - { - get { return IsLong; } - } - - bool IJsonWrapper.IsObject - { - get { return IsObject; } - } - - bool IJsonWrapper.IsString - { - get { return IsString; } - } - - #endregion - - - #region IList Properties - - bool IList.IsFixedSize - { - get - { - return EnsureList().IsFixedSize; - } - } - - bool IList.IsReadOnly - { - get - { - return EnsureList().IsReadOnly; - } - } - #endregion #region Public Indexers - - public JsonData this[string prop_name] - { - get - { - EnsureDictionary(); + public JsonData this[string prop_name] { + get { + EnsureDictionary (); inst_object.TryGetValue(prop_name, out var value); return value; } - set - { - EnsureDictionary(); + set { + EnsureDictionary (); KeyValuePair entry = - new KeyValuePair(prop_name, value); + new KeyValuePair (prop_name, value); - if (inst_object.ContainsKey(prop_name)) - { - for (int i = 0; i < object_list.Count; i++) - { - if (object_list[i].Key == prop_name) - { + if (inst_object.ContainsKey (prop_name)) { + for (int i = 0; i < object_list.Count; i++) { + if (object_list[i].Key == prop_name) { object_list[i] = entry; break; } } - } - else - object_list.Add(entry); + } else + object_list.Add (entry); inst_object[prop_name] = value; json = null; } } - - public string OptGetString(string propName, string defaultValue = "") - { - EnsureDictionary(); + + public String OptGetString(string propName, string defaultValue = "") { + EnsureDictionary (); inst_object.TryGetValue(propName, out var value); if (value == null) { return defaultValue; } - + if (value.IsString) { return (string)value; } - return value.ToJson(); - + else + { + return value.ToJson(); + } + } - - public int OptGetInt(string propName, int defaultValue = 0) - { - EnsureDictionary(); + + public int OptGetInt(string propName, int defaultValue = 0) { + EnsureDictionary (); inst_object.TryGetValue(propName, out var value); if (value == null) { @@ -727,10 +320,9 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return defaultValue; } - - public double OptGetDouble(string propName, double defaultValue = 0) - { - EnsureDictionary(); + + public double OptGetDouble(string propName, double defaultValue = 0) { + EnsureDictionary (); inst_object.TryGetValue(propName, out var value); if (value == null) { @@ -744,10 +336,9 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return defaultValue; } - - public long OptGetLong(string propName, long defaultValue = 0) - { - EnsureDictionary(); + + public long OptGetLong(string propName, long defaultValue = 0) { + EnsureDictionary (); inst_object.TryGetValue(propName, out var value); if (value == null) { @@ -761,10 +352,9 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return defaultValue; } - - public bool OptGetBoolean(string propName, bool defaultValue = false) - { - EnsureDictionary(); + + public bool OptGetBoolean(string propName, bool defaultValue = false) { + EnsureDictionary (); inst_object.TryGetValue(propName, out var value); if (value == null) { @@ -778,10 +368,9 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return defaultValue; } - - public JsonData OptGetObject(string propName, JsonData defaultValue) - { - EnsureDictionary(); + + public JsonData OptGetObject(string propName, JsonData defaultValue) { + EnsureDictionary (); inst_object.TryGetValue(propName, out var value); if (value == null) { @@ -790,15 +379,14 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson if (value.IsObject) { - return value; + return (JsonData)value; } return defaultValue; } - - public JsonData OptGetJsonArray(string propName, JsonData defaultValue) - { - EnsureDictionary(); + + public JsonData OptGetJsonArray(string propName, JsonData defaultValue) { + EnsureDictionary (); inst_object.TryGetValue(propName, out var value); if (value == null) { @@ -807,17 +395,15 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson if (value.IsArray) { - return value; + return (JsonData)value; } return defaultValue; } - public JsonData this[int index] - { - get - { - EnsureCollection(); + public JsonData this[int index] { + get { + EnsureCollection (); if (type == JsonType.Array) return inst_array[index]; @@ -825,17 +411,15 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return object_list[index].Value; } - set - { - EnsureCollection(); + set { + EnsureCollection (); if (type == JsonType.Array) inst_array[index] = value; - else - { + else { KeyValuePair entry = object_list[index]; KeyValuePair new_entry = - new KeyValuePair(entry.Key, value); + new KeyValuePair (entry.Key, value); object_list[index] = new_entry; inst_object[entry.Key] = value; @@ -844,35 +428,33 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson json = null; } } - #endregion #region Constructors - - public JsonData() + public JsonData () { } - public JsonData(bool boolean) + public JsonData (bool boolean) { type = JsonType.Boolean; inst_boolean = boolean; } - public JsonData(double number) + public JsonData (double number) { type = JsonType.Double; inst_double = number; } - public JsonData(int number) + public JsonData (int number) { type = JsonType.Int; inst_int = number; } - public JsonData(long number) + public JsonData (long number) { type = JsonType.Long; inst_long = number; @@ -880,111 +462,102 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson public static JsonData NewJsonArray() { - var jsonData = new JsonData(); + JsonData jsonData = new JsonData(); jsonData.EnsureList(); return jsonData; } - public JsonData(object obj) + public JsonData (object obj) { - if (obj is bool) - { + if (obj is Boolean) { type = JsonType.Boolean; - inst_boolean = (bool)obj; + inst_boolean = (bool) obj; return; } - if (obj is float) + if (obj is Single) { type = JsonType.Double; inst_double = Convert.ToDouble(obj); return; } - if (obj is double) - { + if (obj is Double) { type = JsonType.Double; - inst_double = (double)obj; + inst_double = (double) obj; return; } - if (obj is int) - { + if (obj is Int32) { type = JsonType.Int; - inst_int = (int)obj; + inst_int = (int) obj; return; } - if (obj is long) - { + if (obj is Int64) { type = JsonType.Long; - inst_long = (long)obj; + inst_long = (long) obj; return; } - if (obj is string) - { + if (obj is String) { type = JsonType.String; - inst_string = (string)obj; + inst_string = (string) obj; return; } - throw new ArgumentException( + throw new ArgumentException ( "Unable to wrap the given object with JsonData"); } - public JsonData(string str) + public JsonData (string str) { type = JsonType.String; inst_string = str; } - #endregion #region Implicit Conversions - - public static implicit operator JsonData(bool data) + public static implicit operator JsonData (Boolean data) { - return new JsonData(data); + return new JsonData (data); } - public static implicit operator JsonData(double data) + public static implicit operator JsonData (Double data) { - return new JsonData(data); + return new JsonData (data); } - public static implicit operator JsonData(int data) + public static implicit operator JsonData (Int32 data) { - return new JsonData(data); + return new JsonData (data); } - public static implicit operator JsonData(long data) + public static implicit operator JsonData (Int64 data) { - return new JsonData(data); + return new JsonData (data); } - public static implicit operator JsonData(string data) + public static implicit operator JsonData (String data) { - return new JsonData(data); + return new JsonData (data); } - #endregion #region Explicit Conversions - - public static explicit operator bool(JsonData data) + public static explicit operator Boolean (JsonData data) { if (data == null) return false; if (data.type != JsonType.Boolean) - throw new InvalidCastException( + throw new InvalidCastException ( "Instance of JsonData doesn't hold a Boolean"); return data.inst_boolean; } - public static explicit operator double(JsonData data) + public static explicit operator Double (JsonData data) { if (data == null) return 0; if (data.type != JsonType.Double) @@ -998,7 +571,7 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return data.inst_double; } - public static explicit operator int(JsonData data) + public static explicit operator Int32(JsonData data) { if (data == null) return 0; if (data.type != JsonType.Int && data.type != JsonType.Long) @@ -1011,7 +584,7 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return data.type == JsonType.Int ? data.inst_int : (int)data.inst_long; } - public static explicit operator long(JsonData data) + public static explicit operator Int64(JsonData data) { if (data == null) return 0; if (data.type != JsonType.Long && data.type != JsonType.Int) @@ -1023,410 +596,697 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return data.type == JsonType.Long ? data.inst_long : data.inst_int; } - public static explicit operator string(JsonData data) + public static explicit operator String (JsonData data) { if (data == null) return null; if (data.type != JsonType.String) - throw new InvalidCastException( + throw new InvalidCastException ( $"Instance of JsonData {data} doesn't hold a string"); return data.inst_string; } + #endregion + + #region ICollection Methods + void ICollection.CopyTo (Array array, int index) + { + EnsureCollection ().CopyTo (array, index); + } #endregion #region IDictionary Methods - - void IDictionary.Add(object key, object value) + void IDictionary.Add (object key, object value) { - var data = ToJsonData(value); + JsonData data = ToJsonData (value); - EnsureDictionary().Add(key, data); + EnsureDictionary ().Add (key, data); KeyValuePair entry = - new KeyValuePair((string)key, data); - object_list.Add(entry); + new KeyValuePair ((string) key, data); + object_list.Add (entry); json = null; } - void IDictionary.Clear() + void IDictionary.Clear () { - EnsureDictionary().Clear(); - object_list.Clear(); + EnsureDictionary ().Clear (); + object_list.Clear (); json = null; } - bool IDictionary.Contains(object key) + bool IDictionary.Contains (object key) { - return EnsureDictionary().Contains(key); + return EnsureDictionary ().Contains (key); } - IDictionaryEnumerator IDictionary.GetEnumerator() + IDictionaryEnumerator IDictionary.GetEnumerator () { - return ((IOrderedDictionary)this).GetEnumerator(); + return ((IOrderedDictionary) this).GetEnumerator (); } - void IDictionary.Remove(object key) + void IDictionary.Remove (object key) { - EnsureDictionary().Remove(key); + EnsureDictionary ().Remove (key); - for (int i = 0; i < object_list.Count; i++) - { - if (object_list[i].Key == (string)key) - { - object_list.RemoveAt(i); + for (int i = 0; i < object_list.Count; i++) { + if (object_list[i].Key == (string) key) { + object_list.RemoveAt (i); break; } } json = null; } + #endregion + + #region IEnumerable Methods + IEnumerator IEnumerable.GetEnumerator () + { + return EnsureCollection ().GetEnumerator (); + } #endregion #region IJsonWrapper Methods - - bool IJsonWrapper.GetBoolean() + bool IJsonWrapper.GetBoolean () { if (type != JsonType.Boolean) - throw new InvalidOperationException( + throw new InvalidOperationException ( "JsonData instance doesn't hold a boolean"); return inst_boolean; } - double IJsonWrapper.GetDouble() + double IJsonWrapper.GetDouble () { if (type != JsonType.Double) - throw new InvalidOperationException( + throw new InvalidOperationException ( "JsonData instance doesn't hold a double"); return inst_double; } - int IJsonWrapper.GetInt() + int IJsonWrapper.GetInt () { if (type != JsonType.Int) - throw new InvalidOperationException( + throw new InvalidOperationException ( "JsonData instance doesn't hold an int"); return inst_int; } - long IJsonWrapper.GetLong() + long IJsonWrapper.GetLong () { if (type != JsonType.Long) - throw new InvalidOperationException( + throw new InvalidOperationException ( "JsonData instance doesn't hold a long"); return inst_long; } - string IJsonWrapper.GetString() + string IJsonWrapper.GetString () { if (type != JsonType.String) - throw new InvalidOperationException( + throw new InvalidOperationException ( "JsonData instance doesn't hold a string"); return inst_string; } - void IJsonWrapper.SetBoolean(bool val) + void IJsonWrapper.SetBoolean (bool val) { type = JsonType.Boolean; inst_boolean = val; json = null; } - void IJsonWrapper.SetDouble(double val) + void IJsonWrapper.SetDouble (double val) { type = JsonType.Double; inst_double = val; json = null; } - void IJsonWrapper.SetInt(int val) + void IJsonWrapper.SetInt (int val) { type = JsonType.Int; inst_int = val; json = null; } - void IJsonWrapper.SetLong(long val) + void IJsonWrapper.SetLong (long val) { type = JsonType.Long; inst_long = val; json = null; } - void IJsonWrapper.SetString(string val) + void IJsonWrapper.SetString (string val) { type = JsonType.String; inst_string = val; json = null; } - string IJsonWrapper.ToJson() + string IJsonWrapper.ToJson () { - return ToJson(); + return ToJson (); } - void IJsonWrapper.ToJson(JsonWriter writer) + void IJsonWrapper.ToJson (JsonWriter writer) { - ToJson(writer); + ToJson (writer); } - #endregion #region IList Methods - - int IList.Add(object value) + int IList.Add (object value) { - return Add(value); + return Add (value); } - void IList.Clear() + void IList.Clear () { - EnsureList().Clear(); + EnsureList ().Clear (); json = null; } - bool IList.Contains(object value) + bool IList.Contains (object value) { - return EnsureList().Contains(value); + return EnsureList ().Contains (value); } - int IList.IndexOf(object value) + int IList.IndexOf (object value) { - return EnsureList().IndexOf(value); + return EnsureList ().IndexOf (value); } - void IList.Insert(int index, object value) + void IList.Insert (int index, object value) { - EnsureList().Insert(index, value); + EnsureList ().Insert (index, value); json = null; } - void IList.Remove(object value) + void IList.Remove (object value) { - EnsureList().Remove(value); + EnsureList ().Remove (value); json = null; } - void IList.RemoveAt(int index) + void IList.RemoveAt (int index) { - EnsureList().RemoveAt(index); + EnsureList ().RemoveAt (index); json = null; } - #endregion #region IOrderedDictionary Methods - - IDictionaryEnumerator IOrderedDictionary.GetEnumerator() + IDictionaryEnumerator IOrderedDictionary.GetEnumerator () { - EnsureDictionary(); + EnsureDictionary (); - return new OrderedDictionaryEnumerator( - object_list.GetEnumerator()); + return new OrderedDictionaryEnumerator ( + object_list.GetEnumerator ()); } - void IOrderedDictionary.Insert(int idx, object key, object value) + void IOrderedDictionary.Insert (int idx, object key, object value) { - string property = (string)key; - var data = ToJsonData(value); + string property = (string) key; + JsonData data = ToJsonData (value); this[property] = data; KeyValuePair entry = - new KeyValuePair(property, data); + new KeyValuePair (property, data); - object_list.Insert(idx, entry); + object_list.Insert (idx, entry); } - void IOrderedDictionary.RemoveAt(int idx) + void IOrderedDictionary.RemoveAt (int idx) { - EnsureDictionary(); + EnsureDictionary (); - inst_object.Remove(object_list[idx].Key); - object_list.RemoveAt(idx); + inst_object.Remove (object_list[idx].Key); + object_list.RemoveAt (idx); } - #endregion #region Private Methods - - private ICollection EnsureCollection() + private ICollection EnsureCollection () { if (type == JsonType.Array) - return (ICollection)inst_array; + return (ICollection) inst_array; if (type == JsonType.Object) - return (ICollection)inst_object; + return (ICollection) inst_object; - throw new InvalidOperationException( + throw new InvalidOperationException ( "The JsonData instance has to be initialized first"); } - private IDictionary EnsureDictionary() + private IDictionary EnsureDictionary () { if (type == JsonType.Object) - return (IDictionary)inst_object; + return (IDictionary) inst_object; if (type != JsonType.None) - throw new InvalidOperationException( + throw new InvalidOperationException ( "Instance of JsonData is not a dictionary"); type = JsonType.Object; - inst_object = new Dictionary(); - object_list = new List>(); + inst_object = new Dictionary (); + object_list = new List> (); - return (IDictionary)inst_object; + return (IDictionary) inst_object; } - private IList EnsureList() + private IList EnsureList () { if (type == JsonType.Array) - return (IList)inst_array; + return (IList) inst_array; if (type != JsonType.None) - throw new InvalidOperationException( + throw new InvalidOperationException ( "Instance of JsonData is not a list"); type = JsonType.Array; - inst_array = new List(); + inst_array = new List (); - return (IList)inst_array; + return (IList) inst_array; } - private JsonData ToJsonData(object obj) + private JsonData ToJsonData (object obj) { if (obj == null) return null; if (obj is JsonData) - return (JsonData)obj; + return (JsonData) obj; - return new JsonData(obj); + return new JsonData (obj); } - private static void WriteJson(IJsonWrapper obj, JsonWriter writer) + private static void WriteJson (IJsonWrapper obj, JsonWriter writer) { - if (obj == null) - { - writer.Write(null); + if (obj == null) { + writer.Write (null); return; } - if (obj.IsString) - { - writer.Write(obj.GetString()); + if (obj.IsString) { + writer.Write (obj.GetString ()); return; } - if (obj.IsBoolean) - { - writer.Write(obj.GetBoolean()); + if (obj.IsBoolean) { + writer.Write (obj.GetBoolean ()); return; } - if (obj.IsDouble) - { - writer.Write(obj.GetDouble()); + if (obj.IsDouble) { + writer.Write (obj.GetDouble ()); return; } - if (obj.IsInt) - { - writer.Write(obj.GetInt()); + if (obj.IsInt) { + writer.Write (obj.GetInt ()); return; } - if (obj.IsLong) - { - writer.Write(obj.GetLong()); + if (obj.IsLong) { + writer.Write (obj.GetLong ()); return; } - if (obj.IsArray) - { - writer.WriteArrayStart(); - foreach (object elem in (IList)obj) - WriteJson((JsonData)elem, writer); - writer.WriteArrayEnd(); + if (obj.IsArray) { + writer.WriteArrayStart (); + foreach (object elem in (IList) obj) + WriteJson ((JsonData) elem, writer); + writer.WriteArrayEnd (); return; } - if (obj.IsObject) - { - writer.WriteObjectStart(); + if (obj.IsObject) { + writer.WriteObjectStart (); - foreach (DictionaryEntry entry in (IDictionary)obj) - { - writer.WritePropertyName((string)entry.Key); - WriteJson((JsonData)entry.Value, writer); + foreach (DictionaryEntry entry in ((IDictionary) obj)) { + writer.WritePropertyName ((string) entry.Key); + WriteJson ((JsonData) entry.Value, writer); } - writer.WriteObjectEnd(); + writer.WriteObjectEnd (); + return; + } + } + #endregion + + + public int Add (object value) + { + JsonData data = ToJsonData (value); + + json = null; + + return EnsureList ().Add (data); + } + + public bool Remove(object obj) + { + json = null; + if(IsObject) + { + JsonData value = null; + if (inst_object.TryGetValue((string)obj, out value)) + return inst_object.Remove((string)obj) && object_list.Remove(new KeyValuePair((string)obj, value)); + else + throw new KeyNotFoundException("The specified key was not found in the JsonData object."); + } + if(IsArray) + { + return inst_array.Remove(ToJsonData(obj)); + } + throw new InvalidOperationException ( + "Instance of JsonData is not an object or a list."); + } + + public void Clear () + { + if (IsObject) { + ((IDictionary) this).Clear (); + return; + } + + if (IsArray) { + ((IList) this).Clear (); + return; } } - #endregion + public bool Equals (JsonData x) + { + if (x == null) + return false; + + if (x.type != this.type) + { + // further check to see if this is a long to int comparison + if ((x.type != JsonType.Int && x.type != JsonType.Long) + || (this.type != JsonType.Int && this.type != JsonType.Long)) + { + return false; + } + } + + switch (this.type) { + case JsonType.None: + return true; + + case JsonType.Object: + return this.inst_object.Equals (x.inst_object); + + case JsonType.Array: + return this.inst_array.Equals (x.inst_array); + + case JsonType.String: + return this.inst_string.Equals (x.inst_string); + + case JsonType.Int: + { + if (x.IsLong) + { + if (x.inst_long < Int32.MinValue || x.inst_long > Int32.MaxValue) + return false; + return this.inst_int.Equals((int)x.inst_long); + } + return this.inst_int.Equals(x.inst_int); + } + + case JsonType.Long: + { + if (x.IsInt) + { + if (this.inst_long < Int32.MinValue || this.inst_long > Int32.MaxValue) + return false; + return x.inst_int.Equals((int)this.inst_long); + } + return this.inst_long.Equals(x.inst_long); + } + + case JsonType.Double: + return this.inst_double.Equals (x.inst_double); + + case JsonType.Boolean: + return this.inst_boolean.Equals (x.inst_boolean); + } + + return false; + } + + public JsonType GetJsonType () + { + return type; + } + + public void SetJsonType (JsonType type) + { + if (this.type == type) + return; + + switch (type) { + case JsonType.None: + break; + + case JsonType.Object: + inst_object = new Dictionary (); + object_list = new List> (); + break; + + case JsonType.Array: + inst_array = new List (); + break; + + case JsonType.String: + inst_string = default (String); + break; + + case JsonType.Int: + inst_int = default (Int32); + break; + + case JsonType.Long: + inst_long = default (Int64); + break; + + case JsonType.Double: + inst_double = default (Double); + break; + + case JsonType.Boolean: + inst_boolean = default (Boolean); + break; + } + + this.type = type; + } + + public string ToJson () + { + if (json != null) + return json; + + StringWriter sw = new StringWriter (); + JsonWriter writer = new JsonWriter (sw); + writer.Validate = false; + + WriteJson (this, writer); + json = sw.ToString (); + + return json; + } + + public string ToEJson () + { + if (json != null) + return json; + + StringWriter sw = new StringWriter (); + JsonWriter writer = new JsonWriter (sw); + writer.Validate = false; + + WriteEJson (this, writer); + json = sw.ToString (); + + return json; + } + private static void WriteEJson (IJsonWrapper obj, JsonWriter writer) + { + if (obj == null) { + writer.Write (null); + return; + } + + if (obj.IsString) { + writer.Write (obj.GetString ()); + return; + } + + if (obj.IsBoolean) { + writer.Write (obj.GetBoolean ()); + return; + } + + if (obj.IsDouble) { + JsonData tmpData = new JsonData(); + tmpData["$numberDouble"] = obj.GetDouble().ToString(); + writer.WriteObjectStart (); + foreach (DictionaryEntry entry in ((IDictionary) tmpData)) { + writer.WritePropertyName ((string) entry.Key); + WriteEJson ((JsonData) entry.Value, writer); + } + writer.WriteObjectEnd (); + + // writer.Write (obj.GetDouble ()); + return; + } + + if (obj.IsInt) { + JsonData tmpData = new JsonData(); + tmpData["$numberInt"] = obj.GetInt().ToString(); + writer.WriteObjectStart (); + foreach (DictionaryEntry entry in ((IDictionary) tmpData)) { + writer.WritePropertyName ((string) entry.Key); + WriteEJson ((JsonData) entry.Value, writer); + } + writer.WriteObjectEnd (); + return; + } + + if (obj.IsLong) { + JsonData tmpData = new JsonData(); + tmpData["$numberLong"] = obj.GetLong().ToString(); + writer.WriteObjectStart (); + foreach (DictionaryEntry entry in ((IDictionary) tmpData)) { + writer.WritePropertyName ((string) entry.Key); + WriteEJson ((JsonData) entry.Value, writer); + } + writer.WriteObjectEnd (); + + // writer.Write (obj.GetLong ()); + return; + } + + if (obj.IsArray) { + writer.WriteArrayStart (); + foreach (object elem in (IList) obj) + WriteEJson ((JsonData) elem, writer); + writer.WriteArrayEnd (); + + return; + } + + if (obj.IsObject) { + writer.WriteObjectStart (); + + foreach (DictionaryEntry entry in ((IDictionary) obj)) { + writer.WritePropertyName ((string) entry.Key); + WriteEJson ((JsonData) entry.Value, writer); + } + writer.WriteObjectEnd (); + + return; + } + } + + + public void ToJson (JsonWriter writer) + { + bool old_validate = writer.Validate; + + writer.Validate = false; + + WriteJson (this, writer); + + writer.Validate = old_validate; + } + + public override string ToString () + { + switch (type) { + case JsonType.Array: + return ToJson(); + + case JsonType.Boolean: + return inst_boolean.ToString (); + + case JsonType.Double: + return inst_double.ToString (); + + case JsonType.Int: + return inst_int.ToString (); + + case JsonType.Long: + return inst_long.ToString (); + + case JsonType.Object: + return ToJson(); + + case JsonType.String: + return inst_string; + } + + return "Uninitialized JsonData"; + } } internal class OrderedDictionaryEnumerator : IDictionaryEnumerator { - private readonly IEnumerator> list_enumerator; + IEnumerator> list_enumerator; - public OrderedDictionaryEnumerator( + public object Current { + get { return Entry; } + } + + public DictionaryEntry Entry { + get { + KeyValuePair curr = list_enumerator.Current; + return new DictionaryEntry (curr.Key, curr.Value); + } + } + + public object Key { + get { return list_enumerator.Current.Key; } + } + + public object Value { + get { return list_enumerator.Current.Value; } + } + + + public OrderedDictionaryEnumerator ( IEnumerator> enumerator) { list_enumerator = enumerator; } - public object Current + public bool MoveNext () { - get { return Entry; } + return list_enumerator.MoveNext (); } - public DictionaryEntry Entry + public void Reset () { - get - { - KeyValuePair curr = list_enumerator.Current; - return new DictionaryEntry(curr.Key, curr.Value); - } - } - - public object Key - { - get { return list_enumerator.Current.Key; } - } - - public object Value - { - get { return list_enumerator.Current.Value; } - } - - - public bool MoveNext() - { - return list_enumerator.MoveNext(); - } - - public void Reset() - { - list_enumerator.Reset(); + list_enumerator.Reset (); } } -} \ No newline at end of file +} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonException.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonException.cs index f5a068c..293130c 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonException.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonException.cs @@ -1,5 +1,4 @@ #region Header - /** * JsonException.cs * Base class throwed by LitJSON when a parsing error occurs. @@ -7,12 +6,12 @@ * The authors disclaim copyright to this source code. For more details, see * the COPYING file included with this distribution. **/ - #endregion using System; + namespace StarkSDKSpace.UNBridgeLib.LitJson { public class JsonException : @@ -22,45 +21,45 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson ApplicationException #endif { - public JsonException() + public JsonException () : base () { } - internal JsonException(ParserToken token) : - base(string.Format( - "Invalid token '{0}' in input string", token)) + internal JsonException (ParserToken token) : + base (String.Format ( + "Invalid token '{0}' in input string", token)) { } - internal JsonException(ParserToken token, - Exception inner_exception) : - base(string.Format( - "Invalid token '{0}' in input string", token), - inner_exception) + internal JsonException (ParserToken token, + Exception inner_exception) : + base (String.Format ( + "Invalid token '{0}' in input string", token), + inner_exception) { } - internal JsonException(int c) : - base(string.Format( - "Invalid character '{0}' in input string", (char)c)) + internal JsonException (int c) : + base (String.Format ( + "Invalid character '{0}' in input string", (char) c)) { } - internal JsonException(int c, Exception inner_exception) : - base(string.Format( - "Invalid character '{0}' in input string", (char)c), - inner_exception) + internal JsonException (int c, Exception inner_exception) : + base (String.Format ( + "Invalid character '{0}' in input string", (char) c), + inner_exception) { } - public JsonException(string message) : base(message) + public JsonException (string message) : base (message) { } - public JsonException(string message, Exception inner_exception) : - base(message, inner_exception) + public JsonException (string message, Exception inner_exception) : + base (message, inner_exception) { } } -} \ No newline at end of file +} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonMapper.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonMapper.cs index e9aae4f..55c4d12 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonMapper.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonMapper.cs @@ -1,5 +1,4 @@ #region Header - /** * JsonMapper.cs * JSON to .Net object and object to JSON conversions. @@ -7,7 +6,6 @@ * The authors disclaim copyright to this source code. For more details, see * the COPYING file included with this distribution. **/ - #endregion @@ -18,27 +16,28 @@ using System.Globalization; using System.IO; using System.Reflection; + namespace StarkSDKSpace.UNBridgeLib.LitJson { internal struct PropertyMetadata { public MemberInfo Info; - public bool IsField; - public Type Type; + public bool IsField; + public Type Type; } internal struct ArrayMetadata { private Type element_type; + private bool is_array; + private bool is_list; - public Type ElementType - { - get - { + public Type ElementType { + get { if (element_type == null) - return typeof(JsonData); + return typeof (JsonData); return element_type; } @@ -46,23 +45,30 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson set { element_type = value; } } - public bool IsArray { get; set; } + public bool IsArray { + get { return is_array; } + set { is_array = value; } + } - public bool IsList { get; set; } + public bool IsList { + get { return is_list; } + set { is_list = value; } + } } internal struct ObjectMetadata { private Type element_type; + private bool is_dictionary; + + private IDictionary properties; - public Type ElementType - { - get - { + public Type ElementType { + get { if (element_type == null) - return typeof(JsonData); + return typeof (JsonData); return element_type; } @@ -70,166 +76,30 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson set { element_type = value; } } - public bool IsDictionary { get; set; } + public bool IsDictionary { + get { return is_dictionary; } + set { is_dictionary = value; } + } - public IDictionary Properties { get; set; } + public IDictionary Properties { + get { return properties; } + set { properties = value; } + } } - internal delegate void ExporterFunc(object obj, JsonWriter writer); - public delegate void ExporterFunc(T obj, JsonWriter writer); + internal delegate void ExporterFunc (object obj, JsonWriter writer); + public delegate void ExporterFunc (T obj, JsonWriter writer); - internal delegate object ImporterFunc(object input); - public delegate TValue ImporterFunc(TJson input); + internal delegate object ImporterFunc (object input); + public delegate TValue ImporterFunc (TJson input); - public delegate IJsonWrapper WrapperFactory(); + public delegate IJsonWrapper WrapperFactory (); public class JsonMapper { - - - #region Constructors - - static JsonMapper() - { - max_nesting_depth = 100; - - array_metadata = new Dictionary(); - conv_ops = new Dictionary>(); - object_metadata = new Dictionary(); - type_properties = new Dictionary>(); - - static_writer = new JsonWriter(); - - datetime_format = DateTimeFormatInfo.InvariantInfo; - - base_exporters_table = new Dictionary(); - custom_exporters_table = new Dictionary(); - - base_importers_table = new Dictionary>(); - custom_importers_table = new Dictionary>(); - - RegisterBaseExporters(); - RegisterBaseImporters(); - } - - #endregion - - - public static string ToJson(object obj) - { - lock (static_writer_lock) - { - static_writer.Reset(); - - WriteValue(obj, static_writer, true, 0); - - return static_writer.ToString(); - } - } - - public static void ToJson(object obj, JsonWriter writer) - { - WriteValue(obj, writer, false, 0); - } - - public static JsonData ToObject(JsonReader reader) - { - return (JsonData)ToWrapper( - delegate { return new JsonData(); }, reader); - } - - public static JsonData ToObject(TextReader reader) - { - var json_reader = new JsonReader(reader); - - return (JsonData)ToWrapper( - delegate { return new JsonData(); }, json_reader); - } - - public static JsonData ToObject(string json) - { - return (JsonData)ToWrapper( - delegate { return new JsonData(); }, json); - } - - public static T ToObject(JsonReader reader) - { - return (T)ReadValue(typeof(T), reader); - } - - public static T ToObject(TextReader reader) - { - var json_reader = new JsonReader(reader); - - return (T)ReadValue(typeof(T), json_reader); - } - - public static T ToObject(string json) - { - var reader = new JsonReader(json); - - return (T)ReadValue(typeof(T), reader); - } - - public static object ToObject(string json, Type ConvertType) - { - var reader = new JsonReader(json); - - return ReadValue(ConvertType, reader); - } - - public static IJsonWrapper ToWrapper(WrapperFactory factory, - JsonReader reader) - { - return ReadValue(factory, reader); - } - - public static IJsonWrapper ToWrapper(WrapperFactory factory, - string json) - { - var reader = new JsonReader(json); - - return ReadValue(factory, reader); - } - - public static void RegisterExporter(ExporterFunc exporter) - { - ExporterFunc exporter_wrapper = - delegate(object obj, JsonWriter writer) { - exporter((T)obj, writer); - }; - - custom_exporters_table[typeof(T)] = exporter_wrapper; - } - - public static void RegisterImporter( - ImporterFunc importer) - { - ImporterFunc importer_wrapper = - delegate(object input) { - return importer((TJson)input); - }; - - RegisterImporter(custom_importers_table, typeof(TJson), - typeof(TValue), importer_wrapper); - } - - public static void UnregisterExporters() - { - custom_exporters_table.Clear(); - } - - public static void UnregisterImporters() - { - custom_importers_table.Clear(); - } #region Fields - private static readonly int max_nesting_depth; private static readonly IFormatProvider datetime_format; @@ -238,190 +108,194 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson private static readonly IDictionary custom_exporters_table; private static readonly IDictionary> base_importers_table; + IDictionary> base_importers_table; private static readonly IDictionary> custom_importers_table; + IDictionary> custom_importers_table; private static readonly IDictionary array_metadata; - private static readonly object array_metadata_lock = new object(); + private static readonly object array_metadata_lock = new Object (); private static readonly IDictionary> conv_ops; - private static readonly object conv_ops_lock = new object(); + IDictionary> conv_ops; + private static readonly object conv_ops_lock = new Object (); private static readonly IDictionary object_metadata; - private static readonly object object_metadata_lock = new object(); + private static readonly object object_metadata_lock = new Object (); private static readonly IDictionary> type_properties; - private static readonly object type_properties_lock = new object(); + IList> type_properties; + private static readonly object type_properties_lock = new Object (); - private static readonly JsonWriter static_writer; - private static readonly object static_writer_lock = new object(); + private static readonly JsonWriter static_writer; + private static readonly object static_writer_lock = new Object (); + #endregion + + #region Constructors + static JsonMapper () + { + max_nesting_depth = 100; + + array_metadata = new Dictionary (); + conv_ops = new Dictionary> (); + object_metadata = new Dictionary (); + type_properties = new Dictionary> (); + + static_writer = new JsonWriter (); + + datetime_format = DateTimeFormatInfo.InvariantInfo; + + base_exporters_table = new Dictionary (); + custom_exporters_table = new Dictionary (); + + base_importers_table = new Dictionary> (); + custom_importers_table = new Dictionary> (); + + RegisterBaseExporters (); + RegisterBaseImporters (); + } #endregion #region Private Methods - - private static void AddArrayMetadata(Type type) + private static void AddArrayMetadata (Type type) { - if (array_metadata.ContainsKey(type)) + if (array_metadata.ContainsKey (type)) return; - var data = new ArrayMetadata(); + ArrayMetadata data = new ArrayMetadata (); data.IsArray = type.IsArray; - if (type.GetInterface("System.Collections.IList") != null) + if (type.GetInterface ("System.Collections.IList") != null) data.IsList = true; - foreach (var p_info in type.GetProperties()) - { + foreach (PropertyInfo p_info in type.GetProperties ()) { if (p_info.Name != "Item") continue; - ParameterInfo[] parameters = p_info.GetIndexParameters(); + ParameterInfo[] parameters = p_info.GetIndexParameters (); if (parameters.Length != 1) continue; - if (parameters[0].ParameterType == typeof(int)) + if (parameters[0].ParameterType == typeof (int)) data.ElementType = p_info.PropertyType; } - lock (array_metadata_lock) - { - try - { - array_metadata.Add(type, data); - } - catch (ArgumentException) - { + lock (array_metadata_lock) { + try { + array_metadata.Add (type, data); + } catch (ArgumentException) { + return; } } } - private static void AddObjectMetadata(Type type) + private static void AddObjectMetadata (Type type) { - if (object_metadata.ContainsKey(type)) + if (object_metadata.ContainsKey (type)) return; - var data = new ObjectMetadata(); + ObjectMetadata data = new ObjectMetadata (); - if (type.GetInterface("System.Collections.IDictionary") != null) + if (type.GetInterface ("System.Collections.IDictionary") != null) data.IsDictionary = true; - data.Properties = new Dictionary(); + data.Properties = new Dictionary (); - foreach (var p_info in type.GetProperties()) - { - if (p_info.Name == "Item") - { - ParameterInfo[] parameters = p_info.GetIndexParameters(); + foreach (PropertyInfo p_info in type.GetProperties ()) { + if (p_info.Name == "Item") { + ParameterInfo[] parameters = p_info.GetIndexParameters (); if (parameters.Length != 1) continue; - if (parameters[0].ParameterType == typeof(string)) + if (parameters[0].ParameterType == typeof (string)) data.ElementType = p_info.PropertyType; continue; } - var p_data = new PropertyMetadata(); + PropertyMetadata p_data = new PropertyMetadata (); p_data.Info = p_info; p_data.Type = p_info.PropertyType; - data.Properties.Add(p_info.Name, p_data); + data.Properties.Add (p_info.Name, p_data); } - foreach (var f_info in type.GetFields()) - { - var p_data = new PropertyMetadata(); + foreach (FieldInfo f_info in type.GetFields ()) { + PropertyMetadata p_data = new PropertyMetadata (); p_data.Info = f_info; p_data.IsField = true; p_data.Type = f_info.FieldType; - data.Properties.Add(f_info.Name, p_data); + data.Properties.Add (f_info.Name, p_data); } - lock (object_metadata_lock) - { - try - { - object_metadata.Add(type, data); - } - catch (ArgumentException) - { + lock (object_metadata_lock) { + try { + object_metadata.Add (type, data); + } catch (ArgumentException) { + return; } } } - private static void AddTypeProperties(Type type) + private static void AddTypeProperties (Type type) { - if (type_properties.ContainsKey(type)) + if (type_properties.ContainsKey (type)) return; - IList props = new List(); + IList props = new List (); - foreach (var p_info in type.GetProperties()) - { + foreach (PropertyInfo p_info in type.GetProperties ()) { if (p_info.Name == "Item") continue; - var p_data = new PropertyMetadata(); + PropertyMetadata p_data = new PropertyMetadata (); p_data.Info = p_info; p_data.IsField = false; - props.Add(p_data); + props.Add (p_data); } - foreach (var f_info in type.GetFields()) - { - var p_data = new PropertyMetadata(); + foreach (FieldInfo f_info in type.GetFields ()) { + PropertyMetadata p_data = new PropertyMetadata (); p_data.Info = f_info; p_data.IsField = true; - props.Add(p_data); + props.Add (p_data); } - lock (type_properties_lock) - { - try - { - type_properties.Add(type, props); - } - catch (ArgumentException) - { + lock (type_properties_lock) { + try { + type_properties.Add (type, props); + } catch (ArgumentException) { + return; } } } - private static MethodInfo GetConvOp(Type t1, Type t2) + private static MethodInfo GetConvOp (Type t1, Type t2) { - lock (conv_ops_lock) - { - if (!conv_ops.ContainsKey(t1)) - conv_ops.Add(t1, new Dictionary()); + lock (conv_ops_lock) { + if (! conv_ops.ContainsKey (t1)) + conv_ops.Add (t1, new Dictionary ()); } - if (conv_ops[t1].ContainsKey(t2)) + if (conv_ops[t1].ContainsKey (t2)) return conv_ops[t1][t2]; - var op = t1.GetMethod( - "op_Implicit", new[] - { - t2 - }); + MethodInfo op = t1.GetMethod ( + "op_Implicit", new Type[] { t2 }); - lock (conv_ops_lock) - { - try - { - conv_ops[t1].Add(t2, op); - } - catch (ArgumentException) - { + lock (conv_ops_lock) { + try { + conv_ops[t1].Add (t2, op); + } catch (ArgumentException) { return conv_ops[t1][t2]; } } @@ -429,68 +303,63 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return op; } - private static object ReadValue(Type inst_type, JsonReader reader) + private static object ReadValue (Type inst_type, JsonReader reader) { - reader.Read(); + reader.Read (); if (reader.Token == JsonToken.ArrayEnd) return null; - var underlying_type = Nullable.GetUnderlyingType(inst_type); - var value_type = underlying_type ?? inst_type; + Type underlying_type = Nullable.GetUnderlyingType(inst_type); + Type value_type = underlying_type ?? inst_type; - if (reader.Token == JsonToken.Null) - { + if (reader.Token == JsonToken.Null) { #if NETSTANDARD1_5 if (inst_type.IsClass() || underlying_type != null) { return null; } #else - if (inst_type.IsClass || underlying_type != null) - { + if (inst_type.IsClass || underlying_type != null) { return null; } #endif - throw new JsonException(string.Format( - "Can't assign null to an instance of type {0}", - inst_type)); + throw new JsonException (String.Format ( + "Can't assign null to an instance of type {0}", + inst_type)); } if (reader.Token == JsonToken.Double || reader.Token == JsonToken.Int || reader.Token == JsonToken.Long || reader.Token == JsonToken.String || - reader.Token == JsonToken.Boolean) - { + reader.Token == JsonToken.Boolean) { - var json_type = reader.Value.GetType(); + Type json_type = reader.Value.GetType (); - if (value_type.IsAssignableFrom(json_type)) + if (value_type.IsAssignableFrom (json_type)) return reader.Value; // If there's a custom importer that fits, use it - if (custom_importers_table.ContainsKey(json_type) && - custom_importers_table[json_type].ContainsKey( - value_type)) - { + if (custom_importers_table.ContainsKey (json_type) && + custom_importers_table[json_type].ContainsKey ( + value_type)) { - var importer = + ImporterFunc importer = custom_importers_table[json_type][value_type]; - return importer(reader.Value); + return importer (reader.Value); } // Maybe there's a base importer that works - if (base_importers_table.ContainsKey(json_type) && - base_importers_table[json_type].ContainsKey( - value_type)) - { + if (base_importers_table.ContainsKey (json_type) && + base_importers_table[json_type].ContainsKey ( + value_type)) { - var importer = + ImporterFunc importer = base_importers_table[json_type][value_type]; - return importer(reader.Value); + return importer (reader.Value); } // Maybe it's an enum @@ -499,133 +368,113 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return Enum.ToObject (value_type, reader.Value); #else if (value_type.IsEnum) - return Enum.ToObject(value_type, reader.Value); + return Enum.ToObject (value_type, reader.Value); #endif // Try using an implicit conversion operator - var conv_op = GetConvOp(value_type, json_type); + MethodInfo conv_op = GetConvOp (value_type, json_type); if (conv_op != null) - return conv_op.Invoke(null, - new[] - { - reader.Value - }); + return conv_op.Invoke (null, + new object[] { reader.Value }); // No luck - throw new JsonException(string.Format( - "Can't assign value '{0}' (type {1}) to type {2}", - reader.Value, json_type, inst_type)); + throw new JsonException (String.Format ( + "Can't assign value '{0}' (type {1}) to type {2}", + reader.Value, json_type, inst_type)); } object instance = null; - if (reader.Token == JsonToken.ArrayStart) - { + if (reader.Token == JsonToken.ArrayStart) { - AddArrayMetadata(inst_type); - var t_data = array_metadata[inst_type]; + AddArrayMetadata (inst_type); + ArrayMetadata t_data = array_metadata[inst_type]; - if (!t_data.IsArray && !t_data.IsList) - throw new JsonException(string.Format( - "Type {0} can't act as an array", - inst_type)); + if (! t_data.IsArray && ! t_data.IsList) + throw new JsonException (String.Format ( + "Type {0} can't act as an array", + inst_type)); IList list; Type elem_type; - if (!t_data.IsArray) - { - list = (IList)Activator.CreateInstance(inst_type); + if (! t_data.IsArray) { + list = (IList) Activator.CreateInstance (inst_type); elem_type = t_data.ElementType; + } else { + list = new ArrayList (); + elem_type = inst_type.GetElementType (); } - else - { - list = new ArrayList(); - elem_type = inst_type.GetElementType(); - } - + list.Clear(); - while(true) - { - object item = ReadValue(elem_type, reader); + while (true) { + object item = ReadValue (elem_type, reader); if (item == null && reader.Token == JsonToken.ArrayEnd) break; - list.Add(item); + list.Add (item); } - if (t_data.IsArray) - { + if (t_data.IsArray) { int n = list.Count; - instance = Array.CreateInstance(elem_type, n); + instance = Array.CreateInstance (elem_type, n); for (int i = 0; i < n; i++) - ((Array)instance).SetValue(list[i], i); - } - else + ((Array) instance).SetValue (list[i], i); + } else instance = list; - } - else if (reader.Token == JsonToken.ObjectStart) - { - AddObjectMetadata(value_type); - var t_data = object_metadata[value_type]; + } else if (reader.Token == JsonToken.ObjectStart) { + AddObjectMetadata (value_type); + ObjectMetadata t_data = object_metadata[value_type]; - instance = Activator.CreateInstance(value_type); + instance = Activator.CreateInstance (value_type); - while(true) - { - reader.Read(); + while (true) { + reader.Read (); if (reader.Token == JsonToken.ObjectEnd) break; - string property = (string)reader.Value; + string property = (string) reader.Value; - if (t_data.Properties.ContainsKey(property)) - { - var prop_data = + if (t_data.Properties.ContainsKey (property)) { + PropertyMetadata prop_data = t_data.Properties[property]; - if (prop_data.IsField) - { - ((FieldInfo)prop_data.Info).SetValue( - instance, ReadValue(prop_data.Type, reader)); - } - else - { - var p_info = - (PropertyInfo)prop_data.Info; + if (prop_data.IsField) { + ((FieldInfo) prop_data.Info).SetValue ( + instance, ReadValue (prop_data.Type, reader)); + } else { + PropertyInfo p_info = + (PropertyInfo) prop_data.Info; if (p_info.CanWrite) - p_info.SetValue( + p_info.SetValue ( instance, - ReadValue(prop_data.Type, reader), + ReadValue (prop_data.Type, reader), null); else - ReadValue(prop_data.Type, reader); + ReadValue (prop_data.Type, reader); } - } - else - { - if (!t_data.IsDictionary) - { + } else { + if (! t_data.IsDictionary) { - if (!reader.SkipNonMembers) - { - throw new JsonException(string.Format( - "The type {0} doesn't have the " + - "property '{1}'", - inst_type, property)); + if (! reader.SkipNonMembers) { + throw new JsonException (String.Format ( + "The type {0} doesn't have the " + + "property '{1}'", + inst_type, property)); + } else { + ReadSkip (reader); + continue; } - ReadSkip(reader); - continue; } - ((IDictionary)instance).Add( - property, ReadValue( + ((IDictionary) instance).Add ( + property, ReadValue ( t_data.ElementType, reader)); } @@ -636,74 +485,65 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return instance; } - private static IJsonWrapper ReadValue(WrapperFactory factory, - JsonReader reader) + private static IJsonWrapper ReadValue (WrapperFactory factory, + JsonReader reader) { - reader.Read(); + reader.Read (); if (reader.Token == JsonToken.ArrayEnd || reader.Token == JsonToken.Null) return null; - var instance = factory(); + IJsonWrapper instance = factory (); - if (reader.Token == JsonToken.String) - { - instance.SetString((string)reader.Value); + if (reader.Token == JsonToken.String) { + instance.SetString ((string) reader.Value); return instance; } - if (reader.Token == JsonToken.Double) - { - instance.SetDouble((double)reader.Value); + if (reader.Token == JsonToken.Double) { + instance.SetDouble ((double) reader.Value); return instance; } - if (reader.Token == JsonToken.Int) - { - instance.SetInt((int)reader.Value); + if (reader.Token == JsonToken.Int) { + instance.SetInt ((int) reader.Value); return instance; } - if (reader.Token == JsonToken.Long) - { - instance.SetLong((long)reader.Value); + if (reader.Token == JsonToken.Long) { + instance.SetLong ((long) reader.Value); return instance; } - if (reader.Token == JsonToken.Boolean) - { - instance.SetBoolean((bool)reader.Value); + if (reader.Token == JsonToken.Boolean) { + instance.SetBoolean ((bool) reader.Value); return instance; } - if (reader.Token == JsonToken.ArrayStart) - { - instance.SetJsonType(JsonType.Array); + if (reader.Token == JsonToken.ArrayStart) { + instance.SetJsonType (JsonType.Array); - while(true) - { - var item = ReadValue(factory, reader); + while (true) { + IJsonWrapper item = ReadValue (factory, reader); if (item == null && reader.Token == JsonToken.ArrayEnd) break; - instance.Add(item); + ((IList) instance).Add (item); } } - else if (reader.Token == JsonToken.ObjectStart) - { - instance.SetJsonType(JsonType.Object); + else if (reader.Token == JsonToken.ObjectStart) { + instance.SetJsonType (JsonType.Object); - while(true) - { - reader.Read(); + while (true) { + reader.Read (); if (reader.Token == JsonToken.ObjectEnd) break; - string property = (string)reader.Value; + string property = (string) reader.Value; - instance[property] = ReadValue( + ((IDictionary) instance)[property] = ReadValue ( factory, reader); } @@ -712,336 +552,426 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return instance; } - private static void ReadSkip(JsonReader reader) + private static void ReadSkip (JsonReader reader) { - ToWrapper( - delegate { return new JsonMockWrapper(); }, reader); + ToWrapper ( + delegate { return new JsonMockWrapper (); }, reader); } - private static void RegisterBaseExporters() + private static void RegisterBaseExporters () { - base_exporters_table[typeof(byte)] = - delegate(object obj, JsonWriter writer) { - writer.Write(Convert.ToInt32((byte)obj)); + base_exporters_table[typeof (byte)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToInt32 ((byte) obj)); }; - base_exporters_table[typeof(char)] = - delegate(object obj, JsonWriter writer) { - writer.Write(Convert.ToString((char)obj)); + base_exporters_table[typeof (char)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToString ((char) obj)); }; - base_exporters_table[typeof(DateTime)] = - delegate(object obj, JsonWriter writer) { - writer.Write(Convert.ToString((DateTime)obj, - datetime_format)); + base_exporters_table[typeof (DateTime)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToString ((DateTime) obj, + datetime_format)); }; - base_exporters_table[typeof(decimal)] = - delegate(object obj, JsonWriter writer) { - writer.Write((decimal)obj); + base_exporters_table[typeof (decimal)] = + delegate (object obj, JsonWriter writer) { + writer.Write ((decimal) obj); }; - base_exporters_table[typeof(sbyte)] = - delegate(object obj, JsonWriter writer) { - writer.Write(Convert.ToInt32((sbyte)obj)); + base_exporters_table[typeof (sbyte)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToInt32 ((sbyte) obj)); }; - base_exporters_table[typeof(short)] = - delegate(object obj, JsonWriter writer) { - writer.Write(Convert.ToInt32((short)obj)); + base_exporters_table[typeof (short)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToInt32 ((short) obj)); }; - base_exporters_table[typeof(ushort)] = - delegate(object obj, JsonWriter writer) { - writer.Write(Convert.ToInt32((ushort)obj)); + base_exporters_table[typeof (ushort)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToInt32 ((ushort) obj)); }; - base_exporters_table[typeof(uint)] = - delegate(object obj, JsonWriter writer) { - writer.Write(Convert.ToUInt64((uint)obj)); + base_exporters_table[typeof (uint)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToUInt64 ((uint) obj)); }; - base_exporters_table[typeof(ulong)] = - delegate(object obj, JsonWriter writer) { - writer.Write((ulong)obj); + base_exporters_table[typeof (ulong)] = + delegate (object obj, JsonWriter writer) { + writer.Write ((ulong) obj); }; base_exporters_table[typeof(DateTimeOffset)] = - delegate(object obj, JsonWriter writer) { + delegate (object obj, JsonWriter writer) { writer.Write(((DateTimeOffset)obj).ToString("yyyy-MM-ddTHH:mm:ss.fffffffzzz", datetime_format)); }; } - private static void RegisterBaseImporters() + private static void RegisterBaseImporters () { ImporterFunc importer; - importer = delegate(object input) { - return Convert.ToByte((int)input); + importer = delegate (object input) { + return Convert.ToByte ((int) input); }; - RegisterImporter(base_importers_table, typeof(int), - typeof(byte), importer); + RegisterImporter (base_importers_table, typeof (int), + typeof (byte), importer); - importer = delegate(object input) { - return Convert.ToUInt64((int)input); + importer = delegate (object input) { + return Convert.ToUInt64 ((int) input); }; - RegisterImporter(base_importers_table, typeof(int), - typeof(ulong), importer); + RegisterImporter (base_importers_table, typeof (int), + typeof (ulong), importer); - importer = delegate(object input) { + importer = delegate (object input) { return Convert.ToInt64((int)input); }; RegisterImporter(base_importers_table, typeof(int), - typeof(long), importer); + typeof(long), importer); - importer = delegate(object input) { - return Convert.ToSByte((int)input); + importer = delegate (object input) { + return Convert.ToSByte ((int) input); }; - RegisterImporter(base_importers_table, typeof(int), - typeof(sbyte), importer); + RegisterImporter (base_importers_table, typeof (int), + typeof (sbyte), importer); - importer = delegate(object input) { - return Convert.ToInt16((int)input); + importer = delegate (object input) { + return Convert.ToInt16 ((int) input); }; - RegisterImporter(base_importers_table, typeof(int), - typeof(short), importer); + RegisterImporter (base_importers_table, typeof (int), + typeof (short), importer); - importer = delegate(object input) { - return Convert.ToUInt16((int)input); + importer = delegate (object input) { + return Convert.ToUInt16 ((int) input); }; - RegisterImporter(base_importers_table, typeof(int), - typeof(ushort), importer); + RegisterImporter (base_importers_table, typeof (int), + typeof (ushort), importer); - importer = delegate(object input) { - return Convert.ToUInt32((int)input); + importer = delegate (object input) { + return Convert.ToUInt32 ((int) input); }; - RegisterImporter(base_importers_table, typeof(int), - typeof(uint), importer); + RegisterImporter (base_importers_table, typeof (int), + typeof (uint), importer); - importer = delegate(object input) { - return Convert.ToSingle((int)input); + importer = delegate (object input) { + return Convert.ToSingle ((int) input); }; - RegisterImporter(base_importers_table, typeof(int), - typeof(float), importer); + RegisterImporter (base_importers_table, typeof (int), + typeof (float), importer); - importer = delegate(object input) { - return Convert.ToDouble((int)input); + importer = delegate (object input) { + return Convert.ToDouble ((int) input); }; - RegisterImporter(base_importers_table, typeof(int), - typeof(double), importer); + RegisterImporter (base_importers_table, typeof (int), + typeof (double), importer); - importer = delegate(object input) { - return Convert.ToDecimal((double)input); + importer = delegate (object input) { + return Convert.ToDecimal ((double) input); }; - RegisterImporter(base_importers_table, typeof(double), - typeof(decimal), importer); + RegisterImporter (base_importers_table, typeof (double), + typeof (decimal), importer); - importer = delegate(object input) { + importer = delegate (object input) { return Convert.ToSingle((double)input); }; RegisterImporter(base_importers_table, typeof(double), - typeof(float), importer); + typeof(float), importer); - importer = delegate(object input) { - return Convert.ToUInt32((long)input); + importer = delegate (object input) { + return Convert.ToUInt32 ((long) input); }; - RegisterImporter(base_importers_table, typeof(long), - typeof(uint), importer); + RegisterImporter (base_importers_table, typeof (long), + typeof (uint), importer); - importer = delegate(object input) { - return Convert.ToChar((string)input); + importer = delegate (object input) { + return Convert.ToChar ((string) input); }; - RegisterImporter(base_importers_table, typeof(string), - typeof(char), importer); + RegisterImporter (base_importers_table, typeof (string), + typeof (char), importer); - importer = delegate(object input) { - return Convert.ToDateTime((string)input, datetime_format); + importer = delegate (object input) { + return Convert.ToDateTime ((string) input, datetime_format); }; - RegisterImporter(base_importers_table, typeof(string), - typeof(DateTime), importer); + RegisterImporter (base_importers_table, typeof (string), + typeof (DateTime), importer); - importer = delegate(object input) { + importer = delegate (object input) { return DateTimeOffset.Parse((string)input, datetime_format); }; RegisterImporter(base_importers_table, typeof(string), - typeof(DateTimeOffset), importer); + typeof(DateTimeOffset), importer); } - private static void RegisterImporter( + private static void RegisterImporter ( IDictionary> table, Type json_type, Type value_type, ImporterFunc importer) { - if (!table.ContainsKey(json_type)) - table.Add(json_type, new Dictionary()); + if (! table.ContainsKey (json_type)) + table.Add (json_type, new Dictionary ()); table[json_type][value_type] = importer; } - private static void WriteValue(object obj, JsonWriter writer, - bool writer_is_private, - int depth) + private static void WriteValue (object obj, JsonWriter writer, + bool writer_is_private, + int depth) { if (depth > max_nesting_depth) - throw new JsonException( - string.Format("Max allowed object depth reached while " + - "trying to export from type {0}", - obj.GetType())); + throw new JsonException ( + String.Format ("Max allowed object depth reached while " + + "trying to export from type {0}", + obj.GetType ())); - if (obj == null) - { - writer.Write(null); + if (obj == null) { + writer.Write (null); return; } - if (obj is IJsonWrapper) - { + if (obj is IJsonWrapper) { if (writer_is_private) - writer.TextWriter.Write(((IJsonWrapper)obj).ToJson()); + writer.TextWriter.Write (((IJsonWrapper) obj).ToJson ()); else - ((IJsonWrapper)obj).ToJson(writer); + ((IJsonWrapper) obj).ToJson (writer); return; } - if (obj is string) - { - writer.Write((string)obj); + if (obj is String) { + writer.Write ((string) obj); return; } - if (obj is double) - { - writer.Write((double)obj); + if (obj is Double) { + writer.Write ((double) obj); return; } - if (obj is float) + if (obj is Single) { writer.Write((float)obj); return; } - if (obj is int) - { - writer.Write((int)obj); + if (obj is Int32) { + writer.Write ((int) obj); return; } - if (obj is bool) - { - writer.Write((bool)obj); + if (obj is Boolean) { + writer.Write ((bool) obj); return; } - if (obj is long) - { - writer.Write((long)obj); + if (obj is Int64) { + writer.Write ((long) obj); return; } - if (obj is Array) - { - writer.WriteArrayStart(); + if (obj is Array) { + writer.WriteArrayStart (); - foreach (object elem in (Array)obj) - WriteValue(elem, writer, writer_is_private, depth + 1); + foreach (object elem in (Array) obj) + WriteValue (elem, writer, writer_is_private, depth + 1); - writer.WriteArrayEnd(); + writer.WriteArrayEnd (); return; } - if (obj is IList) - { - writer.WriteArrayStart(); - foreach (object elem in (IList)obj) - WriteValue(elem, writer, writer_is_private, depth + 1); - writer.WriteArrayEnd(); + if (obj is IList) { + writer.WriteArrayStart (); + foreach (object elem in (IList) obj) + WriteValue (elem, writer, writer_is_private, depth + 1); + writer.WriteArrayEnd (); return; } - if (obj is IDictionary dictionary) - { - writer.WriteObjectStart(); - foreach (DictionaryEntry entry in dictionary) - { - string propertyName = entry.Key is string key ? + if (obj is IDictionary dictionary) { + writer.WriteObjectStart (); + foreach (DictionaryEntry entry in dictionary) { + var propertyName = entry.Key is string key ? key : Convert.ToString(entry.Key, CultureInfo.InvariantCulture); - writer.WritePropertyName(propertyName); - WriteValue(entry.Value, writer, writer_is_private, - depth + 1); + writer.WritePropertyName (propertyName); + WriteValue (entry.Value, writer, writer_is_private, + depth + 1); } - writer.WriteObjectEnd(); + writer.WriteObjectEnd (); return; } - var obj_type = obj.GetType(); + Type obj_type = obj.GetType (); // See if there's a custom exporter for the object - if (custom_exporters_table.ContainsKey(obj_type)) - { - var exporter = custom_exporters_table[obj_type]; - exporter(obj, writer); + if (custom_exporters_table.ContainsKey (obj_type)) { + ExporterFunc exporter = custom_exporters_table[obj_type]; + exporter (obj, writer); return; } // If not, maybe there's a base exporter - if (base_exporters_table.ContainsKey(obj_type)) - { - var exporter = base_exporters_table[obj_type]; - exporter(obj, writer); + if (base_exporters_table.ContainsKey (obj_type)) { + ExporterFunc exporter = base_exporters_table[obj_type]; + exporter (obj, writer); return; } // Last option, let's see if it's an enum - if (obj is Enum) - { - var e_type = Enum.GetUnderlyingType(obj_type); + if (obj is Enum) { + Type e_type = Enum.GetUnderlyingType (obj_type); - if (e_type == typeof(long) - || e_type == typeof(uint) - || e_type == typeof(ulong)) - writer.Write((ulong)obj); + if (e_type == typeof (long) + || e_type == typeof (uint) + || e_type == typeof (ulong)) + writer.Write ((ulong) obj); else - writer.Write((int)obj); + writer.Write ((int) obj); return; } // Okay, so it looks like the input should be exported as an // object - AddTypeProperties(obj_type); + AddTypeProperties (obj_type); IList props = type_properties[obj_type]; - writer.WriteObjectStart(); - foreach (var p_data in props) - { - if (p_data.IsField) - { - writer.WritePropertyName(p_data.Info.Name); - WriteValue(((FieldInfo)p_data.Info).GetValue(obj), - writer, writer_is_private, depth + 1); + writer.WriteObjectStart (); + foreach (PropertyMetadata p_data in props) { + if (p_data.IsField) { + writer.WritePropertyName (p_data.Info.Name); + WriteValue (((FieldInfo) p_data.Info).GetValue (obj), + writer, writer_is_private, depth + 1); } - else - { - var p_info = (PropertyInfo)p_data.Info; + else { + PropertyInfo p_info = (PropertyInfo) p_data.Info; - if (p_info.CanRead) - { - writer.WritePropertyName(p_data.Info.Name); - WriteValue(p_info.GetValue(obj, null), - writer, writer_is_private, depth + 1); + if (p_info.CanRead) { + writer.WritePropertyName (p_data.Info.Name); + WriteValue (p_info.GetValue (obj, null), + writer, writer_is_private, depth + 1); } } } - writer.WriteObjectEnd(); + writer.WriteObjectEnd (); + } + #endregion + + + public static string ToJson (object obj) + { + lock (static_writer_lock) { + static_writer.Reset (); + + WriteValue (obj, static_writer, true, 0); + + return static_writer.ToString (); + } } - #endregion + public static void ToJson (object obj, JsonWriter writer) + { + WriteValue (obj, writer, false, 0); + } + + public static JsonData ToObject (JsonReader reader) + { + return (JsonData) ToWrapper ( + delegate { return new JsonData (); }, reader); + } + + public static JsonData ToObject (TextReader reader) + { + JsonReader json_reader = new JsonReader (reader); + + return (JsonData) ToWrapper ( + delegate { return new JsonData (); }, json_reader); + } + + public static JsonData ToObject (string json) + { + return (JsonData) ToWrapper ( + delegate { return new JsonData (); }, json); + } + + public static T ToObject (JsonReader reader) + { + return (T) ReadValue (typeof (T), reader); + } + + public static T ToObject (TextReader reader) + { + JsonReader json_reader = new JsonReader (reader); + + return (T) ReadValue (typeof (T), json_reader); + } + + public static T ToObject (string json) + { + JsonReader reader = new JsonReader (json); + + return (T) ReadValue (typeof (T), reader); + } + + public static object ToObject(string json, Type ConvertType ) + { + JsonReader reader = new JsonReader(json); + + return ReadValue(ConvertType, reader); + } + + public static IJsonWrapper ToWrapper (WrapperFactory factory, + JsonReader reader) + { + return ReadValue (factory, reader); + } + + public static IJsonWrapper ToWrapper (WrapperFactory factory, + string json) + { + JsonReader reader = new JsonReader (json); + + return ReadValue (factory, reader); + } + + public static void RegisterExporter (ExporterFunc exporter) + { + ExporterFunc exporter_wrapper = + delegate (object obj, JsonWriter writer) { + exporter ((T) obj, writer); + }; + + custom_exporters_table[typeof (T)] = exporter_wrapper; + } + + public static void RegisterImporter ( + ImporterFunc importer) + { + ImporterFunc importer_wrapper = + delegate (object input) { + return importer ((TJson) input); + }; + + RegisterImporter (custom_importers_table, typeof (TJson), + typeof (TValue), importer_wrapper); + } + + public static void UnregisterExporters () + { + custom_exporters_table.Clear (); + } + + public static void UnregisterImporters () + { + custom_importers_table.Clear (); + } } -} \ No newline at end of file +} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonMockWrapper.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonMockWrapper.cs index 852fff8..0ad35bc 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonMockWrapper.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonMockWrapper.cs @@ -1,5 +1,4 @@ #region Header - /** * JsonMockWrapper.cs * Mock object implementing IJsonWrapper, to facilitate actions like @@ -8,7 +7,6 @@ * The authors disclaim copyright to this source code. For more details, see * the COPYING file included with this distribution. **/ - #endregion @@ -16,95 +14,92 @@ using System; using System.Collections; using System.Collections.Specialized; + namespace StarkSDKSpace.UNBridgeLib.LitJson { public class JsonMockWrapper : IJsonWrapper { - public bool IsArray { get { return false; } } + public bool IsArray { get { return false; } } public bool IsBoolean { get { return false; } } - public bool IsDouble { get { return false; } } - public bool IsInt { get { return false; } } - public bool IsLong { get { return false; } } - public bool IsObject { get { return false; } } - public bool IsString { get { return false; } } + public bool IsDouble { get { return false; } } + public bool IsInt { get { return false; } } + public bool IsLong { get { return false; } } + public bool IsObject { get { return false; } } + public bool IsString { get { return false; } } - public bool GetBoolean() { return false; } - public double GetDouble() { return 0.0; } - public int GetInt() { return 0; } - public JsonType GetJsonType() { return JsonType.None; } - public long GetLong() { return 0L; } - public string GetString() { return ""; } + public bool GetBoolean () { return false; } + public double GetDouble () { return 0.0; } + public int GetInt () { return 0; } + public JsonType GetJsonType () { return JsonType.None; } + public long GetLong () { return 0L; } + public string GetString () { return ""; } - public void SetBoolean(bool val) {} - public void SetDouble(double val) {} - public void SetInt(int val) {} - public void SetJsonType(JsonType type) {} - public void SetLong(long val) {} - public void SetString(string val) {} + public void SetBoolean (bool val) {} + public void SetDouble (double val) {} + public void SetInt (int val) {} + public void SetJsonType (JsonType type) {} + public void SetLong (long val) {} + public void SetString (string val) {} - public string ToJson() { return ""; } - public void ToJson(JsonWriter writer) {} + public string ToJson () { return ""; } + public void ToJson (JsonWriter writer) {} bool IList.IsFixedSize { get { return true; } } - bool IList.IsReadOnly { get { return true; } } + bool IList.IsReadOnly { get { return true; } } - object IList.this[int index] - { + object IList.this[int index] { get { return null; } set {} } - int IList.Add(object value) { return 0; } - void IList.Clear() {} - bool IList.Contains(object value) { return false; } - int IList.IndexOf(object value) { return -1; } - void IList.Insert(int i, object v) {} - void IList.Remove(object value) {} - void IList.RemoveAt(int index) {} + int IList.Add (object value) { return 0; } + void IList.Clear () {} + bool IList.Contains (object value) { return false; } + int IList.IndexOf (object value) { return -1; } + void IList.Insert (int i, object v) {} + void IList.Remove (object value) {} + void IList.RemoveAt (int index) {} - int ICollection.Count { get { return 0; } } - bool ICollection.IsSynchronized { get { return false; } } - object ICollection.SyncRoot { get { return null; } } + int ICollection.Count { get { return 0; } } + bool ICollection.IsSynchronized { get { return false; } } + object ICollection.SyncRoot { get { return null; } } - void ICollection.CopyTo(Array array, int index) {} + void ICollection.CopyTo (Array array, int index) {} - IEnumerator IEnumerable.GetEnumerator() { return null; } + IEnumerator IEnumerable.GetEnumerator () { return null; } bool IDictionary.IsFixedSize { get { return true; } } - bool IDictionary.IsReadOnly { get { return true; } } + bool IDictionary.IsReadOnly { get { return true; } } - ICollection IDictionary.Keys { get { return null; } } + ICollection IDictionary.Keys { get { return null; } } ICollection IDictionary.Values { get { return null; } } - object IDictionary.this[object key] - { + object IDictionary.this[object key] { get { return null; } set {} } - void IDictionary.Add(object k, object v) {} - void IDictionary.Clear() {} - bool IDictionary.Contains(object key) { return false; } - void IDictionary.Remove(object key) {} + void IDictionary.Add (object k, object v) {} + void IDictionary.Clear () {} + bool IDictionary.Contains (object key) { return false; } + void IDictionary.Remove (object key) {} - IDictionaryEnumerator IDictionary.GetEnumerator() { return null; } + IDictionaryEnumerator IDictionary.GetEnumerator () { return null; } - object IOrderedDictionary.this[int idx] - { + object IOrderedDictionary.this[int idx] { get { return null; } set {} } - IDictionaryEnumerator IOrderedDictionary.GetEnumerator() - { + IDictionaryEnumerator IOrderedDictionary.GetEnumerator () { return null; } - void IOrderedDictionary.Insert(int i, object k, object v) {} - void IOrderedDictionary.RemoveAt(int i) {} + void IOrderedDictionary.Insert (int i, object k, object v) {} + void IOrderedDictionary.RemoveAt (int i) {} } -} \ No newline at end of file +} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonReader.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonReader.cs index babad1b..a10836f 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonReader.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonReader.cs @@ -1,5 +1,4 @@ #region Header - /** * JsonReader.cs * Stream-like access to JSON text. @@ -7,7 +6,6 @@ * The authors disclaim copyright to this source code. For more details, see * the COPYING file included with this distribution. **/ - #endregion @@ -15,6 +13,8 @@ using System; using System.Collections.Generic; using System.Globalization; using System.IO; +using System.Text; + namespace StarkSDKSpace.UNBridgeLib.LitJson { @@ -42,74 +42,410 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson public class JsonReader { + #region Fields + private static readonly IDictionary> parse_table; + + private Stack automaton_stack; + private int current_input; + private int current_symbol; + private bool end_of_json; + private bool end_of_input; + private Lexer lexer; + private bool parser_in_string; + private bool parser_return; + private bool read_started; + private TextReader reader; + private bool reader_is_owned; + private bool skip_non_members; + private object token_value; + private JsonToken token; + #endregion - public void Close() + #region Public Properties + public bool AllowComments { + get { return lexer.AllowComments; } + set { lexer.AllowComments = value; } + } + + public bool AllowSingleQuotedStrings { + get { return lexer.AllowSingleQuotedStrings; } + set { lexer.AllowSingleQuotedStrings = value; } + } + + public bool SkipNonMembers { + get { return skip_non_members; } + set { skip_non_members = value; } + } + + public bool EndOfInput { + get { return end_of_input; } + } + + public bool EndOfJson { + get { return end_of_json; } + } + + public JsonToken Token { + get { return token; } + } + + public object Value { + get { return token_value; } + } + #endregion + + + #region Constructors + static JsonReader () { - if (EndOfInput) + parse_table = PopulateParseTable (); + } + + public JsonReader (string json_text) : + this (new StringReader (json_text), true) + { + } + + public JsonReader (TextReader reader) : + this (reader, false) + { + } + + private JsonReader (TextReader reader, bool owned) + { + if (reader == null) + throw new ArgumentNullException ("reader"); + + parser_in_string = false; + parser_return = false; + + read_started = false; + automaton_stack = new Stack (); + automaton_stack.Push ((int) ParserToken.End); + automaton_stack.Push ((int) ParserToken.Text); + + lexer = new Lexer (reader); + + end_of_input = false; + end_of_json = false; + + skip_non_members = true; + + this.reader = reader; + reader_is_owned = owned; + } + #endregion + + + #region Static Methods + private static IDictionary> PopulateParseTable () + { + // See section A.2. of the manual for details + IDictionary> parse_table = new Dictionary> (); + + TableAddRow (parse_table, ParserToken.Array); + TableAddCol (parse_table, ParserToken.Array, '[', + '[', + (int) ParserToken.ArrayPrime); + + TableAddRow (parse_table, ParserToken.ArrayPrime); + TableAddCol (parse_table, ParserToken.ArrayPrime, '"', + (int) ParserToken.Value, + + (int) ParserToken.ValueRest, + ']'); + TableAddCol (parse_table, ParserToken.ArrayPrime, '[', + (int) ParserToken.Value, + (int) ParserToken.ValueRest, + ']'); + TableAddCol (parse_table, ParserToken.ArrayPrime, ']', + ']'); + TableAddCol (parse_table, ParserToken.ArrayPrime, '{', + (int) ParserToken.Value, + (int) ParserToken.ValueRest, + ']'); + TableAddCol (parse_table, ParserToken.ArrayPrime, (int) ParserToken.Number, + (int) ParserToken.Value, + (int) ParserToken.ValueRest, + ']'); + TableAddCol (parse_table, ParserToken.ArrayPrime, (int) ParserToken.True, + (int) ParserToken.Value, + (int) ParserToken.ValueRest, + ']'); + TableAddCol (parse_table, ParserToken.ArrayPrime, (int) ParserToken.False, + (int) ParserToken.Value, + (int) ParserToken.ValueRest, + ']'); + TableAddCol (parse_table, ParserToken.ArrayPrime, (int) ParserToken.Null, + (int) ParserToken.Value, + (int) ParserToken.ValueRest, + ']'); + + TableAddRow (parse_table, ParserToken.Object); + TableAddCol (parse_table, ParserToken.Object, '{', + '{', + (int) ParserToken.ObjectPrime); + + TableAddRow (parse_table, ParserToken.ObjectPrime); + TableAddCol (parse_table, ParserToken.ObjectPrime, '"', + (int) ParserToken.Pair, + (int) ParserToken.PairRest, + '}'); + TableAddCol (parse_table, ParserToken.ObjectPrime, '}', + '}'); + + TableAddRow (parse_table, ParserToken.Pair); + TableAddCol (parse_table, ParserToken.Pair, '"', + (int) ParserToken.String, + ':', + (int) ParserToken.Value); + + TableAddRow (parse_table, ParserToken.PairRest); + TableAddCol (parse_table, ParserToken.PairRest, ',', + ',', + (int) ParserToken.Pair, + (int) ParserToken.PairRest); + TableAddCol (parse_table, ParserToken.PairRest, '}', + (int) ParserToken.Epsilon); + + TableAddRow (parse_table, ParserToken.String); + TableAddCol (parse_table, ParserToken.String, '"', + '"', + (int) ParserToken.CharSeq, + '"'); + + TableAddRow (parse_table, ParserToken.Text); + TableAddCol (parse_table, ParserToken.Text, '[', + (int) ParserToken.Array); + TableAddCol (parse_table, ParserToken.Text, '{', + (int) ParserToken.Object); + + TableAddRow (parse_table, ParserToken.Value); + TableAddCol (parse_table, ParserToken.Value, '"', + (int) ParserToken.String); + TableAddCol (parse_table, ParserToken.Value, '[', + (int) ParserToken.Array); + TableAddCol (parse_table, ParserToken.Value, '{', + (int) ParserToken.Object); + TableAddCol (parse_table, ParserToken.Value, (int) ParserToken.Number, + (int) ParserToken.Number); + TableAddCol (parse_table, ParserToken.Value, (int) ParserToken.True, + (int) ParserToken.True); + TableAddCol (parse_table, ParserToken.Value, (int) ParserToken.False, + (int) ParserToken.False); + TableAddCol (parse_table, ParserToken.Value, (int) ParserToken.Null, + (int) ParserToken.Null); + + TableAddRow (parse_table, ParserToken.ValueRest); + TableAddCol (parse_table, ParserToken.ValueRest, ',', + ',', + (int) ParserToken.Value, + (int) ParserToken.ValueRest); + TableAddCol (parse_table, ParserToken.ValueRest, ']', + (int) ParserToken.Epsilon); + + return parse_table; + } + + private static void TableAddCol (IDictionary> parse_table, ParserToken row, int col, + params int[] symbols) + { + parse_table[(int) row].Add (col, symbols); + } + + private static void TableAddRow (IDictionary> parse_table, ParserToken rule) + { + parse_table.Add ((int) rule, new Dictionary ()); + } + #endregion + + + #region Private Methods + private void ProcessNumber (string number) + { + if (number.IndexOf ('.') != -1 || + number.IndexOf ('e') != -1 || + number.IndexOf ('E') != -1) { + + double n_double; + if (double.TryParse (number, NumberStyles.Any, CultureInfo.InvariantCulture, out n_double)) { + token = JsonToken.Double; + token_value = n_double; + + return; + } + } + + int n_int32; + if (int.TryParse (number, NumberStyles.Integer, CultureInfo.InvariantCulture, out n_int32)) { + token = JsonToken.Int; + token_value = n_int32; + + return; + } + + long n_int64; + if (long.TryParse (number, NumberStyles.Integer, CultureInfo.InvariantCulture, out n_int64)) { + token = JsonToken.Long; + token_value = n_int64; + + return; + } + + ulong n_uint64; + if (ulong.TryParse(number, NumberStyles.Integer, CultureInfo.InvariantCulture, out n_uint64)) + { + token = JsonToken.Long; + token_value = n_uint64; + + return; + } + + // Shouldn't happen, but just in case, return something + token = JsonToken.Int; + token_value = 0; + } + + private void ProcessSymbol () + { + if (current_symbol == '[') { + token = JsonToken.ArrayStart; + parser_return = true; + + } else if (current_symbol == ']') { + token = JsonToken.ArrayEnd; + parser_return = true; + + } else if (current_symbol == '{') { + token = JsonToken.ObjectStart; + parser_return = true; + + } else if (current_symbol == '}') { + token = JsonToken.ObjectEnd; + parser_return = true; + + } else if (current_symbol == '"') { + if (parser_in_string) { + parser_in_string = false; + + parser_return = true; + + } else { + if (token == JsonToken.None) + token = JsonToken.String; + + parser_in_string = true; + } + + } else if (current_symbol == (int) ParserToken.CharSeq) { + token_value = lexer.StringValue; + + } else if (current_symbol == (int) ParserToken.False) { + token = JsonToken.Boolean; + token_value = false; + parser_return = true; + + } else if (current_symbol == (int) ParserToken.Null) { + token = JsonToken.Null; + parser_return = true; + + } else if (current_symbol == (int) ParserToken.Number) { + ProcessNumber (lexer.StringValue); + + parser_return = true; + + } else if (current_symbol == (int) ParserToken.Pair) { + token = JsonToken.PropertyName; + + } else if (current_symbol == (int) ParserToken.True) { + token = JsonToken.Boolean; + token_value = true; + parser_return = true; + + } + } + + private bool ReadToken () + { + if (end_of_input) + return false; + + lexer.NextToken (); + + if (lexer.EndOfInput) { + Close (); + + return false; + } + + current_input = lexer.Token; + + return true; + } + #endregion + + + public void Close () + { + if (end_of_input) return; - EndOfInput = true; - EndOfJson = true; + end_of_input = true; + end_of_json = true; if (reader_is_owned) { - using (reader) {} + using(reader){} } reader = null; } - public bool Read() + public bool Read () { - if (EndOfInput) + if (end_of_input) return false; - if (EndOfJson) - { - EndOfJson = false; - automaton_stack.Clear(); - automaton_stack.Push((int)ParserToken.End); - automaton_stack.Push((int)ParserToken.Text); + if (end_of_json) { + end_of_json = false; + automaton_stack.Clear (); + automaton_stack.Push ((int) ParserToken.End); + automaton_stack.Push ((int) ParserToken.Text); } parser_in_string = false; - parser_return = false; + parser_return = false; - Token = JsonToken.None; - Value = null; + token = JsonToken.None; + token_value = null; - if (!read_started) - { + if (! read_started) { read_started = true; - if (!ReadToken()) + if (! ReadToken ()) return false; } int[] entry_symbols; - while(true) - { - if (parser_return) - { - if (automaton_stack.Peek() == (int)ParserToken.End) - EndOfJson = true; + while (true) { + if (parser_return) { + if (automaton_stack.Peek () == (int) ParserToken.End) + end_of_json = true; return true; } - current_symbol = automaton_stack.Pop(); + current_symbol = automaton_stack.Pop (); - ProcessSymbol(); + ProcessSymbol (); - if (current_symbol == current_input) - { - if (!ReadToken()) - { - if (automaton_stack.Peek() != (int)ParserToken.End) - throw new JsonException( + if (current_symbol == current_input) { + if (! ReadToken ()) { + if (automaton_stack.Peek () != (int) ParserToken.End) + throw new JsonException ( "Input doesn't evaluate to proper JSON text"); if (parser_return) @@ -121,390 +457,22 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson continue; } - try - { + try { entry_symbols = parse_table[current_symbol][current_input]; - } - catch (KeyNotFoundException e) - { - throw new JsonException((ParserToken)current_input, e); + } catch (KeyNotFoundException e) { + throw new JsonException ((ParserToken) current_input, e); } - if (entry_symbols[0] == (int)ParserToken.Epsilon) + if (entry_symbols[0] == (int) ParserToken.Epsilon) continue; for (int i = entry_symbols.Length - 1; i >= 0; i--) - automaton_stack.Push(entry_symbols[i]); - } - } - #region Fields - - private static readonly IDictionary> parse_table; - - private readonly Stack automaton_stack; - private int current_input; - private int current_symbol; - private readonly Lexer lexer; - private bool parser_in_string; - private bool parser_return; - private bool read_started; - private TextReader reader; - private readonly bool reader_is_owned; - - #endregion - - - #region Public Properties - - public bool AllowComments - { - get { return lexer.AllowComments; } - set { lexer.AllowComments = value; } - } - - public bool AllowSingleQuotedStrings - { - get { return lexer.AllowSingleQuotedStrings; } - set { lexer.AllowSingleQuotedStrings = value; } - } - - public bool SkipNonMembers { get; set; } - - public bool EndOfInput { get; private set; } - - public bool EndOfJson { get; private set; } - - public JsonToken Token { get; private set; } - - public object Value { get; private set; } - - #endregion - - - #region Constructors - - static JsonReader() - { - parse_table = PopulateParseTable(); - } - - public JsonReader(string json_text) : - this(new StringReader(json_text), true) - { - } - - public JsonReader(TextReader reader) : - this(reader, false) - { - } - - private JsonReader(TextReader reader, bool owned) - { - if (reader == null) - throw new ArgumentNullException("reader"); - - parser_in_string = false; - parser_return = false; - - read_started = false; - automaton_stack = new Stack(); - automaton_stack.Push((int)ParserToken.End); - automaton_stack.Push((int)ParserToken.Text); - - lexer = new Lexer(reader); - - EndOfInput = false; - EndOfJson = false; - - SkipNonMembers = true; - - this.reader = reader; - reader_is_owned = owned; - } - - #endregion - - - #region Static Methods - - private static IDictionary> PopulateParseTable() - { - // See section A.2. of the manual for details - IDictionary> parse_table = new Dictionary>(); - - TableAddRow(parse_table, ParserToken.Array); - TableAddCol(parse_table, ParserToken.Array, '[', - '[', - (int)ParserToken.ArrayPrime); - - TableAddRow(parse_table, ParserToken.ArrayPrime); - TableAddCol(parse_table, ParserToken.ArrayPrime, '"', - (int)ParserToken.Value, - (int)ParserToken.ValueRest, - ']'); - TableAddCol(parse_table, ParserToken.ArrayPrime, '[', - (int)ParserToken.Value, - (int)ParserToken.ValueRest, - ']'); - TableAddCol(parse_table, ParserToken.ArrayPrime, ']', - ']'); - TableAddCol(parse_table, ParserToken.ArrayPrime, '{', - (int)ParserToken.Value, - (int)ParserToken.ValueRest, - ']'); - TableAddCol(parse_table, ParserToken.ArrayPrime, (int)ParserToken.Number, - (int)ParserToken.Value, - (int)ParserToken.ValueRest, - ']'); - TableAddCol(parse_table, ParserToken.ArrayPrime, (int)ParserToken.True, - (int)ParserToken.Value, - (int)ParserToken.ValueRest, - ']'); - TableAddCol(parse_table, ParserToken.ArrayPrime, (int)ParserToken.False, - (int)ParserToken.Value, - (int)ParserToken.ValueRest, - ']'); - TableAddCol(parse_table, ParserToken.ArrayPrime, (int)ParserToken.Null, - (int)ParserToken.Value, - (int)ParserToken.ValueRest, - ']'); - - TableAddRow(parse_table, ParserToken.Object); - TableAddCol(parse_table, ParserToken.Object, '{', - '{', - (int)ParserToken.ObjectPrime); - - TableAddRow(parse_table, ParserToken.ObjectPrime); - TableAddCol(parse_table, ParserToken.ObjectPrime, '"', - (int)ParserToken.Pair, - (int)ParserToken.PairRest, - '}'); - TableAddCol(parse_table, ParserToken.ObjectPrime, '}', - '}'); - - TableAddRow(parse_table, ParserToken.Pair); - TableAddCol(parse_table, ParserToken.Pair, '"', - (int)ParserToken.String, - ':', - (int)ParserToken.Value); - - TableAddRow(parse_table, ParserToken.PairRest); - TableAddCol(parse_table, ParserToken.PairRest, ',', - ',', - (int)ParserToken.Pair, - (int)ParserToken.PairRest); - TableAddCol(parse_table, ParserToken.PairRest, '}', - (int)ParserToken.Epsilon); - - TableAddRow(parse_table, ParserToken.String); - TableAddCol(parse_table, ParserToken.String, '"', - '"', - (int)ParserToken.CharSeq, - '"'); - - TableAddRow(parse_table, ParserToken.Text); - TableAddCol(parse_table, ParserToken.Text, '[', - (int)ParserToken.Array); - TableAddCol(parse_table, ParserToken.Text, '{', - (int)ParserToken.Object); - - TableAddRow(parse_table, ParserToken.Value); - TableAddCol(parse_table, ParserToken.Value, '"', - (int)ParserToken.String); - TableAddCol(parse_table, ParserToken.Value, '[', - (int)ParserToken.Array); - TableAddCol(parse_table, ParserToken.Value, '{', - (int)ParserToken.Object); - TableAddCol(parse_table, ParserToken.Value, (int)ParserToken.Number, - (int)ParserToken.Number); - TableAddCol(parse_table, ParserToken.Value, (int)ParserToken.True, - (int)ParserToken.True); - TableAddCol(parse_table, ParserToken.Value, (int)ParserToken.False, - (int)ParserToken.False); - TableAddCol(parse_table, ParserToken.Value, (int)ParserToken.Null, - (int)ParserToken.Null); - - TableAddRow(parse_table, ParserToken.ValueRest); - TableAddCol(parse_table, ParserToken.ValueRest, ',', - ',', - (int)ParserToken.Value, - (int)ParserToken.ValueRest); - TableAddCol(parse_table, ParserToken.ValueRest, ']', - (int)ParserToken.Epsilon); - - return parse_table; - } - - private static void TableAddCol(IDictionary> parse_table, ParserToken row, int col, - params int[] symbols) - { - parse_table[(int)row].Add(col, symbols); - } - - private static void TableAddRow(IDictionary> parse_table, ParserToken rule) - { - parse_table.Add((int)rule, new Dictionary()); - } - - #endregion - - - #region Private Methods - - private void ProcessNumber(string number) - { - if (number.IndexOf('.') != -1 || - number.IndexOf('e') != -1 || - number.IndexOf('E') != -1) - { - - double n_double; - if (double.TryParse(number, NumberStyles.Any, CultureInfo.InvariantCulture, out n_double)) - { - Token = JsonToken.Double; - Value = n_double; - - return; - } - } - - int n_int32; - if (int.TryParse(number, NumberStyles.Integer, CultureInfo.InvariantCulture, out n_int32)) - { - Token = JsonToken.Int; - Value = n_int32; - - return; - } - - long n_int64; - if (long.TryParse(number, NumberStyles.Integer, CultureInfo.InvariantCulture, out n_int64)) - { - Token = JsonToken.Long; - Value = n_int64; - - return; - } - - ulong n_uint64; - if (ulong.TryParse(number, NumberStyles.Integer, CultureInfo.InvariantCulture, out n_uint64)) - { - Token = JsonToken.Long; - Value = n_uint64; - - return; - } - - // Shouldn't happen, but just in case, return something - Token = JsonToken.Int; - Value = 0; - } - - private void ProcessSymbol() - { - if (current_symbol == '[') - { - Token = JsonToken.ArrayStart; - parser_return = true; - - } - else if (current_symbol == ']') - { - Token = JsonToken.ArrayEnd; - parser_return = true; - - } - else if (current_symbol == '{') - { - Token = JsonToken.ObjectStart; - parser_return = true; - - } - else if (current_symbol == '}') - { - Token = JsonToken.ObjectEnd; - parser_return = true; - - } - else if (current_symbol == '"') - { - if (parser_in_string) - { - parser_in_string = false; - - parser_return = true; - - } - else - { - if (Token == JsonToken.None) - Token = JsonToken.String; - - parser_in_string = true; - } - - } - else if (current_symbol == (int)ParserToken.CharSeq) - { - Value = lexer.StringValue; - - } - else if (current_symbol == (int)ParserToken.False) - { - Token = JsonToken.Boolean; - Value = false; - parser_return = true; - - } - else if (current_symbol == (int)ParserToken.Null) - { - Token = JsonToken.Null; - parser_return = true; - - } - else if (current_symbol == (int)ParserToken.Number) - { - ProcessNumber(lexer.StringValue); - - parser_return = true; - - } - else if (current_symbol == (int)ParserToken.Pair) - { - Token = JsonToken.PropertyName; - - } - else if (current_symbol == (int)ParserToken.True) - { - Token = JsonToken.Boolean; - Value = true; - parser_return = true; - + automaton_stack.Push (entry_symbols[i]); } } - private bool ReadToken() - { - if (EndOfInput) - return false; - - lexer.NextToken(); - - if (lexer.EndOfInput) - { - Close(); - - return false; - } - - current_input = lexer.Token; - - return true; - } - - #endregion } -} \ No newline at end of file +} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonWriter.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonWriter.cs index 4cfc97e..b83cd5e 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonWriter.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonWriter.cs @@ -1,5 +1,4 @@ #region Header - /** * JsonWriter.cs * Stream-like facility to output JSON text. @@ -7,7 +6,6 @@ * The authors disclaim copyright to this source code. For more details, see * the COPYING file included with this distribution. **/ - #endregion @@ -17,6 +15,7 @@ using System.Globalization; using System.IO; using System.Text; + namespace StarkSDKSpace.UNBridgeLib.LitJson { internal enum Condition @@ -30,68 +29,313 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson internal class WriterContext { - public int Count; - public bool ExpectingValue; + public int Count; public bool InArray; public bool InObject; - public int Padding; + public bool ExpectingValue; + public int Padding; } public class JsonWriter { + #region Fields + private static readonly NumberFormatInfo number_format; + + private WriterContext context; + private Stack ctx_stack; + private bool has_reached_end; + private char[] hex_seq; + private int indentation; + private int indent_value; + private StringBuilder inst_string_builder; + private bool pretty_print; + private bool validate; + private bool lower_case_properties; + private TextWriter writer; + #endregion - public override string ToString() - { - if (inst_string_builder == null) - return string.Empty; - - return inst_string_builder.ToString(); + #region Properties + public int IndentValue { + get { return indent_value; } + set { + indentation = (indentation / indent_value) * value; + indent_value = value; + } } - public void Reset() + public bool PrettyPrint { + get { return pretty_print; } + set { pretty_print = value; } + } + + public TextWriter TextWriter { + get { return writer; } + } + + public bool Validate { + get { return validate; } + set { validate = value; } + } + + public bool LowerCaseProperties { + get { return lower_case_properties; } + set { lower_case_properties = value; } + } + #endregion + + + #region Constructors + static JsonWriter () + { + number_format = NumberFormatInfo.InvariantInfo; + } + + public JsonWriter () + { + inst_string_builder = new StringBuilder (); + writer = new StringWriter (inst_string_builder); + + Init (); + } + + public JsonWriter (StringBuilder sb) : + this (new StringWriter (sb)) + { + } + + public JsonWriter (TextWriter writer) + { + if (writer == null) + throw new ArgumentNullException ("writer"); + + this.writer = writer; + + Init (); + } + #endregion + + + #region Private Methods + private void DoValidation (Condition cond) + { + if (! context.ExpectingValue) + context.Count++; + + if (! validate) + return; + + if (has_reached_end) + throw new JsonException ( + "A complete JSON symbol has already been written"); + + switch (cond) { + case Condition.InArray: + if (! context.InArray) + throw new JsonException ( + "Can't close an array here"); + break; + + case Condition.InObject: + if (! context.InObject || context.ExpectingValue) + throw new JsonException ( + "Can't close an object here"); + break; + + case Condition.NotAProperty: + if (context.InObject && ! context.ExpectingValue) + throw new JsonException ( + "Expected a property"); + break; + + case Condition.Property: + if (! context.InObject || context.ExpectingValue) + throw new JsonException ( + "Can't add a property here"); + break; + + case Condition.Value: + if (! context.InArray && + (! context.InObject || ! context.ExpectingValue)) + throw new JsonException ( + "Can't add a value here"); + + break; + } + } + + private void Init () + { + has_reached_end = false; + hex_seq = new char[4]; + indentation = 0; + indent_value = 4; + pretty_print = false; + validate = true; + lower_case_properties = false; + + ctx_stack = new Stack (); + context = new WriterContext (); + ctx_stack.Push (context); + } + + private static void IntToHex (int n, char[] hex) + { + int num; + + for (int i = 0; i < 4; i++) { + num = n % 16; + + if (num < 10) + hex[3 - i] = (char) ('0' + num); + else + hex[3 - i] = (char) ('A' + (num - 10)); + + n >>= 4; + } + } + + private void Indent () + { + if (pretty_print) + indentation += indent_value; + } + + + private void Put (string str) + { + if (pretty_print && ! context.ExpectingValue) + for (int i = 0; i < indentation; i++) + writer.Write (' '); + + writer.Write (str); + } + + private void PutNewline () + { + PutNewline (true); + } + + private void PutNewline (bool add_comma) + { + if (add_comma && ! context.ExpectingValue && + context.Count > 1) + writer.Write (','); + + if (pretty_print && ! context.ExpectingValue) + writer.Write (Environment.NewLine); + } + + private void PutString (string str) + { + Put (String.Empty); + + writer.Write ('"'); + + int n = str.Length; + for (int i = 0; i < n; i++) { + switch (str[i]) { + case '\n': + writer.Write ("\\n"); + continue; + + case '\r': + writer.Write ("\\r"); + continue; + + case '\t': + writer.Write ("\\t"); + continue; + + case '"': + case '\\': + writer.Write ('\\'); + writer.Write (str[i]); + continue; + + case '\f': + writer.Write ("\\f"); + continue; + + case '\b': + writer.Write ("\\b"); + continue; + } + + //兼容中文 + if ((int) str[i] >= 32 && (int) str[i] <= 126 || str[i] > 127) { + writer.Write (str[i]); + continue; + } + + // Default, turn into a \uXXXX sequence + IntToHex ((int) str[i], hex_seq); + writer.Write ("\\u"); + writer.Write (hex_seq); + } + + writer.Write ('"'); + } + + private void Unindent () + { + if (pretty_print) + indentation -= indent_value; + } + #endregion + + + public override string ToString () + { + if (inst_string_builder == null) + return String.Empty; + + return inst_string_builder.ToString (); + } + + public void Reset () { has_reached_end = false; - ctx_stack.Clear(); - context = new WriterContext(); - ctx_stack.Push(context); + ctx_stack.Clear (); + context = new WriterContext (); + ctx_stack.Push (context); if (inst_string_builder != null) - inst_string_builder.Remove(0, inst_string_builder.Length); + inst_string_builder.Remove (0, inst_string_builder.Length); } - public void Write(bool boolean) + public void Write (bool boolean) { - DoValidation(Condition.Value); - PutNewline(); + DoValidation (Condition.Value); + PutNewline (); - Put(boolean ? "true" : "false"); + Put (boolean ? "true" : "false"); context.ExpectingValue = false; } - public void Write(decimal number) + public void Write (decimal number) { - DoValidation(Condition.Value); - PutNewline(); + DoValidation (Condition.Value); + PutNewline (); - Put(Convert.ToString(number, number_format)); + Put (Convert.ToString (number, number_format)); context.ExpectingValue = false; } - public void Write(double number) + public void Write (double number) { - DoValidation(Condition.Value); - PutNewline(); + DoValidation (Condition.Value); + PutNewline (); - string str = Convert.ToString(number, number_format); - Put(str); + string str = Convert.ToString (number, number_format); + Put (str); - if (str.IndexOf('.') == -1 && - str.IndexOf('E') == -1) - TextWriter.Write(".0"); + if (str.IndexOf ('.') == -1 && + str.IndexOf ('E') == -1) + writer.Write (".0"); context.ExpectingValue = false; } @@ -107,384 +351,135 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson context.ExpectingValue = false; } - public void Write(int number) + public void Write (int number) { - DoValidation(Condition.Value); - PutNewline(); + DoValidation (Condition.Value); + PutNewline (); - Put(Convert.ToString(number, number_format)); + Put (Convert.ToString (number, number_format)); context.ExpectingValue = false; } - public void Write(long number) + public void Write (long number) { - DoValidation(Condition.Value); - PutNewline(); + DoValidation (Condition.Value); + PutNewline (); - Put(Convert.ToString(number, number_format)); + Put (Convert.ToString (number, number_format)); context.ExpectingValue = false; } - public void Write(string str) + public void Write (string str) { - DoValidation(Condition.Value); - PutNewline(); + DoValidation (Condition.Value); + PutNewline (); if (str == null) - Put("null"); + Put ("null"); else - PutString(str); + PutString (str); context.ExpectingValue = false; } [CLSCompliant(false)] - public void Write(ulong number) + public void Write (ulong number) { - DoValidation(Condition.Value); - PutNewline(); + DoValidation (Condition.Value); + PutNewline (); - Put(Convert.ToString(number, number_format)); + Put (Convert.ToString (number, number_format)); context.ExpectingValue = false; } - public void WriteArrayEnd() + public void WriteArrayEnd () { - DoValidation(Condition.InArray); - PutNewline(false); + DoValidation (Condition.InArray); + PutNewline (false); - ctx_stack.Pop(); + ctx_stack.Pop (); if (ctx_stack.Count == 1) has_reached_end = true; - else - { - context = ctx_stack.Peek(); + else { + context = ctx_stack.Peek (); context.ExpectingValue = false; } - Unindent(); - Put("]"); + Unindent (); + Put ("]"); } - public void WriteArrayStart() + public void WriteArrayStart () { - DoValidation(Condition.NotAProperty); - PutNewline(); + DoValidation (Condition.NotAProperty); + PutNewline (); - Put("["); + Put ("["); - context = new WriterContext(); + context = new WriterContext (); context.InArray = true; - ctx_stack.Push(context); + ctx_stack.Push (context); - Indent(); + Indent (); } - public void WriteObjectEnd() + public void WriteObjectEnd () { - DoValidation(Condition.InObject); - PutNewline(false); + DoValidation (Condition.InObject); + PutNewline (false); - ctx_stack.Pop(); + ctx_stack.Pop (); if (ctx_stack.Count == 1) has_reached_end = true; - else - { - context = ctx_stack.Peek(); + else { + context = ctx_stack.Peek (); context.ExpectingValue = false; } - Unindent(); - Put("}"); + Unindent (); + Put ("}"); } - public void WriteObjectStart() + public void WriteObjectStart () { - DoValidation(Condition.NotAProperty); - PutNewline(); + DoValidation (Condition.NotAProperty); + PutNewline (); - Put("{"); + Put ("{"); - context = new WriterContext(); + context = new WriterContext (); context.InObject = true; - ctx_stack.Push(context); + ctx_stack.Push (context); - Indent(); + Indent (); } - public void WritePropertyName(string property_name) + public void WritePropertyName (string property_name) { - DoValidation(Condition.Property); - PutNewline(); - string propertyName = property_name == null || !LowerCaseProperties + DoValidation (Condition.Property); + PutNewline (); + string propertyName = (property_name == null || !lower_case_properties) ? property_name : property_name.ToLowerInvariant(); - PutString(propertyName); + PutString (propertyName); - if (PrettyPrint) - { + if (pretty_print) { if (propertyName.Length > context.Padding) context.Padding = propertyName.Length; for (int i = context.Padding - propertyName.Length; i >= 0; i--) - TextWriter.Write(' '); + writer.Write (' '); - TextWriter.Write(": "); - } - else - TextWriter.Write(':'); + writer.Write (": "); + } else + writer.Write (':'); context.ExpectingValue = true; } - #region Fields - - private static readonly NumberFormatInfo number_format; - - private WriterContext context; - private Stack ctx_stack; - private bool has_reached_end; - private char[] hex_seq; - private int indentation; - private int indent_value; - private readonly StringBuilder inst_string_builder; - - #endregion - - - #region Properties - - public int IndentValue - { - get { return indent_value; } - set - { - indentation = indentation / indent_value * value; - indent_value = value; - } - } - - public bool PrettyPrint { get; set; } - - public TextWriter TextWriter { get; } - - public bool Validate { get; set; } - - public bool LowerCaseProperties { get; set; } - - #endregion - - - #region Constructors - - static JsonWriter() - { - number_format = NumberFormatInfo.InvariantInfo; - } - - public JsonWriter() - { - inst_string_builder = new StringBuilder(); - TextWriter = new StringWriter(inst_string_builder); - - Init(); - } - - public JsonWriter(StringBuilder sb) : - this(new StringWriter(sb)) - { - } - - public JsonWriter(TextWriter writer) - { - if (writer == null) - throw new ArgumentNullException("writer"); - - TextWriter = writer; - - Init(); - } - - #endregion - - - #region Private Methods - - private void DoValidation(Condition cond) - { - if (!context.ExpectingValue) - context.Count++; - - if (!Validate) - return; - - if (has_reached_end) - throw new JsonException( - "A complete JSON symbol has already been written"); - - switch (cond) - { - case Condition.InArray: - if (!context.InArray) - throw new JsonException( - "Can't close an array here"); - break; - - case Condition.InObject: - if (!context.InObject || context.ExpectingValue) - throw new JsonException( - "Can't close an object here"); - break; - - case Condition.NotAProperty: - if (context.InObject && !context.ExpectingValue) - throw new JsonException( - "Expected a property"); - break; - - case Condition.Property: - if (!context.InObject || context.ExpectingValue) - throw new JsonException( - "Can't add a property here"); - break; - - case Condition.Value: - if (!context.InArray && - (!context.InObject || !context.ExpectingValue)) - throw new JsonException( - "Can't add a value here"); - - break; - } - } - - private void Init() - { - has_reached_end = false; - hex_seq = new char[4]; - indentation = 0; - indent_value = 4; - PrettyPrint = false; - Validate = true; - LowerCaseProperties = false; - - ctx_stack = new Stack(); - context = new WriterContext(); - ctx_stack.Push(context); - } - - private static void IntToHex(int n, char[] hex) - { - int num; - - for (int i = 0; i < 4; i++) - { - num = n % 16; - - if (num < 10) - hex[3 - i] = (char)('0' + num); - else - hex[3 - i] = (char)('A' + (num - 10)); - - n >>= 4; - } - } - - private void Indent() - { - if (PrettyPrint) - indentation += indent_value; - } - - - private void Put(string str) - { - if (PrettyPrint && !context.ExpectingValue) - for (int i = 0; i < indentation; i++) - TextWriter.Write(' '); - - TextWriter.Write(str); - } - - private void PutNewline() - { - PutNewline(true); - } - - private void PutNewline(bool add_comma) - { - if (add_comma && !context.ExpectingValue && - context.Count > 1) - TextWriter.Write(','); - - if (PrettyPrint && !context.ExpectingValue) - TextWriter.Write(Environment.NewLine); - } - - private void PutString(string str) - { - Put(string.Empty); - - TextWriter.Write('"'); - - int n = str.Length; - for (int i = 0; i < n; i++) - { - switch (str[i]) - { - case '\n': - TextWriter.Write("\\n"); - continue; - - case '\r': - TextWriter.Write("\\r"); - continue; - - case '\t': - TextWriter.Write("\\t"); - continue; - - case '"': - case '\\': - TextWriter.Write('\\'); - TextWriter.Write(str[i]); - continue; - - case '\f': - TextWriter.Write("\\f"); - continue; - - case '\b': - TextWriter.Write("\\b"); - continue; - } - - //兼容中文 - if (str[i] >= 32 && str[i] <= 126 || str[i] > 127) - { - TextWriter.Write(str[i]); - continue; - } - - // Default, turn into a \uXXXX sequence - IntToHex(str[i], hex_seq); - TextWriter.Write("\\u"); - TextWriter.Write(hex_seq); - } - - TextWriter.Write('"'); - } - - private void Unindent() - { - if (PrettyPrint) - indentation -= indent_value; - } - - #endregion } -} \ No newline at end of file +} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/Lexer.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/Lexer.cs index 54c47a7..4c8ffd2 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/Lexer.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/Lexer.cs @@ -1,5 +1,4 @@ #region Header - /** * Lexer.cs * JSON lexer implementation based on a finite state machine. @@ -7,187 +6,135 @@ * The authors disclaim copyright to this source code. For more details, see * the COPYING file included with this distribution. **/ - #endregion using System; +using System.Collections.Generic; using System.IO; using System.Text; + namespace StarkSDKSpace.UNBridgeLib.LitJson { internal class FsmContext { + public bool Return; + public int NextState; public Lexer L; - public int NextState; - public bool Return; - public int StateStack; + public int StateStack; } internal class Lexer { - - - private bool GetChar() - { - if ((input_char = NextChar()) != -1) - return true; - - EndOfInput = true; - return false; - } - - private int NextChar() - { - if (input_buffer != 0) - { - int tmp = input_buffer; - input_buffer = 0; - - return tmp; - } - - return reader.Read(); - } - - public bool NextToken() - { - StateHandler handler; - fsm_context.Return = false; - - while(true) - { - handler = fsm_handler_table[state - 1]; - - if (!handler(fsm_context)) - throw new JsonException(input_char); - - if (EndOfInput) - return false; - - if (fsm_context.Return) - { - StringValue = string_buffer.ToString(); - string_buffer.Remove(0, string_buffer.Length); - Token = fsm_return_table[state - 1]; - - if (Token == (int)ParserToken.Char) - Token = input_char; - - state = fsm_context.NextState; - - return true; - } - - state = fsm_context.NextState; - } - } - - private void UngetChar() - { - input_buffer = input_char; - } #region Fields + private delegate bool StateHandler (FsmContext ctx); - private delegate bool StateHandler(FsmContext ctx); - - private static readonly int[] fsm_return_table; + private static readonly int[] fsm_return_table; private static readonly StateHandler[] fsm_handler_table; - private readonly FsmContext fsm_context; - private int input_buffer; - private int input_char; - private readonly TextReader reader; - private int state; - private readonly StringBuilder string_buffer; - private int unichar; - + private bool allow_comments; + private bool allow_single_quoted_strings; + private bool end_of_input; + private FsmContext fsm_context; + private int input_buffer; + private int input_char; + private TextReader reader; + private int state; + private StringBuilder string_buffer; + private string string_value; + private int token; + private int unichar; #endregion #region Properties + public bool AllowComments { + get { return allow_comments; } + set { allow_comments = value; } + } - public bool AllowComments { get; set; } + public bool AllowSingleQuotedStrings { + get { return allow_single_quoted_strings; } + set { allow_single_quoted_strings = value; } + } - public bool AllowSingleQuotedStrings { get; set; } + public bool EndOfInput { + get { return end_of_input; } + } - public bool EndOfInput { get; private set; } - - public int Token { get; private set; } - - public string StringValue { get; private set; } + public int Token { + get { return token; } + } + public string StringValue { + get { return string_value; } + } #endregion #region Constructors - - static Lexer() + static Lexer () { - PopulateFsmTables(out fsm_handler_table, out fsm_return_table); + PopulateFsmTables (out fsm_handler_table, out fsm_return_table); } - public Lexer(TextReader reader) + public Lexer (TextReader reader) { - AllowComments = true; - AllowSingleQuotedStrings = true; + allow_comments = true; + allow_single_quoted_strings = true; input_buffer = 0; - string_buffer = new StringBuilder(128); + string_buffer = new StringBuilder (128); state = 1; - EndOfInput = false; + end_of_input = false; this.reader = reader; - fsm_context = new FsmContext(); + fsm_context = new FsmContext (); fsm_context.L = this; } - #endregion #region Static Methods - - private static int HexValue(int digit) + private static int HexValue (int digit) { - switch (digit) - { - case 'a': - case 'A': - return 10; + switch (digit) { + case 'a': + case 'A': + return 10; - case 'b': - case 'B': - return 11; + case 'b': + case 'B': + return 11; - case 'c': - case 'C': - return 12; + case 'c': + case 'C': + return 12; - case 'd': - case 'D': - return 13; + case 'd': + case 'D': + return 13; - case 'e': - case 'E': - return 14; + case 'e': + case 'E': + return 14; - case 'f': - case 'F': - return 15; + case 'f': + case 'F': + return 15; - default: - return digit - '0'; + default: + return digit - '0'; } } - private static void PopulateFsmTables(out StateHandler[] fsm_handler_table, out int[] fsm_return_table) + private static void PopulateFsmTables (out StateHandler[] fsm_handler_table, out int[] fsm_return_table) { // See section A.1. of the manual for details of the finite // state machine. - fsm_handler_table = new StateHandler[28] - { + fsm_handler_table = new StateHandler[28] { State1, State2, State3, @@ -218,32 +165,31 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson State28 }; - fsm_return_table = new int[28] - { - (int)ParserToken.Char, + fsm_return_table = new int[28] { + (int) ParserToken.Char, 0, - (int)ParserToken.Number, - (int)ParserToken.Number, + (int) ParserToken.Number, + (int) ParserToken.Number, 0, - (int)ParserToken.Number, + (int) ParserToken.Number, 0, - (int)ParserToken.Number, + (int) ParserToken.Number, 0, 0, - (int)ParserToken.True, + (int) ParserToken.True, 0, 0, 0, - (int)ParserToken.False, + (int) ParserToken.False, 0, 0, - (int)ParserToken.Null, - (int)ParserToken.CharSeq, - (int)ParserToken.Char, + (int) ParserToken.Null, + (int) ParserToken.CharSeq, + (int) ParserToken.Char, 0, 0, - (int)ParserToken.CharSeq, - (int)ParserToken.Char, + (int) ParserToken.CharSeq, + (int) ParserToken.Char, 0, 0, 0, @@ -251,229 +197,216 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson }; } - private static char ProcessEscChar(int esc_char) + private static char ProcessEscChar (int esc_char) { - switch (esc_char) - { - case '"': - case '\'': - case '\\': - case '/': - return Convert.ToChar(esc_char); + switch (esc_char) { + case '"': + case '\'': + case '\\': + case '/': + return Convert.ToChar (esc_char); - case 'n': - return '\n'; + case 'n': + return '\n'; - case 't': - return '\t'; + case 't': + return '\t'; - case 'r': - return '\r'; + case 'r': + return '\r'; - case 'b': - return '\b'; + case 'b': + return '\b'; - case 'f': - return '\f'; + case 'f': + return '\f'; - default: - // Unreachable - return '?'; + default: + // Unreachable + return '?'; } } - private static bool State1(FsmContext ctx) + private static bool State1 (FsmContext ctx) { - while(ctx.L.GetChar()) - { + while (ctx.L.GetChar ()) { if (ctx.L.input_char == ' ' || ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') continue; - if (ctx.L.input_char >= '1' && ctx.L.input_char <= '9') - { - ctx.L.string_buffer.Append((char)ctx.L.input_char); + if (ctx.L.input_char >= '1' && ctx.L.input_char <= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); ctx.NextState = 3; return true; } - switch (ctx.L.input_char) - { - case '"': - ctx.NextState = 19; - ctx.Return = true; - return true; + switch (ctx.L.input_char) { + case '"': + ctx.NextState = 19; + ctx.Return = true; + return true; - case ',': - case ':': - case '[': - case ']': - case '{': - case '}': - ctx.NextState = 1; - ctx.Return = true; - return true; + case ',': + case ':': + case '[': + case ']': + case '{': + case '}': + ctx.NextState = 1; + ctx.Return = true; + return true; - case '-': - ctx.L.string_buffer.Append((char)ctx.L.input_char); - ctx.NextState = 2; - return true; + case '-': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 2; + return true; - case '0': - ctx.L.string_buffer.Append((char)ctx.L.input_char); - ctx.NextState = 4; - return true; + case '0': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 4; + return true; - case 'f': - ctx.NextState = 12; - return true; + case 'f': + ctx.NextState = 12; + return true; - case 'n': - ctx.NextState = 16; - return true; + case 'n': + ctx.NextState = 16; + return true; - case 't': - ctx.NextState = 9; - return true; + case 't': + ctx.NextState = 9; + return true; - case '\'': - if (!ctx.L.AllowSingleQuotedStrings) - return false; - - ctx.L.input_char = '"'; - ctx.NextState = 23; - ctx.Return = true; - return true; - - case '/': - if (!ctx.L.AllowComments) - return false; - - ctx.NextState = 25; - return true; - - default: + case '\'': + if (! ctx.L.allow_single_quoted_strings) return false; + + ctx.L.input_char = '"'; + ctx.NextState = 23; + ctx.Return = true; + return true; + + case '/': + if (! ctx.L.allow_comments) + return false; + + ctx.NextState = 25; + return true; + + default: + return false; } } return true; } - private static bool State2(FsmContext ctx) + private static bool State2 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - if (ctx.L.input_char >= '1' && ctx.L.input_char <= '9') - { - ctx.L.string_buffer.Append((char)ctx.L.input_char); + if (ctx.L.input_char >= '1' && ctx.L.input_char<= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); ctx.NextState = 3; return true; } - switch (ctx.L.input_char) - { - case '0': - ctx.L.string_buffer.Append((char)ctx.L.input_char); - ctx.NextState = 4; - return true; + switch (ctx.L.input_char) { + case '0': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 4; + return true; - default: - return false; + default: + return false; } } - private static bool State3(FsmContext ctx) + private static bool State3 (FsmContext ctx) { - while(ctx.L.GetChar()) - { - if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') - { - ctx.L.string_buffer.Append((char)ctx.L.input_char); + while (ctx.L.GetChar ()) { + if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); continue; } if (ctx.L.input_char == ' ' || - ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') - { + ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') { ctx.Return = true; ctx.NextState = 1; return true; } - switch (ctx.L.input_char) - { - case ',': - case ']': - case '}': - ctx.L.UngetChar(); - ctx.Return = true; - ctx.NextState = 1; - return true; - - case '.': - ctx.L.string_buffer.Append((char)ctx.L.input_char); - ctx.NextState = 5; - return true; - - case 'e': - case 'E': - ctx.L.string_buffer.Append((char)ctx.L.input_char); - ctx.NextState = 7; - return true; - - default: - return false; - } - } - return true; - } - - private static bool State4(FsmContext ctx) - { - ctx.L.GetChar(); - - if (ctx.L.input_char == ' ' || - ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') - { - ctx.Return = true; - ctx.NextState = 1; - return true; - } - - switch (ctx.L.input_char) - { + switch (ctx.L.input_char) { case ',': case ']': case '}': - ctx.L.UngetChar(); + ctx.L.UngetChar (); ctx.Return = true; ctx.NextState = 1; return true; case '.': - ctx.L.string_buffer.Append((char)ctx.L.input_char); + ctx.L.string_buffer.Append ((char) ctx.L.input_char); ctx.NextState = 5; return true; case 'e': case 'E': - ctx.L.string_buffer.Append((char)ctx.L.input_char); + ctx.L.string_buffer.Append ((char) ctx.L.input_char); ctx.NextState = 7; return true; default: return false; + } + } + return true; + } + + private static bool State4 (FsmContext ctx) + { + ctx.L.GetChar (); + + if (ctx.L.input_char == ' ' || + ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') { + ctx.Return = true; + ctx.NextState = 1; + return true; + } + + switch (ctx.L.input_char) { + case ',': + case ']': + case '}': + ctx.L.UngetChar (); + ctx.Return = true; + ctx.NextState = 1; + return true; + + case '.': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 5; + return true; + + case 'e': + case 'E': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 7; + return true; + + default: + return false; } } - private static bool State5(FsmContext ctx) + private static bool State5 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') - { - ctx.L.string_buffer.Append((char)ctx.L.input_char); + if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); ctx.NextState = 6; return true; } @@ -481,356 +414,329 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return false; } - private static bool State6(FsmContext ctx) + private static bool State6 (FsmContext ctx) { - while(ctx.L.GetChar()) - { - if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') - { - ctx.L.string_buffer.Append((char)ctx.L.input_char); + while (ctx.L.GetChar ()) { + if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); continue; } if (ctx.L.input_char == ' ' || - ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') - { + ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') { ctx.Return = true; ctx.NextState = 1; return true; } - switch (ctx.L.input_char) - { - case ',': - case ']': - case '}': - ctx.L.UngetChar(); - ctx.Return = true; - ctx.NextState = 1; - return true; + switch (ctx.L.input_char) { + case ',': + case ']': + case '}': + ctx.L.UngetChar (); + ctx.Return = true; + ctx.NextState = 1; + return true; - case 'e': - case 'E': - ctx.L.string_buffer.Append((char)ctx.L.input_char); - ctx.NextState = 7; - return true; + case 'e': + case 'E': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 7; + return true; - default: - return false; + default: + return false; } } return true; } - private static bool State7(FsmContext ctx) + private static bool State7 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') - { - ctx.L.string_buffer.Append((char)ctx.L.input_char); + if (ctx.L.input_char >= '0' && ctx.L.input_char<= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); ctx.NextState = 8; return true; } - switch (ctx.L.input_char) - { - case '+': - case '-': - ctx.L.string_buffer.Append((char)ctx.L.input_char); - ctx.NextState = 8; - return true; + switch (ctx.L.input_char) { + case '+': + case '-': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 8; + return true; - default: - return false; + default: + return false; } } - private static bool State8(FsmContext ctx) + private static bool State8 (FsmContext ctx) { - while(ctx.L.GetChar()) - { - if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') - { - ctx.L.string_buffer.Append((char)ctx.L.input_char); + while (ctx.L.GetChar ()) { + if (ctx.L.input_char >= '0' && ctx.L.input_char<= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); continue; } if (ctx.L.input_char == ' ' || - ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') - { + ctx.L.input_char >= '\t' && ctx.L.input_char<= '\r') { ctx.Return = true; ctx.NextState = 1; return true; } - switch (ctx.L.input_char) - { - case ',': - case ']': - case '}': - ctx.L.UngetChar(); - ctx.Return = true; - ctx.NextState = 1; - return true; + switch (ctx.L.input_char) { + case ',': + case ']': + case '}': + ctx.L.UngetChar (); + ctx.Return = true; + ctx.NextState = 1; + return true; - default: - return false; + default: + return false; } } return true; } - private static bool State9(FsmContext ctx) + private static bool State9 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - switch (ctx.L.input_char) - { - case 'r': - ctx.NextState = 10; - return true; + switch (ctx.L.input_char) { + case 'r': + ctx.NextState = 10; + return true; - default: - return false; + default: + return false; } } - private static bool State10(FsmContext ctx) + private static bool State10 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - switch (ctx.L.input_char) - { - case 'u': - ctx.NextState = 11; - return true; + switch (ctx.L.input_char) { + case 'u': + ctx.NextState = 11; + return true; - default: - return false; + default: + return false; } } - private static bool State11(FsmContext ctx) + private static bool State11 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - switch (ctx.L.input_char) - { - case 'e': - ctx.Return = true; - ctx.NextState = 1; - return true; + switch (ctx.L.input_char) { + case 'e': + ctx.Return = true; + ctx.NextState = 1; + return true; - default: - return false; + default: + return false; } } - private static bool State12(FsmContext ctx) + private static bool State12 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - switch (ctx.L.input_char) - { - case 'a': - ctx.NextState = 13; - return true; + switch (ctx.L.input_char) { + case 'a': + ctx.NextState = 13; + return true; - default: - return false; + default: + return false; } } - private static bool State13(FsmContext ctx) + private static bool State13 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - switch (ctx.L.input_char) - { - case 'l': - ctx.NextState = 14; - return true; + switch (ctx.L.input_char) { + case 'l': + ctx.NextState = 14; + return true; - default: - return false; + default: + return false; } } - private static bool State14(FsmContext ctx) + private static bool State14 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - switch (ctx.L.input_char) - { - case 's': - ctx.NextState = 15; - return true; + switch (ctx.L.input_char) { + case 's': + ctx.NextState = 15; + return true; - default: - return false; + default: + return false; } } - private static bool State15(FsmContext ctx) + private static bool State15 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - switch (ctx.L.input_char) - { - case 'e': - ctx.Return = true; - ctx.NextState = 1; - return true; + switch (ctx.L.input_char) { + case 'e': + ctx.Return = true; + ctx.NextState = 1; + return true; - default: - return false; + default: + return false; } } - private static bool State16(FsmContext ctx) + private static bool State16 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - switch (ctx.L.input_char) - { - case 'u': - ctx.NextState = 17; - return true; + switch (ctx.L.input_char) { + case 'u': + ctx.NextState = 17; + return true; - default: - return false; + default: + return false; } } - private static bool State17(FsmContext ctx) + private static bool State17 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - switch (ctx.L.input_char) - { - case 'l': - ctx.NextState = 18; - return true; + switch (ctx.L.input_char) { + case 'l': + ctx.NextState = 18; + return true; - default: - return false; + default: + return false; } } - private static bool State18(FsmContext ctx) + private static bool State18 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - switch (ctx.L.input_char) - { - case 'l': - ctx.Return = true; - ctx.NextState = 1; - return true; + switch (ctx.L.input_char) { + case 'l': + ctx.Return = true; + ctx.NextState = 1; + return true; - default: - return false; + default: + return false; } } - private static bool State19(FsmContext ctx) + private static bool State19 (FsmContext ctx) { - while(ctx.L.GetChar()) - { - switch (ctx.L.input_char) - { - case '"': - ctx.L.UngetChar(); - ctx.Return = true; - ctx.NextState = 20; - return true; - - case '\\': - ctx.StateStack = 19; - ctx.NextState = 21; - return true; - - default: - ctx.L.string_buffer.Append((char)ctx.L.input_char); - continue; - } - } - - return true; - } - - private static bool State20(FsmContext ctx) - { - ctx.L.GetChar(); - - switch (ctx.L.input_char) - { + while (ctx.L.GetChar ()) { + switch (ctx.L.input_char) { case '"': + ctx.L.UngetChar (); ctx.Return = true; - ctx.NextState = 1; + ctx.NextState = 20; return true; - default: - return false; - } - } - - private static bool State21(FsmContext ctx) - { - ctx.L.GetChar(); - - switch (ctx.L.input_char) - { - case 'u': - ctx.NextState = 22; - return true; - - case '"': - case '\'': - case '/': case '\\': - case 'b': - case 'f': - case 'n': - case 'r': - case 't': - ctx.L.string_buffer.Append( - ProcessEscChar(ctx.L.input_char)); - ctx.NextState = ctx.StateStack; + ctx.StateStack = 19; + ctx.NextState = 21; return true; default: - return false; + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + continue; + } + } + + return true; + } + + private static bool State20 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case '"': + ctx.Return = true; + ctx.NextState = 1; + return true; + + default: + return false; } } - private static bool State22(FsmContext ctx) + private static bool State21 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case 'u': + ctx.NextState = 22; + return true; + + case '"': + case '\'': + case '/': + case '\\': + case 'b': + case 'f': + case 'n': + case 'r': + case 't': + ctx.L.string_buffer.Append ( + ProcessEscChar (ctx.L.input_char)); + ctx.NextState = ctx.StateStack; + return true; + + default: + return false; + } + } + + private static bool State22 (FsmContext ctx) { int counter = 0; - int mult = 4096; + int mult = 4096; ctx.L.unichar = 0; - while(ctx.L.GetChar()) - { + while (ctx.L.GetChar ()) { if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9' || ctx.L.input_char >= 'A' && ctx.L.input_char <= 'F' || - ctx.L.input_char >= 'a' && ctx.L.input_char <= 'f') - { + ctx.L.input_char >= 'a' && ctx.L.input_char <= 'f') { - ctx.L.unichar += HexValue(ctx.L.input_char) * mult; + ctx.L.unichar += HexValue (ctx.L.input_char) * mult; counter++; mult /= 16; - if (counter == 4) - { - ctx.L.string_buffer.Append( - Convert.ToChar(ctx.L.unichar)); + if (counter == 4) { + ctx.L.string_buffer.Append ( + Convert.ToChar (ctx.L.unichar)); ctx.NextState = ctx.StateStack; return true; } @@ -844,74 +750,68 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return true; } - private static bool State23(FsmContext ctx) + private static bool State23 (FsmContext ctx) { - while(ctx.L.GetChar()) - { - switch (ctx.L.input_char) - { - case '\'': - ctx.L.UngetChar(); - ctx.Return = true; - ctx.NextState = 24; - return true; - - case '\\': - ctx.StateStack = 23; - ctx.NextState = 21; - return true; - - default: - ctx.L.string_buffer.Append((char)ctx.L.input_char); - continue; - } - } - - return true; - } - - private static bool State24(FsmContext ctx) - { - ctx.L.GetChar(); - - switch (ctx.L.input_char) - { + while (ctx.L.GetChar ()) { + switch (ctx.L.input_char) { case '\'': - ctx.L.input_char = '"'; + ctx.L.UngetChar (); ctx.Return = true; - ctx.NextState = 1; + ctx.NextState = 24; + return true; + + case '\\': + ctx.StateStack = 23; + ctx.NextState = 21; return true; default: - return false; + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + continue; + } + } + + return true; + } + + private static bool State24 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case '\'': + ctx.L.input_char = '"'; + ctx.Return = true; + ctx.NextState = 1; + return true; + + default: + return false; } } - private static bool State25(FsmContext ctx) + private static bool State25 (FsmContext ctx) { - ctx.L.GetChar(); + ctx.L.GetChar (); - switch (ctx.L.input_char) - { - case '*': - ctx.NextState = 27; - return true; + switch (ctx.L.input_char) { + case '*': + ctx.NextState = 27; + return true; - case '/': - ctx.NextState = 26; - return true; + case '/': + ctx.NextState = 26; + return true; - default: - return false; + default: + return false; } } - private static bool State26(FsmContext ctx) + private static bool State26 (FsmContext ctx) { - while(ctx.L.GetChar()) - { - if (ctx.L.input_char == '\n') - { + while (ctx.L.GetChar ()) { + if (ctx.L.input_char == '\n') { ctx.NextState = 1; return true; } @@ -920,12 +820,10 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return true; } - private static bool State27(FsmContext ctx) + private static bool State27 (FsmContext ctx) { - while(ctx.L.GetChar()) - { - if (ctx.L.input_char == '*') - { + while (ctx.L.GetChar ()) { + if (ctx.L.input_char == '*') { ctx.NextState = 28; return true; } @@ -934,15 +832,13 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return true; } - private static bool State28(FsmContext ctx) + private static bool State28 (FsmContext ctx) { - while(ctx.L.GetChar()) - { + while (ctx.L.GetChar ()) { if (ctx.L.input_char == '*') continue; - if (ctx.L.input_char == '/') - { + if (ctx.L.input_char == '/') { ctx.NextState = 1; return true; } @@ -953,7 +849,64 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson return true; } - #endregion + + + private bool GetChar () + { + if ((input_char = NextChar ()) != -1) + return true; + + end_of_input = true; + return false; + } + + private int NextChar () + { + if (input_buffer != 0) { + int tmp = input_buffer; + input_buffer = 0; + + return tmp; + } + + return reader.Read (); + } + + public bool NextToken () + { + StateHandler handler; + fsm_context.Return = false; + + while (true) { + handler = fsm_handler_table[state - 1]; + + if (! handler (fsm_context)) + throw new JsonException (input_char); + + if (end_of_input) + return false; + + if (fsm_context.Return) { + string_value = string_buffer.ToString (); + string_buffer.Remove (0, string_buffer.Length); + token = fsm_return_table[state - 1]; + + if (token == (int) ParserToken.Char) + token = input_char; + + state = fsm_context.NextState; + + return true; + } + + state = fsm_context.NextState; + } + } + + private void UngetChar () + { + input_buffer = input_char; + } } -} \ No newline at end of file +} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/ParserToken.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/ParserToken.cs index 738555a..f640136 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/ParserToken.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/ParserToken.cs @@ -1,5 +1,4 @@ #region Header - /** * ParserToken.cs * Internal representation of the tokens used by the lexer and the parser. @@ -7,7 +6,6 @@ * The authors disclaim copyright to this source code. For more details, see * the COPYING file included with this distribution. **/ - #endregion @@ -16,7 +14,7 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson internal enum ParserToken { // Lexer tokens (see section A.1.1. of the manual) - None = char.MaxValue + 1, + None = System.Char.MaxValue + 1, Number, True, False, @@ -43,4 +41,4 @@ namespace StarkSDKSpace.UNBridgeLib.LitJson // The empty rule Epsilon } -} \ No newline at end of file +} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/StarkLitJson.asmdef b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/StarkLitJson.asmdef index 2aafb08..ba7d6a8 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/StarkLitJson.asmdef +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/StarkLitJson.asmdef @@ -1,3 +1,3 @@ { - "name": "StarkLitJson" + "name": "StarkLitJson" } diff --git a/Assets/Plugins/Easy Save 3/Resources/ES3.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle.meta similarity index 77% rename from Assets/Plugins/Easy Save 3/Resources/ES3.meta rename to Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle.meta index 853dab9..289d5d8 100644 --- a/Assets/Plugins/Easy Save 3/Resources/ES3.meta +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8d19532266b459c4aada9e9d818f3dbd +guid: d10b3fe51824a446fbd38cdd98bd2736 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/DownloadHandlerTTAssetBundle.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/DownloadHandlerTTAssetBundle.cs new file mode 100644 index 0000000..6a1dcf6 --- /dev/null +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/DownloadHandlerTTAssetBundle.cs @@ -0,0 +1,79 @@ +using System; +using UnityEngine; +using UnityEngine.Networking; + +namespace StarkSDKSpace +{ + /** + * 只是用来承载 asset bundle 的获取, + * TTAssetBundle.load 触发下载后,这里并不会获取到真正的 Asset Bundle 数据 + */ + public class DownloadHandlerTTAssetBundle : DownloadHandlerScript + { + public bool isDone; + + private string _uri; + private uint _crc; + private AssetBundle _assetBundle; + private byte[] _contentBytes; + private int _contentLength; + + private static bool _isFallbackNoticed = false; + + public DownloadHandlerTTAssetBundle(string uri, uint crc) + { + _uri = uri; + _crc = crc; + } + + public AssetBundle assetBundle + { + get + { + if (_assetBundle == null) + { + if (TTAssetBundle.isAbfsReady) + { + if (_contentLength != 0) + { + Debug.LogError($"DownloadHandlerTTAssetBundle contentLength not 0!"); + return null; + } + _assetBundle = AssetBundle.LoadFromFile(_uri, _crc); + TTAssetBundle.bundle2path.Add(_assetBundle, _uri); + } + else + { + _assetBundle = AssetBundle.LoadFromMemory(_contentBytes); + } + } + return _assetBundle; + } + } + + protected override byte[] GetData() => _contentBytes; + + protected override bool ReceiveData(byte[] data, int dataLength) + { + if (data == null || dataLength < 1) + return false; + +#if !(UNITY_WEBGL && !UNITY_EDITOR) + if (!_isFallbackNoticed) + { + _isFallbackNoticed = true; + Debug.LogWarning("TTAssetBundle 仅在 WebGL 方案有优化效果,当前环境下回滚到 UnityWebRequestAssetBundle 加载实现。"); + } +#endif + + _contentBytes = _contentBytes != null ? _contentBytes : Array.Empty(); + Array.Resize(ref _contentBytes, _contentBytes.Length + dataLength); + data.CopyTo(_contentBytes, _contentLength); + _contentLength += dataLength; + return true; + } + + protected override void CompleteContent() => isDone = true; + + } +} \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/DownloadHandlerTTAssetBundle.cs.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/DownloadHandlerTTAssetBundle.cs.meta new file mode 100644 index 0000000..9b71254 --- /dev/null +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/DownloadHandlerTTAssetBundle.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 673047fb5c2142f7ae0f63892e66fc7e +timeCreated: 1716803224 \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundle.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundle.cs new file mode 100644 index 0000000..f1063d7 --- /dev/null +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundle.cs @@ -0,0 +1,56 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Networking; +#if UNITY_WEBGL && !UNITY_EDITOR +using System.Runtime.InteropServices; +#endif + +namespace StarkSDKSpace +{ + public class TTAssetBundle + { + + public static Dictionary bundle2path = new Dictionary(); + + public static bool isAbfsReady = CheckReady(); + +#if UNITY_WEBGL && !UNITY_EDITOR + [DllImport("__Internal", EntryPoint = "StarkAbfsCheckReady")] + public static extern bool CheckReady(); +#else + public static bool CheckReady() + { + return false; + } +#endif + +#if UNITY_WEBGL && !UNITY_EDITOR + [DllImport("__Internal", EntryPoint = "StarkAbfsRegisterAssetBundleUrl")] + public static extern void RegisterAssetBundleUrl(string path); +#else + public static void RegisterAssetBundleUrl(string path) { + + } +#endif + +#if UNITY_WEBGL && !UNITY_EDITOR + [DllImport("__Internal", EntryPoint = "StarkAbfsUnregisterAssetBundleUrl")] + public static extern void UnregisterAssetBundleUrl(string path); +#else + public static void UnregisterAssetBundleUrl(string path) { + + } +#endif + + public static UnityWebRequest GetAssetBundle(string uri) => GetAssetBundle(uri, 0U); + + public static UnityWebRequest GetAssetBundle(string uri, uint crc) + { + if (isAbfsReady) + RegisterAssetBundleUrl(uri); + + return new UnityWebRequest(uri, "GET", new DownloadHandlerTTAssetBundle(uri, crc), null); + } + + } +} \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundle.cs.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundle.cs.meta new file mode 100644 index 0000000..427cf6c --- /dev/null +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundle.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 49289ed00b7c4d60b27494a85032c329 +timeCreated: 1716206168 \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleExtensions.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleExtensions.cs new file mode 100644 index 0000000..583271c --- /dev/null +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleExtensions.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace StarkSDKSpace +{ + public static class TTAssetBundleExtensions + { + public static void TTUnload(this AssetBundle ab, bool unloadAllLoadedObjects) + { + ab.Unload(unloadAllLoadedObjects); + + if (!TTAssetBundle.isAbfsReady) + return; + + if (TTAssetBundle.bundle2path.TryGetValue(ab, out var path)) + { + TTAssetBundle.UnregisterAssetBundleUrl(path); + TTAssetBundle.bundle2path.Remove(ab); + } + else + { + Debug.LogError("AssetBundle.TTUnload() Failure: Unregistered Asset Bundle. Loaded without TTAssetBundle methods?"); + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleExtensions.cs.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleExtensions.cs.meta new file mode 100644 index 0000000..3d8359f --- /dev/null +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleExtensions.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a07551ac0d0a400496656884a7d4acf2 +timeCreated: 1716210299 \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleProviders.cs.txt b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleProviders.cs.txt new file mode 100644 index 0000000..0d14d98 --- /dev/null +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleProviders.cs.txt @@ -0,0 +1,1311 @@ +#if UNITY_2022_1_OR_NEWER +#define UNLOAD_BUNDLE_ASYNC +#endif + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Threading; +using UnityEngine.Networking; +using UnityEngine.ResourceManagement.AsyncOperations; +using UnityEngine.ResourceManagement.Exceptions; +using UnityEngine.ResourceManagement.ResourceLocations; +using UnityEngine.ResourceManagement.Util; +using StarkSDKSpace; + +namespace UnityEngine.ResourceManagement +{ + internal class TTWebRequestQueueOperation + { + private bool m_Completed = false; + public UnityWebRequestAsyncOperation Result; + public Action OnComplete; + public bool IsDone + { + get { return m_Completed || Result != null; } + } + + internal UnityWebRequest m_WebRequest; + + public UnityWebRequest WebRequest + { + get { return m_WebRequest; } + internal set { m_WebRequest = value; } + } + + public TTWebRequestQueueOperation(UnityWebRequest request) + { + m_WebRequest = request; + } + + internal void Complete(UnityWebRequestAsyncOperation asyncOp) + { + m_Completed = true; + Result = asyncOp; + OnComplete?.Invoke(Result); + } + } + + + internal static class WebRequestQueue + { + internal static int s_MaxRequest = 512; + internal static Queue s_QueuedOperations = new Queue(); + internal static List s_ActiveRequests = new List(); + + public static void SetMaxConcurrentRequests(int maxRequests) + { + if (maxRequests < 1) + throw new ArgumentException("MaxRequests must be 1 or greater.", "maxRequests"); + s_MaxRequest = maxRequests; + } + + public static TTWebRequestQueueOperation QueueRequest(UnityWebRequest request) + { + TTWebRequestQueueOperation queueOperation = new TTWebRequestQueueOperation(request); + if (s_ActiveRequests.Count < s_MaxRequest) + BeginWebRequest(queueOperation); + else + s_QueuedOperations.Enqueue(queueOperation); + + return queueOperation; + } + + internal static void WaitForRequestToBeActive(TTWebRequestQueueOperation request, int millisecondsTimeout) + { + var completedRequests = new List(); + while (s_QueuedOperations.Contains(request)) + { + completedRequests.Clear(); + foreach (UnityWebRequestAsyncOperation webRequestAsyncOp in s_ActiveRequests) + { + if (TTUnityWebRequestUtilities.IsAssetBundleDownloaded(webRequestAsyncOp)) + completedRequests.Add(webRequestAsyncOp); + } + + foreach (UnityWebRequestAsyncOperation webRequestAsyncOp in completedRequests) + { + bool requestIsActive = s_QueuedOperations.Peek() == request; + webRequestAsyncOp.completed -= OnWebAsyncOpComplete; + OnWebAsyncOpComplete(webRequestAsyncOp); + if (requestIsActive) + return; + } + + Thread.Sleep(millisecondsTimeout); + } + } + + internal static void DequeueRequest(UnityWebRequestAsyncOperation operation) + { + operation.completed -= OnWebAsyncOpComplete; + OnWebAsyncOpComplete(operation); + } + + private static void OnWebAsyncOpComplete(AsyncOperation operation) + { + OnWebAsyncOpComplete(operation as UnityWebRequestAsyncOperation); + } + + private static void OnWebAsyncOpComplete(UnityWebRequestAsyncOperation operation) + { + if (s_ActiveRequests.Remove(operation) && s_QueuedOperations.Count > 0) + { + var nextQueuedOperation = s_QueuedOperations.Dequeue(); + BeginWebRequest(nextQueuedOperation); + } + } + + static void BeginWebRequest(TTWebRequestQueueOperation queueOperation) + { + var request = queueOperation.m_WebRequest; + UnityWebRequestAsyncOperation webRequestAsyncOp = null; + try + { + webRequestAsyncOp = request.SendWebRequest(); + if (webRequestAsyncOp != null) + { + s_ActiveRequests.Add(webRequestAsyncOp); + + if (webRequestAsyncOp.isDone) + OnWebAsyncOpComplete(webRequestAsyncOp); + else + webRequestAsyncOp.completed += OnWebAsyncOpComplete; + } + else + { + OnWebAsyncOpComplete(null); + } + } + catch (Exception e) + { + Debug.LogError(e.Message); + } + + queueOperation.Complete(webRequestAsyncOp); + } + } +} + +namespace UnityEngine.ResourceManagement.Util +{ + [Flags] + internal enum BundleSource + { + None = 0, + Local = 1, + Cache = 2, + Download = 4, + } +} + +namespace UnityEngine.ResourceManagement.ResourceProviders +{ + + [DisplayName("Assets from TTBundles Provider")] + public class TTBundledAssetProvider : ResourceProviderBase + { + internal class InternalOp + { + AssetBundle m_AssetBundle; + AssetBundleRequest m_PreloadRequest; + AssetBundleRequest m_RequestOperation; + object m_Result; + ProvideHandle m_ProvideHandle; + string subObjectName = null; + + internal static T LoadBundleFromDependecies(IList results) where T : class, IAssetBundleResource + { + if (results == null || results.Count == 0) + return default(T); + + IAssetBundleResource bundle = null; + bool firstBundleWrapper = true; + for (int i = 0; i < results.Count; i++) + { + var abWrapper = results[i] as IAssetBundleResource; + if (abWrapper != null) + { + //only use the first asset bundle, even if it is invalid + abWrapper.GetAssetBundle(); + if (firstBundleWrapper) + bundle = abWrapper; + firstBundleWrapper = false; + } + } + + return bundle as T; + } + + public void Start(ProvideHandle provideHandle) + { + provideHandle.SetProgressCallback(ProgressCallback); + provideHandle.SetWaitForCompletionCallback(WaitForCompletionHandler); + subObjectName = null; + m_ProvideHandle = provideHandle; + m_RequestOperation = null; + List deps = new List(); + m_ProvideHandle.GetDependencies(deps); + var bundleResource = LoadBundleFromDependecies(deps); + if (bundleResource == null) + { + m_ProvideHandle.Complete(null, false, new Exception("Unable to load dependent bundle from location " + m_ProvideHandle.Location)); + } + else + { + m_AssetBundle = bundleResource.GetAssetBundle(); + if (m_AssetBundle == null) + { + m_ProvideHandle.Complete(null, false, new Exception("Unable to load dependent bundle from location " + m_ProvideHandle.Location)); + return; + } + + var assetBundleResource = bundleResource as TTAssetBundleResource; + if (assetBundleResource != null) + m_PreloadRequest = assetBundleResource.GetAssetPreloadRequest(); + if (m_PreloadRequest == null || m_PreloadRequest.isDone) + BeginAssetLoad(); + else + m_PreloadRequest.completed += operation => BeginAssetLoad(); + } + } + + private void BeginAssetLoad() + { + if (m_AssetBundle == null) + { + m_ProvideHandle.Complete(null, false, new Exception("Unable to load dependent bundle from location " + m_ProvideHandle.Location)); + } + else + { + var assetPath = m_ProvideHandle.ResourceManager.TransformInternalId(m_ProvideHandle.Location); + if (m_ProvideHandle.Type.IsArray) + { +#if !UNITY_2021_1_OR_NEWER + if (AsyncOperationHandle.IsWaitingForCompletion) + { + GetArrayResult(m_AssetBundle.LoadAssetWithSubAssets(assetPath, m_ProvideHandle.Type.GetElementType())); + CompleteOperation(); + } + else +#endif + m_RequestOperation = m_AssetBundle.LoadAssetWithSubAssetsAsync(assetPath, m_ProvideHandle.Type.GetElementType()); + } + else if (m_ProvideHandle.Type.IsGenericType && typeof(IList<>) == m_ProvideHandle.Type.GetGenericTypeDefinition()) + { +#if !UNITY_2021_1_OR_NEWER + if (AsyncOperationHandle.IsWaitingForCompletion) + { + GetListResult(m_AssetBundle.LoadAssetWithSubAssets(assetPath, m_ProvideHandle.Type.GetGenericArguments()[0])); + CompleteOperation(); + } + else +#endif + m_RequestOperation = m_AssetBundle.LoadAssetWithSubAssetsAsync(assetPath, m_ProvideHandle.Type.GetGenericArguments()[0]); + } + else + { + if (ExtractKeyAndSubKey(assetPath, out string mainPath, out string subKey)) + { + subObjectName = subKey; +#if !UNITY_2021_1_OR_NEWER + if (AsyncOperationHandle.IsWaitingForCompletion) + { + GetAssetSubObjectResult(m_AssetBundle.LoadAssetWithSubAssets(mainPath, m_ProvideHandle.Type)); + CompleteOperation(); + } + else +#endif + m_RequestOperation = m_AssetBundle.LoadAssetWithSubAssetsAsync(mainPath, m_ProvideHandle.Type); + } + else + { +#if !UNITY_2021_1_OR_NEWER + if (AsyncOperationHandle.IsWaitingForCompletion) + { + GetAssetResult(m_AssetBundle.LoadAsset(assetPath, m_ProvideHandle.Type)); + CompleteOperation(); + } + else +#endif + m_RequestOperation = m_AssetBundle.LoadAssetAsync(assetPath, m_ProvideHandle.Type); + } + } + + if (m_RequestOperation != null) + { + if (m_RequestOperation.isDone) + ActionComplete(m_RequestOperation); + else + { +#if ENABLE_ADDRESSABLE_PROFILER + if (UnityEngine.Profiling.Profiler.enabled && m_ProvideHandle.IsValid) + Profiling.ProfilerRuntime.AddAssetOperation(m_ProvideHandle, Profiling.ContentStatus.Loading); +#endif + m_RequestOperation.completed += ActionComplete; + } + } + } + } + + private bool WaitForCompletionHandler() + { + if (m_PreloadRequest != null && !m_PreloadRequest.isDone) + return m_PreloadRequest.asset == null; + if (m_Result != null) + return true; + if (m_RequestOperation == null) + return false; + if (m_RequestOperation.isDone) + return true; + return m_RequestOperation.asset != null; + } + + private void ActionComplete(AsyncOperation obj) + { + if (m_RequestOperation != null) + { + if (m_ProvideHandle.Type.IsArray) + GetArrayResult(m_RequestOperation.allAssets); + else if (m_ProvideHandle.Type.IsGenericType && typeof(IList<>) == m_ProvideHandle.Type.GetGenericTypeDefinition()) + GetListResult(m_RequestOperation.allAssets); + else if (string.IsNullOrEmpty(subObjectName)) + GetAssetResult(m_RequestOperation.asset); + else + GetAssetSubObjectResult(m_RequestOperation.allAssets); + } + + CompleteOperation(); + } + + private void GetArrayResult(Object[] allAssets) + { + m_Result = ResourceManagerConfig.CreateArrayResult(m_ProvideHandle.Type, allAssets); + } + + private void GetListResult(Object[] allAssets) + { + m_Result = ResourceManagerConfig.CreateListResult(m_ProvideHandle.Type, allAssets); + } + + private void GetAssetResult(Object asset) + { + m_Result = (asset != null && m_ProvideHandle.Type.IsAssignableFrom(asset.GetType())) ? asset : null; + } + + private void GetAssetSubObjectResult(Object[] allAssets) + { + foreach (var o in allAssets) + { + if (o.name == subObjectName) + { + if (m_ProvideHandle.Type.IsAssignableFrom(o.GetType())) + { + m_Result = o; + break; + } + } + } + } + + void CompleteOperation() + { +#if ENABLE_ADDRESSABLE_PROFILER + if (UnityEngine.Profiling.Profiler.enabled && m_Result != null && m_ProvideHandle.IsValid) + Profiling.ProfilerRuntime.AddAssetOperation(m_ProvideHandle, Profiling.ContentStatus.Active); +#endif + + Exception e = m_Result == null + ? new Exception($"Unable to load asset of type {m_ProvideHandle.Type} from location {m_ProvideHandle.Location}.") + : null; + m_ProvideHandle.Complete(m_Result, m_Result != null, e); + } + + public float ProgressCallback() + { + return m_RequestOperation != null ? m_RequestOperation.progress : 0.0f; + } + + /// + /// Extracts main and subobject keys if properly formatted + /// + /// The key as an object. + /// The key of the main asset. This will be set to null if a sub key is not found. + /// The key of the sub object. This will be set to null if not found. + /// + internal static bool ExtractKeyAndSubKey(object keyObj, out string mainKey, out string subKey) + { + var key = keyObj as string; + if (key != null) + { + var i = key.IndexOf('['); + if (i > 0) + { + var j = key.LastIndexOf(']'); + if (j > i) + { + mainKey = key.Substring(0, i); + subKey = key.Substring(i + 1, j - (i + 1)); + return true; + } + } + } + mainKey = null; + subKey = null; + return false; + } + } + + public override void Provide(ProvideHandle provideHandle) + { + new InternalOp().Start(provideHandle); + } + } + + public class TTAssetBundleResource : IAssetBundleResource, IUpdateReceiver + { + public enum LoadType + { + None, + Local, + Web + } + + AssetBundle m_AssetBundle; + DownloadHandlerTTAssetBundle m_downloadHandler; + AsyncOperation m_RequestOperation; + internal TTWebRequestQueueOperation m_WebRequestQueueOperation; + internal ProvideHandle m_ProvideHandle; + internal AssetBundleRequestOptions m_Options; + + [NonSerialized] + bool m_RequestCompletedCallbackCalled = false; + + int m_Retries; + BundleSource m_Source = BundleSource.None; + long m_BytesToDownload; + long m_DownloadedBytes; + bool m_Completed = false; +#if UNLOAD_BUNDLE_ASYNC + AssetBundleUnloadOperation m_UnloadOperation; +#endif + const int k_WaitForWebRequestMainThreadSleep = 1; + string m_TransformedInternalId; + AssetBundleRequest m_PreloadRequest; + bool m_PreloadCompleted = false; + ulong m_LastDownloadedByteCount = 0; + float m_TimeoutTimer = 0; + int m_TimeoutOverFrames = 0; + + private bool HasTimedOut => m_TimeoutTimer >= m_Options.Timeout && m_TimeoutOverFrames > 5; + + internal long BytesToDownload + { + get + { + if (m_BytesToDownload == -1) + { + if (m_Options != null) + m_BytesToDownload = m_Options.ComputeSize(m_ProvideHandle.Location, m_ProvideHandle.ResourceManager); + else + m_BytesToDownload = 0; + } + + return m_BytesToDownload; + } + } + + internal UnityWebRequest CreateWebRequest(IResourceLocation loc) + { + var url = m_ProvideHandle.ResourceManager.TransformInternalId(loc); + return CreateWebRequest(url); + } + + internal UnityWebRequest CreateWebRequest(string url) + { + string sanitizedUrl = Uri.UnescapeDataString(url); + +#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN + Uri uri = new Uri(sanitizedUrl.Replace(" ", "%20")); +#else + Uri uri = new Uri(Uri.EscapeUriString(sanitizedUrl)); +#endif + + if (m_Options == null) + { + m_Source = BundleSource.Download; +#if ENABLE_ADDRESSABLE_PROFILER + AddBundleToProfiler(Profiling.ContentStatus.Downloading, m_Source); +#endif + return TTAssetBundle.GetAssetBundle(url); + } + + UnityWebRequest webRequest; + if (!string.IsNullOrEmpty(m_Options.Hash)) + { + CachedAssetBundle cachedBundle = new CachedAssetBundle(m_Options.BundleName, Hash128.Parse(m_Options.Hash)); +#if ENABLE_CACHING + bool cached = Caching.IsVersionCached(cachedBundle); + m_Source = cached ? BundleSource.Cache : BundleSource.Download; + if (m_Options.UseCrcForCachedBundle || m_Source == BundleSource.Download) + webRequest = UnityWebRequestAssetBundle.GetAssetBundle(uri, cachedBundle, m_Options.Crc); + else + webRequest = UnityWebRequestAssetBundle.GetAssetBundle(uri, cachedBundle); +#else + webRequest = UnityWebRequestAssetBundle.GetAssetBundle(uri, cachedBundle, m_Options.Crc); +#endif + } + else + { + m_Source = BundleSource.Download; + webRequest = TTAssetBundle.GetAssetBundle(url, m_Options.Crc); + } + + if (m_Options.RedirectLimit > 0) + webRequest.redirectLimit = m_Options.RedirectLimit; + if (m_ProvideHandle.ResourceManager.CertificateHandlerInstance != null) + { + webRequest.certificateHandler = m_ProvideHandle.ResourceManager.CertificateHandlerInstance; + webRequest.disposeCertificateHandlerOnDispose = false; + } + + m_ProvideHandle.ResourceManager.WebRequestOverride?.Invoke(webRequest); + return webRequest; + } + + public AssetBundleRequest GetAssetPreloadRequest() + { + if (m_PreloadCompleted || GetAssetBundle() == null) + return null; + + if (m_Options.AssetLoadMode == AssetLoadMode.AllPackedAssetsAndDependencies) + { +#if !UNITY_2021_1_OR_NEWER + if (AsyncOperationHandle.IsWaitingForCompletion) + { + m_AssetBundle.LoadAllAssets(); + m_PreloadCompleted = true; + return null; + } +#endif + if (m_PreloadRequest == null) + { + m_PreloadRequest = m_AssetBundle.LoadAllAssetsAsync(); + m_PreloadRequest.completed += operation => m_PreloadCompleted = true; + } + + return m_PreloadRequest; + } + + return null; + } + + float PercentComplete() + { + return m_RequestOperation != null ? m_RequestOperation.progress : 0.0f; + } + + DownloadStatus GetDownloadStatus() + { + if (m_Options == null) + return default; + var status = new DownloadStatus() {TotalBytes = BytesToDownload, IsDone = PercentComplete() >= 1f}; + if (BytesToDownload > 0) + { + if (m_WebRequestQueueOperation != null && string.IsNullOrEmpty(m_WebRequestQueueOperation.m_WebRequest.error)) + m_DownloadedBytes = (long)(m_WebRequestQueueOperation.m_WebRequest.downloadedBytes); + else if (m_RequestOperation != null && m_RequestOperation is UnityWebRequestAsyncOperation operation && string.IsNullOrEmpty(operation.webRequest.error)) + m_DownloadedBytes = (long)operation.webRequest.downloadedBytes; + } + + status.DownloadedBytes = m_DownloadedBytes; + return status; + } + + public AssetBundle GetAssetBundle() + { + if (m_AssetBundle == null) + { + if (m_downloadHandler != null) + { + m_AssetBundle = m_downloadHandler.assetBundle; + m_downloadHandler.Dispose(); + m_downloadHandler = null; + } else if (m_RequestOperation is TTAssetBundleRequest r) + { + m_AssetBundle = r.assetBundle; + } + } + + return m_AssetBundle; + } + +#if ENABLE_ADDRESSABLE_PROFILER + private void AddBundleToProfiler(Profiling.ContentStatus status, BundleSource source) + { + if (!Profiler.enabled) + return; + // if (!m_ProvideHandle.IsValid) + // return; + + if (status == Profiling.ContentStatus.Active && m_AssetBundle == null) + Profiling.ProfilerRuntime.BundleReleased(m_Options.BundleName); + else + Profiling.ProfilerRuntime.AddBundleOperation(m_ProvideHandle, m_Options, status, source); + } + + private void RemoveBundleFromProfiler() + { + if (m_Options == null) + return; + Profiling.ProfilerRuntime.BundleReleased(m_Options.BundleName); + } + +#endif + +#if UNLOAD_BUNDLE_ASYNC + void OnUnloadOperationComplete(AsyncOperation op) + { + m_UnloadOperation = null; + BeginOperation(); + } + +#endif + +#if UNLOAD_BUNDLE_ASYNC + public void Start(ProvideHandle provideHandle, AssetBundleUnloadOperation unloadOp) +#else + public void Start(ProvideHandle provideHandle) +#endif + { + m_Retries = 0; + m_AssetBundle = null; + m_RequestOperation = null; + m_ProvideHandle = provideHandle; + m_Options = m_ProvideHandle.Location.Data as AssetBundleRequestOptions; + m_BytesToDownload = -1; + m_ProvideHandle.SetProgressCallback(PercentComplete); + m_ProvideHandle.SetDownloadProgressCallbacks(GetDownloadStatus); + m_ProvideHandle.SetWaitForCompletionCallback(WaitForCompletionHandler); +#if UNLOAD_BUNDLE_ASYNC + m_UnloadOperation = unloadOp; + if (m_UnloadOperation != null && !m_UnloadOperation.isDone) + m_UnloadOperation.completed += OnUnloadOperationComplete; + else +#endif + BeginOperation(); + } + + private bool WaitForCompletionHandler() + { +#if UNLOAD_BUNDLE_ASYNC + if (m_UnloadOperation != null && !m_UnloadOperation.isDone) + { + m_UnloadOperation.completed -= OnUnloadOperationComplete; + m_UnloadOperation.WaitForCompletion(); + m_UnloadOperation = null; + BeginOperation(); + } +#endif + + if (m_RequestOperation == null) + { + if (m_WebRequestQueueOperation == null) + return false; + else + WebRequestQueue.WaitForRequestToBeActive(m_WebRequestQueueOperation, k_WaitForWebRequestMainThreadSleep); + } + + //We don't want to wait for request op to complete if it's a LoadFromFileAsync. Only UWR will complete in a tight loop like this. + if (m_RequestOperation is UnityWebRequestAsyncOperation op) + { + while (!TTUnityWebRequestUtilities.IsAssetBundleDownloaded(op)) + Thread.Sleep(k_WaitForWebRequestMainThreadSleep); +#if ENABLE_ASYNC_ASSETBUNDLE_UWR + if (m_Source == BundleSource.Cache) + { + var downloadHandler = (DownloadHandlerTTAssetBundle)op?.webRequest?.downloadHandler; + if (downloadHandler.autoLoadAssetBundle) + m_AssetBundle = downloadHandler.assetBundle; + } +#endif + WebRequestQueue.DequeueRequest(op); + + if (!m_RequestCompletedCallbackCalled) + { + m_RequestOperation.completed -= WebRequestOperationCompleted; + WebRequestOperationCompleted(m_RequestOperation); + } + } + + if (!m_Completed && m_Source == BundleSource.Local) + { + // we don't have to check for done with local files as calling + // m_requestOperation.assetBundle is blocking and will wait for the file to load + if (!m_RequestCompletedCallbackCalled) + { + m_RequestOperation.completed -= LocalRequestOperationCompleted; + LocalRequestOperationCompleted(m_RequestOperation); + } + } + + if (!m_Completed && m_RequestOperation.isDone) + { + m_ProvideHandle.Complete(this, m_AssetBundle != null, null); + m_Completed = true; + } + + return m_Completed; + } + + void AddCallbackInvokeIfDone(AsyncOperation operation, Action callback) + { + if (operation.isDone) + callback(operation); + else + operation.completed += callback; + } + + public static void GetLoadInfo(ProvideHandle handle, out LoadType loadType, out string path) + { + GetLoadInfo(handle.Location, handle.ResourceManager, out loadType, out path); + } + + internal static void GetLoadInfo(IResourceLocation location, ResourceManager resourceManager, out LoadType loadType, out string path) + { + var options = location?.Data as AssetBundleRequestOptions; + if (options == null) + { + loadType = LoadType.None; + path = null; + return; + } + + path = resourceManager.TransformInternalId(location); + if (Application.platform == RuntimePlatform.Android && path.StartsWith("jar:", StringComparison.Ordinal)) + loadType = options.UseUnityWebRequestForLocalBundles ? LoadType.Web : LoadType.Local; + else if (ResourceManagerConfig.ShouldPathUseWebRequest(path)) + loadType = LoadType.Web; + else if (options.UseUnityWebRequestForLocalBundles) + { + path = "file:///" + Path.GetFullPath(path); + loadType = LoadType.Web; + } + else + loadType = LoadType.Local; + + if (loadType == LoadType.Web) + path = path.Replace('\\', '/'); + } + + private void BeginOperation() + { + // retrying a failed request will call BeginOperation multiple times. Any member variables + // should be reset at the beginning of the operation + m_DownloadedBytes = 0; + m_RequestCompletedCallbackCalled = false; + GetLoadInfo(m_ProvideHandle, out LoadType loadType, out m_TransformedInternalId); + + if (loadType == LoadType.Local) + { + LoadLocalBundle(); + return; + } + + if (loadType == LoadType.Web) + { + m_WebRequestQueueOperation = EnqueueWebRequest(m_TransformedInternalId); + AddBeginWebRequestHandler(m_WebRequestQueueOperation); + return; + } + + m_Source = BundleSource.None; + m_RequestOperation = null; + m_ProvideHandle.Complete(null, false, + new RemoteProviderException(string.Format("Invalid path in AssetBundleProvider: '{0}'.", m_TransformedInternalId), m_ProvideHandle.Location)); + m_Completed = true; + } + + private void LoadLocalBundle() + { + m_Source = BundleSource.Local; +#if !UNITY_2021_1_OR_NEWER + if (AsyncOperationHandle.IsWaitingForCompletion) + CompleteBundleLoad(AssetBundle.LoadFromFile(m_TransformedInternalId, m_Options == null ? 0 : m_Options.Crc)); + else +#endif + { + m_RequestOperation = AssetBundle.LoadFromFileAsync(m_TransformedInternalId, m_Options == null ? 0 : m_Options.Crc); +#if ENABLE_ADDRESSABLE_PROFILER + AddBundleToProfiler(Profiling.ContentStatus.Loading, m_Source); +#endif + AddCallbackInvokeIfDone(m_RequestOperation, LocalRequestOperationCompleted); + } + } + + internal TTWebRequestQueueOperation EnqueueWebRequest(string internalId) + { + var req = CreateWebRequest(internalId); +#if ENABLE_ASYNC_ASSETBUNDLE_UWR + ((DownloadHandlerAssetBundle)req.downloadHandler).autoLoadAssetBundle = true; +#endif + req.disposeDownloadHandlerOnDispose = false; + + return WebRequestQueue.QueueRequest(req); + } + + internal void AddBeginWebRequestHandler(TTWebRequestQueueOperation webRequestQueueOperation) + { + if (webRequestQueueOperation.IsDone) + { + BeginWebRequestOperation(webRequestQueueOperation.Result); + } + else + { +#if ENABLE_ADDRESSABLE_PROFILER + AddBundleToProfiler(Profiling.ContentStatus.Queue, m_Source); +#endif + webRequestQueueOperation.OnComplete += asyncOp => BeginWebRequestOperation(asyncOp); + } + } + + private void BeginWebRequestOperation(AsyncOperation asyncOp) + { + m_TimeoutTimer = 0; + m_TimeoutOverFrames = 0; + m_LastDownloadedByteCount = 0; + m_RequestOperation = asyncOp; + if (m_RequestOperation == null || m_RequestOperation.isDone) + WebRequestOperationCompleted(m_RequestOperation); + else + { + if (m_Options.Timeout > 0) + m_ProvideHandle.ResourceManager.AddUpdateReceiver(this); +#if ENABLE_ADDRESSABLE_PROFILER + AddBundleToProfiler(m_Source == BundleSource.Cache ? Profiling.ContentStatus.Loading : Profiling.ContentStatus.Downloading, m_Source); +#endif + m_RequestOperation.completed += WebRequestOperationCompleted; + } + } + + public void Update(float unscaledDeltaTime) + { + if (m_RequestOperation != null && m_RequestOperation is UnityWebRequestAsyncOperation operation && !operation.isDone) + { + if (m_LastDownloadedByteCount != operation.webRequest.downloadedBytes) + { + m_TimeoutTimer = 0; + m_TimeoutOverFrames = 0; + m_LastDownloadedByteCount = operation.webRequest.downloadedBytes; + } + else + { + m_TimeoutTimer += unscaledDeltaTime; + if (HasTimedOut) + operation.webRequest.Abort(); + m_TimeoutOverFrames++; + } + } + } + + private void LocalRequestOperationCompleted(AsyncOperation op) + { + if (m_RequestCompletedCallbackCalled) + { + return; + } + + m_RequestCompletedCallbackCalled = true; + CompleteBundleLoad((op as TTAssetBundleRequest).assetBundle); + } + + private void CompleteBundleLoad(AssetBundle bundle) + { + m_AssetBundle = bundle; +#if ENABLE_ADDRESSABLE_PROFILER + AddBundleToProfiler(Profiling.ContentStatus.Active, m_Source); +#endif + if (m_AssetBundle != null) + m_ProvideHandle.Complete(this, true, null); + else + m_ProvideHandle.Complete(null, false, + new RemoteProviderException(string.Format("Invalid path in AssetBundleProvider: '{0}'.", m_TransformedInternalId), m_ProvideHandle.Location)); + m_Completed = true; + } + + private void WebRequestOperationCompleted(AsyncOperation op) + { + if (m_RequestCompletedCallbackCalled) + return; + + m_RequestCompletedCallbackCalled = true; + + if (m_Options.Timeout > 0) + m_ProvideHandle.ResourceManager.RemoveUpdateReciever(this); + + UnityWebRequestAsyncOperation remoteReq = op as UnityWebRequestAsyncOperation; + var webReq = remoteReq?.webRequest; + var downloadHandler = webReq?.downloadHandler as DownloadHandlerTTAssetBundle; + TTUnityWebRequestResult uwrResult = null; + if (webReq != null && !TTUnityWebRequestUtilities.RequestHasErrors(webReq, out uwrResult)) + { + if (!m_Completed) + { +#if ENABLE_ADDRESSABLE_PROFILER + AddBundleToProfiler(Profiling.ContentStatus.Active, m_Source); +#endif + m_AssetBundle = downloadHandler.assetBundle; + downloadHandler.Dispose(); + downloadHandler = null; + m_ProvideHandle.Complete(this, true, null); + m_Completed = true; + } +#if ENABLE_CACHING + if (!string.IsNullOrEmpty(m_Options.Hash) && m_Options.ClearOtherCachedVersionsWhenLoaded) + Caching.ClearOtherCachedVersions(m_Options.BundleName, Hash128.Parse(m_Options.Hash)); +#endif + } + else + { + if (HasTimedOut) + uwrResult.Error = "Request timeout"; + webReq = m_WebRequestQueueOperation.m_WebRequest; + if (uwrResult == null) + uwrResult = new TTUnityWebRequestResult(m_WebRequestQueueOperation.m_WebRequest); + + downloadHandler = webReq.downloadHandler as DownloadHandlerTTAssetBundle; + downloadHandler.Dispose(); + downloadHandler = null; + bool forcedRetry = false; + string message = $"Web request failed, retrying ({m_Retries}/{m_Options.RetryCount})...\n{uwrResult}"; +#if ENABLE_CACHING + if (!string.IsNullOrEmpty(m_Options.Hash)) + { +#if ENABLE_ADDRESSABLE_PROFILER + if (m_Source == BundleSource.Cache) +#endif + { + message = $"Web request failed to load from cache. The cached AssetBundle will be cleared from the cache and re-downloaded. Retrying...\n{uwrResult}"; + Caching.ClearCachedVersion(m_Options.BundleName, Hash128.Parse(m_Options.Hash)); + // When attempted to load from cache we always retry on first attempt and failed + if (m_Retries == 0 && uwrResult.ShouldRetryDownloadError()) + { + Debug.LogFormat(message); + BeginOperation(); + m_Retries++; //Will prevent us from entering an infinite loop of retrying if retry count is 0 + forcedRetry = true; + } + } + } +#endif + if (!forcedRetry) + { + if (m_Retries < m_Options.RetryCount && uwrResult.ShouldRetryDownloadError()) + { + m_Retries++; + Debug.LogFormat(message); + BeginOperation(); + } + else + { + var exception = new TTRemoteProviderException($"Unable to load asset bundle from : {webReq.url}", m_ProvideHandle.Location, uwrResult); + m_ProvideHandle.Complete(null, false, exception); + m_Completed = true; +#if ENABLE_ADDRESSABLE_PROFILER + RemoveBundleFromProfiler(); +#endif + } + } + } + + webReq.Dispose(); + } + +#if UNLOAD_BUNDLE_ASYNC + public bool Unload(out AssetBundleUnloadOperation unloadOp) +#else + public void Unload() +#endif + { +#if UNLOAD_BUNDLE_ASYNC + unloadOp = null; + if (m_AssetBundle != null) + { + unloadOp = m_AssetBundle.UnloadAsync(true); + m_AssetBundle = null; + } +#else + if (m_AssetBundle != null) + { + m_AssetBundle.TTUnload(true); + m_AssetBundle = null; + } +#endif + m_RequestOperation = null; +#if ENABLE_ADDRESSABLE_PROFILER + RemoveBundleFromProfiler(); +#endif +#if UNLOAD_BUNDLE_ASYNC + return unloadOp != null; +#endif + } + } + + [DisplayName("TTAssetBundle Provider")] + public class TTAssetBundleProvider : ResourceProviderBase + { +#if UNLOAD_BUNDLE_ASYNC + internal static Dictionary m_UnloadingBundles = new Dictionary(); + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + private static void Init() + { + m_UnloadingBundles = new Dictionary(); + } + + protected internal static Dictionary UnloadingBundles + { + get { return m_UnloadingBundles; } + internal set { m_UnloadingBundles = value; } + } + + internal static int UnloadingAssetBundleCount => m_UnloadingBundles.Count; + internal static int AssetBundleCount => AssetBundle.GetAllLoadedAssetBundles().Count() - UnloadingAssetBundleCount; + internal static void WaitForAllUnloadingBundlesToComplete() + { + if (UnloadingAssetBundleCount > 0) + { + var bundles = m_UnloadingBundles.Values.ToArray(); + foreach (var b in bundles) + b.WaitForCompletion(); + } + } + +#else + internal static void WaitForAllUnloadingBundlesToComplete() + { + } + +#endif + + public override void Provide(ProvideHandle providerInterface) + { +#if UNLOAD_BUNDLE_ASYNC + if (m_UnloadingBundles.TryGetValue(providerInterface.Location.InternalId, out var unloadOp)) + { + if (unloadOp.isDone) + unloadOp = null; + } + new TTAssetBundleResource().Start(providerInterface, unloadOp); +#else + new TTAssetBundleResource().Start(providerInterface); +#endif + } + + public override Type GetDefaultType(IResourceLocation location) + { + return typeof(IAssetBundleResource); + } + + public override void Release(IResourceLocation location, object asset) + { + if (location == null) + throw new ArgumentNullException("location"); + if (asset == null) + { + Debug.LogWarningFormat("Releasing null asset bundle from location {0}. This is an indication that the bundle failed to load.", location); + return; + } + + var bundle = asset as TTAssetBundleResource; + if (bundle != null) + { +#if UNLOAD_BUNDLE_ASYNC + if (bundle.Unload(out var unloadOp)) + { + m_UnloadingBundles.Add(location.InternalId, unloadOp); + unloadOp.completed += op => m_UnloadingBundles.Remove(location.InternalId); + } +#else + bundle.Unload(); +#endif + return; + } + } + } +} + + +namespace UnityEngine.ResourceManagement.Exceptions +{ + /// + /// Class representing an error occured during an operation that remotely fetch data. + /// + public class TTRemoteProviderException : ProviderException + { + /// + /// Creates a new instance of . + /// + /// A message describing the error. + /// The resource location that the operation was trying to provide. + /// The result of the unity web request, if any. + /// The exception that caused the error, if any. + public TTRemoteProviderException(string message, IResourceLocation location = null, + TTUnityWebRequestResult uwrResult = null, Exception innerException = null) + : base(message, location, innerException) + { + WebRequestResult = uwrResult; + } + + /// + public override string Message => this.ToString(); + + /// + /// The result of the unity web request, if any. + /// + public TTUnityWebRequestResult WebRequestResult { get; } + + /// Provides a new string object describing the exception. + /// A newly allocated managed string. + public override string ToString() + { + if (WebRequestResult != null) + return + $"{GetType().Name} : {base.Message}\nUnityWebRequest result : {WebRequestResult}\n{InnerException}"; + else + return base.ToString(); + } + } +} + +namespace UnityEngine.ResourceManagement.Util +{ + internal class TTUnityWebRequestUtilities + { + public static bool RequestHasErrors(UnityWebRequest webReq, out TTUnityWebRequestResult result) + { + result = null; + if (webReq == null || !webReq.isDone) + return false; + +#if UNITY_2020_1_OR_NEWER + switch (webReq.result) + { + case UnityWebRequest.Result.InProgress: + case UnityWebRequest.Result.Success: + return false; + case UnityWebRequest.Result.ConnectionError: + case UnityWebRequest.Result.ProtocolError: + case UnityWebRequest.Result.DataProcessingError: + result = new TTUnityWebRequestResult(webReq); + return true; + default: + throw new NotImplementedException($"Cannot determine whether UnityWebRequest succeeded or not from result : {webReq.result}"); + } +#else + var isError = webReq.isHttpError || webReq.isNetworkError; + if (isError) + result = new UnityWebRequestResult(webReq); + + return isError; +#endif + } + + internal static bool IsAssetBundleDownloaded(UnityWebRequestAsyncOperation op) + { +#if ENABLE_ASYNC_ASSETBUNDLE_UWR + var handler = (DownloadHandlerAssetBundle)op.webRequest.downloadHandler; + if (handler != null && handler.autoLoadAssetBundle) + return handler.isDownloadComplete; +#endif + return op.isDone; + } + } + + /// + /// Container class for the result of a unity web request. + /// + public class TTUnityWebRequestResult + { + /// + /// Creates a new instance of . + /// + /// The unity web request. + public TTUnityWebRequestResult(UnityWebRequest request) + { + string error = request.error; +#if UNITY_2020_1_OR_NEWER + if (request.result == UnityWebRequest.Result.DataProcessingError && request.downloadHandler != null) + { + // https://docs.unity3d.com/ScriptReference/Networking.DownloadHandler-error.html + // When a UnityWebRequest ends with the result, UnityWebRequest.Result.DataProcessingError, the message describing the error is in the download handler + error = $"{error} : {request.downloadHandler.error}"; + } + + Result = request.result; +#endif + Error = error; + ResponseCode = request.responseCode; + Method = request.method; + Url = request.url; + } + + /// Provides a new string object describing the result. + /// A newly allocated managed string. + public override string ToString() + { + var sb = new System.Text.StringBuilder(); + +#if UNITY_2020_1_OR_NEWER + sb.AppendLine($"{Result} : {Error}"); +#else + if (!string.IsNullOrEmpty(Error)) + sb.AppendLine(Error); +#endif + if (ResponseCode > 0) + sb.AppendLine($"ResponseCode : {ResponseCode}, Method : {Method}"); + sb.AppendLine($"url : {Url}"); + + return sb.ToString(); + } + + /// + /// A string explaining the error that occured. + /// + public string Error { get; internal set; } + + /// + /// The numeric HTTP response code returned by the server, if any. + /// See documentation for more details. + /// + public long ResponseCode { get; } + +#if UNITY_2020_1_OR_NEWER + /// + /// The outcome of the request. + /// + public UnityWebRequest.Result Result { get; } +#endif + /// + /// The HTTP verb used by this UnityWebRequest, such as GET or POST. + /// + public string Method { get; } + + /// + /// The target url of the request. + /// + public string Url { get; } + + internal bool ShouldRetryDownloadError() + { + if (string.IsNullOrEmpty(Error)) + return true; + + if (Error == "Request aborted" || + Error == "Unable to write data" || + Error == "Malformed URL" || + Error == "Out of memory" || + Error == "Encountered invalid redirect (missing Location header?)" || + Error == "Cannot modify request at this time" || + Error == "Unsupported Protocol" || + Error == "Destination host has an erroneous SSL certificate" || + Error == "Unable to load SSL Cipher for verification" || + Error == "SSL CA certificate error" || + Error == "Unrecognized content-encoding" || + Error == "Request already transmitted" || + Error == "Invalid HTTP Method" || + Error == "Header name contains invalid characters" || + Error == "Header value contains invalid characters" || + Error == "Cannot override system-specified headers" + ) + return false; + + /* Errors that can be retried: + "Unknown Error": + "No Internet Connection" + "Backend Initialization Error": + "Cannot resolve proxy": + "Cannot resolve destination host": + "Cannot connect to destination host": + "Access denied": + "Generic/unknown HTTP error": + "Unable to read data": + "Request timeout": + "Error during HTTP POST transmission": + "Unable to complete SSL connection": + "Redirect limit exceeded": + "Received no data in response": + "Destination host does not support SSL": + "Failed to transmit data": + "Failed to receive data": + "Login failed": + "SSL shutdown failed": + "Redirect limit is invalid": + "Not implemented": + "Data Processing Error, see Download Handler error": + */ + return true; + } + } +} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleProviders.cs.txt.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleProviders.cs.txt.meta new file mode 100644 index 0000000..5ec4ea3 --- /dev/null +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleProviders.cs.txt.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f35fc5190b7541a98d557310153acb94 +timeCreated: 1718113619 \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleRequest.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleRequest.cs new file mode 100644 index 0000000..8d40d91 --- /dev/null +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleRequest.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using AOT; +using UnityEngine; +using UnityEngine.Scripting; +using Random = UnityEngine.Random; + +namespace StarkSDKSpace +{ + public class TTAssetBundleRequest : AsyncOperation, IEnumerator + { + + private static readonly Dictionary _urlToRequest = + new Dictionary(); + + public string Url; + private uint _crc; + private readonly ulong _offset; + + public bool IsDone; + + private AssetBundle _bundle; + private string _requestId; + + public delegate void TTAssetBundleCallback(IntPtr idPtr, uint errCode, IntPtr msgPtr); + + public void Dispose() + { + + } + + public AssetBundle assetBundle + { + get + { + if (_bundle == null) + { + _bundle = AssetBundle.LoadFromFile(Url); + TTAssetBundle.bundle2path.Add(_bundle, Url); + } + + return _bundle; + } + } + + internal TTAssetBundleRequest(string url, uint crc, ulong offset) + { + Url = url; + _crc = crc; + _offset = offset; + + IsDone = false; + _requestId = url + Random.Range(0.0f, 10000000f); + _urlToRequest.Add(_requestId, this); + StarkAbfsFetchBundleFromXHR(url, _requestId, new TTAssetBundleCallback(Callback)); + } + + [MonoPInvokeCallback(typeof(TTAssetBundleCallback))] + public static void Callback(IntPtr idPtr, uint errCode, IntPtr msgPtr) + { + string requestId = Marshal.PtrToStringAuto(idPtr); + _urlToRequest.TryGetValue(requestId, out var request); + _urlToRequest.Remove(requestId); + if (errCode == 0U) + { + request.IsDone = true; + } + else + { + string msg = Marshal.PtrToStringAuto(msgPtr); + Debug.LogError($"StarkAbfsGetBundleFromXML_{requestId} Error: {msg}"); + throw new Exception(msg); + } + } + + [Preserve] +#if UNITY_WEBGL && !UNITY_EDITOR + [DllImport("__Internal", EntryPoint = "StarkAbfsFetchBundleFromXHR")] + private static extern void StarkAbfsFetchBundleFromXHR(string url, string id, TTAssetBundleCallback callback); +#else + private static void StarkAbfsFetchBundleFromXHR(string url, string id, TTAssetBundleCallback callback) + { + throw new PlatformNotSupportedException(); + } +#endif + + public object Current => null; + + public bool MoveNext() => !IsDone; + + public void Reset() => throw new NotImplementedException("Reset Not Implemented"); + + } +} \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleRequest.cs.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleRequest.cs.meta new file mode 100644 index 0000000..2297b40 --- /dev/null +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/AssetBundle/TTAssetBundleRequest.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 005754d578fd41818066e68a53947a54 +timeCreated: 1716206399 \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Compatibility.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Compatibility.meta index 35c2c0f..103f727 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Compatibility.meta +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Compatibility.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 290084c2d28e14a148db9d2861b634b8 +guid: e7f16c10fc601490fb358d218744120e folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Compatibility/UnityCacheCompatibility.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Compatibility/UnityCacheCompatibility.cs index 955f8cb..2785dba 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Compatibility/UnityCacheCompatibility.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Compatibility/UnityCacheCompatibility.cs @@ -8,13 +8,12 @@ namespace StarkSDKSpace public class UnityCacheStorageStatus { public long maximumAvailableStorageSpace; - public long spaceFree; public long spaceOccupied; + public long spaceFree; } - - public static class UnityCacheCompatibility - { - + + public static class UnityCacheCompatibility { + public static bool CheckAndSetMaxStorageSpace(long cacheSizeInBytes) { #if !UNITY_WEBGL @@ -27,7 +26,7 @@ namespace StarkSDKSpace #endif return false; } - + public static UnityCacheStorageStatus GetStorageStatus() { #if !UNITY_WEBGL @@ -44,6 +43,7 @@ namespace StarkSDKSpace #endif return null; } + } - + } \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Compatibility/UnityWebRequestCompatibility.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Compatibility/UnityWebRequestCompatibility.cs index 32445e8..11da086 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Compatibility/UnityWebRequestCompatibility.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Compatibility/UnityWebRequestCompatibility.cs @@ -13,5 +13,6 @@ namespace StarkSDKSpace return UnityWebRequest.Post(host, data); #endif } + } } \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem.meta index 9cf16ec..e638081 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem.meta +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 79cf622bbbc34402986b771a2ea099a5 +guid: 0290aab6d84a343f6be5763bee6766e3 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManager.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManager.cs index 0d05917..813d02a 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManager.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManager.cs @@ -1,3 +1,5 @@ +using System.Runtime.InteropServices; + namespace StarkSDKSpace { /** @@ -7,12 +9,12 @@ namespace StarkSDKSpace public abstract class StarkFileSystemManager { /// - /// 用户数据存储的路径 + /// 用户数据存储的路径 /// public const string USER_DATA_PATH = "scfile://user"; /// - /// 将字符串写入文件(同步) + /// 将字符串写入文件(同步) /// /// 要写入的文件路径 /// 要写入的文本 @@ -21,7 +23,7 @@ namespace StarkSDKSpace public abstract string WriteFileSync(string filePath, string data, string encoding = "utf8"); /// - /// 将二进制写入文件(同步) + /// 将二进制写入文件(同步) /// /// 要写入的文件路径 /// 要写入的二进制数据 @@ -29,32 +31,32 @@ namespace StarkSDKSpace public abstract string WriteFileSync(string filePath, byte[] data); /// - /// 将二进制写入文件(异步) + /// 将二进制写入文件(异步) /// /// public abstract void WriteFile(WriteFileParam param); /// - /// 将字符串写入文件(异步) + /// 将字符串写入文件(异步) /// /// public abstract void WriteFile(WriteFileStringParam param); /// - /// 读取本地文件内容(异步) + /// 读取本地文件内容(异步) /// /// public abstract void ReadFile(ReadFileParam param); /// - /// 从本地文件读取二进制数据数据(同步) + /// 从本地文件读取二进制数据数据(同步) /// /// /// 字节数据,读取失败返回null public abstract byte[] ReadFileSync(string filePath); /// - /// 从本地文件读取字符串数据(同步) + /// 从本地文件读取字符串数据(同步) /// /// 要读取的文件的路径 /// 指定读取文件的字符编码, 不能为空 @@ -62,20 +64,20 @@ namespace StarkSDKSpace public abstract string ReadFileSync(string filePath, string encoding); /// - /// 判断文件/目录是否存在(同步) + /// 判断文件/目录是否存在(同步) /// /// 要判断是否存在的文件/目录路径 /// 成功返回 true, 失败返回 false public abstract bool AccessSync(string path); /// - /// 判断文件/目录是否存在(异步) + /// 判断文件/目录是否存在(异步) /// /// public abstract void Access(AccessParam param); /// - /// 复制文件(同步) + /// 复制文件(同步) /// /// 源文件路径 /// 目标文件路径 @@ -83,19 +85,19 @@ namespace StarkSDKSpace public abstract string CopyFileSync(string srcPath, string destPath); /// - /// 复制文件(异步) + /// 复制文件(异步) /// /// public abstract void CopyFile(CopyFileParam param); /// - /// 重命名文件(异步) + /// 重命名文件(异步) /// /// public abstract void RenameFile(RenameFileParam param); /// - /// 重命名文件(同步) + /// 重命名文件(同步) /// /// 源文件路径 /// 目标文件路径 @@ -103,43 +105,40 @@ namespace StarkSDKSpace public abstract string RenameFileSync(string srcPath, string destPath); /// - /// 删除文件(同步) + /// 删除文件(同步) /// /// 源文件路径,支持本地路径 /// 成功返回空字符串,失败返回错误信息 public abstract string UnlinkSync(string filePath); /// - /// 删除文件(异步) + /// 删除文件(异步) /// /// public abstract void Unlink(UnlinkParam param); /// - /// 创建目录(异步) + /// 创建目录(异步) /// /// public abstract void Mkdir(MkdirParam param); /// - /// 创建目录(同步) + /// 创建目录(同步) /// /// 创建的目录路径 - /// - /// 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a - /// 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 - /// + /// 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 /// 成功返回空字符串,失败返回错误信息 public abstract string MkdirSync(string dirPath, bool recursive = false); /// - /// 删除目录(异步) + /// 删除目录(异步) /// /// public abstract void Rmdir(RmdirParam param); /// - /// 删除目录(同步) + /// 删除目录(同步) /// /// 创建的目录路径 /// 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件 。 @@ -147,7 +146,7 @@ namespace StarkSDKSpace public abstract string RmdirSync(string dirPath, bool recursive = false); /// - /// 读取文件描述信息(同步) + /// 读取文件描述信息(同步) /// /// 文件/目录路径 /// 是否递归获取目录下的每个文件的 Stat 信息 @@ -156,30 +155,30 @@ namespace StarkSDKSpace public abstract StarkStatInfo StatSync(string path, bool throwException = false); /// - /// 读取文件描述信息(异步) + /// 读取文件描述信息(异步) /// /// public abstract void Stat(StatParam param); /// - /// 获取保存的用户目录文件列表(仅WebGL平台可用) + /// 获取保存的用户目录文件列表(仅WebGL平台可用) /// public abstract void GetSavedFileList(GetSavedFileListParam param); /// - /// 根据url链接获取本地缓存文件路径(仅WebGL平台可用) + /// 根据url链接获取本地缓存文件路径(仅WebGL平台可用) /// /// 输入文件下载链接url /// 返回本地缓存文件路径,以scfile://user开头的路径,可以直接用这个路径访问该文件 public abstract string GetLocalCachedPathForUrl(string url); /// - /// 判断该url是否有本地缓存文件(仅WebGL平台可用) + /// 判断该url是否有本地缓存文件(仅WebGL平台可用) /// /// 输入文件下载链接url /// 如果存在缓存文件则返回true,不存在缓存文件则返回false public abstract bool IsUrlCached(string url); - + private static int _isDataMigrated = -1; #if UNITY_WEBGL && !UNITY_EDITOR @@ -222,12 +221,12 @@ namespace StarkSDKSpace { return true; } - if (_isDataMigrated == 0) + else if (_isDataMigrated == 0) { return false; } - bool migrated = StarkIsDataMigrated(); + var migrated = StarkIsDataMigrated(); _isDataMigrated = migrated ? 1 : 0; return migrated; } diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManagerDefault.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManagerDefault.cs index 2bf0562..9d9fcf0 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManagerDefault.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManagerDefault.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.IO; -using UnityEngine; - namespace StarkSDKSpace { public class StarkFileSystemManagerDefault : StarkFileSystemManager @@ -10,7 +5,7 @@ namespace StarkSDKSpace public static readonly StarkFileSystemManagerDefault Instance = new StarkFileSystemManagerDefault(); /// - /// 将字符串写入文件(同步) + /// 将字符串写入文件(同步) /// /// 要写入的文件路径 /// 要写入的文本 @@ -18,16 +13,16 @@ namespace StarkSDKSpace /// 成功返回空字符串,失败返回错误信息 public override string WriteFileSync(string filePath, string data, string encoding = "utf8") { - if (!Directory.Exists(Path.GetDirectoryName(filePath))) + if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(filePath))) { - return $"{Path.GetDirectoryName(filePath)} not exist"; + return $"{System.IO.Path.GetDirectoryName(filePath)} not exist"; } try { - File.WriteAllText(filePath, data); + System.IO.File.WriteAllText(filePath, data); } - catch (Exception exception) + catch (System.Exception exception) { return exception.Message; } @@ -36,23 +31,23 @@ namespace StarkSDKSpace } /// - /// 将二进制写入文件(同步) + /// 将二进制写入文件(同步) /// /// 要写入的文件路径 /// 要写入的二进制数据 /// 成功返回空字符串,失败返回错误信息 public override string WriteFileSync(string filePath, byte[] data) { - if (!Directory.Exists(Path.GetDirectoryName(filePath))) + if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(filePath))) { - return $"{Path.GetDirectoryName(filePath)} not exist"; + return $"{System.IO.Path.GetDirectoryName(filePath)} not exist"; } try { - File.WriteAllBytes(filePath, data); + System.IO.File.WriteAllBytes(filePath, data); } - catch (Exception exception) + catch (System.Exception exception) { return exception.Message; } @@ -61,32 +56,32 @@ namespace StarkSDKSpace } /// - /// 将二进制写入文件(异步) + /// 将二进制写入文件(异步) /// /// public override void WriteFile(WriteFileParam param) { - string errMsg = WriteFileSync(param.filePath, param.data); + var errMsg = WriteFileSync(param.filePath, param.data); CallbackBaseResponse(errMsg, param.success, param.fail); } /// - /// 将字符串写入文件(异步) + /// 将字符串写入文件(异步) /// /// public override void WriteFile(WriteFileStringParam param) { - string errMsg = WriteFileSync(param.filePath, param.data); + var errMsg = WriteFileSync(param.filePath, param.data); CallbackBaseResponse(errMsg, param.success, param.fail); } /// - /// 读取本地文件内容(异步) + /// 读取本地文件内容(异步) /// /// public override void ReadFile(ReadFileParam param) { - if (!File.Exists(param.filePath)) + if (!System.IO.File.Exists(param.filePath)) { CallbackReadFileResponse("file not exist", param.success, param.fail); return; @@ -94,18 +89,18 @@ namespace StarkSDKSpace if (string.IsNullOrEmpty(param.encoding) || param.encoding.Equals("binary")) { - byte[] data = File.ReadAllBytes(param.filePath); + var data = System.IO.File.ReadAllBytes(param.filePath); CallbackReadFileResponse("", param.success, param.fail, data); } else { - string data = File.ReadAllText(param.filePath); + var data = System.IO.File.ReadAllText(param.filePath); CallbackReadFileResponse("", param.success, param.fail, null, data); } } /// - /// 从本地文件读取二进制数据数据(同步) + /// 从本地文件读取二进制数据数据(同步) /// /// /// 字节数据,读取失败返回null @@ -113,17 +108,17 @@ namespace StarkSDKSpace { try { - return File.ReadAllBytes(filePath); + return System.IO.File.ReadAllBytes(filePath); } - catch (Exception exception) + catch (System.Exception exception) { - Debug.LogError($"ReadFileSync: {exception.Message}"); + UnityEngine.Debug.LogError($"ReadFileSync: {exception.Message}"); return null; } } /// - /// 从本地文件读取字符串数据(同步) + /// 从本地文件读取字符串数据(同步) /// /// 要读取的文件的路径 /// 指定读取文件的字符编码, 不能为空 @@ -132,99 +127,102 @@ namespace StarkSDKSpace { try { - return File.ReadAllText(filePath); + return System.IO.File.ReadAllText(filePath); } - catch (Exception exception) + catch (System.Exception exception) { - Debug.LogError($"ReadFileSync: {exception.Message}"); + UnityEngine.Debug.LogError($"ReadFileSync: {exception.Message}"); return null; } } /// - /// 判断文件/目录是否存在(同步) + /// 判断文件/目录是否存在(同步) /// /// 要判断是否存在的文件/目录路径 /// 成功返回 true, 失败返回 false public override bool AccessSync(string path) { - return File.Exists(path) || Directory.Exists(path); + return System.IO.File.Exists(path) || System.IO.Directory.Exists(path); } /// - /// 判断文件/目录是否存在(异步) + /// 判断文件/目录是否存在(异步) /// /// public override void Access(AccessParam param) { - bool exist = AccessSync(param.path); + var exist = AccessSync(param.path); CallbackBaseResponse(exist ? "" : "no such file or directory", param.success, param.fail); } /// - /// 复制文件(同步) + /// 复制文件(同步) /// /// 源文件路径 /// 目标文件路径 /// 成功返回空字符串,失败返回错误信息 public override string CopyFileSync(string srcPath, string destPath) { - if (File.Exists(srcPath)) + if (System.IO.File.Exists(srcPath)) { try { - File.Copy(srcPath, destPath, true); + System.IO.File.Copy(srcPath, destPath, true); } - catch (Exception exception) + catch (System.Exception exception) { return exception.Message; } return ""; } - return "source file not exist"; + else + { + return "source file not exist"; + } } /// - /// 复制文件(异步) + /// 复制文件(异步) /// /// public override void CopyFile(CopyFileParam param) { - string errMsg = CopyFileSync(param.srcPath, param.destPath); + var errMsg = CopyFileSync(param.srcPath, param.destPath); CallbackBaseResponse(errMsg, param.success, param.fail); } /// - /// 重命名文件(异步) + /// 重命名文件(异步) /// /// public override void RenameFile(RenameFileParam param) { - string errMsg = RenameFileSync(param.srcPath, param.destPath); + var errMsg = RenameFileSync(param.srcPath, param.destPath); CallbackBaseResponse(errMsg, param.success, param.fail); } /// - /// 重命名文件(同步) + /// 重命名文件(同步) /// /// 源文件路径 /// 目标文件路径 /// 成功返回空字符串,失败返回错误信息 public override string RenameFileSync(string srcPath, string destPath) { - if (File.Exists(srcPath)) + if (System.IO.File.Exists(srcPath)) { try { - if (File.Exists(destPath)) + if (System.IO.File.Exists(destPath)) { - File.Delete(destPath); + System.IO.File.Delete(destPath); } - File.Move(srcPath, destPath); + System.IO.File.Move(srcPath, destPath); } - catch (Exception exception) + catch (System.Exception exception) { return exception.Message; } @@ -236,19 +234,19 @@ namespace StarkSDKSpace } /// - /// 删除文件(同步) + /// 删除文件(同步) /// /// 源文件路径,支持本地路径 /// 成功返回空字符串,失败返回错误信息 public override string UnlinkSync(string filePath) { - if (File.Exists(filePath)) + if (System.IO.File.Exists(filePath)) { try { - File.Delete(filePath); + System.IO.File.Delete(filePath); } - catch (Exception exception) + catch (System.Exception exception) { return exception.Message; } @@ -260,43 +258,40 @@ namespace StarkSDKSpace } /// - /// 删除文件(异步) + /// 删除文件(异步) /// /// public override void Unlink(UnlinkParam param) { - string errMsg = UnlinkSync(param.filePath); + var errMsg = UnlinkSync(param.filePath); CallbackBaseResponse(errMsg, param.success, param.fail); } /// - /// 创建目录(异步) + /// 创建目录(异步) /// /// public override void Mkdir(MkdirParam param) { - string errMsg = MkdirSync(param.dirPath, param.recursive); + var errMsg = MkdirSync(param.dirPath, param.recursive); CallbackBaseResponse(errMsg, param.success, param.fail); } /// - /// 创建目录(同步) + /// 创建目录(同步) /// /// 创建的目录路径 - /// - /// 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a - /// 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 - /// + /// 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 /// 成功返回空字符串,失败返回错误信息 public override string MkdirSync(string dirPath, bool recursive = false) { - if (!Directory.Exists(dirPath)) + if (!System.IO.Directory.Exists(dirPath)) { try { - Directory.CreateDirectory(dirPath); + System.IO.Directory.CreateDirectory(dirPath); } - catch (Exception exception) + catch (System.Exception exception) { return exception.Message; } @@ -306,41 +301,44 @@ namespace StarkSDKSpace } /// - /// 删除目录(异步) + /// 删除目录(异步) /// /// public override void Rmdir(RmdirParam param) { - string errMsg = RmdirSync(param.dirPath, param.recursive); + var errMsg = RmdirSync(param.dirPath, param.recursive); CallbackBaseResponse(errMsg, param.success, param.fail); } /// - /// 删除目录(同步) + /// 删除目录(同步) /// /// 创建的目录路径 /// 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件 。 /// 成功返回空字符串,失败返回错误信息 public override string RmdirSync(string dirPath, bool recursive = false) { - if (Directory.Exists(dirPath)) + if (System.IO.Directory.Exists(dirPath)) { try { - Directory.Delete(dirPath, recursive); + System.IO.Directory.Delete(dirPath, recursive); } - catch (Exception exception) + catch (System.Exception exception) { return exception.Message; } return ""; } - return "directory not exist"; + else + { + return "directory not exist"; + } } /// - /// 读取文件描述信息(同步) + /// 读取文件描述信息(同步) /// /// 文件/目录路径 /// 是否递归获取目录下的每个文件的 Stat 信息 @@ -348,10 +346,10 @@ namespace StarkSDKSpace /// 返回文件信息,如果访问失败则返回null public override StarkStatInfo StatSync(string path, bool throwException = false) { - if (File.Exists(path)) + if (System.IO.File.Exists(path)) { - var fileInfo = new FileInfo(path); - return new StarkStatInfo + var fileInfo = new System.IO.FileInfo(path); + return new StarkStatInfo() { size = fileInfo.Length, mode = 33060, @@ -359,10 +357,10 @@ namespace StarkSDKSpace lastModifiedTime = GetUnixTime(fileInfo.LastWriteTime.Ticks) }; } - if (Directory.Exists(path)) + else if (System.IO.Directory.Exists(path)) { - var dirInfo = new DirectoryInfo(path); - return new StarkStatInfo + var dirInfo = new System.IO.DirectoryInfo(path); + return new StarkStatInfo() { size = 0, mode = 16676, @@ -370,11 +368,14 @@ namespace StarkSDKSpace lastModifiedTime = GetUnixTime(dirInfo.LastWriteTime.Ticks) }; } - return null; + else + { + return null; + } } /// - /// 读取文件描述信息(异步) + /// 读取文件描述信息(异步) /// /// public override void Stat(StatParam param) @@ -382,14 +383,14 @@ namespace StarkSDKSpace var info = StatSync(param.path); if (info != null) { - param.success?.Invoke(new StarkStatResponse + param.success?.Invoke(new StarkStatResponse() { stat = info }); } else { - param.fail?.Invoke(new StarkStatResponse + param.fail?.Invoke(new StarkStatResponse() { errCode = -1, errMsg = "No such file or directory" @@ -397,20 +398,20 @@ namespace StarkSDKSpace } } - private void GetFilesRecursively(string path, List fileInfos) + private void GetFilesRecursively(string path, System.Collections.Generic.List fileInfos) { - var dir = new DirectoryInfo(path); + System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(path); if (dir.Exists) { - FileInfo[] files = dir.GetFiles(); + System.IO.FileInfo[] files = dir.GetFiles(); if (files != null && files.Length > 0) { - var unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); - foreach (var file in files) + System.DateTime unixEpoch = new System.DateTime(1970, 1, 1, 0, 0, 0, System.DateTimeKind.Utc); + foreach (System.IO.FileInfo file in files) { long unixTimeStampInTicks = (file.CreationTime.ToUniversalTime() - unixEpoch).Ticks; - long unixTimeStampInSeconds = unixTimeStampInTicks / TimeSpan.TicksPerSecond; - fileInfos.Add(new StarkFileInfo + long unixTimeStampInSeconds = unixTimeStampInTicks / System.TimeSpan.TicksPerSecond; + fileInfos.Add(new StarkFileInfo() { mode = 33060, size = file.Length, @@ -420,15 +421,15 @@ namespace StarkSDKSpace } } - DirectoryInfo[] subDirs = dir.GetDirectories(); + System.IO.DirectoryInfo[] subDirs = dir.GetDirectories(); if (subDirs != null && subDirs.Length > 0) { - var unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + System.DateTime unixEpoch = new System.DateTime(1970, 1, 1, 0, 0, 0, System.DateTimeKind.Utc); foreach (var subDir in subDirs) { long unixTimeStampInTicks = (subDir.CreationTime.ToUniversalTime() - unixEpoch).Ticks; - long unixTimeStampInSeconds = unixTimeStampInTicks / TimeSpan.TicksPerSecond; - fileInfos.Add(new StarkFileInfo + long unixTimeStampInSeconds = unixTimeStampInTicks / System.TimeSpan.TicksPerSecond; + fileInfos.Add(new StarkFileInfo() { mode = 16676, size = 0, @@ -442,21 +443,21 @@ namespace StarkSDKSpace } /// - /// 获取保存的用户目录文件列表 + /// 获取保存的用户目录文件列表 /// public override void GetSavedFileList(GetSavedFileListParam param) { - List fileInfos = - new List(); - GetFilesRecursively(Application.persistentDataPath, fileInfos); - param.success?.Invoke(new StarkGetSavedFileListResponse + System.Collections.Generic.List fileInfos = + new System.Collections.Generic.List(); + GetFilesRecursively(UnityEngine.Application.persistentDataPath, fileInfos); + param.success?.Invoke(new StarkGetSavedFileListResponse() { fileList = fileInfos.ToArray() }); } /// - /// 根据url链接获取本地缓存文件路径 + /// 根据url链接获取本地缓存文件路径 /// /// 输入文件下载链接url /// 返回本地缓存文件路径,以scfile://user开头的路径,可以直接用这个路径访问该文件 @@ -466,7 +467,7 @@ namespace StarkSDKSpace } /// - /// 判断该url是否有本地缓存文件 + /// 判断该url是否有本地缓存文件 /// /// 输入文件下载链接url /// 如果存在缓存文件则返回true,不存在缓存文件则返回false @@ -476,14 +477,14 @@ namespace StarkSDKSpace } private static void CallbackReadFileResponse(string errMsg, - Action success, - Action fail, - byte[] binData = null, - string stringData = null) + System.Action success, + System.Action fail, + byte[] binData = null, + string stringData = null) { if (string.IsNullOrEmpty(errMsg)) { - success?.Invoke(new StarkReadFileResponse + success?.Invoke(new StarkReadFileResponse() { binData = binData, stringData = stringData @@ -491,7 +492,7 @@ namespace StarkSDKSpace } else { - fail?.Invoke(new StarkReadFileResponse + fail?.Invoke(new StarkReadFileResponse() { errCode = -1, errMsg = errMsg @@ -499,8 +500,8 @@ namespace StarkSDKSpace } } - private static void CallbackBaseResponse(string errMsg, Action success, - Action fail) + private static void CallbackBaseResponse(string errMsg, System.Action success, + System.Action fail) { if (string.IsNullOrEmpty(errMsg)) { @@ -508,7 +509,7 @@ namespace StarkSDKSpace } else { - fail?.Invoke(new StarkBaseResponse + fail?.Invoke(new StarkBaseResponse() { errCode = -1, errMsg = errMsg @@ -518,8 +519,8 @@ namespace StarkSDKSpace private static long GetUnixTime(long ticks) { - long epochTicks = new DateTime(1970, 1, 1).Ticks; - long unixTime = (ticks - epochTicks) / TimeSpan.TicksPerSecond; + var epochTicks = new System.DateTime(1970, 1, 1).Ticks; + var unixTime = ((ticks - epochTicks) / System.TimeSpan.TicksPerSecond); return unixTime; } } diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManagerWebGL.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManagerWebGL.cs index 757b651..8429b04 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManagerWebGL.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManagerWebGL.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using System.IO; +using System.Runtime.InteropServices; using StarkSDKSpace.UNBridgeLib.LitJson; using UnityEngine; using Object = UnityEngine.Object; @@ -45,7 +45,7 @@ namespace StarkSDKSpace string f); #else private static void StarkWriteStringFile(string filePath, string data, string encoding, string s, - string f) + string f) { StarkFileSystemManagerDefault.Instance.WriteFileSync(filePath, data, encoding); } @@ -235,7 +235,7 @@ namespace StarkSDKSpace { } #endif - + #if UNITY_WEBGL && !UNITY_EDITOR [DllImport("__Internal")] private static extern string StarkGetCachedPathForUrl(string url); @@ -248,10 +248,10 @@ namespace StarkSDKSpace public static readonly StarkFileSystemManagerWebGL Instance = new StarkFileSystemManagerWebGL(); - private static readonly Dictionary s_readFileParams = new Dictionary(); - private static readonly Dictionary s_statParams = new Dictionary(); + private static Dictionary s_readFileParams = new Dictionary(); + private static Dictionary s_statParams = new Dictionary(); - private static readonly Dictionary s_getSavedFileListParams = + private static Dictionary s_getSavedFileListParams = new Dictionary(); private static bool _initialized; @@ -267,7 +267,7 @@ namespace StarkSDKSpace if (!_initialized) { _initialized = true; - var obj = new GameObject(); + GameObject obj = new GameObject(); Object.DontDestroyOnLoad(obj); obj.name = "StarkFileSystemManager"; obj.AddComponent(); @@ -299,17 +299,17 @@ namespace StarkSDKSpace { if (string.IsNullOrEmpty(conf.encoding) || conf.encoding.Equals("binary")) { - byte[] sharedBuffer = new byte[res.byteLength]; + var sharedBuffer = new byte[res.byteLength]; StarkShareFileBuffer(sharedBuffer, res.callbackId); - var obj = new StarkReadFileResponse + var obj = new StarkReadFileResponse() { - binData = sharedBuffer + binData = sharedBuffer, }; conf.success?.Invoke(obj); } else { - var obj = new StarkReadFileResponse + var obj = new StarkReadFileResponse() { stringData = res.data }; @@ -318,7 +318,7 @@ namespace StarkSDKSpace } else { - var obj = new StarkReadFileResponse + var obj = new StarkReadFileResponse() { errCode = res.errCode, errMsg = res.errMsg @@ -440,7 +440,7 @@ namespace StarkSDKSpace } /// - /// 将字符串写入文件(同步) + /// 将字符串写入文件(同步) /// /// 要写入的文件路径 /// 要写入的文本 @@ -457,7 +457,7 @@ namespace StarkSDKSpace } /// - /// 将二进制写入文件(同步) + /// 将二进制写入文件(同步) /// /// 要写入的文件路径 /// 要写入的二进制数据 @@ -468,7 +468,7 @@ namespace StarkSDKSpace } /// - /// 将二进制写入文件(异步) + /// 将二进制写入文件(异步) /// /// public override void WriteFile(WriteFileParam param) @@ -483,7 +483,7 @@ namespace StarkSDKSpace } /// - /// 将字符串写入文件(异步) + /// 将字符串写入文件(异步) /// /// public override void WriteFile(WriteFileStringParam param) @@ -503,42 +503,45 @@ namespace StarkSDKSpace } /// - /// 读取本地文件内容(异步) + /// 读取本地文件内容(异步) /// /// public override void ReadFile(ReadFileParam param) { - string key = StarkCallbackHandler.MakeKey(); + var key = StarkCallbackHandler.MakeKey(); s_readFileParams.Add(key, param); StarkReadFile(FixFilePath(param.filePath), param.encoding, key); } /// - /// 从本地文件读取二进制数据数据(同步) + /// 从本地文件读取二进制数据数据(同步) /// /// /// 字节数据,读取失败返回null public override byte[] ReadFileSync(string filePath) { if (Application.platform == RuntimePlatform.WebGLPlayer || - Application.version.Contains("t") && (int)Application.platform == 0x00000032) + (Application.version.Contains("t") && (int)Application.platform == 0x00000032)) { filePath = FixFilePath(filePath); - int length = StarkReadBinFileSync(filePath); + var length = StarkReadBinFileSync(filePath); if (length == 0) { return null; } - byte[] sharedBuffer = new byte[length]; + var sharedBuffer = new byte[length]; StarkShareFileBuffer(sharedBuffer, filePath); return sharedBuffer; } - return File.ReadAllBytes(filePath); + else + { + return System.IO.File.ReadAllBytes(filePath); + } } /// - /// 从本地文件读取字符串数据(同步) + /// 从本地文件读取字符串数据(同步) /// /// 要读取的文件的路径 /// 指定读取文件的字符编码, 不能为空 @@ -549,7 +552,7 @@ namespace StarkSDKSpace } /// - /// 判断文件/目录是否存在(同步) + /// 判断文件/目录是否存在(同步) /// /// 要判断是否存在的文件/目录路径 /// 成功返回 true, 失败返回 false @@ -559,17 +562,17 @@ namespace StarkSDKSpace } /// - /// 判断文件/目录是否存在(异步) + /// 判断文件/目录是否存在(异步) /// /// public override void Access(AccessParam param) { StarkAccessFile(FixFilePath(param.path), StarkCallbackHandler.Add(param.success), - StarkCallbackHandler.Add(param.fail)); + StarkCallbackHandler.Add(param.fail)); } /// - /// 复制文件(同步) + /// 复制文件(同步) /// /// 源文件路径 /// 目标文件路径 @@ -580,29 +583,29 @@ namespace StarkSDKSpace } /// - /// 复制文件(异步) + /// 复制文件(异步) /// /// public override void CopyFile(CopyFileParam param) { StarkCopyFile(FixFilePath(param.srcPath), FixFilePath(param.destPath), - StarkCallbackHandler.Add(param.success), - StarkCallbackHandler.Add(param.fail)); + StarkCallbackHandler.Add(param.success), + StarkCallbackHandler.Add(param.fail)); } /// - /// 重命名文件(异步) + /// 重命名文件(异步) /// /// public override void RenameFile(RenameFileParam param) { StarkRenameFile(FixFilePath(param.srcPath), FixFilePath(param.destPath), - StarkCallbackHandler.Add(param.success), - StarkCallbackHandler.Add(param.fail)); + StarkCallbackHandler.Add(param.success), + StarkCallbackHandler.Add(param.fail)); } /// - /// 重命名文件(同步) + /// 重命名文件(同步) /// /// 源文件路径 /// 目标文件路径 @@ -613,7 +616,7 @@ namespace StarkSDKSpace } /// - /// 删除文件(同步) + /// 删除文件(同步) /// /// 源文件路径,支持本地路径 /// 成功返回空字符串,失败返回错误信息 @@ -623,33 +626,30 @@ namespace StarkSDKSpace } /// - /// 删除文件(异步) + /// 删除文件(异步) /// /// public override void Unlink(UnlinkParam param) { StarkUnlink(FixFilePath(param.filePath), StarkCallbackHandler.Add(param.success), - StarkCallbackHandler.Add(param.fail)); + StarkCallbackHandler.Add(param.fail)); } /// - /// 创建目录(异步) + /// 创建目录(异步) /// /// public override void Mkdir(MkdirParam param) { StarkMkdir(FixFilePath(param.dirPath), param.recursive, StarkCallbackHandler.Add(param.success), - StarkCallbackHandler.Add(param.fail)); + StarkCallbackHandler.Add(param.fail)); } /// - /// 创建目录(同步) + /// 创建目录(同步) /// /// 创建的目录路径 - /// - /// 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a - /// 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 - /// + /// 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 /// 成功返回空字符串,失败返回错误信息 public override string MkdirSync(string dirPath, bool recursive = false) { @@ -657,17 +657,17 @@ namespace StarkSDKSpace } /// - /// 删除目录(异步) + /// 删除目录(异步) /// /// public override void Rmdir(RmdirParam param) { StarkRmdir(FixFilePath(param.dirPath), param.recursive, StarkCallbackHandler.Add(param.success), - StarkCallbackHandler.Add(param.fail)); + StarkCallbackHandler.Add(param.fail)); } /// - /// 删除目录(同步) + /// 删除目录(同步) /// /// 创建的目录路径 /// 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件 。 @@ -678,7 +678,7 @@ namespace StarkSDKSpace } /// - /// 读取文件描述信息(同步) + /// 读取文件描述信息(同步) /// /// 文件/目录路径 /// 是否递归获取目录下的每个文件的 Stat 信息 @@ -686,7 +686,7 @@ namespace StarkSDKSpace /// 返回文件信息,如果访问失败则返回null public override StarkStatInfo StatSync(string path, bool throwException = false) { - string info = StarkStatSync(FixFilePath(path)); + var info = StarkStatSync(FixFilePath(path)); try { return JsonUtility.FromJson(info); @@ -708,29 +708,29 @@ namespace StarkSDKSpace } /// - /// 读取文件描述信息(异步) + /// 读取文件描述信息(异步) /// /// public override void Stat(StatParam param) { - string key = StarkCallbackHandler.MakeKey(); + var key = StarkCallbackHandler.MakeKey(); s_statParams.Add(key, param); StarkStat(FixFilePath(param.path), key); } /// - /// 获取保存的用户目录文件列表 + /// 获取保存的用户目录文件列表 /// /// public override void GetSavedFileList(GetSavedFileListParam param) { - string key = StarkCallbackHandler.MakeKey(); + var key = StarkCallbackHandler.MakeKey(); s_getSavedFileListParams.Add(key, param); StarkGetSavedFileList(key); } /// - /// 根据url链接获取本地缓存文件路径 + /// 根据url链接获取本地缓存文件路径 /// /// 输入文件下载链接url /// 返回本地缓存文件路径,以scfile://user开头的路径,可以直接用这个路径访问该文件 @@ -740,13 +740,13 @@ namespace StarkSDKSpace } /// - /// 判断该url是否有本地缓存文件 + /// 判断该url是否有本地缓存文件 /// /// 输入文件下载链接url /// 如果存在缓存文件则返回true,不存在缓存文件则返回false public override bool IsUrlCached(string url) { - string path = GetLocalCachedPathForUrl(url); + var path = GetLocalCachedPathForUrl(url); return !string.IsNullOrEmpty(path) && AccessSync(path); } } diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Input.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Input.meta index dab500b..fefcc27 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Input.meta +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Input.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a474166c9e4394ad69a139644700a8f3 +guid: f024022e5aea54bffa1b740b13a36762 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Input/Input.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Input/Input.cs index 288171c..5b64c17 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Input/Input.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Input/Input.cs @@ -1,4 +1,5 @@ #if UNITY_WEBGL && STARK_UNITY_INPUT_OVERRIDE + using UnityEngine; using UnityEngine.EventSystems; diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Network.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Network.meta index b330b27..98240ae 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Network.meta +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Network.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: da595249a8bbe472d877a0fb6911d7b7 +guid: 4c849e73f27be457799df6755443b71b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Network/StarkUDPSocketHandler.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Network/StarkUDPSocketHandler.cs index 80eb9dc..63a311a 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Network/StarkUDPSocketHandler.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/Network/StarkUDPSocketHandler.cs @@ -3,6 +3,8 @@ #endif using System; +using UnityEngine; + #if STARK_UDP_ENABLED using System.Runtime.InteropServices; using AOT; @@ -14,15 +16,15 @@ namespace StarkSDKSpace.Network { #if UNITY_EDITOR - public const string NotImplMessage = "Stark UDP Socket not supported on Unity Editor. Test it with Douyin App."; + public const string NotImplMessage = "Stark UDP Socket not supported on Unity Editor. Test it with Douyin App."; #elif UNITY_ANDROID public const string NotImplMessage = "Stark UDP Socket not supported on Android Native."; #else public const string NotImplMessage = "Stark UDP Socket not supported on current platform."; #endif - + public delegate void StarkUDPSocketOnMessageCallback(string instanceId, IntPtr ptrMsg, int lenMsg, - IntPtr ptrLocalInfo, IntPtr ptrRemoteInfo); + IntPtr ptrLocalInfo, IntPtr ptrRemoteInfo); #if STARK_UDP_ENABLED [DllImport("__Internal")] @@ -33,7 +35,7 @@ namespace StarkSDKSpace.Network throw new NotSupportedException(NotImplMessage); } #endif - + #if STARK_UDP_ENABLED [DllImport("__Internal")] public static extern void StarkUDPSocketClose(string id); @@ -43,7 +45,7 @@ namespace StarkSDKSpace.Network throw new NotSupportedException(NotImplMessage); } #endif - + #if STARK_UDP_ENABLED [DllImport("__Internal")] public static extern void StarkUDPSocketConnect(string id, string option); @@ -63,7 +65,7 @@ namespace StarkSDKSpace.Network throw new NotSupportedException(NotImplMessage); } #endif - + #if STARK_UDP_ENABLED [DllImport("__Internal")] public static extern void StarkUDPSocketOffClose(string id); @@ -73,7 +75,7 @@ namespace StarkSDKSpace.Network throw new NotSupportedException(NotImplMessage); } #endif - + #if STARK_UDP_ENABLED [DllImport("__Internal")] public static extern void StarkUDPSocketOnError(string id); @@ -83,7 +85,7 @@ namespace StarkSDKSpace.Network throw new NotSupportedException(NotImplMessage); } #endif - + #if STARK_UDP_ENABLED [DllImport("__Internal")] public static extern void StarkUDPSocketOffError(string id); @@ -113,7 +115,7 @@ namespace StarkSDKSpace.Network throw new NotSupportedException(NotImplMessage); } #endif - + #if STARK_UDP_ENABLED [DllImport("__Internal")] public static extern void StarkUDPSocketOnMessage(string id, bool needInfo); @@ -123,7 +125,7 @@ namespace StarkSDKSpace.Network throw new NotSupportedException(NotImplMessage); } #endif - + #if STARK_UDP_ENABLED [DllImport("__Internal")] public static extern void StarkUDPSocketOffMessage(string id); @@ -133,7 +135,7 @@ namespace StarkSDKSpace.Network throw new NotSupportedException(NotImplMessage); } #endif - + #if STARK_UDP_ENABLED [DllImport("__Internal", EntryPoint = "StarkUDPSocketSendString")] public static extern void StarkUDPSocketSend(string id, string data, string param); @@ -143,7 +145,7 @@ namespace StarkSDKSpace.Network throw new NotSupportedException(NotImplMessage); } #endif - + #if STARK_UDP_ENABLED [DllImport("__Internal", EntryPoint = "StarkUDPSocketSendBuffer")] public static extern void StarkUDPSocketSend(string id, byte[] data, int dataLength, string param); @@ -153,7 +155,7 @@ namespace StarkSDKSpace.Network throw new NotSupportedException(NotImplMessage); } #endif - + #if STARK_UDP_ENABLED [DllImport("__Internal")] public static extern void StarkUDPSocketSetTTL(string id, double ttl); @@ -163,7 +165,7 @@ namespace StarkSDKSpace.Network throw new NotSupportedException(NotImplMessage); } #endif - + #if STARK_UDP_ENABLED [DllImport("__Internal")] public static extern int StarkUDPSocketBind(string id, string param); @@ -173,7 +175,7 @@ namespace StarkSDKSpace.Network throw new NotSupportedException(NotImplMessage); } #endif - + #if STARK_UDP_ENABLED [DllImport("__Internal")] public static extern int StarkUDPSocketDestroy(string id); @@ -183,7 +185,7 @@ namespace StarkSDKSpace.Network throw new NotSupportedException(NotImplMessage); } #endif - + #if STARK_UDP_ENABLED [DllImport("__Internal")] public static extern void StarkRegisterUDPSocketOnMessageCallback(StarkUDPSocketOnMessageCallback callback); @@ -198,9 +200,9 @@ namespace StarkSDKSpace.Network [MonoPInvokeCallback(typeof(StarkUDPSocketOnMessageCallback))] #endif public static void _UDPSocketOnMessageCallback(string instanceId, IntPtr ptrMsg, int lenMsg, - IntPtr ptrLocalInfo, IntPtr ptrRemoteInfo) + IntPtr ptrLocalInfo, IntPtr ptrRemoteInfo) { - _messageCallback.Invoke(instanceId, ptrMsg, lenMsg, ptrLocalInfo, ptrRemoteInfo); + _messageCallback.Invoke(instanceId, ptrMsg, lenMsg, ptrLocalInfo, ptrRemoteInfo); } private static Action _messageCallback; diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkCallbackHandler.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkCallbackHandler.cs index c4e9f45..ec1e9cd 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkCallbackHandler.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkCallbackHandler.cs @@ -4,11 +4,11 @@ using UnityEngine; namespace StarkSDKSpace { - internal class StarkCallbackHandler + class StarkCallbackHandler { private static readonly Hashtable responseHT = new Hashtable(); - private static int htCounter; + private static int htCounter = 0; private static int GenarateCallbackId() { @@ -27,7 +27,7 @@ namespace StarkSDKSpace { return ""; } - string key = MakeKey(); + var key = MakeKey(); responseHT.Add(key, callback); return key; } @@ -35,9 +35,9 @@ namespace StarkSDKSpace public static string MakeKey() { int id = GenarateCallbackId(); - var ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0); - long timestamp = Convert.ToInt64(ts.TotalSeconds); - string key = timestamp.ToString() + '-' + id; + TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0); + var timestamp = Convert.ToInt64(ts.TotalSeconds); + var key = timestamp.ToString() + '-' + id; return key; } @@ -45,8 +45,8 @@ namespace StarkSDKSpace { if (!string.IsNullOrEmpty(str)) { - var res = JsonUtility.FromJson(str); - string id = res.callbackId; + T res = JsonUtility.FromJson(str); + var id = res.callbackId; Callback(id, res); } @@ -56,7 +56,7 @@ namespace StarkSDKSpace { if (responseHT.ContainsKey(id)) { - Action callback = (Action)responseHT[id]; + var callback = (Action) responseHT[id]; callback(res); responseHT.Remove(id); } diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkModel.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkModel.cs index 56ab116..f7eb8e7 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkModel.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkModel.cs @@ -1,29 +1,27 @@ -using System; - -namespace StarkSDKSpace +namespace StarkSDKSpace { public class StarkBaseResponse { public string callbackId; //回调id,调用者不需要关注 - public int errCode; public string errMsg; + public int errCode; } public class StarkBaseActionParam { - public Action fail; //接口调用失败的回调函数 - public Action success; //接口调用成功的回调函数 + public System.Action success; //接口调用成功的回调函数 + public System.Action fail; //接口调用失败的回调函数 } public class StarkReadFileResponse : StarkBaseResponse { /// - /// 如果返回二进制,则数据在这个字段 + /// 如果返回二进制,则数据在这个字段 /// public byte[] binData; /// - /// 如果返回的是字符串,则数据在这个字段 + /// 如果返回的是字符串,则数据在这个字段 /// public string stringData; } @@ -41,13 +39,12 @@ namespace StarkSDKSpace public class MkdirParam : StarkBaseActionParam { /// - /// 创建的目录路径 (本地路径) + /// 创建的目录路径 (本地路径) /// public string dirPath; /// - /// 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b - /// 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 + /// 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 /// public bool recursive = false; } @@ -55,76 +52,76 @@ namespace StarkSDKSpace public class RmdirParam : StarkBaseActionParam { /// - /// 删除的目录路径 (本地路径) + /// 删除的目录路径 (本地路径) /// public string dirPath; /// - /// 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。 + /// 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。 /// public bool recursive = false; } public class CopyFileParam : StarkBaseActionParam { - public string destPath; public string srcPath; + public string destPath; } public class RenameFileParam : StarkBaseActionParam { - public string destPath; public string srcPath; + public string destPath; } public class WriteFileParam : StarkBaseActionParam { - /// - /// 要写入的二进制数据 - /// - public byte[] data; - /// - /// 要写入的文件路径 (本地路径) + /// 要写入的文件路径 (本地路径) /// public string filePath; + + /// + /// 要写入的二进制数据 + /// + public byte[] data; } public class WriteFileStringParam : StarkBaseActionParam { + /// + /// 要写入的文件路径 (本地路径) + /// + public string filePath; /// - /// 要写入的二进制数据 + /// 要写入的二进制数据 /// public string data; /// - /// 指定写入文件的字符编码 + /// 指定写入文件的字符编码 /// public string encoding = "utf8"; - /// - /// 要写入的文件路径 (本地路径) - /// - public string filePath; } public class ReadFileParam : StarkBaseActionParam { - /// - /// 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 - /// - public string encoding; - /// - /// 要读取的文件的路径 (本地路径) + /// 要读取的文件的路径 (本地路径) /// public string filePath; + + /// + /// 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 + /// + public string encoding; } public class StatParam : StarkBaseActionParam { /// - /// 文件/目录路径 + /// 文件/目录路径 /// public string path; } @@ -135,10 +132,10 @@ namespace StarkSDKSpace public class StarkReadFileCallback : StarkBaseResponse { - public int byteLength; public string data; + public int byteLength; } - + public class StarkGetSavedFileListResponse : StarkBaseResponse { public StarkFileInfo[] fileList; @@ -151,18 +148,18 @@ namespace StarkSDKSpace public class StarkBaseFileInfo { - /// - /// 文件的类型和存取的权限 - /// - public int mode; - /// - /// 文件大小,单位:B + /// 文件大小,单位:B /// public long size; /// - /// 判断当前文件是否一个普通文件 + /// 文件的类型和存取的权限 + /// + public int mode; + + /// + /// 判断当前文件是否一个普通文件 /// /// 是普通文件返回true,不是则返回false public bool IsFile() @@ -171,7 +168,7 @@ namespace StarkSDKSpace } /// - /// 判断当前文件是否一个目录 + /// 判断当前文件是否一个目录 /// /// 是目录返回true,不是则返回false public bool IsDirectory() @@ -183,12 +180,12 @@ namespace StarkSDKSpace public class StarkFileInfo : StarkBaseFileInfo { /// - /// 文件创建时间 + /// 文件创建时间 /// public long createTime; /// - /// 文件路径 + /// 文件路径 /// public string filePath; } @@ -196,12 +193,12 @@ namespace StarkSDKSpace public class StarkStatInfo : StarkBaseFileInfo { /// - /// 文件最近一次被存取或被执行的时间 + /// 文件最近一次被存取或被执行的时间 /// public long lastAccessedTime; /// - /// 文件最后一次被修改的时间 + /// 文件最后一次被修改的时间 /// public long lastModifiedTime; } diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkStorageManager.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkStorageManager.cs index 5a81f86..9d4c8de 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkStorageManager.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkStorageManager.cs @@ -1,3 +1,6 @@ +using System.Runtime.InteropServices; +using UnityEngine.Scripting; + namespace StarkSDKSpace { public static class StarkStorage @@ -51,7 +54,7 @@ namespace StarkSDKSpace [DllImport("__Internal")] private static extern void StarkStorageSetIntSync(string key, int value); #else - private static void StarkStorageSetIntSync(string key, int value) + static void StarkStorageSetIntSync(string key, int value) { UnityEngine.PlayerPrefs.SetInt(key, value); } @@ -61,7 +64,7 @@ namespace StarkSDKSpace [DllImport("__Internal")] private static extern int StarkStorageGetIntSync(string key, int defaultValue); #else - private static int StarkStorageGetIntSync(string key, int defaultValue) + static int StarkStorageGetIntSync(string key, int defaultValue) { return UnityEngine.PlayerPrefs.GetInt(key, defaultValue); } @@ -71,7 +74,7 @@ namespace StarkSDKSpace [DllImport("__Internal")] private static extern void StarkStorageSetStringSync(string key, string value); #else - private static void StarkStorageSetStringSync(string key, string value) + static void StarkStorageSetStringSync(string key, string value) { UnityEngine.PlayerPrefs.SetString(key, value); } @@ -82,7 +85,7 @@ namespace StarkSDKSpace [DllImport("__Internal")] private static extern string StarkStorageGetStringSync(string key, string defaultValue); #else - private static string StarkStorageGetStringSync(string key, string defaultValue) + static string StarkStorageGetStringSync(string key, string defaultValue) { return UnityEngine.PlayerPrefs.GetString(key, defaultValue); } @@ -93,7 +96,7 @@ namespace StarkSDKSpace [DllImport("__Internal")] private static extern void StarkStorageSetFloatSync(string key, float value); #else - private static void StarkStorageSetFloatSync(string key, float value) + static void StarkStorageSetFloatSync(string key, float value) { UnityEngine.PlayerPrefs.SetFloat(key, value); } @@ -104,7 +107,7 @@ namespace StarkSDKSpace [DllImport("__Internal")] private static extern float StarkStorageGetFloatSync(string key, float defaultValue); #else - private static float StarkStorageGetFloatSync(string key, float defaultValue) + static float StarkStorageGetFloatSync(string key, float defaultValue) { return UnityEngine.PlayerPrefs.GetFloat(key, defaultValue); } @@ -115,7 +118,7 @@ namespace StarkSDKSpace [DllImport("__Internal")] private static extern void StarkStorageDeleteAllSync(); #else - private static void StarkStorageDeleteAllSync() + static void StarkStorageDeleteAllSync() { UnityEngine.PlayerPrefs.DeleteAll(); } @@ -126,7 +129,7 @@ namespace StarkSDKSpace [DllImport("__Internal")] private static extern void StarkStorageDeleteKeySync(string key); #else - private static void StarkStorageDeleteKeySync(string key) + static void StarkStorageDeleteKeySync(string key) { UnityEngine.PlayerPrefs.DeleteKey(key); } @@ -137,7 +140,7 @@ namespace StarkSDKSpace [DllImport("__Internal")] private static extern bool StarkStorageHasKeySync(string key); #else - private static bool StarkStorageHasKeySync(string key) + static bool StarkStorageHasKeySync(string key) { return UnityEngine.PlayerPrefs.HasKey(key); } diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkWebGL.asmdef b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkWebGL.asmdef index 0449b1f..bddf8d4 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkWebGL.asmdef +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkWebGL.asmdef @@ -1,16 +1,16 @@ { - "name": "StarkWebGL", - "rootNamespace": "", - "references": [ - "GUID:1e8ccb870274c4d3dbd4e7aa724ad45e" - ], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false + "name": "StarkWebGL", + "rootNamespace": "", + "references": [ + "GUID:1e8ccb870274c4d3dbd4e7aa724ad45e" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false } \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkWebGLInterface.cs b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkWebGLInterface.cs index 6bfdf7d..ccba982 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkWebGLInterface.cs +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkWebGLInterface.cs @@ -1,28 +1,34 @@ +using System; using System.Runtime.InteropServices; using UnityEngine.Scripting; + [assembly: Preserve] namespace StarkSDKSpace { + public delegate void GetFontDataDelegate(IntPtr pBuffer,int length); public class StarkWebGLInterface { -#if UNITY_WEBPLAYER || UNITY_WEBGL +#if (UNITY_WEBPLAYER || UNITY_WEBGL) //以下接口为Web使用,用于调用JS代码。 [method: Preserve] [DllImport("__Internal")] public static extern void unityCallJs(string msg); - + [method: Preserve] [DllImport("__Internal")] public static extern string unityCallJsSync(string msg); - + [method: Preserve] [DllImport("__Internal")] public static extern bool h5HasAPI(string apiName); - + [method: Preserve] [DllImport("__Internal")] public static extern string unityMixCallJs(string msg); + + [DllImport("__Internal")] + public static extern void StarkGetSystemFont(GetFontDataDelegate onFontData); #else public static void unityCallJs(string msg) { @@ -42,6 +48,10 @@ namespace StarkSDKSpace { return ""; } + public static void StarkGetSystemFont(GetFontDataDelegate onFontData) + { + onFontData?.Invoke(IntPtr.Zero, 0); + } #endif } } \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/TTAssetBundle.jslib b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/TTAssetBundle.jslib new file mode 100644 index 0000000..1ffa596 --- /dev/null +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/TTAssetBundle.jslib @@ -0,0 +1,37 @@ +mergeInto(LibraryManager.library, { + StarkAbfsCheckReady: function() { + if (!window.StarkSDK || !window.StarkSDK.abfs) + return false; + return window.StarkSDK.abfs.checkReady(); + }, + StarkAbfsRegisterAssetBundleUrl: function(ptr) { + if (!window.StarkSDK) + return; + + var url = UTF8ToString(ptr); + window.StarkSDK.abfs.registerAssetBundleUrl(url); + }, + StarkAbfsUnregisterAssetBundleUrl: function(ptr) { + if (!window.StarkSDK) + return; + + var url = UTF8ToString(ptr); + window.StarkSDK.abfs.unregisterAssetBundleUrl(url); + }, + StarkAbfsFetchBundleFromXHR: function(url, id, callback, needRetry) { + if (!window.StarkSDK) + return false; + + var _url = UTF8ToString(url); + var _id = UTF8ToString(id); + var _callback = function(code, message) { + + var len = lengthBytesUTF8(_id) + 1; + var idPtr = _malloc(len); + stringToUTF8(_id, idPtr, len); + + dynCall("viii", callback, [idPtr, code, 0]); + } + window.StarkSDK.abfs.fetchBundleFromXHR(_url, _id, _callback, needRetry); + } +}); \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/TTAssetBundle.jslib.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/TTAssetBundle.jslib.meta new file mode 100644 index 0000000..3058827 --- /dev/null +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/TTAssetBundle.jslib.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0f63b268b1354d95b8130c9b6ca787e5 +timeCreated: 1716450370 \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/package.json b/Assets/Plugins/ByteGame/com.bytedance.starksdk/package.json index 7d265d8..d4a0416 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/package.json +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/package.json @@ -1,26 +1,22 @@ + { - "displayName": "Stark SDK", - "name": "com.bytedance.starksdk", - "version": "5.52.5", - "scripts": { - "postinstall": "", - "preuninstall": "" - }, - "versions": [], - "state": "normal", - "description": "StarkSDK Plugin", - "keywords": [], - "category": "Libraries", - "links": [ - { - "label": "View Document", - "url": "https://bytedance.feishu.cn/docs/doccngutoUd3Y8P3HemS5Mq2vHe" - }, - { - "label": "View Changelog", - "url": "https://bytedance.feishu.cn/docs/doccnfO07C3R783siaLMS4VdaKd#" - } - ], - "unitySinceBuild": "*", - "unityUntilBuild": "*" + "displayName" : "Stark SDK", + "name" : "com.bytedance.starksdk", + "version" : "5.52.10", + "description" : "StarkSDK Plugin", + "keywords" : [ + ], + "category" : "Libraries", + "links" : [ + { + "label" : "View Document", + "url" : "https://bytedance.feishu.cn/docs/doccngutoUd3Y8P3HemS5Mq2vHe" + }, + { + "label" : "View Changelog", + "url" : "https://bytedance.feishu.cn/docs/doccnfO07C3R783siaLMS4VdaKd#" + } + ], + "unitySinceBuild" : "*", + "unityUntilBuild" : "*" } \ No newline at end of file diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.dll b/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.dll index 7511b00..e1dc891 100644 Binary files a/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.dll and b/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.dll differ diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.dll.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.dll.meta index 58c9c21..54a86cf 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.dll.meta +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.dll.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a06e08b42e5e84a988ccebef7e1b222b +guid: 11d57ce567a704113ba448423cd61b97 PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.xml b/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.xml index 2bb8680..f4ac242 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.xml +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.xml @@ -6,42 +6,42 @@ - Unity声音录制 + Unity声音录制 - Unity层使用的接口 + Unity层使用的接口 - 开始录屏 + 开始录屏 - 停止录屏 + 停止录屏 - 开启录制游戏声音 + 开启录制游戏声音 - 关闭录制游戏声音 + 关闭录制游戏声音 - 设置录制分辨率 + 设置录制分辨率 - Unity层使用的接口 + Unity层使用的接口 @@ -49,28 +49,28 @@ - Unity声音录制接口 + Unity声音录制接口 - Unity层使用的接口 + Unity层使用的接口 - Unity版本号,每对外升级一次,自增1,详情见 + Unity版本号,每对外升级一次,自增1,详情见 - UnityRenderEvent的回调的指针,可以通过 + UnityRenderEvent的回调的指针,可以通过 - 录制图片 + 录制图片 @@ -79,19 +79,19 @@ - 录制纹理 + 录制纹理 - 传递Unity前后台切换消息 + 传递Unity前后台切换消息 - 录音,传递PCM的float数组 + 录音,传递PCM的float数组 @@ -99,7 +99,7 @@ - 录音,传递PCM的byte数组 + 录音,传递PCM的byte数组 @@ -107,91 +107,91 @@ - 传递录音的配置参数,JSON格式 + 传递录音的配置参数,JSON格式 - 通知JNI DeAttach 当前线程,不然会引起crash + 通知JNI DeAttach 当前线程,不然会引起crash - 设置使用的音频引擎类型:0-unity,1-wwise plugin, 2-wwise mix + 设置使用的音频引擎类型:0-unity,1-wwise plugin, 2-wwise mix - 开始录屏 + 开始录屏 - 停止录屏 + 停止录屏 - 开启录制游戏声音 + 开启录制游戏声音 - 关闭录制游戏声音 + 关闭录制游戏声音 - 声音采样间隔,单位毫秒 + 声音采样间隔,单位毫秒 - 是否需要将PCM从float数组转为byte数组 + 是否需要将PCM从float数组转为byte数组 - 是否在录制中 + 是否在录制中 - 提供给Java端通过UnityPlayer.UnitySendMessage("ByteREC","NativeStopRecord","");来停止录屏 + 提供给Java端通过UnityPlayer.UnitySendMessage("ByteREC","NativeStopRecord","");来停止录屏 - 提供给Java端通过UnityPlayer.UnitySendMessage("ByteREC","NativeStartRecord","");来启动录屏 + 提供给Java端通过UnityPlayer.UnitySendMessage("ByteREC","NativeStartRecord","");来启动录屏 - 提供给Java端通过UnityPlayer.UnitySendMessage("ByteREC","StartRecord","");来触发录制 + 提供给Java端通过UnityPlayer.UnitySendMessage("ByteREC","StartRecord","");来触发录制 - 提供给Java端通过UnityPlayer.UnitySendMessage("ByteREC","NativeRecordVoice","");来设置是否录音 + 提供给Java端通过UnityPlayer.UnitySendMessage("ByteREC","NativeRecordVoice","");来设置是否录音 - 设置是否在Unity测转换PCM + 设置是否在Unity测转换PCM - 支持外部注入RT进行录制 + 支持外部注入RT进行录制 - Unity声音录制 + Unity声音录制 @@ -199,626 +199,608 @@ - 宿主枚举 + 宿主枚举 - 入口枚举 + 入口枚举 - SC的运行环境 + SC的运行环境 - Apk的版本环境 + Apk的版本环境 - 保存宿主环境变量 + 保存宿主环境变量 - 获取query字段,即小程序的启动参数,可能为空,使用时需判空 + 获取query字段,即小程序的启动参数,可能为空,使用时需判空 - 启动场景(该字段目前只有在「侧边栏」启动场景才会返回,返回的属性值为:homepage) + 启动场景(该字段目前只有在「侧边栏」启动场景才会返回,返回的属性值为:homepage) - 启动场景(该字段目前只有在「侧边栏」启动场景才会返回,返回的属性值为:homepage) + 启动场景(该字段目前只有在「侧边栏」启动场景才会返回,返回的属性值为:homepage) - 获取小程序启动时的参数,里面的参数可能为空,使用时需判空; 可以在StarkSDK.init()之后调用,确保得到非空值 + 获取小程序启动时的参数,里面的参数可能为空,使用时需判空; 可以在StarkSDK.init()之后调用,确保得到非空值 - 加速器数据回调 + 加速器数据回调 - 接入头条抖音能力的接口,在非宿主环境下,会对一些回调进行模拟 - 如果调用的函数在宿主版本不被支持,则会抛出异常 + 接入头条抖音能力的接口,在非宿主环境下,会对一些回调进行模拟 + 如果调用的函数在宿主版本不被支持,则会抛出异常 - SDK版本号 + SDK版本号 - 游戏版本号,通过该接口替换Application.version获得正确的版本号信息 + 游戏版本号,通过该接口替换Application.version获得正确的版本号信息 - 游戏发布版本号,发布版本时发布工具中指定的版本号 + 游戏发布版本号,发布版本时发布工具中指定的版本号 - 设置Container初始化成功的回调。获取宿主及入口信息 - 需要在调用其他api之前调用 - 非Container下不会有此回调 - version : 1.0.0 + 设置Container初始化成功的回调。获取宿主及入口信息 + 需要在调用其他api之前调用 + 非Container下不会有此回调 + version : 1.0.0 初始化完成的回调. - 获取录屏相关接口 + 获取录屏相关接口 StarkGameRecorder - 提前向用户发出授权请求。该方法不会调用对应接口,只会弹框咨询用户是否授权或者获取用户信息。如果用户之前有授权,该接口直接返回成功,不会跟用户产生交互。 + 提前向用户发出授权请求。该方法不会调用对应接口,只会弹框咨询用户是否授权或者获取用户信息。如果用户之前有授权,该接口直接返回成功,不会跟用户产生交互。 - 需要预授权的 scope,详见 - https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/open-capacity/user-information/authorization/authorization/ - + 需要预授权的 scope,详见 https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/open-capacity/user-information/authorization/authorization/ 接口调用成功的回调函数 - 接口调用失败的回调函数 + 接口调用失败的回调函数 - 需要白名单 - 获取 RtcEngine 实例(包含音视频应用程序调用的主要方法的接口类实例),应当只调用一次。第二次调用getRtcEngine - 时,实际获取的还是上次那个 + 需要白名单 + 获取 RtcEngine 实例(包含音视频应用程序调用的主要方法的接口类实例),应当只调用一次。第二次调用getRtcEngine 时,实际获取的还是上次那个 StarkRTCManager - 广告相关接口 + 广告相关接口 StarkAdManager - 网络请求接口 + 网络请求接口 StarkAdManager - 控制sdk中的Log级别 + 控制sdk中的Log级别 - 获取小程序启动时的参数,里面的参数可能为空,使用时需判空; 可以在StarkSDK.init()之后调用,确保得到非空值 + 获取小程序启动时的参数,里面的参数可能为空,使用时需判空; 可以在StarkSDK.init()之后调用,确保得到非空值 - 账号模块 + 账号模块 - 获取container sdk 版本号 like "1.0.0" + 获取container sdk 版本号 like "1.0.0" - 关注抖音号 - 需要在开发者平台-设置中绑定抖音号 + 关注抖音号 + 需要在开发者平台-设置中绑定抖音号 完成打开抖音号的回调。涉及用户信息,无法获取用户是否关注了抖音号的状态 打开抖音号失败的回调。errCode: - 当关注抖音号失败,是否显示Toast弹窗提示,默认显示 - CODE_ERROR = -1 - CODE_NOT_SUPPORT = -2 - CODE_NOT_LOGIN = -3 - CODE_NO_ACTIVITY = -4 - CODE_UID_ERROR = -5 + 当关注抖音号失败,是否显示Toast弹窗提示,默认显示 + CODE_ERROR = -1 + CODE_NOT_SUPPORT = -2 + CODE_NOT_LOGIN = -3 + CODE_NO_ACTIVITY = -4 + CODE_UID_ERROR = -5 - 创建快捷方式 + 创建快捷方式 - 创建快捷方式回调,参数为是否成功,true表示成功,false表示失败 - 当创建失败,是否显示Toast弹窗提示,默认显示 + 创建快捷方式回调,参数为是否成功,true表示成功,false表示失败 + 当创建失败,是否显示Toast弹窗提示,默认显示 - 快捷方式是否已经创建 + 快捷方式是否已经创建 - 是否存在的回调,参数表示是否已创建,true表示已创建,false表示未创建 + 是否存在的回调,参数表示是否已创建,true表示已创建,false表示未创建 - 可以配置震动周期的手机震动接口,单位ms + 可以配置震动周期的手机震动接口,单位ms - 震动周期 like long[] pattern = {0, 100, 1000, 300}; 传入null则取消震动 - 重复次数,为-1则不重复 + 震动周期 like long[] pattern = {0, 100, 1000, 300}; 传入null则取消震动 + 重复次数,为-1则不重复 - 注意:WebGL平台下,只有两种震动:长和短。 - pattern数组参数只能传入一个数值,传入小于1000则为短震动,否则为长震动。 - 不支持取消和重复。即repeat参数无效。 + 注意:WebGL平台下,只有两种震动:长和短。 + pattern数组参数只能传入一个数值,传入小于1000则为短震动,否则为长震动。 + 不支持取消和重复。即repeat参数无效。 > - 获取分享相关接口 + 获取分享相关接口 - 是否已关注抖音号 + 是否已关注抖音号 - 是否关注的回调,参数表示是否已关注,true表示已关注,false表示未关注 + 是否关注的回调,参数表示是否已关注,true表示已关注,false表示未关注 - 是否在小程序开发者后台绑定了抖音号 + 是否在小程序开发者后台绑定了抖音号 - 是否绑定的回调,参数表示是否已绑定,true表示已绑定,false表示未绑定 + 是否绑定的回调,参数表示是否已绑定,true表示已绑定,false表示未绑定 - 获取收藏引导接口 + 获取收藏引导接口 - 接入sdk的debugpanel面板,注册一些debug命令的回调函数 + 接入sdk的debugpanel面板,注册一些debug命令的回调函数 - 支付服务接口 + 支付服务接口 - 自定义分析数据上报接口,调用后,会将数据上报到小程序开发者平台,开发者可以在小程序开发者平台中查看上报数据。使用前,需要在小程序管理后台事件中新建事件,配置好事件名与字段。 - 可参考文档 https://microapp.bytedance.com/docs/zh-CN/mini-app/data/advanced-analysis/events + 自定义分析数据上报接口,调用后,会将数据上报到小程序开发者平台,开发者可以在小程序开发者平台中查看上报数据。使用前,需要在小程序管理后台事件中新建事件,配置好事件名与字段。 + 可参考文档 https://microapp.bytedance.com/docs/zh-CN/mini-app/data/advanced-analysis/events - 事件名 - 上报的数据,默认为null key : 配置中的字段名. value(number|string|boolean) : 上报的数据 - + 事件名 + 上报的数据,默认为null key : 配置中的字段名. value(number|string|boolean) : 上报的数据 - 保存游戏数据接口,所有游戏数据保存上限50M + 保存游戏数据接口,所有游戏数据保存上限50M - 数据名 - 可序列化的数据(存档类需标记为Serializable)[见以下的例子] + 数据名 + 可序列化的数据(存档类需标记为Serializable)[见以下的例子] 保存成功返回true,否则返回false - - [Serializable] - class SaveData - { - public int IntValue = 99; - private float FloatValue = 1.0f; - public string StrValue = "My String"; - public Dictionary<String,bool> map; - public List<String> listStr; - } - SaveData sd = new SaveData(); - sd.xx = yyy; - bool ret = StarkSDK.API.Save<SaveData>(sd); - + + [Serializable] + class SaveData + { + public int IntValue = 99; + private float FloatValue = 1.0f; + public string StrValue = "My String"; + public Dictionary<String,bool> map; + public List<String> listStr; + } + SaveData sd = new SaveData(); + sd.xx = yyy; + bool ret = StarkSDK.API.Save<SaveData>(sd); + - - 加载游戏数据接口,返回数据类型需为Serializable - - 数据名 - - - SaveData loaded = StarkSDK.API.LoadSaving<SaveData>(); - + + 加载游戏数据接口,返回数据类型需为Serializable + + 数据名 + + + SaveData loaded = StarkSDK.API.LoadSaving<SaveData>(); + - 删除游戏数据接口 + 删除游戏数据接口 - 数据名 - + 数据名 + - StarkSDK.API.DeleteSaving<SaveData>(); + StarkSDK.API.DeleteSaving<SaveData>(); - 删除所有游戏数据 + 删除所有游戏数据 - 获取游戏数据磁盘总大小 + 获取游戏数据磁盘总大小 - 数据名 + 数据名 - 获取游戏跳转模块 + 获取游戏跳转模块 - 打开客服聊天页 + 打开客服聊天页 - 打开客服聊天页回调,参数为是否成功,true表示成功,false表示失败 + 打开客服聊天页回调,参数为是否成功,true表示成功,false表示失败 - 是平台提供的小游戏客服能力 + 是平台提供的小游戏客服能力 - type:(1 :小 6 客服 2 : 抖音IM - 客服(仅支持抖音))sessionFrom:(保留字段,暂时可以不填),例如{"type":1,"sessionFrom":"xxx"} - + type:(1 :小 6 客服 2 : 抖音IM 客服(仅支持抖音))sessionFrom:(保留字段,暂时可以不填),例如{"type":1,"sessionFrom":"xxx"} 打开客服页面成功或者失败回调 - 通过客服页面发起支付 - 接口说明:https://bytedance.feishu.cn/docx/doxcnUkE86LjFTFdTJREIEGT9bb + 通过客服页面发起支付 + 接口说明:https://bytedance.feishu.cn/docx/doxcnUkE86LjFTFdTJREIEGT9bb - JsonData内容如下 - buyQuantity number 必填 金币购买数量,金币数量必须满足:金币数量*金币单价 = 限定价格等级(详见下方 - buyQuantity 限制说明。开发者可以在字节小游戏平台的“支付”tab 设置游戏币单价) - customId string 必填 游戏开发者自定义的唯一订单号,订单支付成功后通过服务端支付结果回调回传 - currencyType string 非必填 币种, 目前仅为"CNY" - zoneId string 非必填 游戏服务区 id,默认值为1,开发者自定义。游戏不分大区则默认填写"1"。如果应用支持多角色,则角色 - ID 接在分区 ID 后,用"_"连接 - extraInfo string 非必填 游戏开发者自定义的其他信息,订单支付成功后通过服务端支付结果回调回传。字符串长度最大不能超过 - 256。(强烈建议传入) + JsonData内容如下 + buyQuantity number 必填 金币购买数量,金币数量必须满足:金币数量*金币单价 = 限定价格等级(详见下方 buyQuantity 限制说明。开发者可以在字节小游戏平台的“支付”tab 设置游戏币单价) + customId string 必填 游戏开发者自定义的唯一订单号,订单支付成功后通过服务端支付结果回调回传 + currencyType string 非必填 币种, 目前仅为"CNY" + zoneId string 非必填 游戏服务区 id,默认值为1,开发者自定义。游戏不分大区则默认填写"1"。如果应用支持多角色,则角色 ID 接在分区 ID 后,用"_"连接 + extraInfo string 非必填 游戏开发者自定义的其他信息,订单支付成功后通过服务端支付结果回调回传。字符串长度最大不能超过 256。(强烈建议传入) - 打开客服页成功 - 打开客服聊天页回调,参数为是否成功,true表示成功,false表示失败 + 打开客服页成功 + 打开客服聊天页回调,参数为是否成功,true表示成功,false表示失败 - 跳转到抖音视频 + 跳转到抖音视频 - 抖音视频videoId,复制抖音视频链接到浏览器即可得到 - 跳转结果,参数为是否成功,true表示成功,false表示失败 + 抖音视频videoId,复制抖音视频链接到浏览器即可得到 + 跳转结果,参数为是否成功,true表示成功,false表示失败 - 退出程序 + 退出程序 - - 是否显示退出提示对话框,true为在退出前显示二次提示对话框架,false则不显示对话框而直接退出程序 - + 是否显示退出提示对话框,true为在退出前显示二次提示对话框架,false则不显示对话框而直接退出程序 接口调用成功状态回调,true表示成功,false表示失败 - 重启小游戏 + 重启小游戏 接口调用失败时的回调 - 获取系统信息。类似小程序开发平台 tt.getSystemInfoSync 接口返回值。 - https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/device/system-information/tt-get-system-info-sync/ + 获取系统信息。类似小程序开发平台 tt.getSystemInfoSync 接口返回值。 + https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/device/system-information/tt-get-system-info-sync/ StarkSystemInfo 当前系统相关信息 - 开始监听加速度数据 + 开始监听加速度数据 加速度数据回调事件监听 接口调用状态回调,(bool success, string errMsg) => {} - 停止监听加速度数据 + 停止监听加速度数据 接口调用状态回调,(bool success, string errMsg) => {} - 获取陀螺仪接口 + 获取陀螺仪接口 - 替换敏感词 + 替换敏感词 要检查和替换的词语 回调 - int: 返回状态码,0为成功,否则为失败 - string: 错误信息 - JsonData: - audit_result int 1: 有敏感内容;2: 无敏感内容 - audit_content string 被替换的内容(无敏感内容则返回值与传入的word相同) + int: 返回状态码,0为成功,否则为失败 + string: 错误信息 + JsonData: + audit_result int 1: 有敏感内容;2: 无敏感内容 + audit_content string 被替换的内容(无敏感内容则返回值与传入的word相同) - 获取键盘管理器(仅WebGL支持) + 获取键盘管理器(仅WebGL支持) StarkKeyboard - 获取输入模块(仅 WebGL 支持) + 获取输入模块(仅 WebGL 支持) - 宿主事件监听 + 宿主事件监听 - 创建一个 UDP Socket 实例。 + 创建一个 UDP Socket 实例。 - 操作剪切板 + 操作剪切板 - 群聊相关操作 + 群聊相关操作 - 方向监听 + 方向监听 - 屏幕相关操作 + 屏幕相关操作 - - - + + + - 抖音云功能相关接口 - 可以参考 小游戏抖音云相关文档 - https://developer.open-douyin.com/docs/resource/zh-CN/developer/tools/cloud/develop-guide/invoke-sever/cloud-sdk + 抖音云功能相关接口 + 可以参考 小游戏抖音云相关文档 https://developer.open-douyin.com/docs/resource/zh-CN/developer/tools/cloud/develop-guide/invoke-sever/cloud-sdk - 侧边栏跳转相关接口 - https://bytedance.feishu.cn/docx/NkzOdcUPXo02bdxl6zqcemGinzb + 侧边栏跳转相关接口 + https://bytedance.feishu.cn/docx/NkzOdcUPXo02bdxl6zqcemGinzb - 获取菜单按钮(右上角胶囊按钮)的布局位置信息。坐标信息以屏幕左上角为原点。 - https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/api/interface/menu/tt-get-menu-button-layout/ + 获取菜单按钮(右上角胶囊按钮)的布局位置信息。坐标信息以屏幕左上角为原点。 + https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/api/interface/menu/tt-get-menu-button-layout/ - JsonData - width number 宽度,单位:px - height number 高度,单位:px - top number 上边界坐标,单位:px - right number 右边界坐标,单位:px - bottom number 下边界坐标,单位:px - left number 左边界坐标,单位:px + JsonData + width number 宽度,单位:px + height number 高度,单位:px + top number 上边界坐标,单位:px + right number 右边界坐标,单位:px + bottom number 下边界坐标,单位:px + left number 左边界坐标,单位:px - 获取系统字体,仅支持WebGL,AndroidNative方案无需调用此接口,使用默认字体时,便会自动使用系统自动字体。 + 获取系统字体,仅支持WebGL,AndroidNative方案无需调用此接口,使用默认字体时,便会自动使用系统自动字体。 字体资源回调,可为null,开发者需要做好兜底 - 自定义场景数据上报接口 + 自定义场景数据上报接口 - 场景ID,int或long类型登录抖音开放平台,进入「数据」-「性能分析」-「启动监控」-「启动场景配置」模块,进入添加事件场景,新建游戏的自定义启动场景。 - 游戏每次启动只可以上报一次 - + 场景ID,int或long类型登录抖音开放平台,进入「数据」-「性能分析」-「启动监控」-「启动场景配置」模块,进入添加事件场景,新建游戏的自定义启动场景。 游戏每次启动只可以上报一次 场景耗时,单位ms long类型 - 自定义维度数据,key在抖音开放平台获取。且序列化后长度不超过1024个字符 - 自定义指标数据,key在抖音开放平台获取。且序列化后长度不超过1024个字符 - 以上参数使用json格式传入,例如"{"sceneId":0,"costTime":10,"dimension":{},"metric":{}}" - + 自定义维度数据,key在抖音开放平台获取。且序列化后长度不超过1024个字符 + 自定义指标数据,key在抖音开放平台获取。且序列化后长度不超过1024个字符 + 以上参数使用json格式传入,例如"{"sceneId":0,"costTime":10,"dimension":{},"metric":{}}" 接口调用成功的回调函数 接口调用失败的回调函数 接口调用结束的回调函数(调用成功、失败都会执行) - 向用户请求授权允许游戏在满足一定的条件后出现在Feed流中 + 向用户请求授权允许游戏在满足一定的条件后出现在Feed流中 - 必须包含,type(strings)(订阅Feed流的类型),scene(int)订阅的场景ID(type='play'时必传))contentIDs(jsonArray) - 自定义文案ID(type='play'时必传)),例如:{"type":"play","scene":111,"contentIDs":["xxxx"]} - - 接口调用成功的回调函数, - 包含以下内容,errMsg(回调信息),success(用户的订阅结果(true为成功,false为订阅失败,具体原因看errMsg)) - + 必须包含,type(strings)(订阅Feed流的类型),scene(int)订阅的场景ID(type='play'时必传))contentIDs(jsonArray) 自定义文案ID(type='play'时必传)),例如:{"type":"play","scene":111,"contentIDs":["xxxx"]} + 接口调用成功的回调函数, 包含以下内容,errMsg(回调信息),success(用户的订阅结果(true为成功,false为订阅失败,具体原因看errMsg)) 接口调用失败的回调函数 接口调用结束的回调函数(调用成功、失败都会执行) - 查询用户的授权情况。 + 查询用户的授权情况。 - - 必须包含,type(strings)(订阅Feed流的类型),scene(int)订阅的场景ID(type='play'时必传)),例如:{"type":"play","scene":1111} - - - 接口调用成功的回调函数,包含以下内容,errMsg(回调信息),success(用户的订阅结果(true为已经订阅,false为用户未订阅)) - + 必须包含,type(strings)(订阅Feed流的类型),scene(int)订阅的场景ID(type='play'时必传)),例如:{"type":"play","scene":1111} + 接口调用成功的回调函数,包含以下内容,errMsg(回调信息),success(用户的订阅结果(true为已经订阅,false为用户未订阅)) 接口调用失败的回调函数 接口调用结束的回调函数(调用成功、失败都会执行) + + + 获取直播间管理器对象 + + - 创建mock模块 + 创建mock模块 - 获取游戏记录的Mock + 获取游戏记录的Mock - 获取广告的Mock + 获取广告的Mock - 获取分享的Mock + 获取分享的Mock - 收藏模块的Mock + 收藏模块的Mock - 获取账号模块的Mock + 获取账号模块的Mock - 获取账号模块的Mock + 获取账号模块的Mock - 本地音频播放管理器 + 本地音频播放管理器 - 创建 InnerAudioContext + 创建 InnerAudioContext - 音频资源 url 地址,也支持相对路径的地址。只支持 mp3、wav、m4a、aac 格式。 - 如果 url 地址是一个相对路径的地址,比如 Assets/Sound/music.mp3, - 那么会自动根据配置的 url 前缀拼接为完整的url:${url_prefix}/Assets/Sound/music.mp3 - 有两种方法设置 url 前缀: - 1. 构建 WebGL 时填写【游戏资源CDN】url 前缀,运行时会自动拼接为完整 url。 - 2. 通过调用 StarkAudioManager.SetAudioUrlPrefix 函数设置 url 前缀。 - 如果同时填写了【游戏资源CDN】和调用了 StarkAudioManager.SetAudioUrlPrefix 函数,默认优先使用构建时填写的【游戏资源CDN】url前缀。 + 音频资源 url 地址,也支持相对路径的地址。只支持 mp3、wav、m4a、aac 格式。 + 如果 url 地址是一个相对路径的地址,比如 Assets/Sound/music.mp3, + 那么会自动根据配置的 url 前缀拼接为完整的url:${url_prefix}/Assets/Sound/music.mp3 + 有两种方法设置 url 前缀: + 1. 构建 WebGL 时填写【游戏资源CDN】url 前缀,运行时会自动拼接为完整 url。 + 2. 通过调用 StarkAudioManager.SetAudioUrlPrefix 函数设置 url 前缀。 + 如果同时填写了【游戏资源CDN】和调用了 StarkAudioManager.SetAudioUrlPrefix 函数,默认优先使用构建时填写的【游戏资源CDN】url前缀。 - 开始播放的位置(单位:s) + 开始播放的位置(单位:s) - 是否自动播放 + 是否自动播放 - 是否自动循环 + 是否自动循环 - 当前音量,范围 0 ~ 1 + 当前音量,范围 0 ~ 1 - 播放速度。范围 0.5 ~ 2.0,默认为 1 + 播放速度。范围 0.5 ~ 2.0,默认为 1 - 是否需要下载,如果为true,则会完全下载后再触发OnCanplay + 是否需要下载,如果为true,则会完全下载后再触发OnCanplay - 音频实例上下文对象,完成对音频播放 - 同时支持Android及WebGL平台,但如果是Android下播放mp3文件,Unity引擎需要为Unity2020.1.14f1及以上版本 + 音频实例上下文对象,完成对音频播放 + 同时支持Android及WebGL平台,但如果是Android下播放mp3文件,Unity引擎需要为Unity2020.1.14f1及以上版本 - 监听音频进入可以播放状态,但不保证后面可以流畅播放 + 监听音频进入可以播放状态,但不保证后面可以流畅播放 - 监听音频播放事件 + 监听音频播放事件 - 监听音频暂停事件 + 监听音频暂停事件 - 监听音频停止播放事件 + 监听音频停止播放事件 @@ -826,166 +808,166 @@ - 监听音频播放出错事件, - (errMsg) => {} + 监听音频播放出错事件, + (errMsg) => {} - 监听音频加载中事件,当音频因为数据不足,需要停下来加载时会触发 + 监听音频加载中事件,当音频因为数据不足,需要停下来加载时会触发 - 监听音频开始进行 seek 操作的事件 + 监听音频开始进行 seek 操作的事件 - 监听音频完成 seek 操作的事件 + 监听音频完成 seek 操作的事件 - 当前音频ID + 当前音频ID - 获取音频时长,单位 s + 获取音频时长,单位 s - 获取当前播放时长,单位 s - (由于WebGL底层实现方案的原因,只能将结果异步返回) + 获取当前播放时长,单位 s + (由于WebGL底层实现方案的原因,只能将结果异步返回) (currentTime) => {} - audioContext.GetCurrentTime(value => - { + audioContext.GetCurrentTime(value => + { Debug.Log($"audio currentTime: {value} s"); - }); + }); - 获取当前音频是否是暂停状态 - (由于WebGL底层实现方案的原因,只能将结果异步返回) + 获取当前音频是否是暂停状态 + (由于WebGL底层实现方案的原因,只能将结果异步返回) (isPaused) => {} - audioContext.GetBuffered(isPaused => - { + audioContext.GetBuffered(isPaused => + { Debug.Log($"audio isPaused: {isPaused}"); - }); + }); - 获取当前已缓冲的音频长度,单位 s - (由于WebGL底层实现方案的原因,只能将结果异步返回) + 获取当前已缓冲的音频长度,单位 s + (由于WebGL底层实现方案的原因,只能将结果异步返回) - audioContext.GetBuffered(buffered => - { + audioContext.GetBuffered(buffered => + { Debug.Log($"audio buffered: {buffered} s"); - }); + }); - 内部方法(请勿调用) + 内部方法(请勿调用) - 播放音频 - 同时支持Android及WebGL平台,但如果是Android下播放mp3文件,Unity引擎需要为Unity2020.1.14f1及以上版本 + 播放音频 + 同时支持Android及WebGL平台,但如果是Android下播放mp3文件,Unity引擎需要为Unity2020.1.14f1及以上版本 - 暂停播放 + 暂停播放 - 停止播放 + 停止播放 - 销毁当前实例。销毁后该实例将不存在,如需播放需要再次创建 + 销毁当前实例。销毁后该实例将不存在,如需播放需要再次创建 - 跳转到指定位置播放 + 跳转到指定位置播放 - 音量。范围 0~1。默认为 1 + 音量。范围 0~1。默认为 1 - 静音,静音时将音量设置为 0,取消静音则恢复原来的音量 + 静音,静音时将音量设置为 0,取消静音则恢复原来的音量 - 设置是否循环播放,默认为 false + 设置是否循环播放,默认为 false - 记录已判断支持的函数 + 记录已判断支持的函数 - 记录已判断不被支持的函数 + 记录已判断不被支持的函数 - Check if UNBridge android sdk is available + Check if UNBridge android sdk is available - Validate the native method before calling it - 非Container环境下,都返回 true + Validate the native method before calling it + 非Container环境下,都返回 true - Replacement for UNbridge.Call + Replacement for UNbridge.Call native method object to be called - Replacement for UNBridge.Call with callback + Replacement for UNBridge.Call with callback native method object to be called callback object passed in - 不使用Loom调用一个Android方法 + 不使用Loom调用一个Android方法 目标接口 参数数据 - 同步Call通讯接口 + 同步Call通讯接口 消息类型0-call消息,1-listen消息,2-unlisten消息,3-event消息 目标接口 @@ -994,354 +976,353 @@ - Replacement for UNBridge.Call with callback + Replacement for UNBridge.Call with callback native method object to be called callback object passed in - Replacement for UNBridge.Call with callback with timeout + Replacement for UNBridge.Call with callback with timeout native method object to be called callback object passed in callback timeout - - Replacemenet for UNBridge.CallSync, return primitive values; - This API only support basic types: int, long, float, double, bool, string; - Default(T) will return if return type not supported! - - Define Android code as following: - - @UNBridgeMethod(sync = true) - public long testLong() { return 21474836470L; } - - - Only valide for basic types: int, long, float, double, bool, string - Native method object - return value + + Replacemenet for UNBridge.CallSync, return primitive values; + This API only support basic types: int, long, float, double, bool, string; + Default(T) will return if return type not supported! + + Define Android code as following: + + @UNBridgeMethod(sync = true) + public long testLong() { return 21474836470L; } + + + Only valide for basic types: int, long, float, double, bool, string + Native method object + return value - Convenient method to register c# API for Android + Convenient method to register c# API for Android - 关注抖音的回调 - data 内容 : - { - "errCode" : 0, 成功时为0 - “errMsg” : "", errCode不为0时,描述错误原因 - “hasFollowed” : true?false 关注抖音号结果 - } - errCode: - CODE_ERROR = -1 - CODE_NOT_SUPPORT = -2 - CODE_NOT_LOGIN = -3 - CODE_NO_ACTIVITY = -4 - CODE_UID_ERROR = -5 + 关注抖音的回调 + data 内容 : + { + "errCode" : 0, 成功时为0 + “errMsg” : "", errCode不为0时,描述错误原因 + “hasFollowed” : true?false 关注抖音号结果 + } + errCode: + CODE_ERROR = -1 + CODE_NOT_SUPPORT = -2 + CODE_NOT_LOGIN = -3 + CODE_NO_ACTIVITY = -4 + CODE_UID_ERROR = -5 - 关注回调,参数为是否关注 - 错误回调,参数为错误码 和 错误描述 + 关注回调,参数为是否关注 + 错误回调,参数为错误码 和 错误描述 - 创建快捷方式回调 - data 内容 : - { - "errCode" : 0, 成功时为0 - “errMsg” : "", errCode不为0时,描述错误原因 - } - errCode: - 1 : 取消 + 创建快捷方式回调 + data 内容 : + { + "errCode" : 0, 成功时为0 + “errMsg” : "", errCode不为0时,描述错误原因 + } + errCode: + 1 : 取消 - 创建回调,参数为是否成功 + 创建回调,参数为是否成功 - 是否可以使用 + 是否可以使用 - 打印到文件 + 打印到文件 - 初始化打印文件的变量 + 初始化打印文件的变量 - 结束打印 + 结束打印 - 文件名称 + 文件名称 - 是否需要打印栈信息 + 是否需要打印栈信息 - 是否在StarkContainer真机环境下 + 是否在StarkContainer真机环境下 - 是否显示调试Toast提示。当调用StarkSDK相关接口后,获得函数执行状态(主要是失败状态)的反馈。 - 设置为true则在调用StarkSDK相关接口后,会自动弹出Toast提示。默认不显示。【建议只在调试状态下开启】 + 是否显示调试Toast提示。当调用StarkSDK相关接口后,获得函数执行状态(主要是失败状态)的反馈。 + 设置为true则在调用StarkSDK相关接口后,会自动弹出Toast提示。默认不显示。【建议只在调试状态下开启】 - Stark_UnitySDK初始化函数 + Stark_UnitySDK初始化函数 error code : - 0 , 无错误 - 1, stark unity sdk 版本不支持 - 2,unity engine 版本不被支持 - + 0 , 无错误 + 1, stark unity sdk 版本不支持 + 2,unity engine 版本不被支持 - 判断是否运行在StarkContainer + 判断是否运行在StarkContainer - StarkSDK运行再错误的环境中 + StarkSDK运行再错误的环境中 - Hostid 转换 - 对应关系 https://bytedance.feishu.cn/sheets/shtcn959RKBOao1tFJAwEBTI1lf + Hostid 转换 + 对应关系 https://bytedance.feishu.cn/sheets/shtcn959RKBOao1tFJAwEBTI1lf HostEnum - 从Java层传输来的数据和C#层的UC运行环境之间的转换 + 从Java层传输来的数据和C#层的UC运行环境之间的转换 - 从Java层传输来的数据和C#层版本类型枚举做转换 + 从Java层传输来的数据和C#层版本类型枚举做转换 - 当游戏第一次启动以及被其他游戏拉起,或者再次拉起时调用外部摄入的回调方法,并立即写入文件 + 当游戏第一次启动以及被其他游戏拉起,或者再次拉起时调用外部摄入的回调方法,并立即写入文件 - 将Json解析成互跳信息对象 + 将Json解析成互跳信息对象 - The android bridge of the Container SDK. + The android bridge of the Container SDK. - 单例抽象类 + 单例抽象类 - 在竖屏正方向下的安全区域 + 在竖屏正方向下的安全区域 - 安全区域左上角横坐标 + 安全区域左上角横坐标 - 安全区域右下角横坐标 + 安全区域右下角横坐标 - 安全区域左上角纵坐标 + 安全区域左上角纵坐标 - 安全区域右下角纵坐标 + 安全区域右下角纵坐标 - 安全区域的宽度,单位逻辑像素 + 安全区域的宽度,单位逻辑像素 - 安全区域的高度,单位逻辑像素 + 安全区域的高度,单位逻辑像素 - 机型性能评分 + 机型性能评分 - 屏幕方向 + 屏幕方向 - 竖屏 + 竖屏 - 横屏 + 横屏 - 系统信息 + 系统信息 - 当前宿主名,如 Douyin + 当前宿主名,如 Douyin - 当前宿主版本号,如 19.2.0 + 当前宿主版本号,如 19.2.0 - StarkContainer 底层框架版本号 + StarkContainer 底层框架版本号 ,如 Apple、samsung - 手机设备制造商 + 手机设备制造商 - 手机品牌,如 iPhone 12、SM-G9880 + 手机品牌,如 iPhone 12、SM-G9880 - 操作系统,如 ios、android + 操作系统,如 ios、android - 系统版本,如 iOS 15.1.1、Android 11 + 系统版本,如 iOS 15.1.1、Android 11 - 系统语言,如 zh_CN + 系统语言,如 zh_CN - 客户端基础库版本 + 客户端基础库版本 - 设备像素比 + 设备像素比 - 屏幕高度,单位逻辑像素 + 屏幕高度,单位逻辑像素 - 屏幕宽度,单位逻辑像素 + 屏幕宽度,单位逻辑像素 - 状态栏的高度 + 状态栏的高度 - 在竖屏正方向下的安全区域 + 在竖屏正方向下的安全区域 - 机型性能评分 + 机型性能评分 - 性能数组实体 + 性能数组实体 - 判断是否运行在UC环境 + 判断是否运行在UC环境 - 埋点上报到app_log - TODO : 分离 StarkInnelAPI + 埋点上报到app_log + TODO : 分离 StarkInnelAPI - 埋点上报到app_log - TODO : 分离 StarkInnelAPI + 埋点上报到app_log + TODO : 分离 StarkInnelAPI - 读取Java侧UnityContainerConfigCenter中的配置字段,目前返回的泛型数据只支持基本类型 - bool - double - float - Int32 - Int64 - string + 读取Java侧UnityContainerConfigCenter中的配置字段,目前返回的泛型数据只支持基本类型 + bool + double + float + Int32 + Int64 + string 配置字段的类型 配置字段的key @@ -1350,70 +1331,70 @@ - 只埋点上报性能信息,由于性能信息一部分来自Java所以单独列出一个方法 + 只埋点上报性能信息,由于性能信息一部分来自Java所以单独列出一个方法 - 告知Java侧这时候可以手机CPU信息了 + 告知Java侧这时候可以手机CPU信息了 - 新的上报游戏性能信息的接口 + 新的上报游戏性能信息的接口 - Custo onCommand method register + Custo onCommand method register - Default onCommand register + Default onCommand register - callback from onCommand panel + callback from onCommand panel - Default onCommand + Default onCommand - 获取到当前的性能数据 + 获取到当前的性能数据 - 更新需要上报的数据 + 更新需要上报的数据 当前统计到的最新的数据 - 计算平均表现 + 计算平均表现 结果值 - 获取用户存档空间 + 获取用户存档空间 - 判断当前SC版本是否大于等于给定的版本 + 判断当前SC版本是否大于等于给定的版本 主版本号 中间版本号 @@ -1421,7 +1402,7 @@ - 获取小游戏Settings, 适用版本 >= 5.31.0 + 获取小游戏Settings, 适用版本 >= 5.31.0 获取的数据key 是否使用缓存 @@ -1429,40 +1410,40 @@ - 获取应用信息:schema、appid、接口黑白名单、应用版本、应用 pkg 类型、应用技术形态, 适用版本 > 5.32.0 + 获取应用信息:schema、appid、接口黑白名单、应用版本、应用 pkg 类型、应用技术形态, 适用版本 > 5.32.0 是否需要session字段 - 游戏版本号是从AndroidManifest.xml解析出来 + 游戏版本号是从AndroidManifest.xml解析出来 - 游戏发布版本号,发布版本时发布工具中指定的版本号 + 游戏发布版本号,发布版本时发布工具中指定的版本号 - 根据CI填写 + 根据CI填写 - Container的Version + Container的Version - RTC模块 + RTC模块 - 登录 + 登录 @@ -1470,309 +1451,308 @@ - 检查当前session是否有效 + 检查当前session是否有效 - 获取当前的用户信息 + 获取当前的用户信息 - 判断用户是否已经授权给当前游戏读取个人信息 - 该API会调用宿主的代码,如果调用宿主代码成功则会调用onGetUserInfoAuth,并返回是否已经授权 - 如果调用宿主代码失败则会调用onGetUserInfoAuthFail + 判断用户是否已经授权给当前游戏读取个人信息 + 该API会调用宿主的代码,如果调用宿主代码成功则会调用onGetUserInfoAuth,并返回是否已经授权 + 如果调用宿主代码失败则会调用onGetUserInfoAuthFail - 主动打开获取用户信息的授权界面 - 该API会调用宿主的代码,如果调用宿主代码成功则会调用onGetUserInfoAuth,并返回最新的授权状态 - 如果调用宿主代码失败则会调用onGetUserInfoAuthFail + 主动打开获取用户信息的授权界面 + 该API会调用宿主的代码,如果调用宿主代码成功则会调用onGetUserInfoAuth,并返回最新的授权状态 + 如果调用宿主代码失败则会调用onGetUserInfoAuthFail - 用户在实名认证弹窗完成实名认证后回调 - 必须在游戏初始化阶段就调用 + 用户在实名认证弹窗完成实名认证后回调 + 必须在游戏初始化阶段就调用 - 广告管理模块,请求,播放激励视屏广告 - 其他类型广告待实现 + 广告管理模块,请求,播放激励视屏广告 + 其他类型广告待实现 - 设置激励视频广告的回调。获取完整的回调信息,一般处理都可以通过ShowVideoAd完成,评估必要性 + 设置激励视频广告的回调。获取完整的回调信息,一般处理都可以通过ShowVideoAd完成,评估必要性 已播放时长. - video ad state. - Usually only state of `VideoAdState.Loaded` means it is properly loaded. + video ad state. + Usually only state of `VideoAdState.Loaded` means it is properly loaded. - 根据广告错误判断是否需要retry + 根据广告错误判断是否需要retry - 广告是否加载完成 + 广告是否加载完成 - 初始化 + 初始化 - 请求加载激励视频广告 + 请求加载激励视频广告 - 加载广告,并在某些错误情况下进行有限次重试 + 加载广告,并在某些错误情况下进行有限次重试 - 异步请求并显示广告 + 异步请求并显示广告 - 转换服务端 返回的 json 数据, 主要处理 id 和 date 数据 + 转换服务端 返回的 json 数据, 主要处理 id 和 date 数据 - 指定要返回的字段 - Field 示例 - 1. 指定返回doc中字段a,b, projection设置为{a: true, b:true} - 2. 嵌套的字段 {a.b : true} + 指定要返回的字段 + Field 示例 + 1. 指定返回doc中字段a,b, projection设置为{a: true, b:true} + 2. 嵌套的字段 {a.b : true} - 上传下载国产回调逻辑 + 上传下载国产回调逻辑 - 未进行视频裁剪 + 未进行视频裁剪 - 视频裁剪中 + 视频裁剪中 - 视频裁剪完成 + 视频裁剪完成 - 视频裁剪失败 + 视频裁剪失败 - 开始录屏回调 + 开始录屏回调 - 录屏完成回调 + 录屏完成回调 - 录屏失败回调 + 录屏失败回调 - 录屏超时回调 + 录屏超时回调 - 视频裁剪成功回调 + 视频裁剪成功回调 - 视频裁剪失败回调 + 视频裁剪失败回调 - 视频分享成功回调 + 视频分享成功回调 - 视频分享失败回调 + 视频分享失败回调 - 视频分享取消回调 + 视频分享取消回调 - 视频录制状态 + 视频录制状态 - 视频裁剪状态 + 视频裁剪状态 - 视频分享状态 + 视频分享状态 - 录制完成后的视频路径 + 录制完成后的视频路径 - 裁剪后的视频路径 + 裁剪后的视频路径 - 自助配乐 + 自助配乐 - 录屏开启状态,-1未知,0未开启,1开启。 + 录屏开启状态,-1未知,0未开启,1开启。 - 设置录屏是否开启 + 设置录屏是否开启 - 获取录屏开启状态 + 获取录屏开启状态 返回true则表示录屏开启,返回false为录屏关闭 - 开始录屏 - 是否录制声音,默认为录制声音 - 最大录制时长,单位 s。小于等于 0 则无限制。默认为10分钟 - 视频录制开始回调 - 视频录制失败回调 - 录屏超时回调 + 开始录屏 + 是否录制声音,默认为录制声音 + 最大录制时长,单位 s。小于等于 0 则无限制。默认为10分钟 + 视频录制开始回调 + 视频录制失败回调 + 录屏超时回调 函数调用状态,调用成功返回true,否则返回false - WebGL开始录屏 - 视频录制开始回调 - 视频录制失败回调 + WebGL开始录屏 + 视频录制开始回调 + 视频录制失败回调 - 获取录屏时长 + 获取录屏时长 返回录屏时长,单位 ms - 视频裁剪 + 视频裁剪 需要裁剪的时间片段,允许为null或空列表,如果列表为null或空, - 则默认使用RecordClip调用记录的时间片段,会对重合的时间进行合并,然后进行视频裁剪。 - 如果不为空,则按传入的裁剪片段进行视频裁剪,时间片段重叠不会进行合并。主要用于乱序拼接。 - + 则默认使用RecordClip调用记录的时间片段,会对重合的时间进行合并,然后进行视频裁剪。 + 如果不为空,则按传入的裁剪片段进行视频裁剪,时间片段重叠不会进行合并。主要用于乱序拼接。 函数调用状态,调用成功返回true,否则返回false - 分享视频 + 分享视频 - 获取录屏状态 + 获取录屏状态 VideoRecordState - 获取视频分享状态 + 获取视频分享状态 VideoShareState - 输入模块 + 输入模块 - 触摸事件回调 + 触摸事件回调 - 是否注册了 JS 层的 Touch 事件 - 只有注册后,上层才能收到监听 + 是否注册了 JS 层的 Touch 事件 + 只有注册后,上层才能收到监听 - 设定触摸事件监听有变更 + 设定触摸事件监听有变更 - 开始监听 JS 层触摸事件 + 开始监听 JS 层触摸事件 - 停止监听 JS 层触摸事件 + 停止监听 JS 层触摸事件 - 分发 JS 层触摸事件到注册的 Handler + 分发 JS 层触摸事件到注册的 Handler @@ -1782,7 +1762,7 @@ - 创建事件 Handler 实例 + 创建事件 Handler 实例 @@ -1790,25 +1770,25 @@ - 响应 UNBridge 回调 + 响应 UNBridge 回调 - 构造函数 + 构造函数 - 获取上一次的拉起信息 + 获取上一次的拉起信息 - 判断自己本身是否被其他游戏拉起 + 判断自己本身是否被其他游戏拉起 @@ -1816,12 +1796,12 @@ - 初始化 + 初始化 - 跳转至某个游戏 + 跳转至某个游戏 @@ -1829,12 +1809,12 @@ - 保存导航信息 + 保存导航信息 - 调用从互调返回时的回调函数 + 调用从互调返回时的回调函数 游戏id 游玩时间 @@ -1842,12 +1822,12 @@ - 从服务器拉取互跳信息 + 从服务器拉取互跳信息 - 保存一个互跳信息 + 保存一个互跳信息 游戏id 自定义的query值 @@ -1857,24 +1837,24 @@ - 保存自定义信息,用于传递给上一个拉起自己的游戏 + 保存自定义信息,用于传递给上一个拉起自己的游戏 - 监听自己本身是否被其他游戏拉起 + 监听自己本身是否被其他游戏拉起 - Dic的扩展方法 + Dic的扩展方法 - 当游戏Activity#OnResume的方法被调用时调用该C#方法 + 当游戏Activity#OnResume的方法被调用时调用该C#方法 @@ -1883,98 +1863,97 @@ - OK + OK - 禁止录屏 + 禁止录屏 - 录屏SDK未初始化 + 录屏SDK未初始化 - 视频文件不存在 + 视频文件不存在 - 开始录屏错误 + 开始录屏错误 - 视频裁剪失败 + 视频裁剪失败 - 视频分享失败 + 视频分享失败 - 视频分享取消 + 视频分享取消 - 视频文件异常 + 视频文件异常 - 广告模块未初始化 + 广告模块未初始化 - 广告ID为空 + 广告ID为空 - 广告模块异常 + 广告模块异常 - 广告加载失败 + 广告加载失败 - 加速器数据回调 + 加速器数据回调 - RTC连麦接口模块 - rtc 连麦 接口文档:https://bytedance.feishu.cn/docx/doxcnKNEvQGmLTwupIvWDSqh1nd + RTC连麦接口模块 + rtc 连麦 接口文档:https://bytedance.feishu.cn/docx/doxcnKNEvQGmLTwupIvWDSqh1nd - 需要白名单 - 获取 RtcEngine 实例(包含音视频应用程序调用的主要方法的接口类实例),应当只调用一次, - 重复调用返回上次创建的,destroy后则重新创建。 + 需要白名单 + 获取 RtcEngine 实例(包含音视频应用程序调用的主要方法的接口类实例),应当只调用一次, 重复调用返回上次创建的,destroy后则重新创建。 - rtc服务使用的appId, 不是你的游戏的appid + rtc服务使用的appId, 不是你的游戏的appid - 销毁EtcEngine实例 + 销毁EtcEngine实例 成功回调 失败回调 - 加入到通信房间 + 加入到通信房间 加入语音频道的id 加入语音频道用户的唯一标识,建议统一使用当前用户的 openId/匿名 openId @@ -1984,7 +1963,7 @@ - 离开当前频道 + 离开当前频道 成功回调 失败回调 @@ -1992,7 +1971,7 @@ - 开启内部音频采集。默认为关闭状态。 + 开启内部音频采集。默认为关闭状态。 成功回调 失败回调 @@ -2000,7 +1979,7 @@ - 关闭本地麦克风推流 + 关闭本地麦克风推流 成功回调 失败回调 @@ -2008,15 +1987,15 @@ - 控制本地音频流的发送状态:不发送 - 使用此方法后,房间中的其他用户会收到回调: OnUserMuteAudio + 控制本地音频流的发送状态:不发送 + 使用此方法后,房间中的其他用户会收到回调: OnUserMuteAudio 执行结果,true为成功,false为失败 - 控制本地音频流的发送状态:发送 - 使用此方法后,房间中的其他用户会收到回调: OnUserMuteAudio + 控制本地音频流的发送状态:发送 + 使用此方法后,房间中的其他用户会收到回调: OnUserMuteAudio 成功回调 失败回调 @@ -2024,7 +2003,7 @@ - 针对当前设备,静音远端用户音频流 + 针对当前设备,静音远端用户音频流 成功回调 失败回调 @@ -2032,7 +2011,7 @@ - 针对当前设备,取消静音远端用户音频流 + 针对当前设备,取消静音远端用户音频流 成功回调 失败回调 @@ -2040,7 +2019,7 @@ - 针对当前设备,静音所有远端用户音频流 + 针对当前设备,静音所有远端用户音频流 成功回调 失败回调 @@ -2048,7 +2027,7 @@ - 针对当前设备,取消静音所有远端用户音频流 + 针对当前设备,取消静音所有远端用户音频流 成功回调 失败回调 @@ -2056,223 +2035,215 @@ - 调节播放音量(该方法只能加入房间成功后调用才生效) + 调节播放音量(该方法只能加入房间成功后调用才生效) 音量可在0~400范围内进行调节 - - 0 : 静音 - - 100 : 原始音量 - - 400 : 最大可为原始音量的 2 倍(自带溢出保护) - + - 0 : 静音 + - 100 : 原始音量 + - 400 : 最大可为原始音量的 2 倍(自带溢出保护) 成功回调 失败回调 执行结果,true为成功,false为失败 - 调节录音音量,采集麦克风的音量(该方法只能加入房间成功后调用才生效) + 调节录音音量,采集麦克风的音量(该方法只能加入房间成功后调用才生效) 音量可在0~400范围内进行调节 - - 0 : 静音 - - 100 : 原始音量 - - 400 : 最大可为原始音量的 2 倍(自带溢出保护) - + - 0 : 静音 + - 100 : 原始音量 + - 400 : 最大可为原始音量的 2 倍(自带溢出保护) 成功回调 失败回调 执行结果,true为成功,false为失败 - 该方法启用说话者音量提示。调用该方法后,将收到 audioVolumeIndication 事件回调。该方法只有在joinChannel之后才生效 + 该方法启用说话者音量提示。调用该方法后,将收到 audioVolumeIndication 事件回调。该方法只有在joinChannel之后才生效 收到音量提示回调的时间间隔 - + ≤ 0:禁用音量提示功能。 - + > 0:启用音量提示功能,并设置收到音量提示回调的时间间隔。单位为毫秒。 - 建议设置为大于等于 200 毫秒;小于 10 毫秒时,行为未定义。 - + + ≤ 0:禁用音量提示功能。 + + > 0:启用音量提示功能,并设置收到音量提示回调的时间间隔。单位为毫秒。 + 建议设置为大于等于 200 毫秒;小于 10 毫秒时,行为未定义。 成功回调 失败回调 执行结果,true为成功,false为失败 - 取消 RtcEngine,on 监听的所有event类型事件。当event - 为空的时候,会移除所有RtcEngine上的事件监听。可传入参数如下,分别对应上面事件。当不传入时,默认移除所有事件监听 + 取消 RtcEngine,on 监听的所有event类型事件。当event 为空的时候,会移除所有RtcEngine上的事件监听。可传入参数如下,分别对应上面事件。当不传入时,默认移除所有事件监听 - 监听列表 + 监听列表 - 首次加入房间成功。用户手动调用 JoinRoom,收到加入成功。 - 加入房间失败没有单独的事件,需要通过onerror 判断 + 首次加入房间成功。用户手动调用 JoinRoom,收到加入成功。 + 加入房间失败没有单独的事件,需要通过onerror 判断 - 重新加入房间。用户网络较差,失去与服务器的连接,进行重连时收到加入成功。 + 重新加入房间。用户网络较差,失去与服务器的连接,进行重连时收到加入成功。 - 当收到网络质量报告时回调该事件 + 当收到网络质量报告时回调该事件 - 远端可见用户加入房间的回调。 - 远端可见用户断网后重新连入房间时,房间内其他用户将收到该事件。 - 新进房用户会收到进房前已在房内的可见用户的进房回调通知。 + 远端可见用户加入房间的回调。 + 远端可见用户断网后重新连入房间时,房间内其他用户将收到该事件。 + 新进房用户会收到进房前已在房内的可见用户的进房回调通知。 - 远端可见用户离开房间,包含断网情况 + 远端可见用户离开房间,包含断网情况 - rtc连接断开。和connectionLost类似,不过该方法是断开后立即触发 + rtc连接断开。和connectionLost类似,不过该方法是断开后立即触发 - 网络连接断开超过 10 秒,仍然会继续重连。该事件和上面事件在类似,不过是超过10s 后触发 + 网络连接断开超过 10 秒,仍然会继续重连。该事件和上面事件在类似,不过是超过10s 后触发 - 当收到本地第一帧音频的时候上报该事件 + 当收到本地第一帧音频的时候上报该事件 - 接收到来自远端某音频流的第一帧时,收到该回调。 用户刚收到房间内每一个用户音频流时,都会收到该回调。 + 接收到来自远端某音频流的第一帧时,收到该回调。 用户刚收到房间内每一个用户音频流时,都会收到该回调。 - 远端用户调用 muteLocalAudioStream - 改变本地音频推流状态时,房间内其他用户会收到此回调。 - @param muted 是否被静音 - true: 远端用户禁止推送音频数据; - false: 远端用户开启推送音数据 + 远端用户调用 muteLocalAudioStream + 改变本地音频推流状态时,房间内其他用户会收到此回调。 + @param muted 是否被静音 + true: 远端用户禁止推送音频数据; + false: 远端用户开启推送音数据 - 远端用户enableLocalAudio/disableLocalAudio 开启/关闭音频设备采集时,房间内其他人会收到这个回调。 - userMuteAudio 和 userEnableLocalAudio 分别代表开/关 本地麦克风采集 和开/关 推送本地数据。 - 之所以有这样的区分,是因为 开/关 本地麦克风采集成本 的远大于 开/关 推送本地数据。因为麦克风采集需要调用系统接口,而 - 开/关推送数据只是标识位的改变。 - enabled 用户是否开启了音频设备采集 - true: 远端用户禁止推送音频数据; - false: 远端用户开启推送音数据 + 远端用户enableLocalAudio/disableLocalAudio 开启/关闭音频设备采集时,房间内其他人会收到这个回调。 + userMuteAudio 和 userEnableLocalAudio 分别代表开/关 本地麦克风采集 和开/关 推送本地数据。 + 之所以有这样的区分,是因为 开/关 本地麦克风采集成本 的远大于 开/关 推送本地数据。因为麦克风采集需要调用系统接口,而 开/关推送数据只是标识位的改变。 + enabled 用户是否开启了音频设备采集 + true: 远端用户禁止推送音频数据; + false: 远端用户开启推送音数据 - 当收到音量信息时回调该事件,需要调用 enableAudioVolumeIndication 后才可以 - 对于本地用户:只要进行本地音频采集,回调内就会包含本地音频流的音量信息。 - 对于远端用户:本地必须订阅某远端用户的音频流,回调内才会包含其发送的音频流的音量信息。 + 当收到音量信息时回调该事件,需要调用 enableAudioVolumeIndication 后才可以 + 对于本地用户:只要进行本地音频采集,回调内就会包含本地音频流的音量信息。 + 对于远端用户:本地必须订阅某远端用户的音频流,回调内才会包含其发送的音频流的音量信息。 - 当内部发生警告信息时回调该事件 + 当内部发生警告信息时回调该事件 - 当内部发生不可逆转测错误时回调,比如加入房间失败 + 当内部发生不可逆转测错误时回调,比如加入房间失败 - 首次加入房间成功。用户手动调用 JoinRoom,收到加入成功。 - 加入房间失败没有单独的事件,需要通过onerror 判断 + 首次加入房间成功。用户手动调用 JoinRoom,收到加入成功。 + 加入房间失败没有单独的事件,需要通过onerror 判断 从调用joinChannel开始到加入房间成功所经历的时间(毫秒单位) - 重新加入房间。用户网络较差,失去与服务器的连接,进行重连时收到加入成功。 + 重新加入房间。用户网络较差,失去与服务器的连接,进行重连时收到加入成功。 从用户掉线掉重新加入房间成功经历的时间(毫秒单位) - 当收到网络质量报告时回调该事件 + 当收到网络质量报告时回调该事件 远端通话用户标识 所属用户的媒体流上行网络质量 - 所属用户的媒体流下行网络质 + 所属用户的媒体流下行网络质 - 远端可见用户加入房间的回调。 - 远端可见用户断网后重新连入房间时,房间内其他用户将收到该事件。 - 新进房用户会收到进房前已在房内的可见用户的进房回调通知。 + 远端可见用户加入房间的回调。 + 远端可见用户断网后重新连入房间时,房间内其他用户将收到该事件。 + 新进房用户会收到进房前已在房内的可见用户的进房回调通知。 远端通话用户标识 从加入房间到收到该事件经历的时间(毫秒单位) - 远端可见用户离开房间,包含断网情况。 + 远端可见用户离开房间,包含断网情况。 离线用户的标识 用户离线的原因 0, quit normal , 1, user lost - rtc连接断开。和connectionLost类似,不过该方法是断开后立即触发 + rtc连接断开。和connectionLost类似,不过该方法是断开后立即触发 - 网络连接断开超过 10 秒,仍然会继续重连。该事件和上面事件在类似,不过是超过10s 后触发 + 网络连接断开超过 10 秒,仍然会继续重连。该事件和上面事件在类似,不过是超过10s 后触发 - 当收到本地第一帧音频的时候上报该事件 + 当收到本地第一帧音频的时候上报该事件 返回StreamIndex: 0-视频流;1-屏幕流 - 当收到本地第一帧音频的时候上报该事件 + 当收到本地第一帧音频的时候上报该事件 远端通话用户标识 返回StreamIndex: 0-视频流;1-屏幕流 - 远端用户调用 muteLocalAudioStream, 改变本地音频推流状态时,房间内其他用户会收到此回调。 + 远端用户调用 muteLocalAudioStream, 改变本地音频推流状态时,房间内其他用户会收到此回调。 远端通话用户标识 - 是否被静音 true: 远端用户禁止推送音频数据 false: 远端用户开启推送音数据 + 是否被静音 true: 远端用户禁止推送音频数据 false: 远端用户开启推送音数据 - 远端用户enableLocalAudio/disableLocalAudio 开启/关闭音频设备采集时,房间内其他人会收到这个回调。 - userMuteAudio 和 userEnableLocalAudio 分别代表开/关 本地麦克风采集 和开/关 推送本地数据。 - 之所以有这样的区分,是因为 开/关 本地麦克风采集成本 的远大于 开/关 推送本地数据。因为麦克风采集需要调用系统接口,而 - 开/关推送数据只是标识位的改变。 + 远端用户enableLocalAudio/disableLocalAudio 开启/关闭音频设备采集时,房间内其他人会收到这个回调。 + userMuteAudio 和 userEnableLocalAudio 分别代表开/关 本地麦克风采集 和开/关 推送本地数据。 + 之所以有这样的区分,是因为 开/关 本地麦克风采集成本 的远大于 开/关 推送本地数据。因为麦克风采集需要调用系统接口,而 开/关推送数据只是标识位的改变。 远端通话用户标识 - 用户是否开启了音频设备采集 true: 远端用户允许开启音频设备 false: - 远端用户禁止开启音频设备 - + 用户是否开启了音频设备采集 true: 远端用户允许开启音频设备 false: 远端用户禁止开启音频设备 - 当收到音量信息时回调该事件,需要调用 enableAudioVolumeIndication 后才可以。 - 对于本地用户:只要进行本地音频采集,回调内就会包含本地音频流的音量信息。 - 对于远端用户:本地必须订阅某远端用户的音频流,回调内才会包含其发送的音频流的音量信息。 + 当收到音量信息时回调该事件,需要调用 enableAudioVolumeIndication 后才可以。 + 对于本地用户:只要进行本地音频采集,回调内就会包含本地音频流的音量信息。 + 对于远端用户:本地必须订阅某远端用户的音频流,回调内才会包含其发送的音频流的音量信息。 用户id 音量大小,范围[0,255] @@ -2280,13 +2251,13 @@ - 当内部发生警告信息时回调该事件 + 当内部发生警告信息时回调该事件 - 警告码,详情查看 https://bytedance.feishu.cn/docx/doxcnKNEvQGmLTwupIvWDSqh1nd + 警告码,详情查看 https://bytedance.feishu.cn/docx/doxcnKNEvQGmLTwupIvWDSqh1nd - 当内部发生不可逆转测错误时回调,比如加入房间失败 + 当内部发生不可逆转测错误时回调,比如加入房间失败 错误码,详情查看 https://bytedance.feishu.cn/docx/doxcnKNEvQGmLTwupIvWDSqh1nd @@ -2318,7 +2289,7 @@ 远端用户enableLocalAudio/disableLocalAudio 开启/关闭音频设备采集时,房间内其他人会收到这个回调。 - rtc连接断开。和connectionLost类似,不过该方法是断开后立即触发 + rtc连接断开。和connectionLost类似,不过该方法是断开后立即触发 网络连接断开超过 10 秒,仍然会继续重连。该事件和上面事件在类似,不过是超过10s 后触发 @@ -2334,281 +2305,279 @@ - 当前的登录状态 + 当前的登录状态 - 登录后获取登录的用户信息 + 登录后获取登录的用户信息 - https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/open-capacity/user-information/authorization/authorization/ + https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/open-capacity/user-information/authorization/authorization/ - 是否授权用户信息 - 对应接口:tt.getUserInfo + 是否授权用户信息 + 对应接口:tt.getUserInfo - 是否授权地理位置 - 对应接口:tt.getLocation + 是否授权地理位置 + 对应接口:tt.getLocation - 是否授权录音功能 - 对应接口:tt.getRecorderManager.start + 是否授权录音功能 + 对应接口:tt.getRecorderManager.start - 是否授权保存到相册 - 对应接口:tt.saveImageToPhotosAlbum, tt.saveVideoToPhotosAlbum + 是否授权保存到相册 + 对应接口:tt.saveImageToPhotosAlbum, tt.saveVideoToPhotosAlbum - 是否授权摄像头 - 对应接口:tt.scanCode, tt.chooseImage, tt.chooseVideo + 是否授权摄像头 + 对应接口:tt.scanCode, tt.chooseImage, tt.chooseVideo - 是否授权录屏,默认为开。在 onError 里面报错到没有录屏权限时,可以尝试主动调用 - 对应接口:tt.getGameRecorderManager + 是否授权录屏,默认为开。在 onError 里面报错到没有录屏权限时,可以尝试主动调用 + 对应接口:tt.getGameRecorderManager - 是否授权添加日历事件 - 对应接口:tt.addPhoneCalendar + 是否授权添加日历事件 + 对应接口:tt.addPhoneCalendar - - 用户权限授权结果 - - 代码示例 1:检查用户是否已授权指定权限: - ``` - if (AuthSetting.UserInfo) - { - Debug.Log($"用户已授权 UserInfo 权限。"); - } - else - { - Debug.Log($"用户未授权过或已拒绝 UserInfo 权限。"); - } - ``` - - 代码示例 2:检查用户已授权、拒绝或未授权过指定权限: - ``` - var scope = AuthorizeScope.UserInfo; - if (AuthSetting.TryGetValue(scope, out var authorized)) - { - if (authorized) - { - Debug.Log($"用户已授权 {scope} 权限。"); - } - else - { - Debug.Log($"用户已拒绝 {scope} 权限。"); - } - } - else - { - Debug.Log($"用户未授权过 {scope} 权限。"); - } - ``` - + + 用户权限授权结果 + + 代码示例 1:检查用户是否已授权指定权限: + ``` + if (AuthSetting.UserInfo) + { + Debug.Log($"用户已授权 UserInfo 权限。"); + } + else + { + Debug.Log($"用户未授权过或已拒绝 UserInfo 权限。"); + } + ``` + + 代码示例 2:检查用户已授权、拒绝或未授权过指定权限: + ``` + var scope = AuthorizeScope.UserInfo; + if (AuthSetting.TryGetValue(scope, out var authorized)) + { + if (authorized) + { + Debug.Log($"用户已授权 {scope} 权限。"); + } + else + { + Debug.Log($"用户已拒绝 {scope} 权限。"); + } + } + else + { + Debug.Log($"用户未授权过 {scope} 权限。"); + } + ``` + - 是否授权用户信息 - 对应接口:tt.getUserInfo + 是否授权用户信息 + 对应接口:tt.getUserInfo - 是否授权地理位置 - 对应接口:tt.getLocation + 是否授权地理位置 + 对应接口:tt.getLocation - 是否授权录音功能 - 对应接口:tt.getRecorderManager.start + 是否授权录音功能 + 对应接口:tt.getRecorderManager.start - 是否授权保存到相册 - 对应接口:tt.saveImageToPhotosAlbum tt.saveVideoToPhotosAlbum + 是否授权保存到相册 + 对应接口:tt.saveImageToPhotosAlbum tt.saveVideoToPhotosAlbum - 是否授权摄像头 - 对应接口:tt.scanCode tt.chooseImage tt.chooseVideo + 是否授权摄像头 + 对应接口:tt.scanCode tt.chooseImage tt.chooseVideo - 是否授权录屏,默认为开。在 onError 里面报错到没有录屏权限时,可以尝试主动调用 - 对应接口:tt.getGameRecorderManager + 是否授权录屏,默认为开。在 onError 里面报错到没有录屏权限时,可以尝试主动调用 + 对应接口:tt.getGameRecorderManager - 是否授权添加日历事件 - 对应接口:tt.addPhoneCalendar + 是否授权添加日历事件 + 对应接口:tt.addPhoneCalendar - 需获取的抖音权限在授权弹窗中的默认状态 + 需获取的抖音权限在授权弹窗中的默认状态 - 必选项(用户无法取消) + 必选项(用户无法取消) - 非必选,默认选中 + 非必选,默认选中 - 非必选,默认不选中 + 非必选,默认不选中 - Stark账号系统 + Stark账号系统 - 登录成功 + 登录成功 - 临时登录凭证, 有效期 3 分钟。可以通过在服务器端调用 登录凭证校验接口 换取 openid 和 - session_key 等信息。 - + 临时登录凭证, 有效期 3 分钟。可以通过在服务器端调用 登录凭证校验接口 换取 openid 和 session_key 等信息。 用于标识当前设备, 无论登录与否都会返回, 有效期 3 分钟 判断在当前 APP(头条、抖音等)是否处于登录状态 - 登录失败 - 错误消息 + 登录失败 + 错误消息 - 检查Session接口调用失败的回调函数 + 检查Session接口调用失败的回调函数 错误原因 - 接口调用成功的回调函数 + 接口调用成功的回调函数 - 获取用户信息失败的回调 + 获取用户信息失败的回调 失败信息 - 获取用户信息成功的回调 + 获取用户信息成功的回调 目标用户信息 - 用户实名认证成功的回调 + 用户实名认证成功的回调 - 判断当前用户是否已经授权给游戏读取自身的信息 + 判断当前用户是否已经授权给游戏读取自身的信息 是否授权 - 调用接口判断当前用户是否已经授权时失败或者发生内部错误 + 调用接口判断当前用户是否已经授权时失败或者发生内部错误 - 获取用户已经授权过的配置时,接口调用成功的回调函数。 + 获取用户已经授权过的配置时,接口调用成功的回调函数。 授权结果 - 获取用户已经授权过的配置时,接口调用失败的回调函数。 + 获取用户已经授权过的配置时,接口调用失败的回调函数。 - 打开设置页面,返回用户设置过的授权结果时,接口调用成功的回调函数。 + 打开设置页面,返回用户设置过的授权结果时,接口调用成功的回调函数。 授权结果 - 打开设置页面,返回用户设置过的授权结果时,接口调用失败的回调函数。 + 打开设置页面,返回用户设置过的授权结果时,接口调用失败的回调函数。 - 实名认证窗口拉起成功回调 + 实名认证窗口拉起成功回调 - 实名认证窗口拉起失败回调 - "access:fail " + 详细错误信息 + 实名认证窗口拉起失败回调 + "access:fail " + 详细错误信息 - 展示抖音权限授权弹窗成功回调 - 回调信息 - 请求授权返回的票据,此处对标开放平台的 authCode - 用户授权的权限 + 展示抖音权限授权弹窗成功回调 + 回调信息 + 请求授权返回的票据,此处对标开放平台的 authCode + 用户授权的权限 - 展示抖音权限授权弹窗失败回调 - 错误码 - 错误信息 + 展示抖音权限授权弹窗失败回调 + 错误码 + 错误信息 - 登录-获取临时登录凭证 - 强制登录默认为true,即若当前未登录宿主,则会调起宿主的登录窗口, 如果用户点击取消则会调用 fail - 如果当前登录宿主,则直接返回success,获取到 code 和 anonymousCode - 若强制登录为false,当前登录了宿主则会返回success,可以获取到获取到 code 和 anonymousCode - 当前未登录宿主,则只有 anonymousCode - code 可以换取 openid, openid 是用户的唯一标识 - anonymousCode 可以换取 anonymous_openid, 同一台手机 anonymous_openid 是相同的 + 登录-获取临时登录凭证 + 强制登录默认为true,即若当前未登录宿主,则会调起宿主的登录窗口, 如果用户点击取消则会调用 fail + 如果当前登录宿主,则直接返回success,获取到 code 和 anonymousCode + 若强制登录为false,当前登录了宿主则会返回success,可以获取到获取到 code 和 anonymousCode + 当前未登录宿主,则只有 anonymousCode + code 可以换取 openid, openid 是用户的唯一标识 + anonymousCode 可以换取 anonymous_openid, 同一台手机 anonymous_openid 是相同的 未登录时, 是否强制调起登录框 登录成功的回调 @@ -2616,113 +2585,113 @@ - 检查用户当前的 session 状态是否有效 - 只有成功调用 login 才会生成 session,checkSession 才会进入 success 回调,当用户退出登录会清除 session - session_key 会随着login接口的调用被刷新。可以通过checkSession方法验证当前 session 是否有效,从而避免频繁登录。 - 目前实际测试若使用匿名登录(forceLogin = false),则checkSession会一直返回 fail - 只有登录了宿主(forceLogin = true),checkSession才会返回success,下次不用login checkSession也可以返回true + 检查用户当前的 session 状态是否有效 + 只有成功调用 login 才会生成 session,checkSession 才会进入 success 回调,当用户退出登录会清除 session + session_key 会随着login接口的调用被刷新。可以通过checkSession方法验证当前 session 是否有效,从而避免频繁登录。 + 目前实际测试若使用匿名登录(forceLogin = false),则checkSession会一直返回 fail + 只有登录了宿主(forceLogin = true),checkSession才会返回success,下次不用login checkSession也可以返回true 验证有效的回调 验证无效或者验证失败的回调 - 获取已登录用户的基本信息或特殊信息 - 若匿名登录后 userinfo里面字段全部为默认值 - 登录了宿主后可以获取账号数据,下次不用login GetScUserInfo也可以返回正确数据 + 获取已登录用户的基本信息或特殊信息 + 若匿名登录后 userinfo里面字段全部为默认值 + 登录了宿主后可以获取账号数据,下次不用login GetScUserInfo也可以返回正确数据 验证有效的回调 验证无效或者验证失败的回调 - 判断用户是否已经授权给当前游戏读取个人信息 - 该API会调用宿主的代码,如果调用宿主代码成功则会调用onGetUserInfoAuth,并返回是否已经授权 - 如果调用宿主代码失败则会调用onGetUserInfoAuthFail + 判断用户是否已经授权给当前游戏读取个人信息 + 该API会调用宿主的代码,如果调用宿主代码成功则会调用onGetUserInfoAuth,并返回是否已经授权 + 如果调用宿主代码失败则会调用onGetUserInfoAuthFail 调用宿主代码成功,并返回是否已经授权读取用户信息 调用宿主代码时发生错误 - 主动打开获取用户信息的授权界面,在Setting界面关闭后返回最新的授权状态,该方法没有超时时间 - 该API会调用宿主的代码,如果调用宿主代码成功则会调用onGetUserInfoAuth,并返回最新的授权状态 - 如果调用宿主代码失败则会调用onGetUserInfoAuthFail + 主动打开获取用户信息的授权界面,在Setting界面关闭后返回最新的授权状态,该方法没有超时时间 + 该API会调用宿主的代码,如果调用宿主代码成功则会调用onGetUserInfoAuth,并返回最新的授权状态 + 如果调用宿主代码失败则会调用onGetUserInfoAuthFail - 获取用户已经授权过的配置。 - 结果中只会包含向用户请求过的权限。 - 与 OpenSetting 的区别是 GetSetting 只会获取配置,而不会打开配置页面。 + 获取用户已经授权过的配置。 + 结果中只会包含向用户请求过的权限。 + 与 OpenSetting 的区别是 GetSetting 只会获取配置,而不会打开配置页面。 接口调用成功的回调函数 接口调用失败的回调函数 - 打开设置页面,返回用户设置过的授权结果。 - 结果中只会包含用户请求过的权限。 - 与 GetSetting 的区别是,OpenSetting 会打开设置页面,而 GetSetting 只会返回用户授权的设置信息。 - 接口调用成功的回调函数 - 接口调用失败的回调函数 + 打开设置页面,返回用户设置过的授权结果。 + 结果中只会包含用户请求过的权限。 + 与 GetSetting 的区别是,OpenSetting 会打开设置页面,而 GetSetting 只会返回用户授权的设置信息。 + 接口调用成功的回调函数 + 接口调用失败的回调函数 - 用户在实名认证弹窗完成实名认证后回调 - 需要在初始化时设置,回调时机为:游戏中弹出实名认证,用户完成了实名认证时触发 + 用户在实名认证弹窗完成实名认证后回调 + 需要在初始化时设置,回调时机为:游戏中弹出实名认证,用户完成了实名认证时触发 - 获取已登录用户的基本信息或特殊信息 - 若匿名登录后 userinfo里面字段全部为默认值 - 登录了宿主后可以获取账号数据,下次不用login GetScUserInfo也可以返回正确数据 + 获取已登录用户的基本信息或特殊信息 + 若匿名登录后 userinfo里面字段全部为默认值 + 登录了宿主后可以获取账号数据,下次不用login GetScUserInfo也可以返回正确数据 是否获取加密信息以及 CloudId 验证有效的回调 验证无效或者验证失败的回调 - + - 拉起实名认证窗口。 - 注意:调用该接口前请确保用户已登录。 + 拉起实名认证窗口。 + 注意:调用该接口前请确保用户已登录。 实名认证窗口拉起成功回调 实名认证窗口拉起失败回调 - 提供小游戏获取抖音权限的能力,展示出抖音权限授权弹窗。 - 在使用在接口前,需要小游戏拥有者登录抖音开发平台申请开通小游戏需要的权限。 + 提供小游戏获取抖音权限的能力,展示出抖音权限授权弹窗。 + 在使用在接口前,需要小游戏拥有者登录抖音开发平台申请开通小游戏需要的权限。 - 广告管理模块 - 支持激励视屏,banner 和 插屏广告。 - 开通指南:https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/functional-plug-in/advertising-component-access-guide/flow-main-open-process/ + 广告管理模块 + 支持激励视屏,banner 和 插屏广告。 + 开通指南:https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/functional-plug-in/advertising-component-access-guide/flow-main-open-process/ - 是否显示广告加载提示,默认显示 + 是否显示广告加载提示,默认显示 - 展示激励视频广告,在广告未加载时会发起异步请求,弱网情况下会进行重试。失败会调用errCallback - 激励视频广告只支持一个实例,申请多个激励视频广告位是无效的 - 简单回调设置,激励视频完成和错误的回调函数 - 与 SetVideoAdCallBack 不冲突,在结束时都会被调用到,会同时收到close和complete - 错误码由sdk传出,原因参考 - https://bytedance.feishu.cn/docs/doccn1lAbZzMOqI5ueq1gCyPdcg# - https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/open-capacity/ads/ads-error-code-description/ - https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/open-interface/ads/tt-create-interstitial-ad - 1004 可能是由于广告请求被限制了次数,需要跟广告投放沟通 - 如果需要更详细的回调信息,可使用 SetVideoAdCallBack + 展示激励视频广告,在广告未加载时会发起异步请求,弱网情况下会进行重试。失败会调用errCallback + 激励视频广告只支持一个实例,申请多个激励视频广告位是无效的 + 简单回调设置,激励视频完成和错误的回调函数 + 与 SetVideoAdCallBack 不冲突,在结束时都会被调用到,会同时收到close和complete + 错误码由sdk传出,原因参考 + https://bytedance.feishu.cn/docs/doccn1lAbZzMOqI5ueq1gCyPdcg# + https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/open-capacity/ads/ads-error-code-description/ + https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/open-interface/ads/tt-create-interstitial-ad + 1004 可能是由于广告请求被限制了次数,需要跟广告投放沟通 + 如果需要更详细的回调信息,可使用 SetVideoAdCallBack 广告aid. 视频广告关闭回调,参数含义 IsComplete,表明广告是否播放完成. @@ -2731,66 +2700,56 @@ - 展示激励视频广告,在广告未加载时会发起异步请求,弱网情况下会进行重试。失败会调用errCallback - 激励视频广告只支持一个实例,申请多个激励视频广告位是无效的 - 简单回调设置,激励视频完成和错误的回调函数 - 与 SetVideoAdCallBack 不冲突,在结束时都会被调用到,会同时收到close和complete - 错误码由sdk传出,原因参考 - https://bytedance.feishu.cn/docs/doccn1lAbZzMOqI5ueq1gCyPdcg# - https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/open-capacity/ads/ads-error-code-description/ - https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/open-interface/ads/tt-create-interstitial-ad - 1004 可能是由于广告请求被限制了次数,需要跟广告投放沟通 - 如果需要更详细的回调信息,可使用 SetVideoAdCallBack + 展示激励视频广告,在广告未加载时会发起异步请求,弱网情况下会进行重试。失败会调用errCallback + 激励视频广告只支持一个实例,申请多个激励视频广告位是无效的 + 简单回调设置,激励视频完成和错误的回调函数 + 与 SetVideoAdCallBack 不冲突,在结束时都会被调用到,会同时收到close和complete + 错误码由sdk传出,原因参考 + https://bytedance.feishu.cn/docs/doccn1lAbZzMOqI5ueq1gCyPdcg# + https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/open-capacity/ads/ads-error-code-description/ + https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/open-interface/ads/tt-create-interstitial-ad + 1004 可能是由于广告请求被限制了次数,需要跟广告投放沟通 + 如果需要更详细的回调信息,可使用 SetVideoAdCallBack 广告aid. 视频广告关闭回调,参数含义 IsComplete,表明广告是否播放完成. 视频广告错误回调,参数含义 errCode, errMsg 表明错误码和错误描述. 视频广告详细过程回调,一般可以不关注. - 再得添加 - https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/open-capacity/ads/rewardagainintroduce + 再得添加 https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/open-capacity/ads/rewardagainintroduce 是否开启再得广告模式(只支持安卓系统的抖音和抖音极速版) - - 再得广告的奖励文案,玩家每看完一个广告都会展示,如【再看1个获得xx】xx就multitonRewardMsg中的文案,按顺序依次展示,单个文案最大长度为 - 7,multiton为true时必填 - + 再得广告的奖励文案,玩家每看完一个广告都会展示,如【再看1个获得xx】xx就multitonRewardMsg中的文案,按顺序依次展示,单个文案最大长度为 7,multiton为true时必填 额外观看广告的次数,合法的数据范围为1-4,multiton为true时必填 - 是否开启进度提醒,开启时广告文案为【再看N个获得xx】,关闭时为【 - 再看1个获得xx】。N表示玩家当前还需额外观看广告的次数。 - + 是否开启进度提醒,开启时广告文案为【再看N个获得xx】,关闭时为【 再看1个获得xx】。N表示玩家当前还需额外观看广告的次数。 - 创建Banner广告,返回 BannerAd 实例。支持多实例,可以在一个页面下展示多个。也可以分页面展示 - 竖屏情况下,Banner广告接受的宽度范围是 0.8*屏幕宽度,1.0*屏幕宽度。 - 横屏情况下,Banner广告接受的最小宽度是 128,最大宽度是 208。 - 开发者可以在这之间自由指定广告宽度。广告组件会自动等比例缩放素材。 - 创建Banner示例后,要主动调用show来进行展示 - 错误码由sdk传出,原因参考 - https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/open-capacity/ads/ads-error-code-description/ + 创建Banner广告,返回 BannerAd 实例。支持多实例,可以在一个页面下展示多个。也可以分页面展示 + 竖屏情况下,Banner广告接受的宽度范围是 0.8*屏幕宽度,1.0*屏幕宽度。 + 横屏情况下,Banner广告接受的最小宽度是 128,最大宽度是 208。 + 开发者可以在这之间自由指定广告宽度。广告组件会自动等比例缩放素材。 + 创建Banner示例后,要主动调用show来进行展示 + 错误码由sdk传出,原因参考 + https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/open-capacity/ads/ads-error-code-description/ - banner广告位的adid - 样式:"style":{"top":0, "left":0, "width":320}} width 在竖屏下会被限制在 - [0.8*ScreenWidth,1.0*ScreenWidth],横屏下会被限制在[128, 208] - - 广告自动刷新的间隔时间,单位为秒,参数值必须大于等于 30(该参数不传入时 Banner - 广告不会自动刷新). - - 广告错误回调,参数表明错误码和错误描述. - 广告加载回调. - 广告样式改变回调,第一个参数是width.第二个参数是height. + banner广告位的adid + 样式:"style":{"top":0, "left":0, "width":320}} width 在竖屏下会被限制在 [0.8*ScreenWidth,1.0*ScreenWidth],横屏下会被限制在[128, 208] + 广告自动刷新的间隔时间,单位为秒,参数值必须大于等于 30(该参数不传入时 Banner 广告不会自动刷新). + 广告错误回调,参数表明错误码和错误描述. + 广告加载回调. + 广告样式改变回调,第一个参数是width.第二个参数是height. 广告关闭回调,仅在WebGL有效 - 创建并播放插屏广告,在广告模块启动15s内不允许展示插屏广告,在任何地方调用API.GetStarkAdManager,就会启动广告模块 - 两个插屏广告展示间隔不能少于30s - 插屏广告支持多实例。简单回调设置,插屏广告完成和错误的回调函数 - 插屏广告实例只支持展示一次,出现加载错误,或 展示成功,点击关闭按钮或视频广告外的其他地方,广告实例都会自动销毁。下一次需再次创建。 - 提供接口可以手动销毁 - 错误码由sdk传出,原因参考 - https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/open-capacity/ads/tt-create-interstitial-ad + 创建并播放插屏广告,在广告模块启动15s内不允许展示插屏广告,在任何地方调用API.GetStarkAdManager,就会启动广告模块 + 两个插屏广告展示间隔不能少于30s + 插屏广告支持多实例。简单回调设置,插屏广告完成和错误的回调函数 + 插屏广告实例只支持展示一次,出现加载错误,或 展示成功,点击关闭按钮或视频广告外的其他地方,广告实例都会自动销毁。下一次需再次创建。 + 提供接口可以手动销毁 + 错误码由sdk传出,原因参考 + https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/open-capacity/ads/tt-create-interstitial-ad - 插屏广告位的adid + 插屏广告位的adid 广告视频错误回调,参数含义 errCode, errMsg 表明错误码和错误描述. 广告视频关闭回调. 广告加载回调. @@ -2798,110 +2757,110 @@ --------------------------------------------------------------------- - BannerAd 对象 + BannerAd 对象 - 显示。如果加载出错,会调用CreateBannerAd的参数 errCallback + 显示。如果加载出错,会调用CreateBannerAd的参数 errCallback - 隐藏 + 隐藏 - 销毁 + 销毁 - 改变样式 - 成功后会调用CreateBannerAd的参数 resizeCallback - 横屏下可以更改位置和宽度,竖屏下只能更改位置。 + 改变样式 + 成功后会调用CreateBannerAd的参数 resizeCallback + 横屏下可以更改位置和宽度,竖屏下只能更改位置。 - 样式:"style":{"top":0, "left":0, "width":128}} + 样式:"style":{"top":0, "left":0, "width":128}} - 是否有效,bannerad在load出错的情况下,如果adInterval为-1,则无法再进行刷新。此时认为已失效,需要destroy再重新创建 + 是否有效,bannerad在load出错的情况下,如果adInterval为-1,则无法再进行刷新。此时认为已失效,需要destroy再重新创建 - InterstitialAd 对象 + InterstitialAd 对象 - 加载 + 加载 - 显示 + 显示 - 是否已加载 + 是否已加载 - 销毁 + 销毁 - Banner样式 + Banner样式 - 广告位区域左上角横坐标 + 广告位区域左上角横坐标 - 广告位区域左上角纵坐标 + 广告位区域左上角纵坐标 - 广告位区域宽度 + 广告位区域宽度 - 广告位区域高度,受广告内容影响自主变化, 无法由外部指定 + 广告位区域高度,受广告内容影响自主变化, 无法由外部指定 - 广告的回调函数 - + 广告的回调函数 + - 广告加载成功 + 广告加载成功 - 广告播放成功,Unity测触发该回调时间不准确,具体触发Show的时间参考返回毫秒时间戳 + 广告播放成功,Unity测触发该回调时间不准确,具体触发Show的时间参考返回毫秒时间戳 - 广告失败,错误码同 ShowVideoAd + 广告失败,错误码同 ShowVideoAd - 广告关闭回调 + 广告关闭回调 已播放时长. 有效播放时长(超过此时长可以授予激励). @@ -2909,100 +2868,96 @@ - 设置激励视频广告的回调。获取完整的回调信息,一般处理都可以通过ShowVideoAdWithId完成,需要时使用 + 设置激励视频广告的回调。获取完整的回调信息,一般处理都可以通过ShowVideoAdWithId完成,需要时使用 激励视频广告的回调. - 是否显示广告加载进度弹窗 + 是否显示广告加载进度弹窗 - 游戏切到前台事件 + 游戏切到前台事件 - 游戏切到后台事件 + 游戏切到后台事件 - 监听游戏切到前台 + 监听游戏切到前台 - 监听游戏切到后台 + 监听游戏切到后台 - 监听游戏切到前台,统一所有平台,并携带参数 + 监听游戏切到前台,统一所有平台,并携带参数 - 监听游戏切到后台,统一所有平台 + 监听游戏切到后台,统一所有平台 - 监听游戏到前台,统一所有平台,携带参数的格式为字典,可以根据指定key获取指定数据 - https://bytedance.feishu.cn/docx/NkzOdcUPXo02bdxl6zqcemGinzb + 监听游戏到前台,统一所有平台,携带参数的格式为字典,可以根据指定key获取指定数据 + https://bytedance.feishu.cn/docx/NkzOdcUPXo02bdxl6zqcemGinzb - 监听游戏退出 + 监听游戏退出 - - 返回值为true,则表示由开发者自行处理退出逻辑,可以调用StarkSDK.API.ExitApp来手动退出游戏。返回值为false,则默认退出游戏。 - + 返回值为true,则表示由开发者自行处理退出逻辑,可以调用StarkSDK.API.ExitApp来手动退出游戏。返回值为false,则默认退出游戏。 - 设置剪切板信息 + 设置剪切板信息 设置的内容 bool = true设置成功,反则关注错误信息 - 获取剪切板信息 + 获取剪切板信息 bool = true获取成功,value为内容,反则关注错误信息 - 开始监听设备方向变化 + 开始监听设备方向变化 - "监听设备方向的变化回调函数的执行频率,game 适用于更新游戏的回调频率,在 20ms/次 左右,ui - 适用于更新 UI 的回调频率,在 60ms/次 左右,normal 普通的回调频率,在 200ms/次 左右" - + "监听设备方向的变化回调函数的执行频率,game 适用于更新游戏的回调频率,在 20ms/次 左右,ui 适用于更新 UI 的回调频率,在 60ms/次 左右,normal 普通的回调频率,在 200ms/次 左右" - 停止监听设备方向变化 + 停止监听设备方向变化 - 监听设备方向变化事件 + 监听设备方向变化事件 - 抖音云模块 + 抖音云模块 - 请求相关设置 + 请求相关设置 @@ -3015,31 +2970,29 @@ Post 请求的参数 - CloudId key 开发自己定义, value 是cloudId 数据, 相关key value 数据会被自动加到post 请求的body 中 - + CloudId key 开发自己定义, value 是cloudId 数据, 相关key value 数据会被自动加到post 请求的body 中 - 请求响应 + 请求响应 - - - 请求抖音云服务端接口 - 可以参考 小游戏抖音云相关文档 - https://developer.open-douyin.com/docs/resource/zh-CN/developer/tools/cloud/develop-guide/invoke-sever/cloud-sdk - - 抖音云平台环境id - 抖音云平台服务id - 请求path - 请求参数 - 成功回调 - 失败回调 + + + 请求抖音云服务端接口 + 可以参考 小游戏抖音云相关文档 https://developer.open-douyin.com/docs/resource/zh-CN/developer/tools/cloud/develop-guide/invoke-sever/cloud-sdk + + 抖音云平台环境id + 抖音云平台服务id + 请求path + 请求参数 + 成功回调 + 失败回调 - 获取抖音云文件访问地址 + 获取抖音云文件访问地址 抖音云平台环境id 云文件path @@ -3049,7 +3002,7 @@ - 抖音云文件删除 + 抖音云文件删除 抖音云平台环境id 云文件path @@ -3058,18 +3011,18 @@ - 抖音云文件上传 + 抖音云文件上传 抖音云平台环境id 云文件path - 需要传递绝对路径 - 上传进度回调 - 上传成功毁掉 - 上传失败回调 + 需要传递绝对路径 + 上传进度回调 + 上传成功毁掉 + 上传失败回调 - 下载抖音云文件 + 下载抖音云文件 抖音云平台环境id 云文件path @@ -3080,94 +3033,94 @@ - 返回抖音云操作数据库对象 + 返回抖音云操作数据库对象 - 返回一个 ServerDate 对象, 用于表示服务端时间, 可以用于插入数据或者 查询的条件判断 + 返回一个 ServerDate 对象, 用于表示服务端时间, 可以用于插入数据或者 查询的条件判断 - 创建 DBCollection 对象 + 创建 DBCollection 对象 - - - 创建 DbCmd 对象 - - - + + + 创建 DbCmd 对象 + + + - 返回一个 逻辑 CMD 可以调用 AND OR NOR相关方法 + 返回一个 逻辑 CMD 可以调用 AND OR NOR相关方法 - 基于 docid 获取单个文档 + 基于 docid 获取单个文档 - 添加数据, 当前进支持单个添加 + 添加数据, 当前进支持单个添加 - + - - - where 条件查询, 录入 a=1, a.b=1 - - - + + + where 条件查询, 录入 a=1, a.b=1 + + + - 多种条件同时查询, 具体支持请看 CloudDBCommand + 多种条件同时查询, 具体支持请看 CloudDBCommand - 设置查询结果返回的字段, a=true a.b=true + 设置查询结果返回的字段, a=true a.b=true - 设置查询数据量限制 + 设置查询数据量限制 - 设置查询跳过的数量 + 设置查询跳过的数量 - 设置查询的排序方式 + 设置查询的排序方式 @@ -3175,65 +3128,65 @@ - 获取查询结果 + 获取查询结果 - 获取查询结果 使用 count 语句 + 获取查询结果 使用 count 语句 - - - 基于设置的条件 更新数据 - - - - + + + 基于设置的条件 更新数据 + + + + - 基于设置的条件 删除数据 + 基于设置的条件 删除数据 - 数据库操作符 And + 数据库操作符 And - 数据库操作符 Or + 数据库操作符 Or - 数据库操作 Not or + 数据库操作 Not or - 数据库操作符 = + 数据库操作符 = - 数据库操作符 != + 数据库操作符 != @@ -3242,326 +3195,322 @@ - 数据库操作符 > + 数据库操作符 > - 数据库操作符 >= + 数据库操作符 >= - 数据库操作符 in + 数据库操作符 in - 数据库操作符 not in + 数据库操作符 not in - 获取抖音云数据单个文档数据 + 获取抖音云数据单个文档数据 - - - 更新单个云文档数据 - - - - + + + 更新单个云文档数据 + + + + - 设置单个云文档数据, 仅会更新已有字段 + 设置单个云文档数据, 仅会更新已有字段 - - - 删除单个云文档数据 - - - + + + 删除单个云文档数据 + + + - 游戏收藏 + 游戏收藏 - 收藏回调,true表示成功,false表示失败 + 收藏回调,true表示成功,false表示失败 - 取消游戏收藏 + 取消游戏收藏 - 取消收藏回调,true表示成功,false表示失败 + 取消收藏回调,true表示成功,false表示失败 - 游戏是否已收藏 + 游戏是否已收藏 是否已收藏,true表示已收藏,false表示未收藏 - 收藏引导 - 弹窗类型,默认为底部弹窗 - 弹窗文案,仅style为 Tip 时可修改,最多显示 12 个字符。 + 收藏引导 + 弹窗类型,默认为底部弹窗 + 弹窗文案,仅style为 Tip 时可修改,最多显示 12 个字符。 - 调起引导用户复访的提示弹窗,目前仅抖音宿主支持。 - 为了更好的玩家体验,建议在按钮的点击回调中使用。 + 调起引导用户复访的提示弹窗,目前仅抖音宿主支持。 + 为了更好的玩家体验,建议在按钮的点击回调中使用。 调起复访提示回调,true表示成功,false表示失败 - 游戏内录屏模块 + 游戏内录屏模块 - 是否显示视频分享Toast UI提示,默认显示 + 是否显示视频分享Toast UI提示,默认显示 - 开始录屏 + 开始录屏 - 录屏错误 - 错误码 - 错误消息 + 录屏错误 + 错误码 + 错误消息 - 录屏完成 - 实际视频路径 + 录屏完成 + 实际视频路径 - 视频分享成功 + 视频分享成功 - 视频分享失败 - 错误消息 + 视频分享失败 + 错误消息 - 视频分享取消 + 视频分享取消 - 是否显示视频分享Loading界面 + 是否显示视频分享Loading界面 - 时间片段(用于视频裁剪) + 时间片段(用于视频裁剪) - 开始时间,单位ms + 开始时间,单位ms - 结束时间,单位ms + 结束时间,单位ms - 录屏状态枚举 + 录屏状态枚举 - 录制开始中 + 录制开始中 - 录制已开始 + 录制已开始 - 录制暂停中 + 录制暂停中 - 录制已暂停 + 录制已暂停 - 录制停止中 + 录制停止中 - 录制已停止 + 录制已停止 - 录制结束 + 录制结束 - 录制错误 + 录制错误 - 录制的视频时长太短 + 录制的视频时长太短 - 视频分享状态枚举 + 视频分享状态枚举 - 未进行视频分享 + 未进行视频分享 - 视频分享中 + 视频分享中 - 等待分享器回调 + 等待分享器回调 - 视频分享成功 + 视频分享成功 - 视频分享失败 + 视频分享失败 - 视频分享取消 + 视频分享取消 - 设置录屏是否开启 + 设置录屏是否开启 开启设置为true,禁止设置为false - 获取录屏开启状态 + 获取录屏开启状态 返回true则表示录屏开启,返回false为录屏关闭 - 设置录屏关键帧插帧间隔 - 内部默认关键帧间隔1s,若需要更小的关键帧间隔精度,可通过该接口设置关键帧间隔 - 插帧思路按照帧间隔在超过下述设置阈值后,将自动将对应到来的帧插成关键帧 - 在录制前设置,在下次录制时候即生效 + 设置录屏关键帧插帧间隔 + 内部默认关键帧间隔1s,若需要更小的关键帧间隔精度,可通过该接口设置关键帧间隔 + 插帧思路按照帧间隔在超过下述设置阈值后,将自动将对应到来的帧插成关键帧 + 在录制前设置,在下次录制时候即生效 视频关键帧插帧间隔 单位ms,默认值-1,为不插帧 - 是否设置成功回调, true 成功 false 失败 + 是否设置成功回调, true 成功 false 失败 - 开始录屏 - 是否录制声音,默认为录制声音 - 最大录制时长,单位 s。小于等于 0 则无限制。默认为10分钟 - 视频录制开始回调 - 视频录制失败回调 + 开始录屏 + 是否录制声音,默认为录制声音 + 最大录制时长,单位 s。小于等于 0 则无限制。默认为10分钟 + 视频录制开始回调 + 视频录制失败回调 函数调用状态,调用成功返回true,否则返回false - 停止录屏 - 视频录制完成回调 - 视频录制失败回调 - 停止后需要对视频进行裁剪的时间片段,如果为null或空列表,则不对视频进行裁剪 - - 是否对视频裁剪片段进行自动合并。 - 合并规则: - 如果有两段重叠的时间片段,并且重叠部分小于等于1秒,则对这两段进行合并为一段 - 若autoMerge为true,比如时间片段为{[1000, 5000], [4000, 7000]},会被合并为{[1000, 7000]}。 - 若autoMerge为false,将按原始传入的时间片段进行裁剪,是否有重叠,由调用方保证。主要用于自定义裁剪。 - + 停止录屏 + 视频录制完成回调 + 视频录制失败回调 + 停止后需要对视频进行裁剪的时间片段,如果为null或空列表,则不对视频进行裁剪 + 是否对视频裁剪片段进行自动合并。 + 合并规则: + 如果有两段重叠的时间片段,并且重叠部分小于等于1秒,则对这两段进行合并为一段 + 若autoMerge为true,比如时间片段为{[1000, 5000], [4000, 7000]},会被合并为{[1000, 7000]}。 + 若autoMerge为false,将按原始传入的时间片段进行裁剪,是否有重叠,由调用方保证。主要用于自定义裁剪。 函数调用状态,调用成功返回true,否则返回false - 获取录屏时长 + 获取录屏时长 返回录屏时长,单位 ms - 获取视频录制状态 + 获取视频录制状态 VideoRecordState - 给录屏分享设置默认的配乐,若链接不符合要求则不生效,参考文档:https://bytedance.feishu.cn/docs/doccnlj9zMlqSbD0S0FEMonoJZd + 给录屏分享设置默认的配乐,若链接不符合要求则不生效,参考文档:https://bytedance.feishu.cn/docs/doccnlj9zMlqSbD0S0FEMonoJZd - 抖音PGC音乐的短链。形如 "https://v.douyin.com/JmcxWo8/", null 或者 - “”表示取消默认配乐 - + 抖音PGC音乐的短链。形如 "https://v.douyin.com/JmcxWo8/", null 或者 “”表示取消默认配乐 - 获取视频分享状态 + 获取视频分享状态 VideoClipState - 分享视频。分享的视频文件是调用StopVideo后生成的文件。 - 注意:视频分享需要录制至少3s的视频,低于3s的视频将会分享失败。 + 分享视频。分享的视频文件是调用StopVideo后生成的文件。 + 注意:视频分享需要录制至少3s的视频,低于3s的视频将会分享失败。 分享成功回调 分享失败回调 @@ -3570,8 +3519,8 @@ - 带标题和话题的分享视频。分享的视频文件是调用StopVideo后生成的文件。 - 注意:视频分享需要录制至少3s的视频,低于3s的视频将会分享失败。 + 带标题和话题的分享视频。分享的视频文件是调用StopVideo后生成的文件。 + 注意:视频分享需要录制至少3s的视频,低于3s的视频将会分享失败。 分享成功回调 分享失败回调 @@ -3582,108 +3531,102 @@ - 带Json数据格式的分享视频。分享的视频文件是调用StopVideo后生成的文件。 - 注意:视频分享需要录制至少3s的视频,低于3s的视频将会分享失败。 + 带Json数据格式的分享视频。分享的视频文件是调用StopVideo后生成的文件。 + 注意:视频分享需要录制至少3s的视频,低于3s的视频将会分享失败。 分享成功回调 分享失败回调 分享取消回调 视频分享的其它一些字段信息 - (除videoPath、channel字段的其它字段信息,如分享话题、标题、描述等)。 - 参考:https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/retweet/tt-share-app-message/ - + (除videoPath、channel字段的其它字段信息,如分享话题、标题、描述等)。 + 参考:https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/retweet/tt-share-app-message/ + 函数调用状态,调用成功返回true,否则返回false - 金币发放or扣除 + 金币发放or扣除 订单类型,1-发放金币,2-消耗金币, int 点位ID,在开发者后台中金币配置中获取, string 金币数量, int 开发者自定义的订单号, string - - 以上参数使用json的形式传入,例如:{"type":1,"bizId":"xxxxx","goldNum":1,"customId":"xxxx"} - + 以上参数使用json的形式传入,例如:{"type":1,"bizId":"xxxxx","goldNum":1,"customId":"xxxx"} 执行成功的回调函数,会返回平台订单号,例如:{"orderId":"xxxxx"} 接口调用成功的回调函数 接口调用失败的回调函数 - 互推格子模块 + 互推格子模块 - 游戏互推组件能力 + 游戏互推组件能力 GridGamePanelCount,表示游戏推荐组件的格子数量 从组件内打开游戏时附带的query信息 - GridGamePanelSize,表示组件大小,large:100%,medium:90%,small:80%。仅 gridCount = one | four - 时有效。 - - 控制游戏推荐组件的展示位置,不传入时默认展示在屏幕右下角。仅 gridCount = one 时有效。 - + GridGamePanelSize,表示组件大小,large:100%,medium:90%,small:80%。仅 gridCount = one | four 时有效。 + 控制游戏推荐组件的展示位置,不传入时默认展示在屏幕右下角。仅 gridCount = one 时有效。 - 显示 + 显示 - 隐藏 + 隐藏 - 销毁 + 销毁 - https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/open-capacity/im-group/groupchatintroduce + https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/open-capacity/im-group/groupchatintroduce - - 查询用户通过小游戏平台创建的群的信息 - 如游戏开发者在平台创建了群聊 ABC,那么游戏侧可以基于游戏开发者在这个游戏中的 - openid,查询其在小游戏平台创建了哪些群,群的状态如何,做游戏内的加群逻辑优化 - - 建群用户的 openid 必填 - 接口调用成功的回调函数 必填 - 接口调用失败的回调函数 必填 - 会话来源 可空 - 附加信息 可空 + + 查询用户通过小游戏平台创建的群的信息 + 如游戏开发者在平台创建了群聊 ABC,那么游戏侧可以基于游戏开发者在这个游戏中的 openid,查询其在小游戏平台创建了哪些群,群的状态如何,做游戏内的加群逻辑优化 + + 建群用户的 openid 必填 + 接口调用成功的回调函数 必填 + 接口调用失败的回调函数 必填 + 会话来源 可空 + 附加信息 可空 - 在平台创建群聊,获得 groupid 后,游戏内通过这个方法引导用户加入抖音群 + 在平台创建群聊,获得 groupid 后,游戏内通过这个方法引导用户加入抖音群 - 群 ID 必填 - 接口调用成功/失败的回调函数 必填 + 群 ID 必填 + 接口调用成功/失败的回调函数 必填 会话来源 可空 附加信息 可空 - 开始监听陀螺仪 + 开始监听陀螺仪 获取陀螺仪数据的间隔时间,单位为毫秒(ms),默认大小为 50 接口调用状态回调,(bool success, string errMsg) => {} - 停止监听陀螺仪 + 停止监听陀螺仪 接口调用状态回调,(bool success, string errMsg) => {} - 陀螺仪回调 + 陀螺仪回调 x 轴的角速度。 y 轴的角速度。 @@ -3696,363 +3639,375 @@ - 宿主事件监听 + 宿主事件监听 - 添加宿主事件监听 + 添加宿主事件监听 事件名 回调函数,(result) => {},宿主事件触发后自动调用 - 移除宿主事件监听 + 移除宿主事件监听 事件名 - Touch 对象表示在触控设备上的触摸点。通常是指手指或者触控笔在触屏设备或者触摸板上的操作。 + Touch 对象表示在触控设备上的触摸点。通常是指手指或者触控笔在触屏设备或者触摸板上的操作。 - Touch 对象的唯一标识符,只读属性。一次触摸动作(指手指的触摸)在平面上移动的整个过程中, 该标识符不变。 - 可以根据它来判断跟踪的是否是同一次触摸过程。 + Touch 对象的唯一标识符,只读属性。一次触摸动作(指手指的触摸)在平面上移动的整个过程中, 该标识符不变。 可以根据它来判断跟踪的是否是同一次触摸过程。 - 触点相对于屏幕左边沿的 X 坐标。 + 触点相对于屏幕左边沿的 X 坐标。 - 触点相对于屏幕上边沿的 Y 坐标。 + 触点相对于屏幕上边沿的 Y 坐标。 - 触摸事件 + 触摸事件 - 当前所有触摸点的列表 + 当前所有触摸点的列表 - 触发此次事件的触摸点列表 + 触发此次事件的触摸点列表 - 事件触发时的时间戳 + 事件触发时的时间戳 - 触控事件回调 + 触控事件回调 - 监听开始触摸事件 + 监听开始触摸事件 - 监听触点移动事件 + 监听触点移动事件 - 监听触摸结束事件 + 监听触摸结束事件 - 监听触点失效事件 + 监听触点失效事件 - 取消监听开始触摸事件 + 取消监听开始触摸事件 - 取消监听触点移动事件 + 取消监听触点移动事件 - 取消监听触摸结束事件 + 取消监听触摸结束事件 - 取消监听触点失效事件 + 取消监听触点失效事件 - 抖音好友邀请状态变化 - 状态值, 参考@InviteState - 状态对应的信息 + 抖音好友邀请状态变化 + 状态值, 参考@InviteState + 状态对应的信息 - 监听邀请状态变化事件 + 监听邀请状态变化事件 - 抖音好友邀请 + 抖音好友邀请 房间id 用于放在schema 里面的信息,Key-Value形式。 额外扩展信息, Key-Value形式。 调用结果回调: (isSuccess, errMsg) => {} - Example - StarkSDK.API.GetStarkInvite().onInviteStateChanged = (state, msg) => + Example + StarkSDK.API.GetStarkInvite().onInviteStateChanged = (state, msg) => { - Debug.Log($"onInviteStateChanged - state: {state}, msg: {msg}"); + Debug.Log($"onInviteStateChanged - state: {state}, msg: {msg}"); }; - var roomId = "12345"; - var query = new JsonData {["test"] = "query"}; - JsonData extra = null; - StarkSDK.API.GetStarkInvite().CreateInvitePanel(roomId, query, extra, (isSuccess, errorMsg) => - { + var roomId = "12345"; + var query = new JsonData {["test"] = "query"}; + JsonData extra = null; + StarkSDK.API.GetStarkInvite().CreateInvitePanel(roomId, query, extra, (isSuccess, errorMsg) => + { if (isSuccess) { - Debug.Log("CreateInvitePanel success"); + Debug.Log("CreateInvitePanel success"); } else { - Debug.Log($"CreateInvitePanel failed, {errorMsg}"); + Debug.Log($"CreateInvitePanel failed, {errorMsg}"); } - }); + }); - 键盘输入事件 - 键盘输入的当前值 + 键盘输入事件 + 键盘输入的当前值 - 用户点击键盘确定按钮时的事件 - 键盘输入的当前值 + 用户点击键盘确定按钮时的事件 + 键盘输入的当前值 - 键盘收起事件 - 键盘输入的当前值 + 键盘收起事件 + 键盘输入的当前值 - 监听键盘输入事件 + 监听键盘输入事件 - 监听用户点击键盘确定按钮时的事件 + 监听用户点击键盘确定按钮时的事件 - 监听键盘收起事件 + 监听键盘收起事件 - - 显示软键盘(仅WebGL平台下支持) - 参考: - https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/interface/keyboard/tt-show-keyboard/ - 键盘输入监听请设置 onKeyboardInputEvent 和 onKeyboardConfirmEvent - - 显示键盘的参数 - 显示软键盘成功回调: () => {} - 显示软键盘失败回调,(errMsg) => {} - Example: - using StarkSDKSpace; - using UnityEngine; - using UnityEngine.UI; - - public class KeyboardTest : MonoBehaviour - { - public InputField input; - - private void Start() - { - SetInputTexts(); - RegisterKeyboardEvents(); - } - - private void SetInputTexts() - { - input.text = "done"; - var comp = input.GetComponent<ClickableInputField>(); - if (comp == null) - { - comp = input.gameObject.AddComponent<ClickableInputField>(); - } - comp.multiple = false; - comp.confirmType = input.text; - } - - private void OnDestroy() - { - UnregisterKeyboardEvents(); - } - - private void RegisterKeyboardEvents() - { - StarkSDK.API.GetStarkKeyboard().onKeyboardInputEvent += OnKeyboardInput; - StarkSDK.API.GetStarkKeyboard().onKeyboardConfirmEvent += OnKeyboardConfirm; - StarkSDK.API.GetStarkKeyboard().onKeyboardCompleteEvent += OnKeyboardComplete; - } - - private void UnregisterKeyboardEvents() - { - StarkSDK.API.GetStarkKeyboard().onKeyboardInputEvent -= OnKeyboardInput; - StarkSDK.API.GetStarkKeyboard().onKeyboardConfirmEvent -= OnKeyboardConfirm; - StarkSDK.API.GetStarkKeyboard().onKeyboardCompleteEvent -= OnKeyboardComplete; - } - - private void OnKeyboardInput(string value) - { - Debug.Log($"OnKeyboardInput: {value}"); - if (input.isFocused) - { - input.text = value; - } - } - - private void OnKeyboardConfirm(string value) - { - Debug.Log($"OnKeyboardConfirm: {value}"); - } - - private void OnKeyboardComplete(string value) - { - Debug.Log($"OnKeyboardComplete: {value}"); - } - } - public class ClickableInputField : EventTrigger - { - public string confirmType = "done"; // 可选值有: "done", "next", "search", "go", "send" - public int maxInputLength = 100; // 最大输入长度 - public bool multiple = false; // 是否多行输入 - private InputField _inputField; - private void Start() - { - _inputField = GetComponent<InputField>(); - } - public override void OnPointerClick(PointerEventData eventData) - { - if (_inputField != null) - { - if (_inputField.isFocused) - { - StarkSDK.API.GetStarkKeyboard().ShowKeyboard(new StarkKeyboard.ShowKeyboardOptions() - { - maxLength = maxInputLength, - multiple = multiple, - defaultValue = _inputField.text, - confirmType = confirmType - }); - } - } - } - } - + + 显示软键盘(仅WebGL平台下支持) + 参考: https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/interface/keyboard/tt-show-keyboard/ + 键盘输入监听请设置 onKeyboardInputEvent 和 onKeyboardConfirmEvent + + 显示键盘的参数 + 显示软键盘成功回调: () => {} + 显示软键盘失败回调,(errMsg) => {} + Example: + using StarkSDKSpace; + using UnityEngine; + using UnityEngine.UI; + + public class KeyboardTest : MonoBehaviour + { + public InputField input; + + private void Start() + { + SetInputTexts(); + RegisterKeyboardEvents(); + } + + private void SetInputTexts() + { + input.text = "done"; + var comp = input.GetComponent<ClickableInputField>(); + if (comp == null) + { + comp = input.gameObject.AddComponent<ClickableInputField>(); + } + comp.multiple = false; + comp.confirmType = input.text; + } + + private void OnDestroy() + { + UnregisterKeyboardEvents(); + } + + private void RegisterKeyboardEvents() + { + StarkSDK.API.GetStarkKeyboard().onKeyboardInputEvent += OnKeyboardInput; + StarkSDK.API.GetStarkKeyboard().onKeyboardConfirmEvent += OnKeyboardConfirm; + StarkSDK.API.GetStarkKeyboard().onKeyboardCompleteEvent += OnKeyboardComplete; + } + + private void UnregisterKeyboardEvents() + { + StarkSDK.API.GetStarkKeyboard().onKeyboardInputEvent -= OnKeyboardInput; + StarkSDK.API.GetStarkKeyboard().onKeyboardConfirmEvent -= OnKeyboardConfirm; + StarkSDK.API.GetStarkKeyboard().onKeyboardCompleteEvent -= OnKeyboardComplete; + } + + private void OnKeyboardInput(string value) + { + Debug.Log($"OnKeyboardInput: {value}"); + if (input.isFocused) + { + input.text = value; + } + } + + private void OnKeyboardConfirm(string value) + { + Debug.Log($"OnKeyboardConfirm: {value}"); + } + + private void OnKeyboardComplete(string value) + { + Debug.Log($"OnKeyboardComplete: {value}"); + } + } + public class ClickableInputField : EventTrigger + { + public string confirmType = "done"; // 可选值有: "done", "next", "search", "go", "send" + public int maxInputLength = 100; // 最大输入长度 + public bool multiple = false; // 是否多行输入 + private InputField _inputField; + private void Start() + { + _inputField = GetComponent<InputField>(); + } + public override void OnPointerClick(PointerEventData eventData) + { + if (_inputField != null) + { + if (_inputField.isFocused) + { + StarkSDK.API.GetStarkKeyboard().ShowKeyboard(new StarkKeyboard.ShowKeyboardOptions() + { + maxLength = maxInputLength, + multiple = multiple, + defaultValue = _inputField.text, + confirmType = confirmType + }); + } + } + } + } + - 收起软键盘(仅WebGL平台下支持) - 参考: - https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/interface/keyboard/tt-hide-keyboard/ + 收起软键盘(仅WebGL平台下支持) + 参考: https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/interface/keyboard/tt-hide-keyboard/ 隐藏软键盘成功回调: () => {} 隐藏软键盘失败回调,(errMsg) => {} - 更新键盘,只有当键盘处于拉起状态时才会产生效果。 - 参考: - https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/interface/keyboard/tt-show-keyboard/ - 键盘输入监听请设置 onKeyboardInputEvent 和 onKeyboardConfirmEvent + 更新键盘,只有当键盘处于拉起状态时才会产生效果。 + 参考: https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/interface/keyboard/tt-show-keyboard/ + 键盘输入监听请设置 onKeyboardInputEvent 和 onKeyboardConfirmEvent 键盘输入框的当前值 更新软键盘成功回调: () => {} 更新软键盘失败回调,(errMsg) => {} + + + 检查直播间/小游戏挂载状态是否有效 + + 入参,主要为直播间ID{"roomID":"xxxx"},如从直播间进入小游戏roomId来源于启动参数中 + 成功回调 + 失败回调 + 完成回调 + + + + 跳转至直播间 + + 入参,主要为直播间ID{"roomID":"xxxx"} + 成功回调 + 失败回调 + 完成回调 + - 游戏跳转返回的跳转信息 - 用处: - 1.A->B A游戏跳转到B游戏,再从B游戏返回到A时,若A游戏没有被杀死则实时收到该信息 - 2.A->B A游戏跳转到B游戏,再从B游戏返回到A时,若A游戏被杀死则下次A启动时再获取该信息 + 游戏跳转返回的跳转信息 + 用处: + 1.A->B A游戏跳转到B游戏,再从B游戏返回到A时,若A游戏没有被杀死则实时收到该信息 + 2.A->B A游戏跳转到B游戏,再从B游戏返回到A时,若A游戏被杀死则下次A启动时再获取该信息 - 提供游戏互跳功能的模块 - 本地配置互跳信息的方法: - 在Resources文件加下添加game.json - 内容如下: - [{ - "navigate_app_id": "互跳游戏1的appid", - }, - { - "navigate_app_id": "互跳游戏2的appid", - }] + 提供游戏互跳功能的模块 + 本地配置互跳信息的方法: + 在Resources文件加下添加game.json + 内容如下: + [{ + "navigate_app_id": "互跳游戏1的appid", + }, + { + "navigate_app_id": "互跳游戏2的appid", + }] - 当从跳转的目标游戏返回时且自身进程存在没有被玩家杀死则自动调用该方法 - A跳转B,B玩完返回A时,若A依旧存活则会自动调用该方法 - 若A被用户杀死则下一次启动A时可以通过 - 方法获取上次的拉起信息 - 两种情况互斥,A依旧存活时,下次启动A就会获取不到信息;A被杀死,一定获取不到该回调,下次启动时会获取到拉起信息 + 当从跳转的目标游戏返回时且自身进程存在没有被玩家杀死则自动调用该方法 + A跳转B,B玩完返回A时,若A依旧存活则会自动调用该方法 + 若A被用户杀死则下一次启动A时可以通过方法获取上次的拉起信息 + 两种情况互斥,A依旧存活时,下次启动A就会获取不到信息;A被杀死,一定获取不到该回调,下次启动时会获取到拉起信息 跳转的目标appid 游玩时间 - 跳转游戏时失败时调用这个回调 + 跳转游戏时失败时调用这个回调 - 当播放的视频被关闭时调用改接口 + 当播放的视频被关闭时调用改接口 - 直接跳转至目标索引号所代表的游戏 - 互跳的条目信息可有两个来源,网络动态拉取找对应QA同学配置,本地配置方法见类 - StarkNavigateGame的注释。 + 直接跳转至目标索引号所代表的游戏 + 互跳的条目信息可有两个来源,网络动态拉取找对应QA同学配置,本地配置方法见类 + StarkNavigateGame的注释。 在服务器配置的游戏索引号,从0开始 跳转返回时调用该方法 @@ -4061,8 +4016,8 @@ - 拉起方读取被拉起方传递的信息,只有A拉起B后,A被杀死无法从B获取通知时该接口才会有数据 - 该接口涉及到读文件、Native方法调用,比较耗时,不可频繁调用! + 拉起方读取被拉起方传递的信息,只有A拉起B后,A被杀死无法从B获取通知时该接口才会有数据 + 该接口涉及到读文件、Native方法调用,比较耗时,不可频繁调用! @@ -4071,7 +4026,7 @@ - 判断当前游戏是否被另一个游戏拉起 + 判断当前游戏是否被另一个游戏拉起 该游戏被该appid对应的游戏拉起,若不是被拉起的appid为"" 获取从拉起方传递来的自定义数据,若不是被拉起的navigateExtraParam为"" @@ -4079,25 +4034,25 @@ - 初始化,从服务器获取导航信息 + 初始化,从服务器获取导航信息 - 不开放给用户StarkSDK实现的调用SCPlugin的存储文件的方法 + 不开放给用户StarkSDK实现的调用SCPlugin的存储文件的方法 - 当该游戏由其他游戏拉起时,设置的回调 + 当该游戏由其他游戏拉起时,设置的回调 被哪个游戏拉起 被拉起游戏设置的额外信息 - CP自己设置的在本游戏中推荐的游戏 + CP自己设置的在本游戏中推荐的游戏 目标appid 设置的query值 @@ -4106,68 +4061,64 @@ - 被拉起方的游戏设置传递给拉起方的信息,拉起方可以读取设置的该信息 - 游戏A拉起了游戏B: - A若拉起B后在后台被杀死则通过 - 接口可以获取到设置的信息 - A若拉起B后依旧在后台则通过 - 设置的接口通知设置的信息 - 该接口涉及到写文件、Native方法调用,比较耗时,不可频繁调用! + 被拉起方的游戏设置传递给拉起方的信息,拉起方可以读取设置的该信息 + 游戏A拉起了游戏B: + A若拉起B后在后台被杀死则通过接口可以获取到设置的信息 + A若拉起B后依旧在后台则通过设置的接口通知设置的信息 + 该接口涉及到写文件、Native方法调用,比较耗时,不可频繁调用! - 设置从其他游戏拉起的事件监听,从其他游戏拉起时会调用该回调 - 一定要早于StarkSDK的初始化 + 设置从其他游戏拉起的事件监听,从其他游戏拉起时会调用该回调 + 一定要早于StarkSDK的初始化 - 特定游戏的id + 特定游戏的id - 供Java侧调用,获取保存到Unity本地的互跳信息 + 供Java侧调用,获取保存到Unity本地的互跳信息 - 非uc环境下运行 + 非uc环境下运行 - 当前uc环境不支持支付功能 + 当前uc环境不支持支付功能 - 前一个支付未完成 + 前一个支付未完成 - orderInfo参数无效 + orderInfo参数无效 - 支付失败 + 支付失败 - 拉起微信支付失败 + 拉起微信支付失败 - 微信未安装 + 微信未安装 - 查询订单状态处理函数 + 查询订单状态处理函数 订单号(从orderInfo中读取的order_info值) 交易时间(从orderInfo中读取的trade_time值) @@ -4175,205 +4126,185 @@ - 支付状态 + 支付状态 - 支付成功 + 支付成功 - 支付超时 + 支付超时 - 支付失败 + 支付失败 - 支付关闭 + 支付关闭 - 支付取消 + 支付取消 - 订单状态未知/未支付 + 订单状态未知/未支付 - 拉起支付服务类型 + 拉起支付服务类型 - 小程序收银台,从收银台选择支付渠道 + 小程序收银台,从收银台选择支付渠道 - 调用微信 API 支付,不拉起小程序收银台 + 调用微信 API 支付,不拉起小程序收银台 - 调用支付宝 API 支付,不拉起小程序收银台 + 调用支付宝 API 支付,不拉起小程序收银台 - 支付渠道 + 支付渠道 - 使用微信支付 + 使用微信支付 - 使用支付宝支付 + 使用支付宝支付 - 支付接口 (已废弃) - 参考文档:https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/open-interface/pay/tt-pay/ + 支付接口 (已废弃) + 参考文档:https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/open-interface/pay/tt-pay/ json字符串。调起小程序支付收银台的签名订单信息。 - 生成方式参考文档:https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/server/ecpay/server-doc/ - + 生成方式参考文档:https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/server/ecpay/server-doc/ 拉起支付服务类型 (小程序收银台、微信、支付宝) 默认勾选的支付方式(支付宝或微信),仅在 serviceType 值为 Checkout 时有效。 - 注意:这个设置会依赖服务器端下发用户上次使用过的支付方式作为默认支付方式,所以这个设置可能不会生效。 - - (orderNo, tradeTime) => { return PayStatus; } 查询订单支付状态函数实现,仅在 - serviceType 值为 Checkout 时需要实现。 - 如果 serviceType 值为 Checkout ,需要由业务方实现 orderStatusHandler - 接口,根据订单号从业务后台查询支付状态并返回支付状态结果,主要用于通知前端界面展示。 - 注意:orderStatusHandler 这个回调函数会在底层轮循调用。如果查询不到支付结果状态,可以返回PayUnknown状态。 - + 注意:这个设置会依赖服务器端下发用户上次使用过的支付方式作为默认支付方式,所以这个设置可能不会生效。 + (orderNo, tradeTime) => { return PayStatus; } 查询订单支付状态函数实现,仅在 serviceType 值为 Checkout 时需要实现。 + 如果 serviceType 值为 Checkout ,需要由业务方实现 orderStatusHandler 接口,根据订单号从业务后台查询支付状态并返回支付状态结果,主要用于通知前端界面展示。 + 注意:orderStatusHandler 这个回调函数会在底层轮循调用。如果查询不到支付结果状态,可以返回PayUnknown状态。 支付回调 (payStatus) => {} - 当有错误发生时回调 (errCode, errMsg) => {} + 当有错误发生时回调 (errCode, errMsg) => {} - 初始化支付接口,减少支付时卡顿时间 + 初始化支付接口,减少支付时卡顿时间 - 小游戏平台的支付接口 - 接口文档 https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/payment/tt-request-game-payment - mode string 支付的类型, 目前仅为"game" - env int 环境配置,目前合法值仅为"0" - currencyType string 币种, 目前仅为"CNY" - platform string 申请接入时的平台,目前仅为"android" - buyQuantity int 金币购买数量 - zoneId 选填 string 游戏服务区 id, - customId 选填 string 游戏开发者自定义的唯一订单号,订单支付成功后通过服务端支付结果回调回传 - extraInfo string 游戏开发者自定义的其他信息,订单支付成功后通过服务端支付结果回调回传。字符串长度最大不能超过 - 256 + 小游戏平台的支付接口 + 接口文档 https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/payment/tt-request-game-payment + mode string 支付的类型, 目前仅为"game" + env int 环境配置,目前合法值仅为"0" + currencyType string 币种, 目前仅为"CNY" + platform string 申请接入时的平台,目前仅为"android" + buyQuantity int 金币购买数量 + zoneId 选填 string 游戏服务区 id, + customId 选填 string 游戏开发者自定义的唯一订单号,订单支付成功后通过服务端支付结果回调回传 + extraInfo string 游戏开发者自定义的其他信息,订单支付成功后通过服务端支付结果回调回传。字符串长度最大不能超过 256 - `StarkPlayerPrefs` is a class that stores Player preferences between game sessions. It can store - string, float and integer values into the user’s platform registry. - + `StarkPlayerPrefs` is a class that stores Player preferences between game sessions. It can store string, float and integer values into the user’s platform registry. - Sets a single integer value for the preference identified by the given key. You can use - StarkPlayerPrefs.GetInt to retrieve this value. - + Sets a single integer value for the preference identified by the given key. You can use StarkPlayerPrefs.GetInt to retrieve this value. - Returns the value corresponding to key in the preference file if it exists. + Returns the value corresponding to key in the preference file if it exists. - Sets the float value of the preference identified by the given key. You can use - StarkPlayerPrefs.GetFloat to retrieve this value. - + Sets the float value of the preference identified by the given key. You can use StarkPlayerPrefs.GetFloat to retrieve this value. - Returns the value corresponding to key in the preference file if it exists. + Returns the value corresponding to key in the preference file if it exists. - Sets a single string value for the preference identified by the given key. You can use - StarkPlayerPrefs.GetString to retrieve this value. - + Sets a single string value for the preference identified by the given key. You can use StarkPlayerPrefs.GetString to retrieve this value. - Returns the value corresponding to key in the preference file if it exists. + Returns the value corresponding to key in the preference file if it exists. - Returns true if the given key exists in StarkPlayerPrefs, otherwise returns false. + Returns true if the given key exists in StarkPlayerPrefs, otherwise returns false. - Removes the given key from the StarkPlayerPrefs. If the key does not exist, DeleteKey has no - impact. - + Removes the given key from the StarkPlayerPrefs. If the key does not exist, DeleteKey has no impact. - Removes all keys and values from the preferences. Use with caution. + Removes all keys and values from the preferences. Use with caution. - Writes all modified preferences to disk. + Writes all modified preferences to disk. https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/open-capacity/game-rank/setImRankData - 在关键的游戏场景,设置写入用户的排行榜数据(游戏成绩信息),该数据会上传到服务端 + 在关键的游戏场景,设置写入用户的排行榜数据(游戏成绩信息),该数据会上传到服务端 - - 0:数字类型、1:枚举类型;数字类型(0)往往适用于游戏的通关分数(103分、105分),枚举类型(1)适用于段位信息(青铜、白银); - - 展示出来的数值,dataType == 0 - 时只能传正数的字符串,否则会报错。value为具体的值,若dataType为0,请传入数字(eg:103、105);若dataType为1,则传入字符串(eg:青铜、白银) - + 0:数字类型、1:枚举类型;数字类型(0)往往适用于游戏的通关分数(103分、105分),枚举类型(1)适用于段位信息(青铜、白银); + 展示出来的数值,dataType == 0 时只能传正数的字符串,否则会报错。value为具体的值,若dataType为0,请传入数字(eg:103、105);若dataType为1,则传入字符串(eg:青铜、白银) dataType 为 1 时,需要传入这个值判断权重,dataType 为 0 时,不填即可 预留字段 回调函数 @@ -4381,62 +4312,47 @@ https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/open-capacity/game-rank/setImRankData - 在关键的游戏场景,设置写入用户的排行榜数据(游戏成绩信息),该数据会上传到服务端 + 在关键的游戏场景,设置写入用户的排行榜数据(游戏成绩信息),该数据会上传到服务端 - - 0:数字类型、1:枚举类型;数字类型(0)往往适用于游戏的通关分数(103分、105分),枚举类型(1)适用于段位信息(青铜、白银);--(Require) - - 展示出来的数值,dataType == 0 - 时只能传正数的字符串,否则会报错。value为具体的值,若dataType为0,请传入数字(eg:103、105);若dataType为1,则传入字符串(eg:青铜、白银)--(Require) - + 0:数字类型、1:枚举类型;数字类型(0)往往适用于游戏的通关分数(103分、105分),枚举类型(1)适用于段位信息(青铜、白银);--(Require) + 展示出来的数值,dataType == 0 时只能传正数的字符串,否则会报错。value为具体的值,若dataType为0,请传入数字(eg:103、105);若dataType为1,则传入字符串(eg:青铜、白银)--(Require) dataType 为 1 时,需要传入这个值判断权重,dataType 为 0 时,不填即可--(Require) 预留字段--(Nullable) 排行榜分区标识--(Nullable) - - 以上参数使用json格式传入,例如"{"dataType":0,"value":"100","priority":0,"zoneId":"default"}" - + 以上参数使用json格式传入,例如"{"dataType":0,"value":"100","priority":0,"zoneId":"default"}" 回调函数 - - 获取排行榜列表,调用 API 后, 根据参数自动绘制游戏好友排行榜 - - 代表数据排序周期,day为当日写入的数据做排序;week为自然周,month为自然月,all为半年 - - 由于数字类型的数据与枚举类型的数据无法同时排序,因此需要选择排序哪些类型的数据 - 选择榜单展示范围。default: 好友及总榜都展示,all:仅总榜单 - 数据后缀,最后展示样式为 value + suffix,若suffix传“分”,则展示 103分、104分 - 排行榜标题的文案 - 回调函数 + + 获取排行榜列表,调用 API 后, 根据参数自动绘制游戏好友排行榜 + + 代表数据排序周期,day为当日写入的数据做排序;week为自然周,month为自然月,all为半年 + 由于数字类型的数据与枚举类型的数据无法同时排序,因此需要选择排序哪些类型的数据 + 选择榜单展示范围。default: 好友及总榜都展示,all:仅总榜单 + 数据后缀,最后展示样式为 value + suffix,若suffix传“分”,则展示 103分、104分 + 排行榜标题的文案 + 回调函数 - - 获取排行榜列表,调用 API 后, 根据参数自动绘制游戏好友排行榜 - - - 代表数据排序周期,day为当日写入的数据做排序;week为自然周,month为自然月,all为半年--(Require) - - - 由于数字类型的数据与枚举类型的数据无法同时排序,因此需要选择排序哪些类型的数据--(Require) - - 选择榜单展示范围。default: 好友及总榜都展示,all:仅总榜单--(Nullable) - 数据后缀,最后展示样式为 value + suffix,若suffix传“分”,则展示 103分、104分--(Nullable) - - 排行榜标题的文案--(Nullable) - 排行榜分区标识--(Nullable) - - 以上参数使用json格式传入,例如"{"rankType":"week","dataType":0,"relationType":"all","suffix":"分","rankTitle":"","zoneId":"default"}" - - 回调函数 + + 获取排行榜列表,调用 API 后, 根据参数自动绘制游戏好友排行榜 + + 代表数据排序周期,day为当日写入的数据做排序;week为自然周,month为自然月,all为半年--(Require) + 由于数字类型的数据与枚举类型的数据无法同时排序,因此需要选择排序哪些类型的数据--(Require) + 选择榜单展示范围。default: 好友及总榜都展示,all:仅总榜单--(Nullable) + 数据后缀,最后展示样式为 value + suffix,若suffix传“分”,则展示 103分、104分--(Nullable) + 排行榜标题的文案--(Nullable) + 排行榜分区标识--(Nullable) + 以上参数使用json格式传入,例如"{"rankType":"week","dataType":0,"relationType":"all","suffix":"分","rankTitle":"","zoneId":"default"}" + 回调函数 - 获取排序好的「好友/总榜」数据源,开发者基于数据源自行渲染返回的数据 + 获取排序好的「好友/总榜」数据源,开发者基于数据源自行渲染返回的数据 day、week、month、all 0:数字类型 、 1:枚举类型 - friend:当前登录用户的好友的游戏数据排行,default:全部写入数据的排行 ,all: 总榜 - + friend:当前登录用户的好友的游戏数据排行,default:全部写入数据的排行 ,all: 总榜 页码,从1开始 每页长度,大于 0 小于 40 获取成功回调 @@ -4444,13 +4360,11 @@ - 获取排序好的「好友/总榜」数据源,开发者基于数据源自行渲染返回的数据 + 获取排序好的「好友/总榜」数据源,开发者基于数据源自行渲染返回的数据 day、week、month、all--(Require) 0:数字类型 、 1:枚举类型--(Require) - friend:当前登录用户的好友的游戏数据排行,default:全部写入数据的排行 ,all: - 总榜--(Require) - + friend:当前登录用户的好友的游戏数据排行,default:全部写入数据的排行 ,all: 总榜--(Require) 页码,从1开始--(Require) 每页长度,大于 0 小于 40--(Require) 排行榜分区标识--(Nullable) @@ -4460,12 +4374,12 @@ - 游戏内网络请求模块 + 游戏内网络请求模块 - 请求相关设置 + 请求相关设置 @@ -4485,13 +4399,13 @@ - 请求响应 + 请求响应 - 发起一个网络请求。网络相关的 API 在使用前需要配置域名白名单。 - 请参考 https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/guide/basic-ability/network/ + 发起一个网络请求。网络相关的 API 在使用前需要配置域名白名单。 + 请参考 https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/guide/basic-ability/network/ 请求地址 相关设置 @@ -4500,8 +4414,8 @@ - (内部方法)发起一个网络请求。网络相关的 API 在使用前需要配置域名白名单。 - 请参考 https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/guide/basic-ability/network/ + (内部方法)发起一个网络请求。网络相关的 API 在使用前需要配置域名白名单。 + 请参考 https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/guide/basic-ability/network/ 请求地址 相关设置 @@ -4510,7 +4424,7 @@ - 设置是否保持屏幕常亮状态 + 设置是否保持屏幕常亮状态 是否保持屏幕常亮 接口调用成功的回调函数 @@ -4518,14 +4432,14 @@ - 获取屏幕亮度。 + 获取屏幕亮度。 接口调用成功的回调函数,屏幕亮度值,范围 0 ~ 1。0 最暗,1 最亮。 接口调用失败的回调函数 - 设置屏幕亮度。 + 设置屏幕亮度。 屏幕亮度值,范围 0 ~ 1。(0 最暗,1 最亮) 接口调用成功的回调函数 @@ -4534,56 +4448,49 @@ - 分享成功 + 分享成功 - 分享失败 - 错误消息 + 分享失败 + 错误消息 - 分享取消 + 分享取消 - 通用分享 + 通用分享 分享成功回调 分享失败回调 分享取消回调 - - 可填的字段信息参考:https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/retweet/tt-share-app-message/ - + 可填的字段信息参考:https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/retweet/tt-share-app-message/ - 监听用户点击右上角菜单中的“转发”,"拍抖音"按钮时触发的事件 - https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/retweet/tt-on-share-app-message - 需要返回一个ShareParam 对象,用于分享 - https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/retweet/share-param + 监听用户点击右上角菜单中的“转发”,"拍抖音"按钮时触发的事件 https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/retweet/tt-on-share-app-message + 需要返回一个ShareParam 对象,用于分享 https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/retweet/share-param - callback 接收一个 object 类型的参数,属性为:string: channel + callback 接收一个 object 类型的参数,属性为:string: channel - 取消监听用户点击右上角菜单的“转发”按钮时触发的事件。 - https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/retweet/tt-off-share-app-message + 取消监听用户点击右上角菜单的“转发”按钮时触发的事件。 https://microapp.bytedance.com/docs/zh-CN/mini-game/develop/api/retweet/tt-off-share-app-message - 通用分享 + 通用分享 - - 可填的字段信息参考:https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/api/retweet/tt-share-message-to-friend/ - openId string 是 发送对象的 openId - templateId string 是 分享素材模板 id,指定通过平台审核的 templateId 来选择分享内容,需在平台设置且通过审核 - query string 否 查询字符串,必须是 key1=val1&key2=val2 的格式。从这条转发消息进入后,可通过 - tt.getLaunchOptionsSync 或 tt.onShow 获取启动参数中的 query用来实现信息透传 + 可填的字段信息参考:https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/api/retweet/tt-share-message-to-friend/ + openId string 是 发送对象的 openId + templateId string 是 分享素材模板 id,指定通过平台审核的 templateId 来选择分享内容,需在平台设置且通过审核 + query string 否 查询字符串,必须是 key1=val1&key2=val2 的格式。从这条转发消息进入后,可通过 tt.getLaunchOptionsSync 或 tt.onShow 获取启动参数中的 query用来实现信息透传 分享成功回调 分享失败回调 @@ -4591,24 +4498,24 @@ - ShowShareMenu 接口调用成功回调 + ShowShareMenu 接口调用成功回调 - ShowShareMenu 接口调用失败回调 + ShowShareMenu 接口调用失败回调 - ShowShareMenu 接口调用结束回调(调用成功、失败都会执行) + ShowShareMenu 接口调用结束回调(调用成功、失败都会执行) - 设置小游戏转发按钮为显示状态。 - 转发按钮位于小游戏页面右上角的“更多”中。 - 详细信息:https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/api/retweet/tt-show-share-menu + 设置小游戏转发按钮为显示状态。 + 转发按钮位于小游戏页面右上角的“更多”中。 + 详细信息:https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/api/retweet/tt-show-share-menu 接口调用成功的回调函数 接口调用失败的回调函数 @@ -4616,24 +4523,24 @@ - HideShareMenu 接口调用成功回调 + HideShareMenu 接口调用成功回调 - HideShareMenu 接口调用失败回调 + HideShareMenu 接口调用失败回调 - HideShareMenu 接口调用结束回调(调用成功、失败都会执行) + HideShareMenu 接口调用结束回调(调用成功、失败都会执行) - 设置小游戏转发按钮为隐藏状态。 - 转发按钮位于小游戏页面右上角的“更多”中。 - 详细信息:https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/api/retweet/tt-hide-share-menu + 设置小游戏转发按钮为隐藏状态。 + 转发按钮位于小游戏页面右上角的“更多”中。 + 详细信息:https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/develop/api/retweet/tt-hide-share-menu 接口调用成功的回调函数 接口调用失败的回调函数 @@ -4641,7 +4548,7 @@ - 确认当前宿主版本是否支持跳转某个小游戏入口场景。 + 确认当前宿主版本是否支持跳转某个小游戏入口场景。 需要确认的入口场景(目前仅支持的入参为'sidebar') 接口调用成功的回调函数, bool为true说明支持,false表示不支持 @@ -4650,7 +4557,7 @@ - 调用该API可以跳转到某个小游戏入口场景。 + 调用该API可以跳转到某个小游戏入口场景。 需要确认的入口场景(目前仅支持的入参为'sidebar') 接口调用成功的回调函数, bool为true说明支持,false表示不支持 @@ -4659,7 +4566,7 @@ - 调用该API可以跳转到某个小游戏入口场景。支持福利信息透传 + 调用该API可以跳转到某个小游戏入口场景。支持福利信息透传 参数例子{"scene":"sidebar","activityId":"7368350593716338729"} 接口调用成功的回调函数, bool为true说明支持,false表示不支持 @@ -4668,34 +4575,30 @@ - 注册用户参与复访营销活动。当前只支持侧边栏复访活动 + 注册用户参与复访营销活动。当前只支持侧边栏复访活动 - - 指定用户参与的营销活动id,通过OpenAPI申请得到。未填写时,会由平台选择可用活动,可选,例如{"activityId":"111111"} - - 接口调用成功的回调函数, + 指定用户参与的营销活动id,通过OpenAPI申请得到。未填写时,会由平台选择可用活动,可选,例如{"activityId":"111111"} + 接口调用成功的回调函数, 接口调用结束的回调函数(调用成功、失败都会执行) 接口调用失败的回调函数 - 领取营销活动中完成任务后的奖励。当前只支持侧边栏复访活动 + 领取营销活动中完成任务后的奖励。当前只支持侧边栏复访活动 - - 用户参与的营销活动id,通过OpenAPI申请得到。未填写时,会由平台选择可发放的奖励,可选,例如{"activityId":"7368350593716338729"} - - 接口调用成功的回调函数, + 用户参与的营销活动id,通过OpenAPI申请得到。未填写时,会由平台选择可发放的奖励,可选,例如{"activityId":"7368350593716338729"} + 接口调用成功的回调函数, 接口调用结束的回调函数(调用成功、失败都会执行) 接口调用失败的回调函数 - 广告模块的mock层 + 广告模块的mock层 - 登录的mock方法 + 登录的mock方法 @@ -4703,128 +4606,128 @@ - 检查session是否有效的mock方法 + 检查session是否有效的mock方法 - 获取用户信息的mock方法 + 获取用户信息的mock方法 - 获取用户授权状态 + 获取用户授权状态 - 主动打开授权界面,然后获取最新的授权状态 + 主动打开授权界面,然后获取最新的授权状态 - 获取用户已经授权过的配置。 - 结果中只会包含向用户请求过的权限。 - 与 OpenSetting 的区别是 GetSetting 只会获取配置,而不会打开配置页面。 + 获取用户已经授权过的配置。 + 结果中只会包含向用户请求过的权限。 + 与 OpenSetting 的区别是 GetSetting 只会获取配置,而不会打开配置页面。 接口调用成功的回调函数 接口调用失败的回调函数 - 打开设置页面,返回用户设置过的授权结果。 - 结果中只会包含用户请求过的权限。 - 与 GetSetting 的区别是,OpenSetting 会打开设置页面,而 GetSetting 只会返回用户授权的设置信息。 - 接口调用成功的回调函数 - 接口调用失败的回调函数 + 打开设置页面,返回用户设置过的授权结果。 + 结果中只会包含用户请求过的权限。 + 与 GetSetting 的区别是,OpenSetting 会打开设置页面,而 GetSetting 只会返回用户授权的设置信息。 + 接口调用成功的回调函数 + 接口调用失败的回调函数 - 用户在实名认证弹窗完成实名认证后回调 - 必须在游戏初始化阶段就调用 + 用户在实名认证弹窗完成实名认证后回调 + 必须在游戏初始化阶段就调用 - Banner广告的Mock模块 + Banner广告的Mock模块 - 插屏广告的Mock模块 + 插屏广告的Mock模块 - 广告模块的mock层 + 广告模块的mock层 - 收藏模块的Mock层 + 收藏模块的Mock层 - 录屏模块的mock层 + 录屏模块的mock层 - Banner广告的Mock模块 + Banner广告的Mock模块 - 分享模块的mock层 + 分享模块的mock层 - 分享模块的mock层 + 分享模块的mock层 - 分享模块的mock层 + 分享模块的mock层 - 为 StarkInputMock 获取 Unity Input 输入 + 为 StarkInputMock 获取 Unity Input 输入 - 触摸事件回调 + 触摸事件回调 - 获取已存在触点 + 获取已存在触点 - 移除触点 + 移除触点 - 分发 Touch 事件 - 下一帧开始时分发 + 分发 Touch 事件 + 下一帧开始时分发 @@ -4833,44 +4736,44 @@ - Stark 触控事件 API Mock - 通过 Input 获取 Touch 或 Mouse 覆盖到 Stark 事件,仅用于调试。 + Stark 触控事件 API Mock + 通过 Input 获取 Touch 或 Mouse 覆盖到 Stark 事件,仅用于调试。 - 登录成功回调 + 登录成功回调 是否是断线重连,true表示断线重连,false表示正常登录 - 登录失败回调 + 登录失败回调 客户端错误码 客户端错误消息 - 连接断开回调 + 连接断开回调 - 排队队列更新回调 + 排队队列更新回调 排队当前位置 - 排队需要等待的时间,单位 s + 排队需要等待的时间,单位 s - 业务消息事件回调 + 业务消息事件回调 服务器端返回的数据 - 登录事件回调 + 登录事件回调 是否是断线重连,1表示是断线重连,0表示是正常登录 登录结果,0表示登录成功,失败则为客户端错误码 @@ -4879,130 +4782,124 @@ - 登录成功回调 + 登录成功回调 - 登录失败回调 + 登录失败回调 - 断开连接回调 + 断开连接回调 - 排队队列更新回调 + 排队队列更新回调 - 业务消息事件回调 + 业务消息事件回调 - 设置登录回调 + 设置登录回调 登录成功回调 登录失败回调 - 创建一个上下文环境,用于初始化相关信息 + 创建一个上下文环境,用于初始化相关信息 Code ID Code ID 服务器主机地址 服务器端口号 与服务器连接超时时间 - 返回错误码状态,0表示成功,非0表示失败。可以通过调用 GetErrorString 函数获取错误信息。或者直接调用 - GetLastErrorString 获取错误信息。 - + 返回错误码状态,0表示成功,非0表示失败。可以通过调用 GetErrorString 函数获取错误信息。或者直接调用 GetLastErrorString 获取错误信息。 - 销毁上下文环境,清理数据 + 销毁上下文环境,清理数据 - 开始与服务器端建立连接(包括登录流程) - 需要调用SetOnLoginEventCallback,监听登录状态 + 开始与服务器端建立连接(包括登录流程) + 需要调用SetOnLoginEventCallback,监听登录状态 - 返回错误码状态,0表示成功,非0表示失败。可以通过调用 GetErrorString 函数获取错误信息。或者直接调用 - GetLastErrorString 获取错误信息。 - + 返回错误码状态,0表示成功,非0表示失败。可以通过调用 GetErrorString 函数获取错误信息。或者直接调用 GetLastErrorString 获取错误信息。 - 停止与服务器端的连接 + 停止与服务器端的连接 - 与服务器端连接是否已停止 + 与服务器端连接是否已停止 - 更新内部逻辑状态 - !!!Note: 需要定期不断调用该函数(比如每隔100ms调用一次) + 更新内部逻辑状态 + !!!Note: 需要定期不断调用该函数(比如每隔100ms调用一次) - 向服务器端发送业务消息 - 通过调用 SetOnMessageEventCallback 函数监听服务器端的业务消息回调 + 向服务器端发送业务消息 + 通过调用 SetOnMessageEventCallback 函数监听服务器端的业务消息回调 - 返回错误码状态,0表示成功,非0表示失败。可以通过调用 GetErrorString 函数获取错误信息。或者直接调用 - GetLastErrorString 获取错误信息。 - + 返回错误码状态,0表示成功,非0表示失败。可以通过调用 GetErrorString 函数获取错误信息。或者直接调用 GetLastErrorString 获取错误信息。 - 根据错误码获取错误信息 + 根据错误码获取错误信息 返回错误信息文本 - 获取最后一次错误的信息 + 获取最后一次错误的信息 返回错误信息文本 - 业务消息事件回调 + 业务消息事件回调 底层C接口的数据指针 数据长度 - 网络调用的封装 + 网络调用的封装 - RPC调用成功时的回调,返回结果 + RPC调用成功时的回调,返回结果 返回的结果 - RPC调用失败时的回调,返回错误码 + RPC调用失败时的回调,返回错误码 错误码 - 非鉴权的Post方法进行一次RPC + 非鉴权的Post方法进行一次RPC 域名 服务 @@ -5012,312 +4909,311 @@ - 通用结果消息 + 通用结果消息 - 错误信息 + 错误信息 - StarkUDPSocket.Connect 参数 + StarkUDPSocket.Connect 参数 - 要发送消息的地址 + 要发送消息的地址 - 要发送消息的端口号 + 要发送消息的端口号 - StarkUDPSocket.Send 参数 + StarkUDPSocket.Send 参数 - 要发送消息的地址 + 要发送消息的地址 - 要发送消息的端口号 + 要发送消息的端口号 - 要发送的数据 + 要发送的数据 - 发送数据的偏移量,仅当 message 为 ArrayBuffer 类型时有效 - 合法值:自然数,大于等于 message.byteLength 时会设为0 + 发送数据的偏移量,仅当 message 为 ArrayBuffer 类型时有效 + 合法值:自然数,大于等于 message.byteLength 时会设为0 - 发送数据的长度,仅当 message 为 ArrayBuffer 类型时有效 - 合法值:自然数,传入0的时候,会设为 message.byteLength + 发送数据的长度,仅当 message 为 ArrayBuffer 类型时有效 + 合法值:自然数,传入0的时候,会设为 message.byteLength - 向指定地址发消息时,是否要开启广播 + 向指定地址发消息时,是否要开启广播 - 本地信息 + 本地信息 - 远端信息 + 远端信息 - StarkUDPSocket 消息结果 + StarkUDPSocket 消息结果 - 本地信息 + 本地信息 - 远端信息 + 远端信息 - 消息内容 + 消息内容 - 适配层 StarkUDPSocketBind 参数 + 适配层 StarkUDPSocketBind 参数 - bind指定的端口号,合法值:[0, 65535] - 传入0或者不传,则绑定一个系统随机分配的可用端口 + bind指定的端口号,合法值:[0, 65535] + 传入0或者不传,则绑定一个系统随机分配的可用端口 - 适配层 StarkUDPSocketSend 参数 + 适配层 StarkUDPSocketSend 参数 - UDPSocket 实例 + UDPSocket 实例 - 绑定一个系统随机分配的可用端口,或绑定一个指定的端口号。bind 成功会触发 onListening 监听。 + 绑定一个系统随机分配的可用端口,或绑定一个指定的端口号。bind 成功会触发 onListening 监听。 - bind指定的端口号,合法值:[0, 65535]。传入0或者不传,则绑定一个系统随机分配的可用端口。 - + bind指定的端口号,合法值:[0, 65535]。传入0或者不传,则绑定一个系统随机分配的可用端口。 绑定成功的端口号 - 关闭 UDP Socket 实例。 - 在关闭之后,将无法再调用 Bind、Connect、Bind 等方法。 + 关闭 UDP Socket 实例。 + 在关闭之后,将无法再调用 Bind、Connect、Bind 等方法。 - 预先连接到指定的 IP 和端口。 + 预先连接到指定的 IP 和端口。 - 监听收到消息的事件 + 监听收到消息的事件 事件监听函数 回调中是否带有本地和远端地址信息 - 移除收到消息事件的事件监听函数 + 移除收到消息事件的事件监听函数 事件监听函数 - 监听关闭的事件 + 监听关闭的事件 事件监听函数 - 移除关闭事件的事件监听函数 + 移除关闭事件的事件监听函数 事件监听函数 - 监听错误的事件 + 监听错误的事件 事件监听函数 - 移除错误事件的事件监听函数 + 移除错误事件的事件监听函数 事件监听函数 - 监听开始监听数据包的事件 + 监听开始监听数据包的事件 事件监听函数 - 移除开始监听数据包事件的事件监听函数 + 移除开始监听数据包事件的事件监听函数 事件监听函数 - 向指定 IP 和端口发送消息。 - 支持发送 string 或 byte[] 二进制数据。 + 向指定 IP 和端口发送消息。 + 支持发送 string 或 byte[] 二进制数据。 发送消息的参数 - - 触控事件适配 - 挂载到 EventSystem 对象上以解决 WebGL 方案下多点触控时,部分触点 PointerUp 等事件丢失的问题。 - - - 当前脚本会通过重载 StandaloneInputModule,将全局鼠标/触控事件映射到 StarkSDK。 - 如果需要进一步重载 UnityEngine.Input,请参考 UnityInputOverride.cs。 - 如果不需要全局重载,可使用 StarkSDK.API.GetStarkInput() 手动挂载触控监听。 - - 勾选 DebugTraceEnabled,可以打印更多调试日志。 - 仅在 WebGL 方案下生效;Native 和 Unity Editor 环境中不会有任何作用。 - + + 触控事件适配 + 挂载到 EventSystem 对象上以解决 WebGL 方案下多点触控时,部分触点 PointerUp 等事件丢失的问题。 + + + 当前脚本会通过重载 StandaloneInputModule,将全局鼠标/触控事件映射到 StarkSDK。 + 如果需要进一步重载 UnityEngine.Input,请参考 UnityInputOverride.cs。 + 如果不需要全局重载,可使用 StarkSDK.API.GetStarkInput() 手动挂载触控监听。 + + 勾选 DebugTraceEnabled,可以打印更多调试日志。 + 仅在 WebGL 方案下生效;Native 和 Unity Editor 环境中不会有任何作用。 + - 是否启用 DebugMode - 开启时,在 Touch 事件触发时会输出调试日志。 + 是否启用 DebugMode + 开启时,在 Touch 事件触发时会输出调试日志。 - 是否启用 Mock - 开启时,允许在 Unity Editor 环境下使用 Mock 实现调试,Mock 效果不代表真机情况。 + 是否启用 Mock + 开启时,允许在 Unity Editor 环境下使用 Mock 实现调试,Mock 效果不代表真机情况。 - 当前激活的触控点 + 当前激活的触控点 - 要重载的 StandaloneInputModule 对象 + 要重载的 StandaloneInputModule 对象 - 当前是否已重载 + 当前是否已重载 - 重载是否处于已激活状态 + 重载是否处于已激活状态 - 获取 InputModule 对象 + 获取 InputModule 对象 - 启用时注册事件并设置 InputOverride + 启用时注册事件并设置 InputOverride - 禁用时移除事件并还原 InputOverride + 禁用时移除事件并还原 InputOverride - 注册触控事件 + 注册触控事件 - 移除触控事件监听 + 移除触控事件监听 - 响应触控移动 + 响应触控移动 - 响应触控结束 + 响应触控结束 - 响应触控取消 + 响应触控取消 - 每帧结束后,设置 Began 触控点为按住状态,并清理已结束的触控点 + 每帧结束后,设置 Began 触控点为按住状态,并清理已结束的触控点 - 获取已存在的 TouchData + 获取已存在的 TouchData - 创建一个新的 TouchData + 创建一个新的 TouchData - 获取 TouchData 找不到则创建 + 获取 TouchData 找不到则创建 - 更新指定 TouchData + 更新指定 TouchData @@ -5326,33 +5222,33 @@ - 移除所有已经结束的触控点 + 移除所有已经结束的触控点 - Make sure the UnityCache folder disk occupation is under the limit - Will be checked consquently since the Addressable or the developer might overwrite it. - + Make sure the UnityCache folder disk occupation is under the limit + Will be checked consquently since the Addressable or the developer might overwrite it. + - Android Toast提示 - 类似于直接调用Toast.makeText(context, message, Toast.LENGTH_SHORT).show() + Android Toast提示 + 类似于直接调用Toast.makeText(context, message, Toast.LENGTH_SHORT).show() 提示信息 - Android Toast提示 - 类似于直接调用Toast.makeText(context, message, Toast.LENGTH_LONG).show() + Android Toast提示 + 类似于直接调用Toast.makeText(context, message, Toast.LENGTH_LONG).show() 提示信息 - Android 弹出式对话框 + Android 弹出式对话框 标题 内容 @@ -5364,7 +5260,7 @@ - Android 进度加载弹窗 + Android 进度加载弹窗 提示信息 Loading弹窗是否取消(点击空白区域关闭界面) @@ -5372,51 +5268,50 @@ - 隐藏进度加载弹窗 + 隐藏进度加载弹窗 - 以同步的隐藏一个弹框 + 以同步的隐藏一个弹框 - Mock设置类 + Mock设置类 - 用于记录开放了哪些模块 + 用于记录开放了哪些模块 - 是否屏蔽Mock的弹窗 + 是否屏蔽Mock的弹窗 - 获取当前设置的每个模块是否开放 + 获取当前设置的每个模块是否开放 - 打开所有的Mock模块,默认关闭所有模块 + 打开所有的Mock模块,默认关闭所有模块 - 关闭所有的Mock模块,默认关闭所有模块 + 关闭所有的Mock模块,默认关闭所有模块 - 分模块设置各个功能模块对应的Mock UI开放和关闭,默认关闭所有模块 - extraData 大部分模块默认填null即可,目前已知的应用场景如下: - module == MockModule.Host,enable == true,则extraData为 - 的变量,模拟当前在何处启动等 + 分模块设置各个功能模块对应的Mock UI开放和关闭,默认关闭所有模块 + extraData 大部分模块默认填null即可,目前已知的应用场景如下: + module == MockModule.Host,enable == true,则extraData为的变量,模拟当前在何处启动等 目标功能模块 是否开放 @@ -5424,140 +5319,147 @@ - 判断一个功能模块的Mock层是否已经打开 + 判断一个功能模块的Mock层是否已经打开 目标模块 Mock层是否打开 - 使用GUI绘制出Mock层的工具类 + 使用GUI绘制出Mock层的工具类 - 初始化 + 初始化 - 键值对显示mock选项 + 键值对显示mock选项 要显示的内容 当前显示的目标模块 - 获取屏幕密度,和屏幕的英寸长度dpi = a*a+b*b然后开平方再除以 屏幕英寸。 - dp = px * (dpi / 160) + 获取屏幕密度,和屏幕的英寸长度dpi = a*a+b*b然后开平方再除以 屏幕英寸。 + dp = px * (dpi / 160) - 创建一个UI用于显示提示 + 创建一个UI用于显示提示 + + + 通过客户端的埋点上报工具上报 + + + + - 团结引擎运行时平台 + 团结引擎运行时平台 - 小游戏 + 小游戏 - 开放鸿蒙 + 开放鸿蒙 - Android HMI + Android HMI - 引擎发行版 + 引擎发行版 - 未知 + 未知 - Unity 引擎 + Unity 引擎 - 团结引擎 + 团结引擎 - 平台相关判断工具类 + 平台相关判断工具类 - 是否是团结引擎 + 是否是团结引擎 - 是否是类 WebGL 平台 + 是否是类 WebGL 平台 - 是否是类 Android 平台 + 是否是类 Android 平台 - 通用Unity单例 + 通用Unity单例 - Toast提示 + Toast提示 提示信息 - Toast提示 + Toast提示 提示信息 - 时间工具类 + 时间工具类 - 获取当前时间,单位ms + 获取当前时间,单位ms - 用于适配 Unity 版本间 API 迁移 + 用于适配 Unity 版本间 API 迁移 - 调用 UnityWebRequest.PostWwwForm + 调用 UnityWebRequest.PostWwwForm @@ -5566,9 +5468,9 @@ - 创建用于视频裁剪的时间片段 (需要在开始录屏后调用) - 以调用时的录屏时刻为基准,指定前 x 毫秒,后 y 毫秒为将要裁剪的片段,可以多次调用,记录不同时刻。 - 在结束录屏时,可以调用 ClipVideo 接口剪辑并合成记录的片段。 + 创建用于视频裁剪的时间片段 (需要在开始录屏后调用) + 以调用时的录屏时刻为基准,指定前 x 毫秒,后 y 毫秒为将要裁剪的片段,可以多次调用,记录不同时刻。 + 在结束录屏时,可以调用 ClipVideo 接口剪辑并合成记录的片段。 记录那一刻前的毫秒数 记录那一刻后的毫秒数 @@ -5576,34 +5478,34 @@ - 处理Android通讯的工具类 + 处理Android通讯的工具类 - 确保在主线程执行初始化。 + 确保在主线程执行初始化。 - 发送消息到Native + 发送消息到Native - 异步Call通讯 - + 异步Call通讯 + 消息类型0-call消息,1-listen消息,2-unlisten消息,3-event消息 目标接口 参数 - - + + - 混合Call通讯,调用直接返回一段String的数据,同时会有回调。 + 混合Call通讯,调用直接返回一段String的数据,同时会有回调。 目标API接口 参数 @@ -5612,338 +5514,338 @@ - 异步Call通讯 + 异步Call通讯 - - 同步Call通讯 - + + 同步Call通讯 + 消息类型0-call消息,1-listen消息,2-unlisten消息,3-event消息 目标接口 参数 - + - 同步Call通讯 + 同步Call通讯 - 查询Native层是否支持某个API + 查询Native层是否支持某个API 接口名 - BridgeAPI的包装类 + BridgeAPI的包装类 - BridgeAPI的委托 + BridgeAPI的委托 - 回调接口 + 回调接口 - 回调被添加的事件,ns + 回调被添加的事件,ns - 默认Call超时,默认使用通用的超时,10秒 + 默认Call超时,默认使用通用的超时,10秒 - 回调成功 + 回调成功 - 回调失败 + 回调失败 失败码 失败原因 - 超时 + 超时 - UBridge的内部实现 + UBridge的内部实现 - 超时时间 + 超时时间 - 成功 + 成功 - 接口未支持 + 接口未支持 - 接口不支持异步调用 + 接口不支持异步调用 - 缺少参数 + 缺少参数 - 接口不支持同步调用 + 接口不支持同步调用 - 以callback_id为key维护回调。 + 以callback_id为key维护回调。 - 以接口名为key,维护回调 + 以接口名为key,维护回调 - Unity侧以接口的形式实现的API,比委托优先 + Unity侧以接口的形式实现的API,比委托优先 - Unity侧以委托的形式实现的API + Unity侧以委托的形式实现的API - 本地注册的事件列表 + 本地注册的事件列表 - Native端注册的事件列表 + Native端注册的事件列表 - 超时定时器 + 超时定时器 - 定时器是否已经启动,避免重复启动; + 定时器是否已经启动,避免重复启动; - 超时时间,默认10秒 + 超时时间,默认10秒 - 启动超时定时器 + 启动超时定时器 - 停止超时定时器 + 停止超时定时器 - 重新设置Call的超时时间 + 重新设置Call的超时时间 单位ms - Unity注册接口形式的API接口 + Unity注册接口形式的API接口 接口名 接口实现 - Unity注册委托形式的API + Unity注册委托形式的API 接口名 接口实现 - Unity注销接口形式的API接口 + Unity注销接口形式的API接口 接口名 - Unity注册事件 + Unity注册事件 - Unity发送事件消息 + Unity发送事件消息 目标事件 数据 - 异步调用native的方法 + 异步调用native的方法 目标接口 参数数据 回调 - + - 异步调用native的方法 + 异步调用native的方法 目标接口 参数数据 回调 - + - 监听事件 + 监听事件 目标接口 新的监听是否覆盖旧的 - 回调 - + 回调 + - 关闭监听事件 + 关闭监听事件 - + 目标接口 - + - 处理Native调用过来的消息 + 处理Native调用过来的消息 消息数据,JSON格式 - 处理Native的调用消息。 + 处理Native的调用消息。 - 处理Unity调用Native回来的回包。 + 处理Unity调用Native回来的回包。 - 消息的封装 + 消息的封装 - 消息ID + 消息ID - 消息类型,消息类型0-call消息,1-listen消息,2-unListen消息,3-event消息 + 消息类型,消息类型0-call消息,1-listen消息,2-unListen消息,3-event消息 - 回调,唯一 + 回调,唯一 - 错误码 + 错误码 - 消息来源 + 消息来源 - 目标接口或者事件 + 目标接口或者事件 - 错误消息 + 错误消息 - 数据 + 数据 - 参数 + 参数 - Unity侧的SDK版本号 + Unity侧的SDK版本号 - Native侧的SDK版本号 + Native侧的SDK版本号 - SDK的版本信息 + SDK的版本信息 - SDK版本号 + SDK版本号 - 从JsonData中安全的读取数据的帮助类 + 从JsonData中安全的读取数据的帮助类 - 读取int + 读取int @@ -5951,7 +5853,7 @@ - 读取string + 读取string @@ -5959,7 +5861,7 @@ - 读取JsonData + 读取JsonData @@ -5967,7 +5869,7 @@ - 读取Object + 读取Object @@ -5975,61 +5877,61 @@ - Bridge接口 + Bridge接口 - iOS的通信接口 + iOS的通信接口 - 确保在主线程执行初始化。 + 确保在主线程执行初始化。 - 发送消息到Native + 发送消息到Native - 异步Call通讯 - + 异步Call通讯 + 消息类型0-call消息,1-listen消息,2-unlisten消息,3-event消息 目标接口 参数 - - + + - 异步Call通讯,确保调用在主线程执行 + 异步Call通讯,确保调用在主线程执行 - - 同步Call通讯 - + + 同步Call通讯 + 消息类型0-call消息,1-listen消息,2-unlisten消息,3-event消息 目标接口 参数 - + - 同步Call通讯 + 同步Call通讯 - 混合Call通讯,调用直接返回一段String的数据,同时会有回调。 + 混合Call通讯,调用直接返回一段String的数据,同时会有回调。 目标API接口 参数 @@ -6038,29 +5940,29 @@ - 查询Native层是否支持某个API + 查询Native层是否支持某个API 接口名 - 日志辅助类 + 日志辅助类 - 线程调度 + 线程调度 - 处理消息 + 处理消息 - 打包成功的回包 + 打包成功的回包 请求的消息 回包的数据 @@ -6068,7 +5970,7 @@ - 打包失败的回包 + 打包失败的回包 请求的消息 错误码 @@ -6077,7 +5979,7 @@ - 打包异步Call消息 + 打包异步Call消息 消息类型0-call消息,1-listen消息,2-unListen消息,3-event消息 目标接口 @@ -6087,7 +5989,7 @@ - 打包同步Call消息 + 打包同步Call消息 消息类型0-call消息,1-listen消息,2-unListen消息,3-event消息 目标接口 @@ -6096,7 +5998,7 @@ - 打包事件的消息 + 打包事件的消息 目标事件 数据 @@ -6104,95 +6006,95 @@ - 解析消息 + 解析消息 JSON格式的消息 - 同步调用的结果转换 + 同步调用的结果转换 JSON字符串 - Bridge的上下文 + Bridge的上下文 - 回调成功 + 回调成功 数据 - 回调失败 + 回调失败 错误码 错误信息 - webgl的通讯接口 + webgl的通讯接口 - 确保在主线程执行初始化。 + 确保在主线程执行初始化。 - 发送消息到Native + 发送消息到Native - 异步Call通讯 - + 异步Call通讯 + 消息类型0-call消息,1-listen消息,2-unlisten消息,3-event消息 目标接口 参数 - - + + - 异步Call通讯,确保调用在主线程执行 + 异步Call通讯,确保调用在主线程执行 - - 同步Call通讯 - + + 同步Call通讯 + 消息类型0-call消息,1-listen消息,2-unlisten消息,3-event消息 目标接口 参数 - + - 同步Call通讯 + 同步Call通讯 - 查询h5是否支持某个接口 + 查询h5是否支持某个接口 - 混合Call通讯,确保调用在主线程执行 + 混合Call通讯,确保调用在主线程执行 目标API接口 参数 @@ -6200,183 +6102,174 @@ - `PlayerPrefs` is a class that stores Player preferences between game sessions. It can store - string, float and integer values into the user’s platform registry. - + `PlayerPrefs` is a class that stores Player preferences between game sessions. It can store string, float and integer values into the user’s platform registry. - Sets a single integer value for the preference identified by the given key. You can use - PlayerPrefs.GetInt to retrieve this value. - + Sets a single integer value for the preference identified by the given key. You can use PlayerPrefs.GetInt to retrieve this value. - Returns the value corresponding to key in the preference file if it exists. + Returns the value corresponding to key in the preference file if it exists. - Sets the float value of the preference identified by the given key. You can use - PlayerPrefs.GetFloat to retrieve this value. - + Sets the float value of the preference identified by the given key. You can use PlayerPrefs.GetFloat to retrieve this value. - Returns the value corresponding to key in the preference file if it exists. + Returns the value corresponding to key in the preference file if it exists. - Sets a single string value for the preference identified by the given key. You can use - PlayerPrefs.GetString to retrieve this value. - + Sets a single string value for the preference identified by the given key. You can use PlayerPrefs.GetString to retrieve this value. - Returns the value corresponding to key in the preference file if it exists. + Returns the value corresponding to key in the preference file if it exists. - Returns true if the given key exists in PlayerPrefs, otherwise returns false. + Returns true if the given key exists in PlayerPrefs, otherwise returns false. - Removes the given key from the PlayerPrefs. If the key does not exist, DeleteKey has no impact. - + Removes the given key from the PlayerPrefs. If the key does not exist, DeleteKey has no impact. - Removes all keys and values from the preferences. Use with caution. + Removes all keys and values from the preferences. Use with caution. - Writes all modified preferences to disk. + Writes all modified preferences to disk. - Unicode转utf8编码 + Unicode转utf8编码 - 封装了和Native通讯的接口。 + 封装了和Native通讯的接口。 - 初始化Bridge + 初始化Bridge - 重新设置Call的超时时间,单位毫秒 + 重新设置Call的超时时间,单位毫秒 单位ms - Unity注册API,以接口的形式 + Unity注册API,以接口的形式 接口名 接口的实现 - Unity注册API,以委托的形式提供 + Unity注册API,以委托的形式提供 - Unity注册API,以接口的形式 + Unity注册API,以接口的形式 接口名 接口的实现 - Unity注册事件 + Unity注册事件 - Unity发送事件消息 + Unity发送事件消息 - 异步调用native的方法,不需要回调和参数 + 异步调用native的方法,不需要回调和参数 目标接口 - + - 异步调用native的方法,不需要回调 + 异步调用native的方法,不需要回调 目标接口 - 参数数据 - + 参数数据 + - 异步调用native的方法 + 异步调用native的方法 目标接口 参数数据 回调 - + - 异步调用native的方法 + 异步调用native的方法 目标接口 参数数据 回调 超时,默认10秒,单位毫秒 - + - 混合Call,函数可以带回一段string数据 + 混合Call,函数可以带回一段string数据 目标API - 混合Call,函数可以带回一段string数据 + 混合Call,函数可以带回一段string数据 目标API 参数 @@ -6384,7 +6277,7 @@ - 混合Call,函数可以带回一段string数据,同时有回调 + 混合Call,函数可以带回一段string数据,同时有回调 目标API 参数 @@ -6393,7 +6286,7 @@ - 混合Call,函数可以带回一段string数据,同时有回调 + 混合Call,函数可以带回一段string数据,同时有回调 目标API 参数 @@ -6403,47 +6296,47 @@ - 同步调用native的方法 + 同步调用native的方法 目标接口 - 参数数据 - + 参数数据 + - 监听事件 + 监听事件 目标接口 - 回调 - + 回调 + - 监听事件 + 监听事件 目标接口 新的监听是否覆盖旧的 - 回调 - + 回调 + - 关闭监听事件 + 关闭监听事件 - + 目标接口 - + - 查询Native层是否支持某个API + 查询Native层是否支持某个API - 处理Native调用过来的消息,通讯接口 + 处理Native调用过来的消息,通讯接口 消息数据,JSON格式 diff --git a/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.xml.meta b/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.xml.meta index 30c22e4..d8b8b3e 100644 --- a/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.xml.meta +++ b/Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b0c4fb9472cfd40448da7aa84d2bce7c +guid: b61f5c409c35c45a8b751ded99f705c1 TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/Easy Save 3/Change Log/Change Log.txt b/Assets/Plugins/Easy Save 3/Change Log/Change Log.txt deleted file mode 100644 index 060e461..0000000 --- a/Assets/Plugins/Easy Save 3/Change Log/Change Log.txt +++ /dev/null @@ -1,207 +0,0 @@ -3.5.6 -- ES3GameObject Component is now automatically moved to end of Components List to ensure that it's loaded after the Components it references. -- Resolved merge issue where cached data was being stored with it's generic type rather than actual type. -- Resolved issue where private members of inherited types wouldn't be saved in specific circumstances. - -3.5.5 -- References are now gathered when saving a scene and when changes are made in a scene, not when entering playmode. -- Added option to refresh reference managers in all scenes (Tools > Easy Save 3 > Refresh References for All Scenes). -- Added option to exclude references from being added to the manager (right-click > Easy Save 3 > Exclude Reference(s) from Manager). -- Added GetColumnLength and GetRowLength methods to ES3Spreadsheet. -- Resolved issue where enums would cause a FormatException when they were fields of a class with an ES3Type. -- Worked around Unity bug where initialisation events are sometimes not called when importing Easy Save. -- Worked around Unity bug where GetDirectoryName fails to work with a path to a file. -- Auto Saves are now processed in order of their position in the hierarchy. -- Resolved issue where members would be serialized twice when it was marked as ES3Serializable in both concrete and base classes. -- Worked around Unity bug where Unity would throw an error when trying to set a scripting define symbol for Stadia. -- Accounted for change in 2022.3 LTS where Unity have fixed a typo in their Editor API ("ToolbarSeachTextField") - -3.5.4 -- You can now enable Assembly Definition Files for Easy Save by going to Tools > Easy Save 3 > Enable Assembly Definition Files. -- Accounted for edge case where ES3File would be merged rather than overwritten, preventing keys from being deleted from the stored file. -- Resolved issue where reference collection can cause an InvalidOperationException (Collection was modified). -- Worked around bug with Unity Runner Template which prevented Easy Save types from loading. -- overrideSprite is no longer saved when saving UI.Image as Unity now returns the Sprite rather than null when this is unassigned. -- Resolved issue where Auto Save's events sometimes did not update when changing the active scene in the Editor. -- Resolved issue where saving a non-prefab instance GameObject with multiple Components would only save one of those Components. - -3.5.3 -- Attempting to save a Material with a RenderTexture will now throw a warning indicating that the RenderTexture won't be saved. -- Added filtering by tag in the Auto Save window by prefixing 'tag:' to the search query. - -3.5.2 -- Resolved issue where RectTransform was loaded incorrectly as parent is deserialized before anchoredPosition. -- Removed warning regarding Transform parents being set using the accessor rather than the SetParent method. -- ES3.CopyFile now automatically creates the target directory if it doesn't exist. -- Added an option to encrypt/compress raw cached data if the setting is defined for the cached file (postprocessRawCachedData). -- 'Add References to Manager' now permanently adds prefabs to the manager if 'Auto Add Prefabs to Manager' is enabled. -- Assembly names are now in alphabetical order so changes in order aren't registered as a change in version control. -- Using 'Add References to Manager' on a folder now adds all supported assets in that folder to the reference manager. - -3.5.1 -- Reverted changes to LoadRaw methods when using Cache as it caused regression issues. - -3.5.0 -- Added support for NativeArray. -- Managed case where ES3.EncryptBytes/DecryptBytes encountered an encoding issue. -- Worked around Unity bug where invalid assembly list would cause issues when exceptions are disabled. -- Worked around bug at Unity's end where unloaded scenes are returned by their methods. -- Resolved issue where scripting define symbols were overwritten on older versions of Unity. -- Worked around bug where inertia tensor value is rejected even when set as it's default upon loading. -- Most Material properties can now be saved, including custom properties. -- When saving a parent GameObject, children automatically have their parent set to the parent GameObject rather than loading this value by reference. -- Support added for Tuples. -- Added overload for AppendRaw which accepts a string and a filename. -- Worked around Unity bug where EventType.Layout isn't called when moving tabs for first time, causing Types pane recent types to be uninitialised. -- Worked around Unity bug which infrequently prevented Auto Save changes from persisting. -- Added ES3.Compress and ES3.Decompress methods. -- Performing 'Add Reference(s) to Manager' for a Texture2D will also add it's Sprite if one is present. -- Classes without parameterless constructors can now be serialised (note that their constructor will not be called). -- Resolved issue where an unloaded scene warning was thrown when scene is open but manually marked as unloaded in the Editor. - -3.4.2 -- Resolved issue where Unity Visual Scripting defines were not present on some versions of Unity. - -3.4.1 -- Added support for Particle System Bursts -- Resolved issue where Auto Save would sometimes save all Components regardless of settings. -- Resolved issue where Auto Save icon would not highlight when fields are selected. -- Structs with private properties or fields can now be serialized. -- Loading a blank string from a spreadsheet now returns a blank string rather than null. -- The reference manager will only collect references up to 3 levels deep to improve performance. -- System.Random support has been dropped due to Unity's implementation changing, making it non-serializable. -- ES3Ref is no longer stored twice for ScriptableObjects. -- Added support for Numerics.BigInteger. -- Internal fields of the ES3AutoSave Component are no longer displayed in the Editor. -- If a reference ID for a Component exists, it now ignores the GameObject ID so that a new GO instance is not created. -- Added a Get Streaming Assets Path action for Playmaker. -- Added non-generic versions of the ES3Spreadsheet methods to work around issue with Bolt. -- Worked around issue with Bolt where it would crash if you have two methods with the same parameters but one is generic. -- Resolved issue where Components marked as destroyed but not yet destroyed would cause unexpected behaviour. -- Auto Save will now work for additive scenes. -- Resolved issue where reference manager wasn't automatically updated when scene was open additively prior to runtime. -- Support added for Unity Visual Scripting. - -3.4.0 -- Caching now works seamlessly between Cloud and Auto Save. -- Added Save Multiple and Load Multiple actions to enable saving multiple specific variables at once. -- Added extra overloads to the ES3.LoadString method. -- Guids are now natively supported. -- Transform now stores the sibling index. -- Getting a timestamp for a file in cache which doesn't exist now returns a zero timestamp. -- Resolved issues where enums would sometiimes not serialize correctly when creating an ES3Type script for a class. -- Resolved issue where DownloadTimestamp PlayMaker action would download the wrong data. -- Resolved issue where reflection does not recognise a collection of a nested type as a nested type. -- Resolved issue where ES3Cloud was merged with the debug branch. -- Resolved issue where Sprites with atlased Textures would save an incorrect Rect. -- Resolved issue where ES3Spreadsheet was serializing primitives as objects when using PlayMaker actions. - -3.3.2f7 -- Type data is now stored when using ES3.Serialize. -- Worked around issue where Unity would return an incorrect number of assemblies. - -3.3.2f6 -- ES3Spreadsheet now correctly serializes object types into a CSV file. -- Resolved issue where an object[] containing primitive types could not be loaded in some situations. -- Worked around issue where PlayMaker wouldn't initialize variable before it's value was reset. -- Created a workaround for some situations where Unity creates new instances of ScriptableObjects in Assets at runtime. -- Resolved issue where Base-64 encoding option would not work with newline option in PlayMaker SaveRaw action. - -3.3.2f5 -- Resolved issue where scripts were not overwritten by Asset Store importer, causing Easy Save to be unstable. - -3.3.2f4 -- Resolved issue where Save action for PlayMaker could return NullReferenceException due to using the wrong ES3.Save override. -- Worked around IL2CPP bug where reflection would not find particular ES3Types on iOS -- Resolved issue where trying to store an empty/unassigned PlayMaker object would throw a NulReferenceException. -- Keys of a type which no longer exists in the project are now automatically removed -- Abstract types used in an ES3Type will now work as intended - -3.3.2f3 -- Added GameObject variables to Auto Save -- Resolved issue where Sprites would be loaded with the incorrect pivot. -- Resolved issue where Stacks were loaded in reverse. -- Added a 'quality' field to the ES3.SaveImage method to allow the quality to be specified when saving JPEGs. - -3.3.2f2 -- Added method which allows raw bytes to be uploaded via ES3Cloud. -- Worked around issue where File IO was called on platforms which don't support it -- Accounted for situations where Component should evaluate to null but doesn't -- Updated PlayMaker actions to work around issue where global variables sometimes go missing -- Objects with the NotEditable hideFlags can now be stored by reference -- Worked around Unity bug where it fails to deserialize data when Prefab mode is open -- Resolved issue where global 'Save GameObject Children' settings can take precedence over Auto Save settings -- 'Enable Easy Save for Prefab' context menu item now works when multiple objects are selected. - -3.3.2f1 -- Resolved issue where Components on prefabs would sometimes not be added to the reference manager. -- Resolved issue where reference ID was read unnecesserily, causing format exception. -- Resolved issue where child prefabs would not be recognised by manager. - -3.3.1p12 -- Resolved case where certain references would not be added to manager. - -3.3.1f11 -- Fixed issue where using ES3.CacheFile with an encrypted file could fail. -- Fixed issue where Directory.GetFiles cannot process a full path on certain configurations. -- Accounted for case where HideFlags are changed during build process. -- Added a timeout parameter to the ES3Cloud constructor. -- ES3.Serialize and ES3.Deserialize now work with encryption and compression - -3.3.1f10 -- Full support for projects which use multiple scenes at once. -- Added ES3.Encrypt and ES3.Decrypt methods. -- Supported saving the active state and FsmVariables of PlayMaker FSMs. -- Added edge case for SkinnedMeshRenderers which use LODs to ensure that all meshes and Materials are added to the reference manager. -- Ensured that Auto Update References setting is ackowledged when first adding manager to scene. -- Moved menu items into Tools/Easy Save 3 menu. -- Using LoadInto will now assign the loaded reference ID to the object you're loading into. - -3.3.1f9 -- It's not possible to add an ES3ReferenceMgr to your scene directly, ensuring that initialisation code is performed. -- Compressed files can now be cached. -- Ability to only add prefabs directly referenced by your scene to the manager. - -3.3.1f8 -- Caching is now enabled by default for Auto Save, significantly improving performance. -- Added ES3.LoadString method so you do not need to provide all parameters to use the defaultValue overload. -- Resolved case where SaveAll would not correctly save some types of array. -- Resolved case where global references would not be acknowledged. - -3.3.1f7 -- Serialization depth limit has been raised to account for projects with deep hierearchies -- Fixed issue where Easy Save 3 Manager could not be found for scenes which had not been saved. -- Resolved issue where Add Reference(s) to Manager would not dirty scene when Auto Update References was disabled. -- Improved Editor performance by accounting for situations where post-processing events would be called multiple times. - -3.3.1f6 -- Internal fields of the UnityEngine.Object class are hidden in the Types pane as they are not serialisable. -- Accounted for edge case where unassigned script is returned by GameObject.GetComponents(). -- ES3Settings constructor now accepts any settings enum (e.g. ES3.Location). -- No longer throws warning when multiple scenes are open. - -3.3.1f5 -- Updated PlayMaker actions. -- Provided workaround for issue where IL2CPP stripper removes methods which are marked to not be stripped. -- Performance updates. - -3.3.1f4 -- Improved performance when gathering references for reference manager. - -3.3.1f3 -- Added Cache as a storage location, providing a much simpler way of caching data. -- References can now be added by right-clicking the object and going to Easy Save 3 > Add Reference to Manager. -- Floats and doubles are now stored with full precision. -- Assorted bug fixes. - -3.3.1f2 -- Added compression, reducing file size by 85% on average when enabled -- JSON is now pretty printed (formatted) by default -- Added attributes to control serialisation -- Private fields in inherited classes are now stored -- Added search capabilities to the Auto Save window -- The way in which GameObjects is saved is now more flexible -- The reference manager is now updated whenever playmode is entered -- Null values in the global manager are now automatically removed -- Fixed issue where default settings were not applied properly -- Fixed issue where ES3Types would be stored in Easy Save root rather than in Assets/Easy Save 3/ \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Change Log/Change Log.txt.meta b/Assets/Plugins/Easy Save 3/Change Log/Change Log.txt.meta deleted file mode 100644 index 1dfb669..0000000 --- a/Assets/Plugins/Easy Save 3/Change Log/Change Log.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 48fdb523e0bb47f479a18f9b236df644 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor.meta b/Assets/Plugins/Easy Save 3/Editor.meta deleted file mode 100644 index 4ee985c..0000000 --- a/Assets/Plugins/Easy Save 3/Editor.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 600dbc665993148f7b59ae7356fe862e -folderAsset: yes -timeCreated: 1474041532 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/AddES3Prefab.cs b/Assets/Plugins/Easy Save 3/Editor/AddES3Prefab.cs deleted file mode 100644 index c486dc7..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/AddES3Prefab.cs +++ /dev/null @@ -1,82 +0,0 @@ -using ES3Internal; -using UnityEditor; - -namespace ES3Editor -{ - public class AddES3Prefab : Editor - { - [MenuItem("GameObject/Easy Save 3/Enable Easy Save for Prefab(s)", false, 1001)] - [MenuItem("Assets/Easy Save 3/Enable Easy Save for Prefab(s)", false, 1001)] - public static void Enable() - { - if (Selection.gameObjects == null || Selection.gameObjects.Length == 0) - return; - - foreach (var obj in Selection.gameObjects) - { - // Don't add the Component to a GameObject which already has it. - if (obj == null || obj.GetComponent() != null) - continue; - - var go = obj; - - #if UNITY_2018_3_OR_NEWER - if (PrefabUtility.GetPrefabInstanceStatus(go) != PrefabInstanceStatus.NotAPrefab) - { - go = PrefabUtility.GetCorrespondingObjectFromSource(go); - if (go == null) - continue; - } - #else - if(PrefabUtility.GetPrefabType(go) != PrefabType.Prefab) - { - go = (GameObject)PrefabUtility.GetPrefabParent(go); - if(go == null) - continue; - } - #endif - - var es3Prefab = Undo.AddComponent(go); - es3Prefab.GeneratePrefabReferences(); - - if (ES3ReferenceMgrBase.Current != null) - { - ES3ReferenceMgrBase.Current.AddPrefab(es3Prefab); - EditorUtility.SetDirty(ES3ReferenceMgrBase.Current); - } - } - } - - [MenuItem("GameObject/Easy Save 3/Enable Easy Save for Prefab(s)", true, 1001)] - [MenuItem("Assets/Easy Save 3/Enable Easy Save for Prefab(s)", true, 1001)] - public static bool Validate() - { - return Selection.gameObjects != null && Selection.gameObjects.Length > 0; - } - } - - public class RemoveES3Prefab : Editor - { - [MenuItem("GameObject/Easy Save 3/Disable Easy Save for Prefab(s)", false, 1001)] - [MenuItem("Assets/Easy Save 3/Disable Easy Save for Prefab(s)", false, 1001)] - public static void Enable() - { - if (Selection.gameObjects == null || Selection.gameObjects.Length == 0) - return; - - foreach (var obj in Selection.gameObjects) - { - var es3prefab = obj.GetComponent(); - if (es3prefab != null) - Undo.DestroyObjectImmediate(es3prefab); - } - } - - [MenuItem("GameObject/Easy Save 3/Disable Easy Save for Prefab(s)", true, 1001)] - [MenuItem("Assets/Easy Save 3/Disable Easy Save for Prefab(s)", true, 1001)] - public static bool Validate() - { - return Selection.gameObjects != null && Selection.gameObjects.Length > 0; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/AddES3Prefab.cs.meta b/Assets/Plugins/Easy Save 3/Editor/AddES3Prefab.cs.meta deleted file mode 100644 index 745029b..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/AddES3Prefab.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 337c3be705d1942b3bf318b5b29aa7cb -timeCreated: 1519132282 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/AutoSaveWindow.cs b/Assets/Plugins/Easy Save 3/Editor/AutoSaveWindow.cs deleted file mode 100644 index 6da2cb1..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/AutoSaveWindow.cs +++ /dev/null @@ -1,366 +0,0 @@ -using System; -using System.Collections.Generic; -using ES3Internal; -using UnityEditor; -using UnityEditor.SceneManagement; -using UnityEngine; -using UnityEngine.SceneManagement; -using Object = UnityEngine.Object; - -namespace ES3Editor -{ - [Serializable] - public class AutoSaveWindow : SubWindow - { - public bool showAdvancedSettings; - - public ES3AutoSaveMgr mgr; - - private HierarchyItem[] hierarchy; - - private Vector2 hierarchyScrollPosition = Vector2.zero; - - private bool sceneOpen = true; - - private string searchTerm = ""; - public HierarchyItem selected = null; - - public AutoSaveWindow(EditorWindow window) : base("Auto Save", window) - { - EditorSceneManager.activeSceneChangedInEditMode += ChangedActiveScene; - } - - private void ChangedActiveScene(Scene current, Scene next) - { - mgr = null; - Init(); - } - - public override void OnGUI() - { - Init(); - - if (mgr == null) - { - EditorGUILayout.Space(); - if (GUILayout.Button("Enable Auto Save for this scene")) - mgr = ES3Postprocessor.AddManagerToScene().GetComponent(); - else - return; - } - - var style = EditorStyle.Get; - - using (var changeCheck = new EditorGUI.ChangeCheckScope()) - { - using (var vertical = new EditorGUILayout.VerticalScope(style.areaPadded)) - { - //GUILayout.Label("Settings for current scene", style.heading); - mgr.saveEvent = (ES3AutoSaveMgr.SaveEvent)EditorGUILayout.EnumPopup("Save Event", mgr.saveEvent); - mgr.loadEvent = (ES3AutoSaveMgr.LoadEvent)EditorGUILayout.EnumPopup("Load Event", mgr.loadEvent); - - EditorGUILayout.Space(); - - showAdvancedSettings = EditorGUILayout.Foldout(showAdvancedSettings, "Show Advanced Settings"); - if (showAdvancedSettings) - { - EditorGUI.indentLevel++; - mgr.key = EditorGUILayout.TextField("Key", mgr.key); - ES3SettingsEditor.Draw(mgr.settings); - EditorGUI.indentLevel--; - } - } - - // Display the menu. - using (var horizontal = new EditorGUILayout.HorizontalScope()) - { - if (GUILayout.Button("Scene", sceneOpen ? style.menuButtonSelected : style.menuButton)) - { - sceneOpen = true; - OnFocus(); - } - if (GUILayout.Button("Prefabs", sceneOpen ? style.menuButton : style.menuButtonSelected)) - { - sceneOpen = false; - OnFocus(); - } - } - - //EditorGUILayout.HelpBox("Select the Components you want to be saved.\nTo maximise performance, only select the Components with variables which need persisting.", MessageType.None, true); - - if (hierarchy == null || hierarchy.Length == 0) - { - EditorGUILayout.LabelField("Right-click a prefab and select 'Easy Save 3 > Enable Easy Save for Scene' to enable Auto Save for it.\n\nYour scene will also need to reference this prefab for it to be recognised.", style.area); - return; - } - - using (var scrollView = new EditorGUILayout.ScrollViewScope(hierarchyScrollPosition, style.areaPadded)) - { - hierarchyScrollPosition = scrollView.scrollPosition; - - using (new EditorGUILayout.HorizontalScope(GUILayout.Width(200))) - { -#if UNITY_2022_3_OR_NEWER - searchTerm = GUILayout.TextField(searchTerm, GUI.skin.FindStyle("ToolbarSearchTextField")); - if (GUILayout.Button("", GUI.skin.FindStyle("ToolbarSearchCancelButton"))) -#else - searchTerm = GUILayout.TextField(searchTerm, GUI.skin.FindStyle("ToolbarSeachTextField")); - if (GUILayout.Button("", GUI.skin.FindStyle("ToolbarSeachCancelButton"))) -#endif - { - // Remove focus if cleared - searchTerm = ""; - GUI.FocusControl(null); - } - } - - EditorGUILayout.Space(); - EditorGUILayout.Space(); - - foreach (var go in hierarchy) - if (go != null) - go.DrawHierarchy(searchTerm.ToLowerInvariant()); - } - if (changeCheck.changed) - EditorUtility.SetDirty(mgr); - } - } - - public void Init() - { - if (mgr == null) - foreach (var thisMgr in Resources.FindObjectsOfTypeAll()) - if (thisMgr != null && thisMgr.gameObject.scene == SceneManager.GetActiveScene()) - mgr = thisMgr; - - if (hierarchy == null) - OnFocus(); - } - - public override void OnFocus() - { - - GameObject[] parentObjects; - if (sceneOpen) - parentObjects = SceneManager.GetActiveScene().GetRootGameObjects(); - else // Prefabs - { - List prefabs = ES3ReferenceMgrBase.Current.prefabs; - parentObjects = new GameObject[prefabs.Count]; - for (int i = 0; i < prefabs.Count; i++) - if (prefabs[i] != null) - parentObjects[i] = prefabs[i].gameObject; - } - hierarchy = new HierarchyItem[parentObjects.Length]; - for (int i = 0; i < parentObjects.Length; i++) - if (parentObjects[i] != null) - hierarchy[i] = new HierarchyItem(parentObjects[i].transform, null, this); - } - - public class HierarchyItem - { - private ES3AutoSave autoSave; - // Immediate children of this GameObject - private readonly HierarchyItem[] children = new HierarchyItem[0]; - private readonly Component[] components; - private bool showComponents; - private readonly Transform t; - //private AutoSaveWindow window; - - public HierarchyItem(Transform t, HierarchyItem parent, AutoSaveWindow window) - { - autoSave = t.GetComponent(); - this.t = t; - components = t.GetComponents(); - - children = new HierarchyItem[t.childCount]; - for (int i = 0; i < t.childCount; i++) - children[i] = new HierarchyItem(t.GetChild(i), this, window); - - //this.window = window; - } - - public void MergeDown(ES3AutoSave autoSave) - { - if (this.autoSave != autoSave) - { - if (this.autoSave != null) - { - autoSave.componentsToSave.AddRange(autoSave.componentsToSave); - Object.DestroyImmediate(this.autoSave); - } - this.autoSave = autoSave; - } - - foreach (var child in children) - MergeDown(autoSave); - } - - public void DrawHierarchy(string searchTerm) - { - bool containsSearchTerm = false; - - if (t != null) - { - // Filter by tag if it's prefixed by "tag:" - if (searchTerm.StartsWith("tag:") && t.tag.ToLowerInvariant().Contains(searchTerm.Remove(0, 4))) - containsSearchTerm = true; - // Else filter by name - else - containsSearchTerm = t.name.ToLowerInvariant().Contains(searchTerm); - - if (containsSearchTerm) - { - GUIContent saveIcon; - EditorGUIUtility.SetIconSize(new Vector2(16, 16)); - - if (HasSelectedComponentsOrFields()) - saveIcon = new GUIContent(t.name, EditorStyle.Get.saveIconSelected, "There are Components on this GameObject which will be saved."); - else - saveIcon = new GUIContent(t.name, EditorStyle.Get.saveIconUnselected, "No Components on this GameObject will be saved"); - - var style = GUI.skin.GetStyle("Foldout"); - if (Selection.activeTransform == t) - { - style = new GUIStyle(style); - style.fontStyle = FontStyle.Bold; - } - - bool open = EditorGUILayout.Foldout(showComponents, saveIcon, style); - if (open) - { - // Ping the GameObject if this was previously closed - if (showComponents != open) - EditorGUIUtility.PingObject(t.gameObject); - DrawComponents(); - } - showComponents = open; - - EditorGUI.indentLevel += 1; - } - } - - // Draw children - if (children != null) - foreach (var child in children) - if (child != null) - child.DrawHierarchy(searchTerm); - - if (containsSearchTerm) - EditorGUI.indentLevel -= 1; - } - - public void DrawComponents() - { - EditorGUI.indentLevel += 3; - using (var scope = new EditorGUILayout.VerticalScope()) - { - bool toggle; - toggle = EditorGUILayout.ToggleLeft("active", autoSave != null ? autoSave.saveActive : false); - if ((autoSave = toggle && autoSave == null ? t.gameObject.AddComponent() : autoSave) != null) - ApplyBool("saveActive", toggle); - - toggle = EditorGUILayout.ToggleLeft("hideFlags", autoSave != null ? autoSave.saveHideFlags : false); - if ((autoSave = toggle && autoSave == null ? t.gameObject.AddComponent() : autoSave) != null) - ApplyBool("saveHideFlags", toggle); - - toggle = EditorGUILayout.ToggleLeft("layer", autoSave != null ? autoSave.saveLayer : false); - if ((autoSave = toggle && autoSave == null ? t.gameObject.AddComponent() : autoSave) != null) - ApplyBool("saveLayer", toggle); - - toggle = EditorGUILayout.ToggleLeft("name", autoSave != null ? autoSave.saveName : false); - if ((autoSave = toggle && autoSave == null ? t.gameObject.AddComponent() : autoSave) != null) - ApplyBool("saveName", toggle); - - toggle = EditorGUILayout.ToggleLeft("tag", autoSave != null ? autoSave.saveTag : false); - if ((autoSave = toggle && autoSave == null ? t.gameObject.AddComponent() : autoSave) != null) - ApplyBool("saveTag", toggle); - - foreach (var component in components) - { - if (component == null) - continue; - - using (var horizontalScope = new EditorGUILayout.HorizontalScope()) - { - bool saveComponent = false; - if (autoSave != null) - saveComponent = autoSave.componentsToSave.Contains(component); - - bool newValue = EditorGUILayout.ToggleLeft(EditorGUIUtility.ObjectContent(component, component.GetType()), saveComponent); - // If the checkbox has changed, we want to save or not save a Component - if (newValue != saveComponent) - { - if (autoSave == null) - { - autoSave = Undo.AddComponent(t.gameObject); - var so = new SerializedObject(autoSave); - so.FindProperty("saveChildren").boolValue = false; - so.ApplyModifiedProperties(); - } - // If we've unchecked the box, remove the Component from the array. - if (newValue == false) - { - var so = new SerializedObject(autoSave); - var prop = so.FindProperty("componentsToSave"); - int index = autoSave.componentsToSave.IndexOf(component); - prop.DeleteArrayElementAtIndex(index); - so.ApplyModifiedProperties(); - } - // Else, add it to the array. - else - { - var so = new SerializedObject(autoSave); - var prop = so.FindProperty("componentsToSave"); - prop.arraySize++; - prop.GetArrayElementAtIndex(prop.arraySize - 1).objectReferenceValue = component; - so.ApplyModifiedProperties(); - } - } - if (GUILayout.Button(EditorGUIUtility.IconContent("_Popup"), new GUIStyle("Label"))) - ES3Window.InitAndShowTypes(component.GetType()); - } - } - } - - /*if(autoSave != null && isDirty) - { - EditorUtility.SetDirty(autoSave); - if (PrefabUtility.IsPartOfPrefabInstance(autoSave)) - PrefabUtility.RecordPrefabInstancePropertyModifications(autoSave.gameObject); - }*/ - - if (autoSave != null && (autoSave.componentsToSave == null || autoSave.componentsToSave.Count == 0) && !autoSave.saveActive && !autoSave.saveChildren && !autoSave.saveHideFlags && !autoSave.saveLayer && !autoSave.saveName && !autoSave.saveTag) - { - Undo.DestroyObjectImmediate(autoSave); - autoSave = null; - } - EditorGUI.indentLevel -= 3; - } - - public void ApplyBool(string propertyName, bool value) - { - var so = new SerializedObject(autoSave); - so.FindProperty(propertyName).boolValue = value; - so.ApplyModifiedProperties(); - } - - public bool HasSelectedComponentsOrFields() - { - if (autoSave == null) - return false; - - - foreach (var component in components) - if (component != null && autoSave.componentsToSave.Contains(component)) - return true; - - if (autoSave.saveActive || autoSave.saveHideFlags || autoSave.saveLayer || autoSave.saveName || autoSave.saveTag) - return true; - - return false; - } - } - } - -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/AutoSaveWindow.cs.meta b/Assets/Plugins/Easy Save 3/Editor/AutoSaveWindow.cs.meta deleted file mode 100644 index 9958209..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/AutoSaveWindow.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6065cc5492e9f49728674de9a0c1fe84 -timeCreated: 1519132286 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3AutoSaveEditor.cs b/Assets/Plugins/Easy Save 3/Editor/ES3AutoSaveEditor.cs deleted file mode 100644 index 26f2def..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3AutoSaveEditor.cs +++ /dev/null @@ -1,19 +0,0 @@ -using ES3Editor; -using UnityEditor; -using UnityEngine; - -namespace ES3Internal -{ - [CustomEditor(typeof(ES3AutoSave))] - public class ES3AutoSaveEditor : Editor - { - public override void OnInspectorGUI() - { - if (target == null) - return; - - if (GUILayout.Button("Manage Auto Save Settings")) - ES3Window.InitAndShowAutoSave(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3AutoSaveEditor.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3AutoSaveEditor.cs.meta deleted file mode 100644 index 6b4bf60..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3AutoSaveEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 54ded3aeb20a94008a877da330bfc45f -timeCreated: 1519132285 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3AutoSaveMgrEditor.cs b/Assets/Plugins/Easy Save 3/Editor/ES3AutoSaveMgrEditor.cs deleted file mode 100644 index fdeb9bc..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3AutoSaveMgrEditor.cs +++ /dev/null @@ -1,18 +0,0 @@ -using ES3Editor; -using UnityEditor; -using UnityEngine; - -namespace ES3Internal -{ - [CustomEditor(typeof(ES3AutoSaveMgr))] - public class ES3AutoSaveMgrEditor : Editor - { - public override void OnInspectorGUI() - { - EditorGUILayout.HelpBox("This manages the saving and loading of GameObjects which have the Auto Save component attached to them.\n\nIf there are no Auto Save components in your scene, this component will do nothing.", MessageType.Info); - if (GUILayout.Button("Settings...")) - ES3Window.InitAndShowAutoSave(); - } - } - -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3AutoSaveMgrEditor.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3AutoSaveMgrEditor.cs.meta deleted file mode 100644 index 8983ad6..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3AutoSaveMgrEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f440317f3fd444daf83c27a3381af17c -timeCreated: 1519132300 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3ClassTypeTemplate.txt b/Assets/Plugins/Easy Save 3/Editor/ES3ClassTypeTemplate.txt deleted file mode 100644 index 83318c1..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3ClassTypeTemplate.txt +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using UnityEngine; - -namespace ES3Types -{ - [UnityEngine.Scripting.Preserve] - [ES3PropertiesAttribute([propertyNames])] - public class ES3UserType_[es3TypeSuffix] : ES3ObjectType - { - public static ES3Type Instance = null; - - public ES3UserType_[es3TypeSuffix]() : base(typeof([fullType])){ Instance = this; priority = 1; } - - - protected override void WriteObject(object obj, ES3Writer writer) - { - var instance = ([fullType])obj; - [writes] - } - - protected override void ReadObject(ES3Reader reader, object obj) - { - var instance = ([fullType])obj; - foreach(string propertyName in reader.Properties) - { - switch(propertyName) - { - [reads] - default: - reader.Skip(); - break; - } - } - } - - protected override object ReadObject(ES3Reader reader) - { - var instance = new [fullType](); - ReadObject(reader, instance); - return instance; - } - } - - - public class ES3UserType_[es3TypeSuffix]Array : ES3ArrayType - { - public static ES3Type Instance; - - public ES3UserType_[es3TypeSuffix]Array() : base(typeof([fullType][]), ES3UserType_[es3TypeSuffix].Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3ClassTypeTemplate.txt.meta b/Assets/Plugins/Easy Save 3/Editor/ES3ClassTypeTemplate.txt.meta deleted file mode 100644 index 0861d16..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3ClassTypeTemplate.txt.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: cc3cada215f0d417a8fa879651f22f84 -timeCreated: 1483698819 -licenseType: Store -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3ComponentTypeTemplate.txt b/Assets/Plugins/Easy Save 3/Editor/ES3ComponentTypeTemplate.txt deleted file mode 100644 index 9953ea5..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3ComponentTypeTemplate.txt +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using UnityEngine; - -namespace ES3Types -{ - [UnityEngine.Scripting.Preserve] - [ES3PropertiesAttribute([propertyNames])] - public class ES3UserType_[es3TypeSuffix] : ES3ComponentType - { - public static ES3Type Instance = null; - - public ES3UserType_[es3TypeSuffix]() : base(typeof([fullType])){ Instance = this; priority = 1;} - - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = ([fullType])obj; - [writes] - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = ([fullType])obj; - foreach(string propertyName in reader.Properties) - { - switch(propertyName) - { - [reads] - default: - reader.Skip(); - break; - } - } - } - } - - - public class ES3UserType_[es3TypeSuffix]Array : ES3ArrayType - { - public static ES3Type Instance; - - public ES3UserType_[es3TypeSuffix]Array() : base(typeof([fullType][]), ES3UserType_[es3TypeSuffix].Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3ComponentTypeTemplate.txt.meta b/Assets/Plugins/Easy Save 3/Editor/ES3ComponentTypeTemplate.txt.meta deleted file mode 100644 index 3b08a42..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3ComponentTypeTemplate.txt.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b74f7ff5e731846249f9e22ab7afedfb -timeCreated: 1483698819 -licenseType: Store -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3EditorStyle.cs b/Assets/Plugins/Easy Save 3/Editor/ES3EditorStyle.cs deleted file mode 100644 index 5b28226..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3EditorStyle.cs +++ /dev/null @@ -1,90 +0,0 @@ -using UnityEditor; -using UnityEngine; - -namespace ES3Editor -{ - public class EditorStyle - { - private static EditorStyle style; - - public GUIStyle area; - public GUIStyle areaPadded; - - public GUIStyle boldLabelNoStretch; - - public GUIStyle heading; - - public GUIStyle link; - - public GUIStyle menuButton; - public GUIStyle menuButtonSelected; - - public Texture2D saveIconSelected; - public Texture2D saveIconUnselected; - public GUIStyle smallSquareButton; - public GUIStyle subheading; - public GUIStyle subheading2; - - public GUIStyle toggle; - - public EditorStyle() - { - // An area with padding. - area = new GUIStyle(); - area.padding = new RectOffset(10, 10, 10, 10); - area.wordWrap = true; - - // An area with more padding. - areaPadded = new GUIStyle(); - areaPadded.padding = new RectOffset(20, 20, 20, 20); - areaPadded.wordWrap = true; - - // Unselected menu button. - menuButton = new GUIStyle(EditorStyles.toolbarButton); - menuButton.fontStyle = FontStyle.Normal; - menuButton.fontSize = 14; - menuButton.fixedHeight = 24; - - // Selected menu button. - menuButtonSelected = new GUIStyle(menuButton); - menuButtonSelected.fontStyle = FontStyle.Bold; - - // Main Headings - heading = new GUIStyle(EditorStyles.label); - heading.fontStyle = FontStyle.Bold; - heading.fontSize = 24; - - subheading = new GUIStyle(heading); - subheading.fontSize = 18; - - subheading2 = new GUIStyle(heading); - subheading2.fontSize = 14; - - boldLabelNoStretch = new GUIStyle(EditorStyles.label); - boldLabelNoStretch.stretchWidth = false; - boldLabelNoStretch.fontStyle = FontStyle.Bold; - - link = new GUIStyle(); - link.fontSize = 16; - if (EditorGUIUtility.isProSkin) - link.normal.textColor = new Color(0.262f, 0.670f, 0.788f); - else - link.normal.textColor = new Color(0.129f, 0.129f, 0.8f); - - toggle = new GUIStyle(EditorStyles.toggle); - toggle.stretchWidth = false; - - saveIconSelected = AssetDatabase.LoadAssetAtPath(ES3Settings.PathToEasySaveFolder() + "Editor/es3Logo16x16.png"); - saveIconUnselected = AssetDatabase.LoadAssetAtPath(ES3Settings.PathToEasySaveFolder() + "Editor/es3Logo16x16-bw.png"); - } - - public static EditorStyle Get - { - get - { - if (style == null) style = new EditorStyle(); - return style; - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3EditorStyle.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3EditorStyle.cs.meta deleted file mode 100644 index 62aeda3..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3EditorStyle.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f556addc6753344019137cbc45d2c4ff -timeCreated: 1519132301 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3EditorUtility.cs b/Assets/Plugins/Easy Save 3/Editor/ES3EditorUtility.cs deleted file mode 100644 index 1ae72d9..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3EditorUtility.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.Collections.Generic; -using ES3Editor; -using UnityEditor; -using UnityEngine; -public class ES3EditorUtility : Editor -{ - public static void DisplayLink(string label, string url) - { - var style = EditorStyle.Get; - if (GUILayout.Button(label, style.link)) - Application.OpenURL(url); - - var buttonRect = GUILayoutUtility.GetLastRect(); - buttonRect.width = style.link.CalcSize(new GUIContent(label)).x; - - EditorGUIUtility.AddCursorRect(buttonRect, MouseCursor.Link); - } - - public static bool IsPrefabInAssets(Object obj) - { - #if UNITY_2018_3_OR_NEWER - return PrefabUtility.IsPartOfPrefabAsset(obj); - #else - return (PrefabUtility.GetPrefabType(obj) == PrefabType.Prefab); - #endif - } - - /* - * Gets all children and components from a GameObject or GameObjects. - * We create our own method for this because EditorUtility.CollectDeepHierarchy isn't thread safe in the Editor. - */ - public static IEnumerable CollectDeepHierarchy(IEnumerable gos) - { - HashSet deepHierarchy = new HashSet(); - foreach (var go in gos) - { - deepHierarchy.Add(go); - deepHierarchy.UnionWith(go.GetComponents()); - foreach (Transform t in go.transform) - deepHierarchy.UnionWith(CollectDeepHierarchy(new[] - { - t.gameObject - })); - } - return deepHierarchy; - } - - [MenuItem("Tools/Easy Save 3/Getting Started...", false, 0)] - public static void DisplayGettingStarted() - { - Application.OpenURL("https://docs.moodkie.com/easy-save-3/getting-started/"); - } - - [MenuItem("Tools/Easy Save 3/Manual...", false, 0)] - public static void DisplayManual() - { - Application.OpenURL("https://docs.moodkie.com/product/easy-save-3/"); - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3EditorUtility.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3EditorUtility.cs.meta deleted file mode 100644 index f0d8af7..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3EditorUtility.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 501719249e8124990973182985feaeb8 -timeCreated: 1519132285 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3GameObjectEditor.cs b/Assets/Plugins/Easy Save 3/Editor/ES3GameObjectEditor.cs deleted file mode 100644 index de68e23..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3GameObjectEditor.cs +++ /dev/null @@ -1,43 +0,0 @@ -using UnityEditor; -using UnityEngine; - -namespace ES3Internal -{ - [CustomEditor(typeof(ES3GameObject))] - public class ES3GameObjectEditor : Editor - { - public override void OnInspectorGUI() - { - if (target == null) - return; - - var es3Go = (ES3GameObject)target; - - EditorGUILayout.HelpBox("This Component allows you to choose which Components are saved when this GameObject is saved using code.", MessageType.Info); - - if (es3Go.GetComponent() != null) - { - EditorGUILayout.HelpBox("This Component cannot be used on GameObjects which are already managed by Auto Save.", MessageType.Error); - return; - } - - foreach (var component in es3Go.GetComponents()) - { - bool markedToBeSaved = es3Go.components.Contains(component); - bool newMarkedToBeSaved = EditorGUILayout.Toggle(component.GetType().Name, markedToBeSaved); - - if (markedToBeSaved && !newMarkedToBeSaved) - { - Undo.RecordObject(es3Go, "Marked Component to save"); - es3Go.components.Remove(component); - } - - if (!markedToBeSaved && newMarkedToBeSaved) - { - Undo.RecordObject(es3Go, "Unmarked Component to save"); - es3Go.components.Add(component); - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3GameObjectEditor.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3GameObjectEditor.cs.meta deleted file mode 100644 index 6fe8ba3..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3GameObjectEditor.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b7d54ef20554e354eb3c0d40d2a6debe -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3GlobalReferencesEditor.cs b/Assets/Plugins/Easy Save 3/Editor/ES3GlobalReferencesEditor.cs deleted file mode 100644 index 6c98fab..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3GlobalReferencesEditor.cs +++ /dev/null @@ -1,90 +0,0 @@ -#if !ES3GLOBAL_DISABLED -using System; -using System.Collections.Generic; -using UnityEditor; -using UnityEngine; -using Object = UnityEngine.Object; - -namespace ES3Internal -{ - [CustomEditor(typeof(ES3GlobalReferences))] - [Serializable] - public class ES3GlobalReferencesEditor : Editor - { - - private ES3GlobalReferences _globalRefs; - private bool isDraggingOver; - private bool openReferences; - private ES3GlobalReferences globalRefs - { - get - { - if (_globalRefs == null) - _globalRefs = (ES3GlobalReferences)serializedObject.targetObject; - return _globalRefs; - } - } - - public override void OnInspectorGUI() - { - EditorGUILayout.HelpBox("This stores references to objects in Assets, allowing them to be referenced with the same ID between scenes.", MessageType.Info); - - if (EditorGUILayout.Foldout(openReferences, "References") != openReferences) - { - openReferences = !openReferences; - if (openReferences) - openReferences = EditorUtility.DisplayDialog("Are you sure?", "Opening this list will display every reference in the manager, which for larger projects can cause the Editor to freeze\n\nIt is strongly recommended that you save your project before continuing.", "Open References", "Cancel"); - } - - // Make foldout drag-and-drop enabled for objects. - if (GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition)) - { - var evt = Event.current; - - switch (evt.type) - { - case EventType.DragUpdated: - case EventType.DragPerform: - isDraggingOver = true; - break; - case EventType.DragExited: - isDraggingOver = false; - break; - } - - if (isDraggingOver) - { - DragAndDrop.visualMode = DragAndDropVisualMode.Copy; - - if (evt.type == EventType.DragPerform) - { - DragAndDrop.AcceptDrag(); - Undo.RecordObject(globalRefs, "Add References to Easy Save 3 Reference List"); - foreach (var obj in DragAndDrop.objectReferences) - globalRefs.GetOrAdd(obj); - // Return now because otherwise we'll change the GUI during an event which doesn't allow it. - return; - } - } - } - - if (openReferences) - { - EditorGUI.indentLevel++; - - foreach (KeyValuePair kvp in globalRefs.refId) - { - EditorGUILayout.BeginHorizontal(); - - EditorGUILayout.ObjectField(kvp.Key, typeof(Object), true); - EditorGUILayout.LongField(kvp.Value); - - EditorGUILayout.EndHorizontal(); - } - - EditorGUI.indentLevel--; - } - } - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3GlobalReferencesEditor.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3GlobalReferencesEditor.cs.meta deleted file mode 100644 index 0203979..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3GlobalReferencesEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 286fb0c3863779e4d96bc682edb324ce -timeCreated: 1519132283 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3InspectorInfoEditor.cs b/Assets/Plugins/Easy Save 3/Editor/ES3InspectorInfoEditor.cs deleted file mode 100644 index 506760a..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3InspectorInfoEditor.cs +++ /dev/null @@ -1,9 +0,0 @@ -using UnityEditor; -[CustomEditor(typeof(ES3InspectorInfo))] -public class ES3InspectorInfoEditor : Editor -{ - public override void OnInspectorGUI() - { - EditorGUILayout.HelpBox(((ES3InspectorInfo)target).message, MessageType.Info); - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3InspectorInfoEditor.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3InspectorInfoEditor.cs.meta deleted file mode 100644 index 2bb545f..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3InspectorInfoEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b344d685b614044aebf5285c5f59f52d -timeCreated: 1519132294 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3PlayMakerEditor.cs b/Assets/Plugins/Easy Save 3/Editor/ES3PlayMakerEditor.cs deleted file mode 100644 index d73fa0f..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3PlayMakerEditor.cs +++ /dev/null @@ -1,802 +0,0 @@ -#if PLAYMAKER_1_8_OR_NEWER -using UnityEngine; -using UnityEditor; -using HutongGames.PlayMaker; -using HutongGames.PlayMaker.Actions; -using HutongGames.PlayMakerEditor; -using System.Text.RegularExpressions; - -namespace ES3PlayMaker -{ - #region Base Actions - - public abstract class BaseEditor : CustomActionEditor - { - bool showErrorHandling = false; - - public abstract void DrawGUI(); - - public override bool OnGUI() - { - DrawGUI(); - - EditorGUILayout.Separator(); - - showErrorHandling = EditorGUILayout.Foldout(showErrorHandling, "Error Handling"); - if (showErrorHandling) - { - EditorGUI.indentLevel++; - EditField("errorEvent"); - EditField("errorMessage"); - EditorGUI.indentLevel--; - } - - return GUI.changed; - } - - // Displays the FsmVar field without the unnecessary Type field. - protected void FsmVarField(string fieldName) - { - if (target == null || target.State == null) - return; - - var fsmVar = (FsmVar)ES3Internal.ES3Reflection.GetField(target.GetType(), fieldName).GetValue(target); - - if (fsmVar == null) - { - fsmVar = new FsmVar(); - ES3Internal.ES3Reflection.GetField(target.GetType(), fieldName).SetValue(target, fsmVar); - } - - EditorGUILayout.BeginHorizontal(); - var label = Regex.Replace(fieldName, @"\p{Lu}", m => " " + m.Value.ToLowerInvariant()); - EditorGUILayout.PrefixLabel(char.ToUpperInvariant(label[0]) + label.Substring(1)); - - var localVariables = target.Fsm.Variables.GetAllNamedVariablesSorted(); - var globalVariables = FsmVariables.GlobalVariables.GetAllNamedVariablesSorted(); - - var variableNames = new string[localVariables.Length + globalVariables.Length]; - int selected = -1; - - for(int i = 0; i= localVariables.Length ? globalVariables[i - localVariables.Length] : localVariables[i]; - variableNames[i] = i >= localVariables.Length ? "Globals/"+variable.Name : variable.Name; - if (fsmVar.NamedVar == variable) - selected = i; - } - - var newSelected = EditorGUILayout.Popup(selected, variableNames); - - - EditorGUILayout.EndHorizontal(); - - if (newSelected == -1) - return; - - if (selected != newSelected) - { - if (newSelected >= localVariables.Length) - fsmVar.NamedVar = globalVariables[newSelected - localVariables.Length]; - else - fsmVar.NamedVar = localVariables[newSelected]; - } - } - } - - public abstract class SettingsEditor : BaseEditor - { - public override bool OnGUI() - { - base.OnGUI(); - return DrawSettingsEditor(); - } - - public bool DrawSettingsEditor() - { - var action = target as ES3PlayMaker.SettingsAction; - if (action == null) - return false; - action.overrideDefaultSettings.Value = EditorGUILayout.ToggleLeft("Override Default Settings", action.overrideDefaultSettings.Value); - - if (action.overrideDefaultSettings.Value) - { - EditorGUI.indentLevel++; - - EditField("path"); - EditField("location"); - EditField("encryptionType"); - EditField("encryptionPassword"); - EditField("compressionType"); - EditField("directory"); - EditField("format"); - EditField("bufferSize"); - - EditorGUI.indentLevel--; - EditorGUILayout.Space(); - } - return GUI.changed; - } - } - - public abstract class KeyValueSettingsEditor : SettingsEditor - { - public override bool OnGUI() - { - EditField("key"); - EditField("value"); - - base.OnGUI(); - - return GUI.changed; - } - - public override void DrawGUI(){} - } - - public abstract class ES3FileActionEditor : BaseEditor - { - public override bool OnGUI() - { - EditField("fsmES3File"); - - base.OnGUI(); - - var action = target as ES3PlayMaker.ES3FileAction; - if (action == null) - return false; - - return GUI.changed; - } - } -#endregion - -#if !PLAYMAKER_1_9_OR_NEWER -#region Save Actions - - /*[CustomActionEditor(typeof(ES3PlayMaker.Save))] - public class SaveEditor : KeyValueSettingsEditor{}*/ - - /*[CustomActionEditor(typeof(ES3PlayMaker.SaveMultiple))] - public class SaveMultipleEditor : SettingsEditor - { - public override bool OnGUI() - { - return base.OnGUI(); - } - - public override void DrawGUI() - { - DrawDefaultInspector(); - } - }*/ - - [CustomActionEditor(typeof(ES3PlayMaker.SaveAll))] - public class SaveAllEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("key"); - EditField("saveFsmVariables"); - EditField("saveGlobalVariables"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.SaveRaw))] - public class SaveRawEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("str"); - EditField("useBase64Encoding"); - EditField("appendNewline"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.AppendRaw))] - public class AppendRawEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("str"); - EditField("useBase64Encoding"); - EditField("appendNewline"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.SaveImage))] - public class SaveImageEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("imagePath"); - EditField("texture2D"); - EditField("quality"); - } - } - -#endregion - -#region Load Actions - - [CustomActionEditor(typeof(ES3PlayMaker.Load))] - public class LoadEditor : KeyValueSettingsEditor - { - public override void DrawGUI() - { - EditorGUILayout.Space(); - EditField("defaultValue"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.LoadInto))] - public class LoadIntoEditor : KeyValueSettingsEditor{} - - [CustomActionEditor(typeof(ES3PlayMaker.LoadAll))] - public class LoadAllEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("key"); - EditField("loadFsmVariables"); - EditField("loadGlobalVariables"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.LoadAudio))] - public class LoadAudioEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("audioFilePath"); - EditField("audioClip"); -#if UNITY_2018_3_OR_NEWER - EditField("audioType"); -#endif - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.LoadImage))] - public class LoadImageEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("imagePath"); - EditField("texture2D"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.LoadRawString))] - public class LoadRawStringEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("str"); - EditField("useBase64Encoding"); - } - } - -#endregion - -#region Exists Actions - - [CustomActionEditor(typeof(ES3PlayMaker.KeyExists))] - public class KeyExistsEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("key"); - EditField("exists"); - EditorGUILayout.Separator(); - EditField("existsEvent"); - EditField("doesNotExistEvent"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.FileExists))] - public class FileExistsEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("filePath"); - EditField("exists"); - EditorGUILayout.Separator(); - EditField("existsEvent"); - EditField("doesNotExistEvent"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.DirectoryExists))] - public class DirectoryExistsEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("directoryPath"); - EditField("exists"); - EditorGUILayout.Separator(); - EditField("existsEvent"); - EditField("doesNotExistEvent"); - } - } - -#endregion - -#region Delete Actions - - [CustomActionEditor(typeof(ES3PlayMaker.DeleteKey))] - public class DeleteKeyEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("key"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.DeleteFile))] - public class DeleteFileEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("filePath"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.DeleteDirectory))] - public class DeleteDirectoryEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("directoryPath"); - } - } - -#endregion - -#region Backup Actions - - [CustomActionEditor(typeof(ES3PlayMaker.CreateBackup))] - public class CreateBackupEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("filePath"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.RestoreBackup))] - public class RestoreBackupEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("filePath"); - EditField("backupWasRestored"); - } - } - -#endregion - -#region Key, File and Directory methods - - [CustomActionEditor(typeof(ES3PlayMaker.RenameFile))] - public class RenameFileEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("oldFilePath"); - EditField("newFilePath"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.CopyFile))] - public class CopyFileEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("oldFilePath"); - EditField("newFilePath"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.CopyDirectory))] - public class CopyDirectoryEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("oldDirectoryPath"); - EditField("newDirectoryPath"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.GetKeys))] - public class GetKeysEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("filePath"); - EditField("keys"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.GetKeyCount))] - public class GetKeyCountEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("filePath"); - EditField("keyCount"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.GetFiles))] - public class GetFilesEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("directoryPath"); - EditField("files"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.GetDirectories))] - public class GetDirectoriesEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("directoryPath"); - EditField("directories"); - } - } - -#endregion - -#region ES3File Actions - - [CustomActionEditor(typeof(ES3PlayMaker.ES3FileCreate))] - public class ES3FileCreateEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("fsmES3File"); - EditField("filePath"); - EditField("syncWithFile"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3FileSync))] - public class ES3FileSyncEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("fsmES3File"); - } - } - - /*[CustomActionEditor(typeof(ES3PlayMaker.ES3FileSave))] - public class ES3FileSaveEditor : SaveEditor - { - public override void DrawGUI() - { - EditField("fsmES3File"); - base.DrawGUI(); - } - }*/ - - [CustomActionEditor(typeof(ES3PlayMaker.ES3FileLoad))] - public class ES3FileLoadEditor : LoadEditor - { - public override void DrawGUI() - { - EditField("fsmES3File"); - base.DrawGUI(); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3FileLoadInto))] - public class ES3FileLoadIntoEditor : LoadIntoEditor - { - public override void DrawGUI() - { - base.DrawGUI(); - EditField("fsmES3File"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3FileDeleteKey))] - public class ES3FileDeleteKeyEditor : DeleteKeyEditor - { - public override void DrawGUI() - { - base.DrawGUI(); - EditField("fsmES3File"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3FileKeyExists))] - public class ES3FileKeyExistsEditor : KeyExistsEditor - { - public override void DrawGUI() - { - EditField("fsmES3File"); - base.DrawGUI(); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3FileGetKeys))] - public class ES3FileGetKeysEditor : ES3FileActionEditor - { - public override void DrawGUI() - { - EditField("keys"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3FileClear))] - public class ES3FileClearEditor : BaseEditor - { - public override void DrawGUI() - { - EditField("fsmES3File"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3FileSize))] - public class ES3FileSizeEditor : BaseEditor - { - public override void DrawGUI() - { - EditField("size"); - EditField("fsmES3File"); - } - } - - -#endregion - -#region ES3Cloud Actions -#if !DISABLE_WEB - - public abstract class ES3CloudEditor : SettingsEditor - { - protected abstract void DrawChildGUI(); - - public override void DrawGUI() - { - EditField("url"); - EditField("apiKey"); - EditorGUILayout.Space(); - DrawChildGUI(); - EditorGUILayout.Space(); - EditField("errorCode"); - } - } - - public abstract class ES3CloudUserEditor : ES3CloudEditor - { - public bool showUser = false; - - protected override void DrawChildGUI() - { - if((showUser = EditorGUILayout.Foldout(showUser, "User (optional)"))) - { - EditorGUI.indentLevel++; - EditField("user"); - EditField("password"); - EditorGUI.indentLevel--; - } - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3CloudSync))] - public class ES3CloudSyncEditor : ES3CloudUserEditor - { - protected override void DrawChildGUI() - { - EditField("path"); - base.DrawChildGUI(); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3CloudDownloadFile))] - public class ES3CloudDownloadFileEditor : ES3CloudUserEditor - { - protected override void DrawChildGUI() - { - EditField("path"); - base.DrawChildGUI(); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3CloudDownloadES3File))] - public class ES3CloudDownloadES3FileEditor : BaseEditor - { - public bool showUser = false; - public override void DrawGUI() - { - EditField("fsmES3File"); - EditField("url"); - EditField("apiKey"); - EditField("errorCode"); - if ((showUser = EditorGUILayout.Foldout(showUser, "User (optional)"))) - { - EditorGUI.indentLevel++; - EditField("user"); - EditField("password"); - EditorGUI.indentLevel--; - } - } - } - - - [CustomActionEditor(typeof(ES3PlayMaker.ES3CloudUploadFile))] - public class ES3CloudUploadFileEditor : ES3CloudUserEditor - { - protected override void DrawChildGUI() - { - EditField("path"); - base.DrawChildGUI(); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3CloudUploadES3File))] - public class ES3CloudUploadES3FileEditor : BaseEditor - { - public bool showUser = false; - public override void DrawGUI() - { - EditField("fsmES3File"); - EditField("url"); - EditField("apiKey"); - EditField("errorCode"); - if((showUser = EditorGUILayout.Foldout(showUser, "User (optional)"))) - { - EditorGUI.indentLevel++; - EditField("user"); - EditField("password"); - EditorGUI.indentLevel--; - } - } - } - - - - [CustomActionEditor(typeof(ES3PlayMaker.ES3CloudDeleteFile))] - public class ES3CloudDeleteFileEditor : ES3CloudUserEditor - { - protected override void DrawChildGUI() - { - EditField("path"); - base.DrawChildGUI(); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3CloudRenameFile))] - public class ES3CloudRenameFileEditor : ES3CloudUserEditor - { - protected override void DrawChildGUI() - { - EditField("path"); - EditField("newFilename"); - base.DrawChildGUI(); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3CloudDownloadFilenames))] - public class ES3CloudDownloadFilenamesEditor : ES3CloudUserEditor - { - protected override void DrawChildGUI() - { - EditField("filenames"); - EditField("searchPattern"); - base.DrawChildGUI(); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3CloudSearchFilenames))] - public class ES3CloudSearchFilenamesEditor : ES3CloudUserEditor - { - protected override void DrawChildGUI() - { - EditField("filenames"); - EditField("searchPattern"); - base.DrawChildGUI(); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3CloudDownloadTimestamp))] - public class ES3CloudDownloadTimestampEditor : ES3CloudUserEditor - { - protected override void DrawChildGUI() - { - EditField("path"); - EditField("timestamp"); - base.DrawChildGUI(); - } - } - -#endif - -#endregion - -#region ES3SpreadsheetActions - - - [CustomActionEditor(typeof(ES3PlayMaker.ES3SpreadsheetCreate))] - public class ES3SpreadsheetCreateEditor : BaseEditor - { - public override void DrawGUI() - { - EditField("fsmES3Spreadsheet"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3SpreadsheetSetCell))] - public class ES3SpreadsheetSetCellEditor : BaseEditor - { - public override void DrawGUI() - { - EditField("fsmES3Spreadsheet"); - EditField("col"); - EditField("row"); - EditField("value"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3SpreadsheetGetCell))] - public class ES3SpreadsheetGetCellEditor : BaseEditor - { - public override void DrawGUI() - { - EditField("fsmES3Spreadsheet"); - EditField("col"); - EditField("row"); - EditField("value"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3SpreadsheetLoad))] - public class ES3SpreadsheetLoadEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("fsmES3Spreadsheet"); - EditField("filePath"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.ES3SpreadsheetSave))] - public class ES3SpreadsheetSaveEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("fsmES3Spreadsheet"); - EditField("filePath"); - EditField("append"); - } - } - -#endregion - -#region Caching - - [CustomActionEditor(typeof(ES3PlayMaker.CacheFile))] - public class CacheFileEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("filePath"); - } - } - - [CustomActionEditor(typeof(ES3PlayMaker.StoreCachedFile))] - public class StoreCachedFileEditor : SettingsEditor - { - public override void DrawGUI() - { - EditField("filePath"); - } - } - -#endregion -#endif -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3PlayMakerEditor.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3PlayMakerEditor.cs.meta deleted file mode 100644 index 4b91200..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3PlayMakerEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 61838eb75b8164d699b0f54416e0f0bc -timeCreated: 1497347459 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3Postprocessor.cs b/Assets/Plugins/Easy Save 3/Editor/ES3Postprocessor.cs deleted file mode 100644 index 1406295..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3Postprocessor.cs +++ /dev/null @@ -1,277 +0,0 @@ -using System.Collections.Generic; -using ES3Internal; -using UnityEditor; -using UnityEditor.Compilation; -using UnityEditor.SceneManagement; -using UnityEngine; -using UnityEngine.SceneManagement; -using Assembly = UnityEditor.Compilation.Assembly; - - -/* - * ---- How Postprocessing works for the reference manager ---- - * - When the manager is first added to the scene, all top-level dependencies are added to the manager (AddManagerToScene). - * - When the manager is first added to the scene, all prefabs with ES3Prefab components are added to the manager (AddManagerToScene). - * - All GameObjects and Components in the scene are added to the reference manager when we enter Playmode or the scene is saved (PlayModeStateChanged, OnWillSaveAssets -> AddGameObjectsAndComponentstoManager). - * - When a UnityEngine.Object field of a Component is modified, the new UnityEngine.Object reference is added to the reference manager (PostProcessModifications) - * - All prefabs with ES3Prefab Components are added to the reference manager when we enter Playmode or the scene is saved (PlayModeStateChanged, OnWillSaveAssets -> AddGameObjectsAndComponentstoManager). - * - Local references for prefabs are processed whenever a prefab with an ES3Prefab Component is deselected (SelectionChanged -> ProcessGameObject) - */ -[InitializeOnLoad] -public class ES3Postprocessor : AssetModificationProcessor -{ - - public static GameObject lastSelected = null; - - - // This constructor is also called once when playmode is activated and whenever recompilation happens - // because we have the [InitializeOnLoad] attribute assigned to the class. - static ES3Postprocessor() - { -#if UNITY_2020_2_OR_NEWER - ObjectChangeEvents.changesPublished += Changed; -#endif - ObjectFactory.componentWasAdded += ComponentWasAdded; - - // Open the Easy Save 3 window the first time ES3 is installed. - //ES3Editor.ES3Window.OpenEditorWindowOnStart(); - - EditorApplication.playModeStateChanged -= PlayModeStateChanged; - EditorApplication.playModeStateChanged += PlayModeStateChanged; - - EditorSceneManager.sceneOpened += OnSceneOpened; - } - public static ES3ReferenceMgr RefMgr - { - get { return (ES3ReferenceMgr)ES3ReferenceMgrBase.Current; } - } - - - private static void UpdateAssembliesContainingES3Types() - { - Assembly[] assemblies = CompilationPipeline.GetAssemblies(); - - if (assemblies == null || assemblies.Length == 0) - return; - - var defaults = ES3Settings.defaultSettingsScriptableObject; - string[] currentAssemblyNames = defaults.settings.assemblyNames; - - List assemblyNames = new List(); - - foreach (var assembly in assemblies) - { - // Don't include Editor assemblies. - if (assembly.flags.HasFlag(AssemblyFlags.EditorAssembly)) - continue; - - // Assemblies beginning with 'com.' are assumed to be internal. - if (assembly.name.StartsWith("com.")) - continue; - - // If this assembly begins with 'Unity', but isn't created from an Assembly Definition File, skip it. - if (assembly.name.StartsWith("Unity")) - { - bool isAssemblyDefinition = true; - - foreach (string sourceFile in assembly.sourceFiles) - { - if (!sourceFile.StartsWith("Assets/")) - { - isAssemblyDefinition = false; - break; - } - } - - if (!isAssemblyDefinition) - continue; - } - - assemblyNames.Add(assembly.name); - } - - // If there are no assembly names, - if (assemblyNames.Count == 0) - return; - - // Sort it alphabetically so that the order isn't constantly changing, which can affect version control. - assemblyNames.Sort(); - - // Only update if the list has changed. - for (int i = 0; i < assemblyNames.Count; i++) - { - if (currentAssemblyNames.Length != assemblyNames.Count || currentAssemblyNames[i] != assemblyNames[i]) - { - defaults.settings.assemblyNames = assemblyNames.ToArray(); - EditorUtility.SetDirty(defaults); - break; - } - } - } - - public static GameObject AddManagerToScene() - { - GameObject mgr = null; - if (RefMgr != null) - mgr = RefMgr.gameObject; - - if (mgr == null) - mgr = new GameObject("Easy Save 3 Manager"); - - if (mgr.GetComponent() == null) - { - mgr.AddComponent(); - - if (!Application.isPlaying && ES3Settings.defaultSettingsScriptableObject.autoUpdateReferences) - RefMgr.RefreshDependencies(); - } - - if (mgr.GetComponent() == null) - mgr.AddComponent(); - - Undo.RegisterCreatedObjectUndo(mgr, "Enabled Easy Save for Scene"); - return mgr; - } - - #region Reference Updating - - private static void PlayModeStateChanged(PlayModeStateChange state) - { - if (state == PlayModeStateChange.ExitingEditMode) - UpdateAssembliesContainingES3Types(); - } - - private static void OnSceneOpened(Scene scene, OpenSceneMode mode) - { - if (mode == OpenSceneMode.AdditiveWithoutLoading || Application.isPlaying) - return; - - if (ES3Settings.defaultSettingsScriptableObject.autoUpdateReferences && ES3Settings.defaultSettingsScriptableObject.updateReferencesWhenSceneIsOpened) - RefreshScene(scene); - } - - private static void RefreshReferences(bool isEnteringPlayMode = false) - { - /*if (refreshed) // If we've already refreshed, do nothing. - return;*/ - - if (ES3Settings.defaultSettingsScriptableObject.autoUpdateReferences) - for (int i = 0; i < SceneManager.sceneCount; i++) - RefreshScene(SceneManager.GetSceneAt(i)); - //refreshed = true; - } - - private static void RefreshScene(Scene scene, bool isEnteringPlayMode = false) - { - if (scene != null && scene.isLoaded) - { - var mgr = (ES3ReferenceMgr)ES3ReferenceMgrBase.GetManagerFromScene(scene); - if (mgr != null) - mgr.RefreshDependencies(isEnteringPlayMode); - } - } - - private static void ComponentWasAdded(Component c) - { - var scene = c.gameObject.scene; - - if (!scene.isLoaded) - return; - - var mgr = (ES3ReferenceMgr)ES3ReferenceMgrBase.GetManagerFromScene(scene); - - if (mgr != null) - mgr.AddDependencies(c); - } - -#if UNITY_2020_2_OR_NEWER - private static void Changed(ref ObjectChangeEventStream stream) - { - if (EditorApplication.isUpdating || Application.isPlaying || !ES3Settings.defaultSettingsScriptableObject.autoUpdateReferences || !ES3Settings.defaultSettingsScriptableObject.updateReferencesWhenSceneChanges) - return; - - for (int i = 0; i < stream.length; i++) - { - var eventType = stream.GetEventType(i); - int[] instanceIds; - Scene scene; - - if (eventType == ObjectChangeKind.ChangeGameObjectOrComponentProperties) - { - ChangeGameObjectOrComponentPropertiesEventArgs evt; - stream.GetChangeGameObjectOrComponentPropertiesEvent(i, out evt); - instanceIds = new[] - { - evt.instanceId - }; - scene = evt.scene; - } - else if (eventType == ObjectChangeKind.CreateGameObjectHierarchy) - { - CreateGameObjectHierarchyEventArgs evt; - stream.GetCreateGameObjectHierarchyEvent(i, out evt); - instanceIds = new[] - { - evt.instanceId - }; - scene = evt.scene; - } - /*else if (eventType == ObjectChangeKind.ChangeAssetObjectProperties) - { - ChangeAssetObjectPropertiesEventArgs evt; - stream.GetChangeAssetObjectPropertiesEvent(i, out evt); - instanceIds = new int[] { evt.instanceId }; - }*/ - else if (eventType == ObjectChangeKind.UpdatePrefabInstances) - { - UpdatePrefabInstancesEventArgs evt; - stream.GetUpdatePrefabInstancesEvent(i, out evt); - instanceIds = evt.instanceIds.ToArray(); - scene = evt.scene; - } - else - continue; - - var mgr = (ES3ReferenceMgr)ES3ReferenceMgrBase.GetManagerFromScene(scene); - - if (mgr == null) - return; - - foreach (int id in instanceIds) - { - try - { - var obj = EditorUtility.InstanceIDToObject(id); - - if (obj == null) - continue; - - mgr.AddDependencies(obj); - } - catch {} - } - } - } -#endif - - /*public static void PlayModeStateChanged(PlayModeStateChange state) - { - // Add all GameObjects and Components to the reference manager before we enter play mode. - if (state == PlayModeStateChange.ExitingEditMode && ES3Settings.defaultSettingsScriptableObject.autoUpdateReferences) - RefreshReferences(true); - }*/ - - public static string[] OnWillSaveAssets(string[] paths) - { - // Don't refresh references when the application is playing. - if (!EditorApplication.isUpdating && !Application.isPlaying) - { - if (ES3Settings.defaultSettingsScriptableObject.autoUpdateReferences && ES3Settings.defaultSettingsScriptableObject.updateReferencesWhenSceneIsSaved) - RefreshReferences(); - UpdateAssembliesContainingES3Types(); - } - return paths; - } - - #endregion -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3Postprocessor.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3Postprocessor.cs.meta deleted file mode 100644 index f6726e4..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3Postprocessor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 4256380692bcb4e57bdc0a5e13956389 -timeCreated: 1474041535 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3PrefabEditor.cs b/Assets/Plugins/Easy Save 3/Editor/ES3PrefabEditor.cs deleted file mode 100644 index 5bd5a1b..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3PrefabEditor.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using ES3Internal; -using UnityEditor; -using Object = UnityEngine.Object; - -[CustomEditor(typeof(ES3Prefab))] -[Serializable] -public class ES3PrefabEditor : Editor -{ - private bool openLocalRefs; - private bool showAdvanced; - - public override void OnInspectorGUI() - { - var es3Prefab = (ES3Prefab)serializedObject.targetObject; - EditorGUILayout.HelpBox("Easy Save is enabled for this prefab, and can be saved and loaded with the ES3 methods.", MessageType.None); - - - showAdvanced = EditorGUILayout.Foldout(showAdvanced, "Advanced Settings"); - if (showAdvanced) - { - EditorGUI.indentLevel++; - es3Prefab.prefabId = EditorGUILayout.LongField("Prefab ID", es3Prefab.prefabId); - EditorGUILayout.LabelField("Reference count", es3Prefab.localRefs.Count.ToString()); - EditorGUI.indentLevel--; - - openLocalRefs = EditorGUILayout.Foldout(openLocalRefs, "localRefs"); - if (openLocalRefs) - { - EditorGUI.indentLevel++; - - EditorGUILayout.LabelField("It is not recommended to manually modify these."); - - foreach (KeyValuePair kvp in es3Prefab.localRefs) - { - EditorGUILayout.BeginHorizontal(); - - EditorGUILayout.ObjectField(kvp.Key, typeof(Object), false); - EditorGUILayout.LongField(kvp.Value); - - EditorGUILayout.EndHorizontal(); - } - - EditorGUI.indentLevel--; - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3PrefabEditor.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3PrefabEditor.cs.meta deleted file mode 100644 index f0d7c5e..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3PrefabEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9d25610c9233c4cdfa5a0744c9956f5c -timeCreated: 1519132292 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3ReferenceMgrEditor.cs b/Assets/Plugins/Easy Save 3/Editor/ES3ReferenceMgrEditor.cs deleted file mode 100644 index 78a1bc1..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3ReferenceMgrEditor.cs +++ /dev/null @@ -1,220 +0,0 @@ -using System; -using System.Collections.Generic; -using ES3Internal; -using UnityEditor; -using UnityEngine; -using UnityEngine.SceneManagement; -using Object = UnityEngine.Object; - -[CustomEditor(typeof(ES3ReferenceMgr))] -[Serializable] -public class ES3ReferenceMgrEditor : Editor -{ - - private ES3ReferenceMgr _mgr; - private bool isDraggingOver; - private bool openReferences; - private ES3ReferenceMgr mgr - { - get - { - if (_mgr == null) - _mgr = (ES3ReferenceMgr)serializedObject.targetObject; - return _mgr; - } - } - - public override void OnInspectorGUI() - { - EditorGUILayout.HelpBox("This allows Easy Save to maintain references to objects in your scene.\n\nIt is automatically updated when you enter Playmode or build your project.", MessageType.Info); - - if (EditorGUILayout.Foldout(openReferences, "References") != openReferences) - { - openReferences = !openReferences; - if (openReferences) - openReferences = EditorUtility.DisplayDialog("Are you sure?", "Opening this list will display every reference in the manager, which for larger projects can cause the Editor to freeze\n\nIt is strongly recommended that you save your project before continuing.", "Open References", "Cancel"); - } - - // Make foldout drag-and-drop enabled for objects. - if (GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition)) - { - var evt = Event.current; - - switch (evt.type) - { - case EventType.DragUpdated: - case EventType.DragPerform: - isDraggingOver = true; - break; - case EventType.DragExited: - isDraggingOver = false; - break; - } - - if (isDraggingOver) - { - DragAndDrop.visualMode = DragAndDropVisualMode.Copy; - - if (evt.type == EventType.DragPerform) - { - DragAndDrop.AcceptDrag(); - Undo.RecordObject(mgr, "Add References to Easy Save 3 Reference List"); - foreach (var obj in DragAndDrop.objectReferences) - mgr.Add(obj); - // Return now because otherwise we'll change the GUI during an event which doesn't allow it. - return; - } - } - } - - if (openReferences) - { - EditorGUI.indentLevel++; - - foreach (KeyValuePair kvp in mgr.idRef) - { - EditorGUILayout.BeginHorizontal(); - - var value = EditorGUILayout.ObjectField(kvp.Value, typeof(Object), true); - long key = EditorGUILayout.LongField(kvp.Key); - - EditorGUILayout.EndHorizontal(); - - if (value != kvp.Value || key != kvp.Key) - { - Undo.RecordObject(mgr, "Change Easy Save 3 References"); - // If we're deleting a value, delete it. - if (value == null) - mgr.Remove(key); - // Else, update the ID. - else - mgr.ChangeId(kvp.Key, key); - // Break, as removing or changing Dictionary items will make the foreach out of sync. - break; - } - } - - EditorGUI.indentLevel--; - } - - mgr.openPrefabs = EditorGUILayout.Foldout(mgr.openPrefabs, "ES3Prefabs"); - if (mgr.openPrefabs) - { - EditorGUI.indentLevel++; - - foreach (var prefab in mgr.prefabs) - { - EditorGUILayout.BeginHorizontal(); - - EditorGUILayout.ObjectField(prefab, typeof(Object), true); - - EditorGUILayout.EndHorizontal(); - } - - EditorGUI.indentLevel--; - } - - var sp = serializedObject.FindProperty("excludeObjects"); - EditorGUILayout.PropertyField(sp); - serializedObject.ApplyModifiedProperties(); - - EditorGUILayout.LabelField("Reference count", mgr.refId.Count.ToString()); - EditorGUILayout.LabelField("Prefab count", mgr.prefabs.Count.ToString()); - - if (GUILayout.Button("Refresh")) - { - mgr.RefreshDependencies(); - } - - if (GUILayout.Button("Optimize")) - { - mgr.Optimize(); - } - } - - [MenuItem("GameObject/Easy Save 3/Add Reference(s) to Manager", false, 33)] - [MenuItem("Assets/Easy Save 3/Add Reference(s) to Manager", false, 33)] - public static void AddReferenceToManager() - { - var mgr = ES3ReferenceMgrBase.Current; - if (mgr == null) - { - EditorUtility.DisplayDialog("Could not add reference to manager", "This object could not be added to the reference manager because no reference manager exists in this scene. To create one, go to Tools > Easy Save 3 > Add Manager to Scene", "Ok"); - return; - } - - Object[] selected = Selection.GetFiltered(SelectionMode.DeepAssets); - - if (selected == null || selected.Length == 0) - return; - - Undo.RecordObject(mgr, "Update Easy Save 3 Reference Manager"); - - foreach (var obj in selected) - { - if (obj == null) - continue; - - if (obj.GetType() == typeof(GameObject)) - { - var go = (GameObject)obj; - if (ES3EditorUtility.IsPrefabInAssets(go) && go.GetComponent() != null) - mgr.AddPrefab(go.GetComponent()); - } - - ((ES3ReferenceMgr)mgr).AddDependencies(obj); - } - } - - [MenuItem("GameObject/Easy Save 3/Add Reference(s) to Manager", true, 33)] - [MenuItem("Assets/Easy Save 3/Add Reference(s) to Manager", true, 33)] - private static bool CanAddReferenceToManager() - { - Object[] selected = Selection.GetFiltered(SelectionMode.Deep); - return selected != null && selected.Length > 0 && ES3ReferenceMgrBase.Current != null; - } - - [MenuItem("GameObject/Easy Save 3/Exclude Reference(s) from Manager", false, 33)] - [MenuItem("Assets/Easy Save 3/Exclude Reference(s) from Manager", false, 33)] - public static void ExcludeReferenceFromManager() - { - var mgr = (ES3ReferenceMgr)ES3ReferenceMgrBase.Current; - if (mgr == null) - { - EditorUtility.DisplayDialog("Could not exclude reference from manager", "This object could not be excluded from the reference manager because no reference manager exists in this scene. To create one, go to Tools > Easy Save 3 > Add Manager to Scene", "Ok"); - return; - } - - Object[] selected = Selection.GetFiltered(SelectionMode.DeepAssets); - - if (selected == null || selected.Length == 0) - return; - - - Undo.RecordObject(mgr, "Exclude from Easy Save 3 Reference Manager"); - - if (mgr.excludeObjects == null) - mgr.excludeObjects = new List(); - - mgr.excludeObjects.AddRange(EditorUtility.CollectDependencies(selected)); - mgr.RemoveNullOrInvalidValues(); - } - - [MenuItem("GameObject/Easy Save 3/Add Manager to Scene", false, 33)] - [MenuItem("Assets/Easy Save 3/Add Manager to Scene", false, 33)] - [MenuItem("Tools/Easy Save 3/Add Manager to Scene", false, 150)] - public static void EnableForScene() - { - if (!SceneManager.GetActiveScene().isLoaded) - EditorUtility.DisplayDialog("Could not add manager to scene", "Could not add Easy Save 3 Manager to scene because there is not currently a scene open.", "Ok"); - Selection.activeObject = ES3Postprocessor.AddManagerToScene(); - } - - [MenuItem("GameObject/Easy Save 3/Add Manager to Scene", true, 33)] - [MenuItem("Assets/Easy Save 3/Add Manager to Scene", true, 33)] - [MenuItem("Tools/Easy Save 3/Add Manager to Scene", true, 150)] - private static bool CanEnableForScene() - { - return ES3ReferenceMgrBase.GetManagerFromScene(SceneManager.GetActiveScene()) == null; - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3ReferenceMgrEditor.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3ReferenceMgrEditor.cs.meta deleted file mode 100644 index b60a7a3..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3ReferenceMgrEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3b43d266ed3464dedaa77757645ad61c -timeCreated: 1519132283 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3ScriptableObjectTypeTemplate.txt b/Assets/Plugins/Easy Save 3/Editor/ES3ScriptableObjectTypeTemplate.txt deleted file mode 100644 index c5d9a4b..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3ScriptableObjectTypeTemplate.txt +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using UnityEngine; - -namespace ES3Types -{ - [UnityEngine.Scripting.Preserve] - [ES3PropertiesAttribute([propertyNames])] - public class ES3UserType_[es3TypeSuffix] : ES3ScriptableObjectType - { - public static ES3Type Instance = null; - - public ES3UserType_[es3TypeSuffix]() : base(typeof([fullType])){ Instance = this; priority = 1; } - - - protected override void WriteScriptableObject(object obj, ES3Writer writer) - { - var instance = ([fullType])obj; - [writes] - } - - protected override void ReadScriptableObject(ES3Reader reader, object obj) - { - var instance = ([fullType])obj; - foreach(string propertyName in reader.Properties) - { - switch(propertyName) - { - [reads] - default: - reader.Skip(); - break; - } - } - } - } - - - public class ES3UserType_[es3TypeSuffix]Array : ES3ArrayType - { - public static ES3Type Instance; - - public ES3UserType_[es3TypeSuffix]Array() : base(typeof([fullType][]), ES3UserType_[es3TypeSuffix].Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3ScriptableObjectTypeTemplate.txt.meta b/Assets/Plugins/Easy Save 3/Editor/ES3ScriptableObjectTypeTemplate.txt.meta deleted file mode 100644 index 11ad974..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3ScriptableObjectTypeTemplate.txt.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3b4ae594e55834c35b197df04c2e81cb -timeCreated: 1483698819 -licenseType: Store -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3ScriptingDefineSymbols.cs b/Assets/Plugins/Easy Save 3/Editor/ES3ScriptingDefineSymbols.cs deleted file mode 100644 index 3fef138..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3ScriptingDefineSymbols.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using UnityEditor; -using UnityEditor.Build; -[InitializeOnLoad] -public class ES3ScriptingDefineSymbols -{ - static ES3ScriptingDefineSymbols() - { - SetDefineSymbols(); - } - - private static void SetDefineSymbols() - { - if (Type.GetType("Unity.VisualScripting.IncludeInSettingsAttribute, Unity.VisualScripting.Core") != null) - SetDefineSymbol("UNITY_VISUAL_SCRIPTING"); - - if (Type.GetType("Ludiq.IncludeInSettingsAttribute, Ludiq.Core.Runtime") != null) - SetDefineSymbol("BOLT_VISUAL_SCRIPTING"); - } - - private static void SetDefineSymbol(string symbol) - { -#if UNITY_2021_2_OR_NEWER - foreach (var target in GetAllNamedBuildTargets()) - { - string[] defines; - try - { - PlayerSettings.GetScriptingDefineSymbols(target, out defines); - if (!defines.Contains(symbol)) - { - ArrayUtility.Add(ref defines, symbol); - PlayerSettings.SetScriptingDefineSymbols(target, defines); - } - } - catch {} - } -#else - string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup); - var allDefines = new HashSet(definesString.Split(';')); - if (!allDefines.Contains(symbol)) - PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, string.Join(";", allDefines.Concat(new string[] { symbol }).ToArray())); -#endif - } - -#if UNITY_2021_2_OR_NEWER - private static List GetAllNamedBuildTargets() - { - FieldInfo[] staticFields = typeof(NamedBuildTarget).GetFields(BindingFlags.Public | BindingFlags.Static); - List buildTargets = new List(); - - foreach (var staticField in staticFields) - { - // We exclude 'Unknown' because this can throw errors when used with certain methods. - if (staticField.Name == "Unknown") - continue; - - // A bug at Unity's end means that Stadia can throw an error. - if (staticField.Name == "Stadia") - continue; - - if (staticField.FieldType == typeof(NamedBuildTarget)) - buildTargets.Add((NamedBuildTarget)staticField.GetValue(null)); - } - - return buildTargets; - } -#endif -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3ScriptingDefineSymbols.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3ScriptingDefineSymbols.cs.meta deleted file mode 100644 index ca2780c..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3ScriptingDefineSymbols.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 69b6276384d46d34fb2705f95689e8cc -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3SettingsEditor.cs b/Assets/Plugins/Easy Save 3/Editor/ES3SettingsEditor.cs deleted file mode 100644 index aad209b..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3SettingsEditor.cs +++ /dev/null @@ -1,52 +0,0 @@ -using UnityEditor; -using UnityEngine; - -namespace ES3Editor -{ - public static class ES3SettingsEditor - { - public static void Draw(ES3SerializableSettings settings) - { - var style = EditorStyle.Get; - - settings.location = (ES3.Location)EditorGUILayout.EnumPopup("Location", settings.location); - // If the location is File, show the Directory. - if (settings.location == ES3.Location.File) - settings.directory = (ES3.Directory)EditorGUILayout.EnumPopup("Directory", settings.directory); - - settings.path = EditorGUILayout.TextField("Default File Path", settings.path); - - EditorGUILayout.Space(); - - settings.encryptionType = (ES3.EncryptionType)EditorGUILayout.EnumPopup("Encryption", settings.encryptionType); - settings.encryptionPassword = EditorGUILayout.TextField("Encryption Password", settings.encryptionPassword); - - EditorGUILayout.Space(); - - settings.compressionType = (ES3.CompressionType)EditorGUILayout.EnumPopup("Compression", settings.compressionType); - - EditorGUILayout.Space(); - - settings.saveChildren = EditorGUILayout.Toggle("Save GameObject Children", settings.saveChildren); - - EditorGUILayout.Space(); - - if (settings.showAdvancedSettings = EditorGUILayout.Foldout(settings.showAdvancedSettings, "Advanced Settings")) - { - EditorGUILayout.BeginVertical(style.area); - - settings.format = (ES3.Format)EditorGUILayout.EnumPopup("Format", settings.format); - if (settings.format == ES3.Format.JSON) - settings.prettyPrint = EditorGUILayout.Toggle(new GUIContent("Pretty print JSON"), settings.prettyPrint); - settings.bufferSize = EditorGUILayout.IntField("Buffer Size", settings.bufferSize); - settings.memberReferenceMode = (ES3.ReferenceMode)EditorGUILayout.EnumPopup("Serialise Unity Object fields", settings.memberReferenceMode); - settings.serializationDepthLimit = EditorGUILayout.IntField("Serialisation Depth", settings.serializationDepthLimit); - settings.postprocessRawCachedData = EditorGUILayout.Toggle(new GUIContent("Postprocess raw cached data"), settings.postprocessRawCachedData); - - EditorGUILayout.Space(); - - EditorGUILayout.EndVertical(); - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3SettingsEditor.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3SettingsEditor.cs.meta deleted file mode 100644 index be6af3c..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3SettingsEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 35659b9a083a341d7bee216c4b71f4bc -timeCreated: 1519132282 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3TypeTemplate.txt b/Assets/Plugins/Easy Save 3/Editor/ES3TypeTemplate.txt deleted file mode 100644 index 30c17ba..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3TypeTemplate.txt +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using UnityEngine; - -namespace ES3Types -{ - [UnityEngine.Scripting.Preserve] - [ES3PropertiesAttribute([propertyNames])] - public class ES3UserType_[es3TypeSuffix] : ES3Type - { - public static ES3Type Instance = null; - - public ES3UserType_[es3TypeSuffix]() : base(typeof([fullType])){ Instance = this; priority = 1;} - - - public override void Write(object obj, ES3Writer writer) - { - var instance = ([fullType])obj; - [writes] - } - - public override object Read(ES3Reader reader) - { - var instance = new [fullType](); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = ([fullType])obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch(propertyName) - { - [reads] - default: - reader.Skip(); - break; - } - } - } - } - - - public class ES3UserType_[es3TypeSuffix]Array : ES3ArrayType - { - public static ES3Type Instance; - - public ES3UserType_[es3TypeSuffix]Array() : base(typeof([fullType][]), ES3UserType_[es3TypeSuffix].Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3TypeTemplate.txt.meta b/Assets/Plugins/Easy Save 3/Editor/ES3TypeTemplate.txt.meta deleted file mode 100644 index 7c86dfe..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3TypeTemplate.txt.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e84ec2bd739f543b0a5cd3c13741f744 -timeCreated: 1483718243 -licenseType: Store -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3Type_MaterialTemplate.txt b/Assets/Plugins/Easy Save 3/Editor/ES3Type_MaterialTemplate.txt deleted file mode 100644 index 541952f..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3Type_MaterialTemplate.txt +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using UnityEngine; - -namespace ES3Types -{ - [UnityEngine.Scripting.Preserve] - public class ES3UserType_Material : ES3UnityObjectType - { - public static ES3Type Instance = null; - - public ES3UserType_Material() : base(typeof(UnityEngine.Material)){ Instance = this; priority = 1; } - - - protected override void WriteUnityObject(object obj, ES3Writer writer) - { - var instance = (UnityEngine.Material)obj; - - writer.WriteProperty("shader", instance.shader); - writer.WriteProperty("renderQueue", instance.renderQueue, ES3Type_int.Instance); - writer.WriteProperty("shaderKeywords", instance.shaderKeywords); - writer.WriteProperty("globalIlluminationFlags", instance.globalIlluminationFlags); - [writes] - } - - protected override object ReadUnityObject(ES3Reader reader) - { - var obj = new Material(Shader.Find("Diffuse")); - ReadUnityObject(reader, obj); - return obj; - } - - protected override void ReadUnityObject(ES3Reader reader, object obj) - { - var instance = (UnityEngine.Material)obj; - foreach(string propertyName in reader.Properties) - { - switch(propertyName) - { - case "name": - instance.name = reader.Read(ES3Type_string.Instance); - break; - case "shader": - instance.shader = reader.Read(ES3Type_Shader.Instance); - break; - case "renderQueue": - instance.renderQueue = reader.Read(ES3Type_int.Instance); - break; - case "shaderKeywords": - instance.shaderKeywords = reader.Read(); - break; - case "globalIlluminationFlags": - instance.globalIlluminationFlags = reader.Read(); - break; - [reads] - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3Type_MaterialTemplate.txt.meta b/Assets/Plugins/Easy Save 3/Editor/ES3Type_MaterialTemplate.txt.meta deleted file mode 100644 index 5ee9deb..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3Type_MaterialTemplate.txt.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f90b0399488ef42e5bc804122fd99c58 -timeCreated: 1483698819 -licenseType: Store -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3ValueTypeTemplate.txt b/Assets/Plugins/Easy Save 3/Editor/ES3ValueTypeTemplate.txt deleted file mode 100644 index 5df924e..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3ValueTypeTemplate.txt +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using UnityEngine; - -namespace ES3Types -{ - [UnityEngine.Scripting.Preserve] - [ES3PropertiesAttribute([propertyNames])] - public class ES3UserType_[es3TypeSuffix] : ES3Type - { - public static ES3Type Instance = null; - - public ES3UserType_[es3TypeSuffix]() : base(typeof([fullType])){ Instance = this; priority = 1;} - - - public override void Write(object obj, ES3Writer writer) - { - var instance = ([fullType])obj; - [writes] - } - - public override object Read(ES3Reader reader) - { - var instance = new [fullType](); - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch(propertyName) - { - [reads] - default: - reader.Skip(); - break; - } - } - return instance; - } - } - - - public class ES3UserType_[es3TypeSuffix]Array : ES3ArrayType - { - public static ES3Type Instance; - - public ES3UserType_[es3TypeSuffix]Array() : base(typeof([fullType][]), ES3UserType_[es3TypeSuffix].Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3ValueTypeTemplate.txt.meta b/Assets/Plugins/Easy Save 3/Editor/ES3ValueTypeTemplate.txt.meta deleted file mode 100644 index 067cb04..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3ValueTypeTemplate.txt.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f67742ea0c50242f8af16c3f807b723b -timeCreated: 1483718243 -licenseType: Store -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3Window.cs b/Assets/Plugins/Easy Save 3/Editor/ES3Window.cs deleted file mode 100644 index 7692dd9..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3Window.cs +++ /dev/null @@ -1,240 +0,0 @@ -using System; -using System.Linq; -using UnityEditor; -using UnityEngine; - -namespace ES3Editor -{ - public class ES3Window : EditorWindow - { - - public SubWindow currentWindow; - private SubWindow[] windows; - - private void OnEnable() - { - if (windows == null) - InitSubWindows(); - // Set the window name and icon. - var icon = AssetDatabase.LoadAssetAtPath(ES3Settings.PathToEasySaveFolder() + "Editor/es3Logo16x16.png"); - titleContent = new GUIContent("Easy Save", icon); - - // Get the last opened window and open it. - if (currentWindow == null) - { - string currentWindowName = EditorPrefs.GetString("ES3Editor.Window.currentWindow", windows[0].name); - for (int i = 0; i < windows.Length; i++) - { - if (windows[i].name == currentWindowName) - { - currentWindow = windows[i]; - break; - } - } - } - } - - private void OnDestroy() - { - if (currentWindow != null) - currentWindow.OnDestroy(); - } - - private void OnGUI() - { - var style = EditorStyle.Get; - - // Display the menu. - EditorGUILayout.BeginHorizontal(); - - for (int i = 0; i < windows.Length; i++) - { - if (GUILayout.Button(windows[i].name, currentWindow == windows[i] ? style.menuButtonSelected : style.menuButton)) - SetCurrentWindow(windows[i]); - } - - EditorGUILayout.EndHorizontal(); - - if (currentWindow != null) - currentWindow.OnGUI(); - } - - private void OnFocus() - { - if (currentWindow != null) - currentWindow.OnFocus(); - } - - private void OnHierarchyChange() - { - if (currentWindow != null) - currentWindow.OnHierarchyChange(); - } - - private void OnLostFocus() - { - if (currentWindow != null) - currentWindow.OnLostFocus(); - } - - [MenuItem("Window/Easy Save 3", false, 1000)] - [MenuItem("Assets/Easy Save 3/Open Easy Save 3 Window", false, 1000)] - public static void Init() - { - // Get existing open window or if none, make a new one: - var window = (ES3Window)GetWindow(typeof(ES3Window)); - if (window != null) - window.Show(); - } - - public static void InitAndShowHome() - { - // Get existing open window or if none, make a new one: - var window = (ES3Window)GetWindow(typeof(ES3Window)); - if (window != null) - { - window.Show(); - window.SetCurrentWindow(typeof(HomeWindow)); - } - } - - [MenuItem("Tools/Easy Save 3/Auto Save", false, 100)] - public static void InitAndShowAutoSave() - { - // Get existing open window or if none, make a new one: - var window = (ES3Window)GetWindow(typeof(ES3Window)); - if (window != null) - { - window.Show(); - window.SetCurrentWindow(typeof(AutoSaveWindow)); - } - } - - public static void InitAndShowReferences() - { - // Get existing open window or if none, make a new one: - var window = (ES3Window)GetWindow(typeof(ES3Window)); - if (window != null) - { - window.Show(); - window.SetCurrentWindow(typeof(ReferencesWindow)); - } - } - - [MenuItem("Tools/Easy Save 3/Types", false, 100)] - public static void InitAndShowTypes() - { - // Get existing open window or if none, make a new one: - var window = (ES3Window)GetWindow(typeof(ES3Window)); - if (window != null) - { - window.Show(); - window.SetCurrentWindow(typeof(TypesWindow)); - } - } - - public static void InitAndShowTypes(Type type) - { - // Get existing open window or if none, make a new one: - var window = (ES3Window)GetWindow(typeof(ES3Window)); - if (window != null) - { - window.Show(); - var typesWindow = (TypesWindow)window.SetCurrentWindow(typeof(TypesWindow)); - typesWindow.SelectType(type); - } - } - - [MenuItem("Tools/Easy Save 3/Settings", false, 100)] - public static void InitAndShowSettings() - { - // Get existing open window or if none, make a new one: - var window = (ES3Window)GetWindow(typeof(ES3Window)); - if (window != null) - { - window.Show(); - window.SetCurrentWindow(typeof(SettingsWindow)); - } - } - - [MenuItem("Tools/Easy Save 3/Tools", false, 100)] - public static void InitAndShowTools() - { - // Get existing open window or if none, make a new one: - var window = (ES3Window)GetWindow(typeof(ES3Window)); - if (window != null) - { - window.Show(); - window.SetCurrentWindow(typeof(ToolsWindow)); - } - } - - public void InitSubWindows() - { - windows = new SubWindow[] - { - new HomeWindow(this), - new SettingsWindow(this), - new ToolsWindow(this), - new TypesWindow(this), - new AutoSaveWindow(this) - //, new ReferencesWindow(this) - }; - } - - private void SetCurrentWindow(SubWindow window) - { - if (currentWindow != null) - currentWindow.OnLostFocus(); - currentWindow = window; - currentWindow.OnFocus(); - EditorPrefs.SetString("ES3Editor.Window.currentWindow", window.name); - } - - private SubWindow SetCurrentWindow(Type type) - { - currentWindow.OnLostFocus(); - currentWindow = windows.First(w => w.GetType() == type); - EditorPrefs.SetString("ES3Editor.Window.currentWindow", currentWindow.name); - return currentWindow; - } - - // Shows the Easy Save Home window if it's not been disabled. - // This method is called from the Postprocessor. - public static void OpenEditorWindowOnStart() - { - if (EditorPrefs.GetBool("Show ES3 Window on Start", true)) - InitAndShowHome(); - EditorPrefs.SetBool("Show ES3 Window on Start", false); - } - } - - public abstract class SubWindow - { - public string name; - public EditorWindow parent; - - public SubWindow(string name, EditorWindow parent) - { - this.name = name; - this.parent = parent; - } - public abstract void OnGUI(); - - public virtual void OnLostFocus() - { - } - - public virtual void OnFocus() - { - } - - public virtual void OnDestroy() - { - } - - public virtual void OnHierarchyChange() - { - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ES3Window.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ES3Window.cs.meta deleted file mode 100644 index 0f5ce70..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ES3Window.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a95d98897f1cf4e7288b53b0fd8036c1 -timeCreated: 1519132293 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/EasySave3.asmdef.disabled b/Assets/Plugins/Easy Save 3/Editor/EasySave3.asmdef.disabled deleted file mode 100644 index b50911d..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/EasySave3.asmdef.disabled +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "EasySave3", - "rootNamespace": "", - "references": [ - "Unity.VisualScripting.Core" - ], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/EasySave3.asmdef.disabled.meta b/Assets/Plugins/Easy Save 3/Editor/EasySave3.asmdef.disabled.meta deleted file mode 100644 index 0820efe..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/EasySave3.asmdef.disabled.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6eac6c06328c1ab4dacdf5d40907da6b -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/EasySave3Editor.asmdef.disabled b/Assets/Plugins/Easy Save 3/Editor/EasySave3Editor.asmdef.disabled deleted file mode 100644 index 08e43c1..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/EasySave3Editor.asmdef.disabled +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "EasySave3Editor", - "rootNamespace": "", - "references": [ - "EasySave3" - ], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/EnableES3AssemblyDefinitions.cs b/Assets/Plugins/Easy Save 3/Editor/EnableES3AssemblyDefinitions.cs deleted file mode 100644 index 4c0c4b5..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/EnableES3AssemblyDefinitions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.IO; -using UnityEditor; -public class EnableES3AssemblyDefinitions : Editor -{ - [MenuItem("Tools/Easy Save 3/Enable Assembly Definition Files", false, 150)] - public static void EnableAsmDef() - { - string pathToEasySaveFolder = ES3Settings.PathToEasySaveFolder(); - File.Delete(pathToEasySaveFolder + "Editor/EasySave3.asmdef.disabled.meta"); - File.Delete(pathToEasySaveFolder + "Editor/EasySave3Editor.asmdef.disabled.meta"); - File.Move(pathToEasySaveFolder + "Editor/EasySave3Editor.asmdef.disabled", pathToEasySaveFolder + "Editor/EasySave3Editor.asmdef"); - File.Move(pathToEasySaveFolder + "Editor/EasySave3.asmdef.disabled", pathToEasySaveFolder + "EasySave3.asmdef"); - AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate); - EditorUtility.DisplayDialog("Assembly definition files installed", "Assembly definition files for Easy Save 3 installed.\n\nYou may need to go to 'Assets > Reimport' to apply the changes.", "Done"); - } - - [MenuItem("Tools/Easy Save 3/Enable Assembly Definition Files", true, 150)] - public static bool CanEnableAsmDef() - { - return !File.Exists(ES3Settings.PathToEasySaveFolder() + "EasySave3.asmdef"); - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/EnableES3AssemblyDefinitions.cs.meta b/Assets/Plugins/Easy Save 3/Editor/EnableES3AssemblyDefinitions.cs.meta deleted file mode 100644 index 0144526..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/EnableES3AssemblyDefinitions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f53975dae5ac26947856dd0b0bd3be7e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/HomeWindow.cs b/Assets/Plugins/Easy Save 3/Editor/HomeWindow.cs deleted file mode 100644 index a468dda..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/HomeWindow.cs +++ /dev/null @@ -1,68 +0,0 @@ -using UnityEditor; -using UnityEngine; - -namespace ES3Editor -{ - public class HomeWindow : SubWindow - { - private Vector2 scrollPos = Vector2.zero; - - public HomeWindow(EditorWindow window) : base("Home", window) {} - - public override void OnGUI() - { - - var style = EditorStyle.Get; - - scrollPos = EditorGUILayout.BeginScrollView(scrollPos); - - EditorGUILayout.BeginVertical(style.area); - - GUILayout.Label("Welcome to Easy Save", style.heading); - - EditorGUILayout.BeginVertical(style.area); - GUILayout.Label("New To Easy Save?", style.subheading); - EditorGUILayout.BeginVertical(style.area); - ES3EditorUtility.DisplayLink("• See our Getting Started guide", "http://docs.moodkie.com/easy-save-3/getting-started/"); - EditorGUILayout.EndVertical(); - - GUILayout.Label("Support", style.subheading); - - EditorGUILayout.BeginVertical(style.area); - - ES3EditorUtility.DisplayLink("• Contact us directly", "http://www.moodkie.com/contact/"); - ES3EditorUtility.DisplayLink("• Ask a question in our Easy Save 3 forums", "http://moodkie.com/forum/viewforum.php?f=12"); - ES3EditorUtility.DisplayLink("• Ask a question in the Unity Forum thread", "https://forum.unity3d.com/threads/easy-save-the-complete-save-load-asset-for-unity.91040/"); - EditorGUILayout.EndVertical(); - - GUILayout.Label("Documentation and Guides", style.subheading); - - EditorGUILayout.BeginVertical(style.area); - - ES3EditorUtility.DisplayLink("• Documentation", "http://docs.moodkie.com/product/easy-save-3/"); - ES3EditorUtility.DisplayLink("• Guides", "http://docs.moodkie.com/product/easy-save-3/es3-guides/"); - ES3EditorUtility.DisplayLink("• API Scripting Reference", "http://docs.moodkie.com/product/easy-save-3/es3-api/"); - ES3EditorUtility.DisplayLink("• Supported Types", "http://docs.moodkie.com/easy-save-3/es3-supported-types/"); - - - EditorGUILayout.EndVertical(); - - GUILayout.Label("PlayMaker Documentation", style.subheading); - - EditorGUILayout.BeginVertical(style.area); - - ES3EditorUtility.DisplayLink("• Actions", "http://docs.moodkie.com/product/easy-save-3/es3-playmaker/es3-playmaker-actions/"); - ES3EditorUtility.DisplayLink("• Actions Overview", "http://docs.moodkie.com/easy-save-3/es3-playmaker/playmaker-actions-overview/"); - - - EditorGUILayout.EndVertical(); - - EditorGUILayout.EndVertical(); - - EditorGUILayout.EndVertical(); - - EditorGUILayout.EndScrollView(); - - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/HomeWindow.cs.meta b/Assets/Plugins/Easy Save 3/Editor/HomeWindow.cs.meta deleted file mode 100644 index cf019eb..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/HomeWindow.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 394cc2e77038849709526f44f7efdd22 -timeCreated: 1519132283 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ReferencesWindow.cs b/Assets/Plugins/Easy Save 3/Editor/ReferencesWindow.cs deleted file mode 100644 index b9fbfcf..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ReferencesWindow.cs +++ /dev/null @@ -1,17 +0,0 @@ -using UnityEditor; - -namespace ES3Editor -{ - public class ReferencesWindow : SubWindow - { - - - public ReferencesWindow(EditorWindow window) : base("References", window) {} - - public override void OnGUI() - { - - } - } - -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ReferencesWindow.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ReferencesWindow.cs.meta deleted file mode 100644 index 5e132e9..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ReferencesWindow.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: af2d805793e784eef87fbcdebb11fa35 -timeCreated: 1519132291 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/SettingsWindow.cs b/Assets/Plugins/Easy Save 3/Editor/SettingsWindow.cs deleted file mode 100644 index b24f2a1..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/SettingsWindow.cs +++ /dev/null @@ -1,179 +0,0 @@ -using UnityEditor; -using UnityEngine; - -namespace ES3Editor -{ - public class SettingsWindow : SubWindow - { - public ES3Defaults editorSettings; - public SerializedProperty referenceFoldersProperty; - - private Vector2 scrollPos = Vector2.zero; - public ES3SerializableSettings settings; - public SerializedObject so; - - public SettingsWindow(EditorWindow window) : base("Settings", window) {} - - public void OnEnable() - { - - } - - public override void OnGUI() - { - if (settings == null || editorSettings == null) - Init(); - - var style = EditorStyle.Get; - - float labelWidth = EditorGUIUtility.labelWidth; - - - EditorGUI.BeginChangeCheck(); - - using (var scrollView = new EditorGUILayout.ScrollViewScope(scrollPos, style.area)) - { - scrollPos = scrollView.scrollPosition; - - EditorGUIUtility.labelWidth = 160; - - GUILayout.Label("Runtime Settings", style.heading); - - using (new EditorGUILayout.VerticalScope(style.area)) - { - ES3SettingsEditor.Draw(settings); - } - - GUILayout.Label("Debug Settings", style.heading); - - using (new EditorGUILayout.VerticalScope(style.area)) - { - EditorGUIUtility.labelWidth = 100; - - using (new EditorGUILayout.HorizontalScope()) - { - EditorGUILayout.PrefixLabel("Log Info"); - editorSettings.logDebugInfo = EditorGUILayout.Toggle(editorSettings.logDebugInfo); - } - - using (new EditorGUILayout.HorizontalScope()) - { - EditorGUILayout.PrefixLabel("Log Warnings"); - editorSettings.logWarnings = EditorGUILayout.Toggle(editorSettings.logWarnings); - } - - using (new EditorGUILayout.HorizontalScope()) - { - EditorGUILayout.PrefixLabel("Log Errors"); - editorSettings.logErrors = EditorGUILayout.Toggle(editorSettings.logErrors); - } - - EditorGUILayout.Space(); - } - - GUILayout.Label("Editor Settings", style.heading); - - using (new EditorGUILayout.VerticalScope(style.area)) - { - EditorGUIUtility.labelWidth = 170; - - using (new EditorGUILayout.HorizontalScope()) - { - EditorGUILayout.PrefixLabel("Auto Update References"); - editorSettings.autoUpdateReferences = EditorGUILayout.Toggle(editorSettings.autoUpdateReferences); - } - - if (editorSettings.autoUpdateReferences) - { - using (new EditorGUILayout.HorizontalScope()) - { - var content = new GUIContent("-- When changes are made", "Should Easy Save update the reference manager when objects in your scene changes?"); - editorSettings.updateReferencesWhenSceneChanges = EditorGUILayout.Toggle(content, editorSettings.updateReferencesWhenSceneChanges); - } - - using (new EditorGUILayout.HorizontalScope()) - { - var content = new GUIContent("-- When scene is saved", "Should Easy Save update the reference manager when objects in your scene is saved?"); - editorSettings.updateReferencesWhenSceneIsSaved = EditorGUILayout.Toggle(content, editorSettings.updateReferencesWhenSceneIsSaved); - } - - using (new EditorGUILayout.HorizontalScope()) - { - var content = new GUIContent("-- When scene is opened", "Should Easy Save update the reference manager you open a scene in the Editor?"); - editorSettings.updateReferencesWhenSceneIsOpened = EditorGUILayout.Toggle(content, editorSettings.updateReferencesWhenSceneIsOpened); - } - EditorGUILayout.Space(); - } - - using (new EditorGUILayout.HorizontalScope()) - { - so.Update(); - EditorGUILayout.PropertyField(referenceFoldersProperty, true); - so.ApplyModifiedProperties(); - } - EditorGUILayout.Space(); - - /*using (new EditorGUILayout.HorizontalScope()) - { - var content = new GUIContent("Reference depth", "How deep should Easy Save look when gathering references from an object? Higher means deeper."); - EditorGUILayout.PrefixLabel(content); - editorSettings.collectDependenciesDepth = EditorGUILayout.IntField(editorSettings.collectDependenciesDepth); - }*/ - - using (new EditorGUILayout.HorizontalScope()) - { - var content = new GUIContent("Reference timeout (seconds)", "How many seconds should Easy Save taking collecting references for an object before timing out?"); - EditorGUILayout.PrefixLabel(content); - editorSettings.collectDependenciesTimeout = EditorGUILayout.IntField(editorSettings.collectDependenciesTimeout); - } - - using (new EditorGUILayout.HorizontalScope()) - { - EditorGUILayout.PrefixLabel("Use Global References"); - - string symbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup); - bool useGlobalReferences = !symbols.Contains("ES3GLOBAL_DISABLED"); - if (EditorGUILayout.Toggle(useGlobalReferences) != useGlobalReferences) - { - // Remove the existing symbol even if we're disabling global references, just incase it's already in there. - symbols = symbols.Replace("ES3GLOBAL_DISABLED;", ""); // With semicolon - symbols = symbols.Replace("ES3GLOBAL_DISABLED", ""); // Without semicolon - - // Add the symbol if useGlobalReferences is currently true, meaning that we want to disable it. - if (useGlobalReferences) - symbols = "ES3GLOBAL_DISABLED;" + symbols; - - PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, symbols); - - if (useGlobalReferences) - EditorUtility.DisplayDialog("Global references disabled for build platform", "This will only disable Global References for this build platform. To disable it for other build platforms, open that platform in the Build Settings and uncheck this box again.", "Ok"); - } - } - - using (new EditorGUILayout.HorizontalScope()) - { - var content = new GUIContent("Add All Prefabs to Manager", "Should all prefabs with ES3Prefab Components be added to the manager?"); - EditorGUILayout.PrefixLabel(content); - editorSettings.addAllPrefabsToManager = EditorGUILayout.Toggle(editorSettings.addAllPrefabsToManager); - } - - EditorGUILayout.Space(); - } - } - - if (EditorGUI.EndChangeCheck()) - EditorUtility.SetDirty(editorSettings); - - EditorGUIUtility.labelWidth = labelWidth; // Set the label width back to default - } - - public void Init() - { - editorSettings = ES3Settings.defaultSettingsScriptableObject; - settings = editorSettings.settings; - so = new SerializedObject(editorSettings); - referenceFoldersProperty = so.FindProperty("referenceFolders"); - } - } - -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/SettingsWindow.cs.meta b/Assets/Plugins/Easy Save 3/Editor/SettingsWindow.cs.meta deleted file mode 100644 index d58da5f..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/SettingsWindow.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 95e7bbc9a5aee44feb088811fb5e7b80 -timeCreated: 1519132291 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/ToolsWindow.cs b/Assets/Plugins/Easy Save 3/Editor/ToolsWindow.cs deleted file mode 100644 index 6464195..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ToolsWindow.cs +++ /dev/null @@ -1,153 +0,0 @@ -using System.IO; -using UnityEditor; -using UnityEngine; - -namespace ES3Editor -{ - public class ToolsWindow : SubWindow - { - public ToolsWindow(EditorWindow window) : base("Tools", window) {} - - public override void OnGUI() - { - var style = EditorStyle.Get; - - EditorGUILayout.BeginHorizontal(style.area); - - if (GUILayout.Button("Open Persistent Data Path")) - OpenPersistentDataPath(); - - EditorGUILayout.EndHorizontal(); - - EditorGUILayout.BeginHorizontal(style.area); - - if (GUILayout.Button("Clear Persistent Data Path")) - ClearPersistentDataPath(); - - if (GUILayout.Button("Clear PlayerPrefs")) - ClearPlayerPrefs(); - - EditorGUILayout.EndHorizontal(); - } - - [MenuItem("Tools/Easy Save 3/Open Persistent Data Path", false, 200)] - private static void OpenPersistentDataPath() - { - EditorUtility.RevealInFinder(Application.persistentDataPath); - } - - [MenuItem("Tools/Easy Save 3/Clear Persistent Data Path", false, 200)] - private static void ClearPersistentDataPath() - { - if (EditorUtility.DisplayDialog("Clear Persistent Data Path", "Are you sure you wish to clear the persistent data path?\n This action cannot be reversed.", "Clear", "Cancel")) - { - var di = new DirectoryInfo(Application.persistentDataPath); - - foreach (var file in di.GetFiles()) - file.Delete(); - foreach (var dir in di.GetDirectories()) - dir.Delete(true); - } - } - - [MenuItem("Tools/Easy Save 3/Clear PlayerPrefs", false, 200)] - private static void ClearPlayerPrefs() - { - if (EditorUtility.DisplayDialog("Clear PlayerPrefs", "Are you sure you wish to clear PlayerPrefs?\nThis action cannot be reversed.", "Clear", "Cancel")) - PlayerPrefs.DeleteAll(); - } - } - - /*public static class OSFileBrowser - { - public static bool IsInMacOS - { - get - { - return UnityEngine.SystemInfo.operatingSystem.IndexOf("Mac OS") != -1; - } - } - - public static bool IsInWinOS - { - get - { - return UnityEngine.SystemInfo.operatingSystem.IndexOf("Windows") != -1; - } - } - - public static void OpenInMac(string path) - { - bool openInsidesOfFolder = false; - - // try mac - string macPath = path.Replace("\\", "/"); // mac finder doesn't like backward slashes - - if ( System.IO.Directory.Exists(macPath) ) // if path requested is a folder, automatically open insides of that folder - { - openInsidesOfFolder = true; - } - - if ( !macPath.StartsWith("\"") ) - { - macPath = "\"" + macPath; - } - - if ( !macPath.EndsWith("\"") ) - { - macPath = macPath + "\""; - } - - string arguments = (openInsidesOfFolder ? "" : "-R ") + macPath; - - try - { - System.Diagnostics.Process.Start("open", arguments); - } - catch ( System.ComponentModel.Win32Exception e ) - { - // tried to open mac finder in windows - // just silently skip error - // we currently have no platform define for the current OS we are in, so we resort to this - e.HelpLink = ""; // do anything with this variable to silence warning about not using it - } - } - - public static void OpenInWin(string path) - { - bool openInsidesOfFolder = false; - - // try windows - string winPath = path.Replace("/", "\\"); // windows explorer doesn't like forward slashes - - if ( System.IO.Directory.Exists(winPath) ) // if path requested is a folder, automatically open insides of that folder - openInsidesOfFolder = true; - - try - { - System.Diagnostics.Process.Start("explorer.exe", (openInsidesOfFolder ? "/root," : "/select,") + "\"" + winPath + "\""); - } - catch ( System.ComponentModel.Win32Exception e ) - { - e.HelpLink = ""; - } - } - - public static void Open(string path) - { - if ( IsInWinOS ) - { - OpenInWin(path); - } - else if ( IsInMacOS ) - { - OpenInMac(path); - } - else // couldn't determine OS - { - OpenInWin(path); - OpenInMac(path); - } - } - }*/ -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/ToolsWindow.cs.meta b/Assets/Plugins/Easy Save 3/Editor/ToolsWindow.cs.meta deleted file mode 100644 index c6fbe3f..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/ToolsWindow.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0d6114c1d40624e9e8575e814c45ac1a -timeCreated: 1519132280 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/TypesWindow.cs b/Assets/Plugins/Easy Save 3/Editor/TypesWindow.cs deleted file mode 100644 index d2d835e..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/TypesWindow.cs +++ /dev/null @@ -1,725 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using ES3Internal; -using ES3Types; -using UnityEditor; -using UnityEngine; -using Object = UnityEngine.Object; - -namespace ES3Editor -{ - public class TypesWindow : SubWindow - { - private const int recentTypeCount = 5; - - private Texture2D checkmark; - private string classTemplateFile; - private string componentTemplateFile; - private ES3Reflection.ES3ReflectedMember[] fields = new ES3Reflection.ES3ReflectedMember[0]; - private bool[] fieldSelected = new bool[0]; - private GUIStyle leftPaneStyle; - private readonly int leftPaneWidth = 300; - private List recentTypes; - private string scriptableObjectTemplateFile; - private GUIStyle searchBarCancelButtonStyle; - //private Texture2D checkmarkSmall; - - private GUIStyle searchBarStyle; - - private string searchFieldValue = ""; - private GUIStyle selectAllNoneButtonStyle; - - private int selectedType = -1; - private GUIStyle selectedTypeButtonStyle; - private GUIStyle typeButtonStyle; - - private Vector2 typeListScrollPos = Vector2.zero; - private Vector2 typePaneScrollPos = Vector2.zero; - private TypeListItem[] types; - - private bool unsavedChanges; - - private string valueTemplateFile; - - public TypesWindow(EditorWindow window) : base("Types", window) {} - - public override void OnGUI() - { - if (types == null) - Init(); - - EditorGUILayout.BeginHorizontal(); - - EditorGUILayout.BeginVertical(leftPaneStyle); - SearchBar(); - TypeList(); - EditorGUILayout.EndVertical(); - EditorGUILayout.BeginVertical(); - TypePane(); - EditorGUILayout.EndVertical(); - - EditorGUILayout.EndHorizontal(); - } - - private void SearchBar() - { - var style = EditorStyle.Get; - - GUILayout.Label("Enter a type name in the field below\n* Type names are case-sensitive *", style.subheading2); - - EditorGUILayout.BeginHorizontal(); - - // Set control name so we can force a Focus reset for it. - string currentSearchFieldValue = EditorGUILayout.TextField(searchFieldValue, searchBarStyle); - - if (searchFieldValue != currentSearchFieldValue) - { - searchFieldValue = currentSearchFieldValue; - PerformSearch(currentSearchFieldValue); - } - - GUI.SetNextControlName("Clear"); - - if (GUILayout.Button("x", searchBarCancelButtonStyle)) - { - searchFieldValue = ""; - GUI.FocusControl("Clear"); - PerformSearch(""); - } - - EditorGUILayout.EndHorizontal(); - } - - private void RecentTypeList() - { - if (!string.IsNullOrEmpty(searchFieldValue) || recentTypes.Count == 0) - return; - - for (int i = recentTypes.Count - 1; i > -1; i--) - TypeButton(recentTypes[i]); - - EditorGUILayout.TextArea("", GUI.skin.horizontalSlider); - - } - - private void TypeList() - { - if (!string.IsNullOrEmpty(searchFieldValue)) - GUILayout.Label("Search Results", EditorStyles.boldLabel); - - typeListScrollPos = EditorGUILayout.BeginScrollView(typeListScrollPos); - - RecentTypeList(); - - if (!string.IsNullOrEmpty(searchFieldValue)) - for (int i = 0; i < types.Length; i++) - TypeButton(i); - - EditorGUILayout.EndScrollView(); - } - - private void TypePane() - { - if (selectedType < 0) - return; - - var style = EditorStyle.Get; - - var typeListItem = types[selectedType]; - var type = typeListItem.type; - - typePaneScrollPos = EditorGUILayout.BeginScrollView(typePaneScrollPos, style.area); - - GUILayout.Label(typeListItem.name, style.subheading); - GUILayout.Label(typeListItem.namespaceName); - - EditorGUILayout.BeginVertical(style.area); - - bool hasParameterlessConstructor = ES3Reflection.HasParameterlessConstructor(type); - bool isComponent = ES3Reflection.IsAssignableFrom(typeof(Component), type); - - string path = GetOutputPath(types[selectedType].type); - // An ES3Type file already exists. - if (File.Exists(path)) - { - if (hasParameterlessConstructor || isComponent) - { - EditorGUILayout.BeginHorizontal(); - if (GUILayout.Button("Reset to Default")) - { - SelectNone(true, true); - AssetDatabase.MoveAssetToTrash("Assets" + path.Remove(0, Application.dataPath.Length)); - SelectType(selectedType); - } - if (GUILayout.Button("Edit ES3Type Script")) - AssetDatabase.OpenAsset(AssetDatabase.LoadMainAssetAtPath("Assets" + path.Remove(0, Application.dataPath.Length))); - EditorGUILayout.EndHorizontal(); - } - else - { - EditorGUILayout.HelpBox("This type has no public parameterless constructors.\n\nTo support this type you will need to modify the ES3Type script to use a specific constructor instead of the parameterless constructor.", MessageType.Info); - if (GUILayout.Button("Click here to edit the ES3Type script")) - AssetDatabase.OpenAsset(AssetDatabase.LoadMainAssetAtPath("Assets" + path.Remove(0, Application.dataPath.Length))); - if (GUILayout.Button("Reset to Default")) - { - SelectAll(true, true); - File.Delete(path); - AssetDatabase.Refresh(); - } - } - } - // No ES3Type file and no fields. - else if (fields.Length == 0) - { - if (!hasParameterlessConstructor && !isComponent) - EditorGUILayout.HelpBox("This type has no public parameterless constructors.\n\nTo support this type you will need to create an ES3Type script and modify it to use a specific constructor instead of the parameterless constructor.", MessageType.Info); - - if (GUILayout.Button("Create ES3Type Script")) - Generate(); - } - // No ES3Type file, but fields are selectable. - else - { - if (!hasParameterlessConstructor && !isComponent) - { - EditorGUILayout.HelpBox("This type has no public parameterless constructors.\n\nTo support this type you will need to select the fields you wish to serialize below, and then modify the generated ES3Type script to use a specific constructor instead of the parameterless constructor.", MessageType.Info); - if (GUILayout.Button("Select all fields and generate ES3Type script")) - { - SelectAll(true, false); - Generate(); - } - } - else - { - if (GUILayout.Button("Create ES3Type Script")) - Generate(); - } - } - - EditorGUILayout.EndVertical(); - - PropertyPane(); - - EditorGUILayout.EndScrollView(); - } - - private void PropertyPane() - { - var style = EditorStyle.Get; - - EditorGUILayout.BeginVertical(style.area); - - GUILayout.Label("Fields", EditorStyles.boldLabel); - - DisplayFieldsOrProperties(true, false); - EditorGUILayout.Space(); - - GUILayout.Label("Properties", EditorStyles.boldLabel); - - DisplayFieldsOrProperties(false, true); - EditorGUILayout.EndVertical(); - } - - private void DisplayFieldsOrProperties(bool showFields, bool showProperties) - { - // Get field and property counts. - int fieldCount = 0; - int propertyCount = 0; - for (int i = 0; i < fields.Length; i++) - { - if (fields[i].isProperty && showProperties) - propertyCount++; - else if (!fields[i].isProperty && showFields) - fieldCount++; - } - - // If there is nothing to display, show message. - if (showFields && showProperties && fieldCount == 0 && propertyCount == 0) - GUILayout.Label("This type has no serializable fields or properties."); - else if (showFields && fieldCount == 0) - GUILayout.Label("This type has no serializable fields."); - else if (showProperties && propertyCount == 0) - GUILayout.Label("This type has no serializable properties."); - - // Display Select All/Select None buttons only if there are fields to display. - if (fieldCount > 0 || propertyCount > 0) - { - EditorGUILayout.BeginHorizontal(); - - if (GUILayout.Button("Select All", selectAllNoneButtonStyle)) - { - SelectAll(showFields, showProperties); - Generate(); - } - - if (GUILayout.Button("Select None", selectAllNoneButtonStyle)) - { - SelectNone(showFields, showProperties); - Generate(); - } - EditorGUILayout.EndHorizontal(); - } - - for (int i = 0; i < fields.Length; i++) - { - var field = fields[i]; - if (field.isProperty && !showProperties || !field.isProperty && !showFields) - continue; - - EditorGUILayout.BeginHorizontal(); - - var content = new GUIContent(field.Name); - - if (typeof(Object).IsAssignableFrom(field.MemberType)) - content.tooltip = field.MemberType + "\nSaved by reference"; - else - content.tooltip = field.MemberType + "\nSaved by value"; - - - - bool selected = EditorGUILayout.ToggleLeft(content, fieldSelected[i]); - if (selected != fieldSelected[i]) - { - fieldSelected[i] = selected; - unsavedChanges = true; - } - - EditorGUILayout.EndHorizontal(); - } - } - - // Selects all fields, properties or both. - private void SelectAll(bool selectFields, bool selectProperties) - { - for (int i = 0; i < fieldSelected.Length; i++) - if (fields[i].isProperty && selectProperties || !fields[i].isProperty && selectFields) - fieldSelected[i] = true; - } - - // Selects all fields, properties or both. - private void SelectNone(bool selectFields, bool selectProperties) - { - for (int i = 0; i < fieldSelected.Length; i++) - if (fields[i].isProperty && selectProperties || !fields[i].isProperty && selectFields) - fieldSelected[i] = false; - } - - public override void OnLostFocus() - { - if (unsavedChanges) - Generate(); - } - - private void TypeButton(int i) - { - var type = types[i]; - if (!types[i].showInList) - return; - - if (type.hasExplicitES3Type) - EditorGUILayout.BeginHorizontal(); - - - var thisTypeButtonStyle = i == selectedType ? selectedTypeButtonStyle : typeButtonStyle; - - if (GUILayout.Button(new GUIContent(type.name, type.namespaceName), thisTypeButtonStyle)) - SelectType(i); - - // Set the cursor. - var buttonRect = GUILayoutUtility.GetLastRect(); - EditorGUIUtility.AddCursorRect(buttonRect, MouseCursor.Link); - - - - if (type.hasExplicitES3Type) - { - GUILayout.Box(new GUIContent(checkmark, "Type is explicitly supported"), EditorStyles.largeLabel); - EditorGUILayout.EndHorizontal(); - } - } - - private void PerformSearch(string query) - { - string lowerCaseQuery = query.ToLowerInvariant(); - bool emptyQuery = string.IsNullOrEmpty(query); - - for (int i = 0; i < types.Length; i++) - types[i].showInList = emptyQuery || types[i].lowercaseName.Contains(lowerCaseQuery); - } - - public void SelectType(Type type) - { - Init(); - for (int i = 0; i < types.Length; i++) - if (types[i].type == type) - SelectType(i); - } - - private void SelectType(int typeIndex) - { - selectedType = typeIndex; - - if (selectedType == -1) - { - SaveType("TypesWindowSelectedType", -1); - return; - } - - SaveType("TypesWindowSelectedType", selectedType); - - if (!recentTypes.Contains(typeIndex)) - { - // If our recent type queue is full, remove an item before adding another. - if (recentTypes.Count == recentTypeCount) - recentTypes.RemoveAt(0); - recentTypes.Add(typeIndex); - for (int j = 0; j < recentTypes.Count; j++) - SaveType("TypesWindowRecentType" + j, recentTypes[j]); - } - - var type = types[selectedType].type; - - fields = ES3Reflection.GetSerializableMembers(type, false); - fieldSelected = new bool[fields.Length]; - - var es3Type = ES3TypeMgr.GetES3Type(type); - // If there's no ES3Type for this, only select fields which are supported by reflection. - if (es3Type == null) - { - ES3Reflection.ES3ReflectedMember[] safeFields = ES3Reflection.GetSerializableMembers(type); - for (int i = 0; i < fields.Length; i++) - fieldSelected[i] = safeFields.Any(item => item.Name == fields[i].Name); - return; - } - - // Get fields and whether they're selected. - List selectedFields = new List(); - object[] propertyAttributes = es3Type.GetType().GetCustomAttributes(typeof(ES3PropertiesAttribute), false); - if (propertyAttributes.Length > 0) - selectedFields.AddRange(((ES3PropertiesAttribute)propertyAttributes[0]).members); - - fieldSelected = new bool[fields.Length]; - - for (int i = 0; i < fields.Length; i++) - fieldSelected[i] = selectedFields.Contains(fields[i].Name); - } - - private void SaveType(string key, int typeIndex) - { - if (typeIndex == -1) - return; - SaveType(key, types[typeIndex].type); - } - - private void SaveType(string key, Type type) - { - EditorPrefs.SetString(key, type.AssemblyQualifiedName); - } - - private int LoadTypeIndex(string key) - { - string selectedTypeName = EditorPrefs.GetString(key, ""); - if (selectedTypeName != "") - { - var type = ES3Reflection.GetType(selectedTypeName); - if (type != null) - { - int typeIndex = GetTypeIndex(type); - if (typeIndex != -1) - return typeIndex; - } - } - return -1; - } - - private int GetTypeIndex(Type type) - { - for (int i = 0; i < types.Length; i++) - if (types[i].type == type) - return i; - return -1; - } - - private void Init() - { - componentTemplateFile = "ES3ComponentTypeTemplate.txt"; - classTemplateFile = "ES3ClassTypeTemplate.txt"; - valueTemplateFile = "ES3ValueTypeTemplate.txt"; - scriptableObjectTemplateFile = "ES3ScriptableObjectTypeTemplate.txt"; - - // Init Type List - List tempTypes = new List(); - - Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(assembly => !assembly.FullName.Contains("Editor") && assembly.FullName != "ES3" && !assembly.FullName.Contains("ES3")).OrderBy(assembly => assembly.GetName().Name).ToArray(); - - foreach (var assembly in assemblies) - { - Type[] assemblyTypes = assembly.GetTypes(); - - for (int i = 0; i < assemblyTypes.Length; i++) - { - var type = assemblyTypes[i]; - if (type.IsGenericType || type.IsEnum || type.IsNotPublic || type.IsAbstract || type.IsInterface) - continue; - - string typeName = type.Name; - if (typeName[0] == '$' || typeName[0] == '_' || typeName[0] == '<') - continue; - - string typeNamespace = type.Namespace; - string namespaceName = typeNamespace == null ? "" : typeNamespace; - - tempTypes.Add(new TypeListItem(type.Name, namespaceName, type, true, HasExplicitES3Type(type))); - } - - } - types = tempTypes.OrderBy(type => type.name).ToArray(); - - // Load types and recent types. - if (recentTypes == null) - { - recentTypes = new List(); - for (int i = 0; i < recentTypeCount; i++) - { - int typeIndex = LoadTypeIndex("TypesWindowRecentType" + i); - if (typeIndex != -1) - recentTypes.Add(typeIndex); - } - SelectType(LoadTypeIndex("TypesWindowSelectedType")); - } - - - PerformSearch(searchFieldValue); - - // Init Assets. - string es3FolderPath = ES3Settings.PathToEasySaveFolder(); - checkmark = AssetDatabase.LoadAssetAtPath(es3FolderPath + "Editor/checkmark.png"); - //checkmarkSmall = AssetDatabase.LoadAssetAtPath(es3FolderPath + "Editor/checkmarkSmall.png"); - - // Init Styles. - searchBarCancelButtonStyle = new GUIStyle(EditorStyles.miniButton); - float cancelButtonSize = EditorStyles.miniTextField.CalcHeight(new GUIContent(""), 20); - searchBarCancelButtonStyle.fixedWidth = cancelButtonSize; - searchBarCancelButtonStyle.fixedHeight = cancelButtonSize; - searchBarCancelButtonStyle.fontSize = 8; - searchBarCancelButtonStyle.padding = new RectOffset(); - searchBarStyle = new GUIStyle(EditorStyles.toolbarTextField); - searchBarStyle.stretchWidth = true; - - typeButtonStyle = new GUIStyle(EditorStyles.largeLabel); - typeButtonStyle.alignment = TextAnchor.MiddleLeft; - typeButtonStyle.stretchWidth = false; - selectedTypeButtonStyle = new GUIStyle(typeButtonStyle); - selectedTypeButtonStyle.fontStyle = FontStyle.Bold; - - leftPaneStyle = new GUIStyle(); - leftPaneStyle.fixedWidth = leftPaneWidth; - leftPaneStyle.clipping = TextClipping.Clip; - leftPaneStyle.padding = new RectOffset(10, 10, 10, 10); - - selectAllNoneButtonStyle = new GUIStyle(EditorStyles.miniButton); - selectAllNoneButtonStyle.stretchWidth = false; - selectAllNoneButtonStyle.margin = new RectOffset(0, 0, 0, 10); - } - - private void Generate() - { - var type = types[selectedType].type; - if (type == null) - { - EditorUtility.DisplayDialog("Type not selected", "Type not selected. Please ensure you select a type", "Ok"); - return; - } - - unsavedChanges = false; - - // Get the serializable fields of this class. - //var fields = ES3Reflection.GetSerializableES3Fields(type); - - // The string that we suffix to the class name. i.e. UnityEngine_UnityEngine_Transform. - string es3TypeSuffix = type.Name; - // The string for the full C#-safe type name. This name must be suitable for going inside typeof(). - string fullType = GetFullTypeName(type); - // The list of WriteProperty calls to write the properties of this type. - string writes = GenerateWrites(); - // The list of case statements and Read calls to read the properties of this type. - string reads = GenerateReads(); - // A comma-seperated string of fields we've supported in this type. - string propertyNames = ""; - - bool first = true; - for (int i = 0; i < fields.Length; i++) - { - if (!fieldSelected[i]) - continue; - - if (first) - first = false; - else - propertyNames += ", "; - propertyNames += "\"" + fields[i].Name + "\""; - } - - string easySaveEditorPath = ES3Settings.PathToEasySaveFolder() + "Editor/"; - - // Insert the relevant strings into the template. - string template; - if (typeof(Component).IsAssignableFrom(type)) - template = File.ReadAllText(easySaveEditorPath + componentTemplateFile); - else if (ES3Reflection.IsValueType(type)) - template = File.ReadAllText(easySaveEditorPath + valueTemplateFile); - else if (typeof(ScriptableObject).IsAssignableFrom(type)) - template = File.ReadAllText(easySaveEditorPath + scriptableObjectTemplateFile); - else - template = File.ReadAllText(easySaveEditorPath + classTemplateFile); - template = template.Replace("[es3TypeSuffix]", es3TypeSuffix); - template = template.Replace("[writes]", writes); - template = template.Replace("[reads]", reads); - template = template.Replace("[propertyNames]", propertyNames); - template = template.Replace("[fullType]", fullType); // Do this last as we use the [fullType] tag in reads. - - // Create the output file. - - - string outputFilePath = GetOutputPath(type); - var fileInfo = new FileInfo(outputFilePath); - fileInfo.Directory.Create(); - File.WriteAllText(outputFilePath, template); - AssetDatabase.Refresh(); - } - - private string GenerateWrites() - { - var type = types[selectedType].type; - bool isComponent = typeof(Component).IsAssignableFrom(type); - string writes = ""; - - for (int i = 0; i < fields.Length; i++) - { - var field = fields[i]; - bool selected = fieldSelected[i]; - var es3Type = ES3TypeMgr.GetES3Type(field.MemberType); - - if (!selected || isComponent && (field.Name == ES3Reflection.componentTagFieldName || field.Name == ES3Reflection.componentNameFieldName)) - continue; - - string writeByRef = ES3Reflection.IsAssignableFrom(typeof(Object), field.MemberType) ? "ByRef" : ""; - string es3TypeParam = HasExplicitES3Type(es3Type) && writeByRef == "" && !field.MemberType.IsEnum ? ", " + es3Type.GetType().Name + ".Instance" : writeByRef == "" ? ", ES3Internal.ES3TypeMgr.GetOrCreateES3Type(typeof(" + GetFullTypeName(field.MemberType) + "))" : ""; - - // If this is static, access the field through the class name rather than through an instance. - string instance = field.IsStatic ? GetFullTypeName(type) : "instance"; - - if (!field.IsPublic) - { - string memberType = field.isProperty ? "Property" : "Field"; - writes += string.Format("\r\n\t\t\twriter.WritePrivate{2}{1}(\"{0}\", instance);", field.Name, writeByRef, memberType); - } - else - writes += string.Format("\r\n\t\t\twriter.WriteProperty{1}(\"{0}\", {3}.{0}{2});", field.Name, writeByRef, es3TypeParam, instance); - } - return writes; - } - - private string GenerateReads() - { - var type = types[selectedType].type; - bool isComponent = typeof(Component).IsAssignableFrom(type); - string reads = ""; - - for (int i = 0; i < fields.Length; i++) - { - var field = fields[i]; - bool selected = fieldSelected[i]; - - if (!selected || isComponent && (field.Name == "tag" || field.Name == "name")) - continue; - - string fieldTypeName = GetFullTypeName(field.MemberType); - string es3TypeParam = HasExplicitES3Type(field.MemberType) ? ES3TypeMgr.GetES3Type(field.MemberType).GetType().Name + ".Instance" : ""; - // If this is static, access the field through the class name rather than through an instance. - string instance = field.IsStatic ? GetFullTypeName(type) : "instance"; - - // If we're writing a private field or property, we need to write it using a different method. - if (!field.IsPublic) - { - es3TypeParam = ", " + es3TypeParam; - - if (field.isProperty) - reads += string.Format("\r\n\t\t\t\t\tcase \"{0}\":\r\n\t\t\t\t\tinstance = ([fullType])reader.SetPrivateProperty(\"{0}\", reader.Read<{1}>(), instance);\r\n\t\t\t\t\tbreak;", field.Name, fieldTypeName); - else - reads += string.Format("\r\n\t\t\t\t\tcase \"{0}\":\r\n\t\t\t\t\tinstance = ([fullType])reader.SetPrivateField(\"{0}\", reader.Read<{1}>(), instance);\r\n\t\t\t\t\tbreak;", field.Name, fieldTypeName); - } - else - reads += string.Format("\r\n\t\t\t\t\tcase \"{0}\":\r\n\t\t\t\t\t\t{3}.{0} = reader.Read<{1}>({2});\r\n\t\t\t\t\t\tbreak;", field.Name, fieldTypeName, es3TypeParam, instance); - } - return reads; - } - - private string GetOutputPath(Type type) - { - return Application.dataPath + "/Easy Save 3/Types/ES3UserType_" + type.Name + ".cs"; - } - - /* Gets the full Type name, replacing any syntax (such as '+') with a dot to make it a valid type name */ - private static string GetFullTypeName(Type type) - { - string typeName = type.ToString(); - - typeName = typeName.Replace('+', '.'); - - // If it's a generic type, replace syntax with angled brackets. - int genericArgumentCount = type.GetGenericArguments().Length; - if (genericArgumentCount > 0) - { - return string.Format("{0}<{1}>", type.ToString().Split('`')[0], string.Join(", ", type.GetGenericArguments().Select(x => GetFullTypeName(x)).ToArray())); - } - - return typeName; - } - - /* Whether this type has an explicit ES3Type. For example, ES3ArrayType would return false, but ES3Vector3ArrayType would return true */ - private static bool HasExplicitES3Type(Type type) - { - var es3Type = ES3TypeMgr.GetES3Type(type); - if (es3Type == null) - return false; - // If this ES3Type has a static Instance property, return true. - if (es3Type.GetType().GetField("Instance", BindingFlags.Public | BindingFlags.Static) != null) - return true; - return false; - } - - private static bool HasExplicitES3Type(ES3Type es3Type) - { - if (es3Type == null) - return false; - // If this ES3Type has a static Instance property, return true. - if (es3Type.GetType().GetField("Instance", BindingFlags.Public | BindingFlags.Static) != null) - return true; - return false; - } - - public class TypeListItem - { - public bool hasExplicitES3Type; - public string lowercaseName; - public string name; - public string namespaceName; - public bool showInList; - public Type type; - - public TypeListItem(string name, string namespaceName, Type type, bool showInList, bool hasExplicitES3Type) - { - this.name = name; - lowercaseName = name.ToLowerInvariant(); - this.namespaceName = namespaceName; - this.type = type; - this.showInList = showInList; - this.hasExplicitES3Type = hasExplicitES3Type; - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Editor/TypesWindow.cs.meta b/Assets/Plugins/Easy Save 3/Editor/TypesWindow.cs.meta deleted file mode 100644 index 7505034..0000000 --- a/Assets/Plugins/Easy Save 3/Editor/TypesWindow.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 600b987de172f4a82b182077ceb7fffa -timeCreated: 1519132286 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Editor/checkmark.png b/Assets/Plugins/Easy Save 3/Editor/checkmark.png deleted file mode 100644 index cda4c8d..0000000 Binary files a/Assets/Plugins/Easy Save 3/Editor/checkmark.png and /dev/null differ diff --git a/Assets/Plugins/Easy Save 3/Editor/checkmarkSmall.png b/Assets/Plugins/Easy Save 3/Editor/checkmarkSmall.png deleted file mode 100644 index 46c3c1f..0000000 Binary files a/Assets/Plugins/Easy Save 3/Editor/checkmarkSmall.png and /dev/null differ diff --git a/Assets/Plugins/Easy Save 3/Editor/es3Logo16x16-bw.png b/Assets/Plugins/Easy Save 3/Editor/es3Logo16x16-bw.png deleted file mode 100644 index 2edf317..0000000 Binary files a/Assets/Plugins/Easy Save 3/Editor/es3Logo16x16-bw.png and /dev/null differ diff --git a/Assets/Plugins/Easy Save 3/Editor/es3Logo16x16.png b/Assets/Plugins/Easy Save 3/Editor/es3Logo16x16.png deleted file mode 100644 index ccde047..0000000 Binary files a/Assets/Plugins/Easy Save 3/Editor/es3Logo16x16.png and /dev/null differ diff --git a/Assets/Plugins/Easy Save 3/PlayMaker.meta b/Assets/Plugins/Easy Save 3/PlayMaker.meta deleted file mode 100644 index 3ac7941..0000000 --- a/Assets/Plugins/Easy Save 3/PlayMaker.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 0a6bee318130749539d0eec8a7b37ccd -folderAsset: yes -timeCreated: 1497259711 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/PlayMaker/ES3PlayMaker.cs b/Assets/Plugins/Easy Save 3/PlayMaker/ES3PlayMaker.cs deleted file mode 100644 index a1f9490..0000000 --- a/Assets/Plugins/Easy Save 3/PlayMaker/ES3PlayMaker.cs +++ /dev/null @@ -1,1902 +0,0 @@ -#if PLAYMAKER_1_8_OR_NEWER -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using ES3Internal; -using HutongGames.PlayMaker.Actions; -using HutongGames.PlayMaker; -using System.Linq; -using System; -using Tooltip = HutongGames.PlayMaker.TooltipAttribute; - -public class FsmES3File : ScriptableObject -{ - public ES3File file; -} - -public class FsmES3Spreadsheet : ScriptableObject -{ - public ES3Spreadsheet spreadsheet; -} - -namespace ES3PlayMaker -{ - - #region Base Classes - - public abstract class ActionBase : FsmStateAction - { - [ActionSection("Error handling")] - [Tooltip("This event is triggered if an error occurs.")] - public FsmEvent errorEvent; - [Tooltip("If an error occurs, the error message will be stored in this variable.")] - public FsmString errorMessage; - - public abstract void Enter(); - public abstract void OnReset(); - - public override void OnEnter() - { - try - { - Enter(); - } - catch (System.Exception e) - { - HandleError(e.ToString()); - } - Finish(); - } - - public override void Reset() - { - errorEvent = null; - errorMessage = ""; - OnReset(); - } - - public void HandleError(string msg) - { - errorMessage.Value = msg; - if (errorEvent != null) - Fsm.Event(errorEvent); - else - LogError(msg); - } - } - - public abstract class SettingsAction : ActionBase - { - [ActionSection("Settings")] - public FsmBool overrideDefaultSettings = false; - [HutongGames.PlayMaker.HideIf("DefaultSettingsOverridden")] - [Tooltip("The path this ES3Settings object points to, if any.")] - public FsmString path; - [HutongGames.PlayMaker.HideIf("DefaultSettingsOverridden")] - [ObjectType(typeof(ES3.Location))] - [Tooltip("The storage location where we wish to store data by default.")] - public FsmEnum location; - [HutongGames.PlayMaker.HideIf("DefaultSettingsOverridden")] - [ObjectType(typeof(ES3.EncryptionType))] - [Tooltip("The type of encryption to use when encrypting data, if any.")] - public FsmEnum encryptionType; - [HutongGames.PlayMaker.HideIf("DefaultSettingsOverridden")] - [Tooltip("The password to use to encrypt the data if encryption is enabled.")] - public FsmString encryptionPassword; - [HutongGames.PlayMaker.HideIf("DefaultSettingsOverridden")] - [ObjectType(typeof(ES3.CompressionType))] - [Tooltip("The type of compression to use when compressing data, if any.")] - public FsmEnum compressionType; - [HutongGames.PlayMaker.HideIf("DefaultSettingsOverridden")] - [ObjectType(typeof(ES3.Directory))] - [Tooltip("The default directory in which to store files when using the File save location, and the location which relative paths should be relative to.")] - public FsmEnum directory; - [HutongGames.PlayMaker.HideIf("DefaultSettingsOverridden")] - [ObjectType(typeof(ES3.Format))] - [Tooltip("The format we should use when serializing and deserializing data.")] - public FsmEnum format; - [HutongGames.PlayMaker.HideIf("DefaultSettingsOverridden")] - [Tooltip("Any stream buffers will be set to this length in bytes.")] - public FsmInt bufferSize; - - public bool DefaultSettingsOverridden() - { - return !overrideDefaultSettings.Value; - } - - public override void Reset() - { - var settings = new ES3Settings(); - path = settings.path; - location = settings.location; - encryptionType = settings.encryptionType; - compressionType = settings.compressionType; - encryptionPassword = settings.encryptionPassword; - directory = settings.directory; - format = settings.format; - bufferSize = settings.bufferSize; - overrideDefaultSettings = false; - base.Reset(); - } - - public ES3Settings GetSettings() - { - var settings = new ES3Settings(); - if (overrideDefaultSettings.Value) - { - settings.path = path.Value; - settings.location = (ES3.Location)location.Value; - settings.encryptionType = (ES3.EncryptionType)encryptionType.Value; - settings.encryptionPassword = encryptionPassword.Value; - settings.compressionType = (ES3.CompressionType)compressionType.Value; - settings.directory = (ES3.Directory)directory.Value; - settings.format = (ES3.Format)format.Value; - settings.bufferSize = bufferSize.Value; - } - return settings; - } - } - - public abstract class ES3FileAction : ActionBase - { - [Tooltip("The ES3 File we are using, created using the Create ES3 File action.")] - [ObjectType(typeof(FsmES3File))] - [Title("ES3 File")] - [RequiredField] - public FsmObject fsmES3File; - - public ES3File es3File { get { return ((FsmES3File)fsmES3File.Value).file; } } - - public override void Reset() - { - fsmES3File = null; - base.Reset(); - } - } - - public abstract class ES3FileSettingsAction : SettingsAction - { - [Tooltip("The ES3File variable we're using.")] - [ObjectType(typeof(FsmES3File))] - [Title("ES3 File")] - [RequiredField] - public FsmObject fsmES3File; - - public ES3File es3File { get { return ((FsmES3File)fsmES3File.Value).file; } } - - public override void Reset() - { - fsmES3File = null; - base.Reset(); - } - } - - public abstract class ES3SpreadsheetAction : ActionBase - { - [Tooltip("The ES3 Spreadsheet we are using, created using the Create ES3 Spreadsheet action.")] - [ObjectType(typeof(FsmES3Spreadsheet))] - [Title("ES3 Spreadsheet")] - [RequiredField] - public FsmObject fsmES3Spreadsheet; - - public ES3Spreadsheet es3Spreadsheet { get { return ((FsmES3Spreadsheet)fsmES3Spreadsheet.Value).spreadsheet; } } - - public override void Reset() - { - fsmES3Spreadsheet = null; - base.Reset(); - } - } - - public abstract class ES3SpreadsheetSettingsAction : SettingsAction - { - [Tooltip("The ES3Spreadsheet variable we're using.")] - [ObjectType(typeof(FsmES3Spreadsheet))] - [Title("ES3 Spreadsheet")] - [RequiredField] - public FsmObject fsmES3Spreadsheet; - - public ES3Spreadsheet es3Spreadsheet { get { return ((FsmES3Spreadsheet)fsmES3Spreadsheet.Value).spreadsheet; } } - - public override void Reset() - { - fsmES3Spreadsheet = null; - base.Reset(); - } - } - - #endregion - - #region Save Actions - - [ActionCategory("Easy Save 3")] - [Tooltip("Saves the value to a file with the given key.")] - public class Save : SettingsAction - { - [Tooltip("The unique key we want to use to identity the data we are saving.")] - public FsmString key; - [Tooltip("The value we want to save.")] - [UIHint(UIHint.Variable)] - [HideTypeFilter] - public FsmVar value; - - public override void OnReset() - { - key = "key"; - value = null; - } - - public override void Enter() - { - value.UpdateValue(); - - if (value.Type == VariableType.Array) - ES3.Save(key.Value, new PMDataWrapper(value.arrayValue.Values), GetSettings()); - else - ES3.Save(key.Value, value.GetValue(), GetSettings()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Saves multiple values to a file with the given keys.")] - public class SaveMultiple : SettingsAction - { - [RequiredField] - [CompoundArray("Count", "Key", "Value")] - public FsmString[] keys; - [Tooltip("The value we want to save.")] - [UIHint(UIHint.Variable)] - [HideTypeFilter] - public FsmVar[] variables; - - public override void OnReset() - { - keys = null; - variables = null; - } - - public override void Enter() - { - for (int i = 0; i < variables.Length; i++) - { - var key = keys[i]; - var value = variables[i]; - value.UpdateValue(); - - if (value.Type == VariableType.Array) - ES3.Save(key.Value, new PMDataWrapper(value.arrayValue.Values), GetSettings()); - else - ES3.Save(key.Value, value.GetValue(), GetSettings()); - } - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Saves all FsmVariables in this FSM to a file with the given key.")] - public class SaveAll : SettingsAction - { - [Tooltip("The unique key we want to use to identity the data we are saving.")] - public FsmString key; - - [Tooltip("Save the local variables accessible in this FSM?")] - public FsmBool saveFsmVariables = true; - [Tooltip("Save the global variables accessible in all FSMs?")] - public FsmBool saveGlobalVariables = true; - - public override void OnReset() - { - key = "key"; - } - - public override void Enter() - { - ES3.Save(key.Value, new PMDataWrapper(Fsm, saveFsmVariables.Value, saveGlobalVariables.Value), GetSettings()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Saves a byte array as a file, overwriting any existing files.")] - public class SaveRaw : SettingsAction - { - [Tooltip("The string we want to save as a file.")] - public FsmString str; - [Tooltip("Whether to encode this string using Base-64 encoding. This will override any default encoding settings.")] - public FsmBool useBase64Encoding; - [Tooltip("Adds a newline to the end of the file.")] - public FsmBool appendNewline; - - public override void OnReset() - { - str = ""; - useBase64Encoding = false; - appendNewline = false; - } - - public override void Enter() - { - if (useBase64Encoding.Value) - ES3.SaveRaw(System.Convert.FromBase64String(str.Value + (appendNewline.Value ? "\n" : "")), GetSettings()); - else - ES3.SaveRaw(str.Value + (appendNewline.Value ? "\n" : ""), GetSettings()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Appends a string to the end of a file.")] - public class AppendRaw : SettingsAction - { - [Tooltip("The string we want to append to a file.")] - public FsmString str; - [Tooltip("Whether to encode this string using Base-64 encoding. This will override any default encoding settings.")] - public FsmBool useBase64Encoding; - [Tooltip("If checked, a newline will be added after the data.")] - public FsmBool appendNewline; - - public override void OnReset() - { - str = ""; - useBase64Encoding = false; - appendNewline = false; - } - - public override void Enter() - { - if (useBase64Encoding.Value) - ES3.AppendRaw(System.Convert.FromBase64String(str.Value) + (appendNewline.Value ? "\n" : ""), GetSettings()); - else - ES3.AppendRaw(str.Value + (appendNewline.Value ? "\n" : ""), GetSettings()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Saves a Texture2D as a PNG or a JPG, depending on the file extension of the supplied image path.")] - public class SaveImage : SettingsAction - { - [Tooltip("The relative or absolute path of the PNG or JPG file we want to store our image to.")] - public FsmString imagePath; - [Tooltip("The Texture2D we want to save as an image.")] - [ObjectType(typeof(Texture2D))] - public FsmTexture texture2D; - [Tooltip("The quality of the image when saving JPGs, from 1 to 100. Default is 75.")] - public FsmInt quality; - - public override void OnReset() - { - imagePath = "image.png"; - texture2D = null; - quality = 75; - } - - public override void Enter() - { - ES3.SaveImage((Texture2D)texture2D.Value, quality.Value, imagePath.Value, GetSettings()); - } - } - - #endregion - - #region Load Actions - - [ActionCategory("Easy Save 3")] - [Tooltip("Loads a value from a file with the given key.")] - public class Load : SettingsAction - { - [Tooltip("The unique key which identifies the data we're loading.")] - public FsmString key; - [Tooltip("The variable we want to use to store our loaded data.")] - [UIHint(UIHint.Variable)] - [HideTypeFilter] - public FsmVar value; - [Tooltip("Optional: A value to return if the key does not exist.")] - [UIHint(UIHint.Variable)] - [HideTypeFilter] - public FsmVar defaultValue; - - public override void OnReset() - { - key = "key"; - value = null; - defaultValue = null; - } - - public override void Enter() - { - defaultValue.UpdateValue(); - bool useDefaultVal = defaultValue.GetValue() != null && !defaultValue.IsNone; - - - if (value.Type == VariableType.Array) - { - if (useDefaultVal) - value.SetValue(ES3.Load(key.Value, new PMDataWrapper(defaultValue.arrayValue.Values), GetSettings()).array); - else - value.SetValue(ES3.Load(key.Value, GetSettings()).array); - } - else - { - if (useDefaultVal) - value.SetValue(ES3.Load(key.Value, defaultValue.GetValue(), GetSettings())); - else - value.SetValue(ES3.Load(key.Value, GetSettings())); - } - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Loads multiple values from a file with the given keys.")] - public class LoadMultiple : SettingsAction - { - [RequiredField] - [CompoundArray("Count", "Key", "Value")] - public FsmString[] keys; - [Tooltip("The variables we want to load into.")] - [UIHint(UIHint.Variable)] - [HideTypeFilter] - public FsmVar[] variables; - - public override void OnReset() - { - keys = null; - variables = null; - } - - public override void Enter() - { - for (int i = 0; i < variables.Length; i++) - { - var key = keys[i]; - var value = variables[i]; - - if (value.Type == VariableType.Array) - value.SetValue(ES3.Load(key.Value, GetSettings()).array); - else - value.SetValue(ES3.Load(key.Value, GetSettings())); - } - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Loads a value from a file with the given key into an existing object, rather than creating a new instance.")] - public class LoadInto : SettingsAction - { - [Tooltip("The unique key which identifies the data we're loading.")] - public FsmString key; - [Tooltip("The object we want to load our data into.")] - [RequiredField] - [UIHint(UIHint.Variable)] - [HideTypeFilter] - public FsmVar value; - - public override void OnReset() - { - key = "key"; - value = null; - } - - public override void Enter() - { - value.UpdateValue(); - if (value.IsNone || value.GetValue() == null) - HandleError("The 'Load Into' action requires an object to load the data into, but none was specified in the 'Value' field."); - else - { - ES3.LoadInto(key.Value, value.GetValue(), GetSettings()); - - if (value.Type == VariableType.Array) - HandleError("It's not possible to use LoadInto with arrays in PlayMaker as they are not strictly typed. Consider using Load instead."); - else - value.SetValue(ES3.Load(key.Value, GetSettings())); - } - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Loads all FsmVariables in this FSM to a file with the given key.")] - public class LoadAll : SettingsAction - { - [Tooltip("The key we used to save the data we're loading.")] - public FsmString key; - - [Tooltip("Load the local variables accessible in this FSM?")] - public FsmBool loadFsmVariables = true; - [Tooltip("Load the global variables accessible in all FSMs?")] - public FsmBool loadGlobalVariables = true; - - public override void OnReset() - { - key = "key"; - } - - public override void Enter() - { - ES3.Load(key.Value, GetSettings()).ApplyVariables(Fsm, loadFsmVariables.Value, loadGlobalVariables.Value); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Loads an entire file as a string.")] - public class LoadRawString : SettingsAction - { - [Tooltip("The variable we want to store our loaded string in.")] - public FsmString str; - [Tooltip("Whether or not the data we're loading is Base-64 encoded. Usually this should be left unchecked.")] - public FsmBool useBase64Encoding; - - public override void OnReset() - { - str = null; - useBase64Encoding = false; - } - - public override void Enter() - { - if (useBase64Encoding.Value) - str.Value = System.Convert.ToBase64String(ES3.LoadRawBytes(GetSettings())); - else - str.Value = ES3.LoadRawString(GetSettings()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Loads a JPG or PNG image file as a Texture2D.")] - public class LoadImage : SettingsAction - { - [Tooltip("The relative or absolute path of the JPG or PNG image file we want to load.")] - public FsmString imagePath; - [Tooltip("The variable we want to use to store our loaded texture.")] - public FsmTexture texture2D; - - public override void OnReset() - { - imagePath = "image.png"; - texture2D = null; - } - - public override void Enter() - { - texture2D.Value = ES3.LoadImage(imagePath.Value, GetSettings()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Loads an audio file as an AudioClip.")] - public class LoadAudio : SettingsAction - { - [Tooltip("The relative or absolute path of the audio file we want to load.")] - public FsmString audioFilePath; - [ObjectType(typeof(AudioClip))] - [Tooltip("The variable we want to use to store our loaded AudioClip.")] - public FsmObject audioClip; - -#if UNITY_2018_3_OR_NEWER - [Tooltip("The type of AudioClip we're loading.")] - [ObjectType(typeof(AudioType))] - public FsmEnum audioType; -#endif - - public override void OnReset() - { - audioFilePath = "audio.wav"; - audioClip = null; -#if UNITY_2018_3_OR_NEWER - audioType = AudioType.MPEG; -#endif - } - - public override void Enter() - { - audioClip.Value = ES3.LoadAudio(audioFilePath.Value, -#if UNITY_2018_3_OR_NEWER - (AudioType)audioType.Value, -#endif - GetSettings()); - } - } - - - #endregion - - #region Exists Actions - - [ActionCategory("Easy Save 3")] - [Tooltip("Checks whether a key exists in a file.")] - public class KeyExists : SettingsAction - { - [Tooltip("The key we want to check the existence of.")] - public FsmString key; - [Tooltip("Whether the key exists. This is set after the action runs.")] - public FsmBool exists; - - [Tooltip("This event is triggered if the key exists.")] - public FsmEvent existsEvent; - [Tooltip("This event is triggered if the key does not exist.")] - public FsmEvent doesNotExistEvent; - - public override void OnReset() - { - key = "key"; - exists = false; - existsEvent = null; - doesNotExistEvent = null; - } - - public override void Enter() - { - exists.Value = ES3.KeyExists(key.Value, GetSettings()); - - Fsm.Event(exists.Value ? existsEvent : doesNotExistEvent); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Checks whether a file exists in a directory.")] - public class FileExists : SettingsAction - { - [Tooltip("The file we want to check the existence of")] - public FsmString filePath; - [Tooltip("Whether the file exists. This is set after the action runs.")] - public FsmBool exists; - - [Tooltip("This event is triggered if the file exists.")] - public FsmEvent existsEvent; - [Tooltip("This event is triggered if the file does not exist.")] - public FsmEvent doesNotExistEvent; - - public override void OnReset() - { - filePath = "SaveFile.es3"; - exists = false; - existsEvent = null; - doesNotExistEvent = null; - } - - public override void Enter() - { - exists.Value = ES3.FileExists(filePath.Value, GetSettings()); - - Fsm.Event(exists.Value ? existsEvent : doesNotExistEvent); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Checks whether a directory exists in another directory")] - public class DirectoryExists : SettingsAction - { - [Tooltip("The directory we want to check the existence of.")] - public FsmString directoryPath; - [Tooltip("Whether the directory exists. This is set after the action runs.")] - public FsmBool exists; - - [Tooltip("This event is triggered if the directory exists.")] - public FsmEvent existsEvent; - [Tooltip("This event is triggered if the directory does not exist.")] - public FsmEvent doesNotExistEvent; - - public override void OnReset() - { - directoryPath = ""; - exists = false; - existsEvent = null; - doesNotExistEvent = null; - } - - public override void Enter() - { - exists.Value = ES3.DirectoryExists(directoryPath.Value, GetSettings()); - - Fsm.Event(exists.Value ? existsEvent : doesNotExistEvent); - } - } - - #endregion - - #region Delete Actions - - [ActionCategory("Easy Save 3")] - [Tooltip("Deletes a key from a file.")] - public class DeleteKey : SettingsAction - { - [Tooltip("The key we want to delete.")] - public FsmString key; - - public override void OnReset() - { - key = "key"; - } - - public override void Enter() - { - ES3.DeleteKey(key.Value, GetSettings()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Deletes a file.")] - public class DeleteFile : SettingsAction - { - [Tooltip("The relative or absolute path of the file we want to delete.")] - public FsmString filePath; - - public override void OnReset() - { - filePath = "SaveFile.es3"; - } - - public override void Enter() - { - ES3.DeleteFile(filePath.Value, GetSettings()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Deletes a directory and it's contents.")] - public class DeleteDirectory : SettingsAction - { - [Tooltip("The relative or absolute path of the directory we want to delete.")] - public FsmString directoryPath; - - public override void OnReset() - { - directoryPath = ""; - } - - public override void Enter() - { - ES3.DeleteDirectory(directoryPath.Value, GetSettings()); - } - } - - #endregion - - #region Backup Actions - - [ActionCategory("Easy Save 3")] - [Tooltip("Creates a backup of a file which can be restored using the Restore Backup action.")] - public class CreateBackup : SettingsAction - { - [Tooltip("The relative or absolute path of the file we want to backup.")] - public FsmString filePath; - - public override void OnReset() - { - filePath = "SaveFile.es3"; - } - - public override void Enter() - { - ES3.CreateBackup(filePath.Value, GetSettings()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Restores a backup of a file created using the Create Backup action.")] - public class RestoreBackup : SettingsAction - { - [Tooltip("The relative or absolute path of the file we want to restore the backup of.")] - public FsmString filePath; - [Tooltip("True if a backup was restored, or False if no backup could be found.")] - public FsmBool backupWasRestored; - - public override void OnReset() - { - filePath = "SaveFile.es3"; - backupWasRestored = false; - } - - public override void Enter() - { - backupWasRestored.Value = ES3.RestoreBackup(filePath.Value, GetSettings()); - } - } - - #endregion - - #region Key, File and Directory Methods - - [ActionCategory("Easy Save 3")] - [Tooltip("Renames a file.")] - public class RenameFile : SettingsAction - { - [Tooltip("The relative or absolute path of the file we want to rename from.")] - public FsmString oldFilePath; - [Tooltip("The relative or absolute path of the file we want to rename to.")] - public FsmString newFilePath; - - public override void OnReset() - { - oldFilePath = "SaveFile.es3"; - newFilePath = ""; - } - - public override void Enter() - { - ES3.RenameFile(oldFilePath.Value, newFilePath.Value, GetSettings(), GetSettings()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Copies a file.")] - public class CopyFile : SettingsAction - { - [Tooltip("The relative or absolute path of the file we want to copy.")] - public FsmString oldFilePath; - [Tooltip("The relative or absolute path of the file we want to create.")] - public FsmString newFilePath; - - public override void OnReset() - { - oldFilePath = "SaveFile.es3"; - newFilePath = ""; - } - - public override void Enter() - { - ES3.CopyFile(oldFilePath.Value, newFilePath.Value, GetSettings(), GetSettings()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Copies a directory.")] - public class CopyDirectory : SettingsAction - { - [Tooltip("The relative or absolute path of the directory we want to copy.")] - public FsmString oldDirectoryPath; - [Tooltip("The relative or absolute path of the directory we want to create.")] - public FsmString newDirectoryPath; - - public override void OnReset() - { - oldDirectoryPath = ""; - newDirectoryPath = ""; - } - - public override void Enter() - { - ES3.CopyDirectory(oldDirectoryPath.Value, newDirectoryPath.Value, GetSettings(), GetSettings()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Gets an array of key names from a file.")] - public class GetKeys : SettingsAction - { - [Tooltip("The relative or absolute path of the file we want to get the keys from.")] - public FsmString filePath; - [Tooltip("The string array variable we want to load our key names into.")] - [ArrayEditor(VariableType.String)] - public FsmArray keys; - - public override void OnReset() - { - filePath = "SaveFile.es3"; - keys = null; - } - - public override void Enter() - { - keys.Values = ES3.GetKeys(filePath.Value, GetSettings()); - keys.SaveChanges(); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Gets how many keys are in a file.")] - public class GetKeyCount : SettingsAction - { - [Tooltip("The relative or absolute path of the file we want to count the keys of.")] - public FsmString filePath; - [Tooltip("The int variable we want to load our count into.")] - public FsmInt keyCount; - - public override void OnReset() - { - filePath = "SaveFile.es3"; - keyCount = null; - } - - public override void Enter() - { - keyCount.Value = ES3.GetKeys(filePath.Value, GetSettings()).Length; - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Gets the names of the files in a given directory.")] - public class GetFiles : SettingsAction - { - [Tooltip("The relative or absolute path of the directory we want to get the file names from.")] - public FsmString directoryPath; - [Tooltip("The string array variable we want to load our file names into.")] - [ArrayEditor(VariableType.String)] - public FsmArray files; - - public override void OnReset() - { - directoryPath = ""; - files = null; - } - - public override void Enter() - { - files.Values = ES3.GetFiles(directoryPath.Value, GetSettings()); - files.SaveChanges(); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Gets the names of any directories in a given directory.")] - public class GetDirectories : SettingsAction - { - [Tooltip("The relative or absolute path of the directory we want to get the directory names from.")] - public FsmString directoryPath; - [Tooltip("The string array variable we want to load our directory names into.")] - [ArrayEditor(VariableType.String)] - public FsmArray directories; - - public override void OnReset() - { - directoryPath = ""; - directories = null; - } - - public override void Enter() - { - directories.Values = ES3.GetDirectories(directoryPath.Value, GetSettings()); - directories.SaveChanges(); - } - } - - #endregion - - #region ES3Spreadsheet Actions - - [ActionCategory("Easy Save 3")] - [Tooltip("Creates a new empty ES3Spreadsheet.")] - public class ES3SpreadsheetCreate : ES3SpreadsheetAction - { - public override void OnReset() - { - } - - public override void Enter() - { - var spreadsheet = ScriptableObject.CreateInstance(); - spreadsheet.spreadsheet = new ES3Spreadsheet(); - fsmES3Spreadsheet.Value = spreadsheet; - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Sets a given cell of the ES3Spreadsheet to the value provided.")] - public class ES3SpreadsheetSetCell : ES3SpreadsheetAction - { - [Tooltip("The column of the cell we want to set the value of.")] - public FsmInt col; - [Tooltip("The row of the cell we want to set the value of.")] - public FsmInt row; - - [Tooltip("The value we want to save.")] - [UIHint(UIHint.Variable)] - [HideTypeFilter] - public FsmVar value; - - public override void OnReset() - { - value = null; - } - - public override void Enter() - { - value.UpdateValue(); - es3Spreadsheet.SetCell(col.Value, row.Value, value.GetValue()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Gets a given cell of the ES3Spreadsheet and loads it into the value field.")] - public class ES3SpreadsheetGetCell : ES3SpreadsheetAction - { - [Tooltip("The column of the cell we want to set the value of.")] - public FsmInt col; - [Tooltip("The row of the cell we want to set the value of.")] - public FsmInt row; - - [Tooltip("The value we want to save.")] - [UIHint(UIHint.Variable)] - [HideTypeFilter] - public FsmVar value; - - public override void OnReset() - { - value = null; - } - - public override void Enter() - { - value.SetValue(es3Spreadsheet.GetCell(value.RealType, col.Value, row.Value)); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Saves the ES3Spreadsheet to file.")] - public class ES3SpreadsheetSave : ES3SpreadsheetSettingsAction - { - [Tooltip("The filename or path we want to use to save the spreadsheet.")] - public FsmString filePath; - [Tooltip("Whether we want to append this spreadsheet to an existing spreadsheet if one already exists.")] - public FsmBool append; - - public override void OnReset() - { - filePath = "ES3.csv"; - append = false; - } - - public override void Enter() - { - es3Spreadsheet.Save(filePath.Value, GetSettings(), append.Value); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Loads a a spreadsheet from a file into this ES3Spreadsheet.")] - public class ES3SpreadsheetLoad : ES3SpreadsheetSettingsAction - { - [Tooltip("The filename or path we want to use to save the spreadsheet.")] - public FsmString filePath; - - public override void OnReset() - { - filePath = "ES3.csv"; - - } - - public override void Enter() - { - es3Spreadsheet.Load(filePath.Value, GetSettings()); - } - } - #endregion - - #region ES3File Actions - - [ActionCategory("Deprecated Easy Save 3 actions")] - [Tooltip("Creates a new ES3File, and optionally loads a file from storage into it.")] - public class ES3FileCreate : ES3FileSettingsAction - { - [Tooltip("The relative or absolute path of the file this ES3File represents in storage.")] - public FsmString filePath; - [Tooltip("Whether we should sync this ES3File with the one in storage immediately after creating it.")] - public FsmBool syncWithFile; - - public override void OnReset() - { - filePath = "SaveFile.es3"; - syncWithFile = true; - } - - public override void Enter() - { - var file = ScriptableObject.CreateInstance(); - file.file = new ES3File(filePath.Value, GetSettings(), syncWithFile.Value); - fsmES3File.Value = file; - } - } - - [ActionCategory("Deprecated Easy Save 3 actions")] - [Tooltip("Synchronises this ES3File with a file in storage.")] - public class ES3FileSync : ES3FileSettingsAction - { - [Tooltip("The relative or absolute path of the file we want to synchronise with in storage.")] - public FsmString filePath; - - public override void OnReset() - { - filePath = "SaveFile.es3"; - } - - public override void Enter() - { - if (overrideDefaultSettings.Value) - es3File.Sync(GetSettings()); - else - es3File.Sync(); - } - } - - [ActionCategory("Deprecated Easy Save 3 actions")] - [Tooltip("Saves the value to the ES3File with the given key.")] - public class ES3FileSave : ES3FileAction - { - [Tooltip("The unique key we want to use to identity the data we are saving.")] - public FsmString key; - [Tooltip("The value we want to save.")] - [UIHint(UIHint.Variable)] - [HideTypeFilter] - public FsmVar value; - - public override void OnReset() - { - key = "key"; - value = null; - } - - public override void Enter() - { - value.UpdateValue(); - es3File.Save(key.Value, value.GetValue()); - } - } - - [ActionCategory("Deprecated Easy Save 3 actions")] - [Tooltip("Loads a value with the given key from the ES3File")] - public class ES3FileLoad : ES3FileAction - { - [Tooltip("The unique key which identifies the data we're loading.")] - public FsmString key; - [Tooltip("The variable we want to use to store our loaded data.")] - [UIHint(UIHint.Variable)] - [HideTypeFilter] - public FsmVar value; - [Tooltip("Optional: A value to return if the key does not exist.")] - [UIHint(UIHint.Variable)] - [HideTypeFilter] - public FsmVar defaultValue; - - public override void OnReset() - { - key = "key"; - value = null; - defaultValue = null; - } - - public override void Enter() - { - defaultValue.UpdateValue(); - if (defaultValue.GetValue() != null && !defaultValue.IsNone) - value.SetValue(es3File.Load(key.Value, defaultValue.GetValue())); - else - value.SetValue(es3File.Load(key.Value)); - } - } - - [ActionCategory("Deprecated Easy Save 3 actions")] - [Tooltip("Loads a value with the given key from the ES3File into an existing object")] - public class ES3FileLoadInto : ES3FileAction - { - [Tooltip("The unique key which identifies the data we're loading.")] - public FsmString key; - [Tooltip("The variable we want to load our data into.")] - [UIHint(UIHint.Variable)] - [HideTypeFilter] - public FsmVar value; - - public override void OnReset() - { - key = "key"; - value = null; - } - - public override void Enter() - { - value.UpdateValue(); - es3File.LoadInto(key.Value, value.GetValue()); - } - } - - [ActionCategory("Deprecated Easy Save 3 actions")] - [Tooltip("Loads the entire ES3 File as a string")] - public class ES3FileLoadRawString : ES3FileAction - { - [Tooltip("The FsmArray variable we want to use to store our string representing the file.")] - public FsmString str; - [Tooltip("Whether or not the data we're loading is Base-64 encoded. Usually this should be left unchecked.")] - public FsmBool useBase64Encoding; - - public override void OnReset() - { - str = null; - useBase64Encoding = false; - } - - public override void Enter() - { - if (useBase64Encoding.Value) - str.Value = System.Convert.ToBase64String(es3File.LoadRawBytes()); - else - str.Value = es3File.LoadRawString(); - } - } - - [ActionCategory("Deprecated Easy Save 3 actions")] - [Tooltip("Deletes a key from an ES3 File.")] - public class ES3FileDeleteKey : ES3FileAction - { - [Tooltip("The key we want to delete.")] - public FsmString key; - - public override void OnReset() - { - key = "key"; - } - - public override void Enter() - { - es3File.DeleteKey(key.Value); - } - } - - [ActionCategory("Deprecated Easy Save 3 actions")] - [Tooltip("Checks whether a key exists in an ES3File.")] - public class ES3FileKeyExists : ES3FileAction - { - [Tooltip("The key we want to check the existence of.")] - public FsmString key; - [Tooltip("Whether the key exists. This is set after the action runs.")] - public FsmBool exists; - - [Tooltip("This event is triggered if the key exists.")] - public FsmEvent existsEvent; - [Tooltip("This event is triggered if the key does not exist.")] - public FsmEvent doesNotExistEvent; - - public override void OnReset() - { - key = "key"; - exists = false; - existsEvent = null; - doesNotExistEvent = null; - } - - public override void Enter() - { - exists.Value = es3File.KeyExists(key.Value); - - if (exists.Value && existsEvent != null) - Fsm.Event(existsEvent); - else if (doesNotExistEvent != null) - Fsm.Event(doesNotExistEvent); - } - } - - [ActionCategory("Deprecated Easy Save 3 actions")] - [Tooltip("Gets an array of key names from an ES3File.")] - public class ES3FileGetKeys : ES3FileAction - { - [Tooltip("The string array variable we want to load our key names into.")] - [ArrayEditor(VariableType.String)] - public FsmArray keys; - - public override void OnReset() - { - keys = null; - } - - public override void Enter() - { - keys.Values = es3File.GetKeys(); - keys.SaveChanges(); - } - } - - [ActionCategory("Deprecated Easy Save 3 actions")] - [Tooltip("Clears all keys from an ES3File.")] - public class ES3FileClear : ES3FileAction - { - public override void OnReset() { } - - public override void Enter() - { - es3File.Clear(); - } - } - - [ActionCategory("Deprecated Easy Save 3 actions")] - [Tooltip("Gets an array of key names from a file.")] - public class ES3FileSize : ES3FileAction - { - [Tooltip("The variable we want to put the file size into.")] - public FsmInt size; - - public override void OnReset() - { - size = 0; - } - - public override void Enter() - { - size.Value = es3File.Size(); - } - } - - #endregion - - #region ES3Cloud Actions - -#if !DISABLE_WEB - public abstract class ES3CloudAction : SettingsAction - { - [Tooltip("The URL to the ES3Cloud.php file on your server.")] - [RequiredField] - public FsmString url; - [Tooltip("The API key generated when installing ES3 Cloud on your server.")] - [RequiredField] - public FsmString apiKey; - - [Tooltip("The ES3File variable we're using.")] - [ObjectType(typeof(FsmES3File))] - [Title("ES3 File")] - [RequiredField] - public FsmObject fsmES3File; - - public ES3File es3File { get { return ((FsmES3File)fsmES3File.Value).file; } } - - [Tooltip("An error code if an error occurred.")] - public FsmInt errorCode; - - protected ES3Cloud cloud = null; - - public override void OnReset() - { - url = "http://www.myserver.com/ES3Cloud.php"; - errorCode = 0; - cloud = null; - fsmES3File = null; - } - - public override void OnEnter() - { - try - { - CreateES3Cloud(); - Enter(); - } - catch (System.Exception e) - { - HandleError(e.ToString()); - } - } - - public override void OnUpdate() - { - base.OnUpdate(); - if (cloud.isDone) - { - if (cloud.isError) - { - errorCode.Value = (int)cloud.errorCode; - errorMessage.Value = cloud.error; - Log("Error occurred when trying to perform operation with ES3Cloud: [Error " + cloud.errorCode + "] " + cloud.error); - Fsm.Event(errorEvent); - } - else - Finish(); - } - } - - protected void CreateES3Cloud() - { - cloud = new ES3Cloud(url.Value, apiKey.Value); - } - } - - public abstract class ES3CloudUserAction : ES3CloudAction - { - [ActionSection("User (optional)")] - public FsmString user; - public FsmString password; - - public override void OnReset() - { - base.OnReset(); - user = ""; - password = ""; - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Synchronises a file in storage with the server.")] - public class ES3CloudSync : ES3CloudUserAction - { - public override void Enter() - { - var settings = GetSettings(); - StartCoroutine(cloud.Sync(path.Value, settings)); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Uploads a file in storage to the server, overwriting any existing files.")] - public class ES3CloudUploadFile : ES3CloudUserAction - { - public override void Enter() - { - var settings = GetSettings(); - StartCoroutine(cloud.UploadFile(path.Value, user.Value, password.Value, settings)); - } - } - - [ActionCategory("Deprecated Easy Save 3 actions")] - [Tooltip("Uploads a file in storage to the server, overwriting any existing files.")] - public class ES3CloudUploadES3File : ES3CloudUserAction - { - public override void Enter() - { - var settings = GetSettings(); - StartCoroutine(cloud.UploadFile(es3File, user.Value, password.Value)); - } - } - - [ActionCategory("Deprecated Easy Save 3 actions")] - [Tooltip("Downloads a file from the server, overwriting any existing files, or returning error code 3 if no file exists on the server.")] - public class ES3CloudDownloadES3File : ES3CloudUserAction - { - public override void Enter() - { - var settings = GetSettings(); - StartCoroutine(cloud.DownloadFile(es3File, user.Value, password.Value)); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Downloads a file from the server into an file, or returning error code 3 if no file exists on the server.")] - public class ES3CloudDownloadFile : ES3CloudUserAction - { - public override void Enter() - { - var settings = GetSettings(); - StartCoroutine(cloud.DownloadFile(path.Value, user.Value, password.Value, settings)); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Downloads a file from the server, overwriting any existing files, or returning error code 3 if no file exists on the server.")] - public class ES3CloudDeleteFile : ES3CloudUserAction - { - public override void Enter() - { - var settings = GetSettings(); - StartCoroutine(cloud.DeleteFile(path.Value, user.Value, password.Value, settings)); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Renames a file on the server, overwriting any existing files, or returning error code 3 if no file exists on the server.")] - public class ES3CloudRenameFile : ES3CloudUserAction - { - [Tooltip("The name we want to rename the file to.")] - public FsmString newFilename; - - public override void Enter() - { - var settings = GetSettings(); - StartCoroutine(cloud.RenameFile(path.Value, newFilename.Value, user.Value, password.Value, settings)); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Downloads the names of all of the files on the server for the given user.")] - public class ES3CloudDownloadFilenames : ES3CloudUserAction - { - [Tooltip("The string array variable we want to load our file names into.")] - [ArrayEditor(VariableType.String)] - public FsmArray filenames; - - [Tooltip("An optional search pattern containing '%' or '_' wildcards where '%' represents zero, one, or multiple characters, and '_' represents a single character. See https://www.w3schools.com/sql/sql_like.asp for more info.")] - public FsmString searchPattern; - - public override void OnReset() - { - filenames = null; - searchPattern = ""; - } - - public override void Enter() - { - StartCoroutine(cloud.SearchFilenames(string.IsNullOrEmpty(searchPattern.Value) ? "%" : searchPattern.Value, user.Value, password.Value)); - } - - public override void OnUpdate() - { - if (cloud != null && cloud.isDone) - { - var downloadedFilenames = cloud.filenames; - filenames.Resize(cloud.filenames.Length); - for (int i = 0; i < downloadedFilenames.Length; i++) - filenames.Set(i, downloadedFilenames[i]); - filenames.SaveChanges(); - } - base.OnUpdate(); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Downloads the names of all of the files on the server for the given user.")] - public class ES3CloudSearchFilenames : ES3CloudUserAction - { - [Tooltip("The string array variable we want to load our file names into.")] - [ArrayEditor(VariableType.String)] - public FsmArray filenames; - - [Tooltip("An optional search pattern containing '%' or '_' wildcards where '%' represents zero, one, or multiple characters, and '_' represents a single character. See https://www.w3schools.com/sql/sql_like.asp for more info.")] - public FsmString searchPattern; - - public override void OnReset() - { - filenames = null; - searchPattern = ""; - } - - public override void Enter() - { - StartCoroutine(cloud.SearchFilenames(string.IsNullOrEmpty(searchPattern.Value) ? "%" : searchPattern.Value, user.Value, password.Value)); - } - - public override void OnUpdate() - { - if (cloud != null && cloud.isDone) - { - var downloadedFilenames = cloud.filenames; - filenames.Resize(cloud.filenames.Length); - for (int i = 0; i < downloadedFilenames.Length; i++) - filenames.Set(i, downloadedFilenames[i]); - filenames.SaveChanges(); - } - base.OnUpdate(); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Determines when a file was last updated.")] - public class ES3CloudDownloadTimestamp : ES3CloudUserAction - { - [Tooltip("The Date and time the file was last updated, as a string formatted as yyyy-MM-ddTHH:mm:ss.")] - public FsmString timestamp; - - public override void OnReset() - { - timestamp = ""; - } - - public override void Enter() - { - StartCoroutine(cloud.DownloadTimestamp(path.Value, user.Value, password.Value)); - } - - public override void OnUpdate() - { - if (cloud != null && cloud.isDone) - timestamp.Value = cloud.timestamp.ToString("s"); - base.OnUpdate(); - } - } - -#endif - #endregion - - #region ES3AutoSave actions - - [ActionCategory("Easy Save 3")] - [Tooltip("Triggers Auto Save's Save method.")] - public class ES3AutoSaveSave : FsmStateAction - { - public override void OnEnter() - { - GameObject.Find("Easy Save 3 Manager").GetComponent().Save(); - Finish(); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Triggers Auto Save's Load method.")] - public class ES3AutoSaveLoad : FsmStateAction - { - public override void OnEnter() - { - GameObject.Find("Easy Save 3 Manager").GetComponent().Load(); - Finish(); - } - } - - #endregion - - #region ES3Cache actions - - [ActionCategory("Easy Save 3")] - [Tooltip("Caches a locally-stored file into memory.")] - public class CacheFile : SettingsAction - { - [Tooltip("The filename or file path of the file we want to cache.")] - public FsmString filePath; - - public override void OnReset() - { - filePath = "SaveFile.es3"; - } - - public override void Enter() - { - ES3.CacheFile(filePath.Value, GetSettings()); - } - } - - [ActionCategory("Easy Save 3")] - [Tooltip("Stores a file in the cache to a local file.")] - public class StoreCachedFile : SettingsAction - { - [Tooltip("The filename or file path of the file we want to store.")] - public FsmString filePath; - - public override void OnReset() - { - filePath = "SaveFile.es3"; - } - - public override void Enter() - { - ES3.StoreCachedFile(filePath.Value, GetSettings()); - } - } - - #endregion - - #region Misc actions - - [ActionCategory("Easy Save 3")] - [Tooltip("Gets the Streaming Assets path (see https://docs.unity3d.com/Manual/StreamingAssets.html), and optionally appends onto it. It is strongly recommended to use Easy Save's default of Persistent Data Path instead as this works on all platforms.")] - public class GetStreamingAssetsPath : FsmStateAction - { - [Tooltip("The variable we want to output the Streaming Assets path to.")] - public FsmString output; - [Tooltip("[Optional] A string to append to the path, for example a filename. A forward slash is automatically added for you.")] - public FsmString append; - - public override void Reset() - { - output = null; - append = null; - } - - public override void OnEnter() - { - if (!string.IsNullOrEmpty(append.Value)) - output.Value = Application.streamingAssetsPath + "/" + append.Value; - else - output.Value = Application.streamingAssetsPath; - Finish(); - } - } - - #endregion - - public class PMDataWrapper - { - public Dictionary objs = null; - public Dictionary arrays = null; - - public object obj = null; - public object[] array = null; - - public PMDataWrapper(Fsm fsm, bool fsmVariables, bool globalVariables) - { - objs = new Dictionary(); - arrays = new Dictionary(); - - if (fsm == null) - return; - - // Get FSMVariables objects required based on whether the user wants to save local variables, global variables or both. - var variableLists = new List(); - if (fsmVariables) - variableLists.Add(fsm.Variables); - if (globalVariables) - variableLists.Add(FsmVariables.GlobalVariables); - - foreach (var variableList in variableLists) - { - foreach (var fsmVariable in variableList.GetAllNamedVariables()) - { - if (string.IsNullOrEmpty(fsmVariable.Name)) - continue; - - if (fsmVariable.GetType() == typeof(FsmArray)) - arrays.Add(fsmVariable.Name, ((FsmArray)fsmVariable).Values); - else - objs.Add(fsmVariable.Name, fsmVariable.RawValue); - } - } - } - - public PMDataWrapper(Dictionary objs, Dictionary arrays) - { - this.objs = objs; - this.arrays = arrays; - } - - public PMDataWrapper(object obj) - { - this.obj = obj; - } - - public PMDataWrapper(object[] array) - { - this.array = array; - } - - public PMDataWrapper() { } - - public void ApplyVariables(Fsm fsm, bool fsmVariables, bool globalVariables) - { - // Get FSMVariables objects required based on whether the user wants to save local variables, global variables or both. - var variableLists = new List(); - - if (fsmVariables) - variableLists.Add(fsm.Variables); - if (globalVariables) - variableLists.Add(FsmVariables.GlobalVariables); - - foreach (var variableList in variableLists) - { - foreach (var fsmVariable in variableList.GetAllNamedVariables()) - { - if (fsmVariable.GetType() == typeof(FsmArray)) - { - if (arrays.ContainsKey(fsmVariable.Name)) - ((FsmArray)fsmVariable).Values = arrays[fsmVariable.Name]; - } - else - { - if (objs.ContainsKey(fsmVariable.Name)) - fsmVariable.RawValue = objs[fsmVariable.Name]; - } - } - } - } - } -} - -namespace ES3Types -{ - [UnityEngine.Scripting.Preserve] - [ES3Properties("objs", "arrays", "obj", "array")] - public class ES3Type_PMDataWrapper : ES3ObjectType - { - public static ES3Type Instance = null; - - public ES3Type_PMDataWrapper() : base(typeof(ES3PlayMaker.PMDataWrapper)) { Instance = this; priority = 1; } - - - protected override void WriteObject(object obj, ES3Writer writer) - { - var instance = (ES3PlayMaker.PMDataWrapper)obj; - - writer.WriteProperty("objs", instance.objs); - writer.WriteProperty("arrays", instance.arrays); - writer.WriteProperty("obj", instance.obj); - writer.WriteProperty("array", instance.array); - } - - protected override void ReadObject(ES3Reader reader, object obj) - { - var instance = (ES3PlayMaker.PMDataWrapper)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "objs": - instance.objs = reader.Read>(); - break; - case "arrays": - instance.arrays = reader.Read>(); - break; - case "obj": - instance.obj = reader.Read(); - break; - case "array": - instance.array = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - - protected override object ReadObject(ES3Reader reader) - { - var instance = new ES3PlayMaker.PMDataWrapper(); - ReadObject(reader, instance); - return instance; - } - } - - [UnityEngine.Scripting.Preserve] - [ES3Properties("ActiveStateName")] - public class ES3Type_Fsm : ES3ObjectType - { - public static ES3Type Instance = null; - - public ES3Type_Fsm() : base(typeof(Fsm)) { Instance = this; priority = 1; } - - - protected override void WriteObject(object obj, ES3Writer writer) - { - var instance = (Fsm)obj; - writer.WriteProperty("ActiveStateName", instance.ActiveStateName, ES3Type_string.Instance); - writer.WriteProperty("Variables", new ES3PlayMaker.PMDataWrapper(instance, true, false), ES3Type_PMDataWrapper.Instance); - } - - protected override void ReadObject(ES3Reader reader, object obj) - { - var instance = (Fsm)obj; - if(!instance.Initialized) - { - // Toggle FSM Component twice to trigger initialisation. - instance.FsmComponent.enabled = !instance.FsmComponent.enabled; - instance.FsmComponent.enabled = !instance.FsmComponent.enabled; - } - - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case "ActiveStateName": - instance.SetState(reader.Read(ES3Type_string.Instance)); - break; - case "Variables": - reader.Read(ES3Type_PMDataWrapper.Instance).ApplyVariables(instance, true, false); - break; - } - } - } - - protected override object ReadObject(ES3Reader reader) - { - var instance = new HutongGames.PlayMaker.Fsm(); - ReadObject(reader, instance); - return instance; - } - } - - [UnityEngine.Scripting.Preserve] - [ES3Properties("Fsm")] - public class ES3Type_PlayMakerFSM : ES3ComponentType - { - public static ES3Type Instance = null; - - public ES3Type_PlayMakerFSM() : base(typeof(PlayMakerFSM)) { Instance = this; priority = 1; } - - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (PlayMakerFSM)obj; - - writer.WriteProperty("enabled", instance.enabled); - writer.WriteProperty("Fsm", instance.Fsm, ES3Type_Fsm.Instance); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (PlayMakerFSM)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "Fsm": - reader.ReadInto(instance.Fsm); - break; - default: - reader.Skip(); - break; - } - } - } - } -} - - -#endif \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/PlayMaker/ES3PlayMaker.cs.meta b/Assets/Plugins/Easy Save 3/PlayMaker/ES3PlayMaker.cs.meta deleted file mode 100644 index 4f8898a..0000000 --- a/Assets/Plugins/Easy Save 3/PlayMaker/ES3PlayMaker.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5989e48214df74e2b9cced724ec2e5c8 -timeCreated: 1497259720 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset b/Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset deleted file mode 100644 index fa3e7e8..0000000 --- a/Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset +++ /dev/null @@ -1,49 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7b340139c9e4d054f904d8b452798652, type: 3} - m_Name: ES3Defaults - m_EditorClassIdentifier: - settings: - _location: 0 - path: SaveFile.es3 - encryptionType: 0 - compressionType: 0 - encryptionPassword: password - directory: 0 - format: 0 - prettyPrint: 1 - bufferSize: 2048 - saveChildren: 1 - postprocessRawCachedData: 0 - typeChecking: 1 - safeReflection: 1 - memberReferenceMode: 0 - referenceMode: 2 - serializationDepthLimit: 64 - assemblyNames: - - Assembly-CSharp - - Assembly-CSharp-firstpass - - StarkLitJson - - StarkWebGL - showAdvancedSettings: 0 - addMgrToSceneAutomatically: 0 - autoUpdateReferences: 1 - addAllPrefabsToManager: 1 - collectDependenciesDepth: 4 - collectDependenciesTimeout: 10 - updateReferencesWhenSceneChanges: 1 - updateReferencesWhenSceneIsSaved: 1 - updateReferencesWhenSceneIsOpened: 1 - referenceFolders: [] - logDebugInfo: 0 - logWarnings: 1 - logErrors: 1 diff --git a/Assets/Plugins/Easy Save 3/Scripts.meta b/Assets/Plugins/Easy Save 3/Scripts.meta deleted file mode 100644 index 9a10374..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 86ef77fdddf9947f290776206b1f23ab -folderAsset: yes -timeCreated: 1499764821 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Attributes.meta b/Assets/Plugins/Easy Save 3/Scripts/Attributes.meta deleted file mode 100644 index af485a9..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Attributes.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e3195251321eef445b65f7c8d345e743 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Attributes/ES3Attributes.cs b/Assets/Plugins/Easy Save 3/Scripts/Attributes/ES3Attributes.cs deleted file mode 100644 index 080e75f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Attributes/ES3Attributes.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Property)] -public class ES3Serializable : Attribute -{ -} - -[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Property)] -public class ES3NonSerializable : Attribute -{ -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Attributes/ES3Attributes.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Attributes/ES3Attributes.cs.meta deleted file mode 100644 index e18e2d3..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Attributes/ES3Attributes.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e29c69181d1dff642b20c218819fe2e9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Auto Save.meta b/Assets/Plugins/Easy Save 3/Scripts/Auto Save.meta deleted file mode 100644 index cf53efc..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Auto Save.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: a01ff460e5e0b4f58bd28b3520b7ff2c -folderAsset: yes -timeCreated: 1502446431 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSave.cs b/Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSave.cs deleted file mode 100644 index 8efee06..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSave.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Collections.Generic; -using ES3Internal; -using UnityEngine; -public class ES3AutoSave : MonoBehaviour, ISerializationCallbackReceiver -{ - public bool saveLayer = true; - public bool saveTag = true; - public bool saveName = true; - public bool saveHideFlags = true; - public bool saveActive = true; - public bool saveChildren; - - //[HideInInspector] - public List componentsToSave = new List(); - - private bool isQuitting; - - public void Awake() - { - if (ES3AutoSaveMgr.Current == null) - ES3Debug.LogWarning("No GameObjects in this scene will be autosaved because there is no Easy Save 3 Manager. To add a manager to this scene, exit playmode and go to Assets > Easy Save 3 > Add Manager to Scene.", this); - else - ES3AutoSaveMgr.AddAutoSave(this); - } - - public void Reset() - { - // Initialise saveLayer (etc) to false for all new Components. - saveLayer = false; - saveTag = false; - saveName = false; - saveHideFlags = false; - saveActive = false; - saveChildren = false; - } - - public void OnDestroy() - { - // If this is being destroyed, but not because the application is quitting, - // remove the AutoSave from the manager. - if (!isQuitting) - ES3AutoSaveMgr.RemoveAutoSave(this); - } - - public void OnApplicationQuit() - { - isQuitting = true; - } - public void OnBeforeSerialize() {} - public void OnAfterDeserialize() - { - // Remove any null Components - componentsToSave.RemoveAll(c => c == null || c.GetType() == typeof(Component)); - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSave.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSave.cs.meta deleted file mode 100644 index 1bc7333..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSave.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9cfcc9ceea0bf419cb3bcaf548c2600d -timeCreated: 1519132292 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSaveMgr.cs b/Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSaveMgr.cs deleted file mode 100644 index da45f3f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSaveMgr.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Unity.VisualScripting; -using UnityEngine; -using UnityEngine.SceneManagement; -#if UNITY_VISUAL_SCRIPTING -[IncludeInSettings(true)] -#elif BOLT_VISUAL_SCRIPTING -[Ludiq.IncludeInSettings(true)] -#endif -public class ES3AutoSaveMgr : MonoBehaviour -{ - public static ES3AutoSaveMgr _current; - public static ES3AutoSaveMgr Current - { - get - { - if (_current == null /*|| _current.gameObject.scene != SceneManager.GetActiveScene()*/) - { - var scene = SceneManager.GetActiveScene(); - GameObject[] roots = scene.GetRootGameObjects(); - - // First, look for Easy Save 3 Manager in the top-level. - foreach (var root in roots) - if (root.name == "Easy Save 3 Manager") - return _current = root.GetComponent(); - - // If the user has moved or renamed the Easy Save 3 Manager, we need to perform a deep search. - foreach (var root in roots) - if ((_current = root.GetComponentInChildren()) != null) - return _current; - } - return _current; - } - } - - // Included for backwards compatibility. - public static ES3AutoSaveMgr Instance - { - get { return Current; } - } - - public enum LoadEvent { None, Awake, Start } - public enum SaveEvent { None, OnApplicationQuit, OnApplicationPause } - - public string key = Guid.NewGuid().ToString(); - public SaveEvent saveEvent = SaveEvent.OnApplicationQuit; - public LoadEvent loadEvent = LoadEvent.Awake; - public ES3SerializableSettings settings = new ES3SerializableSettings("AutoSave.es3", ES3.Location.Cache); - - public HashSet autoSaves = new HashSet(); - - public void Save() - { - if (autoSaves == null || autoSaves.Count == 0) - return; - - // If we're using caching and we've not already cached this file, cache it. - if (settings.location == ES3.Location.Cache && !ES3.FileExists(settings)) - ES3.CacheFile(settings); - - if (autoSaves == null || autoSaves.Count == 0) - { - ES3.DeleteKey(key, settings); - } - else - { - List gameObjects = new List(); - foreach (var autoSave in autoSaves) - { - // If the ES3AutoSave component is disabled, don't save it. - if (autoSave != null && autoSave.enabled) - gameObjects.Add(autoSave.gameObject); - } - // Save in the same order as their depth in the hierarchy. - ES3.Save(key, gameObjects.OrderBy(x => GetDepth(x.transform)).ToArray(), settings); - } - - if (settings.location == ES3.Location.Cache && ES3.FileExists(settings)) - ES3.StoreCachedFile(settings); - } - - public void Load() - { - try - { - // If we're using caching and we've not already cached this file, cache it. - if (settings.location == ES3.Location.Cache && !ES3.FileExists(settings)) - ES3.CacheFile(settings); - } - catch {} - - ES3.Load(key, new GameObject[0], settings); - } - - private void Start() - { - if (loadEvent == LoadEvent.Start) - Load(); - } - - public void Awake() - { - GetAutoSaves(); - - if (loadEvent == LoadEvent.Awake) - Load(); - } - - private void OnApplicationQuit() - { - if (saveEvent == SaveEvent.OnApplicationQuit) - Save(); - } - - private void OnApplicationPause(bool paused) - { - if ((saveEvent == SaveEvent.OnApplicationPause || - Application.isMobilePlatform && saveEvent == SaveEvent.OnApplicationQuit) && paused) - Save(); - } - - /* Register an ES3AutoSave with the ES3AutoSaveMgr, if there is one */ - public static void AddAutoSave(ES3AutoSave autoSave) - { - if (Current != null) - Current.autoSaves.Add(autoSave); - } - - /* Remove an ES3AutoSave from the ES3AutoSaveMgr, for example if it's GameObject has been destroyed */ - public static void RemoveAutoSave(ES3AutoSave autoSave) - { - if (Current != null) - Current.autoSaves.Remove(autoSave); - } - - /* Gathers all of the ES3AutoSave Components in the scene and registers them with the manager */ - public void GetAutoSaves() - { - autoSaves = new HashSet(); - - foreach (var go in gameObject.scene.GetRootGameObjects()) - autoSaves.UnionWith(go.GetComponentsInChildren(true)); - } - - // Gets the depth of a Transform in the hierarchy. - private static int GetDepth(Transform t) - { - int depth = 0; - - while(t.parent != null) - { - t = t.parent; - depth++; - } - - return depth; - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSaveMgr.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSaveMgr.cs.meta deleted file mode 100644 index 39da0af..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSaveMgr.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9107aee0ced90422da95f0b31680501f -timeCreated: 1519132291 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Debugging.meta b/Assets/Plugins/Easy Save 3/Scripts/Debugging.meta deleted file mode 100644 index 7d3f40a..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Debugging.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: c00267afddf624bb19ac24ce8076f9e4 -folderAsset: yes -timeCreated: 1518175259 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Debugging/ES3Debug.cs b/Assets/Plugins/Easy Save 3/Scripts/Debugging/ES3Debug.cs deleted file mode 100644 index 70367cd..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Debugging/ES3Debug.cs +++ /dev/null @@ -1,50 +0,0 @@ -using UnityEngine; - -namespace ES3Internal -{ - internal static class ES3Debug - { - private const string disableInfoMsg = "\nTo disable these messages from Easy Save, go to Window > Easy Save 3 > Settings, and uncheck 'Log Info'"; - private const string disableWarningMsg = "\nTo disable warnings from Easy Save, go to Window > Easy Save 3 > Settings, and uncheck 'Log Warnings'"; - private const string disableErrorMsg = "\nTo disable these error messages from Easy Save, go to Window > Easy Save 3 > Settings, and uncheck 'Log Errors'"; - - private const char indentChar = '-'; - - public static void Log(string msg, Object context = null, int indent = 0) - { - if (!ES3Settings.defaultSettingsScriptableObject.logDebugInfo) - return; - if (context != null) - Debug.LogFormat(context, Indent(indent) + msg + disableInfoMsg); - else - Debug.LogFormat(context, Indent(indent) + msg); - } - - public static void LogWarning(string msg, Object context = null, int indent = 0) - { - if (!ES3Settings.defaultSettingsScriptableObject.logWarnings) - return; - if (context != null) - Debug.LogWarningFormat(context, Indent(indent) + msg + disableWarningMsg); - else - Debug.LogWarningFormat(context, Indent(indent) + msg + disableWarningMsg); - } - - public static void LogError(string msg, Object context = null, int indent = 0) - { - if (!ES3Settings.defaultSettingsScriptableObject.logErrors) - return; - if (context != null) - Debug.LogErrorFormat(context, Indent(indent) + msg + disableErrorMsg); - else - Debug.LogErrorFormat(context, Indent(indent) + msg + disableErrorMsg); - } - - private static string Indent(int size) - { - if (size < 0) - return ""; - return new string(indentChar, size); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Debugging/ES3Debug.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Debugging/ES3Debug.cs.meta deleted file mode 100644 index d26c5ba..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Debugging/ES3Debug.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9f97d288c55524622a117171a19d3225 -timeCreated: 1518175265 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3.cs b/Assets/Plugins/Easy Save 3/Scripts/ES3.cs deleted file mode 100644 index 8042265..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3.cs +++ /dev/null @@ -1,1683 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.IO.Compression; -using ES3Internal; -using ES3Types; -using Unity.VisualScripting; -using UnityEngine; -#if UNITY_2018_3_OR_NEWER -using UnityEngine.Networking; -#endif - -/// -/// The main class for Easy Save methods. All methods in this class are static. -/// -#if UNITY_VISUAL_SCRIPTING -[IncludeInSettings(true)] -#elif BOLT_VISUAL_SCRIPTING -[Ludiq.IncludeInSettings(true)] -#endif -public class ES3 -{ - public enum Location { File, PlayerPrefs, InternalMS, Resources, Cache } - public enum Directory { PersistentDataPath, DataPath } - public enum EncryptionType { None, AES } - public enum CompressionType { None, Gzip } - public enum Format { JSON } - public enum ReferenceMode { ByRef, ByValue, ByRefAndValue } - public enum ImageType { JPEG, PNG } - - #region ES3.Save - - // Saves the value to the default file with the given key. - /// The key we want to use to identify our value in the file. - /// The value we want to save. - public static void Save(string key, object value) - { - Save(key, value, new ES3Settings()); - } - - /// Saves the value to a file with the given key. - /// The key we want to use to identify our value in the file. - /// The value we want to save. - /// The relative or absolute path of the file we want to store our value to. - public static void Save(string key, object value, string filePath) - { - Save(key, value, new ES3Settings(filePath)); - } - - /// Saves the value to a file with the given key. - /// The key we want to use to identify our value in the file. - /// The value we want to save. - /// The relative or absolute path of the file we want to store our value to. - /// The settings we want to use to override the default settings. - public static void Save(string key, object value, string filePath, ES3Settings settings) - { - Save(key, value, new ES3Settings(filePath, settings)); - } - - /// Saves the value to a file with the given key. - /// The key we want to use to identify our value in the file. - /// The value we want to save. - /// The settings we want to use to override the default settings. - public static void Save(string key, object value, ES3Settings settings) - { - Save(key, value, settings); - } - - /// Saves the value to the default file with the given key. - /// The type of the data that we want to save. - /// The key we want to use to identify our value in the file. - /// The value we want to save. - public static void Save(string key, T value) - { - Save(key, value, new ES3Settings()); - } - - /// Saves the value to a file with the given key. - /// The type of the data that we want to save. - /// The key we want to use to identify our value in the file. - /// The value we want to save. - /// The relative or absolute path of the file we want to store our value to. - public static void Save(string key, T value, string filePath) - { - Save(key, value, new ES3Settings(filePath)); - } - - /// Saves the value to a file with the given key. - /// The type of the data that we want to save. - /// The key we want to use to identify our value in the file. - /// The value we want to save. - /// The relative or absolute path of the file we want to store our value to. - /// The settings we want to use to override the default settings. - public static void Save(string key, T value, string filePath, ES3Settings settings) - { - Save(key, value, new ES3Settings(filePath, settings)); - } - - /// Saves the value to a file with the given key. - /// The type of the data that we want to save. - /// The key we want to use to identify our value in the file. - /// The value we want to save. - /// The settings we want to use to override the default settings. - public static void Save(string key, T value, ES3Settings settings) - { - if (settings.location == Location.Cache) - { - ES3File.GetOrCreateCachedFile(settings).Save(key, value); - return; - } - - using (var writer = ES3Writer.Create(settings)) - { - writer.Write(key, value); - writer.Save(); - } - } - - /// Creates or overwrites a file with the specified raw bytes. - /// The bytes we want to store. - public static void SaveRaw(byte[] bytes) - { - SaveRaw(bytes, new ES3Settings()); - } - - /// Creates or overwrites a file with the specified raw bytes. - /// The bytes we want to store. - /// The relative or absolute path of the file we want to store our bytes to. - public static void SaveRaw(byte[] bytes, string filePath) - { - SaveRaw(bytes, new ES3Settings(filePath)); - } - - /// Creates or overwrites a file with the specified raw bytes. - /// The bytes we want to store. - /// The relative or absolute path of the file we want to store our bytes to. - /// The settings we want to use to override the default settings. - public static void SaveRaw(byte[] bytes, string filePath, ES3Settings settings) - { - SaveRaw(bytes, new ES3Settings(filePath, settings)); - } - - /// Creates or overwrites a file with the specified raw bytes. - /// The bytes we want to store. - /// The settings we want to use to override the default settings. - public static void SaveRaw(byte[] bytes, ES3Settings settings) - { - if (settings.location == Location.Cache) - { - ES3File.GetOrCreateCachedFile(settings).SaveRaw(bytes, settings); - return; - } - - using (var stream = ES3Stream.CreateStream(settings, ES3FileMode.Write)) - { - stream.Write(bytes, 0, bytes.Length); - } - ES3IO.CommitBackup(settings); - } - - /// Creates or overwrites the default file with the specified raw bytes. - /// The string we want to store. - public static void SaveRaw(string str) - { - SaveRaw(str, new ES3Settings()); - } - - /// Creates or overwrites the default file with the specified raw bytes. - /// The string we want to store. - /// The relative or absolute path of the file we want to store our bytes to. - public static void SaveRaw(string str, string filePath) - { - SaveRaw(str, new ES3Settings(filePath)); - } - - /// Creates or overwrites a file with the specified raw bytes. - /// The string we want to store. - /// The relative or absolute path of the file we want to store our bytes to. - /// The settings we want to use to override the default settings. - public static void SaveRaw(string str, string filePath, ES3Settings settings) - { - SaveRaw(str, new ES3Settings(filePath, settings)); - } - - /// Creates or overwrites a file with the specified raw bytes. - /// The string we want to store. - /// The settings we want to use to override the default settings. - public static void SaveRaw(string str, ES3Settings settings) - { - byte[] bytes = settings.encoding.GetBytes(str); - SaveRaw(bytes, settings); - } - - /// Creates or appends the specified bytes to a file. - /// The bytes we want to append. - public static void AppendRaw(byte[] bytes) - { - AppendRaw(bytes, new ES3Settings()); - } - - /// Creates or appends the specified bytes to a file. - /// The bytes we want to append. - /// The relative or absolute path of the file we want to append our bytes to. - /// The settings we want to use to override the default settings. - public static void AppendRaw(byte[] bytes, string filePath, ES3Settings settings) - { - AppendRaw(bytes, new ES3Settings(filePath, settings)); - } - - /// Creates or appends the specified bytes to a file. - /// The bytes we want to append. - /// The settings we want to use to override the default settings. - public static void AppendRaw(byte[] bytes, ES3Settings settings) - { - if (settings.location == Location.Cache) - { - ES3File.GetOrCreateCachedFile(settings).AppendRaw(bytes); - return; - } - - var newSettings = new ES3Settings(settings.path, settings); - newSettings.encryptionType = EncryptionType.None; - newSettings.compressionType = CompressionType.None; - - using (var stream = ES3Stream.CreateStream(newSettings, ES3FileMode.Append)) - stream.Write(bytes, 0, bytes.Length); - } - - /// Creates or appends the specified string to the default file. - /// The string we want to append. - public static void AppendRaw(string str) - { - AppendRaw(str, new ES3Settings()); - } - - /// Creates or appends the specified string to the default file. - /// The string we want to append. - /// The relative or absolute path of the file we want to append our string to. - public static void AppendRaw(string str, string filePath) - { - AppendRaw(str, new ES3Settings(filePath)); - } - - /// Creates or appends the specified string to the default file. - /// The string we want to append. - /// The relative or absolute path of the file we want to append our string to. - /// The settings we want to use to override the default settings. - public static void AppendRaw(string str, string filePath, ES3Settings settings) - { - AppendRaw(str, new ES3Settings(filePath, settings)); - } - - /// Creates or appends the specified string to the default file. - /// The string we want to append. - /// The settings we want to use to override the default settings. - public static void AppendRaw(string str, ES3Settings settings) - { - byte[] bytes = settings.encoding.GetBytes(str); - var newSettings = new ES3Settings(settings.path, settings); - newSettings.encryptionType = EncryptionType.None; - newSettings.compressionType = CompressionType.None; - - if (settings.location == Location.Cache) - { - ES3File.GetOrCreateCachedFile(settings).SaveRaw(bytes); - return; - } - - using (var stream = ES3Stream.CreateStream(newSettings, ES3FileMode.Append)) - stream.Write(bytes, 0, bytes.Length); - } - - /// Saves a Texture2D as a PNG or JPG, depending on the file extension used for the filePath. - /// The Texture2D we want to save as a JPG or PNG. - /// The relative or absolute path of the PNG or JPG file we want to create. - public static void SaveImage(Texture2D texture, string imagePath) - { - SaveImage(texture, new ES3Settings(imagePath)); - } - - /// Saves a Texture2D as a PNG or JPG, depending on the file extension used for the filePath. - /// The Texture2D we want to save as a JPG or PNG. - /// The relative or absolute path of the PNG or JPG file we want to create. - public static void SaveImage(Texture2D texture, string imagePath, ES3Settings settings) - { - SaveImage(texture, new ES3Settings(imagePath, settings)); - } - - /// Saves a Texture2D as a PNG or JPG, depending on the file extension used for the filePath. - /// The Texture2D we want to save as a JPG or PNG. - /// The settings we want to use to override the default settings. - public static void SaveImage(Texture2D texture, ES3Settings settings) - { - SaveImage(texture, 75, settings); - } - - /// Saves a Texture2D as a PNG or JPG, depending on the file extension used for the filePath. - /// The Texture2D we want to save as a JPG or PNG. - /// - /// Quality to encode with, where 1 is minimum and 100 is maximum. Note that this only applies to - /// JPGs. - /// - /// The relative or absolute path of the PNG or JPG file we want to create. - public static void SaveImage(Texture2D texture, int quality, string imagePath) - { - SaveImage(texture, quality, new ES3Settings(imagePath)); - } - - /// Saves a Texture2D as a PNG or JPG, depending on the file extension used for the filePath. - /// The Texture2D we want to save as a JPG or PNG. - /// - /// Quality to encode with, where 1 is minimum and 100 is maximum. Note that this only applies to - /// JPGs. - /// - /// The relative or absolute path of the PNG or JPG file we want to create. - public static void SaveImage(Texture2D texture, int quality, string imagePath, ES3Settings settings) - { - SaveImage(texture, quality, new ES3Settings(imagePath, settings)); - } - - /// Saves a Texture2D as a PNG or JPG, depending on the file extension used for the filePath. - /// The Texture2D we want to save as a JPG or PNG. - /// - /// Quality to encode with, where 1 is minimum and 100 is maximum. Note that this only applies to - /// JPGs. - /// - /// The settings we want to use to override the default settings. - public static void SaveImage(Texture2D texture, int quality, ES3Settings settings) - { - // Get the file extension to determine what format we want to save the image as. - string extension = ES3IO.GetExtension(settings.path).ToLower(); - if (string.IsNullOrEmpty(extension)) - throw new ArgumentException("File path must have a file extension when using ES3.SaveImage."); - byte[] bytes; - if (extension == ".jpg" || extension == ".jpeg") - bytes = texture.EncodeToJPG(quality); - else if (extension == ".png") - bytes = texture.EncodeToPNG(); - else - throw new ArgumentException("File path must have extension of .png, .jpg or .jpeg when using ES3.SaveImage."); - - SaveRaw(bytes, settings); - } - - - /// Saves a Texture2D as a PNG or JPG, depending on the file extension used for the filePath. - /// The Texture2D we want to save as a JPG or PNG. - /// - /// Quality to encode with, where 1 is minimum and 100 is maximum. Note that this only applies to - /// JPGs. - /// - public static byte[] SaveImageToBytes(Texture2D texture, int quality, ImageType imageType) - { - if (imageType == ImageType.JPEG) - return texture.EncodeToJPG(quality); - return texture.EncodeToPNG(); - } - - #endregion - - #region ES3.Load - - /* Standard load methods */ - - /// Loads the value from a file with the given key. - /// The key which identifies the value we want to load. - public static object Load(string key) - { - return Load(key, new ES3Settings()); - } - - /// Loads the value from a file with the given key. - /// The key which identifies the value we want to load. - /// The relative or absolute path of the file we want to load from. - public static object Load(string key, string filePath) - { - return Load(key, new ES3Settings(filePath)); - } - - /// Loads the value from a file with the given key. - /// The key which identifies the value we want to load. - /// The relative or absolute path of the file we want to load from. - /// The settings we want to use to override the default settings. - public static object Load(string key, string filePath, ES3Settings settings) - { - return Load(key, new ES3Settings(filePath, settings)); - } - - /// Loads the value from a file with the given key. - /// The key which identifies the value we want to load. - /// The settings we want to use to override the default settings. - public static object Load(string key, ES3Settings settings) - { - return Load(key, settings); - } - - /// Loads the value from a file with the given key. - /// The key which identifies the value we want to load. - /// The value we want to return if the file or key does not exist. - public static object Load(string key, object defaultValue) - { - return Load(key, defaultValue, new ES3Settings()); - } - - /// Loads the value from a file with the given key. - /// The key which identifies the value we want to load. - /// The relative or absolute path of the file we want to load from. - /// The value we want to return if the file or key does not exist. - public static object Load(string key, string filePath, object defaultValue) - { - return Load(key, defaultValue, new ES3Settings(filePath)); - } - - /// Loads the value from a file with the given key. - /// The key which identifies the value we want to load. - /// The relative or absolute path of the file we want to load from. - /// The value we want to return if the file or key does not exist. - /// The settings we want to use to override the default settings. - public static object Load(string key, string filePath, object defaultValue, ES3Settings settings) - { - return Load(key, defaultValue, new ES3Settings(filePath, settings)); - } - - /// Loads the value from a file with the given key. - /// The key which identifies the value we want to load. - /// The value we want to return if the file or key does not exist. - /// The settings we want to use to override the default settings. - public static object Load(string key, object defaultValue, ES3Settings settings) - { - return Load(key, defaultValue, settings); - } - - /// Loads the value from a file with the given key. - /// The type of the data that we want to load. - /// The key which identifies the value we want to load. - public static T Load(string key) - { - return Load(key, new ES3Settings()); - } - - /// Loads the value from a file with the given key. - /// The type of the data that we want to load. - /// The key which identifies the value we want to load. - /// The relative or absolute path of the file we want to load from. - public static T Load(string key, string filePath) - { - return Load(key, new ES3Settings(filePath)); - } - - /// Loads the value from a file with the given key. - /// The type of the data that we want to load. - /// The key which identifies the value we want to load. - /// The relative or absolute path of the file we want to load from. - /// The settings we want to use to override the default settings. - public static T Load(string key, string filePath, ES3Settings settings) - { - return Load(key, new ES3Settings(filePath, settings)); - } - - /// Loads the value from a file with the given key. - /// The type of the data that we want to load. - /// The key which identifies the value we want to load. - /// The settings we want to use to override the default settings. - public static T Load(string key, ES3Settings settings) - { - if (settings.location == Location.Cache) - return ES3File.GetOrCreateCachedFile(settings).Load(key); - - using (var reader = ES3Reader.Create(settings)) - { - if (reader == null) - throw new FileNotFoundException("File \"" + settings.FullPath + "\" could not be found."); - return reader.Read(key); - } - } - - /// Loads the value from a file with the given key. - /// The type of the data that we want to load. - /// The key which identifies the value we want to load. - /// The value we want to return if the file or key does not exist. - public static T Load(string key, T defaultValue) - { - return Load(key, defaultValue, new ES3Settings()); - } - - /// Loads the value from a file with the given key. - /// The type of the data that we want to load. - /// The key which identifies the value we want to load. - /// The relative or absolute path of the file we want to load from. - /// The value we want to return if the file or key does not exist. - public static T Load(string key, string filePath, T defaultValue) - { - return Load(key, defaultValue, new ES3Settings(filePath)); - } - - /// Loads the value from a file with the given key. - /// The type of the data that we want to load. - /// The key which identifies the value we want to load. - /// The relative or absolute path of the file we want to load from. - /// The value we want to return if the file or key does not exist. - /// The settings we want to use to override the default settings. - public static T Load(string key, string filePath, T defaultValue, ES3Settings settings) - { - return Load(key, defaultValue, new ES3Settings(filePath, settings)); - } - - /// Loads the value from a file with the given key. - /// The type of the data that we want to load. - /// The key which identifies the value we want to load. - /// The value we want to return if the file or key does not exist. - /// The settings we want to use to override the default settings. - public static T Load(string key, T defaultValue, ES3Settings settings) - { - if (settings.location == Location.Cache) - return ES3File.GetOrCreateCachedFile(settings).Load(key, defaultValue); - - using (var reader = ES3Reader.Create(settings)) - { - if (reader == null) - return defaultValue; - return reader.Read(key, defaultValue); - } - } - - /* Self-assigning load methods */ - - /// Loads the value from a file with the given key into an existing object, rather than creating a new instance. - /// The key which identifies the value we want to load. - /// The object we want to load the value into. - public static void LoadInto(string key, object obj) where T : class - { - LoadInto(key, obj, new ES3Settings()); - } - - /// Loads the value from a file with the given key into an existing object, rather than creating a new instance. - /// The key which identifies the value we want to load. - /// The relative or absolute path of the file we want to load from. - /// The object we want to load the value into. - public static void LoadInto(string key, string filePath, object obj) - { - LoadInto(key, obj, new ES3Settings(filePath)); - } - - /// Loads the value from a file with the given key into an existing object, rather than creating a new instance. - /// The key which identifies the value we want to load. - /// The relative or absolute path of the file we want to load from. - /// The object we want to load the value into. - /// The settings we want to use to override the default settings. - public static void LoadInto(string key, string filePath, object obj, ES3Settings settings) - { - LoadInto(key, obj, new ES3Settings(filePath, settings)); - } - - /// Loads the value from a file with the given key into an existing object, rather than creating a new instance. - /// The key which identifies the value we want to load. - /// The object we want to load the value into. - /// The settings we want to use to override the default settings. - public static void LoadInto(string key, object obj, ES3Settings settings) - { - LoadInto(key, obj, settings); - } - - /// Loads the value from a file with the given key into an existing object, rather than creating a new instance. - /// The type of the data that we want to load. - /// The key which identifies the value we want to load. - /// The object we want to load the value into. - public static void LoadInto(string key, T obj) where T : class - { - LoadInto(key, obj, new ES3Settings()); - } - - /// Loads the value from a file with the given key into an existing object, rather than creating a new instance. - /// The type of the data that we want to load. - /// The key which identifies the value we want to load. - /// The relative or absolute path of the file we want to load from. - /// The object we want to load the value into. - public static void LoadInto(string key, string filePath, T obj) where T : class - { - LoadInto(key, obj, new ES3Settings(filePath)); - } - - /// Loads the value from a file with the given key into an existing object, rather than creating a new instance. - /// The type of the data that we want to load. - /// The key which identifies the value we want to load. - /// The relative or absolute path of the file we want to load from. - /// The object we want to load the value into. - /// The settings we want to use to override the default settings. - public static void LoadInto(string key, string filePath, T obj, ES3Settings settings) where T : class - { - LoadInto(key, obj, new ES3Settings(filePath, settings)); - } - - /// Loads the value from a file with the given key into an existing object, rather than creating a new instance. - /// The type of the data that we want to load. - /// The key which identifies the value we want to load. - /// The object we want to load the value into. - /// The settings we want to use to override the default settings. - public static void LoadInto(string key, T obj, ES3Settings settings) where T : class - { - if (ES3Reflection.IsValueType(obj.GetType())) - throw new InvalidOperationException("ES3.LoadInto can only be used with reference types, but the data you're loading is a value type. Use ES3.Load instead."); - - if (settings.location == Location.Cache) - { - ES3File.GetOrCreateCachedFile(settings).LoadInto(key, obj); - return; - } - - if (settings == null) settings = new ES3Settings(); - using (var reader = ES3Reader.Create(settings)) - { - if (reader == null) - throw new FileNotFoundException("File \"" + settings.FullPath + "\" could not be found."); - reader.ReadInto(key, obj); - } - } - - /* LoadString method, as this can be difficult with overloads. */ - - /// Loads the value from a file with the given key. - /// The key which identifies the value we want to load. - /// The value we want to return if the file or key does not exist. - /// The settings we want to use to override the default settings. - public static string LoadString(string key, string defaultValue, ES3Settings settings) - { - return Load(key, null, defaultValue, settings); - } - - /// Loads the value from a file with the given key. - /// The key which identifies the value we want to load. - /// The value we want to return if the file or key does not exist. - /// The relative or absolute path of the file we want to load from. - /// The settings we want to use to override the default settings. - public static string LoadString(string key, string defaultValue, string filePath = null, ES3Settings settings = null) - { - return Load(key, filePath, defaultValue, settings); - } - - #endregion - - #region Other ES3.Load Methods - - /// Loads the default file as a byte array. - public static byte[] LoadRawBytes() - { - return LoadRawBytes(new ES3Settings()); - } - - /// Loads a file as a byte array. - /// The relative or absolute path of the file we want to load as a byte array. - public static byte[] LoadRawBytes(string filePath) - { - return LoadRawBytes(new ES3Settings(filePath)); - } - - /// Loads a file as a byte array. - /// The relative or absolute path of the file we want to load as a byte array. - /// The settings we want to use to override the default settings. - public static byte[] LoadRawBytes(string filePath, ES3Settings settings) - { - return LoadRawBytes(new ES3Settings(filePath, settings)); - } - - /// Loads the default file as a byte array. - /// The settings we want to use to override the default settings. - public static byte[] LoadRawBytes(ES3Settings settings) - { - if (settings.location == Location.Cache) - return ES3File.GetOrCreateCachedFile(settings).LoadRawBytes(); - - using (var stream = ES3Stream.CreateStream(settings, ES3FileMode.Read)) - { - if (stream == null) - throw new FileNotFoundException("File " + settings.path + " could not be found"); - - if (stream.GetType() == typeof(GZipStream)) - { - var gZipStream = (GZipStream)stream; - using (var ms = new MemoryStream()) - { - ES3Stream.CopyTo(gZipStream, ms); - return ms.ToArray(); - } - } - byte[] bytes = new byte[stream.Length]; - stream.Read(bytes, 0, bytes.Length); - return bytes; - } - - /*if(settings.location == Location.File) - return ES3IO.ReadAllBytes(settings.FullPath); - else if(settings.location == Location.PlayerPrefs) - return System.Convert.FromBase64String(PlayerPrefs.GetString(settings.FullPath)); - else if(settings.location == Location.Resources) - { - var textAsset = Resources.Load(settings.FullPath); - return textAsset.bytes; - } - return null;*/ - } - - /// Loads the default file as a byte array. - public static string LoadRawString() - { - return LoadRawString(new ES3Settings()); - } - - /// Loads a file as a byte array. - /// The relative or absolute path of the file we want to load as a byte array. - /// The settings we want to use to override the default settings. - public static string LoadRawString(string filePath) - { - return LoadRawString(new ES3Settings(filePath)); - } - - /// Loads a file as a byte array. - /// The relative or absolute path of the file we want to load as a byte array. - /// The settings we want to use to override the default settings. - public static string LoadRawString(string filePath, ES3Settings settings) - { - return LoadRawString(new ES3Settings(filePath, settings)); - } - - /// Loads the default file as a byte array. - /// The settings we want to use to override the default settings. - public static string LoadRawString(ES3Settings settings) - { - byte[] bytes = LoadRawBytes(settings); - return settings.encoding.GetString(bytes, 0, bytes.Length); - } - - /// Loads a PNG or JPG as a Texture2D. - /// The relative or absolute path of the PNG or JPG file we want to load as a Texture2D. - /// The settings we want to use to override the default settings. - public static Texture2D LoadImage(string imagePath) - { - return LoadImage(new ES3Settings(imagePath)); - } - - /// Loads a PNG or JPG as a Texture2D. - /// The relative or absolute path of the PNG or JPG file we want to load as a Texture2D. - /// The settings we want to use to override the default settings. - public static Texture2D LoadImage(string imagePath, ES3Settings settings) - { - return LoadImage(new ES3Settings(imagePath, settings)); - } - - /// Loads a PNG or JPG as a Texture2D. - /// The settings we want to use to override the default settings. - public static Texture2D LoadImage(ES3Settings settings) - { - byte[] bytes = LoadRawBytes(settings); - return LoadImage(bytes); - } - - /// Loads a PNG or JPG as a Texture2D. - /// The raw bytes of the PNG or JPG. - public static Texture2D LoadImage(byte[] bytes) - { - var texture = new Texture2D(1, 1); - texture.LoadImage(bytes); - return texture; - } - - /// - /// Loads an audio file as an AudioClip. Note that MP3 files are not supported on standalone platforms and Ogg - /// Vorbis files are not supported on mobile platforms. - /// - /// The relative or absolute path of the audio file we want to load as an AudioClip. - public static AudioClip LoadAudio(string audioFilePath -#if UNITY_2018_3_OR_NEWER - , AudioType audioType -#endif - ) - { - return LoadAudio(audioFilePath, -#if UNITY_2018_3_OR_NEWER - audioType, -#endif - new ES3Settings()); - } - - /// - /// Loads an audio file as an AudioClip. Note that MP3 files are not supported on standalone platforms and Ogg - /// Vorbis files are not supported on mobile platforms. - /// - /// The relative or absolute path of the audio file we want to load as an AudioClip. - /// The settings we want to use to override the default settings. - public static AudioClip LoadAudio(string audioFilePath, -#if UNITY_2018_3_OR_NEWER - AudioType audioType, -#endif - ES3Settings settings) - { - if (settings.location != Location.File) - throw new InvalidOperationException("ES3.LoadAudio can only be used with the File save location"); - - if (Application.platform == RuntimePlatform.WebGLPlayer) - throw new InvalidOperationException("You cannot use ES3.LoadAudio with WebGL"); - - string extension = ES3IO.GetExtension(audioFilePath).ToLower(); - - if (extension == ".mp3" && (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.OSXPlayer)) - throw new InvalidOperationException("You can only load Ogg, WAV, XM, IT, MOD or S3M on Unity Standalone"); - - if (extension == ".ogg" && (Application.platform == RuntimePlatform.IPhonePlayer - || Application.platform == RuntimePlatform.Android - || Application.platform == RuntimePlatform.WSAPlayerARM)) - throw new InvalidOperationException("You can only load MP3, WAV, XM, IT, MOD or S3M on Unity Standalone"); - - var newSettings = new ES3Settings(audioFilePath, settings); - -#if UNITY_2018_3_OR_NEWER - using (var www = UnityWebRequestMultimedia.GetAudioClip("file://" + newSettings.FullPath, audioType)) - { - www.SendWebRequest(); - - while(!www.isDone) - { - // Wait for it to load. - } - - if (ES3WebClass.IsNetworkError(www)) - throw new Exception(www.error); - return DownloadHandlerAudioClip.GetContent(www); - } -#elif UNITY_2017_1_OR_NEWER - WWW www = new WWW(newSettings.FullPath); - - while(!www.isDone) - { - // Wait for it to load. - } - - if(!string.IsNullOrEmpty(www.error)) - throw new System.Exception(www.error); -#else - WWW www = new WWW("file://"+newSettings.FullPath); - - while(!www.isDone) - { - // Wait for it to load. - } - - if(!string.IsNullOrEmpty(www.error)) - throw new System.Exception(www.error); -#endif - -#if UNITY_2017_3_OR_NEWER && !UNITY_2018_3_OR_NEWER - return www.GetAudioClip(true); -#elif UNITY_5_6_OR_NEWER && !UNITY_2018_3_OR_NEWER - return WWWAudioExtensions.GetAudioClip(www); -#endif - } - - #endregion - - #region Serialize/Deserialize - - public static byte[] Serialize(T value, ES3Settings settings = null) - { - return Serialize(value, ES3TypeMgr.GetOrCreateES3Type(typeof(T)), settings); - } - - internal static byte[] Serialize(object value, ES3Type type, ES3Settings settings = null) - { - if (settings == null) settings = new ES3Settings(); - - using (var ms = new MemoryStream()) - { - using (var stream = ES3Stream.CreateStream(ms, settings, ES3FileMode.Write)) - { - using (var baseWriter = ES3Writer.Create(stream, settings, false, false)) - { - // If T is object, use the value to get it's type. Otherwise, use T so that it works with inheritence. - //var type = typeof(T) != typeof(object) ? typeof(T) : (value == null ? typeof(T) : value.GetType()); - baseWriter.Write(value, type, settings.referenceMode); - } - - return ms.ToArray(); - } - } - } - - public static T Deserialize(byte[] bytes, ES3Settings settings = null) - { - return (T)Deserialize(ES3TypeMgr.GetOrCreateES3Type(typeof(T)), bytes, settings); - } - - internal static object Deserialize(ES3Type type, byte[] bytes, ES3Settings settings = null) - { - if (settings == null) - settings = new ES3Settings(); - - using (var ms = new MemoryStream(bytes, false)) - using (var stream = ES3Stream.CreateStream(ms, settings, ES3FileMode.Read)) - using (var reader = ES3Reader.Create(stream, settings, false)) - return reader.Read(type); - } - - public static void DeserializeInto(byte[] bytes, T obj, ES3Settings settings = null) where T : class - { - DeserializeInto(ES3TypeMgr.GetOrCreateES3Type(typeof(T)), bytes, obj, settings); - } - - public static void DeserializeInto(ES3Type type, byte[] bytes, T obj, ES3Settings settings = null) where T : class - { - if (settings == null) - settings = new ES3Settings(); - - using (var ms = new MemoryStream(bytes, false)) - using (var reader = ES3Reader.Create(ms, settings, false)) - reader.ReadInto(obj, type); - } - - #endregion - - #region Other ES3 Methods - - public static byte[] EncryptBytes(byte[] bytes, string password = null) - { - if (string.IsNullOrEmpty(password)) - password = ES3Settings.defaultSettings.encryptionPassword; - return new AESEncryptionAlgorithm().Encrypt(bytes, password, ES3Settings.defaultSettings.bufferSize); - } - - public static byte[] DecryptBytes(byte[] bytes, string password = null) - { - if (string.IsNullOrEmpty(password)) - password = ES3Settings.defaultSettings.encryptionPassword; - return new AESEncryptionAlgorithm().Decrypt(bytes, password, ES3Settings.defaultSettings.bufferSize); - } - - public static string EncryptString(string str, string password = null) - { - return Convert.ToBase64String(EncryptBytes(ES3Settings.defaultSettings.encoding.GetBytes(str), password)); - } - - public static string DecryptString(string str, string password = null) - { - return ES3Settings.defaultSettings.encoding.GetString(DecryptBytes(Convert.FromBase64String(str), password)); - } - - public static byte[] CompressBytes(byte[] bytes) - { - using (var ms = new MemoryStream()) - { - var settings = new ES3Settings(); - settings.location = Location.InternalMS; - settings.compressionType = CompressionType.Gzip; - settings.encryptionType = EncryptionType.None; - - using (var stream = ES3Stream.CreateStream(ms, settings, ES3FileMode.Write)) - stream.Write(bytes, 0, bytes.Length); - - return ms.ToArray(); - } - } - - public static byte[] DecompressBytes(byte[] bytes) - { - using (var ms = new MemoryStream(bytes)) - { - var settings = new ES3Settings(); - settings.location = Location.InternalMS; - settings.compressionType = CompressionType.Gzip; - settings.encryptionType = EncryptionType.None; - - using (var output = new MemoryStream()) - { - using (var input = ES3Stream.CreateStream(ms, settings, ES3FileMode.Read)) - ES3Stream.CopyTo(input, output); - return output.ToArray(); - } - } - } - - public static string CompressString(string str) - { - return Convert.ToBase64String(CompressBytes(ES3Settings.defaultSettings.encoding.GetBytes(str))); - } - - public static string DecompressString(string str) - { - return ES3Settings.defaultSettings.encoding.GetString(DecompressBytes(Convert.FromBase64String(str))); - } - - /// Deletes the default file. - public static void DeleteFile() - { - DeleteFile(new ES3Settings()); - } - - /// Deletes the file at the given path using the default settings. - /// The relative or absolute path of the file we wish to delete. - public static void DeleteFile(string filePath) - { - DeleteFile(new ES3Settings(filePath)); - } - - /// Deletes the file at the given path using the settings provided. - /// The relative or absolute path of the file we wish to delete. - /// The settings we want to use to override the default settings. - public static void DeleteFile(string filePath, ES3Settings settings) - { - DeleteFile(new ES3Settings(filePath, settings)); - } - - /// Deletes the file specified by the ES3Settings object provided as a parameter. - /// The settings we want to use to override the default settings. - public static void DeleteFile(ES3Settings settings) - { - if (settings.location == Location.File) - ES3IO.DeleteFile(settings.FullPath); - else if (settings.location == Location.PlayerPrefs) - PlayerPrefs.DeleteKey(settings.FullPath); - else if (settings.location == Location.Cache) - ES3File.RemoveCachedFile(settings); - else if (settings.location == Location.Resources) - throw new NotSupportedException("Deleting files from Resources is not possible."); - } - - /// Copies a file from one path to another. - /// The relative or absolute path of the file we want to copy. - /// The relative or absolute path of the copy we want to create. - public static void CopyFile(string oldFilePath, string newFilePath) - { - CopyFile(new ES3Settings(oldFilePath), new ES3Settings(newFilePath)); - } - - /// Copies a file from one location to another, using the ES3Settings provided to override any default settings. - /// The relative or absolute path of the file we want to copy. - /// The relative or absolute path of the copy we want to create. - /// The settings we want to use when copying the old file. - /// The settings we want to use when creating the new file. - public static void CopyFile(string oldFilePath, string newFilePath, ES3Settings oldSettings, ES3Settings newSettings) - { - CopyFile(new ES3Settings(oldFilePath, oldSettings), new ES3Settings(newFilePath, newSettings)); - } - - /// Copies a file from one location to another, using the ES3Settings provided to determine the locations. - /// The settings we want to use when copying the old file. - /// The settings we want to use when creating the new file. - public static void CopyFile(ES3Settings oldSettings, ES3Settings newSettings) - { - if (oldSettings.location != newSettings.location) - throw new InvalidOperationException("Cannot copy file from " + oldSettings.location + " to " + newSettings.location + ". Location must be the same for both source and destination."); - - if (oldSettings.location == Location.File) - { - if (ES3IO.FileExists(oldSettings.FullPath)) - { - // Create the new directory if it doesn't exist. - string newDirectory = ES3IO.GetDirectoryPath(newSettings.FullPath); - if (!ES3IO.DirectoryExists(newDirectory)) - ES3IO.CreateDirectory(newDirectory); - // Otherwise delete the existing file so that we can overwrite it. - else - ES3IO.DeleteFile(newSettings.FullPath); - ES3IO.CopyFile(oldSettings.FullPath, newSettings.FullPath); - } - } - else if (oldSettings.location == Location.PlayerPrefs) - { - PlayerPrefs.SetString(newSettings.FullPath, PlayerPrefs.GetString(oldSettings.FullPath)); - } - else if (oldSettings.location == Location.Cache) - { - ES3File.CopyCachedFile(oldSettings, newSettings); - } - else if (oldSettings.location == Location.Resources) - throw new NotSupportedException("Modifying files from Resources is not allowed."); - } - - /// Renames a file. - /// The relative or absolute path of the file we want to rename. - /// The relative or absolute path we want to rename the file to. - public static void RenameFile(string oldFilePath, string newFilePath) - { - RenameFile(new ES3Settings(oldFilePath), new ES3Settings(newFilePath)); - } - - /// Renames a file. - /// The relative or absolute path of the file we want to rename. - /// The relative or absolute path we want to rename the file to. - /// The settings for the file we want to rename. - /// The settings for the file we want our source file to be renamed to. - public static void RenameFile(string oldFilePath, string newFilePath, ES3Settings oldSettings, ES3Settings newSettings) - { - RenameFile(new ES3Settings(oldFilePath, oldSettings), new ES3Settings(newFilePath, newSettings)); - } - - /// Renames a file. - /// The settings for the file we want to rename. - /// The settings for the file we want our source file to be renamed to. - public static void RenameFile(ES3Settings oldSettings, ES3Settings newSettings) - { - if (oldSettings.location != newSettings.location) - throw new InvalidOperationException("Cannot rename file in " + oldSettings.location + " to " + newSettings.location + ". Location must be the same for both source and destination."); - - if (oldSettings.location == Location.File) - { - if (ES3IO.FileExists(oldSettings.FullPath)) - { - ES3IO.DeleteFile(newSettings.FullPath); - ES3IO.MoveFile(oldSettings.FullPath, newSettings.FullPath); - } - } - else if (oldSettings.location == Location.PlayerPrefs) - { - PlayerPrefs.SetString(newSettings.FullPath, PlayerPrefs.GetString(oldSettings.FullPath)); - PlayerPrefs.DeleteKey(oldSettings.FullPath); - } - else if (oldSettings.location == Location.Cache) - { - ES3File.CopyCachedFile(oldSettings, newSettings); - ES3File.RemoveCachedFile(oldSettings); - } - else if (oldSettings.location == Location.Resources) - throw new NotSupportedException("Modifying files from Resources is not allowed."); - } - - /// Copies a file from one path to another. - /// The relative or absolute path of the directory we want to copy. - /// The relative or absolute path of the copy we want to create. - public static void CopyDirectory(string oldDirectoryPath, string newDirectoryPath) - { - CopyDirectory(new ES3Settings(oldDirectoryPath), new ES3Settings(newDirectoryPath)); - } - - /// Copies a file from one location to another, using the ES3Settings provided to override any default settings. - /// The relative or absolute path of the directory we want to copy. - /// The relative or absolute path of the copy we want to create. - /// The settings we want to use when copying the old directory. - /// The settings we want to use when creating the new directory. - public static void CopyDirectory(string oldDirectoryPath, string newDirectoryPath, ES3Settings oldSettings, ES3Settings newSettings) - { - CopyDirectory(new ES3Settings(oldDirectoryPath, oldSettings), new ES3Settings(newDirectoryPath, newSettings)); - } - - /// Copies a file from one location to another, using the ES3Settings provided to determine the locations. - /// The settings we want to use when copying the old file. - /// The settings we want to use when creating the new file. - public static void CopyDirectory(ES3Settings oldSettings, ES3Settings newSettings) - { - if (oldSettings.location != Location.File) - throw new InvalidOperationException("ES3.CopyDirectory can only be used when the save location is 'File'"); - - if (!DirectoryExists(oldSettings)) - throw new DirectoryNotFoundException("Directory " + oldSettings.FullPath + " not found"); - - if (!DirectoryExists(newSettings)) - ES3IO.CreateDirectory(newSettings.FullPath); - - foreach (string fileName in GetFiles(oldSettings)) - CopyFile(ES3IO.CombinePathAndFilename(oldSettings.path, fileName), - ES3IO.CombinePathAndFilename(newSettings.path, fileName)); - - foreach (string directoryName in GetDirectories(oldSettings)) - CopyDirectory(ES3IO.CombinePathAndFilename(oldSettings.path, directoryName), - ES3IO.CombinePathAndFilename(newSettings.path, directoryName)); - } - - /// Renames a file. - /// The relative or absolute path of the file we want to rename. - /// The relative or absolute path we want to rename the file to. - public static void RenameDirectory(string oldDirectoryPath, string newDirectoryPath) - { - RenameDirectory(new ES3Settings(oldDirectoryPath), new ES3Settings(newDirectoryPath)); - } - - /// Renames a file. - /// The relative or absolute path of the file we want to rename. - /// The relative or absolute path we want to rename the file to. - /// The settings for the file we want to rename. - /// The settings for the file we want our source file to be renamed to. - public static void RenameDirectory(string oldDirectoryPath, string newDirectoryPath, ES3Settings oldSettings, ES3Settings newSettings) - { - RenameDirectory(new ES3Settings(oldDirectoryPath, oldSettings), new ES3Settings(newDirectoryPath, newSettings)); - } - - /// Renames a file. - /// The settings for the file we want to rename. - /// The settings for the file we want our source file to be renamed to. - public static void RenameDirectory(ES3Settings oldSettings, ES3Settings newSettings) - { - if (oldSettings.location == Location.File) - { - if (ES3IO.DirectoryExists(oldSettings.FullPath)) - { - ES3IO.DeleteDirectory(newSettings.FullPath); - ES3IO.MoveDirectory(oldSettings.FullPath, newSettings.FullPath); - } - } - else if (oldSettings.location == Location.PlayerPrefs || oldSettings.location == Location.Cache) - throw new NotSupportedException("Directories cannot be renamed when saving to Cache, PlayerPrefs, tvOS or using WebGL."); - else if (oldSettings.location == Location.Resources) - throw new NotSupportedException("Modifying files from Resources is not allowed."); - } - - /// Deletes the directory at the given path using the settings provided. - /// The relative or absolute path of the folder we wish to delete. - public static void DeleteDirectory(string directoryPath) - { - DeleteDirectory(new ES3Settings(directoryPath)); - } - - /// Deletes the directory at the given path using the settings provided. - /// The relative or absolute path of the folder we wish to delete. - /// The settings we want to use to override the default settings. - public static void DeleteDirectory(string directoryPath, ES3Settings settings) - { - DeleteDirectory(new ES3Settings(directoryPath, settings)); - } - - /// Deletes the directory at the given path using the settings provided. - /// The settings we want to use to override the default settings. - public static void DeleteDirectory(ES3Settings settings) - { - if (settings.location == Location.File) - ES3IO.DeleteDirectory(settings.FullPath); - else if (settings.location == Location.PlayerPrefs || settings.location == Location.Cache) - throw new NotSupportedException("Deleting Directories using Cache or PlayerPrefs is not supported."); - else if (settings.location == Location.Resources) - throw new NotSupportedException("Deleting directories from Resources is not allowed."); - } - - /// Deletes a key in the default file. - /// The key we want to delete. - public static void DeleteKey(string key) - { - DeleteKey(key, new ES3Settings()); - } - - public static void DeleteKey(string key, string filePath) - { - DeleteKey(key, new ES3Settings(filePath)); - } - - /// Deletes a key in the file specified. - /// The key we want to delete. - /// The relative or absolute path of the file we want to delete the key from. - /// The settings we want to use to override the default settings. - public static void DeleteKey(string key, string filePath, ES3Settings settings) - { - DeleteKey(key, new ES3Settings(filePath, settings)); - } - - /// Deletes a key in the file specified by the ES3Settings object. - /// The key we want to delete. - /// The settings we want to use to override the default settings. - public static void DeleteKey(string key, ES3Settings settings) - { - if (settings.location == Location.Resources) - throw new NotSupportedException("Modifying files in Resources is not allowed."); - if (settings.location == Location.Cache) - ES3File.DeleteKey(key, settings); - else if (FileExists(settings)) - { - using (var writer = ES3Writer.Create(settings)) - { - writer.MarkKeyForDeletion(key); - writer.Save(); - } - } - } - - /// Checks whether a key exists in the default file. - /// The key we want to check the existence of. - /// True if the key exists, otherwise False. - public static bool KeyExists(string key) - { - return KeyExists(key, new ES3Settings()); - } - - /// Checks whether a key exists in the specified file. - /// The key we want to check the existence of. - /// The relative or absolute path of the file we want to search. - /// True if the key exists, otherwise False. - public static bool KeyExists(string key, string filePath) - { - return KeyExists(key, new ES3Settings(filePath)); - } - - /// Checks whether a key exists in the default file. - /// The key we want to check the existence of. - /// The relative or absolute path of the file we want to search. - /// The settings we want to use to override the default settings. - /// True if the key exists, otherwise False. - public static bool KeyExists(string key, string filePath, ES3Settings settings) - { - return KeyExists(key, new ES3Settings(filePath, settings)); - } - - /// Checks whether a key exists in a file. - /// The key we want to check the existence of. - /// The settings we want to use to override the default settings. - /// True if the file exists, otherwise False. - public static bool KeyExists(string key, ES3Settings settings) - { - if (settings.location == Location.Cache) - return ES3File.KeyExists(key, settings); - - using (var reader = ES3Reader.Create(settings)) - { - if (reader == null) - return false; - return reader.Goto(key); - } - } - - /// Checks whether the default file exists. - /// The relative or absolute path of the file we want to check the existence of. - /// True if the file exists, otherwise False. - public static bool FileExists() - { - return FileExists(new ES3Settings()); - } - - /// Checks whether a file exists. - /// The relative or absolute path of the file we want to check the existence of. - /// True if the file exists, otherwise False. - public static bool FileExists(string filePath) - { - return FileExists(new ES3Settings(filePath)); - } - - /// Checks whether a file exists. - /// The relative or absolute path of the file we want to check the existence of. - /// The settings we want to use to override the default settings. - /// True if the file exists, otherwise False. - public static bool FileExists(string filePath, ES3Settings settings) - { - return FileExists(new ES3Settings(filePath, settings)); - } - - /// Checks whether a file exists. - /// The settings we want to use to override the default settings. - /// True if the file exists, otherwise False. - public static bool FileExists(ES3Settings settings) - { - if (settings.location == Location.File) - return ES3IO.FileExists(settings.FullPath); - if (settings.location == Location.PlayerPrefs) - return PlayerPrefs.HasKey(settings.FullPath); - if (settings.location == Location.Cache) - return ES3File.FileExists(settings); - if (settings.location == Location.Resources) - return Resources.Load(settings.FullPath) != null; - return false; - } - - /// Checks whether a folder exists. - /// The relative or absolute path of the folder we want to check the existence of. - /// True if the folder exists, otherwise False. - public static bool DirectoryExists(string folderPath) - { - return DirectoryExists(new ES3Settings(folderPath)); - } - - /// Checks whether a file exists. - /// The relative or absolute path of the folder we want to check the existence of. - /// The settings we want to use to override the default settings. - /// True if the folder exists, otherwise False. - public static bool DirectoryExists(string folderPath, ES3Settings settings) - { - return DirectoryExists(new ES3Settings(folderPath, settings)); - } - - /// Checks whether a folder exists. - /// The settings we want to use to override the default settings. - /// True if the folder exists, otherwise False. - public static bool DirectoryExists(ES3Settings settings) - { - if (settings.location == Location.File) - return ES3IO.DirectoryExists(settings.FullPath); - if (settings.location == Location.PlayerPrefs || settings.location == Location.Cache) - throw new NotSupportedException("Directories are not supported for the Cache and PlayerPrefs location."); - if (settings.location == Location.Resources) - throw new NotSupportedException("Checking existence of folder in Resources not supported."); - return false; - } - - /// Gets an array of all of the key names in the default file. - public static string[] GetKeys() - { - return GetKeys(new ES3Settings()); - } - - /// Gets an array of all of the key names in a file. - /// The relative or absolute path of the file we want to get the key names from. - public static string[] GetKeys(string filePath) - { - return GetKeys(new ES3Settings(filePath)); - } - - /// Gets an array of all of the key names in a file. - /// The relative or absolute path of the file we want to get the key names from. - /// The settings we want to use to override the default settings. - public static string[] GetKeys(string filePath, ES3Settings settings) - { - return GetKeys(new ES3Settings(filePath, settings)); - } - - /// Gets an array of all of the key names in a file. - /// The settings we want to use to override the default settings. - public static string[] GetKeys(ES3Settings settings) - { - - if (settings.location == Location.Cache) - return ES3File.GetKeys(settings); - - List keys = new List(); - using (var reader = ES3Reader.Create(settings)) - { - foreach (string key in reader.Properties) - { - keys.Add(key); - reader.Skip(); - } - } - return keys.ToArray(); - } - - /// Gets an array of all of the file names in a directory. - public static string[] GetFiles() - { - var settings = new ES3Settings(); - if (settings.location == Location.File) - { - if (settings.directory == Directory.PersistentDataPath) - settings.path = ES3IO.persistentDataPath; - else - settings.path = ES3IO.dataPath; - } - return GetFiles(new ES3Settings()); - } - - /// Gets an array of all of the file names in a directory. - /// The relative or absolute path of the directory we want to get the file names from. - public static string[] GetFiles(string directoryPath) - { - return GetFiles(new ES3Settings(directoryPath)); - } - - /// Gets an array of all of the file names in a directory. - /// The relative or absolute path of the directory we want to get the file names from. - /// The settings we want to use to override the default settings. - public static string[] GetFiles(string directoryPath, ES3Settings settings) - { - return GetFiles(new ES3Settings(directoryPath, settings)); - } - - /// Gets an array of all of the file names in a directory. - /// The settings we want to use to override the default settings. - public static string[] GetFiles(ES3Settings settings) - { - if (settings.location == Location.Cache) - return ES3File.GetFiles(); - if (settings.location != Location.File) - throw new NotSupportedException("ES3.GetFiles can only be used when the location is set to File or Cache."); - return ES3IO.GetFiles(settings.FullPath, false); - } - - /// Gets an array of all of the sub-directory names in a directory. - public static string[] GetDirectories() - { - return GetDirectories(new ES3Settings()); - } - - /// Gets an array of all of the sub-directory names in a directory. - /// The relative or absolute path of the directory we want to get the sub-directory names from. - public static string[] GetDirectories(string directoryPath) - { - return GetDirectories(new ES3Settings(directoryPath)); - } - - /// Gets an array of all of the sub-directory names in a directory. - /// The relative or absolute path of the directory we want to get the sub-directory names from. - /// The settings we want to use to override the default settings. - public static string[] GetDirectories(string directoryPath, ES3Settings settings) - { - return GetDirectories(new ES3Settings(directoryPath, settings)); - } - - /// Gets an array of all of the sub-directory names in a directory. - /// The settings we want to use to override the default settings. - public static string[] GetDirectories(ES3Settings settings) - { - if (settings.location != Location.File) - throw new NotSupportedException("ES3.GetDirectories can only be used when the location is set to File."); - return ES3IO.GetDirectories(settings.FullPath, false); - } - - /// Creates a backup of the default file . - /// - /// A backup is created by copying the file and giving it a .bak extension. - /// If a backup already exists it will be overwritten, so you will need to ensure that the old backup will not be - /// required before calling this method. - /// - public static void CreateBackup() - { - CreateBackup(new ES3Settings()); - } - - /// Creates a backup of a file. - /// - /// A backup is created by copying the file and giving it a .bak extension. - /// If a backup already exists it will be overwritten, so you will need to ensure that the old backup will not be - /// required before calling this method. - /// - /// The relative or absolute path of the file we wish to create a backup of. - public static void CreateBackup(string filePath) - { - CreateBackup(new ES3Settings(filePath)); - } - - /// Creates a backup of a file. - /// - /// A backup is created by copying the file and giving it a .bak extension. - /// If a backup already exists it will be overwritten, so you will need to ensure that the old backup will not be - /// required before calling this method. - /// - /// The relative or absolute path of the file we wish to create a backup of. - /// The settings we want to use to override the default settings. - public static void CreateBackup(string filePath, ES3Settings settings) - { - CreateBackup(new ES3Settings(filePath, settings)); - } - - /// Creates a backup of a file. - /// - /// A backup is created by copying the file and giving it a .bak extension. - /// If a backup already exists it will be overwritten, so you will need to ensure that the old backup will not be - /// required before calling this method. - /// - /// The settings we want to use to override the default settings. - public static void CreateBackup(ES3Settings settings) - { - var backupSettings = new ES3Settings(settings.path + ES3IO.backupFileSuffix, settings); - CopyFile(settings, backupSettings); - } - - /// Restores a backup of a file. - /// The relative or absolute path of the file we wish to restore the backup of. - /// True if a backup was restored, or False if no backup could be found. - public static bool RestoreBackup(string filePath) - { - return RestoreBackup(new ES3Settings(filePath)); - } - - /// Restores a backup of a file. - /// The relative or absolute path of the file we wish to restore the backup of. - /// The settings we want to use to override the default settings. - /// True if a backup was restored, or False if no backup could be found. - public static bool RestoreBackup(string filePath, ES3Settings settings) - { - return RestoreBackup(new ES3Settings(filePath, settings)); - } - - /// Restores a backup of a file. - /// The settings we want to use to override the default settings. - /// True if a backup was restored, or False if no backup could be found. - public static bool RestoreBackup(ES3Settings settings) - { - var backupSettings = new ES3Settings(settings.path + ES3IO.backupFileSuffix, settings); - - if (!FileExists(backupSettings)) - return false; - - RenameFile(backupSettings, settings); - - return true; - } - - public static DateTime GetTimestamp() - { - return GetTimestamp(new ES3Settings()); - } - - public static DateTime GetTimestamp(string filePath) - { - return GetTimestamp(new ES3Settings(filePath)); - } - - public static DateTime GetTimestamp(string filePath, ES3Settings settings) - { - return GetTimestamp(new ES3Settings(filePath, settings)); - } - - /// Gets the date and time the file was last updated, in the UTC timezone. - /// The settings we want to use to override the default settings. - /// A DateTime object represeting the UTC date and time the file was last updated. - public static DateTime GetTimestamp(ES3Settings settings) - { - if (settings.location == Location.File) - return ES3IO.GetTimestamp(settings.FullPath); - if (settings.location == Location.PlayerPrefs) - return new DateTime(long.Parse(PlayerPrefs.GetString("timestamp_" + settings.FullPath, "0")), DateTimeKind.Utc); - if (settings.location == Location.Cache) - return ES3File.GetTimestamp(settings); - return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); - } - - /// Stores the default cached file to persistent storage. - /// - /// A backup is created by copying the file and giving it a .bak extension. - /// If a backup already exists it will be overwritten, so you will need to ensure that the old backup will not be - /// required before calling this method. - /// - public static void StoreCachedFile() - { - ES3File.Store(); - } - - /// Stores a cached file to persistent storage. - /// The filename or path of the file we want to store the cached file to. - public static void StoreCachedFile(string filePath) - { - StoreCachedFile(new ES3Settings(filePath)); - } - - /// Creates a backup of a file. - /// The filename or path of the file we want to store the cached file to. - /// The settings of the file we want to store to. - public static void StoreCachedFile(string filePath, ES3Settings settings) - { - StoreCachedFile(new ES3Settings(filePath, settings)); - } - - /// Stores a cached file to persistent storage. - /// The settings of the file we want to store to. - public static void StoreCachedFile(ES3Settings settings) - { - ES3File.Store(settings); - } - - /// Loads the default file in persistent storage into the cache. - /// - /// A backup is created by copying the file and giving it a .bak extension. - /// If a backup already exists it will be overwritten, so you will need to ensure that the old backup will not be - /// required before calling this method. - /// - public static void CacheFile() - { - CacheFile(new ES3Settings()); - } - - /// Loads a file from persistent storage into the cache. - /// The filename or path of the file we want to store the cached file to. - public static void CacheFile(string filePath) - { - CacheFile(new ES3Settings(filePath)); - } - - /// Creates a backup of a file. - /// The filename or path of the file we want to store the cached file to. - /// The settings of the file we want to store to. - public static void CacheFile(string filePath, ES3Settings settings) - { - CacheFile(new ES3Settings(filePath, settings)); - } - - /// Stores a cached file to persistent storage. - /// The settings of the file we want to store to. - public static void CacheFile(ES3Settings settings) - { - ES3File.CacheFile(settings); - } - - /// - /// Initialises Easy Save. This happens automatically when any ES3 methods are called, but is useful if you want - /// to perform initialisation before calling an ES3 method. - /// - public static void Init() - { - var settings = ES3Settings.defaultSettings; - string pdp = ES3IO.persistentDataPath; // Call this to initialise ES3IO for threading purposes. - ES3TypeMgr.Init(); - } - - #endregion -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/ES3.cs.meta deleted file mode 100644 index e5d6900..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ca1cdcde6d39a44b39ee5f5b86ddfd73 -timeCreated: 1499764822 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3Crypto.cs b/Assets/Plugins/Easy Save 3/Scripts/ES3Crypto.cs deleted file mode 100644 index 9e5fdb2..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3Crypto.cs +++ /dev/null @@ -1,209 +0,0 @@ -#if !DISABLE_ENCRYPTION -using System.IO; -using System.Security.Cryptography; -using System.Text; -#if NETFX_CORE -using Windows.Security.Cryptography; -using Windows.Security.Cryptography.Core; -using Windows.Storage.Streams; -using System.Runtime.InteropServices.WindowsRuntime; -#endif - -namespace ES3Internal -{ - public static class ES3Hash - { -#if NETFX_CORE - public static string SHA1Hash(string input) - { - return System.Text.Encoding.UTF8.GetString(UnityEngine.Windows.Crypto.ComputeSHA1Hash(System.Text.Encoding.UTF8.GetBytes(input))); - } -#else - public static string SHA1Hash(string input) - { - using (var sha1 = new SHA1Managed()) - return Encoding.UTF8.GetString(sha1.ComputeHash(Encoding.UTF8.GetBytes(input))); - } -#endif - } - - public abstract class EncryptionAlgorithm - { - public abstract byte[] Encrypt(byte[] bytes, string password, int bufferSize); - public abstract byte[] Decrypt(byte[] bytes, string password, int bufferSize); - public abstract void Encrypt(Stream input, Stream output, string password, int bufferSize); - public abstract void Decrypt(Stream input, Stream output, string password, int bufferSize); - - protected static void CopyStream(Stream input, Stream output, int bufferSize) - { - byte[] buffer = new byte[bufferSize]; - int read; - while((read = input.Read(buffer, 0, bufferSize)) > 0) - output.Write(buffer, 0, read); - } - } - - public class AESEncryptionAlgorithm : EncryptionAlgorithm - { - private const int ivSize = 16; - private const int keySize = 16; - private const int pwIterations = 100; - - public override byte[] Encrypt(byte[] bytes, string password, int bufferSize) - { - using (var input = new MemoryStream(bytes)) - { - using (var output = new MemoryStream()) - { - Encrypt(input, output, password, bufferSize); - return output.ToArray(); - } - } - } - - public override byte[] Decrypt(byte[] bytes, string password, int bufferSize) - { - using (var input = new MemoryStream(bytes)) - { - using (var output = new MemoryStream()) - { - Decrypt(input, output, password, bufferSize); - return output.ToArray(); - } - } - } - - public override void Encrypt(Stream input, Stream output, string password, int bufferSize) - { - input.Position = 0; - -#if NETFX_CORE - // Generate an IV and write it to the output. - var iv = CryptographicBuffer.GenerateRandom(ivSize); - output.Write(iv.ToArray(), 0, ivSize); - - var pwBuffer = CryptographicBuffer.ConvertStringToBinary(password, BinaryStringEncoding.Utf8); - var keyDerivationProvider = KeyDerivationAlgorithmProvider.OpenAlgorithm("PBKDF2_SHA1"); - KeyDerivationParameters pbkdf2Parms = KeyDerivationParameters.BuildForPbkdf2(iv, pwIterations); - // Create a key based on original key and derivation parmaters - CryptographicKey keyOriginal = keyDerivationProvider.CreateKey(pwBuffer); - IBuffer keyMaterial = CryptographicEngine.DeriveKeyMaterial(keyOriginal, pbkdf2Parms, keySize); - - var provider = SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.AesCbcPkcs7); - var key = provider.CreateSymmetricKey(keyMaterial); - - // Get the input stream as an IBuffer. - IBuffer msg; - using(var ms = new MemoryStream()) - { - input.CopyTo(ms); - msg = ms.ToArray().AsBuffer(); - } - - var buffEncrypt = CryptographicEngine.Encrypt(key, msg, iv); - - - output.Write(buffEncrypt.ToArray(), 0, (int)buffEncrypt.Length); - output.Dispose(); -#else - using (var alg = Aes.Create()) - { - alg.Mode = CipherMode.CBC; - alg.Padding = PaddingMode.PKCS7; - alg.GenerateIV(); - var key = new Rfc2898DeriveBytes(password, alg.IV, pwIterations); - alg.Key = key.GetBytes(keySize); - // Write the IV to the output stream. - output.Write(alg.IV, 0, ivSize); - using (var encryptor = alg.CreateEncryptor()) - using (var cs = new CryptoStream(output, encryptor, CryptoStreamMode.Write)) - CopyStream(input, cs, bufferSize); - } -#endif - } - - public override void Decrypt(Stream input, Stream output, string password, int bufferSize) - { -#if NETFX_CORE - var thisIV = new byte[ivSize]; - input.Read(thisIV, 0, ivSize); - var iv = thisIV.AsBuffer(); - - var pwBuffer = CryptographicBuffer.ConvertStringToBinary(password, BinaryStringEncoding.Utf8); - - var keyDerivationProvider = KeyDerivationAlgorithmProvider.OpenAlgorithm("PBKDF2_SHA1"); - KeyDerivationParameters pbkdf2Parms = KeyDerivationParameters.BuildForPbkdf2(iv, pwIterations); - // Create a key based on original key and derivation parameters. - CryptographicKey keyOriginal = keyDerivationProvider.CreateKey(pwBuffer); - IBuffer keyMaterial = CryptographicEngine.DeriveKeyMaterial(keyOriginal, pbkdf2Parms, keySize); - - var provider = SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.AesCbcPkcs7); - var key = provider.CreateSymmetricKey(keyMaterial); - - // Get the input stream as an IBuffer. - IBuffer msg; - using(var ms = new MemoryStream()) - { - input.CopyTo(ms); - msg = ms.ToArray().AsBuffer(); - } - - var buffDecrypt = CryptographicEngine.Decrypt(key, msg, iv); - - output.Write(buffDecrypt.ToArray(), 0, (int)buffDecrypt.Length); -#else - using (var alg = Aes.Create()) - { - byte[] thisIV = new byte[ivSize]; - input.Read(thisIV, 0, ivSize); - alg.IV = thisIV; - - var key = new Rfc2898DeriveBytes(password, alg.IV, pwIterations); - alg.Key = key.GetBytes(keySize); - - using (var decryptor = alg.CreateDecryptor()) - using (var cryptoStream = new CryptoStream(input, decryptor, CryptoStreamMode.Read)) - CopyStream(cryptoStream, output, bufferSize); - - } -#endif - output.Position = 0; - } - } - - public class UnbufferedCryptoStream : MemoryStream - { - private readonly bool isReadStream; - private readonly Stream stream; - private readonly EncryptionAlgorithm alg; - private readonly int bufferSize; - private bool disposed; - private readonly string password; - - public UnbufferedCryptoStream(Stream stream, bool isReadStream, string password, int bufferSize, EncryptionAlgorithm alg) - { - this.stream = stream; - this.isReadStream = isReadStream; - this.password = password; - this.bufferSize = bufferSize; - this.alg = alg; - - - if (isReadStream) - alg.Decrypt(stream, this, password, bufferSize); - } - - protected override void Dispose(bool disposing) - { - if (disposed) - return; - disposed = true; - - if (!isReadStream) - alg.Encrypt(this, stream, password, bufferSize); - stream.Dispose(); - base.Dispose(disposing); - } - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3Crypto.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/ES3Crypto.cs.meta deleted file mode 100644 index 5d39d6d..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3Crypto.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d2b3b6335276042569261b3e6bed694e -timeCreated: 1519132297 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3File.cs b/Assets/Plugins/Easy Save 3/Scripts/ES3File.cs deleted file mode 100644 index 5a3ea32..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3File.cs +++ /dev/null @@ -1,517 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.IO; -using System.Linq; -using ES3Internal; -using ES3Types; -/// Represents a cached file which can be saved to and loaded from, and commited to storage when necessary. -public class ES3File -{ - [EditorBrowsable(EditorBrowsableState.Never)] - public static Dictionary cachedFiles = new Dictionary(); - private readonly Dictionary cache = new Dictionary(); - - public ES3Settings settings; - private bool syncWithFile; - private readonly DateTime timestamp = DateTime.UtcNow; - - /// Creates a new ES3File and loads the default file into the ES3File if there is data to load. - public ES3File() : this(new ES3Settings(), true) {} - - /// Creates a new ES3File and loads the specified file into the ES3File if there is data to load. - /// The relative or absolute path of the file in storage our ES3File is associated with. - public ES3File(string filePath) : this(new ES3Settings(filePath), true) {} - - /// Creates a new ES3File and loads the specified file into the ES3File if there is data to load. - /// The relative or absolute path of the file in storage our ES3File is associated with. - /// The settings we want to use to override the default settings. - public ES3File(string filePath, ES3Settings settings) : this(new ES3Settings(filePath, settings), true) {} - - /// Creates a new ES3File and loads the specified file into the ES3File if there is data to load. - /// The settings we want to use to override the default settings. - public ES3File(ES3Settings settings) : this(settings, true) {} - - /// Creates a new ES3File and only loads the default file into it if syncWithFile is set to true. - /// Whether we should sync this ES3File with the one in storage immediately after creating it. - public ES3File(bool syncWithFile) : this(new ES3Settings(), syncWithFile) {} - /// Creates a new ES3File and only loads the specified file into it if syncWithFile is set to true. - /// The relative or absolute path of the file in storage our ES3File is associated with. - /// Whether we should sync this ES3File with the one in storage immediately after creating it. - public ES3File(string filePath, bool syncWithFile) : this(new ES3Settings(filePath), syncWithFile) {} - /// Creates a new ES3File and only loads the specified file into it if syncWithFile is set to true. - /// The relative or absolute path of the file in storage our ES3File is associated with. - /// The settings we want to use to override the default settings. - /// Whether we should sync this ES3File with the one in storage immediately after creating it. - public ES3File(string filePath, ES3Settings settings, bool syncWithFile) : this(new ES3Settings(filePath, settings), syncWithFile) {} - - /// Creates a new ES3File and loads the specified file into the ES3File if there is data to load. - /// The settings we want to use to override the default settings. - /// Whether we should sync this ES3File with the one in storage immediately after creating it. - public ES3File(ES3Settings settings, bool syncWithFile) - { - this.settings = settings; - this.syncWithFile = syncWithFile; - if (syncWithFile) - { - // Type checking must be enabled when syncing. - var settingsWithTypeChecking = (ES3Settings)settings.Clone(); - settingsWithTypeChecking.typeChecking = true; - - using (var reader = ES3Reader.Create(settingsWithTypeChecking)) - { - if (reader == null) - return; - foreach (KeyValuePair kvp in reader.RawEnumerator) - cache[kvp.Key] = kvp.Value; - } - - timestamp = ES3.GetTimestamp(settingsWithTypeChecking); - } - } - - /// Creates a new ES3File and loads the bytes into the ES3File. Note the bytes must represent that of a file. - /// The bytes representing our file. - /// The settings we want to use to override the default settings. - /// Whether we should sync this ES3File with the one in storage immediately after creating it. - public ES3File(byte[] bytes, ES3Settings settings = null) - { - if (settings == null) - this.settings = new ES3Settings(); - else - this.settings = settings; - - syncWithFile = true; // This ensures that the file won't be merged, which would prevent deleted keys from being deleted. - - SaveRaw(bytes, settings); - } - - /// Synchronises this ES3File with a file in storage. - public void Sync() - { - Sync(settings); - } - - /// Synchronises this ES3File with a file in storage. - /// The relative or absolute path of the file in storage we want to synchronise with. - /// The settings we want to use to override the default settings. - public void Sync(string filePath, ES3Settings settings = null) - { - Sync(new ES3Settings(filePath, settings)); - } - - /// Synchronises this ES3File with a file in storage. - /// The settings we want to use to override the default settings. - public void Sync(ES3Settings settings = null) - { - if (settings == null) - settings = new ES3Settings(); - - if (cache.Count == 0) - { - ES3.DeleteFile(settings); - return; - } - - using (var baseWriter = ES3Writer.Create(settings, true, !syncWithFile, false)) - { - foreach (KeyValuePair kvp in cache) - { - // If we change the name of a type, the type may be null. - // In this case, use System.Object as the type. - Type type; - if (kvp.Value.type == null) - type = typeof(object); - else - type = kvp.Value.type.type; - baseWriter.Write(kvp.Key, type, kvp.Value.bytes); - } - baseWriter.Save(!syncWithFile); - } - } - - /// Removes the data stored in this ES3File. The ES3File will be empty after calling this method. - public void Clear() - { - cache.Clear(); - } - - /// Returns an array of all of the key names in this ES3File. - public string[] GetKeys() - { - var keyCollection = cache.Keys; - string[] keys = new string[keyCollection.Count]; - keyCollection.CopyTo(keys, 0); - return keys; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - internal static ES3File GetOrCreateCachedFile(ES3Settings settings) - { - ES3File cachedFile; - if (!cachedFiles.TryGetValue(settings.path, out cachedFile)) - { - cachedFile = new ES3File(settings, false); - cachedFiles.Add(settings.path, cachedFile); - cachedFile.syncWithFile = true; // This ensures that the file won't be merged, which would prevent deleted keys from being deleted. - } - // Settings might refer to the same file, but might have changed. - // To account for this, we update the settings of the ES3File each time we access it. - cachedFile.settings = settings; - return cachedFile; - } - - internal static void CacheFile(ES3Settings settings) - { - // If we're still using cached settings, set it to the default location. - if (settings.location == ES3.Location.Cache) - { - settings = (ES3Settings)settings.Clone(); - // If the default settings are also set to cache, assume ES3.Location.File. Otherwise, set it to the default location. - settings.location = ES3Settings.defaultSettings.location == ES3.Location.Cache ? ES3.Location.File : ES3Settings.defaultSettings.location; - } - - if (!ES3.FileExists(settings)) - return; - - // Disable compression and encryption when loading the raw bytes, and the ES3File constructor will expect encrypted/compressed bytes. - var loadSettings = (ES3Settings)settings.Clone(); - loadSettings.compressionType = ES3.CompressionType.None; - loadSettings.encryptionType = ES3.EncryptionType.None; - - cachedFiles[settings.path] = new ES3File(ES3.LoadRawBytes(loadSettings), settings); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - internal static void Store(ES3Settings settings = null) - { - if (settings == null) - settings = new ES3Settings(ES3.Location.File); - // If we're still using cached settings, set it to the default location. - else if (settings.location == ES3.Location.Cache) - { - settings = (ES3Settings)settings.Clone(); - // If the default settings are also set to cache, assume ES3.Location.File. Otherwise, set it to the default location. - settings.location = ES3Settings.defaultSettings.location == ES3.Location.Cache ? ES3.Location.File : ES3Settings.defaultSettings.location; - } - - ES3File cachedFile; - if (!cachedFiles.TryGetValue(settings.path, out cachedFile)) - throw new FileNotFoundException("The file '" + settings.path + "' could not be stored because it could not be found in the cache."); - cachedFile.Sync(settings); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - internal static void RemoveCachedFile(ES3Settings settings) - { - cachedFiles.Remove(settings.path); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - internal static void CopyCachedFile(ES3Settings oldSettings, ES3Settings newSettings) - { - ES3File cachedFile; - if (!cachedFiles.TryGetValue(oldSettings.path, out cachedFile)) - throw new FileNotFoundException("The file '" + oldSettings.path + "' could not be copied because it could not be found in the cache."); - if (cachedFiles.ContainsKey(newSettings.path)) - throw new InvalidOperationException("Cannot copy file '" + oldSettings.path + "' to '" + newSettings.path + "' because '" + newSettings.path + "' already exists"); - - cachedFiles.Add(newSettings.path, (ES3File)cachedFile.MemberwiseClone()); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - internal static void DeleteKey(string key, ES3Settings settings) - { - ES3File cachedFile; - if (cachedFiles.TryGetValue(settings.path, out cachedFile)) - cachedFile.DeleteKey(key); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - internal static bool KeyExists(string key, ES3Settings settings) - { - ES3File cachedFile; - if (cachedFiles.TryGetValue(settings.path, out cachedFile)) - return cachedFile.KeyExists(key); - return false; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - internal static bool FileExists(ES3Settings settings) - { - return cachedFiles.ContainsKey(settings.path); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - internal static string[] GetKeys(ES3Settings settings) - { - ES3File cachedFile; - if (!cachedFiles.TryGetValue(settings.path, out cachedFile)) - throw new FileNotFoundException("Could not get keys from the file '" + settings.path + "' because it could not be found in the cache."); - return cachedFile.cache.Keys.ToArray(); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - internal static string[] GetFiles() - { - return cachedFiles.Keys.ToArray(); - } - - internal static DateTime GetTimestamp(ES3Settings settings) - { - ES3File cachedFile; - if (!cachedFiles.TryGetValue(settings.path, out cachedFile)) - return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); - return cachedFile.timestamp; - } - - #region Save Methods - - /// Saves a value to a key in this ES3File. - /// The key we want to use to identify our value in the file. - /// The value we want to save. - public void Save(string key, T value) - { - var unencryptedSettings = (ES3Settings)settings.Clone(); - unencryptedSettings.encryptionType = ES3.EncryptionType.None; - unencryptedSettings.compressionType = ES3.CompressionType.None; - - // If T is object, use the value to get it's type. Otherwise, use T so that it works with inheritence. - Type type; - if (value == null) - type = typeof(T); - else - type = value.GetType(); - - cache[key] = new ES3Data(ES3TypeMgr.GetOrCreateES3Type(type), ES3.Serialize(value, unencryptedSettings)); - } - - /// Merges the data specified by the bytes parameter into this ES3File. - /// The bytes we want to merge with this ES3File. - /// The settings we want to use to override the default settings. - public void SaveRaw(byte[] bytes, ES3Settings settings = null) - { - if (settings == null) - settings = new ES3Settings(); - - // Type checking must be enabled when syncing. - var settingsWithTypeChecking = (ES3Settings)settings.Clone(); - settingsWithTypeChecking.typeChecking = true; - - using (var reader = ES3Reader.Create(bytes, settingsWithTypeChecking)) - { - if (reader == null) - return; - foreach (KeyValuePair kvp in reader.RawEnumerator) - cache[kvp.Key] = kvp.Value; - } - } - - /// Merges the data specified by the bytes parameter into this ES3File. - /// The bytes we want to merge with this ES3File. - /// The settings we want to use to override the default settings. - public void AppendRaw(byte[] bytes, ES3Settings settings = null) - { - if (settings == null) - settings = new ES3Settings(); - // AppendRaw just does the same thing as SaveRaw in ES3File. - SaveRaw(bytes, settings); - } - - #endregion - - #region Load Methods - - /* Standard load methods */ - - /// Loads the value from this ES3File with the given key. - /// The key which identifies the value we want to load. - public object Load(string key) - { - return Load(key); - } - - /// Loads the value from this ES3File with the given key. - /// The key which identifies the value we want to load. - /// The value we want to return if the key does not exist in this ES3File. - public object Load(string key, object defaultValue) - { - return Load(key, defaultValue); - } - - /// Loads the value from this ES3File with the given key. - /// The key which identifies the value we want to load. - public T Load(string key) - { - ES3Data es3Data; - - if (!cache.TryGetValue(key, out es3Data)) - throw new KeyNotFoundException("Key \"" + key + "\" was not found in this ES3File. Use Load(key, defaultValue) if you want to return a default value if the key does not exist."); - - var unencryptedSettings = (ES3Settings)settings.Clone(); - unencryptedSettings.encryptionType = ES3.EncryptionType.None; - unencryptedSettings.compressionType = ES3.CompressionType.None; - - if (typeof(T) == typeof(object)) - return (T)ES3.Deserialize(es3Data.type, es3Data.bytes, unencryptedSettings); - return ES3.Deserialize(es3Data.bytes, unencryptedSettings); - } - - /// Loads the value from this ES3File with the given key. - /// The key which identifies the value we want to load. - /// The value we want to return if the key does not exist in this ES3File. - public T Load(string key, T defaultValue) - { - ES3Data es3Data; - - if (!cache.TryGetValue(key, out es3Data)) - return defaultValue; - var unencryptedSettings = (ES3Settings)settings.Clone(); - unencryptedSettings.encryptionType = ES3.EncryptionType.None; - unencryptedSettings.compressionType = ES3.CompressionType.None; - - if (typeof(T) == typeof(object)) - return (T)ES3.Deserialize(es3Data.type, es3Data.bytes, unencryptedSettings); - return ES3.Deserialize(es3Data.bytes, unencryptedSettings); - } - - /// Loads the value from this ES3File with the given key into an existing object. - /// The key which identifies the value we want to load. - /// The object we want to load the value into. - public void LoadInto(string key, T obj) where T : class - { - ES3Data es3Data; - - if (!cache.TryGetValue(key, out es3Data)) - throw new KeyNotFoundException("Key \"" + key + "\" was not found in this ES3File. Use Load(key, defaultValue) if you want to return a default value if the key does not exist."); - - var unencryptedSettings = (ES3Settings)settings.Clone(); - unencryptedSettings.encryptionType = ES3.EncryptionType.None; - unencryptedSettings.compressionType = ES3.CompressionType.None; - - if (typeof(T) == typeof(object)) - ES3.DeserializeInto(es3Data.type, es3Data.bytes, obj, unencryptedSettings); - else - ES3.DeserializeInto(es3Data.bytes, obj, unencryptedSettings); - } - - #endregion - - #region Load Raw Methods - - /// Loads the ES3File as a raw, unencrypted, uncompressed byte array. - public byte[] LoadRawBytes() - { - var newSettings = (ES3Settings)settings.Clone(); - if (!newSettings.postprocessRawCachedData) - { - newSettings.encryptionType = ES3.EncryptionType.None; - newSettings.compressionType = ES3.CompressionType.None; - } - return GetBytes(newSettings); - } - - /// - /// Loads the ES3File as a raw, unencrypted, uncompressed string, using the encoding defined in the ES3File's - /// settings variable. - /// - public string LoadRawString() - { - if (cache.Count == 0) - return ""; - return settings.encoding.GetString(LoadRawBytes()); - } - - /* - * Same as LoadRawString, except it will return an encrypted/compressed file if these are enabled. - */ - internal byte[] GetBytes(ES3Settings settings = null) - { - if (cache.Count == 0) - return new byte[0]; - - if (settings == null) - settings = this.settings; - - using (var ms = new MemoryStream()) - { - var memorySettings = (ES3Settings)settings.Clone(); - memorySettings.location = ES3.Location.InternalMS; - // Ensure we return unencrypted bytes. - if (!memorySettings.postprocessRawCachedData) - { - memorySettings.encryptionType = ES3.EncryptionType.None; - memorySettings.compressionType = ES3.CompressionType.None; - } - - using (var baseWriter = ES3Writer.Create(ES3Stream.CreateStream(ms, memorySettings, ES3FileMode.Write), memorySettings, true, false)) - { - foreach (KeyValuePair kvp in cache) - baseWriter.Write(kvp.Key, kvp.Value.type.type, kvp.Value.bytes); - baseWriter.Save(false); - } - - return ms.ToArray(); - } - } - - #endregion - - #region Other ES3 Methods - - /// Deletes a key from this ES3File. - /// The key we want to delete. - public void DeleteKey(string key) - { - cache.Remove(key); - } - - /// Checks whether a key exists in this ES3File. - /// The key we want to check the existence of. - /// True if the key exists, otherwise False. - public bool KeyExists(string key) - { - return cache.ContainsKey(key); - } - - /// Gets the size of the cached data in bytes. - public int Size() - { - int size = 0; - foreach (KeyValuePair kvp in cache) - size += kvp.Value.bytes.Length; - return size; - } - - public Type GetKeyType(string key) - { - ES3Data es3data; - if (!cache.TryGetValue(key, out es3data)) - throw new KeyNotFoundException("Key \"" + key + "\" was not found in this ES3File. Use Load(key, defaultValue) if you want to return a default value if the key does not exist."); - - return es3data.type.type; - } - - #endregion -} - -namespace ES3Internal -{ - public struct ES3Data - { - public ES3Type type; - public byte[] bytes; - - public ES3Data(Type type, byte[] bytes) - { - this.type = type == null ? null : ES3TypeMgr.GetOrCreateES3Type(type); - this.bytes = bytes; - } - - public ES3Data(ES3Type type, byte[] bytes) - { - this.type = type; - this.bytes = bytes; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3File.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/ES3File.cs.meta deleted file mode 100644 index 43f99ff..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3File.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2cd9723dc51904030be3c30362442d47 -timeCreated: 1499764821 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3GameObject.cs b/Assets/Plugins/Easy Save 3/Scripts/ES3GameObject.cs deleted file mode 100644 index f4d5e53..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3GameObject.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Collections.Generic; -using UnityEditorInternal; -using UnityEngine; -[ExecuteInEditMode] -public class ES3GameObject : MonoBehaviour -{ - public List components = new List(); - - /* Ensures that this Component is always last in the List to guarantee that it's loaded after any Components it references */ - private void Update() - { - if (Application.isPlaying) - return; - -#if UNITY_EDITOR - ComponentUtility.MoveComponentDown(this); -#endif - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3GameObject.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/ES3GameObject.cs.meta deleted file mode 100644 index 25a8d9b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3GameObject.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7e2cacabe81aea8468e08e911727ee97 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3IO.cs b/Assets/Plugins/Easy Save 3/Scripts/ES3IO.cs deleted file mode 100644 index e3144aa..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3IO.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using System.IO; -using UnityEngine; - -namespace ES3Internal -{ - public static class ES3IO - { -#if UNITY_SWITCH - internal static readonly string persistentDataPath = ""; - internal static readonly string dataPath = ""; -#else - internal static readonly string persistentDataPath = Application.persistentDataPath; - internal static readonly string dataPath = Application.dataPath; -#endif - - internal const string backupFileSuffix = ".bac"; - internal const string temporaryFileSuffix = ".tmp"; - - public enum ES3FileMode { Read, Write, Append } - - public static DateTime GetTimestamp(string filePath) - { - if (!FileExists(filePath)) - return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); - return File.GetLastWriteTime(filePath).ToUniversalTime(); - } - - public static string GetExtension(string path) - { - return Path.GetExtension(path); - } - - public static void DeleteFile(string filePath) - { - if (FileExists(filePath)) - File.Delete(filePath); - } - - public static bool FileExists(string filePath) { return File.Exists(filePath); } - public static void MoveFile(string sourcePath, string destPath) { File.Move(sourcePath, destPath); } - public static void CopyFile(string sourcePath, string destPath) { File.Copy(sourcePath, destPath); } - - public static void MoveDirectory(string sourcePath, string destPath) { Directory.Move(sourcePath, destPath); } - public static void CreateDirectory(string directoryPath) { Directory.CreateDirectory(directoryPath); } - public static bool DirectoryExists(string directoryPath) { return Directory.Exists(directoryPath); } - - /* - * Given a path, it returns the directory that path points to. - * eg. "C:/myFolder/thisFolder/myFile.txt" will return "C:/myFolder/thisFolder". - */ - public static string GetDirectoryPath(string path, char seperator = '/') - { - //return Path.GetDirectoryName(path); - // Path.GetDirectoryName turns forward slashes to backslashes in some cases on Windows, which is why - // Substring is used instead. - char slashChar = UsesForwardSlash(path) ? '/' : '\\'; - - int slash = path.LastIndexOf(slashChar); - - // If this path ends in a slash it is assumed to already be a path to a Directory. - if (slash == path.Length - 1) - return path; - - // Ignore trailing slash if necessary. - if (slash == path.Length - 1) - slash = path.Substring(0, slash).LastIndexOf(slashChar); - if (slash == -1) - ES3Debug.LogError("Path provided is not a directory path as it contains no slashes."); - return path.Substring(0, slash); - } - - public static bool UsesForwardSlash(string path) - { - if (path.Contains("/")) - return true; - return false; - } - - // Takes a directory path and a file or directory name and combines them into a single path. - public static string CombinePathAndFilename(string directoryPath, string fileOrDirectoryName) - { - if (directoryPath[directoryPath.Length - 1] != '/' && directoryPath[directoryPath.Length - 1] != '\\') - directoryPath += '/'; - return directoryPath + fileOrDirectoryName; - } - - public static string[] GetDirectories(string path, bool getFullPaths = true) - { - string[] paths = Directory.GetDirectories(path); - for (int i = 0; i < paths.Length; i++) - { - if (!getFullPaths) - paths[i] = Path.GetFileName(paths[i]); - // GetDirectories sometimes returns backslashes, so we need to convert them to - // forward slashes. - paths[i].Replace("\\", "/"); - } - return paths; - } - - public static void DeleteDirectory(string directoryPath) - { - if (DirectoryExists(directoryPath)) - Directory.Delete(directoryPath, true); - } - - // Note: Paths not ending in a slash are assumed to be a path to a file. - // In this case the Directory containing the file will be searched. - public static string[] GetFiles(string path, bool getFullPaths = true) - { - string[] paths = Directory.GetFiles(GetDirectoryPath(path)); - if (!getFullPaths) - { - for (int i = 0; i < paths.Length; i++) - paths[i] = Path.GetFileName(paths[i]); - } - return paths; - } - - public static byte[] ReadAllBytes(string path) - { - return File.ReadAllBytes(path); - } - - public static void WriteAllBytes(string path, byte[] bytes) - { - File.WriteAllBytes(path, bytes); - } - - public static void CommitBackup(ES3Settings settings) - { - ES3Debug.Log("Committing backup for " + settings.path + " to storage location " + settings.location); - - string temporaryFilePath = settings.FullPath + temporaryFileSuffix; - - if (settings.location == ES3.Location.File) - { - string oldFileBackup = settings.FullPath + temporaryFileSuffix + ".bak"; - - // If there's existing save data to overwrite ... - if (FileExists(settings.FullPath)) - { - // Delete any old backups. - DeleteFile(oldFileBackup); - // Rename the old file so we can restore it if it fails. - CopyFile(settings.FullPath, oldFileBackup); - - try - { - // Delete the old file so that we can move it. - DeleteFile(settings.FullPath); - // Now rename the temporary file to the name of the save file. - MoveFile(temporaryFilePath, settings.FullPath); - } - catch (Exception e) - { - // If any exceptions occur, restore the original save file. - try { DeleteFile(settings.FullPath); } - catch {} - MoveFile(oldFileBackup, settings.FullPath); - throw e; - } - - DeleteFile(oldFileBackup); - } - // Else just rename the temporary file to the main file. - else - MoveFile(temporaryFilePath, settings.FullPath); - } - else if (settings.location == ES3.Location.PlayerPrefs) - { - PlayerPrefs.SetString(settings.FullPath, PlayerPrefs.GetString(temporaryFilePath)); - PlayerPrefs.DeleteKey(temporaryFilePath); - PlayerPrefs.Save(); - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3IO.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/ES3IO.cs.meta deleted file mode 100644 index 2d3c49c..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3IO.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0e3e89d69f37e4fa9b4d60467722ac73 -timeCreated: 1499764821 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3InspectorInfo.cs b/Assets/Plugins/Easy Save 3/Scripts/ES3InspectorInfo.cs deleted file mode 100644 index 62523d8..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3InspectorInfo.cs +++ /dev/null @@ -1,17 +0,0 @@ -using UnityEngine; - -/* - * Displays an info message in the inspector. - * Only available in the Editor. - */ -public class ES3InspectorInfo : MonoBehaviour -{ - #if UNITY_EDITOR - public string message = ""; - - public void SetMessage(string message) - { - this.message = message; - } - #endif -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3InspectorInfo.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/ES3InspectorInfo.cs.meta deleted file mode 100644 index c48e539..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3InspectorInfo.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8714d999c5ae749538494c1347e5a3ca -timeCreated: 1519132290 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3Prefab.cs b/Assets/Plugins/Easy Save 3/Scripts/ES3Prefab.cs deleted file mode 100644 index 11601da..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3Prefab.cs +++ /dev/null @@ -1,220 +0,0 @@ -using System.Collections.Generic; -using ES3Internal; -using UnityEditor.SceneManagement; -using UnityEngine; -using UnityEngine.Scripting; -#if UNITY_EDITOR -using UnityEditor; -#endif - - -namespace ES3Internal -{ - public class ES3Prefab : MonoBehaviour - { - public long prefabId = GetNewRefID(); - /* - * We need to store references to all dependencies of the prefab because only supported scripts will be serialised. - * This means that although supported scripts have their dependencies added to the reference manager when we load the prefab, - * there will not be any dependencies in the reference manager for scripts which are not supported. So it will not be possible to save any reference to these. - */ - public ES3RefIdDictionary localRefs = new ES3RefIdDictionary(); - - public void Awake() - { - // Add the references to the reference list when this prefab is instantiated. - var mgr = ES3ReferenceMgrBase.Current; - - if (mgr == null) - return; - - foreach (KeyValuePair kvp in localRefs) - if (kvp.Key != null) - mgr.Add(kvp.Key); - } - - public long Get(Object obj) - { - long id; - if (localRefs.TryGetValue(obj, out id)) - return id; - return -1; - } - - public long Add(Object obj) - { - long id; - if (localRefs.TryGetValue(obj, out id)) - return id; - - if (!ES3ReferenceMgrBase.CanBeSaved(obj)) - return -1; - id = GetNewRefID(); - localRefs.Add(obj, id); - return id; - } - - public Dictionary GetReferences() - { - Dictionary localToGlobal = new Dictionary(); - - var refMgr = ES3ReferenceMgrBase.Current; - - if (refMgr == null) - return localToGlobal; - - foreach (KeyValuePair kvp in localRefs) - { - long id = refMgr.Add(kvp.Key); - localToGlobal.Add(kvp.Value.ToString(), id.ToString()); - } - return localToGlobal; - } - - public void ApplyReferences(Dictionary localToGlobal) - { - if (ES3ReferenceMgrBase.Current == null) - return; - - foreach (KeyValuePair localRef in localRefs) - { - long globalId; - if (localToGlobal.TryGetValue(localRef.Value, out globalId)) - ES3ReferenceMgrBase.Current.Add(localRef.Key, globalId); - } - } - - public static long GetNewRefID() - { - return ES3ReferenceMgrBase.GetNewRefID(); - } -#if UNITY_EDITOR - public void GeneratePrefabReferences() - { -#if UNITY_2021_3_OR_NEWER - if (gameObject.scene.name != null || PrefabStageUtility.GetCurrentPrefabStage() != null) -#elif UNITY_2018_3_OR_NEWER - if (this.gameObject.scene.name != null || UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage() != null) -#else - if (this.gameObject.scene.name != null) -#endif - return; - - // Create a new reference list so that any objects which are no longer dependencies are removed. - var tempLocalRefs = new ES3RefIdDictionary(); - - // Get dependencies of children also. - Transform[] transforms = GetComponentsInChildren(); - GameObject[] gos = new GameObject[transforms.Length]; - for (int i = 0; i < transforms.Length; i++) - gos[i] = transforms[i].gameObject; - - bool addedNewReference = false; - - // Add the GameObject's dependencies to the reference list. - foreach (var obj in EditorUtility.CollectDependencies(gos)) - { - var dependency = obj; - if (obj == null || !ES3ReferenceMgrBase.CanBeSaved(dependency)) - continue; - - long id = Get(dependency); - // If we're adding a new reference, do an Undo.RecordObject to ensure it persists. - if (id == -1) - { - addedNewReference = true; - Undo.RecordObject(this, "Update Easy Save 3 Prefab"); - EditorUtility.SetDirty(this); - } - tempLocalRefs.Add(dependency, id == -1 ? GetNewRefID() : id); - } - - if (addedNewReference || tempLocalRefs.Count != localRefs.Count) - localRefs = tempLocalRefs; - } -#endif - } -} - -/* - * Create a blank ES3Type for ES3Prefab as it does not require serialising/deserialising when stored as a Component. - */ -namespace ES3Types -{ - [Preserve] - public class ES3Type_ES3Prefab : ES3Type - { - public static ES3Type Instance; - - public ES3Type_ES3Prefab() : base(typeof(ES3Prefab)) { Instance = this; } - - public override void Write(object obj, ES3Writer writer) - { - } - - public override object Read(ES3Reader reader) - { - return null; - } - } - - /* - * Use this ES3Type to serialise the . - */ - public class ES3Type_ES3PrefabInternal : ES3Type - { - public static ES3Type Instance = new ES3Type_ES3PrefabInternal(); - - public ES3Type_ES3PrefabInternal() : base(typeof(ES3Type_ES3PrefabInternal)) { Instance = this; } - - public override void Write(object obj, ES3Writer writer) - { - var es3Prefab = (ES3Prefab)obj; - - writer.WriteProperty("prefabId", es3Prefab.prefabId.ToString(), ES3Type_string.Instance); - writer.WriteProperty("refs", es3Prefab.GetReferences()); - } - - public override object Read(ES3Reader reader) - { - long prefabId = reader.ReadRefProperty(); - - if (ES3ReferenceMgrBase.Current == null) - return null; - - var es3Prefab = ES3ReferenceMgrBase.Current.GetPrefab(prefabId); - if (es3Prefab == null) - throw new MissingReferenceException("Prefab with ID " + prefabId + " could not be found.\nPress the 'Refresh References' button on the ES3ReferenceMgr Component of the Easy Save 3 Manager in the scene to refresh prefabs."); - - -#if UNITY_EDITOR - // Use PrefabUtility.InstantiatePrefab if we're saving in the Editor and the application isn't playing. - // This keeps the connection to the prefab, which is useful for Editor scripts saving data outside of runtime. - var instance = Application.isPlaying ? Object.Instantiate(es3Prefab.gameObject) : PrefabUtility.InstantiatePrefab(es3Prefab.gameObject); -#else - var instance = GameObject.Instantiate(es3Prefab.gameObject); -#endif - var instanceES3Prefab = ((GameObject)instance).GetComponent(); - if (instanceES3Prefab == null) - throw new MissingReferenceException("Prefab with ID " + prefabId + " was found, but it does not have an ES3Prefab component attached."); - - ReadInto(reader, instance); - - return instanceES3Prefab.gameObject; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - // Load as ES3Refs and convert to longs. - Dictionary localToGlobal_refs = reader.ReadProperty>(ES3Type_ES3RefDictionary.Instance); - Dictionary localToGlobal = new Dictionary(); - foreach (KeyValuePair kvp in localToGlobal_refs) - localToGlobal.Add(kvp.Key.id, kvp.Value.id); - - if (ES3ReferenceMgrBase.Current == null) - return; - - ((GameObject)obj).GetComponent().ApplyReferences(localToGlobal); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3Prefab.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/ES3Prefab.cs.meta deleted file mode 100644 index 4c771c9..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3Prefab.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: baff8732cd3074ef88b34f9cc487846d -timeCreated: 1519132295 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgr.cs b/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgr.cs deleted file mode 100644 index 447fb62..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgr.cs +++ /dev/null @@ -1,255 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel; -using ES3Internal; -using UnityEngine; -using UnityEngine.SceneManagement; -using Object = UnityEngine.Object; -#if UNITY_EDITOR -using UnityEditor; -using UnityEditor.SceneManagement; -using System; -using System.Linq; -#endif - -#if UNITY_VISUAL_SCRIPTING -using Unity.VisualScripting; -[IncludeInSettings(true)] -#endif -public class ES3ReferenceMgr : ES3ReferenceMgrBase -{ -#if UNITY_EDITOR - - [EditorBrowsable(EditorBrowsableState.Never)] - public void RefreshDependencies(bool isEnteringPlayMode = false) - { - // Empty the refId so it has to be refreshed. - refId = null; - - ES3ReferenceMgrBase.isEnteringPlayMode = isEnteringPlayMode; - - // This will get the dependencies for all GameObjects and Components from the active scene. - AddDependencies(gameObject.scene.GetRootGameObjects()); - AddDependenciesFromFolders(); - AddPrefabsToManager(); - RemoveNullOrInvalidValues(); - - ES3ReferenceMgrBase.isEnteringPlayMode = false; - } - - [MenuItem("Tools/Easy Save 3/Refresh References for All Scenes", false, 150)] - private static void RefreshDependenciesInAllScenes() - { - if (!EditorUtility.DisplayDialog("Refresh references in all scenes", "This will open each scene which is enabled in your Build Settings, refresh each reference manager, and save the scene.\n\nWe recommend making a backup of your project before doing this for the first time.", "Ok", "Cancel", DialogOptOutDecisionType.ForThisMachine, "ES3RefreshAllOptOut")) - return; - - // Get a list of loaded scenes so we know whether we need to close them after refreshing references or not. - string[] loadedScenePaths = new string[SceneManager.sceneCount]; - for (int i = 0; i < SceneManager.sceneCount; i++) - loadedScenePaths[i] = SceneManager.GetSceneAt(i).path; - - EditorBuildSettingsScene[] scenes = EditorBuildSettings.scenes; - string sceneNameList = ""; // We use this so we can display a list of scenes at the end. - - for (int i = 0; i < scenes.Length; i++) - { - var buildSettingsScene = scenes[i]; - - if (!buildSettingsScene.enabled) - continue; - - if (EditorUtility.DisplayCancelableProgressBar("Refreshing references", $"Refreshing references for scene {buildSettingsScene.path}.", i / scenes.Length)) - return; - - bool sceneWasOpen = loadedScenePaths.Contains(buildSettingsScene.path); - var scene = EditorSceneManager.OpenScene(buildSettingsScene.path, OpenSceneMode.Additive); - - var mgr = GetManagerFromScene(scene); - - if (mgr != null) - { - try - { - ((ES3ReferenceMgr)mgr).RefreshDependencies(); - } - catch (Exception e) - { - Debug.LogError($"Couldn't update references for scene {scene.name} as the following exception occurred:\n\n" + e); - } - } - - sceneNameList += $"{scene.name}\n"; - - // If the scene wasn't originally open, save it and close it. - if (!sceneWasOpen) - { - // Temporarily disable refreshing on save so that it doesn't refresh again. - bool updateReferencesOnSave = ES3Settings.defaultSettingsScriptableObject.updateReferencesWhenSceneIsSaved; - ES3Settings.defaultSettingsScriptableObject.updateReferencesWhenSceneIsSaved = false; - - EditorSceneManager.SaveScene(scene); - EditorSceneManager.CloseScene(scene, true); - - ES3Settings.defaultSettingsScriptableObject.updateReferencesWhenSceneIsSaved = updateReferencesOnSave; - } - } - EditorUtility.ClearProgressBar(); - - EditorUtility.DisplayDialog("References refreshed", $"Refrences updated for scenes:\n\n{sceneNameList}", "Ok", DialogOptOutDecisionType.ForThisMachine, "ES3RefreshAllCompleteOptOut"); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void Optimize() - { - Object[] dependencies = EditorUtility.CollectDependencies(gameObject.scene.GetRootGameObjects()); - HashSet notDependenciesOfScene = new HashSet(); - - foreach (KeyValuePair kvp in idRef) - if (!dependencies.Contains(kvp.Value)) - notDependenciesOfScene.Add(kvp.Value); - - foreach (var obj in notDependenciesOfScene) - Remove(obj); - } - - /* Adds all dependencies from this scene to the manager */ - [EditorBrowsable(EditorBrowsableState.Never)] - public void AddDependencies() - { - GameObject[] rootGameObjects = gameObject.scene.GetRootGameObjects(); - - for (int j = 0; j < rootGameObjects.Length; j++) - { - var go = rootGameObjects[j]; - - if (EditorUtility.DisplayCancelableProgressBar("Gathering references", "Populating reference manager with your scene dependencies so they can be saved and loaded by reference.", j / rootGameObjects.Length)) - return; - - AddDependencies(go); - } - - EditorUtility.ClearProgressBar(); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void AddDependencies(Object[] objs) - { - double timeStarted = EditorApplication.timeSinceStartup; - int timeout = ES3Settings.defaultSettingsScriptableObject.collectDependenciesTimeout; - - foreach (var obj in objs) - { - if (obj == null || obj.name == "Easy Save 3 Manager") - continue; - - foreach (var dependency in EditorUtility.CollectDependencies(new[] - { - obj - })) - { - if (EditorApplication.timeSinceStartup - timeStarted > timeout) - { - Debug.LogWarning($"Easy Save cancelled gathering of references for object {obj.name} because it took longer than {timeout} seconds. You can increase the timeout length in Tools > Easy Save 3 > Settings > Reference Gathering Timeout, or adjust the settings so that fewer objects are referenced in your scene."); - return; - } - - Add(dependency); - - if (obj is ES3Prefab prefab) - AddPrefabToManager(prefab); - } - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void AddDependenciesFromFolders() - { - string[] folders = ES3Settings.defaultSettingsScriptableObject.referenceFolders; - - if (folders == null || folders.Length == 0) - return; - - string[] guids = AssetDatabase.FindAssets("t:Object", folders); - - foreach (string guid in guids) - { - string path = AssetDatabase.GUIDToAssetPath(guid); - var obj = AssetDatabase.LoadAssetAtPath(path); - - if (obj != null) - AddDependencies(obj); - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void AddDependenciesLegacy(Object[] objs) - { - for (int i = 0; i < objs.Length; i++) - { - var obj = objs[i]; - - if (obj.name == "Easy Save 3 Manager") - continue; - - HashSet dependencies = CollectDependenciesLegacy(obj); - - foreach (var dependency in dependencies) - { - if (dependency != null) - { - Add(dependency); - - // Add the prefab if it's referenced by this scene. - if (dependency.GetType() == typeof(ES3Prefab)) - AddPrefabToManager((ES3Prefab)dependency); - } - } - } - - Undo.RecordObject(this, "Update Easy Save 3 Reference List"); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void AddDependencies(Object obj) - { - AddDependencies(new[] - { - obj - }); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void GeneratePrefabReferences() - { - AddPrefabsToManager(); - foreach (var es3Prefab in prefabs) - es3Prefab.GeneratePrefabReferences(); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void AddPrefabsToManager() - { - if (ES3Settings.defaultSettingsScriptableObject.addAllPrefabsToManager) - { - // Clear any null values. This isn't necessary if we're not adding all prefabs to manager as the list is cleared each time. - if (prefabs.RemoveAll(item => item == null) > 0) - Undo.RecordObject(this, "Update Easy Save 3 Reference List"); - - foreach (var es3Prefab in Resources.FindObjectsOfTypeAll()) - AddPrefabToManager(es3Prefab); - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - private void AddPrefabToManager(ES3Prefab es3Prefab) - { - try - { - if (es3Prefab != null && EditorUtility.IsPersistent(es3Prefab)) - if (AddPrefab(es3Prefab)) - Undo.RecordObject(this, "Update Easy Save 3 Reference List"); - es3Prefab.GeneratePrefabReferences(); - } - catch {} - } -#endif -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgr.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgr.cs.meta deleted file mode 100644 index d1c37c6..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgr.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9a83408fcc9044c4fbc7e5d09a369ab6 -timeCreated: 1503395115 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs b/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs deleted file mode 100644 index 6d5e0e8..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs +++ /dev/null @@ -1,735 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using UnityEditor; -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.SceneManagement; -using UnityEngine.UI; -using Component = UnityEngine.Component; -using Object = UnityEngine.Object; -using Random = System.Random; - -namespace ES3Internal -{ - [Serializable] - [DisallowMultipleComponent] - public abstract class ES3ReferenceMgrBase : MonoBehaviour - { - internal object _lock = new object(); - - public const string referencePropertyName = "_ES3Ref"; - private static ES3ReferenceMgrBase _current; - private static HashSet mgrs = new HashSet(); -#if UNITY_EDITOR - protected static bool isEnteringPlayMode; - private static readonly HideFlags[] invalidHideFlags = - { - HideFlags.DontSave, - HideFlags.DontSaveInBuild, - HideFlags.DontSaveInEditor, - HideFlags.HideAndDontSave - }; -#endif - -#if !UNITY_EDITOR - [NonSerialized] -#endif - public List excludeObjects = new List(); - - private static Random rng; - - [HideInInspector] - public bool openPrefabs; // Whether the prefab list should be open in the Editor. - - public List prefabs = new List(); - - public static ES3ReferenceMgrBase Current - { - get - { - // If the reference manager hasn't been assigned, or we've got a reference to a manager in a different scene which isn't marked as DontDestroyOnLoad, look for this scene's manager. - if (_current == null /*|| (_current.gameObject.scene.buildIndex != -1 && _current.gameObject.scene != SceneManager.GetActiveScene())*/) - { - var mgr = GetManagerFromScene(SceneManager.GetActiveScene()); - if (mgr != null) - mgrs.Add(_current = mgr); - } - return _current; - } - } - - public static ES3ReferenceMgrBase GetManagerFromScene(Scene scene) - { - // This has been removed as isLoaded is false during the initial Awake(). - /*if (!scene.isLoaded) - return null;*/ - - GameObject[] roots; - try - { - roots = scene.GetRootGameObjects(); - } - catch - { - return null; - } - - ES3ReferenceMgr mgr = null; - - // First, look for Easy Save 3 Manager in the top-level. - foreach (var root in roots) - { - if (root.name == "Easy Save 3 Manager") - { - mgr = root.GetComponent(); - break; - } - } - - // If the user has moved or renamed the Easy Save 3 Manager, we need to perform a deep search. - if (mgr == null) - foreach (var root in roots) - if ((mgr = root.GetComponentInChildren()) != null) - break; - - return mgr; - } - - public bool IsInitialised { get { return idRef.Count > 0; } } - - [SerializeField] - public ES3IdRefDictionary idRef = new ES3IdRefDictionary(); - private ES3RefIdDictionary _refId; - - public ES3RefIdDictionary refId - { - get - { - if (_refId == null) - { - _refId = new ES3RefIdDictionary(); - // Populate the reverse dictionary with the items from the normal dictionary. - foreach (KeyValuePair kvp in idRef) - if (kvp.Value != null) - _refId[kvp.Value] = kvp.Key; - } - return _refId; - } - set - { - _refId = value; - } - } - - public ES3GlobalReferences GlobalReferences - { - get - { - return ES3GlobalReferences.Instance; - } - } - - // Reset static variables to handle disabled domain reloading. - [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] - private static void Init() - { - _current = null; - mgrs = new HashSet(); -#if UNITY_EDITOR - isEnteringPlayMode = false; -#endif - rng = null; - } - - private void Awake() - { - if (_current != null && _current != this) - { - var existing = _current; - - /* We intentionally use Current rather than _current here, as _current may contain a reference to a manager in another scene, - * but Current only returns the Manager for the active scene. */ - if (Current != null) - { - RemoveNullValues(); - - existing.Merge(this); - Destroy(this); - _current = existing; // Undo the call to Current, which may have set it to NULL. - } - } - else - _current = this; - mgrs.Add(this); - } - - private void OnDestroy() - { - if (_current == this) - _current = null; - mgrs.Remove(this); - } - - // Merges two managers, not allowing any clashes of IDs - public void Merge(ES3ReferenceMgrBase otherMgr) - { - foreach (KeyValuePair kvp in otherMgr.idRef) - Add(kvp.Value, kvp.Key); - } - - public long Get(Object obj) - { - if (!mgrs.Contains(this)) - mgrs.Add(this); - - foreach (var mgr in mgrs) - { - if (mgr == null) - continue; - - if (obj == null) - return -1; - - long id; - if (mgr.refId.TryGetValue(obj, out id)) - return id; - } - return -1; - } - - internal Object Get(long id, Type type, bool suppressWarnings = false) - { - if (!mgrs.Contains(this)) - mgrs.Add(this); - - foreach (var mgr in mgrs) - { - if (mgr == null) - continue; - - if (id == -1) - return null; - - Object obj; - if (mgr.idRef.TryGetValue(id, out obj)) - { - if (obj == null) // If obj has been marked as destroyed but not yet destroyed, don't return it. - return null; - return obj; - } - } - - if (GlobalReferences != null) - { - var globalRef = GlobalReferences.Get(id); - if (globalRef != null) - return globalRef; - } - - if (type != null) - ES3Debug.LogWarning("Reference for " + type + " with ID " + id + " could not be found in Easy Save's reference manager. If you are loading objects dynamically (i.e. objects created at runtime), this warning is expected and can be ignored.", this); - else - ES3Debug.LogWarning("Reference with ID " + id + " could not be found in Easy Save's reference manager. If you are loading objects dynamically (i.e. objects created at runtime), this warning is expected and can be ignored.", this); - - return null; - } - - public Object Get(long id, bool suppressWarnings = false) - { - return Get(id, null, suppressWarnings); - } - - public ES3Prefab GetPrefab(long id, bool suppressWarnings = false) - { - if (!mgrs.Contains(this)) - mgrs.Add(this); - - foreach (var mgr in mgrs) - { - if (mgr == null) - continue; - - foreach (var prefab in mgr.prefabs) - if (prefabs != null && prefab.prefabId == id) - return prefab; - } - if (!suppressWarnings) - ES3Debug.LogWarning("Prefab with ID " + id + " could not be found in Easy Save's reference manager. Try pressing the Refresh References button on the ES3ReferenceMgr Component of the Easy Save 3 Manager in your scene.", this); - return null; - } - - public long GetPrefab(ES3Prefab prefabToFind, bool suppressWarnings = false) - { - if (!mgrs.Contains(this)) - mgrs.Add(this); - - foreach (var mgr in mgrs) - { - if (mgr == null) - continue; - - foreach (var prefab in prefabs) - if (prefab == prefabToFind) - return prefab.prefabId; - } - if (!suppressWarnings) - ES3Debug.LogWarning("Prefab with name " + prefabToFind.name + " could not be found in Easy Save's reference manager. Try pressing the Refresh References button on the ES3ReferenceMgr Component of the Easy Save 3 Manager in your scene.", prefabToFind); - return -1; - } - - public long Add(Object obj) - { - if (obj == null) - return -1; - - if (!CanBeSaved(obj)) - return -1; - - long id; - // If it already exists in the list, do nothing. - if (refId.TryGetValue(obj, out id)) - return id; - - if (GlobalReferences != null) - { - id = GlobalReferences.GetOrAdd(obj); - if (id != -1) - { - Add(obj, id); - return id; - } - } - - lock (_lock) - { - // Add the reference to the Dictionary. - id = GetNewRefID(); - return Add(obj, id); - } - } - - public long Add(Object obj, long id) - { - if (obj == null) - return -1; - - if (!CanBeSaved(obj)) - return -1; - - // If the ID is -1, auto-generate an ID. - if (id == -1) - id = GetNewRefID(); - // Add the reference to the Dictionary. - lock (_lock) - { - idRef[id] = obj; - if (obj != null) - refId[obj] = id; - } - return id; - } - - public bool AddPrefab(ES3Prefab prefab) - { - if (!prefabs.Contains(prefab)) - { - prefabs.Add(prefab); - return true; - } - return false; - } - - public void Remove(Object obj) - { - if (!mgrs.Contains(this)) - mgrs.Add(this); - - foreach (var mgr in mgrs) - { - if (mgr == null) - continue; - - // Only remove from this manager if we're in the Editor. - if (!Application.isPlaying && mgr != this) - continue; - - lock (mgr._lock) - { - mgr.refId.Remove(obj); - // There may be multiple references with the same ID, so remove them all. - foreach (KeyValuePair item in mgr.idRef.Where(kvp => kvp.Value == obj).ToList()) - mgr.idRef.Remove(item.Key); - } - } - } - - public void Remove(long referenceID) - { - foreach (var mgr in mgrs) - { - if (mgr == null) - continue; - - lock (mgr._lock) - { - mgr.idRef.Remove(referenceID); - // There may be multiple references with the same ID, so remove them all. - foreach (KeyValuePair item in mgr.refId.Where(kvp => kvp.Value == referenceID).ToList()) - mgr.refId.Remove(item.Key); - } - } - } - - public void RemoveNullValues() - { - List nullKeys = idRef.Where(pair => pair.Value == null).Select(pair => pair.Key).ToList(); - foreach (long key in nullKeys) - idRef.Remove(key); - } - - public void RemoveNullOrInvalidValues() - { - List nullKeys = idRef.Where(pair => pair.Value == null || !CanBeSaved(pair.Value) || excludeObjects.Contains(pair.Value)).Select(pair => pair.Key).ToList(); - foreach (long key in nullKeys) - idRef.Remove(key); - - if (GlobalReferences != null) - GlobalReferences.RemoveInvalidKeys(); - } - - public void Clear() - { - lock (_lock) - { - refId.Clear(); - idRef.Clear(); - } - } - - public bool Contains(Object obj) - { - return refId.ContainsKey(obj); - } - - public bool Contains(long referenceID) - { - return idRef.ContainsKey(referenceID); - } - - public void ChangeId(long oldId, long newId) - { - idRef.ChangeKey(oldId, newId); - // Empty the refId so it has to be refreshed. - refId = null; - } - - internal static long GetNewRefID() - { - if (rng == null) - rng = new Random(); - - byte[] buf = new byte[8]; - rng.NextBytes(buf); - long longRand = BitConverter.ToInt64(buf, 0); - - return Math.Abs(longRand % (long.MaxValue - 0)) + 0; - } - -#if UNITY_EDITOR - public static HashSet CollectDependenciesLegacy(Object obj, HashSet dependencies = null, int depth = int.MinValue) - { - return CollectDependenciesLegacy(new[] - { - obj - }, dependencies, depth); - } - - /* - * Collects all top-level dependencies of an object. - * For GameObjects, it will traverse all children. - * For Components or ScriptableObjects, it will get all serialisable UnityEngine.Object fields/properties as dependencies. - */ - public static HashSet CollectDependenciesLegacy(Object[] objs, HashSet dependencies = null, int depth = int.MinValue) - { - if (depth == int.MinValue) - depth = ES3Settings.defaultSettingsScriptableObject.collectDependenciesDepth; - - if (depth < 0) - return dependencies; - - if (dependencies == null) - dependencies = new HashSet(); - - foreach (var obj in objs) - { - if (obj == null) - continue; - - var type = obj.GetType(); - - // Skip types which don't need processing - if (type == typeof(ES3ReferenceMgr) || type == typeof(ES3AutoSaveMgr) || type == typeof(ES3AutoSave) || type == typeof(ES3InspectorInfo)) - continue; - - // Add the prefab to the manager but don't process it. We'll use this to work out what prefabs to add to the prefabs list later. - if (type == typeof(ES3Prefab)) - { - dependencies.Add(obj); - continue; - } - - // If it's a GameObject, get the GameObject's Components and collect their dependencies. - if (type == typeof(GameObject)) - { - var go = (GameObject)obj; - // If we've not already processed this GameObject ... - if (dependencies.Add(go)) - { - // Get the dependencies of each Component in the GameObject. - CollectDependenciesLegacy(go.GetComponents(), dependencies, depth - 1); - // Get the dependencies of each child in the GameObject. - foreach (Transform child in go.transform) - CollectDependenciesLegacy(child.gameObject, dependencies, depth); // Don't decrement child, as we consider this a top-level object. - } - } - // Else if it's a Component or ScriptableObject, add the values of any UnityEngine.Object fields as dependencies. - else - CollectDependenciesFromFieldsLegacy(obj, dependencies, depth - 1); - } - - return dependencies; - } - - private static void CollectDependenciesFromFieldsLegacy(Object obj, HashSet dependencies, int depth) - { - // If we've already collected dependencies for this, do nothing. - if (!dependencies.Add(obj)) - return; - - if (depth == int.MinValue) - depth = ES3Settings.defaultSettingsScriptableObject.collectDependenciesDepth; - - if (depth < 0) - return; - - var type = obj.GetType(); - - if (isEnteringPlayMode && type == typeof(Text)) - return; - - try - { - // SerializedObject is expensive, so for known classes we manually gather references. - - if (type == typeof(Animator) || obj is Transform || type == typeof(CanvasRenderer) || type == typeof(Mesh) || type == typeof(AudioClip) || type == typeof(Rigidbody) || obj is HorizontalOrVerticalLayoutGroup) - return; - - if (obj is Texture) - { - // This ensures that Sprites which are children of the Texture are also added. In the Editor you would otherwise need to expand the Texture to add the Sprite. - foreach (var dependency in AssetDatabase.LoadAllAssetsAtPath(AssetDatabase.GetAssetPath(obj))) - if (dependency != obj) - dependencies.Add(dependency); - } - - if (obj is Graphic) - { - var m = (Graphic)obj; - dependencies.Add(m.material); - dependencies.Add(m.defaultMaterial); - dependencies.Add(m.mainTexture); - - if (type == typeof(Text)) - { - var text = (Text)obj; - dependencies.Add(text.font); - } - else if (type == typeof(Image)) - { - var img = (Image)obj; - dependencies.Add(img.sprite); - } - return; - } - - if (type == typeof(Mesh)) - { - if (AssetDatabase.Contains(obj)) - dependencies.Add(obj); - return; - } - - if (type == typeof(Material)) - { - var material = (Material)obj; - var shader = material.shader; - if (shader != null) - { - dependencies.Add(material.shader); - -#if UNITY_2019_3_OR_NEWER - for (int i = 0; i < shader.GetPropertyCount(); i++) - if (shader.GetPropertyType(i) == ShaderPropertyType.Texture) - dependencies.Add(material.GetTexture(shader.GetPropertyName(i))); - } -#endif - - return; - } - - if (type == typeof(MeshFilter)) - { - dependencies.Add(((MeshFilter)obj).sharedMesh); - return; - } - - if (type == typeof(MeshCollider)) - { - var mc = (MeshCollider)obj; - dependencies.Add(mc.sharedMesh); - dependencies.Add(mc.sharedMaterial); - dependencies.Add(mc.attachedRigidbody); - return; - } - - if (type == typeof(Camera)) - { - var c = (Camera)obj; - dependencies.Add(c.targetTexture); - return; - } - - if (type == typeof(SkinnedMeshRenderer)) - dependencies.Add(((SkinnedMeshRenderer)obj).sharedMesh); // Don't return. Let this fall through to the if(obj is renderer) call. - else if (type == typeof(SpriteRenderer)) - dependencies.Add(((SpriteRenderer)obj).sprite); // Don't return. Let this fall through to the if(obj is renderer) call. - else if (type == typeof(ParticleSystemRenderer)) - dependencies.Add(((ParticleSystemRenderer)obj).mesh); // Don't return. Let this fall through to the if(obj is renderer) call. - - if (obj is Renderer) - { - var renderer = (Renderer)obj; - foreach (var material in renderer.sharedMaterials) - CollectDependenciesFromFieldsLegacy(material, dependencies, depth - 1); - return; - } - } - catch {} - - var so = new SerializedObject(obj); - if (so == null) - return; - - var property = so.GetIterator(); - if (property == null) - return; - - // Iterate through each of this object's properties. - while(property.NextVisible(true)) - { - try - { - // If it's an array which contains UnityEngine.Objects, add them as dependencies. - if (property.isArray && property.propertyType != SerializedPropertyType.String) - { - for (int i = 0; i < property.arraySize; i++) - { - var element = property.GetArrayElementAtIndex(i); - - // If the array contains UnityEngine.Object types, add them to the dependencies. - if (element.propertyType == SerializedPropertyType.ObjectReference) - { - var elementValue = element.objectReferenceValue; - var elementType = elementValue.GetType(); - - // If it's a GameObject, use CollectDependencies so that Components are also added. - if (elementType == typeof(GameObject)) - CollectDependenciesLegacy(elementValue, dependencies, depth - 1); - else - CollectDependenciesFromFieldsLegacy(elementValue, dependencies, depth - 1); - } - // Otherwise this array does not contain UnityEngine.Object types, so we should stop. - else - break; - } - } - // Else if it's a normal UnityEngine.Object field, add it. - else if (property.propertyType == SerializedPropertyType.ObjectReference) - { - var propertyValue = property.objectReferenceValue; - if (propertyValue == null) - continue; - - // If it's a GameObject, use CollectDependencies so that Components are also added. - if (propertyValue.GetType() == typeof(GameObject)) - CollectDependenciesLegacy(propertyValue, dependencies, depth - 1); - else - CollectDependenciesFromFieldsLegacy(propertyValue, dependencies, depth - 1); - } - } - catch {} - } - } - - // Called in the Editor when this Component is added. - private void Reset() - { - // Ensure that Component can only be added by going to Assets > Easy Save 3 > Add Manager to Scene. - if (gameObject.name != "Easy Save 3 Manager") - { - EditorUtility.DisplayDialog("Cannot add ES3ReferenceMgr directly", "Please go to 'Tools > Easy Save 3 > Add Manager to Scene' to add an Easy Save 3 Manager to your scene.", "Ok"); - DestroyImmediate(this); - } - } -#endif - - internal static bool CanBeSaved(Object obj) - { -#if UNITY_EDITOR - if (obj == null) - return true; - - foreach (var flag in invalidHideFlags) - if ((obj.hideFlags & flag) != 0 && obj.hideFlags != HideFlags.HideInHierarchy && obj.hideFlags != HideFlags.HideInInspector && obj.hideFlags != HideFlags.NotEditable) - if (!(obj is Mesh || obj is Material)) - return false; - - // Exclude the Easy Save 3 Manager, and all components attached to it. - if (obj.name == "Easy Save 3 Manager") - return false; -#endif - return true; - } - } - - [Serializable] - public class ES3IdRefDictionary : ES3SerializableDictionary - { - protected override bool KeysAreEqual(long a, long b) - { - return a == b; - } - - protected override bool ValuesAreEqual(Object a, Object b) - { - return a == b; - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - [Serializable] - public class ES3RefIdDictionary : ES3SerializableDictionary - { - protected override bool KeysAreEqual(Object a, Object b) - { - return a == b; - } - - protected override bool ValuesAreEqual(long a, long b) - { - return a == b; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs.meta deleted file mode 100644 index be51e29..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f659e3ad478b6470d9744732042e7515 -timeCreated: 1519132301 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3Reflection.cs b/Assets/Plugins/Easy Save 3/Scripts/ES3Reflection.cs deleted file mode 100644 index 74f1444..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3Reflection.cs +++ /dev/null @@ -1,797 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Runtime.Serialization; -using ES3Types; -using UnityEngine; -using Object = UnityEngine.Object; - -namespace ES3Internal -{ - public static class ES3Reflection - { - public const string memberFieldPrefix = "m_"; - public const string componentTagFieldName = "tag"; - public const string componentNameFieldName = "name"; - public static readonly string[] excludedPropertyNames = - { - "runInEditMode", - "useGUILayout", - "hideFlags" - }; - - public static readonly Type serializableAttributeType = typeof(SerializableAttribute); - public static readonly Type serializeFieldAttributeType = typeof(SerializeField); - public static readonly Type obsoleteAttributeType = typeof(ObsoleteAttribute); - public static readonly Type nonSerializedAttributeType = typeof(NonSerializedAttribute); - public static readonly Type es3SerializableAttributeType = typeof(ES3Serializable); - public static readonly Type es3NonSerializableAttributeType = typeof(ES3NonSerializable); - - public static Type[] EmptyTypes = new Type[0]; - - private static Assembly[] _assemblies; - private static Assembly[] Assemblies - { - get - { - - if (_assemblies == null) - { - string[] assemblyNames = new ES3Settings().assemblyNames; - List assemblyList = new List(); - - /* We only use a try/catch block for UWP because exceptions can be disabled on some other platforms (e.g. WebGL), but the non-try/catch method doesn't work on UWP */ -#if NETFX_CORE - for (int i = 0; i < assemblyNames.Length; i++) - { - try - { - var assembly = Assembly.Load(new AssemblyName(assemblyNames[i])); - if (assembly != null) - assemblyList.Add(assembly); - } - catch { } - } - -#else - Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); - foreach (var assembly in assemblies) - { - // This try/catch block is here to catch errors such as assemblies containing double-byte characters in their path. - // This obviously won't work if exceptions are disabled. - try - { - if (assemblyNames.Contains(assembly.GetName().Name)) - assemblyList.Add(assembly); - } - catch {} - } -#endif - _assemblies = assemblyList.ToArray(); - } - return _assemblies; - } - } - - /* - * Gets the element type of a collection or array. - * Returns null if type is not a collection type. - */ - public static Type[] GetElementTypes(Type type) - { - if (IsGenericType(type)) - return GetGenericArguments(type); - if (type.IsArray) - return new[] - { - GetElementType(type) - }; - return null; - } - - public static List GetSerializableFields(Type type, List serializableFields = null, bool safe = true, string[] memberNames = null, BindingFlags bindings = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly) - { - if (type == null) - return new List(); - - FieldInfo[] fields = type.GetFields(bindings); - - if (serializableFields == null) - serializableFields = new List(); - - foreach (var field in fields) - { - string fieldName = field.Name; - - // If a members array was provided as a parameter, only include the field if it's in the array. - if (memberNames != null) - if (!memberNames.Contains(fieldName)) - continue; - - var fieldType = field.FieldType; - - if (AttributeIsDefined(field, es3SerializableAttributeType)) - { - serializableFields.Add(field); - continue; - } - - if (AttributeIsDefined(field, es3NonSerializableAttributeType)) - continue; - - if (safe) - { - // If the field is private, only serialize it if it's explicitly marked as serializable. - if (!field.IsPublic && !AttributeIsDefined(field, serializeFieldAttributeType)) - continue; - } - - // Exclude const or readonly fields. - if (field.IsLiteral || field.IsInitOnly) - continue; - - // Don't store fields whose type is the same as the class the field is housed in unless it's stored by reference (to prevent cyclic references) - if (fieldType == type && !IsAssignableFrom(typeof(Object), fieldType)) - continue; - - // If property is marked as obsolete or non-serialized, don't serialize it. - if (AttributeIsDefined(field, nonSerializedAttributeType) || AttributeIsDefined(field, obsoleteAttributeType)) - continue; - - if (!TypeIsSerializable(field.FieldType)) - continue; - - // Don't serialize member fields. - if (safe && fieldName.StartsWith(memberFieldPrefix) && field.DeclaringType.Namespace != null && field.DeclaringType.Namespace.Contains("UnityEngine")) - continue; - - serializableFields.Add(field); - } - - var baseType = BaseType(type); - if (baseType != null && baseType != typeof(object) && baseType != typeof(Object)) - GetSerializableFields(BaseType(type), serializableFields, safe, memberNames); - - return serializableFields; - } - - public static List GetSerializableProperties(Type type, List serializableProperties = null, bool safe = true, string[] memberNames = null, BindingFlags bindings = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly) - { - bool isComponent = IsAssignableFrom(typeof(Component), type); - - // Only get private properties if we're not getting properties safely. - if (!safe) - bindings = bindings | BindingFlags.NonPublic; - - PropertyInfo[] properties = type.GetProperties(bindings); - - if (serializableProperties == null) - serializableProperties = new List(); - - foreach (var p in properties) - { - if (AttributeIsDefined(p, es3SerializableAttributeType)) - { - serializableProperties.Add(p); - continue; - } - - if (AttributeIsDefined(p, es3NonSerializableAttributeType)) - continue; - - string propertyName = p.Name; - - if (excludedPropertyNames.Contains(propertyName)) - continue; - - // If a members array was provided as a parameter, only include the property if it's in the array. - if (memberNames != null) - if (!memberNames.Contains(propertyName)) - continue; - - if (safe) - { - // If safe serialization is enabled, only get properties which are explicitly marked as serializable. - if (!AttributeIsDefined(p, serializeFieldAttributeType) && !AttributeIsDefined(p, es3SerializableAttributeType)) - continue; - } - - var propertyType = p.PropertyType; - - // Don't store properties whose type is the same as the class the property is housed in unless it's stored by reference (to prevent cyclic references) - if (propertyType == type && !IsAssignableFrom(typeof(Object), propertyType)) - continue; - - if (!p.CanRead || !p.CanWrite) - continue; - - // Only support properties with indexing if they're an array. - if (p.GetIndexParameters().Length != 0 && !propertyType.IsArray) - continue; - - // Check that the type of the property is one which we can serialize. - // Also check whether an ES3Type exists for it. - if (!TypeIsSerializable(propertyType)) - continue; - - // Ignore certain properties on components. - if (isComponent) - { - // Ignore properties which are accessors for GameObject fields. - if (propertyName == componentTagFieldName || propertyName == componentNameFieldName) - continue; - } - - // If property is marked as obsolete or non-serialized, don't serialize it. - if (AttributeIsDefined(p, obsoleteAttributeType) || AttributeIsDefined(p, nonSerializedAttributeType)) - continue; - - serializableProperties.Add(p); - } - - var baseType = BaseType(type); - if (baseType != null && baseType != typeof(object)) - GetSerializableProperties(baseType, serializableProperties, safe, memberNames); - - return serializableProperties; - } - - public static bool TypeIsSerializable(Type type) - { - if (type == null) - return false; - - if (AttributeIsDefined(type, es3NonSerializableAttributeType)) - return false; - - if (IsPrimitive(type) || IsValueType(type) || IsAssignableFrom(typeof(Component), type) || IsAssignableFrom(typeof(ScriptableObject), type)) - return true; - - var es3Type = ES3TypeMgr.GetOrCreateES3Type(type, false); - - if (es3Type != null && !es3Type.isUnsupported) - return true; - - if (TypeIsArray(type)) - { - if (TypeIsSerializable(type.GetElementType())) - return true; - return false; - } - - Type[] genericArgs = type.GetGenericArguments(); - for (int i = 0; i < genericArgs.Length; i++) - if (!TypeIsSerializable(genericArgs[i])) - return false; - - /*if (HasParameterlessConstructor(type)) - return true;*/ - return false; - } - - public static object CreateInstance(Type type) - { - if (IsAssignableFrom(typeof(Component), type)) - return ES3ComponentType.CreateComponent(type); - if (IsAssignableFrom(typeof(ScriptableObject), type)) - return ScriptableObject.CreateInstance(type); - if (HasParameterlessConstructor(type)) - return Activator.CreateInstance(type); -#if NETFX_CORE - throw new NotSupportedException($"Cannot create an instance of {type} because it does not have a parameterless constructor, which is required on Universal Windows platform."); -#else - return FormatterServices.GetUninitializedObject(type); -#endif - } - - public static object CreateInstance(Type type, params object[] args) - { - if (IsAssignableFrom(typeof(Component), type)) - return ES3ComponentType.CreateComponent(type); - if (IsAssignableFrom(typeof(ScriptableObject), type)) - return ScriptableObject.CreateInstance(type); - return Activator.CreateInstance(type, args); - } - - public static Array ArrayCreateInstance(Type type, int length) - { - return Array.CreateInstance(type, new[] - { - length - }); - } - - public static Array ArrayCreateInstance(Type type, int[] dimensions) - { - return Array.CreateInstance(type, dimensions); - } - - public static Type MakeGenericType(Type type, Type genericParam) - { - return type.MakeGenericType(genericParam); - } - - public static ES3ReflectedMember[] GetSerializableMembers(Type type, bool safe = true, string[] memberNames = null) - { - if (type == null) - return new ES3ReflectedMember[0]; - - List fieldInfos = GetSerializableFields(type, new List(), safe, memberNames); - List propertyInfos = GetSerializableProperties(type, new List(), safe, memberNames); - ES3ReflectedMember[] reflectedFields = new ES3ReflectedMember[fieldInfos.Count + propertyInfos.Count]; - - for (int i = 0; i < fieldInfos.Count; i++) - reflectedFields[i] = new ES3ReflectedMember(fieldInfos[i]); - for (int i = 0; i < propertyInfos.Count; i++) - reflectedFields[i + fieldInfos.Count] = new ES3ReflectedMember(propertyInfos[i]); - - return reflectedFields; - } - - public static ES3ReflectedMember GetES3ReflectedProperty(Type type, string propertyName) - { - var propertyInfo = GetProperty(type, propertyName); - return new ES3ReflectedMember(propertyInfo); - } - - public static ES3ReflectedMember GetES3ReflectedMember(Type type, string fieldName) - { - var fieldInfo = GetField(type, fieldName); - return new ES3ReflectedMember(fieldInfo); - } - - /* - * Finds all classes of a specific type, and then returns an instance of each. - * Ignores classes which can't be instantiated (i.e. abstract classes, those without parameterless constructors). - */ - public static IList GetInstances() - { - List instances = new List(); - foreach (var assembly in Assemblies) - foreach (var type in assembly.GetTypes()) - if (IsAssignableFrom(typeof(T), type) && HasParameterlessConstructor(type) && !IsAbstract(type)) - instances.Add((T)Activator.CreateInstance(type)); - return instances; - } - - public static IList GetDerivedTypes(Type derivedType) - { - return - ( - from assembly in Assemblies - from type in assembly.GetTypes() - where IsAssignableFrom(derivedType, type) - select type - ).ToList(); - } - - public static bool IsAssignableFrom(Type a, Type b) - { - return a.IsAssignableFrom(b); - } - - public static Type GetGenericTypeDefinition(Type type) - { - return type.GetGenericTypeDefinition(); - } - - public static Type[] GetGenericArguments(Type type) - { - return type.GetGenericArguments(); - } - - public static int GetArrayRank(Type type) - { - return type.GetArrayRank(); - } - - public static string GetAssemblyQualifiedName(Type type) - { - return type.AssemblyQualifiedName; - } - - public static ES3ReflectedMethod GetMethod(Type type, string methodName, Type[] genericParameters, Type[] parameterTypes) - { - return new ES3ReflectedMethod(type, methodName, genericParameters, parameterTypes); - } - - public static bool TypeIsArray(Type type) - { - return type.IsArray; - } - - public static Type GetElementType(Type type) - { - return type.GetElementType(); - } - -#if NETFX_CORE - public static bool IsAbstract(Type type) - { - return type.GetTypeInfo().IsAbstract; - } - - public static bool IsInterface(Type type) - { - return type.GetTypeInfo().IsInterface; - } - - public static bool IsGenericType(Type type) - { - return type.GetTypeInfo().IsGenericType; - } - - public static bool IsValueType(Type type) - { - return type.GetTypeInfo().IsValueType; - } - - public static bool IsEnum(Type type) - { - return type.GetTypeInfo().IsEnum; - } - - public static bool HasParameterlessConstructor(Type type) - { - return GetParameterlessConstructor(type) != null; - } - - public static ConstructorInfo GetParameterlessConstructor(Type type) - { - foreach (var cInfo in type.GetTypeInfo().DeclaredConstructors) - if (!cInfo.IsStatic && cInfo.GetParameters().Length == 0) - return cInfo; - return null; - } - - public static string GetShortAssemblyQualifiedName(Type type) - { - if (IsPrimitive (type)) - return type.ToString (); - return type.FullName + "," + type.GetTypeInfo().Assembly.GetName().Name; - } - - public static PropertyInfo GetProperty(Type type, string propertyName) - { - var property = type.GetTypeInfo().GetDeclaredProperty(propertyName); - if (property == null && type.BaseType != typeof(object)) - return GetProperty(type.BaseType, propertyName); - return property; - } - - public static FieldInfo GetField(Type type, string fieldName) - { - return type.GetTypeInfo().GetDeclaredField(fieldName); - } - - public static MethodInfo[] GetMethods(Type type, string methodName) - { - return type.GetTypeInfo().GetDeclaredMethods(methodName); - } - - public static bool IsPrimitive(Type type) - { - return (type.GetTypeInfo().IsPrimitive || type == typeof(string) || type == typeof(decimal)); - } - - public static bool AttributeIsDefined(MemberInfo info, Type attributeType) - { - var attributes = info.GetCustomAttributes(attributeType, true); - foreach(var attribute in attributes) - return true; - return false; - } - - public static bool AttributeIsDefined(Type type, Type attributeType) - { - var attributes = type.GetTypeInfo().GetCustomAttributes(attributeType, true); - foreach(var attribute in attributes) - return true; - return false; - } - - public static bool ImplementsInterface(Type type, Type interfaceType) - { - return type.GetTypeInfo().ImplementedInterfaces.Contains(interfaceType); - } - - public static Type BaseType(Type type) - { - return type.GetTypeInfo().BaseType; - } -#else - public static bool IsAbstract(Type type) - { - return type.IsAbstract; - } - - public static bool IsInterface(Type type) - { - return type.IsInterface; - } - - public static bool IsGenericType(Type type) - { - return type.IsGenericType; - } - - public static bool IsValueType(Type type) - { - return type.IsValueType; - } - - public static bool IsEnum(Type type) - { - return type.IsEnum; - } - - public static bool HasParameterlessConstructor(Type type) - { - if (IsValueType(type) || GetParameterlessConstructor(type) != null) - return true; - return false; - } - - public static ConstructorInfo GetParameterlessConstructor(Type type) - { - ConstructorInfo[] constructors = type.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); - - foreach (var constructor in constructors) - if (constructor.GetParameters().Length == 0) - return constructor; - return null; - } - - public static string GetShortAssemblyQualifiedName(Type type) - { - if (IsPrimitive(type)) - return type.ToString(); - return type.FullName + "," + type.Assembly.GetName().Name; - } - - public static PropertyInfo GetProperty(Type type, string propertyName) - { - var property = type.GetProperty(propertyName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); - if (property == null && BaseType(type) != typeof(object)) - return GetProperty(BaseType(type), propertyName); - return property; - } - - public static FieldInfo GetField(Type type, string fieldName) - { - var field = type.GetField(fieldName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); - if (field == null && BaseType(type) != typeof(object)) - return GetField(BaseType(type), fieldName); - return field; - } - - public static MethodInfo[] GetMethods(Type type, string methodName) - { - return type.GetMethods().Where(t => t.Name == methodName).ToArray(); - } - - public static bool IsPrimitive(Type type) - { - return type.IsPrimitive || type == typeof(string) || type == typeof(decimal); - } - - public static bool AttributeIsDefined(MemberInfo info, Type attributeType) - { - return Attribute.IsDefined(info, attributeType, true); - } - - public static bool AttributeIsDefined(Type type, Type attributeType) - { - return type.IsDefined(attributeType, true); - } - - public static bool ImplementsInterface(Type type, Type interfaceType) - { - return type.GetInterface(interfaceType.Name) != null; - } - - public static Type BaseType(Type type) - { - return type.BaseType; - } - - public static Type GetType(string typeString) - { - switch (typeString) - { - case "bool": - return typeof(bool); - case "byte": - return typeof(byte); - case "sbyte": - return typeof(sbyte); - case "char": - return typeof(char); - case "decimal": - return typeof(decimal); - case "double": - return typeof(double); - case "float": - return typeof(float); - case "int": - return typeof(int); - case "uint": - return typeof(uint); - case "long": - return typeof(long); - case "ulong": - return typeof(ulong); - case "short": - return typeof(short); - case "ushort": - return typeof(ushort); - case "string": - return typeof(string); - case "Vector2": - return typeof(Vector2); - case "Vector3": - return typeof(Vector3); - case "Vector4": - return typeof(Vector4); - case "Color": - return typeof(Color); - case "Transform": - return typeof(Transform); - case "Component": - return typeof(Component); - case "GameObject": - return typeof(GameObject); - case "MeshFilter": - return typeof(MeshFilter); - case "Material": - return typeof(Material); - case "Texture2D": - return typeof(Texture2D); - case "UnityEngine.Object": - return typeof(Object); - case "System.Object": - return typeof(object); - default: - return Type.GetType(typeString); - } - } - - public static string GetTypeString(Type type) - { - if (type == typeof(bool)) - return "bool"; - if (type == typeof(byte)) - return "byte"; - if (type == typeof(sbyte)) - return "sbyte"; - if (type == typeof(char)) - return "char"; - if (type == typeof(decimal)) - return "decimal"; - if (type == typeof(double)) - return "double"; - if (type == typeof(float)) - return "float"; - if (type == typeof(int)) - return "int"; - if (type == typeof(uint)) - return "uint"; - if (type == typeof(long)) - return "long"; - if (type == typeof(ulong)) - return "ulong"; - if (type == typeof(short)) - return "short"; - if (type == typeof(ushort)) - return "ushort"; - if (type == typeof(string)) - return "string"; - if (type == typeof(Vector2)) - return "Vector2"; - if (type == typeof(Vector3)) - return "Vector3"; - if (type == typeof(Vector4)) - return "Vector4"; - if (type == typeof(Color)) - return "Color"; - if (type == typeof(Transform)) - return "Transform"; - if (type == typeof(Component)) - return "Component"; - if (type == typeof(GameObject)) - return "GameObject"; - if (type == typeof(MeshFilter)) - return "MeshFilter"; - if (type == typeof(Material)) - return "Material"; - if (type == typeof(Texture2D)) - return "Texture2D"; - if (type == typeof(Object)) - return "UnityEngine.Object"; - if (type == typeof(object)) - return "System.Object"; - return GetShortAssemblyQualifiedName(type); - } -#endif - - /* - * Allows us to use FieldInfo and PropertyInfo interchangably. - */ - public struct ES3ReflectedMember - { - // The FieldInfo or PropertyInfo for this field. - private readonly FieldInfo fieldInfo; - private readonly PropertyInfo propertyInfo; - public bool isProperty; - - public bool IsNull { get { return fieldInfo == null && propertyInfo == null; } } - public string Name { get { return isProperty ? propertyInfo.Name : fieldInfo.Name; } } - public Type MemberType { get { return isProperty ? propertyInfo.PropertyType : fieldInfo.FieldType; } } - public bool IsPublic { get { return isProperty ? propertyInfo.GetGetMethod(true).IsPublic && propertyInfo.GetSetMethod(true).IsPublic : fieldInfo.IsPublic; } } - public bool IsProtected { get { return isProperty ? propertyInfo.GetGetMethod(true).IsFamily : fieldInfo.IsFamily; } } - public bool IsStatic { get { return isProperty ? propertyInfo.GetGetMethod(true).IsStatic : fieldInfo.IsStatic; } } - - public ES3ReflectedMember(object fieldPropertyInfo) - { - if (fieldPropertyInfo == null) - { - propertyInfo = null; - fieldInfo = null; - isProperty = false; - return; - } - - isProperty = IsAssignableFrom(typeof(PropertyInfo), fieldPropertyInfo.GetType()); - if (isProperty) - { - propertyInfo = (PropertyInfo)fieldPropertyInfo; - fieldInfo = null; - } - else - { - fieldInfo = (FieldInfo)fieldPropertyInfo; - propertyInfo = null; - } - } - - public void SetValue(object obj, object value) - { - if (isProperty) - propertyInfo.SetValue(obj, value, null); - else - fieldInfo.SetValue(obj, value); - } - - public object GetValue(object obj) - { - if (isProperty) - return propertyInfo.GetValue(obj, null); - return fieldInfo.GetValue(obj); - } - } - - public class ES3ReflectedMethod - { - private readonly MethodInfo method; - - public ES3ReflectedMethod(Type type, string methodName, Type[] genericParameters, Type[] parameterTypes) - { - var nonGenericMethod = type.GetMethod(methodName, parameterTypes); - method = nonGenericMethod.MakeGenericMethod(genericParameters); - } - - public ES3ReflectedMethod(Type type, string methodName, Type[] genericParameters, Type[] parameterTypes, BindingFlags bindingAttr) - { - var nonGenericMethod = type.GetMethod(methodName, bindingAttr, null, parameterTypes, null); - method = nonGenericMethod.MakeGenericMethod(genericParameters); - } - - public object Invoke(object obj, object[] parameters = null) - { - return method.Invoke(obj, parameters); - } - } - - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3Reflection.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/ES3Reflection.cs.meta deleted file mode 100644 index e8d30de..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3Reflection.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 499c212fb9e3c410dacca179f55ba150 -timeCreated: 1499764821 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3SerializableDictionary.cs b/Assets/Plugins/Easy Save 3/Scripts/ES3SerializableDictionary.cs deleted file mode 100644 index 81ac0ca..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3SerializableDictionary.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace ES3Internal -{ - [Serializable] - public abstract class ES3SerializableDictionary : Dictionary, ISerializationCallbackReceiver - { - [SerializeField] - private List _Keys; - [SerializeField] - private List _Values; - - public void OnBeforeSerialize() - { - _Keys = new List(); - _Values = new List(); - foreach (KeyValuePair pair in this) - { - try - { - _Keys.Add(pair.Key); - _Values.Add(pair.Value); - } - catch {} - } - } - - // load dictionary from lists - public void OnAfterDeserialize() - { - // There are some situations where Unity will not get the serialized data correctly, returning null. - // In this case we don't want to change anything, otherwise we'll lose the data entirely. - if (_Keys == null || _Values == null) - return; - - if (_Keys.Count != _Values.Count) - throw new Exception("Key count is different to value count after deserialising dictionary."); - - Clear(); - - for (int i = 0; i < _Keys.Count; i++) - { - if (_Keys[i] != null) - { - try - { - Add(_Keys[i], _Values[i]); - } - catch {} - } - } - - _Keys = null; - _Values = null; - } - - protected abstract bool KeysAreEqual(TKey a, TKey b); - protected abstract bool ValuesAreEqual(TVal a, TVal b); - - public int RemoveNullValues() - { - List nullKeys = this.Where(pair => pair.Value == null) - .Select(pair => pair.Key) - .ToList(); - foreach (var nullKey in nullKeys) - Remove(nullKey); - return nullKeys.Count; - } - - // Changes the key of a value without changing it's position in the underlying Lists. - // Mainly used in the Editor where position might otherwise change while the user is editing it. - // Returns true if a change was made. - public bool ChangeKey(TKey oldKey, TKey newKey) - { - if (KeysAreEqual(oldKey, newKey)) - return false; - - var val = this[oldKey]; - Remove(oldKey); - this[newKey] = val; - return true; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3SerializableDictionary.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/ES3SerializableDictionary.cs.meta deleted file mode 100644 index 50a99d2..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3SerializableDictionary.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 681896bd0089c4f7296b3ecbd899f44d -timeCreated: 1519132287 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3Spreadsheet.cs b/Assets/Plugins/Easy Save 3/Scripts/ES3Spreadsheet.cs deleted file mode 100644 index 3c136b6..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3Spreadsheet.cs +++ /dev/null @@ -1,303 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using ES3Internal; -using Unity.VisualScripting; -#if UNITY_VISUAL_SCRIPTING -[IncludeInSettings(true)] -#elif BOLT_VISUAL_SCRIPTING -[Ludiq.IncludeInSettings(true)] -#endif -public class ES3Spreadsheet -{ - private readonly Dictionary cells = new Dictionary(); - - private const string QUOTE = "\""; - private const char QUOTE_CHAR = '"'; - private const char COMMA_CHAR = ','; - private const char NEWLINE_CHAR = '\n'; - private const string ESCAPED_QUOTE = "\"\""; - private static readonly char[] CHARS_TO_ESCAPE = - { - ',', - '"', - '\n', - ' ' - }; - - public int ColumnCount { get; private set; } - - public int RowCount { get; private set; } - - public int GetColumnLength(int col) - { - if (col >= ColumnCount) - return 0; - - int maxRow = -1; - - foreach (var index in cells.Keys) - if (index.col == col && index.row > maxRow) - maxRow = index.row; - - return maxRow + 1; - } - - public int GetRowLength(int row) - { - if (row >= RowCount) - return 0; - - int maxCol = -1; - - foreach (var index in cells.Keys) - if (index.row == row && index.col > maxCol) - maxCol = index.col; - - return maxCol + 1; - } - - public void SetCell(int col, int row, object value) - { - var type = value.GetType(); - - // If we're writing a string, add it without formatting. - if (type == typeof(string)) - { - SetCellString(col, row, (string)value); - return; - } - - var settings = new ES3Settings(); - if (ES3Reflection.IsPrimitive(type)) - SetCellString(col, row, value.ToString()); - else - SetCellString(col, row, settings.encoding.GetString(ES3.Serialize(value, ES3TypeMgr.GetOrCreateES3Type(type)))); - - // Expand the spreadsheet if necessary. - if (col >= ColumnCount) - ColumnCount = col + 1; - if (row >= RowCount) - RowCount = row + 1; - } - - private void SetCellString(int col, int row, string value) - { - cells[new Index(col, row)] = value; - - // Expand the spreadsheet if necessary. - if (col >= ColumnCount) - ColumnCount = col + 1; - if (row >= RowCount) - RowCount = row + 1; - } - - - // Don't create non-generic version of this. Generic parameter is necessary as no type data is stored in the CSV file. - public T GetCell(int col, int row) - { - object val = GetCell(typeof(T), col, row); - - if (val == null) - return default (T); - return (T)val; - } - - public object GetCell(Type type, int col, int row) - { - string value; - - if (col >= ColumnCount || row >= RowCount) - throw new IndexOutOfRangeException("Cell (" + col + ", " + row + ") is out of bounds of spreadsheet (" + ColumnCount + ", " + RowCount + ")."); - - if (!cells.TryGetValue(new Index(col, row), out value) || value == null) - return null; - - // If we're loading a string, simply return the string value. - if (type == typeof(string)) - { - object str = value; - return str; - } - - var settings = new ES3Settings(); - return ES3.Deserialize(ES3TypeMgr.GetOrCreateES3Type(type), settings.encoding.GetBytes(value), settings); - } - - public void Load(string filePath) - { - Load(new ES3Settings(filePath)); - } - - public void Load(string filePath, ES3Settings settings) - { - Load(new ES3Settings(filePath, settings)); - } - - public void Load(ES3Settings settings) - { - Load(ES3Stream.CreateStream(settings, ES3FileMode.Read), settings); - } - - public void LoadRaw(string str) - { - Load(new MemoryStream(new ES3Settings().encoding.GetBytes(str)), new ES3Settings()); - } - - public void LoadRaw(string str, ES3Settings settings) - { - Load(new MemoryStream(settings.encoding.GetBytes(str)), settings); - } - - private void Load(Stream stream, ES3Settings settings) - { - using (var reader = new StreamReader(stream)) - { - int c_int; - char c; - string value = ""; - int col = 0; - int row = 0; - - // Read until the end of the stream. - while(true) - { - c_int = reader.Read(); - c = (char)c_int; - if (c == QUOTE_CHAR) - { - while(true) - { - c = (char)reader.Read(); - - if (c == QUOTE_CHAR) - { - // If this quote isn't escaped by another, it is the last quote, so we should stop parsing this value. - if ((char)reader.Peek() != QUOTE_CHAR) - break; - c = (char)reader.Read(); - } - value += c; - } - } - // If this is the end of a column, row, or the stream, add the value to the spreadsheet. - else if (c == COMMA_CHAR || c == NEWLINE_CHAR || c_int == -1) - { - SetCell(col, row, value); - value = ""; - if (c == COMMA_CHAR) - col++; - else if (c == NEWLINE_CHAR) - { - col = 0; - row++; - } - else - break; - } - else - value += c; - } - } - } - - public void Save(string filePath) - { - Save(new ES3Settings(filePath), false); - } - - public void Save(string filePath, ES3Settings settings) - { - Save(new ES3Settings(filePath, settings), false); - } - - public void Save(ES3Settings settings) - { - Save(settings, false); - } - - public void Save(string filePath, bool append) - { - Save(new ES3Settings(filePath), append); - } - - public void Save(string filePath, ES3Settings settings, bool append) - { - Save(new ES3Settings(filePath, settings), append); - } - - public void Save(ES3Settings settings, bool append) - { - using (var writer = new StreamWriter(ES3Stream.CreateStream(settings, append ? ES3FileMode.Append : ES3FileMode.Write))) - { - // If data already exists and we're appending, we need to prepend a newline. - if (append && ES3.FileExists(settings)) - writer.Write(NEWLINE_CHAR); - - string[,] array = ToArray(); - for (int row = 0; row < RowCount; row++) - { - if (row != 0) - writer.Write(NEWLINE_CHAR); - - for (int col = 0; col < ColumnCount; col++) - { - if (col != 0) - writer.Write(COMMA_CHAR); - - writer.Write(Escape(array[col, row])); - } - } - } - if (!append) - ES3IO.CommitBackup(settings); - } - - private static string Escape(string str, bool isAlreadyWrappedInQuotes = false) - { - if (str == "") - return "\"\""; - if (str == null) - return null; - - // Now escape any other quotes. - if (str.Contains(QUOTE)) - str = str.Replace(QUOTE, ESCAPED_QUOTE); - - // If there's chars to escape, wrap the value in quotes. - if (str.IndexOfAny(CHARS_TO_ESCAPE) > -1) - str = QUOTE + str + QUOTE; - return str; - } - - private static string Unescape(string str) - { - if (str.StartsWith(QUOTE) && str.EndsWith(QUOTE)) - { - str = str.Substring(1, str.Length - 2); - if (str.Contains(ESCAPED_QUOTE)) - str = str.Replace(ESCAPED_QUOTE, QUOTE); - } - return str; - } - - private string[,] ToArray() - { - string[,] array = new string[ColumnCount, RowCount]; - foreach (KeyValuePair cell in cells) - array[cell.Key.col, cell.Key.row] = cell.Value; - return array; - } - - protected struct Index - { - public int col; - public int row; - - public Index(int col, int row) - { - this.col = col; - this.row = row; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/ES3Spreadsheet.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/ES3Spreadsheet.cs.meta deleted file mode 100644 index ad2f748..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/ES3Spreadsheet.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: bb1f812633929432dabb61bb8de267ba -timeCreated: 1508838134 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Readers.meta b/Assets/Plugins/Easy Save 3/Scripts/Readers.meta deleted file mode 100644 index 3fce668..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Readers.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 23cb117b6fd3547afa9766976f6dbd18 -folderAsset: yes -timeCreated: 1499764821 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs b/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs deleted file mode 100644 index 6356b24..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs +++ /dev/null @@ -1,561 +0,0 @@ -using System; -using System.Globalization; -using System.IO; -using System.Text; -using ES3Types; - -namespace ES3Internal -{ - /* - * Specific ES3Reader for reading JSON data. - * - * Note: Leading & trailing whitespace is ignored whenever - * reading characters which are part of the JSON syntax, - * i.e. { } [ ] , " " : - */ - public class ES3JSONReader : ES3Reader - { - private const char endOfStreamChar = (char)65535; - - public StreamReader baseReader; - - internal ES3JSONReader(Stream stream, ES3Settings settings, bool readHeaderAndFooter = true) : base(settings, readHeaderAndFooter) - { - baseReader = new StreamReader(stream); - - // Read opening brace from file if we're loading straight from file. - if (readHeaderAndFooter) - { - try - { - SkipOpeningBraceOfFile(); - } - catch - { - Dispose(); - throw new FormatException("Cannot load from file because the data in it is not JSON data, or the data is encrypted.\nIf the save data is encrypted, please ensure that encryption is enabled when you load, and that you are using the same password used to encrypt the data."); - } - } - } - - - public override void Dispose() - { - baseReader.Dispose(); - } - - #region Property/Key Methods - - /* - * Reads the name of a property, and must be positioned (with or without whitespace) either: - * - Before the '"' of a property name. - * - Before the ',' separating properties. - * - Before the '}' or ']' terminating this list of properties. - * Can be used in conjunction with Read(ES3Type) to read a property. - */ - public override string ReadPropertyName() - { - char c = PeekCharIgnoreWhitespace(); - - // Check whether there are any properties left to read. - if (IsTerminator(c)) - return null; - if (c == ',') - ReadCharIgnoreWhitespace(); - else if (!IsQuotationMark(c)) - throw new FormatException("Expected ',' separating properties or '\"' before property name, found '" + c + "'."); - - string propertyName = Read_string(); - if (propertyName == null) - throw new FormatException("Stream isn't positioned before a property."); - - ES3Debug.Log("" + propertyName + " (reading property)", null, serializationDepth); - - // Skip the ':' seperating property and value. - ReadCharIgnoreWhitespace(':'); - - return propertyName; - } - - /* - * Reads the type data prefixed to this key. - * If ignore is true, it will return null to save the computation of converting - * the string to a Type. - */ - protected override Type ReadKeyPrefix(bool ignoreType = false) - { - StartReadObject(); - - Type dataType = null; - - string propertyName = ReadPropertyName(); - if (propertyName == ES3Type.typeFieldName) - { - string typeString = Read_string(); - dataType = ignoreType ? null : ES3Reflection.GetType(typeString); - propertyName = ReadPropertyName(); - } - - if (propertyName != "value") - throw new FormatException("This data is not Easy Save Key Value data. Expected property name \"value\", found \"" + propertyName + "\"."); - - return dataType; - } - - protected override void ReadKeySuffix() - { - EndReadObject(); - } - - - internal override bool StartReadObject() - { - base.StartReadObject(); - return ReadNullOrCharIgnoreWhitespace('{'); - } - - internal override void EndReadObject() - { - ReadCharIgnoreWhitespace('}'); - base.EndReadObject(); - } - - - internal override bool StartReadDictionary() - { - return StartReadObject(); - } - - internal override void EndReadDictionary() {} - - internal override bool StartReadDictionaryKey() - { - // If this is an empty Dictionary, return false. - if (PeekCharIgnoreWhitespace() == '}') - { - ReadCharIgnoreWhitespace(); - return false; - } - return true; - } - - internal override void EndReadDictionaryKey() - { - ReadCharIgnoreWhitespace(':'); - } - - internal override void StartReadDictionaryValue() {} - - internal override bool EndReadDictionaryValue() - { - char c = ReadCharIgnoreWhitespace(); - // If we find a ']', we reached the end of the array. - if (c == '}') - return true; - // Else, we should expect a comma. - if (c != ',') - throw new FormatException("Expected ',' seperating Dictionary items or '}' terminating Dictionary, found '" + c + "'."); - return false; - } - - - internal override bool StartReadCollection() - { - return ReadNullOrCharIgnoreWhitespace('['); - } - - internal override void EndReadCollection() {} - - internal override bool StartReadCollectionItem() - { - // If this is an empty collection, return false. - if (PeekCharIgnoreWhitespace() == ']') - { - ReadCharIgnoreWhitespace(); - return false; - } - return true; - } - - internal override bool EndReadCollectionItem() - { - char c = ReadCharIgnoreWhitespace(); - // If we find a ']', we reached the end of the array. - if (c == ']') - return true; - // Else, we should expect a comma. - if (c != ',') - throw new FormatException("Expected ',' seperating collection items or ']' terminating collection, found '" + c + "'."); - return false; - } - - #endregion - - #region Seeking Methods - - /* - * Reads a string value into a StreamWriter. - * Reader should be positioned after the opening quotation mark. - * Will also read the closing quotation mark. - * If the 'skip' parameter is true, data will not be written into a StreamWriter and will return null. - */ - private void ReadString(StreamWriter writer, bool skip = false) - { - bool endOfString = false; - // Read to end of string, or throw error if we reach end of stream. - while(!endOfString) - { - char c = ReadOrSkipChar(writer, skip); - switch (c) - { - case endOfStreamChar: - throw new FormatException("String without closing quotation mark detected."); - case '\\': - ReadOrSkipChar(writer, skip); - break; - default: - if (IsQuotationMark(c)) - endOfString = true; - break; - } - } - } - - /* - * Reads the current object in the stream. - * Stream position should be somewhere before the opening brace for the object. - * When this method successfully exits, it will be on the closing brace for the object. - * If the 'skip' parameter is true, data will not be written into a StreamWriter and will return null. - */ - internal override byte[] ReadElement(bool skip = false) - { - // If 'skip' is enabled, don't create a stream or writer as we'll discard all bytes we read. - var writer = skip ? null : new StreamWriter(new MemoryStream(settings.bufferSize)); - - using (writer) - { - int nesting = 0; - char c = (char)baseReader.Peek(); - - // Determine if we're skipping a primitive type. - // First check if it's an opening object or array brace. - if (!IsOpeningBrace(c)) - { - // If we're skipping a string, use SkipString(). - if (c == '\"') - { - // Skip initial quotation mark as SkipString() requires this. - ReadOrSkipChar(writer, skip); - ReadString(writer, skip); - } - // Else we just need to read until we reach a closing brace. - else - // While we've not peeked a closing brace. - while(!IsEndOfValue((char)baseReader.Peek())) - ReadOrSkipChar(writer, skip); - - if (skip) - return null; - writer.Flush(); - return ((MemoryStream)writer.BaseStream).ToArray(); - } - - // Else, we're skipping a type surrounded by braces. - // Iterate through every character, logging nesting. - while(true) - { - c = ReadOrSkipChar(writer, skip); - - if (c == endOfStreamChar) // Detect premature end of stream, which denotes missing closing brace. - throw new FormatException("Missing closing brace detected, as end of stream was reached before finding it."); - - // Handle quoted strings. - // According to the RFC, only '\' and '"' must be escaped in strings. - if (IsQuotationMark(c)) - { - ReadString(writer, skip); - continue; - } - - // Handle braces and other characters. - switch (c) - { - case '{': // Entered another level of nesting. - case '[': - nesting++; - break; - case '}': // Exited a level of nesting. - case ']': - nesting--; - // If nesting < 1, we've come to the end of the object. - if (nesting < 1) - { - if (skip) - return null; - writer.Flush(); - return ((MemoryStream)writer.BaseStream).ToArray(); - } - break; - } - } - } - } - - /* - * Reads the next char into a stream, or ignores it if 'skip' is true. - */ - private char ReadOrSkipChar(StreamWriter writer, bool skip) - { - char c = (char)baseReader.Read(); - if (!skip) writer.Write(c); - return c; - } - - #endregion - - #region JSON-specific methods. - - /* - * Reads a char from the stream and ignores leading and trailing whitespace. - */ - private char ReadCharIgnoreWhitespace(bool ignoreTrailingWhitespace = true) - { - char c; - // Skip leading whitespace and read char. - while(IsWhiteSpace(c = (char)baseReader.Read())) - { - } - - // Skip trailing whitespace. - if (ignoreTrailingWhitespace) - while(IsWhiteSpace((char)baseReader.Peek())) - baseReader.Read(); - - return c; - } - - /* - * Reads a char, or the NULL value, from the stream and ignores leading and trailing whitespace. - * Returns true if NULL was read. - */ - private bool ReadNullOrCharIgnoreWhitespace(char expectedChar) - { - char c = ReadCharIgnoreWhitespace(); - - // Check for null - if (c == 'n') - { - char[] chars = new char[3]; - baseReader.ReadBlock(chars, 0, 3); - if (chars[0] == 'u' && chars[1] == 'l' && chars[2] == 'l') - return true; - } - - if (c != expectedChar) - { - if (c == endOfStreamChar) - throw new FormatException("End of stream reached when expecting '" + expectedChar + "'."); - throw new FormatException("Expected \'" + expectedChar + "\' or \"null\", found \'" + c + "\'."); - } - return false; - } - - /* - * Reads a char from the stream and ignores leading and trailing whitespace. - * Throws an error if the char isn't equal to the one specificed as a parameter, or if it's the end of stream. - */ - private char ReadCharIgnoreWhitespace(char expectedChar) - { - char c = ReadCharIgnoreWhitespace(); - if (c != expectedChar) - { - if (c == endOfStreamChar) - throw new FormatException("End of stream reached when expecting '" + expectedChar + "'."); - throw new FormatException("Expected \'" + expectedChar + "\', found \'" + c + "\'."); - } - return c; - } - - private bool ReadQuotationMarkOrNullIgnoreWhitespace() - { - char c = ReadCharIgnoreWhitespace(false); // Don't read trailing whitespace as this is the value. - - if (c == 'n') - { - char[] chars = new char[3]; - baseReader.ReadBlock(chars, 0, 3); - if (chars[0] == 'u' && chars[1] == 'l' && chars[2] == 'l') - return true; - } - else if (!IsQuotationMark(c)) - { - if (c == endOfStreamChar) - throw new FormatException("End of stream reached when expecting quotation mark."); - throw new FormatException("Expected quotation mark, found \'" + c + "\'."); - } - return false; - } - - /* - * Peeks the next char in the stream, ignoring leading whitespace, but not trailing whitespace. - */ - private char PeekCharIgnoreWhitespace(char expectedChar) - { - char c = PeekCharIgnoreWhitespace(); - if (c != expectedChar) - { - if (c == endOfStreamChar) - throw new FormatException("End of stream reached while peeking, when expecting '" + expectedChar + "'."); - throw new FormatException("Expected \'" + expectedChar + "\', found \'" + c + "\'."); - } - return c; - } - - /* - * Peeks the next char in the stream, ignoring leading whitespace, but not trailing whitespace. - * Throws an error if the char isn't equal to the one specificed as a parameter. - */ - private char PeekCharIgnoreWhitespace() - { - char c; - // Skip leading whitespace and read char. - while(IsWhiteSpace(c = (char)baseReader.Peek())) - baseReader.Read(); - return c; - } - - // Skips all whitespace immediately after the current position. - private void SkipWhiteSpace() - { - while(IsWhiteSpace((char)baseReader.Peek())) - baseReader.Read(); - } - - private void SkipOpeningBraceOfFile() - { - // Skip the whitespace and '{' at the beginning of the JSON file. - char firstChar = ReadCharIgnoreWhitespace(); - if (firstChar != '{') // If first char isn't '{', it's not valid JSON. - throw new FormatException("File is not valid JSON. Expected '{' at beginning of file, but found '" + firstChar + "'."); - } - - private static bool IsWhiteSpace(char c) - { - return c == ' ' || c == '\t' || c == '\n' || c == '\r'; - } - - private static bool IsOpeningBrace(char c) - { - return c == '{' || c == '['; - } - - private static bool IsEndOfValue(char c) - { - return c == '}' || c == ' ' || c == '\t' || c == ']' || c == ',' || c == ':' || c == endOfStreamChar || c == '\n' || c == '\r'; - } - - private static bool IsTerminator(char c) - { - return c == '}' || c == ']'; - } - - private static bool IsQuotationMark(char c) - { - return c == '\"' || c == '“' || c == '”'; - } - - private static bool IsEndOfStream(char c) - { - return c == endOfStreamChar; - } - - /* - * Reads a value (i.e. non-string, non-object) from the stream as a string. - * Used mostly in Read_[type]() methods. - */ - private string GetValueString() - { - var builder = new StringBuilder(); - - while(!IsEndOfValue(PeekCharIgnoreWhitespace())) - builder.Append((char)baseReader.Read()); - - // If it's an empty value, return null. - if (builder.Length == 0) - return null; - return builder.ToString(); - } - - #endregion - - #region Primitive Read() Methods. - - internal override string Read_string() - { - if (ReadQuotationMarkOrNullIgnoreWhitespace()) - return null; - char c; - - var sb = new StringBuilder(); - - while(!IsQuotationMark(c = (char)baseReader.Read())) - { - // If escape mark is found, generate correct escaped character. - if (c == '\\') - { - c = (char)baseReader.Read(); - if (IsEndOfStream(c)) - throw new FormatException("Reached end of stream while trying to read string literal."); - - switch (c) - { - case 'b': - c = '\b'; - break; - case 'f': - c = '\f'; - break; - case 'n': - c = '\n'; - break; - case 'r': - c = '\r'; - break; - case 't': - c = '\t'; - break; - } - } - sb.Append(c); - } - return sb.ToString(); - } - - internal override long Read_ref() - { - if (ES3ReferenceMgrBase.Current == null) - throw new InvalidOperationException("An Easy Save 3 Manager is required to load references. To add one to your scene, exit playmode and go to Tools > Easy Save 3 > Add Manager to Scene"); - if (IsQuotationMark(PeekCharIgnoreWhitespace())) - return long.Parse(Read_string()); - return Read_long(); - } - - internal override char Read_char() { return char.Parse(Read_string()); } - internal override float Read_float() { return float.Parse(GetValueString(), CultureInfo.InvariantCulture); } - internal override int Read_int() { return int.Parse(GetValueString()); } - internal override bool Read_bool() { return bool.Parse(GetValueString()); } - internal override decimal Read_decimal() { return decimal.Parse(GetValueString(), CultureInfo.InvariantCulture); } - internal override double Read_double() { return double.Parse(GetValueString(), CultureInfo.InvariantCulture); } - internal override long Read_long() { return long.Parse(GetValueString()); } - internal override ulong Read_ulong() { return ulong.Parse(GetValueString()); } - internal override uint Read_uint() { return uint.Parse(GetValueString()); } - internal override byte Read_byte() { return (byte)int.Parse(GetValueString()); } - internal override sbyte Read_sbyte() { return (sbyte)int.Parse(GetValueString()); } - internal override short Read_short() { return (short)int.Parse(GetValueString()); } - internal override ushort Read_ushort() { return (ushort)int.Parse(GetValueString()); } - - internal override byte[] Read_byteArray() { return Convert.FromBase64String(Read_string()); } - - #endregion - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs.meta deleted file mode 100644 index 663a6bb..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8757682770a6c4537a3dcbed278277bc -timeCreated: 1499764822 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs b/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs deleted file mode 100644 index b04c2dc..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs +++ /dev/null @@ -1,456 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.IO; -using ES3Internal; -using ES3Types; -public abstract class ES3Reader : IDisposable -{ - - // If this is not null, the next call to the Properties will return this name. - internal string overridePropertiesName; - - protected int serializationDepth; - /// The settings used to create this reader. - public ES3Settings settings; - - internal ES3Reader(ES3Settings settings, bool readHeaderAndFooter = true) - { - this.settings = settings; - } - /// Allows you to enumerate over each field name. This should only be used within an ES3Type file. - public virtual ES3ReaderPropertyEnumerator Properties - { - get - { - return new ES3ReaderPropertyEnumerator(this); - } - } - - internal virtual ES3ReaderRawEnumerator RawEnumerator - { - get - { - return new ES3ReaderRawEnumerator(this); - } - } - - /* - * Skips the current object in the stream. - * Stream position should be somewhere before the opening brace for the object. - * When this method successfully exits, it will be on the closing brace for the object. - */ - /// Skips the current object in the stream. - [EditorBrowsable(EditorBrowsableState.Never)] - public virtual void Skip() - { - ReadElement(true); - } - - /// Reads a value of type T from the reader. - public virtual T Read() - { - return Read(ES3TypeMgr.GetOrCreateES3Type(typeof(T))); - } - - /// Reads a value of type T from the reader into an existing object. - /// The object we want to read our value into. - public virtual void ReadInto(object obj) - { - ReadInto(obj, ES3TypeMgr.GetOrCreateES3Type(typeof(T))); - } - - /// - /// Reads a property (i.e. a property name and value) from the reader, ignoring the property name and only - /// returning the value. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public T ReadProperty() - { - return ReadProperty(ES3TypeMgr.GetOrCreateES3Type(typeof(T))); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public T ReadProperty(ES3Type type) - { - ReadPropertyName(); - return Read(type); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public long ReadRefProperty() - { - ReadPropertyName(); - return Read_ref(); - } - - internal Type ReadType() - { - return ES3Reflection.GetType(Read(ES3Type_string.Instance)); - } - - /// Sets the value of a private property on an object. - /// The name of the property we want to set. - /// The value we want to set the property to. - /// The object containing the property we want to set. - /// - /// The objectContainingProperty object. This is helpful if you're setting a private property on a struct or other - /// immutable type and need to return the boxed value. - /// - public object SetPrivateProperty(string name, object value, object objectContainingProperty) - { - var property = ES3Reflection.GetES3ReflectedProperty(objectContainingProperty.GetType(), name); - if (property.IsNull) - throw new MissingMemberException("A private property named " + name + " does not exist in the type " + objectContainingProperty.GetType()); - property.SetValue(objectContainingProperty, value); - return objectContainingProperty; - } - - /// Sets the value of a private field on an object. - /// The name of the field we want to set. - /// The value we want to set the field to. - /// The object containing the field we want to set. - /// - /// The objectContainingField object. This is helpful if you're setting a private property on a struct or other - /// immutable type and need to return the boxed value. - /// - public object SetPrivateField(string name, object value, object objectContainingField) - { - var field = ES3Reflection.GetES3ReflectedMember(objectContainingField.GetType(), name); - if (field.IsNull) - throw new MissingMemberException("A private field named " + name + " does not exist in the type " + objectContainingField.GetType()); - field.SetValue(objectContainingField, value); - return objectContainingField; - } - [EditorBrowsable(EditorBrowsableState.Never)] - internal Type ReadTypeFromHeader() - { - // Check whether we need to determine the type by reading the header. - if (typeof(T) == typeof(object)) - return ReadKeyPrefix(); - if (settings.typeChecking) - { - var type = ReadKeyPrefix(); - if (type != typeof(T)) - throw new InvalidOperationException("Trying to load data of type " + typeof(T) + ", but data contained in file is type of " + type + "."); - return type; - } - ReadKeyPrefix(true); - return typeof(T); - } - - /// Creates a new ES3Reader and loads the default file into it. - public static ES3Reader Create() - { - return Create(new ES3Settings()); - } - - /// Creates a new ES3Reader and loads a file in storage into it. - /// The relative or absolute path of the file we want to load into the reader. - public static ES3Reader Create(string filePath) - { - return Create(new ES3Settings(filePath)); - } - - /// Creates a new ES3Reader and loads a file in storage into it. - /// The relative or absolute path of the file we want to load into the reader. - /// The settings we want to use to override the default settings. - public static ES3Reader Create(string filePath, ES3Settings settings) - { - return Create(new ES3Settings(filePath, settings)); - } - - /// Creates a new ES3Reader and loads a file in storage into it. - /// The settings we want to use to override the default settings. - public static ES3Reader Create(ES3Settings settings) - { - var stream = ES3Stream.CreateStream(settings, ES3FileMode.Read); - if (stream == null) - return null; - - // Get the baseWriter using the given Stream. - if (settings.format == ES3.Format.JSON) - return new ES3JSONReader(stream, settings); - return null; - } - - /// Creates a new ES3Reader and loads the bytes provided into it. - public static ES3Reader Create(byte[] bytes) - { - return Create(bytes, new ES3Settings()); - } - - /// Creates a new ES3Reader and loads the bytes provided into it. - /// The settings we want to use to override the default settings. - public static ES3Reader Create(byte[] bytes, ES3Settings settings) - { - var stream = ES3Stream.CreateStream(new MemoryStream(bytes), settings, ES3FileMode.Read); - if (stream == null) - return null; - - // Get the baseWriter using the given Stream. - if (settings.format == ES3.Format.JSON) - return new ES3JSONReader(stream, settings); - return null; - } - - internal static ES3Reader Create(Stream stream, ES3Settings settings) - { - stream = ES3Stream.CreateStream(stream, settings, ES3FileMode.Read); - - // Get the baseWriter using the given Stream. - if (settings.format == ES3.Format.JSON) - return new ES3JSONReader(stream, settings); - return null; - } - - internal static ES3Reader Create(Stream stream, ES3Settings settings, bool readHeaderAndFooter) - { - // Get the baseWriter using the given Stream. - if (settings.format == ES3.Format.JSON) - return new ES3JSONReader(stream, settings, readHeaderAndFooter); - return null; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public class ES3ReaderPropertyEnumerator - { - public ES3Reader reader; - - public ES3ReaderPropertyEnumerator(ES3Reader reader) - { - this.reader = reader; - } - - public IEnumerator GetEnumerator() - { - string propertyName; - while(true) - { - // Allows us to repeat a property name or insert one of our own. - if (reader.overridePropertiesName != null) - { - string tempName = reader.overridePropertiesName; - reader.overridePropertiesName = null; - yield return tempName; - } - else - { - if ((propertyName = reader.ReadPropertyName()) == null) - yield break; - yield return propertyName; - } - } - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public class ES3ReaderRawEnumerator - { - public ES3Reader reader; - - public ES3ReaderRawEnumerator(ES3Reader reader) - { - this.reader = reader; - } - - public IEnumerator GetEnumerator() - { - while(true) - { - string key = reader.ReadPropertyName(); - if (key == null) - yield break; - - var type = reader.ReadTypeFromHeader(); - - byte[] bytes = reader.ReadElement(); - - reader.ReadKeySuffix(); - - if (type != null) - yield return new KeyValuePair(key, new ES3Data(type, bytes)); - } - } - } - - #region ES3Reader Abstract Methods - - internal abstract int Read_int(); - internal abstract float Read_float(); - internal abstract bool Read_bool(); - internal abstract char Read_char(); - internal abstract decimal Read_decimal(); - internal abstract double Read_double(); - internal abstract long Read_long(); - internal abstract ulong Read_ulong(); - internal abstract byte Read_byte(); - internal abstract sbyte Read_sbyte(); - internal abstract short Read_short(); - internal abstract ushort Read_ushort(); - internal abstract uint Read_uint(); - internal abstract string Read_string(); - internal abstract byte[] Read_byteArray(); - internal abstract long Read_ref(); - - [EditorBrowsable(EditorBrowsableState.Never)] - public abstract string ReadPropertyName(); - - protected abstract Type ReadKeyPrefix(bool ignore = false); - protected abstract void ReadKeySuffix(); - internal abstract byte[] ReadElement(bool skip = false); - - /// Disposes of the reader and it's underlying stream. - public abstract void Dispose(); - - // Seeks to the given key. Note that the stream position will not be reset. - internal virtual bool Goto(string key) - { - if (key == null) - throw new ArgumentNullException("Key cannot be NULL when loading data."); - - string currentKey; - while((currentKey = ReadPropertyName()) != key) - { - if (currentKey == null) - return false; - Skip(); - } - return true; - } - - internal virtual bool StartReadObject() - { - serializationDepth++; - return false; - } - - internal virtual void EndReadObject() - { - serializationDepth--; - } - - internal abstract bool StartReadDictionary(); - internal abstract void EndReadDictionary(); - internal abstract bool StartReadDictionaryKey(); - internal abstract void EndReadDictionaryKey(); - internal abstract void StartReadDictionaryValue(); - internal abstract bool EndReadDictionaryValue(); - - internal abstract bool StartReadCollection(); - internal abstract void EndReadCollection(); - internal abstract bool StartReadCollectionItem(); - internal abstract bool EndReadCollectionItem(); - - #endregion - - #region Read(key) & Read(key, obj) methods - - /// Reads a value from the reader with the given key. - /// The key which uniquely identifies our value. - public virtual T Read(string key) - { - if (!Goto(key)) - throw new KeyNotFoundException("Key \"" + key + "\" was not found in file \"" + settings.FullPath + "\". Use Load(key, defaultValue) if you want to return a default value if the key does not exist."); - - var type = ReadTypeFromHeader(); - - var obj = Read(ES3TypeMgr.GetOrCreateES3Type(type)); - - //ReadKeySuffix(); //No need to read key suffix as we're returning. Doing so would throw an error at this point for BinaryReaders. - return obj; - } - - /// Reads a value from the reader with the given key, returning the default value if the key does not exist. - /// The key which uniquely identifies our value. - /// The value we want to return if this key does not exist in the reader. - public virtual T Read(string key, T defaultValue) - { - if (!Goto(key)) - return defaultValue; - - var type = ReadTypeFromHeader(); - var obj = Read(ES3TypeMgr.GetOrCreateES3Type(type)); - - //ReadKeySuffix(); //No need to read key suffix as we're returning. Doing so would throw an error at this point for BinaryReaders. - return obj; - } - - /// Reads a value from the reader with the given key into the provided object. - /// The key which uniquely identifies our value. - /// The object we want to load the value into. - public virtual void ReadInto(string key, T obj) where T : class - { - if (!Goto(key)) - throw new KeyNotFoundException("Key \"" + key + "\" was not found in file \"" + settings.FullPath + "\""); - - var type = ReadTypeFromHeader(); - - ReadInto(obj, ES3TypeMgr.GetOrCreateES3Type(type)); - - //ReadKeySuffix(); //No need to read key suffix as we're returning. Doing so would throw an error at this point for BinaryReaders. - } - - protected virtual void ReadObject(object obj, ES3Type type) - { - // Check for null. - if (StartReadObject()) - return; - - type.ReadInto(this, obj); - - EndReadObject(); - } - - protected virtual T ReadObject(ES3Type type) - { - if (StartReadObject()) - return default (T); - - object obj = type.Read(this); - - EndReadObject(); - return (T)obj; - } - - #endregion - - #region Read(ES3Type) & Read(obj,ES3Type) methods - - /* - * Parses the next JSON Object in the stream (i.e. must be between '{' and '}' chars). - * If the first character in the Stream is not a '{', it will throw an error. - * Will also read the terminating '}'. - * If we have reached the end of stream, it will return null. - */ - [EditorBrowsable(EditorBrowsableState.Never)] - public virtual T Read(ES3Type type) - { - if (type == null || type.isUnsupported) - throw new NotSupportedException("Type of " + type + " is not currently supported, and could not be loaded using reflection."); - if (type.isPrimitive) - return (T)type.Read(this); - if (type.isCollection) - return (T)((ES3CollectionType)type).Read(this); - if (type.isDictionary) - return (T)((ES3DictionaryType)type).Read(this); - return ReadObject(type); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public virtual void ReadInto(object obj, ES3Type type) - { - if (type == null || type.isUnsupported) - throw new NotSupportedException("Type of " + obj.GetType() + " is not currently supported, and could not be loaded using reflection."); - - if (type.isCollection) - ((ES3CollectionType)type).ReadInto(this, obj); - else if (type.isDictionary) - ((ES3DictionaryType)type).ReadInto(this, obj); - else - ReadObject(obj, type); - } - - #endregion -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs.meta deleted file mode 100644 index 48dcb67..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f511cfa2663a045aeac7dfe13754efba -timeCreated: 1519132300 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3XMLReader.cs b/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3XMLReader.cs deleted file mode 100644 index c2877e9..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3XMLReader.cs +++ /dev/null @@ -1,4 +0,0 @@ -public class ES3XMLReader -{ - // Not Implemented -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3XMLReader.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3XMLReader.cs.meta deleted file mode 100644 index b824bde..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Readers/ES3XMLReader.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 2ef972c40e0163f4c873b7e18c0e24fb -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Referencing.meta b/Assets/Plugins/Easy Save 3/Scripts/Referencing.meta deleted file mode 100644 index 54e00d8..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Referencing.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7aae016e8c4b7924290cd0904f1509b5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Referencing/ES3GlobalReferences.cs b/Assets/Plugins/Easy Save 3/Scripts/Referencing/ES3GlobalReferences.cs deleted file mode 100644 index 2b7d23a..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Referencing/ES3GlobalReferences.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel; -using UnityEditor; -using UnityEngine; - -namespace ES3Internal -{ - public class ES3GlobalReferences : ScriptableObject - { -#if !UNITY_EDITOR || ES3GLOBAL_DISABLED - public static ES3GlobalReferences Instance{ get{ return null; } } - public UnityEngine.Object Get(long id){return null;} - public long GetOrAdd(UnityEngine.Object obj){return -1;} - public void RemoveInvalidKeys(){} -#else - -#if ES3GLOBAL_DISABLED - private static bool useGlobalReferences = false; -#else - private static readonly bool useGlobalReferences = true; -#endif - - private const string globalReferencesPath = "ES3/ES3GlobalReferences"; - - [EditorBrowsable(EditorBrowsableState.Never)] - public ES3RefIdDictionary refId = new ES3RefIdDictionary(); - - private static ES3GlobalReferences _globalReferences; - public static ES3GlobalReferences Instance - { - get - { - if (Application.isPlaying) - return null; - - if (!useGlobalReferences) - return null; - - if (_globalReferences == null) - { - _globalReferences = Resources.Load(globalReferencesPath); - - if (_globalReferences == null) - { - _globalReferences = CreateInstance(); - - // If this is the version being submitted to the Asset Store, don't include ES3Defaults. - if (Application.productName.Contains("ES3 Release")) - { - Debug.Log("This has been identified as a release build as the title contains 'ES3 Release', so ES3GlobalReferences will not be created."); - return _globalReferences; - } - - ES3Settings.CreateDefaultSettingsFolder(); - AssetDatabase.CreateAsset(_globalReferences, PathToGlobalReferences()); - AssetDatabase.SaveAssets(); - } - - } - - return _globalReferences; - } - } - - private long Get(Object obj) - { - if (obj == null) - return -1; - - long id; - if (!refId.TryGetValue(obj, out id)) - return -1; - return id; - } - - public Object Get(long id) - { - foreach (KeyValuePair kvp in refId) - if (kvp.Value == id) - return kvp.Key; - return null; - } - - public void RemoveInvalidKeys() - { - var newRefId = new ES3RefIdDictionary(); - foreach (KeyValuePair kvp in refId) - { - var obj = kvp.Key; - if (obj == null) - continue; - - if ((obj.hideFlags & HideFlags.DontSave) == HideFlags.DontSave || - (obj.hideFlags & HideFlags.DontSaveInBuild) == HideFlags.DontSaveInBuild || - (obj.hideFlags & HideFlags.DontSaveInEditor) == HideFlags.DontSaveInEditor || - (obj.hideFlags & HideFlags.HideAndDontSave) == HideFlags.HideAndDontSave) - { - var type = obj.GetType(); - // Meshes are marked with HideAndDontSave, but shouldn't be ignored. - if (type != typeof(Mesh) && type != typeof(Material)) - continue; - } - newRefId[obj] = kvp.Value; - } - refId = newRefId; - } - - public long GetOrAdd(Object obj) - { - long id = Get(obj); - - // Only add items to global references when it's not playing. - if (!Application.isPlaying && id == -1 && AssetDatabase.Contains(obj) && ES3ReferenceMgrBase.CanBeSaved(obj)) - { - id = ES3ReferenceMgrBase.GetNewRefID(); - refId.Add(obj, id); - - EditorUtility.SetDirty(this); - } - - return id; - } - - private static string PathToGlobalReferences() - { - return ES3Settings.PathToEasySaveFolder() + "Resources/" + globalReferencesPath + ".asset"; - } -#endif - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Referencing/ES3GlobalReferences.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Referencing/ES3GlobalReferences.cs.meta deleted file mode 100644 index 591df09..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Referencing/ES3GlobalReferences.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e6b16dc7c203450459bb86e24305f9ca -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Settings.meta b/Assets/Plugins/Easy Save 3/Scripts/Settings.meta deleted file mode 100644 index 034ed77..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Settings.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 6c350197e0cac40839770b990d43d828 -folderAsset: yes -timeCreated: 1499765763 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3DefaultSettings.cs b/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3DefaultSettings.cs deleted file mode 100644 index 9181d75..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3DefaultSettings.cs +++ /dev/null @@ -1,12 +0,0 @@ -using UnityEngine; - -namespace ES3Internal -{ - public class ES3DefaultSettings : MonoBehaviour - { - [SerializeField] - public ES3SerializableSettings settings; - - public bool autoUpdateReferences = true; - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3DefaultSettings.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3DefaultSettings.cs.meta deleted file mode 100644 index 5cb6de2..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3DefaultSettings.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c6d233887d0c64d7e8f3ebcb39bc8c82 -timeCreated: 1519132296 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3Defaults.cs b/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3Defaults.cs deleted file mode 100644 index 7870e39..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3Defaults.cs +++ /dev/null @@ -1,21 +0,0 @@ -using UnityEngine; -public class ES3Defaults : ScriptableObject -{ - [SerializeField] - public ES3SerializableSettings settings = new ES3SerializableSettings(); - - public bool addMgrToSceneAutomatically; - public bool autoUpdateReferences = true; - public bool addAllPrefabsToManager = true; - public int collectDependenciesDepth = 4; - public int collectDependenciesTimeout = 10; - public bool updateReferencesWhenSceneChanges = true; - public bool updateReferencesWhenSceneIsSaved = true; - public bool updateReferencesWhenSceneIsOpened = true; - [Tooltip("Folders listed here will be searched for references every time the reference manager is refreshed. Path should be relative to the project folder.")] - public string[] referenceFolders = new string[0]; - - public bool logDebugInfo; - public bool logWarnings = true; - public bool logErrors = true; -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3Defaults.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3Defaults.cs.meta deleted file mode 100644 index 4a6af3f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3Defaults.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7b340139c9e4d054f904d8b452798652 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3Settings.cs b/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3Settings.cs deleted file mode 100644 index 40773fb..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3Settings.cs +++ /dev/null @@ -1,424 +0,0 @@ -using System; -using System.ComponentModel; -using System.IO; -using System.Text; -using ES3Internal; -using Unity.VisualScripting; -using UnityEngine; -#if UNITY_EDITOR -using UnityEditor; -#endif - -#if UNITY_VISUAL_SCRIPTING -[IncludeInSettings(true)] -#elif BOLT_VISUAL_SCRIPTING -[Ludiq.IncludeInSettings(true)] -#endif -public class ES3Settings : ICloneable -{ - - #region Default settings - - private static ES3Settings _defaults; - private static ES3Defaults _defaultSettingsScriptableObject; - private const string defaultSettingsPath = "ES3/ES3Defaults"; - - public static ES3Defaults defaultSettingsScriptableObject - { - get - { - if (_defaultSettingsScriptableObject == null) - { - _defaultSettingsScriptableObject = Resources.Load(defaultSettingsPath); - -#if UNITY_EDITOR - if (_defaultSettingsScriptableObject == null) - { - _defaultSettingsScriptableObject = ScriptableObject.CreateInstance(); - - // If this is the version being submitted to the Asset Store, don't include ES3Defaults. - if (Application.productName.Contains("ES3 Release")) - { - Debug.Log("This has been identified as a release build as the title contains 'ES3 Release', so ES3Defaults will not be created."); - return _defaultSettingsScriptableObject; - } - - // Convert the old settings to the new settings if necessary. - var oldSettings = GetOldSettings(); - if (oldSettings != null) - { - oldSettings.CopyInto(_defaultSettingsScriptableObject.settings); - // Only enable warning logs by default for new installs as this may look like unexpected behaviour to some. - _defaultSettingsScriptableObject.logWarnings = false; - RemoveOldSettings(); - } - - CreateDefaultSettingsFolder(); - AssetDatabase.CreateAsset(_defaultSettingsScriptableObject, PathToDefaultSettings()); - AssetDatabase.SaveAssets(); - } -#endif - } - return _defaultSettingsScriptableObject; - } - } - - public static ES3Settings defaultSettings - { - get - { - if (_defaults == null) - { - if (defaultSettingsScriptableObject != null) - _defaults = defaultSettingsScriptableObject.settings; - } - return _defaults; - } - } - - private static ES3Settings _unencryptedUncompressedSettings; - internal static ES3Settings unencryptedUncompressedSettings - { - get - { - if (_unencryptedUncompressedSettings == null) - _unencryptedUncompressedSettings = new ES3Settings(ES3.EncryptionType.None, ES3.CompressionType.None); - return _unencryptedUncompressedSettings; - } - } - - #endregion - - #region Fields - - private static readonly string[] resourcesExtensions = - { - ".txt", - ".htm", - ".html", - ".xml", - ".bytes", - ".json", - ".csv", - ".yaml", - ".fnt" - }; - - [SerializeField] - private ES3.Location _location; - /// - /// The location where we wish to store data. As it's not possible to save/load from File in WebGL, if the default - /// location is File it will use PlayerPrefs instead. - /// - public ES3.Location location - { - get - { - if (_location == ES3.Location.File && (Application.platform == RuntimePlatform.WebGLPlayer || Application.platform == RuntimePlatform.tvOS)) - return ES3.Location.PlayerPrefs; - return _location; - } - set { _location = value; } - } - - /// The path associated with this ES3Settings object, if any. - public string path = "SaveFile.es3"; - /// The type of encryption to use when encrypting data, if any. - public ES3.EncryptionType encryptionType = ES3.EncryptionType.None; - /// The type of encryption to use when encrypting data, if any. - public ES3.CompressionType compressionType = ES3.CompressionType.None; - /// The password to use when encrypting data. - public string encryptionPassword = "password"; - /// The default directory in which to store files, and the location which relative paths should be relative to. - public ES3.Directory directory = ES3.Directory.PersistentDataPath; - /// What format to use when serialising and deserialising data. - public ES3.Format format = ES3.Format.JSON; - /// Whether we want to pretty print JSON. - public bool prettyPrint = true; - /// Any stream buffers will be set to this length in bytes. - public int bufferSize = 2048; - /// The text encoding to use for text-based format. Note that changing this may invalidate previous save data. - public Encoding encoding = Encoding.UTF8; - // Whether we should serialise children when serialising a GameObject. - public bool saveChildren = true; - // Whether we should apply encryption and/or compression to raw cached data if they're specified in the cached data's settings. - public bool postprocessRawCachedData; - - /// Whether we should check that the data we are loading from a file matches the method we are using to load it. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool typeChecking = true; - - /// - /// Enabling this ensures that only serialisable fields are serialised. Otherwise, possibly unsafe fields and - /// properties will be serialised. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public bool safeReflection = true; - /// Whether UnityEngine.Object members should be stored by value, reference or both. - [EditorBrowsable(EditorBrowsableState.Never)] - public ES3.ReferenceMode memberReferenceMode = ES3.ReferenceMode.ByRef; - /// Whether the main save methods should save UnityEngine.Objects by value, reference, or both. - [EditorBrowsable(EditorBrowsableState.Never)] - public ES3.ReferenceMode referenceMode = ES3.ReferenceMode.ByRefAndValue; - - /// How many levels of hierarchy Easy Save will serialise. This is used to protect against cyclic references. - [EditorBrowsable(EditorBrowsableState.Never)] - public int serializationDepthLimit = 64; - - /// The names of the Assemblies we should try to load our ES3Types from. - [EditorBrowsable(EditorBrowsableState.Never)] - public string[] assemblyNames = - { - "Assembly-CSharp-firstpass", - "Assembly-CSharp" - }; - - /// Gets the full, absolute path which this ES3Settings object identifies. - public string FullPath - { - get - { - if (path == null) - throw new NullReferenceException("The 'path' field of this ES3Settings is null, indicating that it was not possible to load the default settings from Resources. Please check that the ES3 Default Settings.prefab exists in Assets/Plugins/Resources/ES3/"); - - if (IsAbsolute(path)) - return path; - - if (location == ES3.Location.File) - { - if (directory == ES3.Directory.PersistentDataPath) - return ES3IO.persistentDataPath + "/" + path; - if (directory == ES3.Directory.DataPath) - return Application.dataPath + "/" + path; - throw new NotImplementedException("File directory \"" + directory + "\" has not been implemented."); - } - if (location == ES3.Location.Resources) - { - // Check that it has valid extension - string extension = Path.GetExtension(path); - bool hasValidExtension = false; - foreach (string ext in resourcesExtensions) - { - if (extension == ext) - { - hasValidExtension = true; - break; - } - } - - if (!hasValidExtension) - throw new ArgumentException("Extension of file in Resources must be .json, .bytes, .txt, .csv, .htm, .html, .xml, .yaml or .fnt, but path given was \"" + path + "\""); - - // Remove extension - string resourcesPath = path.Replace(extension, ""); - return resourcesPath; - } - return path; - } - } - - #endregion - - #region Constructors - - /// Creates a new ES3Settings object with the given path. - /// The path associated with this ES3Settings object. - /// The settings we want to use to override the default settings. - public ES3Settings(string path = null, ES3Settings settings = null) : this(true) - { - // if there are settings to merge, merge them. - if (settings != null) - settings.CopyInto(this); - - if (path != null) - this.path = path; - } - - /// Creates a new ES3Settings object with the given path. - /// The path associated with this ES3Settings object. - /// - /// Accepts an ES3.EncryptionType, ES3.CompressionType, ES3.Location, ES3.Directory or - /// ES3.ReferenceMode. - /// - public ES3Settings(string path, params Enum[] enums) : this(enums) - { - if (path != null) - this.path = path; - } - - - /// Creates a new ES3Settings object with the given path. - /// The path associated with this ES3Settings object. - /// - /// Accepts an ES3.EncryptionType, ES3.CompressionType, ES3.Location, ES3.Directory or - /// ES3.ReferenceMode. - /// - public ES3Settings(params Enum[] enums) : this(true) - { - foreach (var setting in enums) - { - if (setting is ES3.EncryptionType) - encryptionType = (ES3.EncryptionType)setting; - else if (setting is ES3.Location) - location = (ES3.Location)setting; - else if (setting is ES3.CompressionType) - compressionType = (ES3.CompressionType)setting; - else if (setting is ES3.ReferenceMode) - referenceMode = (ES3.ReferenceMode)setting; - else if (setting is ES3.Format) - format = (ES3.Format)setting; - else if (setting is ES3.Directory) - directory = (ES3.Directory)setting; - } - } - - /// Creates a new ES3Settings object with the given encryption settings. - /// The type of encryption to use, if any. - /// The password to use when encrypting data. - public ES3Settings(ES3.EncryptionType encryptionType, string encryptionPassword) : this(true) - { - this.encryptionType = encryptionType; - this.encryptionPassword = encryptionPassword; - } - - /// Creates a new ES3Settings object with the given path and encryption settings. - /// The path associated with this ES3Settings object. - /// The type of encryption to use, if any. - /// The password to use when encrypting data. - /// The settings we want to use to override the default settings. - public ES3Settings(string path, ES3.EncryptionType encryptionType, string encryptionPassword, ES3Settings settings = null) : this(path, settings) - { - this.encryptionType = encryptionType; - this.encryptionPassword = encryptionPassword; - } - - /* Base constructor which allows us to bypass defaults so it can be called by Editor serialization */ - [EditorBrowsable(EditorBrowsableState.Never)] - public ES3Settings(bool applyDefaults) - { - if (applyDefaults) - if (defaultSettings != null) - _defaults.CopyInto(this); - } - - #endregion - - #region Editor methods - -#if UNITY_EDITOR - public static string pathToEasySaveFolder; - - public static string PathToEasySaveFolder() - { - // If the path has not yet been cached, get the path and cache it. - if (string.IsNullOrEmpty(pathToEasySaveFolder)) - { - string[] guids = AssetDatabase.FindAssets("ES3Window"); - if (guids.Length == 0) - ES3Debug.LogError("Could not locate the Easy Save 3 folder because the ES3Window script has been moved or removed."); - if (guids.Length > 1) - ES3Debug.LogError("Could not locate the Easy Save 3 folder because more than one ES3Window script exists in the project, but this needs to be unique to locate the folder."); - - pathToEasySaveFolder = AssetDatabase.GUIDToAssetPath(guids[0]).Split(new[] - { - "Editor" - }, StringSplitOptions.RemoveEmptyEntries)[0]; - } - return pathToEasySaveFolder; - } - - internal static string PathToDefaultSettings() - { - return PathToEasySaveFolder() + "Resources/" + defaultSettingsPath + ".asset"; - } - - internal static void CreateDefaultSettingsFolder() - { - if (AssetDatabase.IsValidFolder(PathToEasySaveFolder() + "Resources/ES3")) - return; - // Remove leading slash from PathToEasySaveFolder. - AssetDatabase.CreateFolder(PathToEasySaveFolder().Remove(PathToEasySaveFolder().Length - 1, 1), "Resources"); - AssetDatabase.CreateFolder(PathToEasySaveFolder() + "Resources", "ES3"); - } - - private static ES3SerializableSettings GetOldSettings() - { - var go = Resources.Load(defaultSettingsPath.Replace("ES3Defaults", "ES3 Default Settings")); - if (go != null) - { - var c = go.GetComponent(); - if (c != null && c.settings != null) - return c.settings; - } - return null; - } - - private static void RemoveOldSettings() - { - AssetDatabase.DeleteAsset(PathToDefaultSettings().Replace("ES3Defaults.asset", "ES3 Default Settings.prefab")); - } -#endif - - #endregion - - #region Utility methods - - private static bool IsAbsolute(string path) - { - if (path.Length > 0 && (path[0] == '/' || path[0] == '\\')) - return true; - if (path.Length > 1 && path[1] == ':') - return true; - return false; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public object Clone() - { - var settings = new ES3Settings(); - CopyInto(settings); - return settings; - } - - private void CopyInto(ES3Settings newSettings) - { - newSettings._location = _location; - newSettings.directory = directory; - newSettings.format = format; - newSettings.prettyPrint = prettyPrint; - newSettings.path = path; - newSettings.encryptionType = encryptionType; - newSettings.encryptionPassword = encryptionPassword; - newSettings.compressionType = compressionType; - newSettings.bufferSize = bufferSize; - newSettings.encoding = encoding; - newSettings.typeChecking = typeChecking; - newSettings.safeReflection = safeReflection; - newSettings.referenceMode = referenceMode; - newSettings.memberReferenceMode = memberReferenceMode; - newSettings.assemblyNames = assemblyNames; - newSettings.saveChildren = saveChildren; - newSettings.serializationDepthLimit = serializationDepthLimit; - newSettings.postprocessRawCachedData = postprocessRawCachedData; - } - - #endregion -} - -/* - * A serializable version of the settings we can use as a field in the Editor, which doesn't automatically - * assign defaults to itself, so we get no serialization errors. - */ -[EditorBrowsable(EditorBrowsableState.Never)] -[Serializable] -public class ES3SerializableSettings : ES3Settings -{ - -#if UNITY_EDITOR - public bool showAdvancedSettings; -#endif - public ES3SerializableSettings() : base(false) {} - public ES3SerializableSettings(bool applyDefaults) : base(applyDefaults) {} - public ES3SerializableSettings(string path) : base(false) { this.path = path; } - public ES3SerializableSettings(string path, ES3.Location location) : base(false) { this.location = location; } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3Settings.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3Settings.cs.meta deleted file mode 100644 index 2b45b24..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Settings/ES3Settings.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b7b35a33d52a04187b51d5e2e2e5b0c8 -timeCreated: 1519132294 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Streams.meta b/Assets/Plugins/Easy Save 3/Scripts/Streams.meta deleted file mode 100644 index 327f802..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Streams.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 37ab5860b18cc4976bb573d0554aa453 -folderAsset: yes -timeCreated: 1499764821 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3FileStream.cs b/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3FileStream.cs deleted file mode 100644 index 2903e18..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3FileStream.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.IO; - -namespace ES3Internal -{ - public enum ES3FileMode { Read, Write, Append } - - public class ES3FileStream : FileStream - { - private bool isDisposed; - - public ES3FileStream(string path, ES3FileMode fileMode, int bufferSize, bool useAsync) - : base(GetPath(path, fileMode), GetFileMode(fileMode), GetFileAccess(fileMode), FileShare.None, bufferSize, useAsync) - { - } - - // Gets a temporary path if necessary. - protected static string GetPath(string path, ES3FileMode fileMode) - { - string directoryPath = ES3IO.GetDirectoryPath(path); - // Attempt to create the directory incase it does not exist if we are storing data. - if (fileMode != ES3FileMode.Read && directoryPath != ES3IO.persistentDataPath) - ES3IO.CreateDirectory(directoryPath); - if (fileMode != ES3FileMode.Write || fileMode == ES3FileMode.Append) - return path; - return fileMode == ES3FileMode.Write ? path + ES3IO.temporaryFileSuffix : path; - } - - protected static FileMode GetFileMode(ES3FileMode fileMode) - { - if (fileMode == ES3FileMode.Read) - return FileMode.Open; - if (fileMode == ES3FileMode.Write) - return FileMode.Create; - return FileMode.Append; - } - - protected static FileAccess GetFileAccess(ES3FileMode fileMode) - { - if (fileMode == ES3FileMode.Read) - return FileAccess.Read; - if (fileMode == ES3FileMode.Write) - return FileAccess.Write; - return FileAccess.Write; - } - - protected override void Dispose(bool disposing) - { - // Ensure we only perform disposable once. - if (isDisposed) - return; - isDisposed = true; - - base.Dispose(disposing); - - - // If this is a file writer, we need to replace the temp file. - /*if(fileMode == ES3FileMode.Write && fileMode != ES3FileMode.Append) - { - // Delete the old file before overwriting it. - ES3IO.DeleteFile(path); - // Rename temporary file to new file. - ES3IO.MoveFile(path + ES3.temporaryFileSuffix, path); - }*/ - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3FileStream.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3FileStream.cs.meta deleted file mode 100644 index 40077cf..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3FileStream.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0daff17c3279448f994a7a93d305046a -timeCreated: 1499764821 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3PlayerPrefsStream.cs b/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3PlayerPrefsStream.cs deleted file mode 100644 index cd895a0..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3PlayerPrefsStream.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.IO; - -namespace ES3Internal -{ - internal class ES3PlayerPrefsStream : MemoryStream - { - private readonly bool append; - private bool isDisposed; - private readonly bool isWriteStream; - private readonly string path; - - // This constructor should be used for read streams only. - public ES3PlayerPrefsStream(string path) : base(GetData(path, false)) - { - this.path = path; - append = false; - } - - // This constructor should be used for write streams only. - public ES3PlayerPrefsStream(string path, int bufferSize, bool append = false) : base(bufferSize) - { - this.path = path; - this.append = append; - isWriteStream = true; - } - - private static byte[] GetData(string path, bool isWriteStream) - { - if (!PlayerPrefs.HasKey(path)) - throw new FileNotFoundException("File \"" + path + "\" could not be found in PlayerPrefs"); - return Convert.FromBase64String(PlayerPrefs.GetString(path)); - } - - protected override void Dispose(bool disposing) - { - if (isDisposed) - return; - isDisposed = true; - if (isWriteStream && Length > 0) - { - if (append) - { - // Convert data back to bytes before appending, as appending Base-64 strings directly can corrupt the data. - byte[] sourceBytes = Convert.FromBase64String(PlayerPrefs.GetString(path)); - byte[] appendBytes = ToArray(); - byte[] finalBytes = new byte[sourceBytes.Length + appendBytes.Length]; - Buffer.BlockCopy(sourceBytes, 0, finalBytes, 0, sourceBytes.Length); - Buffer.BlockCopy(appendBytes, 0, finalBytes, sourceBytes.Length, appendBytes.Length); - - PlayerPrefs.SetString(path, Convert.ToBase64String(finalBytes)); - - PlayerPrefs.Save(); - } - else - PlayerPrefs.SetString(path + ES3IO.temporaryFileSuffix, Convert.ToBase64String(ToArray())); - // Save the timestamp to a separate key. - PlayerPrefs.SetString("timestamp_" + path, DateTime.UtcNow.Ticks.ToString()); - } - base.Dispose(disposing); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3PlayerPrefsStream.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3PlayerPrefsStream.cs.meta deleted file mode 100644 index 690bef4..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3PlayerPrefsStream.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: df45161eabf2549c28f00352d4f970dc -timeCreated: 1499764823 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3ResourcesStream.cs b/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3ResourcesStream.cs deleted file mode 100644 index 8a62648..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3ResourcesStream.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.IO; -using UnityEngine; - -namespace ES3Internal -{ - internal class ES3ResourcesStream : MemoryStream - { - - // Used when creating - public ES3ResourcesStream(string path) : base(GetData(path)) - { - } - // Check that data exists by checking stream is not empty. - public bool Exists { get { return Length > 0; } } - - private static byte[] GetData(string path) - { - var textAsset = Resources.Load(path) as TextAsset; - - // If data doesn't exist in Resources, return an empty byte array. - if (textAsset == null) - return new byte[0]; - - return textAsset.bytes; - } - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3ResourcesStream.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3ResourcesStream.cs.meta deleted file mode 100644 index 06046cf..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3ResourcesStream.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: fe24380d3aca84a4d97e668349d86d37 -timeCreated: 1519132301 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3Stream.cs b/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3Stream.cs deleted file mode 100644 index 6b14c86..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3Stream.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.IO; -using System.IO.Compression; -using System.Security.Cryptography; -using UnityEngine; - -namespace ES3Internal -{ - public static class ES3Stream - { - public static Stream CreateStream(ES3Settings settings, ES3FileMode fileMode) - { - bool isWriteStream = fileMode != ES3FileMode.Read; - Stream stream = null; - - // Check that the path is in a valid format. This will throw an exception if not. - new FileInfo(settings.FullPath); - - try - { - if (settings.location == ES3.Location.InternalMS) - { - // There's no point in creating an empty MemoryStream if we're only reading from it. - if (!isWriteStream) - return null; - stream = new MemoryStream(settings.bufferSize); - } - else if (settings.location == ES3.Location.File) - { - if (!isWriteStream && !ES3IO.FileExists(settings.FullPath)) - return null; - stream = new ES3FileStream(settings.FullPath, fileMode, settings.bufferSize, false); - } - else if (settings.location == ES3.Location.PlayerPrefs) - { - if (isWriteStream) - stream = new ES3PlayerPrefsStream(settings.FullPath, settings.bufferSize, fileMode == ES3FileMode.Append); - else - { - if (!PlayerPrefs.HasKey(settings.FullPath)) - return null; - stream = new ES3PlayerPrefsStream(settings.FullPath); - } - } - else if (settings.location == ES3.Location.Resources) - { - if (!isWriteStream) - { - var resourcesStream = new ES3ResourcesStream(settings.FullPath); - if (resourcesStream.Exists) - stream = resourcesStream; - else - { - resourcesStream.Dispose(); - return null; - } - } - else if (Application.isEditor) - throw new NotSupportedException("Cannot write directly to Resources folder. Try writing to a directory outside of Resources, and then manually move the file there."); - else - throw new NotSupportedException("Cannot write to Resources folder at runtime. Use a different save location at runtime instead."); - } - - return CreateStream(stream, settings, fileMode); - } - catch (Exception e) - { - if (stream != null) - stream.Dispose(); - throw e; - } - } - - public static Stream CreateStream(Stream stream, ES3Settings settings, ES3FileMode fileMode) - { - try - { - bool isWriteStream = fileMode != ES3FileMode.Read; - - #if !DISABLE_ENCRYPTION - // Encryption - if (settings.encryptionType != ES3.EncryptionType.None && stream.GetType() != typeof(UnbufferedCryptoStream)) - { - EncryptionAlgorithm alg = null; - if (settings.encryptionType == ES3.EncryptionType.AES) - alg = new AESEncryptionAlgorithm(); - stream = new UnbufferedCryptoStream(stream, !isWriteStream, settings.encryptionPassword, settings.bufferSize, alg); - } - #endif - - // Compression - if (settings.compressionType != ES3.CompressionType.None && stream.GetType() != typeof(GZipStream)) - { - if (settings.compressionType == ES3.CompressionType.Gzip) - stream = isWriteStream ? new GZipStream(stream, CompressionMode.Compress) : new GZipStream(stream, CompressionMode.Decompress); - } - - return stream; - } - catch (Exception e) - { - if (stream != null) - stream.Dispose(); - if (e.GetType() == typeof(CryptographicException)) - throw new CryptographicException("Could not decrypt file. Please ensure that you are using the same password used to encrypt the file."); - throw e; - } - } - - public static void CopyTo(Stream source, Stream destination) - { - #if UNITY_2019_1_OR_NEWER - source.CopyTo(destination); - #else - byte[] buffer = new byte[2048]; - int bytesRead; - while ((bytesRead = source.Read(buffer, 0, buffer.Length)) > 0) - destination.Write(buffer, 0, bytesRead); - #endif - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3Stream.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3Stream.cs.meta deleted file mode 100644 index ed9f16c..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Streams/ES3Stream.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b4ec91ea5d66749aca7d5555b767728a -timeCreated: 1499764822 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types.meta b/Assets/Plugins/Easy Save 3/Scripts/Types.meta deleted file mode 100644 index 40da695..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1b8a01835c8014ce9bef4d4e31eb057b -folderAsset: yes -timeCreated: 1499764821 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types.meta deleted file mode 100644 index 092cfa1..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1995368ea5d4c45878840cfba12bd7bd -folderAsset: yes -timeCreated: 1499764821 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES32DArrayType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES32DArrayType.cs deleted file mode 100644 index 45c2dbf..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES32DArrayType.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System; -using System.Collections.Generic; -using ES3Internal; - -namespace ES3Types -{ - public class ES32DArrayType : ES3CollectionType - { - public ES32DArrayType(Type type) : base(type) {} - - public override void Write(object obj, ES3Writer writer, ES3.ReferenceMode unityObjectType) - { - var array = (Array)obj; - - if (elementType == null) - throw new ArgumentNullException("ES3Type argument cannot be null."); - - //writer.StartWriteCollection(); - - for (int i = 0; i < array.GetLength(0); i++) - { - writer.StartWriteCollectionItem(i); - writer.StartWriteCollection(); - for (int j = 0; j < array.GetLength(1); j++) - { - writer.StartWriteCollectionItem(j); - writer.Write(array.GetValue(i, j), elementType, unityObjectType); - writer.EndWriteCollectionItem(j); - } - writer.EndWriteCollection(); - writer.EndWriteCollectionItem(i); - } - - //writer.EndWriteCollection(); - } - - public override object Read(ES3Reader reader) - { - return Read(reader); - /*if(reader.StartReadCollection()) - return null; - - // Create a List to store the items as a 1D array, which we can work out the positions of by calculating the lengths of the two dimensions. - var items = new List(); - int length1 = 0; - - // Iterate through each character until we reach the end of the array. - while(true) - { - if(!reader.StartReadCollectionItem()) - break; - - ReadICollection(reader, items, elementType); - length1++; - - if(reader.EndReadCollectionItem()) - break; - } - - int length2 = items.Count / length1; - - var array = new T[length1,length2]; - - for(int i=0; i items = new List(); - int length1 = 0; - - // Iterate through each character until we reach the end of the array. - while(true) - { - if (!reader.StartReadCollectionItem()) - break; - - ReadICollection(reader, items, elementType); - length1++; - - if (reader.EndReadCollectionItem()) - break; - } - - int length2 = items.Count / length1; - - var array = ES3Reflection.ArrayCreateInstance(elementType.type, new[] - { - length1, - length2 - }); - - for (int i = 0; i < length1; i++) - for (int j = 0; j < length2; j++) - array.SetValue(items[i * length2 + j], i, j); - - return array; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - ReadInto(reader, obj); - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var array = (Array)obj; - - if (reader.StartReadCollection()) - throw new NullReferenceException("The Collection we are trying to load is stored as null, which is not allowed when using ReadInto methods."); - - bool iHasBeenRead = false; - - for (int i = 0; i < array.GetLength(0); i++) - { - bool jHasBeenRead = false; - - if (!reader.StartReadCollectionItem()) - throw new IndexOutOfRangeException("The collection we are loading is smaller than the collection provided as a parameter."); - - reader.StartReadCollection(); - for (int j = 0; j < array.GetLength(1); j++) - { - if (!reader.StartReadCollectionItem()) - throw new IndexOutOfRangeException("The collection we are loading is smaller than the collection provided as a parameter."); - reader.ReadInto(array.GetValue(i, j), elementType); - jHasBeenRead = reader.EndReadCollectionItem(); - } - - if (!jHasBeenRead) - throw new IndexOutOfRangeException("The collection we are loading is larger than the collection provided as a parameter."); - - reader.EndReadCollection(); - - iHasBeenRead = reader.EndReadCollectionItem(); - } - - if (!iHasBeenRead) - throw new IndexOutOfRangeException("The collection we are loading is larger than the collection provided as a parameter."); - - reader.EndReadCollection(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES32DArrayType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES32DArrayType.cs.meta deleted file mode 100644 index 5d924b3..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES32DArrayType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 16f7aabe86b814cc8a059954a1c78d25 -timeCreated: 1519132280 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES33DArrayType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES33DArrayType.cs deleted file mode 100644 index 413a7cd..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES33DArrayType.cs +++ /dev/null @@ -1,168 +0,0 @@ -using System; -using System.Collections.Generic; -using ES3Internal; - -namespace ES3Types -{ - public class ES33DArrayType : ES3CollectionType - { - public ES33DArrayType(Type type) : base(type) {} - - public override void Write(object obj, ES3Writer writer, ES3.ReferenceMode memberReferenceMode) - { - var array = (Array)obj; - - if (elementType == null) - throw new ArgumentNullException("ES3Type argument cannot be null."); - - //writer.StartWriteCollection(); - - for (int i = 0; i < array.GetLength(0); i++) - { - writer.StartWriteCollectionItem(i); - writer.StartWriteCollection(); - - for (int j = 0; j < array.GetLength(1); j++) - { - writer.StartWriteCollectionItem(j); - writer.StartWriteCollection(); - - for (int k = 0; k < array.GetLength(2); k++) - { - writer.StartWriteCollectionItem(k); - writer.Write(array.GetValue(i, j, k), elementType, memberReferenceMode); - writer.EndWriteCollectionItem(k); - } - writer.EndWriteCollection(); - writer.EndWriteCollectionItem(j); - } - writer.EndWriteCollection(); - writer.EndWriteCollectionItem(i); - } - //writer.EndWriteCollection(); - } - - public override object Read(ES3Reader reader) - { - return Read(reader); - } - - public override object Read(ES3Reader reader) - { - if (reader.StartReadCollection()) - return null; - - // Create a List to store the items as a 1D array, which we can work out the positions of by calculating the lengths of the two dimensions. - List items = new List(); - int length1 = 0; - int length2 = 0; - - // Iterate through each sub-array - while(true) - { - if (!reader.StartReadCollectionItem()) - break; - reader.StartReadCollection(); - - length1++; - - while(true) - { - if (!reader.StartReadCollectionItem()) - break; - - ReadICollection(reader, items, elementType); - length2++; - - if (reader.EndReadCollectionItem()) - break; - } - - reader.EndReadCollection(); - if (reader.EndReadCollectionItem()) - break; - } - - reader.EndReadCollection(); - - length2 = length2 / length1; - int length3 = items.Count / length2 / length1; - - var array = ES3Reflection.ArrayCreateInstance(elementType.type, new[] - { - length1, - length2, - length3 - }); - - for (int i = 0; i < length1; i++) - for (int j = 0; j < length2; j++) - for (int k = 0; k < length3; k++) - array.SetValue(items[i * length2 * length3 + j * length3 + k], i, j, k); - - return array; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - ReadInto(reader, obj); - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var array = (Array)obj; - - if (reader.StartReadCollection()) - throw new NullReferenceException("The Collection we are trying to load is stored as null, which is not allowed when using ReadInto methods."); - - bool iHasBeenRead = false; - - for (int i = 0; i < array.GetLength(0); i++) - { - bool jHasBeenRead = false; - - if (!reader.StartReadCollectionItem()) - throw new IndexOutOfRangeException("The collection we are loading is smaller than the collection provided as a parameter."); - - reader.StartReadCollection(); - - for (int j = 0; j < array.GetLength(1); j++) - { - bool kHasBeenRead = false; - - if (!reader.StartReadCollectionItem()) - throw new IndexOutOfRangeException("The collection we are loading is smaller than the collection provided as a parameter."); - - reader.StartReadCollection(); - - for (int k = 0; k < array.GetLength(2); k++) - { - if (!reader.StartReadCollectionItem()) - throw new IndexOutOfRangeException("The collection we are loading is smaller than the collection provided as a parameter."); - reader.ReadInto(array.GetValue(i, j, k), elementType); - kHasBeenRead = reader.EndReadCollectionItem(); - } - - if (!kHasBeenRead) - throw new IndexOutOfRangeException("The collection we are loading is larger than the collection provided as a parameter."); - - reader.EndReadCollection(); - - jHasBeenRead = reader.EndReadCollectionItem(); - } - - if (!jHasBeenRead) - throw new IndexOutOfRangeException("The collection we are loading is larger than the collection provided as a parameter."); - - reader.EndReadCollection(); - - iHasBeenRead = reader.EndReadCollectionItem(); - } - - if (!iHasBeenRead) - throw new IndexOutOfRangeException("The collection we are loading is larger than the collection provided as a parameter."); - - reader.EndReadCollection(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES33DArrayType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES33DArrayType.cs.meta deleted file mode 100644 index f87024d..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES33DArrayType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f60b75065118c4199aeaa2c3c31ecc0f -timeCreated: 1519132301 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs deleted file mode 100644 index 9f83df1..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3ArrayType : ES3CollectionType - { - public ES3ArrayType(Type type) : base(type) {} - public ES3ArrayType(Type type, ES3Type elementType) : base(type, elementType) {} - - public override void Write(object obj, ES3Writer writer, ES3.ReferenceMode memberReferenceMode) - { - var array = (Array)obj; - - if (elementType == null) - throw new ArgumentNullException("ES3Type argument cannot be null."); - - //writer.StartWriteCollection(); - - for (int i = 0; i < array.Length; i++) - { - writer.StartWriteCollectionItem(i); - writer.Write(array.GetValue(i), elementType, memberReferenceMode); - writer.EndWriteCollectionItem(i); - } - - //writer.EndWriteCollection(); - } - - public override object Read(ES3Reader reader) - { - List list = new List(); - if (!ReadICollection(reader, list, elementType)) - return null; - - var array = ES3Reflection.ArrayCreateInstance(elementType.type, list.Count); - int i = 0; - foreach (object item in list) - { - array.SetValue(item, i); - i++; - } - - return array; - } - - public override object Read(ES3Reader reader) - { - return Read(reader); - } - - public override void ReadInto(ES3Reader reader, object obj) - { - ReadICollectionInto(reader, (ICollection)obj, elementType); - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var collection = (IList)obj; - - if (collection.Count == 0) - ES3Debug.LogWarning("LoadInto/ReadInto expects a collection containing instances to load data in to, but the collection is empty."); - - if (reader.StartReadCollection()) - throw new NullReferenceException("The Collection we are trying to load is stored as null, which is not allowed when using ReadInto methods."); - - int itemsLoaded = 0; - - // Iterate through each item in the collection and try to load it. - foreach (object item in collection) - { - itemsLoaded++; - - if (!reader.StartReadCollectionItem()) - break; - - reader.ReadInto(item, elementType); - - // If we find a ']', we reached the end of the array. - if (reader.EndReadCollectionItem()) - break; - - // If there's still items to load, but we've reached the end of the collection we're loading into, throw an error. - if (itemsLoaded == collection.Count) - throw new IndexOutOfRangeException("The collection we are loading is longer than the collection provided as a parameter."); - } - - // If we loaded fewer items than the parameter collection, throw index out of range exception. - if (itemsLoaded != collection.Count) - throw new IndexOutOfRangeException("The collection we are loading is shorter than the collection provided as a parameter."); - - reader.EndReadCollection(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs.meta deleted file mode 100644 index bcdc911..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 80139e4c0efc5414caff6bb50527d63d -timeCreated: 1519132289 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs deleted file mode 100644 index 796649b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public abstract class ES3CollectionType : ES3Type - { - public ES3Type elementType; - - public ES3CollectionType(Type type) : base(type) - { - elementType = ES3TypeMgr.GetOrCreateES3Type(ES3Reflection.GetElementTypes(type)[0], false); - isCollection = true; - - // If the element type is null (i.e. unsupported), make this ES3Type null. - if (elementType == null) - isUnsupported = true; - } - - public ES3CollectionType(Type type, ES3Type elementType) : base(type) - { - this.elementType = elementType; - isCollection = true; - } - - /*protected ES3Reflection.ES3ReflectedMethod readMethod = null; - protected ES3Reflection.ES3ReflectedMethod readIntoMethod = null;*/ - - public abstract object Read(ES3Reader reader); - public abstract void ReadInto(ES3Reader reader, object obj); - public abstract void Write(object obj, ES3Writer writer, ES3.ReferenceMode memberReferenceMode); - - [Preserve] - public override void Write(object obj, ES3Writer writer) - { - Write(obj, writer, ES3.ReferenceMode.ByRefAndValue); - } - - protected virtual bool ReadICollection(ES3Reader reader, ICollection collection, ES3Type elementType) - { - if (reader.StartReadCollection()) - return false; - - // Iterate through each character until we reach the end of the array. - while(true) - { - if (!reader.StartReadCollectionItem()) - break; - collection.Add(reader.Read(elementType)); - - if (reader.EndReadCollectionItem()) - break; - } - - reader.EndReadCollection(); - - return true; - } - - protected virtual void ReadICollectionInto(ES3Reader reader, ICollection collection, ES3Type elementType) - { - ReadICollectionInto(reader, collection, elementType); - } - - [Preserve] - protected virtual void ReadICollectionInto(ES3Reader reader, ICollection collection, ES3Type elementType) - { - if (reader.StartReadCollection()) - throw new NullReferenceException("The Collection we are trying to load is stored as null, which is not allowed when using ReadInto methods."); - - int itemsLoaded = 0; - - // Iterate through each item in the collection and try to load it. - foreach (object item in collection) - { - itemsLoaded++; - - if (!reader.StartReadCollectionItem()) - break; - - reader.ReadInto(item, elementType); - - // If we find a ']', we reached the end of the array. - if (reader.EndReadCollectionItem()) - break; - - // If there's still items to load, but we've reached the end of the collection we're loading into, throw an error. - if (itemsLoaded == collection.Count) - throw new IndexOutOfRangeException("The collection we are loading is longer than the collection provided as a parameter."); - } - - // If we loaded fewer items than the parameter collection, throw index out of range exception. - if (itemsLoaded != collection.Count) - throw new IndexOutOfRangeException("The collection we are loading is shorter than the collection provided as a parameter."); - - reader.EndReadCollection(); - } - - /* - * Calls the Read method using reflection so we don't need to provide a generic parameter. - */ - /*public virtual object Read(ES3Reader reader) - { - if(readMethod == null) - readMethod = ES3Reflection.GetMethod(this.GetType(), "Read", new Type[]{elementType.type}, new Type[]{typeof(ES3Reader)}); - return readMethod.Invoke(this, new object[]{reader}); - } - - public virtual void ReadInto(ES3Reader reader, object obj) - { - if(readIntoMethod == null) - readIntoMethod = ES3Reflection.GetMethod(this.GetType(), "ReadInto", new Type[]{elementType.type}, new Type[]{typeof(ES3Reader), typeof(object)}); - readIntoMethod.Invoke(this, new object[]{reader, obj}); - }*/ - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs.meta deleted file mode 100644 index d02b40d..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 4758f55361e6f4485afe7dfdd3a3a372 -timeCreated: 1519132284 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ConcurrentDictionaryType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ConcurrentDictionaryType.cs deleted file mode 100644 index c703265..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ConcurrentDictionaryType.cs +++ /dev/null @@ -1,144 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3ConcurrentDictionaryType : ES3Type - { - public ES3Type keyType; - protected ES3Reflection.ES3ReflectedMethod readIntoMethod = null; - - protected ES3Reflection.ES3ReflectedMethod readMethod = null; - public ES3Type valueType; - - public ES3ConcurrentDictionaryType(Type type) : base(type) - { - Type[] types = ES3Reflection.GetElementTypes(type); - keyType = ES3TypeMgr.GetOrCreateES3Type(types[0], false); - valueType = ES3TypeMgr.GetOrCreateES3Type(types[1], false); - - // If either the key or value type is unsupported, make this type NULL. - if (keyType == null || valueType == null) - isUnsupported = true; - ; - - isDictionary = true; - } - - public ES3ConcurrentDictionaryType(Type type, ES3Type keyType, ES3Type valueType) : base(type) - { - this.keyType = keyType; - this.valueType = valueType; - - // If either the key or value type is unsupported, make this type NULL. - if (keyType == null || valueType == null) - isUnsupported = true; - ; - - isDictionary = true; - } - - public override void Write(object obj, ES3Writer writer) - { - Write(obj, writer, writer.settings.memberReferenceMode); - } - - public void Write(object obj, ES3Writer writer, ES3.ReferenceMode memberReferenceMode) - { - var dict = (IDictionary)obj; - - //writer.StartWriteDictionary(dict.Count); - - int i = 0; - foreach (DictionaryEntry kvp in dict) - { - writer.StartWriteDictionaryKey(i); - writer.Write(kvp.Key, keyType, memberReferenceMode); - writer.EndWriteDictionaryKey(i); - writer.StartWriteDictionaryValue(i); - writer.Write(kvp.Value, valueType, memberReferenceMode); - writer.EndWriteDictionaryValue(i); - i++; - } - - //writer.EndWriteDictionary(); - } - - public override object Read(ES3Reader reader) - { - return Read(reader); - } - - public override void ReadInto(ES3Reader reader, object obj) - { - ReadInto(reader, obj); - } - - /* - * Allows us to call the generic Read method using Reflection so we can define the generic parameter at runtime. - * It also caches the method to improve performance in later calls. - */ - public object Read(ES3Reader reader) - { - if (reader.StartReadDictionary()) - return null; - - var dict = (IDictionary)ES3Reflection.CreateInstance(type); - - // Iterate through each character until we reach the end of the array. - while(true) - { - if (!reader.StartReadDictionaryKey()) - return dict; - object key = reader.Read(keyType); - reader.EndReadDictionaryKey(); - - reader.StartReadDictionaryValue(); - object value = reader.Read(valueType); - - dict.Add(key, value); - - if (reader.EndReadDictionaryValue()) - break; - } - - reader.EndReadDictionary(); - - return dict; - } - - public void ReadInto(ES3Reader reader, object obj) - { - if (reader.StartReadDictionary()) - throw new NullReferenceException("The Dictionary we are trying to load is stored as null, which is not allowed when using ReadInto methods."); - - var dict = (IDictionary)obj; - - // Iterate through each character until we reach the end of the array. - while(true) - { - if (!reader.StartReadDictionaryKey()) - return; - object key = reader.Read(keyType); - - if (!dict.Contains(key)) - throw new KeyNotFoundException("The key \"" + key + "\" in the Dictionary we are loading does not exist in the Dictionary we are loading into"); - object value = dict[key]; - reader.EndReadDictionaryKey(); - - reader.StartReadDictionaryValue(); - - reader.ReadInto(value, valueType); - - if (reader.EndReadDictionaryValue()) - break; - } - - reader.EndReadDictionary(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ConcurrentDictionaryType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ConcurrentDictionaryType.cs.meta deleted file mode 100644 index 02b70a3..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ConcurrentDictionaryType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 57aa1763324cfbd4ea9782b0ea036900 -timeCreated: 1519132282 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3DictionaryType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3DictionaryType.cs deleted file mode 100644 index 1e8e1b9..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3DictionaryType.cs +++ /dev/null @@ -1,144 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3DictionaryType : ES3Type - { - public ES3Type keyType; - protected ES3Reflection.ES3ReflectedMethod readIntoMethod = null; - - protected ES3Reflection.ES3ReflectedMethod readMethod = null; - public ES3Type valueType; - - public ES3DictionaryType(Type type) : base(type) - { - Type[] types = ES3Reflection.GetElementTypes(type); - keyType = ES3TypeMgr.GetOrCreateES3Type(types[0], false); - valueType = ES3TypeMgr.GetOrCreateES3Type(types[1], false); - - // If either the key or value type is unsupported, make this type NULL. - if (keyType == null || valueType == null) - isUnsupported = true; - ; - - isDictionary = true; - } - - public ES3DictionaryType(Type type, ES3Type keyType, ES3Type valueType) : base(type) - { - this.keyType = keyType; - this.valueType = valueType; - - // If either the key or value type is unsupported, make this type NULL. - if (keyType == null || valueType == null) - isUnsupported = true; - ; - - isDictionary = true; - } - - public override void Write(object obj, ES3Writer writer) - { - Write(obj, writer, writer.settings.memberReferenceMode); - } - - public void Write(object obj, ES3Writer writer, ES3.ReferenceMode memberReferenceMode) - { - var dict = (IDictionary)obj; - - //writer.StartWriteDictionary(dict.Count); - - int i = 0; - foreach (DictionaryEntry kvp in dict) - { - writer.StartWriteDictionaryKey(i); - writer.Write(kvp.Key, keyType, memberReferenceMode); - writer.EndWriteDictionaryKey(i); - writer.StartWriteDictionaryValue(i); - writer.Write(kvp.Value, valueType, memberReferenceMode); - writer.EndWriteDictionaryValue(i); - i++; - } - - //writer.EndWriteDictionary(); - } - - public override object Read(ES3Reader reader) - { - return Read(reader); - } - - public override void ReadInto(ES3Reader reader, object obj) - { - ReadInto(reader, obj); - } - - /* - * Allows us to call the generic Read method using Reflection so we can define the generic parameter at runtime. - * It also caches the method to improve performance in later calls. - */ - public object Read(ES3Reader reader) - { - if (reader.StartReadDictionary()) - return null; - - var dict = (IDictionary)ES3Reflection.CreateInstance(type); - - // Iterate through each character until we reach the end of the array. - while(true) - { - if (!reader.StartReadDictionaryKey()) - return dict; - object key = reader.Read(keyType); - reader.EndReadDictionaryKey(); - - reader.StartReadDictionaryValue(); - object value = reader.Read(valueType); - - dict.Add(key, value); - - if (reader.EndReadDictionaryValue()) - break; - } - - reader.EndReadDictionary(); - - return dict; - } - - public void ReadInto(ES3Reader reader, object obj) - { - if (reader.StartReadDictionary()) - throw new NullReferenceException("The Dictionary we are trying to load is stored as null, which is not allowed when using ReadInto methods."); - - var dict = (IDictionary)obj; - - // Iterate through each character until we reach the end of the array. - while(true) - { - if (!reader.StartReadDictionaryKey()) - return; - object key = reader.Read(keyType); - - if (!dict.Contains(key)) - throw new KeyNotFoundException("The key \"" + key + "\" in the Dictionary we are loading does not exist in the Dictionary we are loading into"); - object value = dict[key]; - reader.EndReadDictionaryKey(); - - reader.StartReadDictionaryValue(); - - reader.ReadInto(value, valueType); - - if (reader.EndReadDictionaryValue()) - break; - } - - reader.EndReadDictionary(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3DictionaryType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3DictionaryType.cs.meta deleted file mode 100644 index ee845c5..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3DictionaryType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2bc573810521e44bea185a4fa7c415e9 -timeCreated: 1519132282 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3HashSetType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3HashSetType.cs deleted file mode 100644 index f3ed3aa..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3HashSetType.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3HashSetType : ES3CollectionType - { - public ES3HashSetType(Type type) : base(type) {} - - public override void Write(object obj, ES3Writer writer, ES3.ReferenceMode memberReferenceMode) - { - if (obj == null) - { - writer.WriteNull(); - return; - } - ; - - var list = (IEnumerable)obj; - - if (elementType == null) - throw new ArgumentNullException("ES3Type argument cannot be null."); - - int count = 0; - foreach (object item in list) - count++; - - //writer.StartWriteCollection(count); - - int i = 0; - foreach (object item in list) - { - writer.StartWriteCollectionItem(i); - writer.Write(item, elementType, memberReferenceMode); - writer.EndWriteCollectionItem(i); - i++; - } - - //writer.EndWriteCollection(); - } - - public override object Read(ES3Reader reader) - { - object val = Read(reader); - if (val == null) - return default (T); - return (T)val; - } - - - public override object Read(ES3Reader reader) - { - /*var method = typeof(ES3CollectionType).GetMethod("ReadICollection", BindingFlags.Instance | BindingFlags.NonPublic).MakeGenericMethod(elementType.type); - if(!(bool)method.Invoke(this, new object[] { reader, list, elementType })) - return null;*/ - - var genericParam = ES3Reflection.GetGenericArguments(type)[0]; - var listType = ES3Reflection.MakeGenericType(typeof(List<>), genericParam); - var list = (IList)ES3Reflection.CreateInstance(listType); - - if (!reader.StartReadCollection()) - { - // Iterate through each character until we reach the end of the array. - while(true) - { - if (!reader.StartReadCollectionItem()) - break; - list.Add(reader.Read(elementType)); - - if (reader.EndReadCollectionItem()) - break; - } - - reader.EndReadCollection(); - } - - return ES3Reflection.CreateInstance(type, list); - } - - public override void ReadInto(ES3Reader reader, object obj) - { - ReadInto(reader, obj); - } - - public override void ReadInto(ES3Reader reader, object obj) - { - throw new NotImplementedException("Cannot use LoadInto/ReadInto with HashSet because HashSets do not maintain the order of elements"); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3HashSetType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3HashSetType.cs.meta deleted file mode 100644 index 1301c2e..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3HashSetType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e2a5f03b11de242bf9f3c6766875188b -timeCreated: 1519132282 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ListType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ListType.cs deleted file mode 100644 index 1e8ca5f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ListType.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.Collections; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3ListType : ES3CollectionType - { - public ES3ListType(Type type) : base(type) {} - public ES3ListType(Type type, ES3Type elementType) : base(type, elementType) {} - - public override void Write(object obj, ES3Writer writer, ES3.ReferenceMode memberReferenceMode) - { - if (obj == null) - { - writer.WriteNull(); - return; - } - ; - - var list = (IList)obj; - - if (elementType == null) - throw new ArgumentNullException("ES3Type argument cannot be null."); - - //writer.StartWriteCollection(); - - int i = 0; - foreach (object item in list) - { - writer.StartWriteCollectionItem(i); - writer.Write(item, elementType, memberReferenceMode); - writer.EndWriteCollectionItem(i); - i++; - } - - //writer.EndWriteCollection(); - } - - public override object Read(ES3Reader reader) - { - return Read(reader); - - /*var list = new List(); - if(!ReadICollection(reader, list, elementType)) - return null; - return list;*/ - } - - public override void ReadInto(ES3Reader reader, object obj) - { - ReadICollectionInto(reader, (ICollection)obj, elementType); - } - - public override object Read(ES3Reader reader) - { - var instance = (IList)ES3Reflection.CreateInstance(type); - - if (reader.StartReadCollection()) - return null; - - // Iterate through each character until we reach the end of the array. - while(true) - { - if (!reader.StartReadCollectionItem()) - break; - instance.Add(reader.Read(elementType)); - - if (reader.EndReadCollectionItem()) - break; - } - - reader.EndReadCollection(); - - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var collection = (IList)obj; - - if (reader.StartReadCollection()) - throw new NullReferenceException("The Collection we are trying to load is stored as null, which is not allowed when using ReadInto methods."); - - int itemsLoaded = 0; - - // Iterate through each item in the collection and try to load it. - foreach (object item in collection) - { - itemsLoaded++; - - if (!reader.StartReadCollectionItem()) - break; - - reader.ReadInto(item, elementType); - - // If we find a ']', we reached the end of the array. - if (reader.EndReadCollectionItem()) - break; - - // If there's still items to load, but we've reached the end of the collection we're loading into, throw an error. - if (itemsLoaded == collection.Count) - throw new IndexOutOfRangeException("The collection we are loading is longer than the collection provided as a parameter."); - } - - // If we loaded fewer items than the parameter collection, throw index out of range exception. - if (itemsLoaded != collection.Count) - throw new IndexOutOfRangeException("The collection we are loading is shorter than the collection provided as a parameter."); - - reader.EndReadCollection(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ListType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ListType.cs.meta deleted file mode 100644 index 628bd82..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ListType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3502f1923072c49498bb91827fae42eb -timeCreated: 1519132282 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3NativeArrayType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3NativeArrayType.cs deleted file mode 100644 index 96cfb2c..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3NativeArrayType.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using ES3Internal; -using Unity.Collections; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3NativeArrayType : ES3CollectionType - { - public ES3NativeArrayType(Type type) : base(type) {} - public ES3NativeArrayType(Type type, ES3Type elementType) : base(type, elementType) {} - - public override void Write(object obj, ES3Writer writer, ES3.ReferenceMode memberReferenceMode) - { - if (elementType == null) - throw new ArgumentNullException("ES3Type argument cannot be null."); - - var enumerable = (IEnumerable)obj; - - int i = 0; - foreach (object item in enumerable) - { - writer.StartWriteCollectionItem(i); - writer.Write(item, elementType, memberReferenceMode); - writer.EndWriteCollectionItem(i); - i++; - } - } - - public override object Read(ES3Reader reader) - { - var array = ReadAsArray(reader); - - return ES3Reflection.CreateInstance(type, array, Allocator.Persistent); - } - - public override object Read(ES3Reader reader) - { - return Read(reader); - } - - public override void ReadInto(ES3Reader reader, object obj) - { - ReadInto(reader, obj); - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var array = ReadAsArray(reader); - var copyFromMethod = ES3Reflection.GetMethods(type, "CopyFrom").First(m => ES3Reflection.TypeIsArray(m.GetParameters()[0].GetType())); - copyFromMethod.Invoke(obj, new object[] - { - array - }); - } - - private Array ReadAsArray(ES3Reader reader) - { - List list = new List(); - if (!ReadICollection(reader, list, elementType)) - return null; - - var array = ES3Reflection.ArrayCreateInstance(elementType.type, list.Count); - int i = 0; - foreach (object item in list) - { - array.SetValue(item, i); - i++; - } - - return array; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3NativeArrayType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3NativeArrayType.cs.meta deleted file mode 100644 index fb46dc1..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3NativeArrayType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0dee780de7e2d074bb6ceff11f18d540 -timeCreated: 1519132289 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3QueueType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3QueueType.cs deleted file mode 100644 index 2c1e581..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3QueueType.cs +++ /dev/null @@ -1,148 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3QueueType : ES3CollectionType - { - public ES3QueueType(Type type) : base(type) {} - - public override void Write(object obj, ES3Writer writer, ES3.ReferenceMode memberReferenceMode) - { - var list = (ICollection)obj; - - if (elementType == null) - throw new ArgumentNullException("ES3Type argument cannot be null."); - - //writer.StartWriteCollection(); - - int i = 0; - foreach (object item in list) - { - writer.StartWriteCollectionItem(i); - writer.Write(item, elementType, memberReferenceMode); - writer.EndWriteCollectionItem(i); - i++; - } - - //writer.EndWriteCollection(); - } - - public override object Read(ES3Reader reader) - { - return Read(reader); - /*if(reader.StartReadCollection()) - return null; - - var queue = new Queue(); - - // Iterate through each character until we reach the end of the array. - while(true) - { - if(!reader.StartReadCollectionItem()) - break; - queue.Enqueue(reader.Read(elementType)); - if(reader.EndReadCollectionItem()) - break; - } - - reader.EndReadCollection(); - return queue;*/ - } - - public override void ReadInto(ES3Reader reader, object obj) - { - if (reader.StartReadCollection()) - throw new NullReferenceException("The Collection we are trying to load is stored as null, which is not allowed when using ReadInto methods."); - - int itemsLoaded = 0; - - Queue queue = (Queue)obj; - - // Iterate through each item in the collection and try to load it. - foreach (var item in queue) - { - itemsLoaded++; - - if (!reader.StartReadCollectionItem()) - break; - - reader.ReadInto(item, elementType); - - // If we find a ']', we reached the end of the array. - if (reader.EndReadCollectionItem()) - break; - // If there's still items to load, but we've reached the end of the collection we're loading into, throw an error. - if (itemsLoaded == queue.Count) - throw new IndexOutOfRangeException("The collection we are loading is longer than the collection provided as a parameter."); - } - - // If we loaded fewer items than the parameter collection, throw index out of range exception. - if (itemsLoaded != queue.Count) - throw new IndexOutOfRangeException("The collection we are loading is shorter than the collection provided as a parameter."); - - reader.EndReadCollection(); - } - - public override object Read(ES3Reader reader) - { - var instance = (IList)ES3Reflection.CreateInstance(ES3Reflection.MakeGenericType(typeof(List<>), elementType.type)); - - if (reader.StartReadCollection()) - return null; - - // Iterate through each character until we reach the end of the array. - while(true) - { - if (!reader.StartReadCollectionItem()) - break; - instance.Add(reader.Read(elementType)); - - if (reader.EndReadCollectionItem()) - break; - } - - reader.EndReadCollection(); - - return ES3Reflection.CreateInstance(type, instance); - } - - public override void ReadInto(ES3Reader reader, object obj) - { - if (reader.StartReadCollection()) - throw new NullReferenceException("The Collection we are trying to load is stored as null, which is not allowed when using ReadInto methods."); - - int itemsLoaded = 0; - - var collection = (ICollection)obj; - - // Iterate through each item in the collection and try to load it. - foreach (object item in collection) - { - itemsLoaded++; - - if (!reader.StartReadCollectionItem()) - break; - - reader.ReadInto(item, elementType); - - // If we find a ']', we reached the end of the array. - if (reader.EndReadCollectionItem()) - break; - // If there's still items to load, but we've reached the end of the collection we're loading into, throw an error. - if (itemsLoaded == collection.Count) - throw new IndexOutOfRangeException("The collection we are loading is longer than the collection provided as a parameter."); - } - - // If we loaded fewer items than the parameter collection, throw index out of range exception. - if (itemsLoaded != collection.Count) - throw new IndexOutOfRangeException("The collection we are loading is shorter than the collection provided as a parameter."); - - reader.EndReadCollection(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3QueueType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3QueueType.cs.meta deleted file mode 100644 index 98238b8..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3QueueType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0832bfdeae2dc410db8d4963332335c7 -timeCreated: 1519132279 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3StackType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3StackType.cs deleted file mode 100644 index 9c7f467..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3StackType.cs +++ /dev/null @@ -1,153 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3StackType : ES3CollectionType - { - public ES3StackType(Type type) : base(type) {} - - public override void Write(object obj, ES3Writer writer, ES3.ReferenceMode memberReferenceMode) - { - var list = (ICollection)obj; - - if (elementType == null) - throw new ArgumentNullException("ES3Type argument cannot be null."); - - //writer.StartWriteCollection(); - - int i = 0; - foreach (object item in list) - { - writer.StartWriteCollectionItem(i); - writer.Write(item, elementType, memberReferenceMode); - writer.EndWriteCollectionItem(i); - i++; - } - - //writer.EndWriteCollection(); - } - - public override object Read(ES3Reader reader) - { - return Read(reader); - /*if(reader.StartReadCollection()) - return null; - - var stack = new Stack(); - - // Iterate through each character until we reach the end of the array. - while(true) - { - if(!reader.StartReadCollectionItem()) - break; - stack.Push(reader.Read(elementType)); - if(reader.EndReadCollectionItem()) - break; - } - - reader.EndReadCollection(); - return stack;*/ - } - - public override void ReadInto(ES3Reader reader, object obj) - { - if (reader.StartReadCollection()) - throw new NullReferenceException("The Collection we are trying to load is stored as null, which is not allowed when using ReadInto methods."); - - int itemsLoaded = 0; - - Stack stack = (Stack)obj; - - // Iterate through each item in the collection and try to load it. - foreach (var item in stack) - { - itemsLoaded++; - - if (!reader.StartReadCollectionItem()) - break; - - reader.ReadInto(item, elementType); - - // If we find a ']', we reached the end of the array. - if (reader.EndReadCollectionItem()) - break; - // If there's still items to load, but we've reached the end of the collection we're loading into, throw an error. - if (itemsLoaded == stack.Count) - throw new IndexOutOfRangeException("The collection we are loading is longer than the collection provided as a parameter."); - } - - // If we loaded fewer items than the parameter collection, throw index out of range exception. - if (itemsLoaded != stack.Count) - throw new IndexOutOfRangeException("The collection we are loading is shorter than the collection provided as a parameter."); - - reader.EndReadCollection(); - } - - public override object Read(ES3Reader reader) - { - var instance = (IList)ES3Reflection.CreateInstance(ES3Reflection.MakeGenericType(typeof(List<>), elementType.type)); - - if (reader.StartReadCollection()) - return null; - - // Iterate through each character until we reach the end of the array. - while(true) - { - if (!reader.StartReadCollectionItem()) - break; - instance.Add(reader.Read(elementType)); - - if (reader.EndReadCollectionItem()) - break; - } - - reader.EndReadCollection(); - - ES3Reflection.GetMethods(instance.GetType(), "Reverse").FirstOrDefault(t => !t.IsStatic).Invoke(instance, new object[] - { - }); - return ES3Reflection.CreateInstance(type, instance); - - } - - public override void ReadInto(ES3Reader reader, object obj) - { - if (reader.StartReadCollection()) - throw new NullReferenceException("The Collection we are trying to load is stored as null, which is not allowed when using ReadInto methods."); - - int itemsLoaded = 0; - - var collection = (ICollection)obj; - - // Iterate through each item in the collection and try to load it. - foreach (object item in collection) - { - itemsLoaded++; - - if (!reader.StartReadCollectionItem()) - break; - - reader.ReadInto(item, elementType); - - // If we find a ']', we reached the end of the array. - if (reader.EndReadCollectionItem()) - break; - // If there's still items to load, but we've reached the end of the collection we're loading into, throw an error. - if (itemsLoaded == collection.Count) - throw new IndexOutOfRangeException("The collection we are loading is longer than the collection provided as a parameter."); - } - - // If we loaded fewer items than the parameter collection, throw index out of range exception. - if (itemsLoaded != collection.Count) - throw new IndexOutOfRangeException("The collection we are loading is shorter than the collection provided as a parameter."); - - reader.EndReadCollection(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3StackType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3StackType.cs.meta deleted file mode 100644 index 549bb64..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3StackType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 45a74cb7ab3d648208c9f89b7be930a7 -timeCreated: 1519132284 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3TupleType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3TupleType.cs deleted file mode 100644 index 2c9ca25..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3TupleType.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3TupleType : ES3Type - { - public ES3Type[] es3Types; - protected ES3Reflection.ES3ReflectedMethod readIntoMethod = null; - - protected ES3Reflection.ES3ReflectedMethod readMethod = null; - public Type[] types; - - public ES3TupleType(Type type) : base(type) - { - types = ES3Reflection.GetElementTypes(type); - es3Types = new ES3Type[types.Length]; - - for (int i = 0; i < types.Length; i++) - { - es3Types[i] = ES3TypeMgr.GetOrCreateES3Type(types[i], false); - if (es3Types[i] == null) - isUnsupported = true; - } - - isTuple = true; - } - - public override void Write(object obj, ES3Writer writer) - { - Write(obj, writer, writer.settings.memberReferenceMode); - } - - public void Write(object obj, ES3Writer writer, ES3.ReferenceMode memberReferenceMode) - { - if (obj == null) - { - writer.WriteNull(); - return; - } - ; - - writer.StartWriteCollection(); - - for (int i = 0; i < es3Types.Length; i++) - { - var itemProperty = ES3Reflection.GetProperty(type, "Item" + (i + 1)); - object item = itemProperty.GetValue(obj); - writer.StartWriteCollectionItem(i); - writer.Write(item, es3Types[i], memberReferenceMode); - writer.EndWriteCollectionItem(i); - } - - writer.EndWriteCollection(); - } - - public override object Read(ES3Reader reader) - { - object[] objects = new object[types.Length]; - - if (reader.StartReadCollection()) - return null; - - for (int i = 0; i < types.Length; i++) - { - reader.StartReadCollectionItem(); - objects[i] = reader.Read(es3Types[i]); - reader.EndReadCollectionItem(); - } - - reader.EndReadCollection(); - - var constructor = type.GetConstructor(types); - object instance = constructor.Invoke(objects); - - return instance; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3TupleType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3TupleType.cs.meta deleted file mode 100644 index eb7440c..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3TupleType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8d2309c133bf4514784522dda2afb0fc -timeCreated: 1519132282 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ComponentType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ComponentType.cs deleted file mode 100644 index 8139710..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ComponentType.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System; -using ES3Internal; -using UnityEngine; -using UnityEngine.Scripting; -using Object = UnityEngine.Object; - -namespace ES3Types -{ - [Preserve] - public abstract class ES3ComponentType : ES3UnityObjectType - { - - protected const string gameObjectPropertyName = "goID"; - public ES3ComponentType(Type type) : base(type) {} - - protected abstract void WriteComponent(object obj, ES3Writer writer); - protected abstract void ReadComponent(ES3Reader reader, object obj); - - protected override void WriteUnityObject(object obj, ES3Writer writer) - { - var instance = obj as Component; - if (obj != null && instance == null) - throw new ArgumentException("Only types of UnityEngine.Component can be written with this method, but argument given is type of " + obj.GetType()); - - var refMgr = ES3ReferenceMgrBase.Current; - - if (refMgr != null) - { - // Write the reference of the GameObject so we know what one to attach it to. - writer.WriteProperty(gameObjectPropertyName, refMgr.Add(instance.gameObject).ToString(), ES3Type_string.Instance); - } - WriteComponent(instance, writer); - } - - protected override void ReadUnityObject(ES3Reader reader, object obj) - { - ReadComponent(reader, obj); - } - - protected override object ReadUnityObject(ES3Reader reader) - { - throw new NotImplementedException(); - } - - /* - * It's IMPORTANT that we override ReadObject in ES3UnityObjectType rather than use ReadUnityObject because otherwise the first IF statement will never be called, - * and we will never get the reference ID for the Component we're loading, so if we create a new Component we cannot assign it's correct reference ID. - */ - protected override object ReadObject(ES3Reader reader) - { - var refMgr = ES3ReferenceMgrBase.Current; - long id = -1; - Object instance = null; - - foreach (string propertyName in reader.Properties) - { - if (propertyName == ES3ReferenceMgrBase.referencePropertyName) - { - id = reader.Read_ref(); - instance = refMgr.Get(id, true); - - /*if (instance != null) - break;*/ - } - else if (propertyName == gameObjectPropertyName) - { - long goID = reader.Read_ref(); - - // If we already have an instance for this Component, don't attempt to create a new GameObject for it. - if (instance != null) - break; - - var go = (GameObject)refMgr.Get(goID, type); - - if (go == null) - { - go = new GameObject("Easy Save 3 Loaded GameObject"); -#if UNITY_EDITOR - go.AddComponent().SetMessage("This GameObject was created because Easy Save could not find a GameObject in the scene with the same instance ID as the GameObject the Component we are loading is attached to.\nTo prevent this from being created, use the LoadInto methods to tell Easy Save what Component the data should be loaded in to."); -#endif - refMgr.Add(go, goID); - } - instance = GetOrAddComponent(go, type); - refMgr.Add(instance, id); - break; - } - else - { - reader.overridePropertiesName = propertyName; - if (instance == null) - { - var go = new GameObject("Easy Save 3 Loaded GameObject"); -#if UNITY_EDITOR - go.AddComponent().SetMessage("This GameObject was created because Easy Save could not find a GameObject in the scene with the same instance ID as the GameObject the Component we are loading is attached to.\nTo prevent this from being created, use the LoadInto methods to tell Easy Save what Component the data should be loaded in to."); -#endif - instance = GetOrAddComponent(go, type); - refMgr.Add(instance, id); - refMgr.Add(go); - } - break; - } - } - - if (instance != null) - ReadComponent(reader, instance); - - return instance; - } - - private static Component GetOrAddComponent(GameObject go, Type type) - { - var c = go.GetComponent(type); - if (c != null) - return c; - return go.AddComponent(type); - - /*if (type == typeof(Transform)) - return go.GetComponent(type); - // Manage types which can only have a single Component attached. - else if (type == typeof(MeshFilter) || type.Name.ToString().Contains("Renderer") || ES3Reflection.AttributeIsDefined(type, typeof(DisallowMultipleComponent))) - return GetOrCreateComponentIfNotExists(go, type); - return go.AddComponent(type);*/ - } - - public static Component CreateComponent(Type type) - { - var go = new GameObject("Easy Save 3 Loaded Component"); -#if UNITY_EDITOR - // If we're running in the Editor, add a description explaining why this object was created. - go.AddComponent().SetMessage("This GameObject was created because Easy Save tried to load a Component with an instance ID which does not exist in this scene.\nTo prevent this from being created, use the LoadInto methods to tell Easy Save what Component the data should be loaded in to.\nThis can also happen if you load a class which references another object, but that object has not yet been loaded. In this case, you should load the object the class references before loading the class."); -#endif - if (type == typeof(Transform)) - return go.GetComponent(type); - return GetOrAddComponent(go, type); - } - - // Creates a Component if one doesn't exist, or returns the existing instance. - /*public static Component GetOrCreateComponentIfNotExists(GameObject go, Type type) - { - Component mf; - if ((mf = go.GetComponent(type)) != null) - return mf; - return go.AddComponent(type); - }*/ - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ComponentType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ComponentType.cs.meta deleted file mode 100644 index c7ba402..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ComponentType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6d82e3d10b49c4028bca528611e53210 -timeCreated: 1499764822 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs deleted file mode 100644 index 458bd13..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public abstract class ES3ObjectType : ES3Type - { - public ES3ObjectType(Type type) : base(type) {} - - protected abstract void WriteObject(object obj, ES3Writer writer); - protected abstract object ReadObject(ES3Reader reader); - - protected virtual void ReadObject(ES3Reader reader, object obj) - { - throw new NotSupportedException("ReadInto is not supported for type " + type); - } - - public override void Write(object obj, ES3Writer writer) - { - if (!WriteUsingDerivedType(obj, writer)) - { - var baseType = ES3Reflection.BaseType(obj.GetType()); - if (baseType != typeof(object)) - { - var es3Type = ES3TypeMgr.GetOrCreateES3Type(baseType, false); - // If it's a Dictionary or Collection, we need to write it as a field with a property name. - if (es3Type != null && (es3Type.isDictionary || es3Type.isCollection)) - writer.WriteProperty("_Values", obj, es3Type); - } - - WriteObject(obj, writer); - } - } - - public override object Read(ES3Reader reader) - { - string propertyName; - while(true) - { - propertyName = ReadPropertyName(reader); - - if (propertyName == typeFieldName) - return ES3TypeMgr.GetOrCreateES3Type(reader.ReadType()).Read(reader); - reader.overridePropertiesName = propertyName; - - return ReadObject(reader); - } - } - - public override void ReadInto(ES3Reader reader, object obj) - { - string propertyName; - while(true) - { - propertyName = ReadPropertyName(reader); - - if (propertyName == typeFieldName) - { - ES3TypeMgr.GetOrCreateES3Type(reader.ReadType()).ReadInto(reader, obj); - return; - } - // This is important we return if the enumerator returns null, otherwise we will encounter an endless cycle. - if (propertyName == null) - return; - reader.overridePropertiesName = propertyName; - ReadObject(reader, obj); - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs.meta deleted file mode 100644 index fd73df3..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2becffd8c9d4e4e0db6031d9680eae48 -timeCreated: 1499764821 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3Property.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3Property.cs deleted file mode 100644 index 2a3955b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3Property.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; - -namespace ES3Internal -{ - public class ES3Member - { - public bool isProperty; - public string name; - public ES3Reflection.ES3ReflectedMember reflectedMember; - public Type type; - public bool useReflection; - - public ES3Member(string name, Type type, bool isProperty) - { - this.name = name; - this.type = type; - this.isProperty = isProperty; - } - - public ES3Member(ES3Reflection.ES3ReflectedMember reflectedMember) - { - this.reflectedMember = reflectedMember; - name = reflectedMember.Name; - type = reflectedMember.MemberType; - isProperty = reflectedMember.isProperty; - useReflection = true; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3Property.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3Property.cs.meta deleted file mode 100644 index f3f82e0..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3Property.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b987e63c8e10f448c8364eaceddd96e5 -timeCreated: 1519132295 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ScriptableObjectType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ScriptableObjectType.cs deleted file mode 100644 index b01f101..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ScriptableObjectType.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using ES3Internal; -using UnityEngine; -using UnityEngine.Scripting; -using Object = UnityEngine.Object; - -namespace ES3Types -{ - [Preserve] - public abstract class ES3ScriptableObjectType : ES3UnityObjectType - { - public ES3ScriptableObjectType(Type type) : base(type) {} - - protected abstract void WriteScriptableObject(object obj, ES3Writer writer); - protected abstract void ReadScriptableObject(ES3Reader reader, object obj); - - protected override void WriteUnityObject(object obj, ES3Writer writer) - { - var instance = obj as ScriptableObject; - if (obj != null && instance == null) - throw new ArgumentException("Only types of UnityEngine.ScriptableObject can be written with this method, but argument given is type of " + obj.GetType()); - - // If this object is in the instance manager, store it's instance ID with it. - /*var refMgr = ES3ReferenceMgrBase.Current; - if(refMgr != null) - writer.WriteRef(instance);*/ - WriteScriptableObject(instance, writer); - } - - protected override void ReadUnityObject(ES3Reader reader, object obj) - { - ReadScriptableObject(reader, obj); - } - - protected override object ReadUnityObject(ES3Reader reader) - { - throw new NotImplementedException(); - } - - - protected override object ReadObject(ES3Reader reader) - { - var refMgr = ES3ReferenceMgrBase.Current; - long id = -1; - Object instance = null; - - foreach (string propertyName in reader.Properties) - { - if (propertyName == ES3ReferenceMgrBase.referencePropertyName && refMgr != null) - { - id = reader.Read_ref(); - instance = refMgr.Get(id, type); - - if (instance != null) - break; - } - else - { - reader.overridePropertiesName = propertyName; - - if (instance == null) - { - instance = ScriptableObject.CreateInstance(type); - if (refMgr != null) - refMgr.Add(instance, id); - } - - break; - } - } - - ReadScriptableObject(reader, instance); - return instance; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ScriptableObjectType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ScriptableObjectType.cs.meta deleted file mode 100644 index f3d9c7b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3ScriptableObjectType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a26529496f04146959460074ab1a9b3f -timeCreated: 1519132293 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3Type.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3Type.cs deleted file mode 100644 index d0f5b12..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3Type.cs +++ /dev/null @@ -1,200 +0,0 @@ -using System; -using System.Collections; -using System.ComponentModel; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [EditorBrowsable(EditorBrowsableState.Never)] - [Preserve] - public abstract class ES3Type - { - public const string typeFieldName = "__type"; - public bool isCollection = false; - public bool isDictionary = false; - public bool isEnum = false; - public bool isES3TypeUnityObject = false; - public bool isPrimitive = false; - public bool isReflectedType = false; - public bool isTuple = false; - public bool isUnsupported = false; - public bool isValueType; - - public ES3Member[] members; - public int priority = 0; - public Type type; - - protected ES3Type(Type type) - { - ES3TypeMgr.Add(type, this); - this.type = type; - isValueType = ES3Reflection.IsValueType(type); - } - - public abstract void Write(object obj, ES3Writer writer); - public abstract object Read(ES3Reader reader); - - public virtual void ReadInto(ES3Reader reader, object obj) - { - throw new NotImplementedException("Self-assigning Read is not implemented or supported on this type."); - } - - protected bool WriteUsingDerivedType(object obj, ES3Writer writer) - { - var objType = obj.GetType(); - - if (objType != type) - { - writer.WriteType(objType); - ES3TypeMgr.GetOrCreateES3Type(objType).Write(obj, writer); - return true; - } - return false; - } - - protected void ReadUsingDerivedType(ES3Reader reader, object obj) - { - ES3TypeMgr.GetOrCreateES3Type(reader.ReadType()).ReadInto(reader, obj); - } - - internal string ReadPropertyName(ES3Reader reader) - { - if (reader.overridePropertiesName != null) - { - string propertyName = reader.overridePropertiesName; - reader.overridePropertiesName = null; - return propertyName; - } - return reader.ReadPropertyName(); - } - - #region Reflection Methods - - protected void WriteProperties(object obj, ES3Writer writer) - { - if (members == null) - GetMembers(writer.settings.safeReflection); - - for (int i = 0; i < members.Length; i++) - { - var property = members[i]; - writer.WriteProperty(property.name, property.reflectedMember.GetValue(obj), ES3TypeMgr.GetOrCreateES3Type(property.type), writer.settings.memberReferenceMode); - } - } - - protected object ReadProperties(ES3Reader reader, object obj) - { - // Iterate through each property in the file and try to load it using the appropriate - // ES3Member in the members array. - foreach (string propertyName in reader.Properties) - { - // Find the property. - ES3Member property = null; - for (int i = 0; i < members.Length; i++) - { - if (members[i].name == propertyName) - { - property = members[i]; - break; - } - } - - // If this is a class which derives directly from a Collection, we need to load it's dictionary first. - if (propertyName == "_Values") - { - var baseType = ES3TypeMgr.GetOrCreateES3Type(ES3Reflection.BaseType(obj.GetType())); - if (baseType.isDictionary) - { - var dict = (IDictionary)obj; - var loaded = (IDictionary)baseType.Read(reader); - foreach (DictionaryEntry kvp in loaded) - dict[kvp.Key] = kvp.Value; - } - else if (baseType.isCollection) - { - var loaded = (IEnumerable)baseType.Read(reader); - - var type = baseType.GetType(); - - if (type == typeof(ES3ListType)) - foreach (object item in loaded) - ((IList)obj).Add(item); - else if (type == typeof(ES3QueueType)) - { - var method = baseType.type.GetMethod("Enqueue"); - foreach (object item in loaded) - method.Invoke(obj, new[] - { - item - }); - } - else if (type == typeof(ES3StackType)) - { - var method = baseType.type.GetMethod("Push"); - foreach (object item in loaded) - method.Invoke(obj, new[] - { - item - }); - } - else if (type == typeof(ES3HashSetType)) - { - var method = baseType.type.GetMethod("Add"); - foreach (object item in loaded) - method.Invoke(obj, new[] - { - item - }); - } - } - } - - if (property == null) - reader.Skip(); - else - { - var type = ES3TypeMgr.GetOrCreateES3Type(property.type); - - if (ES3Reflection.IsAssignableFrom(typeof(ES3DictionaryType), type.GetType())) - property.reflectedMember.SetValue(obj, ((ES3DictionaryType)type).Read(reader)); - else if (ES3Reflection.IsAssignableFrom(typeof(ES3CollectionType), type.GetType())) - property.reflectedMember.SetValue(obj, ((ES3CollectionType)type).Read(reader)); - else - { - object readObj = reader.Read(type); - property.reflectedMember.SetValue(obj, readObj); - } - } - } - return obj; - } - - protected void GetMembers(bool safe) - { - GetMembers(safe, null); - } - - protected void GetMembers(bool safe, string[] memberNames) - { - ES3Reflection.ES3ReflectedMember[] serializedMembers = ES3Reflection.GetSerializableMembers(type, safe, memberNames); - - members = new ES3Member[serializedMembers.Length]; - for (int i = 0; i < serializedMembers.Length; i++) - members[i] = new ES3Member(serializedMembers[i]); - } - - #endregion - } - - [AttributeUsage(AttributeTargets.Class)] - public class ES3PropertiesAttribute : Attribute - { - public readonly string[] members; - - public ES3PropertiesAttribute(params string[] members) - { - this.members = members; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3Type.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3Type.cs.meta deleted file mode 100644 index 4cbc991..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3Type.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 03469b5a3eca74a2d932f1c5f39ecf4e -timeCreated: 1519132279 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3TypeMgr.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3TypeMgr.cs deleted file mode 100644 index 82ccc54..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3TypeMgr.cs +++ /dev/null @@ -1,157 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using ES3Types; -using Unity.Collections; -using UnityEngine; -using UnityEngine.Scripting; -using Component = UnityEngine.Component; -using Object = UnityEngine.Object; - -namespace ES3Internal -{ - [Preserve] - public static class ES3TypeMgr - { - private static readonly object _lock = new object(); - - [EditorBrowsable(EditorBrowsableState.Never)] - public static Dictionary types; - - // We cache the last accessed type as we quite often use the same type multiple times, - // so this improves performance as another lookup is not required. - private static ES3Type lastAccessedType; - - public static ES3Type GetOrCreateES3Type(Type type, bool throwException = true) - { - if (types == null) - Init(); - - if (type != typeof(object) && lastAccessedType != null && lastAccessedType.type == type) - return lastAccessedType; - - // If type doesn't exist, create one. - if (types.TryGetValue(type, out lastAccessedType)) - return lastAccessedType; - return lastAccessedType = CreateES3Type(type, throwException); - } - - public static ES3Type GetES3Type(Type type) - { - if (types == null) - Init(); - - if (types.TryGetValue(type, out lastAccessedType)) - return lastAccessedType; - return null; - } - - internal static void Add(Type type, ES3Type es3Type) - { - if (types == null) - Init(); - - var existingType = GetES3Type(type); - if (existingType != null && existingType.priority > es3Type.priority) - return; - - lock (_lock) - { - types[type] = es3Type; - } - } - - internal static ES3Type CreateES3Type(Type type, bool throwException = true) - { - ES3Type es3Type; - - if (ES3Reflection.IsEnum(type)) - return new ES3Type_enum(type); - if (ES3Reflection.TypeIsArray(type)) - { - int rank = ES3Reflection.GetArrayRank(type); - if (rank == 1) - es3Type = new ES3ArrayType(type); - else if (rank == 2) - es3Type = new ES32DArrayType(type); - else if (rank == 3) - es3Type = new ES33DArrayType(type); - else if (throwException) - throw new NotSupportedException("Only arrays with up to three dimensions are supported by Easy Save."); - else - return null; - } - else if (ES3Reflection.IsGenericType(type) && ES3Reflection.ImplementsInterface(type, typeof(IEnumerable))) - { - var genericType = ES3Reflection.GetGenericTypeDefinition(type); - if (typeof(List<>).IsAssignableFrom(genericType)) - es3Type = new ES3ListType(type); - else if (typeof(Dictionary<,>).IsAssignableFrom(genericType)) - es3Type = new ES3DictionaryType(type); - else if (genericType == typeof(Queue<>)) - es3Type = new ES3QueueType(type); - else if (genericType == typeof(Stack<>)) - es3Type = new ES3StackType(type); - else if (genericType == typeof(HashSet<>)) - es3Type = new ES3HashSetType(type); - else if (genericType == typeof(NativeArray<>)) - es3Type = new ES3NativeArrayType(type); - else if (throwException) - throw new NotSupportedException("Generic type \"" + type + "\" is not supported by Easy Save."); - else - return null; - } - else if (ES3Reflection.IsPrimitive(type)) // ERROR: We should not have to create an ES3Type for a primitive. - { - if (types == null || types.Count == 0) // If the type list is not initialised, it is most likely an initialisation error. - throw new TypeLoadException("ES3Type for primitive could not be found, and the type list is empty. Please contact Easy Save developers at http://www.moodkie.com/contact"); - // Else it's a different error, possibly an error in the specific ES3Type for that type. - throw new TypeLoadException("ES3Type for primitive could not be found, but the type list has been initialised and is not empty. Please contact Easy Save developers on mail@moodkie.com"); - } - else - { - if (ES3Reflection.IsAssignableFrom(typeof(Component), type)) - es3Type = new ES3ReflectedComponentType(type); - else if (ES3Reflection.IsValueType(type)) - es3Type = new ES3ReflectedValueType(type); - else if (ES3Reflection.IsAssignableFrom(typeof(ScriptableObject), type)) - es3Type = new ES3ReflectedScriptableObjectType(type); - else if (ES3Reflection.IsAssignableFrom(typeof(Object), type)) - es3Type = new ES3ReflectedUnityObjectType(type); - /*else if (ES3Reflection.HasParameterlessConstructor(type) || ES3Reflection.IsAbstract(type) || ES3Reflection.IsInterface(type)) - es3Type = new ES3ReflectedObjectType(type);*/ - else if (type.Name.StartsWith("Tuple`")) - es3Type = new ES3TupleType(type); - /*else if (throwException) - throw new NotSupportedException("Type of " + type + " is not supported as it does not have a parameterless constructor. Only value types, Components or ScriptableObjects are supportable without a parameterless constructor. However, you may be able to create an ES3Type script to add support for it.");*/ - else - es3Type = new ES3ReflectedObjectType(type); - } - - if (es3Type.type == null || es3Type.isUnsupported) - { - if (throwException) - throw new NotSupportedException(string.Format("ES3Type.type is null when trying to create an ES3Type for {0}, possibly because the element type is not supported.", type)); - return null; - } - - Add(type, es3Type); - return es3Type; - } - - internal static void Init() - { - lock (_lock) - { - types = new Dictionary(); - // ES3Types add themselves to the types Dictionary. - ES3Reflection.GetInstances(); - - // Check that the type list was initialised correctly. - if (types == null || types.Count == 0) - throw new TypeLoadException("Type list could not be initialised. Please contact Easy Save developers on mail@moodkie.com."); - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3TypeMgr.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3TypeMgr.cs.meta deleted file mode 100644 index 3b697d6..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3TypeMgr.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ed6202a98cbc545a0842c63cf8894b99 -timeCreated: 1499764823 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3UnityObjectType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3UnityObjectType.cs deleted file mode 100644 index cf60692..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3UnityObjectType.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System; -using ES3Internal; -using UnityEngine.Scripting; -using Object = UnityEngine.Object; - -namespace ES3Types -{ - [Preserve] - public abstract class ES3UnityObjectType : ES3ObjectType - { - public ES3UnityObjectType(Type type) : base(type) - { - isValueType = false; - isES3TypeUnityObject = true; - } - - protected abstract void WriteUnityObject(object obj, ES3Writer writer); - protected abstract void ReadUnityObject(ES3Reader reader, object obj); - protected abstract object ReadUnityObject(ES3Reader reader); - - protected override void WriteObject(object obj, ES3Writer writer) - { - WriteObject(obj, writer, ES3.ReferenceMode.ByRefAndValue); - } - - public virtual void WriteObject(object obj, ES3Writer writer, ES3.ReferenceMode mode) - { - if (WriteUsingDerivedType(obj, writer, mode)) - return; - var instance = obj as Object; - if (obj != null && instance == null) - throw new ArgumentException("Only types of UnityEngine.Object can be written with this method, but argument given is type of " + obj.GetType()); - - // If this object is in the instance manager, store it's instance ID with it. - if (mode != ES3.ReferenceMode.ByValue) - { - var refMgr = ES3ReferenceMgrBase.Current; - if (refMgr == null) - throw new InvalidOperationException("An Easy Save 3 Manager is required to load references. To add one to your scene, exit playmode and go to Tools > Easy Save 3 > Add Manager to Scene"); - writer.WriteRef(instance); - if (mode == ES3.ReferenceMode.ByRef) - return; - } - WriteUnityObject(instance, writer); - } - - protected override void ReadObject(ES3Reader reader, object obj) - { - var refMgr = ES3ReferenceMgrBase.Current; - if (refMgr != null) - { - foreach (string propertyName in reader.Properties) - { - if (propertyName == ES3ReferenceMgrBase.referencePropertyName) - // If the object we're loading into isn't registered with the reference manager, register it. - refMgr.Add((Object)obj, reader.Read_ref()); - else - { - reader.overridePropertiesName = propertyName; - break; - } - } - } - ReadUnityObject(reader, obj); - } - - protected override object ReadObject(ES3Reader reader) - { - var refMgr = ES3ReferenceMgrBase.Current; - if (refMgr == null) - return ReadUnityObject(reader); - - long id = -1; - Object instance = null; - - foreach (string propertyName in reader.Properties) - { - if (propertyName == ES3ReferenceMgrBase.referencePropertyName) - { - if (refMgr == null) - throw new InvalidOperationException("An Easy Save 3 Manager is required to load references. To add one to your scene, exit playmode and go to Tools > Easy Save 3 > Add Manager to Scene"); - id = reader.Read_ref(); - instance = refMgr.Get(id, type); - - if (instance != null) - break; - } - else - { - reader.overridePropertiesName = propertyName; - if (instance == null) - { - instance = (Object)ReadUnityObject(reader); - refMgr.Add(instance, id); - } - break; - } - } - - ReadUnityObject(reader, instance); - return instance; - } - - protected bool WriteUsingDerivedType(object obj, ES3Writer writer, ES3.ReferenceMode mode) - { - var objType = obj.GetType(); - - if (objType != type) - { - writer.WriteType(objType); - - var es3Type = ES3TypeMgr.GetOrCreateES3Type(objType); - if (es3Type is ES3UnityObjectType) - ((ES3UnityObjectType)es3Type).WriteObject(obj, writer, mode); - else - es3Type.Write(obj, writer); - - return true; - } - return false; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3UnityObjectType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/ES3UnityObjectType.cs.meta deleted file mode 100644 index ac4d029..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/ES3UnityObjectType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6206e73d6e9414301b5475296e1103a2 -timeCreated: 1519132286 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types.meta deleted file mode 100644 index f2de032..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 01ada09c8494e744a87f6e4bc52f3235 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_BigInteger.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_BigInteger.cs deleted file mode 100644 index 1672a96..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_BigInteger.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Numerics; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3Properties("bytes")] - public class ES3Type_BigInteger : ES3Type - { - public static ES3Type Instance; - - public ES3Type_BigInteger() : base(typeof(BigInteger)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var casted = (BigInteger)obj; - writer.WriteProperty("bytes", casted.ToByteArray(), ES3Type_byteArray.Instance); - } - - public override object Read(ES3Reader reader) - { - return new BigInteger(reader.ReadProperty(ES3Type_byteArray.Instance)); - } - } - - public class ES3Type_BigIntegerArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_BigIntegerArray() : base(typeof(BigInteger[]), ES3Type_BigInteger.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_BigInteger.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_BigInteger.cs.meta deleted file mode 100644 index 70524b5..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_BigInteger.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b3375f14105a7074b92a27519e7a9bb4 -timeCreated: 1538210707 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_Random.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_Random.cs deleted file mode 100644 index 830526d..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_Random.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * System.Random is no longer serializable at runtime due to Unity changing the implementation away from .NET. - */ - -namespace ES3Types -{ -#if !UNITY_2021_2_OR_NEWER - [UnityEngine.Scripting.Preserve] - [ES3PropertiesAttribute("inext", "inextp", "SeedArray")] - public class ES3Type_Random : ES3ObjectType - { - public static ES3Type Instance = null; - - public ES3Type_Random() : base(typeof(System.Random)){ Instance = this; } - - protected override void WriteObject(object obj, ES3Writer writer) - { - var instance = (System.Random)obj; - - writer.WritePrivateField("inext", instance); - writer.WritePrivateField("inextp", instance); - writer.WritePrivateField("SeedArray", instance); - } - - protected override void ReadObject(ES3Reader reader, object obj) - { - var instance = (System.Random)obj; - foreach(string propertyName in reader.Properties) - { - switch(propertyName) - { - - case "inext": - reader.SetPrivateField("inext", reader.Read(), instance); - break; - case "inextp": - reader.SetPrivateField("inextp", reader.Read(), instance); - break; - case "SeedArray": - reader.SetPrivateField("SeedArray", reader.Read(), instance); - break; - default: - reader.Skip(); - break; - } - } - } - - protected override object ReadObject(ES3Reader reader) - { - var instance = new System.Random(); - ReadObject(reader, instance); - return instance; - } - } - - public class ES3Type_RandomArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_RandomArray() : base(typeof(System.Random[]), ES3Type_Random.Instance) - { - Instance = this; - } - } -#endif -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_Random.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_Random.cs.meta deleted file mode 100644 index a207ee3..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_Random.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 84232cc4cb5a646249f6ebe5eeee1e97 -timeCreated: 1538210707 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_Type.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_Type.cs deleted file mode 100644 index 473ba77..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_Type.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3Properties] - public class ES3Type_Type : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Type() : base(typeof(Type)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var type = (Type)obj; - writer.WriteProperty("assemblyQualifiedName", type.AssemblyQualifiedName); - } - - public override object Read(ES3Reader reader) - { - return Type.GetType(reader.ReadProperty()); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_Type.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_Type.cs.meta deleted file mode 100644 index 6e403dc..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/NET Types/ES3Type_Type.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 1fe3873c075a7c2409980f2e5e400017 -timeCreated: 1538210707 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types.meta deleted file mode 100644 index ec25ae6..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 045cb4c329b0141ea8d3acd96dff32c2 -folderAsset: yes -timeCreated: 1499764821 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_DateTime.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_DateTime.cs deleted file mode 100644 index 018434f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_DateTime.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_DateTime : ES3Type - { - public static ES3Type Instance; - - public ES3Type_DateTime() : base(typeof(DateTime)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WriteProperty("ticks", ((DateTime)obj).Ticks, ES3Type_long.Instance); - } - - public override object Read(ES3Reader reader) - { - reader.ReadPropertyName(); - return new DateTime(reader.Read(ES3Type_long.Instance)); - } - } - - public class ES3Type_DateTimeArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_DateTimeArray() : base(typeof(DateTime[]), ES3Type_DateTime.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_DateTime.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_DateTime.cs.meta deleted file mode 100644 index ed6ed0a..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_DateTime.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9c9737ff78c714548af339e220b90303 -timeCreated: 1519132292 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ES3Ref.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ES3Ref.cs deleted file mode 100644 index fa7ff69..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ES3Ref.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Collections.Generic; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_ES3Ref : ES3Type - { - public static ES3Type Instance = new ES3Type_ES3Ref(); - - public ES3Type_ES3Ref() : base(typeof(long)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive(((long)obj).ToString()); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)new ES3Ref(reader.Read_ref()); - } - } - - public class ES3Type_ES3RefArray : ES3ArrayType - { - public static ES3Type Instance = new ES3Type_ES3RefArray(); - - public ES3Type_ES3RefArray() : base(typeof(ES3Ref[]), ES3Type_ES3Ref.Instance) - { - Instance = this; - } - } - - public class ES3Type_ES3RefDictionary : ES3DictionaryType - { - public static ES3Type Instance = new ES3Type_ES3RefDictionary(); - - public ES3Type_ES3RefDictionary() : base(typeof(Dictionary), ES3Type_ES3Ref.Instance, ES3Type_ES3Ref.Instance) - { - Instance = this; - } - } -} - -public class ES3Ref -{ - public long id; - public ES3Ref(long id) - { - this.id = id; - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ES3Ref.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ES3Ref.cs.meta deleted file mode 100644 index a88c0e0..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ES3Ref.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ab1dd0b4209f2c144ad424236e639426 -timeCreated: 1519132294 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_UIntPtr.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_UIntPtr.cs deleted file mode 100644 index be4c1c4..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_UIntPtr.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_UIntPtr : ES3Type - { - public static ES3Type Instance; - - public ES3Type_UIntPtr() : base(typeof(UIntPtr)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((ulong)obj); - } - - public override object Read(ES3Reader reader) - { - return reader.Read_ulong(); - } - } - - public class ES3Type_UIntPtrArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_UIntPtrArray() : base(typeof(UIntPtr[]), ES3Type_UIntPtr.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_UIntPtr.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_UIntPtr.cs.meta deleted file mode 100644 index e1a3ccb..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_UIntPtr.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6fe9eb4dc6fa54989a516115e34602df -timeCreated: 1519132288 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_bool.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_bool.cs deleted file mode 100644 index 3a6c1e1..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_bool.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_bool : ES3Type - { - public static ES3Type Instance; - - public ES3Type_bool() : base(typeof(bool)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((bool)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_bool(); - } - } - - public class ES3Type_boolArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_boolArray() : base(typeof(bool[]), ES3Type_bool.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_bool.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_bool.cs.meta deleted file mode 100644 index 81ea5f7..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_bool.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6fa779d8184f649f897074ba540ab1f9 -timeCreated: 1519132288 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byte.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byte.cs deleted file mode 100644 index 3489cfc..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byte.cs +++ /dev/null @@ -1,26 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_byte : ES3Type - { - public static ES3Type Instance; - - public ES3Type_byte() : base(typeof(byte)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((byte)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_byte(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byte.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byte.cs.meta deleted file mode 100644 index d72b280..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byte.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0c6f8718240d84f40a9d4b3ac41b3398 -timeCreated: 1519132280 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byteArray.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byteArray.cs deleted file mode 100644 index 996250e..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byteArray.cs +++ /dev/null @@ -1,26 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_byteArray : ES3Type - { - public static ES3Type Instance; - - public ES3Type_byteArray() : base(typeof(byte[])) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((byte[])obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_byteArray(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byteArray.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byteArray.cs.meta deleted file mode 100644 index 614f5dc..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byteArray.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 59bd4a4624c4a4082bb3b8333a399ee2 -timeCreated: 1519132286 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_char.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_char.cs deleted file mode 100644 index c3b81af..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_char.cs +++ /dev/null @@ -1,35 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_char : ES3Type - { - public static ES3Type Instance; - - public ES3Type_char() : base(typeof(char)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((char)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_char(); - } - } - public class ES3Type_charArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_charArray() : base(typeof(char[]), ES3Type_char.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_char.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_char.cs.meta deleted file mode 100644 index 4e5cc82..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_char.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: fdc3981e5018244468c97a2bbcbb610a -timeCreated: 1519132301 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_decimal.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_decimal.cs deleted file mode 100644 index e07724c..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_decimal.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_decimal : ES3Type - { - public static ES3Type Instance; - - public ES3Type_decimal() : base(typeof(decimal)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((decimal)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_decimal(); - } - } - - public class ES3Type_decimalArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_decimalArray() : base(typeof(decimal[]), ES3Type_decimal.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_decimal.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_decimal.cs.meta deleted file mode 100644 index 78ea5c7..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_decimal.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 030f062403dc345f78476442992e3c9c -timeCreated: 1519132279 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_double.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_double.cs deleted file mode 100644 index 640448b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_double.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_double : ES3Type - { - public static ES3Type Instance; - - public ES3Type_double() : base(typeof(double)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((double)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_double(); - } - } - - public class ES3Type_doubleArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_doubleArray() : base(typeof(double[]), ES3Type_double.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_double.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_double.cs.meta deleted file mode 100644 index 5ccb756..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_double.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c445261bbbfc24045863aa3c2c097a73 -timeCreated: 1519132296 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_enum.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_enum.cs deleted file mode 100644 index ff42f67..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_enum.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_enum : ES3Type - { - public static ES3Type Instance; - private readonly Type underlyingType; - - public ES3Type_enum(Type type) : base(type) - { - isPrimitive = true; - isEnum = true; - Instance = this; - underlyingType = Enum.GetUnderlyingType(type); - } - - public override void Write(object obj, ES3Writer writer) - { - if (underlyingType == typeof(int)) writer.WritePrimitive((int)obj); - else if (underlyingType == typeof(bool)) writer.WritePrimitive((bool)obj); - else if (underlyingType == typeof(byte)) writer.WritePrimitive((byte)obj); - else if (underlyingType == typeof(char)) writer.WritePrimitive((char)obj); - else if (underlyingType == typeof(decimal)) writer.WritePrimitive((decimal)obj); - else if (underlyingType == typeof(double)) writer.WritePrimitive((double)obj); - else if (underlyingType == typeof(float)) writer.WritePrimitive((float)obj); - else if (underlyingType == typeof(long)) writer.WritePrimitive((long)obj); - else if (underlyingType == typeof(sbyte)) writer.WritePrimitive((sbyte)obj); - else if (underlyingType == typeof(short)) writer.WritePrimitive((short)obj); - else if (underlyingType == typeof(uint)) writer.WritePrimitive((uint)obj); - else if (underlyingType == typeof(ulong)) writer.WritePrimitive((ulong)obj); - else if (underlyingType == typeof(ushort)) writer.WritePrimitive((ushort)obj); - else - throw new InvalidCastException("The underlying type " + underlyingType + " of Enum " + type + " is not supported"); - - } - - public override object Read(ES3Reader reader) - { - if (underlyingType == typeof(int)) return Enum.ToObject(type, reader.Read_int()); - if (underlyingType == typeof(bool)) return Enum.ToObject(type, reader.Read_bool()); - if (underlyingType == typeof(byte)) return Enum.ToObject(type, reader.Read_byte()); - if (underlyingType == typeof(char)) return Enum.ToObject(type, reader.Read_char()); - if (underlyingType == typeof(decimal)) return Enum.ToObject(type, reader.Read_decimal()); - if (underlyingType == typeof(double)) return Enum.ToObject(type, reader.Read_double()); - if (underlyingType == typeof(float)) return Enum.ToObject(type, reader.Read_float()); - if (underlyingType == typeof(long)) return Enum.ToObject(type, reader.Read_long()); - if (underlyingType == typeof(sbyte)) return Enum.ToObject(type, reader.Read_sbyte()); - if (underlyingType == typeof(short)) return Enum.ToObject(type, reader.Read_short()); - if (underlyingType == typeof(uint)) return Enum.ToObject(type, reader.Read_uint()); - if (underlyingType == typeof(ulong)) return Enum.ToObject(type, reader.Read_ulong()); - if (underlyingType == typeof(ushort)) return Enum.ToObject(type, reader.Read_ushort()); - throw new InvalidCastException("The underlying type " + underlyingType + " of Enum " + type + " is not supported"); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_enum.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_enum.cs.meta deleted file mode 100644 index 822eee4..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_enum.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0bc176cf7e9c84850b4ead41131e66af -timeCreated: 1519132280 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_float.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_float.cs deleted file mode 100644 index d1e8f25..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_float.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_float : ES3Type - { - public static ES3Type Instance; - - public ES3Type_float() : base(typeof(float)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((float)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_float(); - } - } - - public class ES3Type_floatArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_floatArray() : base(typeof(float[]), ES3Type_float.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_float.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_float.cs.meta deleted file mode 100644 index a27a1f6..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_float.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f40643b43129b41ff9143c8a23741391 -timeCreated: 1519132300 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_int.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_int.cs deleted file mode 100644 index 7fa7849..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_int.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_int : ES3Type - { - public static ES3Type Instance; - - public ES3Type_int() : base(typeof(int)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((int)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_int(); - } - } - - public class ES3Type_intArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_intArray() : base(typeof(int[]), ES3Type_int.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_int.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_int.cs.meta deleted file mode 100644 index 53a2beb..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_int.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 13efdffd9de75437f8eb6d09e595e70d -timeCreated: 1519132280 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_intptr.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_intptr.cs deleted file mode 100644 index 52ab694..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_intptr.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_IntPtr : ES3Type - { - public static ES3Type Instance; - - public ES3Type_IntPtr() : base(typeof(IntPtr)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((long)(IntPtr)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)(IntPtr)reader.Read_long(); - } - } - - public class ES3Type_IntPtrArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_IntPtrArray() : base(typeof(IntPtr[]), ES3Type_IntPtr.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_intptr.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_intptr.cs.meta deleted file mode 100644 index 09cb3a1..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_intptr.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8fe212a329d2d46a482270d9a93d704f -timeCreated: 1519132291 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_long.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_long.cs deleted file mode 100644 index 9261614..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_long.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_long : ES3Type - { - public static ES3Type Instance; - - public ES3Type_long() : base(typeof(long)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((long)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_long(); - } - } - - public class ES3Type_longArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_longArray() : base(typeof(long[]), ES3Type_long.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_long.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_long.cs.meta deleted file mode 100644 index 792ad5e..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_long.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b534e98b9d5dc4219978a5aada0d11b0 -timeCreated: 1519132294 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_sbyte.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_sbyte.cs deleted file mode 100644 index 89d960b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_sbyte.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_sbyte : ES3Type - { - public static ES3Type Instance; - - public ES3Type_sbyte() : base(typeof(sbyte)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((sbyte)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_sbyte(); - } - } - - public class ES3Type_sbyteArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_sbyteArray() : base(typeof(sbyte[]), ES3Type_sbyte.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_sbyte.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_sbyte.cs.meta deleted file mode 100644 index 383ec75..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_sbyte.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5aaea33736cb64165b06b21ccffb4dde -timeCreated: 1519132286 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_short.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_short.cs deleted file mode 100644 index 054ab39..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_short.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_short : ES3Type - { - public static ES3Type Instance; - - public ES3Type_short() : base(typeof(short)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((short)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_short(); - } - } - - public class ES3Type_shortArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_shortArray() : base(typeof(short[]), ES3Type_short.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_short.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_short.cs.meta deleted file mode 100644 index 8088746..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_short.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 62ef5aa170d8444eb9613f6733dace9c -timeCreated: 1519132286 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_string.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_string.cs deleted file mode 100644 index ba39441..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_string.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_string : ES3Type - { - public static ES3Type Instance; - - public ES3Type_string() : base(typeof(string)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((string)obj); - } - - public override object Read(ES3Reader reader) - { - return reader.Read_string(); - } - } - - public class ES3Type_StringArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_StringArray() : base(typeof(string[]), ES3Type_string.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_string.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_string.cs.meta deleted file mode 100644 index 5c50346..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_string.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 138987e042d4e4283a967a0958ab0a52 -timeCreated: 1519132280 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_uint.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_uint.cs deleted file mode 100644 index d8d6a8f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_uint.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_uint : ES3Type - { - public static ES3Type Instance; - - public ES3Type_uint() : base(typeof(uint)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((uint)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_uint(); - } - } - - public class ES3Type_uintArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_uintArray() : base(typeof(uint[]), ES3Type_uint.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_uint.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_uint.cs.meta deleted file mode 100644 index 4c9fcc2..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_uint.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2c39c4f1168884e94b9e7e6087affd2d -timeCreated: 1519132282 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ulong.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ulong.cs deleted file mode 100644 index 50de738..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ulong.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_ulong : ES3Type - { - public static ES3Type Instance; - - public ES3Type_ulong() : base(typeof(ulong)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((ulong)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_ulong(); - } - } - - public class ES3Type_ulongArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_ulongArray() : base(typeof(ulong[]), ES3Type_ulong.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ulong.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ulong.cs.meta deleted file mode 100644 index 2e8f548..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ulong.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f25dca3f336094cababceb772c7e390b -timeCreated: 1519132300 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ushort.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ushort.cs deleted file mode 100644 index cb2a8a6..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ushort.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_ushort : ES3Type - { - public static ES3Type Instance; - - public ES3Type_ushort() : base(typeof(ushort)) - { - isPrimitive = true; - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - writer.WritePrimitive((ushort)obj); - } - - public override object Read(ES3Reader reader) - { - return (T)(object)reader.Read_ushort(); - } - } - - public class ES3Type_ushortArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_ushortArray() : base(typeof(ushort[]), ES3Type_ushort.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ushort.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ushort.cs.meta deleted file mode 100644 index 37c6b4e..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_ushort.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 33d86db06b1954996a48d38a75c76dd9 -timeCreated: 1519132282 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types.meta deleted file mode 100644 index cdc6e25..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 4082e405acc0345388494ffa52b63839 -folderAsset: yes -timeCreated: 1499764821 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedComponentType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedComponentType.cs deleted file mode 100644 index 293ef49..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedComponentType.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - internal class ES3ReflectedComponentType : ES3ComponentType - { - public ES3ReflectedComponentType(Type type) : base(type) - { - isReflectedType = true; - GetMembers(true); - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - WriteProperties(obj, writer); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - ReadProperties(reader, obj); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedComponentType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedComponentType.cs.meta deleted file mode 100644 index 9a62402..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedComponentType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2b125647af96a4b5494ca82d1da9a9e6 -timeCreated: 1499764821 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedObjectType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedObjectType.cs deleted file mode 100644 index 7da4c2c..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedObjectType.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - internal class ES3ReflectedObjectType : ES3ObjectType - { - public ES3ReflectedObjectType(Type type) : base(type) - { - isReflectedType = true; - GetMembers(true); - } - - protected override void WriteObject(object obj, ES3Writer writer) - { - WriteProperties(obj, writer); - } - - protected override object ReadObject(ES3Reader reader) - { - object obj = ES3Reflection.CreateInstance(type); - ReadProperties(reader, obj); - return obj; - } - - protected override void ReadObject(ES3Reader reader, object obj) - { - ReadProperties(reader, obj); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedObjectType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedObjectType.cs.meta deleted file mode 100644 index 99d776e..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedObjectType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d239970ac781b4079bda34e2999dc775 -timeCreated: 1519132297 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedScriptableObjectType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedScriptableObjectType.cs deleted file mode 100644 index ff91dd2..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedScriptableObjectType.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - internal class ES3ReflectedScriptableObjectType : ES3ScriptableObjectType - { - public ES3ReflectedScriptableObjectType(Type type) : base(type) - { - isReflectedType = true; - GetMembers(true); - } - - protected override void WriteScriptableObject(object obj, ES3Writer writer) - { - WriteProperties(obj, writer); - } - - protected override void ReadScriptableObject(ES3Reader reader, object obj) - { - ReadProperties(reader, obj); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedScriptableObjectType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedScriptableObjectType.cs.meta deleted file mode 100644 index 45d7433..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedScriptableObjectType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: dd9e88c6e3735412ab2033c284212528 -timeCreated: 1519132298 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedType.cs deleted file mode 100644 index 7139f95..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedType.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using ES3Internal; -using UnityEngine.Scripting; -using Object = UnityEngine.Object; - -namespace ES3Types -{ - [Preserve] - internal class ES3ReflectedType : ES3Type - { - public ES3ReflectedType(Type type) : base(type) - { - isReflectedType = true; - } - - // Constructs a reflected ES3Type, only serializing members which are in the provided members array. - public ES3ReflectedType(Type type, string[] members) : this(type) - { - GetMembers(false, members); - } - - public override void Write(object obj, ES3Writer writer) - { - // Manage NULL values. - if (obj == null) - { - writer.WriteNull(); - return; - } - ; - - var unityObj = obj as Object; - bool isUnityEngineObject = unityObj != null; - - // If this is a derived type, write the type as a property and use it's specific ES3Type. - var objType = obj.GetType(); - if (objType != type) - { - writer.WriteType(objType); - ES3TypeMgr.GetOrCreateES3Type(objType).Write(obj, writer); - return; - } - - if (isUnityEngineObject) - writer.WriteRef(unityObj); - - if (members == null) - GetMembers(writer.settings.safeReflection); - for (int i = 0; i < members.Length; i++) - { - var property = members[i]; - - if (ES3Reflection.IsAssignableFrom(typeof(Object), property.type)) - { - object valueObj = property.reflectedMember.GetValue(obj); - var value = valueObj == null ? null : (Object)valueObj; - - writer.WritePropertyByRef(property.name, value); - } - else - writer.WriteProperty(property.name, property.reflectedMember.GetValue(obj), ES3TypeMgr.GetOrCreateES3Type(property.type)); - } - } - - public override object Read(ES3Reader reader) - { - if (members == null) - GetMembers(reader.settings.safeReflection); - - object obj; - string propertyName = reader.ReadPropertyName(); - - // If we're loading a derived type, use it's specific ES3Type. - if (propertyName == typeFieldName) - return ES3TypeMgr.GetOrCreateES3Type(reader.ReadType()).Read(reader); - - // If we're loading a reference, load it. Else, create an instance. - if (propertyName == ES3ReferenceMgrBase.referencePropertyName) - { - long id = reader.Read_ref(); - obj = ES3ReferenceMgrBase.Current.Get(id, type); - if (obj == null) - { - // If an instance isn't already registered for this object, create an instance and register the reference. - obj = ES3Reflection.CreateInstance(type); - ES3ReferenceMgrBase.Current.Add((Object)obj, id); - } - } - else - { - reader.overridePropertiesName = propertyName; - obj = ES3Reflection.CreateInstance(type); - } - - // Iterate through each property in the file and try to load it using the appropriate - // ES3Property in the members array. - ReadProperties(reader, obj); - - return obj; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - if (members == null) - GetMembers(reader.settings.safeReflection); - - string propertyName = reader.ReadPropertyName(); - - // If we're loading a derived type, use it's specific ES3Type. - if (propertyName == typeFieldName) - { - ES3TypeMgr.GetOrCreateES3Type(reader.ReadType()).ReadInto(reader, obj); - return; - } - reader.overridePropertiesName = propertyName; - - // Iterate through each property in the file and try to load it using the appropriate - // ES3Property in the members array. - ReadProperties(reader, obj); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedType.cs.meta deleted file mode 100644 index 3a91f09..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d859cda1b74634568a53487bd1651001 -timeCreated: 1499764823 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedUnityObjectType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedUnityObjectType.cs deleted file mode 100644 index a40c1fa..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedUnityObjectType.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - internal class ES3ReflectedUnityObjectType : ES3UnityObjectType - { - public ES3ReflectedUnityObjectType(Type type) : base(type) - { - isReflectedType = true; - GetMembers(true); - } - - protected override void WriteUnityObject(object obj, ES3Writer writer) - { - WriteProperties(obj, writer); - } - - protected override object ReadUnityObject(ES3Reader reader) - { - object obj = ES3Reflection.CreateInstance(type); - ReadProperties(reader, obj); - return obj; - } - - protected override void ReadUnityObject(ES3Reader reader, object obj) - { - ReadProperties(reader, obj); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedUnityObjectType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedUnityObjectType.cs.meta deleted file mode 100644 index c9d5889..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedUnityObjectType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f8c48527c8cb247f1be391e0ca112968 -timeCreated: 1519132301 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedValueType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedValueType.cs deleted file mode 100644 index 62154db..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedValueType.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using ES3Internal; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - internal class ES3ReflectedValueType : ES3Type - { - public ES3ReflectedValueType(Type type) : base(type) - { - isReflectedType = true; - GetMembers(true); - } - - public override void Write(object obj, ES3Writer writer) - { - WriteProperties(obj, writer); - } - - public override object Read(ES3Reader reader) - { - object obj = ES3Reflection.CreateInstance(type); - - if (obj == null) - throw new NotSupportedException("Cannot create an instance of " + type + ". However, you may be able to add support for it using a custom ES3Type file. For more information see: http://docs.moodkie.com/easy-save-3/es3-guides/controlling-serialization-using-es3types/"); - // Make sure we return the result of ReadProperties as properties aren't assigned by reference. - return ReadProperties(reader, obj); - } - - public override void ReadInto(ES3Reader reader, object obj) - { - throw new NotSupportedException("Cannot perform self-assigning load on a value type."); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedValueType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedValueType.cs.meta deleted file mode 100644 index 2099910..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedValueType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f8bc4124377914b60b46b243480f0eb5 -timeCreated: 1519132301 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types.meta deleted file mode 100644 index 7389163..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: a14e00d7328764c16803c1a5f854286b -folderAsset: yes -timeCreated: 1499764821 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types.meta deleted file mode 100644 index 4873446..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 96e5384a630b34a90a22b84d95f3dac9 -folderAsset: yes -timeCreated: 1499764821 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_BoxCollider.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_BoxCollider.cs deleted file mode 100644 index ea94363..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_BoxCollider.cs +++ /dev/null @@ -1,62 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("center", "size", "enabled", "isTrigger", "contactOffset", "sharedMaterial")] - public class ES3Type_BoxCollider : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_BoxCollider() : base(typeof(BoxCollider)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (BoxCollider)obj; - - writer.WriteProperty("center", instance.center); - writer.WriteProperty("size", instance.size); - writer.WriteProperty("enabled", instance.enabled); - writer.WriteProperty("isTrigger", instance.isTrigger); - writer.WriteProperty("contactOffset", instance.contactOffset); - writer.WritePropertyByRef("material", instance.sharedMaterial); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (BoxCollider)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "center": - instance.center = reader.Read(); - break; - case "size": - instance.size = reader.Read(); - break; - case "enabled": - instance.enabled = reader.Read(); - break; - case "isTrigger": - instance.isTrigger = reader.Read(); - break; - case "contactOffset": - instance.contactOffset = reader.Read(); - break; - case "material": - instance.sharedMaterial = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_BoxCollider.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_BoxCollider.cs.meta deleted file mode 100644 index a45de66..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_BoxCollider.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d36ea4342de4546b198eea1405516979 -timeCreated: 1519132297 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_BoxCollider2D.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_BoxCollider2D.cs deleted file mode 100644 index fdb0c52..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_BoxCollider2D.cs +++ /dev/null @@ -1,67 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("size", "density", "isTrigger", "usedByEffector", "offset", "sharedMaterial", "enabled")] - public class ES3Type_BoxCollider2D : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_BoxCollider2D() : base(typeof(BoxCollider2D)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (BoxCollider2D)obj; - - writer.WriteProperty("size", instance.size); - if (instance.attachedRigidbody != null && instance.attachedRigidbody.useAutoMass) - writer.WriteProperty("density", instance.density); - writer.WriteProperty("isTrigger", instance.isTrigger); - writer.WriteProperty("usedByEffector", instance.usedByEffector); - writer.WriteProperty("offset", instance.offset); - writer.WritePropertyByRef("sharedMaterial", instance.sharedMaterial); - writer.WriteProperty("enabled", instance.enabled); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (BoxCollider2D)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "size": - instance.size = reader.Read(); - break; - case "density": - instance.density = reader.Read(); - break; - case "isTrigger": - instance.isTrigger = reader.Read(); - break; - case "usedByEffector": - instance.usedByEffector = reader.Read(); - break; - case "offset": - instance.offset = reader.Read(); - break; - case "sharedMaterial": - instance.sharedMaterial = reader.Read(); - break; - case "enabled": - instance.enabled = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_BoxCollider2D.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_BoxCollider2D.cs.meta deleted file mode 100644 index 0795afc..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_BoxCollider2D.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8ae32677f95cd4f2ba1c34db2a065c9c -timeCreated: 1519132290 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Camera.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Camera.cs deleted file mode 100644 index be91942..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Camera.cs +++ /dev/null @@ -1,167 +0,0 @@ -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("fieldOfView", "nearClipPlane", "farClipPlane", "renderingPath", "allowHDR", "orthographicSize", "orthographic", "opaqueSortMode", "transparencySortMode", "depth", "aspect", "cullingMask", "eventMask", "backgroundColor", "rect", "pixelRect", "worldToCameraMatrix", "projectionMatrix", "nonJitteredProjectionMatrix", "useJitteredProjectionMatrixForTransparentRendering", "clearFlags", "stereoSeparation", "stereoConvergence", "cameraType", "stereoTargetEye", "targetDisplay", "useOcclusionCulling", "cullingMatrix", "layerCullSpherical", "depthTextureMode", "clearStencilAfterLightingPass", "enabled", "hideFlags")] - public class ES3Type_Camera : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_Camera() : base(typeof(Camera)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (Camera)obj; - - writer.WriteProperty("fieldOfView", instance.fieldOfView); - writer.WriteProperty("nearClipPlane", instance.nearClipPlane); - writer.WriteProperty("farClipPlane", instance.farClipPlane); - writer.WriteProperty("renderingPath", instance.renderingPath); - #if UNITY_5_6_OR_NEWER - writer.WriteProperty("allowHDR", instance.allowHDR); - #endif - writer.WriteProperty("orthographicSize", instance.orthographicSize); - writer.WriteProperty("orthographic", instance.orthographic); - writer.WriteProperty("opaqueSortMode", instance.opaqueSortMode); - writer.WriteProperty("transparencySortMode", instance.transparencySortMode); - writer.WriteProperty("depth", instance.depth); - writer.WriteProperty("aspect", instance.aspect); - writer.WriteProperty("cullingMask", instance.cullingMask); - writer.WriteProperty("eventMask", instance.eventMask); - writer.WriteProperty("backgroundColor", instance.backgroundColor); - writer.WriteProperty("rect", instance.rect); - writer.WriteProperty("pixelRect", instance.pixelRect); - writer.WriteProperty("projectionMatrix", instance.projectionMatrix); - writer.WriteProperty("nonJitteredProjectionMatrix", instance.nonJitteredProjectionMatrix); - writer.WriteProperty("useJitteredProjectionMatrixForTransparentRendering", instance.useJitteredProjectionMatrixForTransparentRendering); - writer.WriteProperty("clearFlags", instance.clearFlags); - writer.WriteProperty("stereoSeparation", instance.stereoSeparation); - writer.WriteProperty("stereoConvergence", instance.stereoConvergence); - writer.WriteProperty("cameraType", instance.cameraType); - writer.WriteProperty("stereoTargetEye", instance.stereoTargetEye); - writer.WriteProperty("targetDisplay", instance.targetDisplay); - writer.WriteProperty("useOcclusionCulling", instance.useOcclusionCulling); - writer.WriteProperty("layerCullSpherical", instance.layerCullSpherical); - writer.WriteProperty("depthTextureMode", instance.depthTextureMode); - writer.WriteProperty("clearStencilAfterLightingPass", instance.clearStencilAfterLightingPass); - writer.WriteProperty("enabled", instance.enabled); - writer.WriteProperty("hideFlags", instance.hideFlags); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (Camera)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "fieldOfView": - instance.fieldOfView = reader.Read(); - break; - case "nearClipPlane": - instance.nearClipPlane = reader.Read(); - break; - case "farClipPlane": - instance.farClipPlane = reader.Read(); - break; - case "renderingPath": - instance.renderingPath = reader.Read(); - break; - #if UNITY_5_6_OR_NEWER - case "allowHDR": - instance.allowHDR = reader.Read(); - break; - #endif - case "orthographicSize": - instance.orthographicSize = reader.Read(); - break; - case "orthographic": - instance.orthographic = reader.Read(); - break; - case "opaqueSortMode": - instance.opaqueSortMode = reader.Read(); - break; - case "transparencySortMode": - instance.transparencySortMode = reader.Read(); - break; - case "depth": - instance.depth = reader.Read(); - break; - case "aspect": - instance.aspect = reader.Read(); - break; - case "cullingMask": - instance.cullingMask = reader.Read(); - break; - case "eventMask": - instance.eventMask = reader.Read(); - break; - case "backgroundColor": - instance.backgroundColor = reader.Read(); - break; - case "rect": - instance.rect = reader.Read(); - break; - case "pixelRect": - instance.pixelRect = reader.Read(); - break; - case "projectionMatrix": - instance.projectionMatrix = reader.Read(); - break; - case "nonJitteredProjectionMatrix": - instance.nonJitteredProjectionMatrix = reader.Read(); - break; - case "useJitteredProjectionMatrixForTransparentRendering": - instance.useJitteredProjectionMatrixForTransparentRendering = reader.Read(); - break; - case "clearFlags": - instance.clearFlags = reader.Read(); - break; - case "stereoSeparation": - instance.stereoSeparation = reader.Read(); - break; - case "stereoConvergence": - instance.stereoConvergence = reader.Read(); - break; - case "cameraType": - instance.cameraType = reader.Read(); - break; - case "stereoTargetEye": - instance.stereoTargetEye = reader.Read(); - break; - case "targetDisplay": - instance.targetDisplay = reader.Read(); - break; - case "useOcclusionCulling": - instance.useOcclusionCulling = reader.Read(); - break; - case "layerCullSpherical": - instance.layerCullSpherical = reader.Read(); - break; - case "depthTextureMode": - instance.depthTextureMode = reader.Read(); - break; - case "clearStencilAfterLightingPass": - instance.clearStencilAfterLightingPass = reader.Read(); - break; - case "enabled": - instance.enabled = reader.Read(); - break; - case "hideFlags": - instance.hideFlags = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Camera.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Camera.cs.meta deleted file mode 100644 index 2d367aa..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Camera.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c88c1ce73e1f3462ea1aff5df7935e22 -timeCreated: 1499764822 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_CapsuleCollider.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_CapsuleCollider.cs deleted file mode 100644 index fd68039..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_CapsuleCollider.cs +++ /dev/null @@ -1,70 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("center", "radius", "height", "direction", "enabled", "isTrigger", "contactOffset", "sharedMaterial")] - public class ES3Type_CapsuleCollider : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_CapsuleCollider() : base(typeof(CapsuleCollider)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (CapsuleCollider)obj; - - writer.WriteProperty("center", instance.center, ES3Type_Vector3.Instance); - writer.WriteProperty("radius", instance.radius, ES3Type_float.Instance); - writer.WriteProperty("height", instance.height, ES3Type_float.Instance); - writer.WriteProperty("direction", instance.direction, ES3Type_int.Instance); - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("isTrigger", instance.isTrigger, ES3Type_bool.Instance); - writer.WriteProperty("contactOffset", instance.contactOffset, ES3Type_float.Instance); - writer.WritePropertyByRef("material", instance.sharedMaterial); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (CapsuleCollider)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case "center": - instance.center = reader.Read(ES3Type_Vector3.Instance); - break; - case "radius": - instance.radius = reader.Read(ES3Type_float.Instance); - break; - case "height": - instance.height = reader.Read(ES3Type_float.Instance); - break; - case "direction": - instance.direction = reader.Read(ES3Type_int.Instance); - break; - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "isTrigger": - instance.isTrigger = reader.Read(ES3Type_bool.Instance); - break; - case "contactOffset": - instance.contactOffset = reader.Read(ES3Type_float.Instance); - break; - case "material": - instance.sharedMaterial = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_CapsuleCollider.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_CapsuleCollider.cs.meta deleted file mode 100644 index f4c88e0..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_CapsuleCollider.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c523bafd506f04c85b160320b0b6d9dd -timeCreated: 1519132296 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_EventSystem.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_EventSystem.cs deleted file mode 100644 index 74a3f60..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_EventSystem.cs +++ /dev/null @@ -1,26 +0,0 @@ -using UnityEngine.EventSystems; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - public class ES3Type_EventSystem : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_EventSystem() : base(typeof(EventSystem)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - foreach (string propertyName in reader.Properties) - reader.Skip(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_EventSystem.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_EventSystem.cs.meta deleted file mode 100644 index d901720..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_EventSystem.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 02df167b6b77741308bfc8110dae71dd -timeCreated: 1519132279 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Image.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Image.cs deleted file mode 100644 index 9224768..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Image.cs +++ /dev/null @@ -1,137 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; -using UnityEngine.UI; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("sprite", "overrideSprite", "type", "preserveAspect", "fillCenter", "fillMethod", "fillAmount", "fillClockwise", "fillOrigin", "alphaHitTestMinimumThreshold", "useSpriteMesh", "pixelsPerUnitMultiplier", "material", "onCullStateChanged", "maskable", "color", "raycastTarget", "useLegacyMeshGeneration", "useGUILayout", "enabled", "hideFlags")] - public class ES3Type_Image : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_Image() : base(typeof(Image)) - { - Instance = this; - priority = 1; - } - - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (Image)obj; - - writer.WritePropertyByRef("sprite", instance.sprite); - writer.WriteProperty("type", instance.type); - writer.WriteProperty("preserveAspect", instance.preserveAspect, ES3Type_bool.Instance); - writer.WriteProperty("fillCenter", instance.fillCenter, ES3Type_bool.Instance); - writer.WriteProperty("fillMethod", instance.fillMethod); - writer.WriteProperty("fillAmount", instance.fillAmount, ES3Type_float.Instance); - writer.WriteProperty("fillClockwise", instance.fillClockwise, ES3Type_bool.Instance); - writer.WriteProperty("fillOrigin", instance.fillOrigin, ES3Type_int.Instance); - writer.WriteProperty("alphaHitTestMinimumThreshold", instance.alphaHitTestMinimumThreshold, ES3Type_float.Instance); -#if UNITY_2019_1_OR_NEWER - writer.WriteProperty("useSpriteMesh", instance.useSpriteMesh, ES3Type_bool.Instance); -#endif - // Unity automatically sets the default material if it's set to null. - // This prevents missing reference warnings. - if (instance.material.name.Contains("Default")) - writer.WriteProperty("material", null); - else - writer.WriteProperty("material", instance.material); - writer.WriteProperty("onCullStateChanged", instance.onCullStateChanged); - writer.WriteProperty("maskable", instance.maskable, ES3Type_bool.Instance); - writer.WriteProperty("color", instance.color, ES3Type_Color.Instance); - writer.WriteProperty("raycastTarget", instance.raycastTarget, ES3Type_bool.Instance); - writer.WritePrivateProperty("useLegacyMeshGeneration", instance); - writer.WriteProperty("useGUILayout", instance.useGUILayout, ES3Type_bool.Instance); - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("hideFlags", instance.hideFlags, ES3Type_enum.Instance); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (Image)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "sprite": - instance.sprite = reader.Read(ES3Type_Sprite.Instance); - break; - case "type": - instance.type = reader.Read(); - break; - case "preserveAspect": - instance.preserveAspect = reader.Read(ES3Type_bool.Instance); - break; - case "fillCenter": - instance.fillCenter = reader.Read(ES3Type_bool.Instance); - break; - case "fillMethod": - instance.fillMethod = reader.Read(); - break; - case "fillAmount": - instance.fillAmount = reader.Read(ES3Type_float.Instance); - break; - case "fillClockwise": - instance.fillClockwise = reader.Read(ES3Type_bool.Instance); - break; - case "fillOrigin": - instance.fillOrigin = reader.Read(ES3Type_int.Instance); - break; - case "alphaHitTestMinimumThreshold": - instance.alphaHitTestMinimumThreshold = reader.Read(ES3Type_float.Instance); - break; -#if UNITY_2019_1_OR_NEWER - case "useSpriteMesh": - instance.useSpriteMesh = reader.Read(ES3Type_bool.Instance); - break; -#endif - case "material": - instance.material = reader.Read(ES3Type_Material.Instance); - break; - case "onCullStateChanged": - instance.onCullStateChanged = reader.Read(); - break; - case "maskable": - instance.maskable = reader.Read(ES3Type_bool.Instance); - break; - case "color": - instance.color = reader.Read(ES3Type_Color.Instance); - break; - case "raycastTarget": - instance.raycastTarget = reader.Read(ES3Type_bool.Instance); - break; - case "useLegacyMeshGeneration": - reader.SetPrivateProperty("useLegacyMeshGeneration", reader.Read(), instance); - break; - case "useGUILayout": - instance.useGUILayout = reader.Read(ES3Type_bool.Instance); - break; - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "hideFlags": - instance.hideFlags = reader.Read(ES3Type_enum.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } - - - public class ES3Type_ImageArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_ImageArray() : base(typeof(Image[]), ES3Type_Image.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Image.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Image.cs.meta deleted file mode 100644 index 0b13178..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Image.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 044e538602955694c90bc8b86d487ac5 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshCollider.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshCollider.cs deleted file mode 100644 index a2b3954..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshCollider.cs +++ /dev/null @@ -1,80 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("sharedMesh", "convex", "inflateMesh", "skinWidth", "enabled", "isTrigger", "contactOffset", "sharedMaterial")] - public class ES3Type_MeshCollider : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_MeshCollider() : base(typeof(MeshCollider)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (MeshCollider)obj; - - writer.WritePropertyByRef("sharedMesh", instance.sharedMesh); - writer.WriteProperty("convex", instance.convex, ES3Type_bool.Instance); - /*writer.WriteProperty("inflateMesh", instance.inflateMesh, ES3Type_bool.Instance); - writer.WriteProperty("skinWidth", instance.skinWidth, ES3Type_float.Instance);*/ - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("isTrigger", instance.isTrigger, ES3Type_bool.Instance); - writer.WriteProperty("contactOffset", instance.contactOffset, ES3Type_float.Instance); - writer.WriteProperty("material", instance.sharedMaterial); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (MeshCollider)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "sharedMesh": - instance.sharedMesh = reader.Read(ES3Type_Mesh.Instance); - break; - case "convex": - instance.convex = reader.Read(ES3Type_bool.Instance); - break; - /*case "inflateMesh": - instance.inflateMesh = reader.Read(ES3Type_bool.Instance); - break; - case "skinWidth": - instance.skinWidth = reader.Read(ES3Type_float.Instance); - break;*/ - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "isTrigger": - instance.isTrigger = reader.Read(ES3Type_bool.Instance); - break; - case "contactOffset": - instance.contactOffset = reader.Read(ES3Type_float.Instance); - break; - case "material": - instance.sharedMaterial = reader.Read(ES3Type_PhysicMaterial.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } - - public class ES3Type_MeshColliderArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_MeshColliderArray() : base(typeof(MeshCollider[]), ES3Type_MeshCollider.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshCollider.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshCollider.cs.meta deleted file mode 100644 index dfb148f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshCollider.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b7825b483b5804bcb95a1a47cb287500 -timeCreated: 1519132294 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshFilter.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshFilter.cs deleted file mode 100644 index 557dfd1..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshFilter.cs +++ /dev/null @@ -1,51 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("sharedMesh")] - public class ES3Type_MeshFilter : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_MeshFilter() : base(typeof(MeshFilter)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (MeshFilter)obj; - writer.WritePropertyByRef("sharedMesh", instance.sharedMesh); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (MeshFilter)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "sharedMesh": - instance.sharedMesh = reader.Read(ES3Type_Mesh.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } - - public class ES3Type_MeshFilterArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_MeshFilterArray() : base(typeof(MeshFilter[]), ES3Type_MeshFilter.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshFilter.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshFilter.cs.meta deleted file mode 100644 index 9a22df1..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshFilter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 00364532a712841328836c36da833503 -timeCreated: 1519132279 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshRenderer.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshRenderer.cs deleted file mode 100644 index cfa3e73..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshRenderer.cs +++ /dev/null @@ -1,117 +0,0 @@ -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("additionalVertexStreams", "enabled", "shadowCastingMode", "receiveShadows", "sharedMaterials", "lightmapIndex", "realtimeLightmapIndex", "lightmapScaleOffset", "motionVectorGenerationMode", "realtimeLightmapScaleOffset", "lightProbeUsage", "lightProbeProxyVolumeOverride", "probeAnchor", "reflectionProbeUsage", "sortingLayerName", "sortingLayerID", "sortingOrder")] - public class ES3Type_MeshRenderer : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_MeshRenderer() : base(typeof(MeshRenderer)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (MeshRenderer)obj; - - writer.WriteProperty("additionalVertexStreams", instance.additionalVertexStreams, ES3Type_Mesh.Instance); - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("shadowCastingMode", instance.shadowCastingMode); - writer.WriteProperty("receiveShadows", instance.receiveShadows, ES3Type_bool.Instance); - writer.WriteProperty("sharedMaterials", instance.sharedMaterials, ES3Type_MaterialArray.Instance); - writer.WriteProperty("lightmapIndex", instance.lightmapIndex, ES3Type_int.Instance); - writer.WriteProperty("realtimeLightmapIndex", instance.realtimeLightmapIndex, ES3Type_int.Instance); - writer.WriteProperty("lightmapScaleOffset", instance.lightmapScaleOffset, ES3Type_Vector4.Instance); - writer.WriteProperty("motionVectorGenerationMode", instance.motionVectorGenerationMode); - writer.WriteProperty("realtimeLightmapScaleOffset", instance.realtimeLightmapScaleOffset, ES3Type_Vector4.Instance); - writer.WriteProperty("lightProbeUsage", instance.lightProbeUsage); - writer.WriteProperty("lightProbeProxyVolumeOverride", instance.lightProbeProxyVolumeOverride); - writer.WriteProperty("probeAnchor", instance.probeAnchor, ES3Type_Transform.Instance); - writer.WriteProperty("reflectionProbeUsage", instance.reflectionProbeUsage); - writer.WriteProperty("sortingLayerName", instance.sortingLayerName, ES3Type_string.Instance); - writer.WriteProperty("sortingLayerID", instance.sortingLayerID, ES3Type_int.Instance); - writer.WriteProperty("sortingOrder", instance.sortingOrder, ES3Type_int.Instance); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (MeshRenderer)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "additionalVertexStreams": - instance.additionalVertexStreams = reader.Read(ES3Type_Mesh.Instance); - break; - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "shadowCastingMode": - instance.shadowCastingMode = reader.Read(); - break; - case "receiveShadows": - instance.receiveShadows = reader.Read(ES3Type_bool.Instance); - break; - case "sharedMaterials": - instance.sharedMaterials = reader.Read(); - break; - case "lightmapIndex": - instance.lightmapIndex = reader.Read(ES3Type_int.Instance); - break; - case "realtimeLightmapIndex": - instance.realtimeLightmapIndex = reader.Read(ES3Type_int.Instance); - break; - case "lightmapScaleOffset": - instance.lightmapScaleOffset = reader.Read(ES3Type_Vector4.Instance); - break; - case "motionVectorGenerationMode": - instance.motionVectorGenerationMode = reader.Read(); - break; - case "realtimeLightmapScaleOffset": - instance.realtimeLightmapScaleOffset = reader.Read(ES3Type_Vector4.Instance); - break; - case "lightProbeUsage": - instance.lightProbeUsage = reader.Read(); - break; - case "lightProbeProxyVolumeOverride": - instance.lightProbeProxyVolumeOverride = reader.Read(ES3Type_GameObject.Instance); - break; - case "probeAnchor": - instance.probeAnchor = reader.Read(ES3Type_Transform.Instance); - break; - case "reflectionProbeUsage": - instance.reflectionProbeUsage = reader.Read(); - break; - case "sortingLayerName": - instance.sortingLayerName = reader.Read(ES3Type_string.Instance); - break; - case "sortingLayerID": - instance.sortingLayerID = reader.Read(ES3Type_int.Instance); - break; - case "sortingOrder": - instance.sortingOrder = reader.Read(ES3Type_int.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } - - public class ES3Type_MeshRendererArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_MeshRendererArray() : base(typeof(MeshRenderer[]), ES3Type_MeshRenderer.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshRenderer.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshRenderer.cs.meta deleted file mode 100644 index 7277162..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_MeshRenderer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d33e88a8388cf4cf1b47495afc6722a7 -timeCreated: 1519132297 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_ParticleSystem.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_ParticleSystem.cs deleted file mode 100644 index 2307dc7..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_ParticleSystem.cs +++ /dev/null @@ -1,149 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("time", "hideFlags", "collision", "colorBySpeed", "colorOverLifetime", "emission", "externalForces", "forceOverLifetime", "inheritVelocity", - "lights", "limitVelocityOverLifetime", "main", "noise", "rotatonBySpeed", "rotationOverLifetime", "shape", "sizeBySpeed", "sizeOverLifetime", - "subEmitters", "textureSheetAnimation", "trails", "trigger", "useAutoRandomSeed", "velocityOverLifetime", "isPaused", "isPlaying", "isStopped")] - public class ES3Type_ParticleSystem : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_ParticleSystem() : base(typeof(ParticleSystem)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (ParticleSystem)obj; - - writer.WriteProperty("time", instance.time); - writer.WriteProperty("hideFlags", instance.hideFlags); - writer.WriteProperty("collision", instance.collision); - writer.WriteProperty("colorBySpeed", instance.colorBySpeed); - writer.WriteProperty("colorOverLifetime", instance.colorOverLifetime); - writer.WriteProperty("emission", instance.emission); - writer.WriteProperty("externalForces", instance.externalForces); - writer.WriteProperty("forceOverLifetime", instance.forceOverLifetime); - writer.WriteProperty("inheritVelocity", instance.inheritVelocity); - writer.WriteProperty("lights", instance.lights); - writer.WriteProperty("limitVelocityOverLifetime", instance.limitVelocityOverLifetime); - writer.WriteProperty("main", instance.main); - writer.WriteProperty("noise", instance.noise); - writer.WriteProperty("rotationBySpeed", instance.rotationBySpeed); - writer.WriteProperty("rotationOverLifetime", instance.rotationOverLifetime); - writer.WriteProperty("shape", instance.shape); - writer.WriteProperty("sizeBySpeed", instance.sizeBySpeed); - writer.WriteProperty("sizeOverLifetime", instance.sizeOverLifetime); - writer.WriteProperty("subEmitters", instance.subEmitters); - writer.WriteProperty("textureSheetAnimation", instance.textureSheetAnimation); - writer.WriteProperty("trails", instance.trails); - writer.WriteProperty("trigger", instance.trigger); - writer.WriteProperty("useAutoRandomSeed", instance.useAutoRandomSeed); - writer.WriteProperty("velocityOverLifetime", instance.velocityOverLifetime); - writer.WriteProperty("isPaused", instance.isPaused); - writer.WriteProperty("isPlaying", instance.isPlaying); - writer.WriteProperty("isStopped", instance.isStopped); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (ParticleSystem)obj; - // Stop particle system as some properties require it to not be playing to be set. - instance.Stop(); - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case "time": - instance.time = reader.Read(); - break; - case "hideFlags": - instance.hideFlags = reader.Read(); - break; - case "collision": - reader.ReadInto(instance.collision, ES3Type_CollisionModule.Instance); - break; - case "colorBySpeed": - reader.ReadInto(instance.colorBySpeed, ES3Type_ColorBySpeedModule.Instance); - break; - case "colorOverLifetime": - reader.ReadInto(instance.colorOverLifetime, ES3Type_ColorOverLifetimeModule.Instance); - break; - case "sizeOverLifetime": - reader.ReadInto(instance.sizeOverLifetime, ES3Type_SizeOverLifetimeModule.Instance); - break; - case "shape": - reader.ReadInto(instance.shape, ES3Type_ShapeModule.Instance); - break; - case "emission": - reader.ReadInto(instance.emission, ES3Type_EmissionModule.Instance); - break; - case "externalForces": - reader.ReadInto(instance.externalForces, ES3Type_ExternalForcesModule.Instance); - break; - case "forceOverLifetime": - reader.ReadInto(instance.forceOverLifetime, ES3Type_ForceOverLifetimeModule.Instance); - break; - case "inheritVelocity": - reader.ReadInto(instance.inheritVelocity, ES3Type_InheritVelocityModule.Instance); - break; - case "lights": - reader.ReadInto(instance.lights, ES3Type_LightsModule.Instance); - break; - case "limitVelocityOverLifetime": - reader.ReadInto(instance.limitVelocityOverLifetime, ES3Type_LimitVelocityOverLifetimeModule.Instance); - break; - case "main": - reader.ReadInto(instance.main, ES3Type_MainModule.Instance); - break; - case "noise": - reader.ReadInto(instance.noise, ES3Type_NoiseModule.Instance); - break; - case "sizeBySpeed": - reader.ReadInto(instance.sizeBySpeed, ES3Type_SizeBySpeedModule.Instance); - break; - case "rotationBySpeed": - reader.ReadInto(instance.rotationBySpeed, ES3Type_RotationBySpeedModule.Instance); - break; - case "rotationOverLifetime": - reader.ReadInto(instance.rotationOverLifetime, ES3Type_RotationOverLifetimeModule.Instance); - break; - case "subEmitters": - reader.ReadInto(instance.subEmitters, ES3Type_SubEmittersModule.Instance); - break; - case "textureSheetAnimation": - reader.ReadInto(instance.textureSheetAnimation, ES3Type_TextureSheetAnimationModule.Instance); - break; - case "trails": - reader.ReadInto(instance.trails, ES3Type_TrailModule.Instance); - break; - case "trigger": - reader.ReadInto(instance.trigger, ES3Type_TriggerModule.Instance); - break; - case "useAutoRandomSeed": - instance.useAutoRandomSeed = reader.Read(ES3Type_bool.Instance); - break; - case "velocityOverLifetime": - reader.ReadInto(instance.velocityOverLifetime, ES3Type_VelocityOverLifetimeModule.Instance); - break; - case "isPaused": - if (reader.Read(ES3Type_bool.Instance)) instance.Pause(); - break; - case "isPlaying": - if (reader.Read(ES3Type_bool.Instance)) instance.Play(); - break; - case "isStopped": - if (reader.Read(ES3Type_bool.Instance)) instance.Stop(); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_ParticleSystem.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_ParticleSystem.cs.meta deleted file mode 100644 index 62abfe5..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_ParticleSystem.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9484f3e3b46ec4871977550c93381f25 -timeCreated: 1519132291 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_PolygonCollider2D.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_PolygonCollider2D.cs deleted file mode 100644 index e3566b0..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_PolygonCollider2D.cs +++ /dev/null @@ -1,87 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("points", "pathCount", "paths", "density", "isTrigger", "usedByEffector", "offset", "sharedMaterial", "enabled")] - public class ES3Type_PolygonCollider2D : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_PolygonCollider2D() : base(typeof(PolygonCollider2D)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (PolygonCollider2D)obj; - - writer.WriteProperty("points", instance.points, ES3Type_Vector2Array.Instance); - writer.WriteProperty("pathCount", instance.pathCount, ES3Type_int.Instance); - - for (int i = 0; i < instance.pathCount; i++) - writer.WriteProperty("path" + i, instance.GetPath(i), ES3Type_Vector2Array.Instance); - - if (instance.attachedRigidbody != null && instance.attachedRigidbody.useAutoMass) - writer.WriteProperty("density", instance.density, ES3Type_float.Instance); - writer.WriteProperty("isTrigger", instance.isTrigger, ES3Type_bool.Instance); - writer.WriteProperty("usedByEffector", instance.usedByEffector, ES3Type_bool.Instance); - writer.WriteProperty("offset", instance.offset, ES3Type_Vector2.Instance); - writer.WriteProperty("sharedMaterial", instance.sharedMaterial); - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (PolygonCollider2D)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "points": - instance.points = reader.Read(ES3Type_Vector2Array.Instance); - break; - case "pathCount": - int pathCount = reader.Read(ES3Type_int.Instance); - for (int i = 0; i < pathCount; i++) - instance.SetPath(i, reader.ReadProperty(ES3Type_Vector2Array.Instance)); - break; - case "density": - instance.density = reader.Read(ES3Type_float.Instance); - break; - case "isTrigger": - instance.isTrigger = reader.Read(ES3Type_bool.Instance); - break; - case "usedByEffector": - instance.usedByEffector = reader.Read(ES3Type_bool.Instance); - break; - case "offset": - instance.offset = reader.Read(ES3Type_Vector2.Instance); - break; - case "sharedMaterial": - instance.sharedMaterial = reader.Read(ES3Type_PhysicsMaterial2D.Instance); - break; - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } - - public class ES3Type_PolygonCollider2DArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_PolygonCollider2DArray() : base(typeof(PolygonCollider2D[]), ES3Type_PolygonCollider2D.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_PolygonCollider2D.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_PolygonCollider2D.cs.meta deleted file mode 100644 index 21a8143..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_PolygonCollider2D.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ec8749737dd724d6a91ac3a9c241ba17 -timeCreated: 1519132300 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_RawImage.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_RawImage.cs deleted file mode 100644 index a762df0..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_RawImage.cs +++ /dev/null @@ -1,101 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; -using UnityEngine.UI; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("texture", "uvRect", "onCullStateChanged", "maskable", "color", "raycastTarget", "useLegacyMeshGeneration", "material", "useGUILayout", "enabled", "hideFlags")] - public class ES3Type_RawImage : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_RawImage() : base(typeof(RawImage)) - { - Instance = this; - priority = 1; - } - - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (RawImage)obj; - - writer.WritePropertyByRef("texture", instance.texture); - writer.WriteProperty("uvRect", instance.uvRect, ES3Type_Rect.Instance); - writer.WriteProperty("onCullStateChanged", instance.onCullStateChanged); - writer.WriteProperty("maskable", instance.maskable, ES3Type_bool.Instance); - writer.WriteProperty("color", instance.color, ES3Type_Color.Instance); - writer.WriteProperty("raycastTarget", instance.raycastTarget, ES3Type_bool.Instance); - writer.WritePrivateProperty("useLegacyMeshGeneration", instance); - // Unity automatically sets the default material if it's set to null. - // This prevents missing reference warnings. - if (instance.material.name.Contains("Default")) - writer.WriteProperty("material", null); - else - writer.WriteProperty("material", instance.material); - writer.WriteProperty("useGUILayout", instance.useGUILayout, ES3Type_bool.Instance); - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("hideFlags", instance.hideFlags); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (RawImage)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "texture": - instance.texture = reader.Read(ES3Type_Texture.Instance); - break; - case "uvRect": - instance.uvRect = reader.Read(ES3Type_Rect.Instance); - break; - case "onCullStateChanged": - instance.onCullStateChanged = reader.Read(); - break; - case "maskable": - instance.maskable = reader.Read(ES3Type_bool.Instance); - break; - case "color": - instance.color = reader.Read(ES3Type_Color.Instance); - break; - case "raycastTarget": - instance.raycastTarget = reader.Read(ES3Type_bool.Instance); - break; - case "useLegacyMeshGeneration": - reader.SetPrivateProperty("useLegacyMeshGeneration", reader.Read(), instance); - break; - case "material": - instance.material = reader.Read(ES3Type_Material.Instance); - break; - case "useGUILayout": - instance.useGUILayout = reader.Read(ES3Type_bool.Instance); - break; - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "hideFlags": - instance.hideFlags = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } - - - public class ES3Type_RawImageArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_RawImageArray() : base(typeof(RawImage[]), ES3Type_RawImage.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_RawImage.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_RawImage.cs.meta deleted file mode 100644 index 3d4e161..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_RawImage.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d8b1e267b6439604a9854f1876a085b7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Rigidbody.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Rigidbody.cs deleted file mode 100644 index c10db23..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Rigidbody.cs +++ /dev/null @@ -1,140 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("velocity", "angularVelocity", "drag", "angularDrag", "mass", "useGravity", "maxDepenetrationVelocity", "isKinematic", "freezeRotation", "constraints", "collisionDetectionMode", "centerOfMass", "inertiaTensorRotation", "inertiaTensor", "detectCollisions", "position", "rotation", "interpolation", "solverIterations", "sleepThreshold", "maxAngularVelocity", "solverVelocityIterations")] - public class ES3Type_Rigidbody : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_Rigidbody() : base(typeof(Rigidbody)) - { - Instance = this; - priority = 1; - } - - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (Rigidbody)obj; - - writer.WriteProperty("velocity", instance.velocity, ES3Type_Vector3.Instance); - writer.WriteProperty("angularVelocity", instance.angularVelocity, ES3Type_Vector3.Instance); - writer.WriteProperty("drag", instance.drag, ES3Type_float.Instance); - writer.WriteProperty("angularDrag", instance.angularDrag, ES3Type_float.Instance); - writer.WriteProperty("mass", instance.mass, ES3Type_float.Instance); - writer.WriteProperty("useGravity", instance.useGravity, ES3Type_bool.Instance); - writer.WriteProperty("maxDepenetrationVelocity", instance.maxDepenetrationVelocity, ES3Type_float.Instance); - writer.WriteProperty("isKinematic", instance.isKinematic, ES3Type_bool.Instance); - writer.WriteProperty("freezeRotation", instance.freezeRotation, ES3Type_bool.Instance); - writer.WriteProperty("constraints", instance.constraints); - writer.WriteProperty("collisionDetectionMode", instance.collisionDetectionMode); - writer.WriteProperty("centerOfMass", instance.centerOfMass, ES3Type_Vector3.Instance); - writer.WriteProperty("detectCollisions", instance.detectCollisions, ES3Type_bool.Instance); - writer.WriteProperty("position", instance.position, ES3Type_Vector3.Instance); - writer.WriteProperty("rotation", instance.rotation, ES3Type_Quaternion.Instance); - writer.WriteProperty("interpolation", instance.interpolation); - writer.WriteProperty("solverIterations", instance.solverIterations, ES3Type_int.Instance); - writer.WriteProperty("sleepThreshold", instance.sleepThreshold, ES3Type_float.Instance); - writer.WriteProperty("maxAngularVelocity", instance.maxAngularVelocity, ES3Type_float.Instance); - writer.WriteProperty("solverVelocityIterations", instance.solverVelocityIterations, ES3Type_int.Instance); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (Rigidbody)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "velocity": - instance.velocity = reader.Read(ES3Type_Vector3.Instance); - break; - case "angularVelocity": - instance.angularVelocity = reader.Read(ES3Type_Vector3.Instance); - break; - case "drag": - instance.drag = reader.Read(ES3Type_float.Instance); - break; - case "angularDrag": - instance.angularDrag = reader.Read(ES3Type_float.Instance); - break; - case "mass": - instance.mass = reader.Read(ES3Type_float.Instance); - break; - case "useGravity": - instance.useGravity = reader.Read(ES3Type_bool.Instance); - break; - case "maxDepenetrationVelocity": - instance.maxDepenetrationVelocity = reader.Read(ES3Type_float.Instance); - break; - case "isKinematic": - instance.isKinematic = reader.Read(ES3Type_bool.Instance); - break; - case "freezeRotation": - instance.freezeRotation = reader.Read(ES3Type_bool.Instance); - break; - case "constraints": - instance.constraints = reader.Read(); - break; - case "collisionDetectionMode": - instance.collisionDetectionMode = reader.Read(); - break; - case "centerOfMass": - instance.centerOfMass = reader.Read(ES3Type_Vector3.Instance); - break; - case "inertiaTensorRotation": - instance.inertiaTensorRotation = reader.Read(ES3Type_Quaternion.Instance); - break; - case "inertiaTensor": - var inertiaTensor = reader.Read(ES3Type_Vector3.Instance); - // Check that the inertia tensor isn't zero, as it will throw an error if we try to set it. - if (inertiaTensor != Vector3.zero) - instance.inertiaTensor = inertiaTensor; - break; - case "detectCollisions": - instance.detectCollisions = reader.Read(ES3Type_bool.Instance); - break; - case "position": - instance.position = reader.Read(ES3Type_Vector3.Instance); - break; - case "rotation": - instance.rotation = reader.Read(ES3Type_Quaternion.Instance); - break; - case "interpolation": - instance.interpolation = reader.Read(); - break; - case "solverIterations": - instance.solverIterations = reader.Read(ES3Type_int.Instance); - break; - case "sleepThreshold": - instance.sleepThreshold = reader.Read(ES3Type_float.Instance); - break; - case "maxAngularVelocity": - instance.maxAngularVelocity = reader.Read(ES3Type_float.Instance); - break; - case "solverVelocityIterations": - instance.solverVelocityIterations = reader.Read(ES3Type_int.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } - - - public class ES3UserType_RigidbodyArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3UserType_RigidbodyArray() : base(typeof(Rigidbody[]), ES3Type_Rigidbody.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Rigidbody.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Rigidbody.cs.meta deleted file mode 100644 index 471e990..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Rigidbody.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8154830c992ded745b9784a07116b1b6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_SphereCollider.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_SphereCollider.cs deleted file mode 100644 index e8b11f3..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_SphereCollider.cs +++ /dev/null @@ -1,61 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("center", "radius", "enabled", "isTrigger", "contactOffset", "sharedMaterial")] - public class ES3Type_SphereCollider : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_SphereCollider() : base(typeof(SphereCollider)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (SphereCollider)obj; - - writer.WriteProperty("center", instance.center, ES3Type_Vector3.Instance); - writer.WriteProperty("radius", instance.radius, ES3Type_float.Instance); - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("isTrigger", instance.isTrigger, ES3Type_bool.Instance); - writer.WriteProperty("contactOffset", instance.contactOffset, ES3Type_float.Instance); - writer.WritePropertyByRef("material", instance.sharedMaterial); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (SphereCollider)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case "center": - instance.center = reader.Read(ES3Type_Vector3.Instance); - break; - case "radius": - instance.radius = reader.Read(ES3Type_float.Instance); - break; - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "isTrigger": - instance.isTrigger = reader.Read(ES3Type_bool.Instance); - break; - case "contactOffset": - instance.contactOffset = reader.Read(ES3Type_float.Instance); - break; - case "material": - instance.sharedMaterial = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_SphereCollider.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_SphereCollider.cs.meta deleted file mode 100644 index c388053..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_SphereCollider.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: bb19da8937a274e63ada528bb6215c6d -timeCreated: 1519132295 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Text.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Text.cs deleted file mode 100644 index b6f07fc..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Text.cs +++ /dev/null @@ -1,146 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; -using UnityEngine.UI; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("font", "text", "supportRichText", "resizeTextForBestFit", "resizeTextMinSize", "resizeTextMaxSize", "alignment", "alignByGeometry", "fontSize", "horizontalOverflow", "verticalOverflow", "lineSpacing", "fontStyle", "onCullStateChanged", "maskable", "color", "raycastTarget", "material", "useGUILayout", "enabled", "tag", "name", "hideFlags")] - public class ES3Type_Text : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_Text() : base(typeof(Text)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (Text)obj; - - //writer.WriteProperty("font", instance.font); - writer.WriteProperty("text", instance.text); - writer.WriteProperty("supportRichText", instance.supportRichText); - writer.WriteProperty("resizeTextForBestFit", instance.resizeTextForBestFit); - writer.WriteProperty("resizeTextMinSize", instance.resizeTextMinSize); - writer.WriteProperty("resizeTextMaxSize", instance.resizeTextMaxSize); - writer.WriteProperty("alignment", instance.alignment); - writer.WriteProperty("alignByGeometry", instance.alignByGeometry); - writer.WriteProperty("fontSize", instance.fontSize); - writer.WriteProperty("horizontalOverflow", instance.horizontalOverflow); - writer.WriteProperty("verticalOverflow", instance.verticalOverflow); - writer.WriteProperty("lineSpacing", instance.lineSpacing); - writer.WriteProperty("fontStyle", instance.fontStyle); - writer.WriteProperty("onCullStateChanged", instance.onCullStateChanged); - writer.WriteProperty("maskable", instance.maskable); - writer.WriteProperty("color", instance.color); - writer.WriteProperty("raycastTarget", instance.raycastTarget); - // Unity automatically sets the default material if it's set to null. - // This prevents missing reference warnings. - if (instance.material.name.Contains("Default")) - writer.WriteProperty("material", null); - else - writer.WriteProperty("material", instance.material); - writer.WriteProperty("useGUILayout", instance.useGUILayout); - writer.WriteProperty("enabled", instance.enabled); - writer.WriteProperty("hideFlags", instance.hideFlags); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (Text)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "m_FontData": - reader.SetPrivateField("m_FontData", reader.Read(), instance); - break; - case "m_LastTrackedFont": - reader.SetPrivateField("m_LastTrackedFont", reader.Read(), instance); - break; - case "m_Text": - reader.SetPrivateField("m_Text", reader.Read(), instance); - break; - case "m_TextCache": - reader.SetPrivateField("m_TextCache", reader.Read(), instance); - break; - case "m_TextCacheForLayout": - reader.SetPrivateField("m_TextCacheForLayout", reader.Read(), instance); - break; - case "m_Material": - reader.SetPrivateField("m_Material", reader.Read(), instance); - break; - case "font": - instance.font = reader.Read(); - break; - case "text": - instance.text = reader.Read(); - break; - case "supportRichText": - instance.supportRichText = reader.Read(); - break; - case "resizeTextForBestFit": - instance.resizeTextForBestFit = reader.Read(); - break; - case "resizeTextMinSize": - instance.resizeTextMinSize = reader.Read(); - break; - case "resizeTextMaxSize": - instance.resizeTextMaxSize = reader.Read(); - break; - case "alignment": - instance.alignment = reader.Read(); - break; - case "alignByGeometry": - instance.alignByGeometry = reader.Read(); - break; - case "fontSize": - instance.fontSize = reader.Read(); - break; - case "horizontalOverflow": - instance.horizontalOverflow = reader.Read(); - break; - case "verticalOverflow": - instance.verticalOverflow = reader.Read(); - break; - case "lineSpacing": - instance.lineSpacing = reader.Read(); - break; - case "fontStyle": - instance.fontStyle = reader.Read(); - break; - case "onCullStateChanged": - instance.onCullStateChanged = reader.Read(); - break; - case "maskable": - instance.maskable = reader.Read(); - break; - case "color": - instance.color = reader.Read(); - break; - case "raycastTarget": - instance.raycastTarget = reader.Read(); - break; - case "material": - instance.material = reader.Read(); - break; - case "useGUILayout": - instance.useGUILayout = reader.Read(); - break; - case "enabled": - instance.enabled = reader.Read(); - break; - case "hideFlags": - instance.hideFlags = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Text.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Text.cs.meta deleted file mode 100644 index 83aa4f4..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Text.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 69268592921476a42b9819cd66b6ea4a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Transform.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Transform.cs deleted file mode 100644 index 871acf8..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Transform.cs +++ /dev/null @@ -1,58 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("localPosition", "localRotation", "localScale", "parent", "siblingIndex")] - public class ES3Type_Transform : ES3ComponentType - { - public static int countRead = 0; - public static ES3Type Instance; - - public ES3Type_Transform() : base(typeof(Transform)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (Transform)obj; - writer.WritePropertyByRef("parent", instance.parent); - writer.WriteProperty("localPosition", instance.localPosition); - writer.WriteProperty("localRotation", instance.localRotation); - writer.WriteProperty("localScale", instance.localScale); - writer.WriteProperty("siblingIndex", instance.GetSiblingIndex()); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (Transform)obj; - - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case "parent": - instance.SetParent(reader.Read()); - break; - case "localPosition": - instance.localPosition = reader.Read(); - break; - case "localRotation": - instance.localRotation = reader.Read(); - break; - case "localScale": - instance.localScale = reader.Read(); - break; - case "siblingIndex": - instance.SetSiblingIndex(reader.Read()); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Transform.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Transform.cs.meta deleted file mode 100644 index 92c5277..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/Component Types/ES3Type_Transform.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 91cb5bec8da6744608c92304a04462fd -timeCreated: 1519132291 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_AnimationCurve.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_AnimationCurve.cs deleted file mode 100644 index 37d9a50..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_AnimationCurve.cs +++ /dev/null @@ -1,58 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("keys", "preWrapMode", "postWrapMode")] - public class ES3Type_AnimationCurve : ES3Type - { - public static ES3Type Instance; - - public ES3Type_AnimationCurve() : base(typeof(AnimationCurve)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (AnimationCurve)obj; - - writer.WriteProperty("keys", instance.keys, ES3Type_KeyframeArray.Instance); - writer.WriteProperty("preWrapMode", instance.preWrapMode); - writer.WriteProperty("postWrapMode", instance.postWrapMode); - } - - public override object Read(ES3Reader reader) - { - var instance = new AnimationCurve(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (AnimationCurve)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "keys": - instance.keys = reader.Read(); - break; - case "preWrapMode": - instance.preWrapMode = reader.Read(); - break; - case "postWrapMode": - instance.postWrapMode = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_AnimationCurve.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_AnimationCurve.cs.meta deleted file mode 100644 index 4744a26..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_AnimationCurve.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5939fcd6cf1ac4167b4320111cb9930e -timeCreated: 1519132286 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_AudioClip.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_AudioClip.cs deleted file mode 100644 index 2596e61..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_AudioClip.cs +++ /dev/null @@ -1,90 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("name", "samples", "channels", "frequency", "sampleData")] - public class ES3Type_AudioClip : ES3UnityObjectType - { - public static ES3Type Instance; - - public ES3Type_AudioClip() : base(typeof(AudioClip)) { Instance = this; } - - protected override void WriteUnityObject(object obj, ES3Writer writer) - { - var param = (AudioClip)obj; - float[] samples = new float[param.samples * param.channels]; - param.GetData(samples, 0); - writer.WriteProperty("name", param.name); - writer.WriteProperty("samples", param.samples); - writer.WriteProperty("channels", param.channels); - writer.WriteProperty("frequency", param.frequency); - writer.WriteProperty("sampleData", samples); - } - - protected override void ReadUnityObject(ES3Reader reader, object obj) - { - var clip = (AudioClip)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case "sampleData": - clip.SetData(reader.Read(ES3Type_floatArray.Instance), 0); - break; - default: - reader.Skip(); - break; - } - } - } - - protected override object ReadUnityObject(ES3Reader reader) - { - string name = ""; - int samples = 0; - int channels = 0; - int frequency = 0; - AudioClip clip = null; - - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case "name": - name = reader.Read(ES3Type_string.Instance); - break; - case "samples": - samples = reader.Read(ES3Type_int.Instance); - break; - case "channels": - channels = reader.Read(ES3Type_int.Instance); - break; - case "frequency": - frequency = reader.Read(ES3Type_int.Instance); - break; - case "sampleData": - clip = AudioClip.Create(name, samples, channels, frequency, false); - clip.SetData(reader.Read(ES3Type_floatArray.Instance), 0); - break; - default: - reader.Skip(); - break; - } - } - - return clip; - } - } - - public class ES3Type_AudioClipArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_AudioClipArray() : base(typeof(AudioClip[]), ES3Type_AudioClip.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_AudioClip.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_AudioClip.cs.meta deleted file mode 100644 index 77d148d..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_AudioClip.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9b8f97ab775644e1782f7775c54f891a -timeCreated: 1519132292 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_BoneWeight.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_BoneWeight.cs deleted file mode 100644 index 2ceeb94..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_BoneWeight.cs +++ /dev/null @@ -1,60 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("boneIndex0", "boneIndex1", "boneIndex2", "boneIndex3", "weight0", "weight1", "weight2", "weight3")] - public class ES3Type_BoneWeight : ES3Type - { - public static ES3Type Instance; - - public ES3Type_BoneWeight() : base(typeof(BoneWeight)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var casted = (BoneWeight)obj; - - writer.WriteProperty("boneIndex0", casted.boneIndex0, ES3Type_int.Instance); - writer.WriteProperty("boneIndex1", casted.boneIndex1, ES3Type_int.Instance); - writer.WriteProperty("boneIndex2", casted.boneIndex2, ES3Type_int.Instance); - writer.WriteProperty("boneIndex3", casted.boneIndex3, ES3Type_int.Instance); - - writer.WriteProperty("weight0", casted.weight0, ES3Type_float.Instance); - writer.WriteProperty("weight1", casted.weight1, ES3Type_float.Instance); - writer.WriteProperty("weight2", casted.weight2, ES3Type_float.Instance); - writer.WriteProperty("weight3", casted.weight3, ES3Type_float.Instance); - - } - - public override object Read(ES3Reader reader) - { - var obj = new BoneWeight(); - - obj.boneIndex0 = reader.ReadProperty(ES3Type_int.Instance); - obj.boneIndex1 = reader.ReadProperty(ES3Type_int.Instance); - obj.boneIndex2 = reader.ReadProperty(ES3Type_int.Instance); - obj.boneIndex3 = reader.ReadProperty(ES3Type_int.Instance); - - obj.weight0 = reader.ReadProperty(ES3Type_float.Instance); - obj.weight1 = reader.ReadProperty(ES3Type_float.Instance); - obj.weight2 = reader.ReadProperty(ES3Type_float.Instance); - obj.weight3 = reader.ReadProperty(ES3Type_float.Instance); - - return obj; - } - } - - public class ES3Type_BoneWeightArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_BoneWeightArray() : base(typeof(BoneWeight[]), ES3Type_BoneWeight.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_BoneWeight.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_BoneWeight.cs.meta deleted file mode 100644 index 66448fd..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_BoneWeight.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 570ee00d71c7c43a5a7e6a68e2c9d96f -timeCreated: 1519132285 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Bounds.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Bounds.cs deleted file mode 100644 index cbb22a8..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Bounds.cs +++ /dev/null @@ -1,41 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("center", "size")] - public class ES3Type_Bounds : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Bounds() : base(typeof(Bounds)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var casted = (Bounds)obj; - - writer.WriteProperty("center", casted.center, ES3Type_Vector3.Instance); - writer.WriteProperty("size", casted.size, ES3Type_Vector3.Instance); - } - - public override object Read(ES3Reader reader) - { - return new Bounds(reader.ReadProperty(ES3Type_Vector3.Instance), - reader.ReadProperty(ES3Type_Vector3.Instance)); - } - } - - public class ES3Type_BoundsArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_BoundsArray() : base(typeof(Bounds[]), ES3Type_Bounds.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Bounds.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Bounds.cs.meta deleted file mode 100644 index c85d95d..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Bounds.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3a9d8a8b9b10b466786d6d39807aa8e0 -timeCreated: 1519132283 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Burst.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Burst.cs deleted file mode 100644 index 267a706..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Burst.cs +++ /dev/null @@ -1,81 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("time", "count", "minCount", "maxCount", "cycleCount", "repeatInterval", "probability")] - public class ES3Type_Burst : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Burst() : base(typeof(ParticleSystem.Burst)) - { - Instance = this; - priority = 1; - } - - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.Burst)obj; - - writer.WriteProperty("time", instance.time, ES3Type_float.Instance); - writer.WriteProperty("count", instance.count, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("minCount", instance.minCount, ES3Type_short.Instance); - writer.WriteProperty("maxCount", instance.maxCount, ES3Type_short.Instance); - writer.WriteProperty("cycleCount", instance.cycleCount, ES3Type_int.Instance); - writer.WriteProperty("repeatInterval", instance.repeatInterval, ES3Type_float.Instance); - writer.WriteProperty("probability", instance.probability, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.Burst(); - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "time": - instance.time = reader.Read(ES3Type_float.Instance); - break; - case "count": - instance.count = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "minCount": - instance.minCount = reader.Read(ES3Type_short.Instance); - break; - case "maxCount": - instance.maxCount = reader.Read(ES3Type_short.Instance); - break; - case "cycleCount": - instance.cycleCount = reader.Read(ES3Type_int.Instance); - break; - case "repeatInterval": - instance.repeatInterval = reader.Read(ES3Type_float.Instance); - break; - case "probability": - instance.probability = reader.Read(ES3Type_float.Instance); - break; - default: - reader.Skip(); - break; - } - } - return instance; - } - } - - - public class ES3Type_BurstArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_BurstArray() : base(typeof(ParticleSystem.Burst[]), ES3Type_Burst.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Burst.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Burst.cs.meta deleted file mode 100644 index b08fb3a..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Burst.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f15f94055e5ae9346969078ad65f3786 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_CollisionModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_CollisionModule.cs deleted file mode 100644 index ed8aa50..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_CollisionModule.cs +++ /dev/null @@ -1,117 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "type", "mode", "dampen", "dampenMultiplier", "bounce", "bounceMultiplier", "lifetimeLoss", "lifetimeLossMultiplier", "minKillSpeed", "maxKillSpeed", "collidesWith", "enableDynamicColliders", "maxCollisionShapes", "quality", "voxelSize", "radiusScale", "sendCollisionMessages")] - public class ES3Type_CollisionModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_CollisionModule() : base(typeof(ParticleSystem.CollisionModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.CollisionModule)obj; - - writer.WriteProperty("enabled", instance.enabled); - writer.WriteProperty("type", instance.type); - writer.WriteProperty("mode", instance.mode); - writer.WriteProperty("dampen", instance.dampen); - writer.WriteProperty("dampenMultiplier", instance.dampenMultiplier); - writer.WriteProperty("bounce", instance.bounce); - writer.WriteProperty("bounceMultiplier", instance.bounceMultiplier); - writer.WriteProperty("lifetimeLoss", instance.lifetimeLoss); - writer.WriteProperty("lifetimeLossMultiplier", instance.lifetimeLossMultiplier); - writer.WriteProperty("minKillSpeed", instance.minKillSpeed); - writer.WriteProperty("maxKillSpeed", instance.maxKillSpeed); - writer.WriteProperty("collidesWith", instance.collidesWith); - writer.WriteProperty("enableDynamicColliders", instance.enableDynamicColliders); - writer.WriteProperty("maxCollisionShapes", instance.maxCollisionShapes); - writer.WriteProperty("quality", instance.quality); - writer.WriteProperty("voxelSize", instance.voxelSize); - writer.WriteProperty("radiusScale", instance.radiusScale); - writer.WriteProperty("sendCollisionMessages", instance.sendCollisionMessages); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.CollisionModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.CollisionModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - case "enabled": - instance.enabled = reader.Read(); - break; - case "type": - instance.type = reader.Read(); - break; - case "mode": - instance.mode = reader.Read(); - break; - case "dampen": - instance.dampen = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "dampenMultiplier": - instance.dampenMultiplier = reader.Read(); - break; - case "bounce": - instance.bounce = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "bounceMultiplier": - instance.bounceMultiplier = reader.Read(); - break; - case "lifetimeLoss": - instance.lifetimeLoss = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "lifetimeLossMultiplier": - instance.lifetimeLossMultiplier = reader.Read(); - break; - case "minKillSpeed": - instance.minKillSpeed = reader.Read(); - break; - case "maxKillSpeed": - instance.maxKillSpeed = reader.Read(); - break; - case "collidesWith": - instance.collidesWith = reader.Read(); - break; - case "enableDynamicColliders": - instance.enableDynamicColliders = reader.Read(); - break; - case "maxCollisionShapes": - instance.maxCollisionShapes = reader.Read(); - break; - case "quality": - instance.quality = reader.Read(); - break; - case "voxelSize": - instance.voxelSize = reader.Read(); - break; - case "radiusScale": - instance.radiusScale = reader.Read(); - break; - case "sendCollisionMessages": - instance.sendCollisionMessages = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_CollisionModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_CollisionModule.cs.meta deleted file mode 100644 index 8474ea0..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_CollisionModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 45f02f0eb77fe4209a290c5928c9ade5 -timeCreated: 1519132284 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Color.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Color.cs deleted file mode 100644 index bb29f94..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Color.cs +++ /dev/null @@ -1,44 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("r", "g", "b", "a")] - public class ES3Type_Color : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Color() : base(typeof(Color)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var casted = (Color)obj; - writer.WriteProperty("r", casted.r, ES3Type_float.Instance); - writer.WriteProperty("g", casted.g, ES3Type_float.Instance); - writer.WriteProperty("b", casted.b, ES3Type_float.Instance); - writer.WriteProperty("a", casted.a, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - return new Color(reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance)); - } - } - - public class ES3Type_ColorArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_ColorArray() : base(typeof(Color[]), ES3Type_Color.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Color.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Color.cs.meta deleted file mode 100644 index 1d0dc8b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Color.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b97411847937943ab859b0ab7acfb872 -timeCreated: 1519132295 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Color32.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Color32.cs deleted file mode 100644 index 78fd3fb..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Color32.cs +++ /dev/null @@ -1,51 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("r", "g", "b", "a")] - public class ES3Type_Color32 : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Color32() : base(typeof(Color32)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var casted = (Color32)obj; - writer.WriteProperty("r", casted.r, ES3Type_byte.Instance); - writer.WriteProperty("g", casted.g, ES3Type_byte.Instance); - writer.WriteProperty("b", casted.b, ES3Type_byte.Instance); - writer.WriteProperty("a", casted.a, ES3Type_byte.Instance); - } - - public override object Read(ES3Reader reader) - { - return new Color32(reader.ReadProperty(ES3Type_byte.Instance), - reader.ReadProperty(ES3Type_byte.Instance), - reader.ReadProperty(ES3Type_byte.Instance), - reader.ReadProperty(ES3Type_byte.Instance)); - } - - public static bool Equals(Color32 a, Color32 b) - { - if (a.r != b.r || a.g != b.g || a.b != b.b || a.a != b.a) - return false; - return true; - } - } - - public class ES3Type_Color32Array : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_Color32Array() : base(typeof(Color32[]), ES3Type_Color32.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Color32.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Color32.cs.meta deleted file mode 100644 index 93d9bfc..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Color32.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3b1b3a09c48c14072a133f5ba4c651e7 -timeCreated: 1519132283 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ColorBySpeedModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ColorBySpeedModule.cs deleted file mode 100644 index f601a90..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ColorBySpeedModule.cs +++ /dev/null @@ -1,58 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "color", "range")] - public class ES3Type_ColorBySpeedModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_ColorBySpeedModule() : base(typeof(ParticleSystem.ColorBySpeedModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.ColorBySpeedModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("color", instance.color, ES3Type_MinMaxGradient.Instance); - writer.WriteProperty("range", instance.range, ES3Type_Vector2.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.ColorBySpeedModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.ColorBySpeedModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "color": - instance.color = reader.Read(ES3Type_MinMaxGradient.Instance); - break; - case "range": - instance.range = reader.Read(ES3Type_Vector2.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ColorBySpeedModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ColorBySpeedModule.cs.meta deleted file mode 100644 index 38e5107..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ColorBySpeedModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: fb109d087368d4849b6e1222c912ec72 -timeCreated: 1519132301 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ColorOverLifetimeModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ColorOverLifetimeModule.cs deleted file mode 100644 index 31e2a62..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ColorOverLifetimeModule.cs +++ /dev/null @@ -1,54 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "color")] - public class ES3Type_ColorOverLifetimeModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_ColorOverLifetimeModule() : base(typeof(ParticleSystem.ColorOverLifetimeModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.ColorOverLifetimeModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("color", instance.color, ES3Type_MinMaxGradient.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.ColorOverLifetimeModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.ColorOverLifetimeModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "color": - instance.color = reader.Read(ES3Type_MinMaxGradient.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ColorOverLifetimeModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ColorOverLifetimeModule.cs.meta deleted file mode 100644 index 39921c1..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ColorOverLifetimeModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 744909a4693a34ff99f9886d8bddc408 -timeCreated: 1519132288 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_EmissionModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_EmissionModule.cs deleted file mode 100644 index e2fcf40..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_EmissionModule.cs +++ /dev/null @@ -1,74 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "rateOverTime", "rateOverTimeMultiplier", "rateOverDistance", "rateOverDistanceMultiplier")] - public class ES3Type_EmissionModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_EmissionModule() : base(typeof(ParticleSystem.EmissionModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.EmissionModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("rateOverTime", instance.rateOverTime, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("rateOverTimeMultiplier", instance.rateOverTimeMultiplier, ES3Type_float.Instance); - writer.WriteProperty("rateOverDistance", instance.rateOverDistance, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("rateOverDistanceMultiplier", instance.rateOverDistanceMultiplier, ES3Type_float.Instance); - - ParticleSystem.Burst[] bursts = new ParticleSystem.Burst[instance.burstCount]; - instance.GetBursts(bursts); - writer.WriteProperty("bursts", bursts, ES3Type_BurstArray.Instance); - } - - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.EmissionModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.EmissionModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "rateOverTime": - instance.rateOverTime = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "rateOverTimeMultiplier": - instance.rateOverTimeMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "rateOverDistance": - instance.rateOverDistance = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "rateOverDistanceMultiplier": - instance.rateOverDistanceMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "bursts": - instance.SetBursts(reader.Read(ES3Type_BurstArray.Instance)); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_EmissionModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_EmissionModule.cs.meta deleted file mode 100644 index 99fcbec..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_EmissionModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0601343d0f8fb45d591c1f16dde23330 -timeCreated: 1519132279 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ExternalForcesModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ExternalForcesModule.cs deleted file mode 100644 index 708ec5b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ExternalForcesModule.cs +++ /dev/null @@ -1,54 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "multiplier")] - public class ES3Type_ExternalForcesModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_ExternalForcesModule() : base(typeof(ParticleSystem.ExternalForcesModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.ExternalForcesModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("multiplier", instance.multiplier, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.ExternalForcesModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.ExternalForcesModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "multiplier": - instance.multiplier = reader.Read(ES3Type_float.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ExternalForcesModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ExternalForcesModule.cs.meta deleted file mode 100644 index 6c9f789..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ExternalForcesModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 73b0b581a64c54420b1931059384200c -timeCreated: 1519132288 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Flare.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Flare.cs deleted file mode 100644 index d3f028c..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Flare.cs +++ /dev/null @@ -1,60 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("hideFlags")] - public class ES3Type_Flare : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Flare() : base(typeof(Flare)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (Flare)obj; - - writer.WriteProperty("hideFlags", instance.hideFlags); - } - - public override object Read(ES3Reader reader) - { - var instance = new Flare(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (Flare)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "hideFlags": - instance.hideFlags = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } - - public class ES3Type_FlareArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_FlareArray() : base(typeof(Flare[]), ES3Type_Flare.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Flare.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Flare.cs.meta deleted file mode 100644 index daf3587..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Flare.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 32592ed571b254a1ebc1cda3cc03f861 -timeCreated: 1519132282 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Font.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Font.cs deleted file mode 100644 index d7efffa..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Font.cs +++ /dev/null @@ -1,57 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("material", "name")] - public class ES3Type_Font : ES3UnityObjectType - { - public static ES3Type Instance; - - public ES3Type_Font() : base(typeof(Font)) { Instance = this; } - - protected override void WriteUnityObject(object obj, ES3Writer writer) - { - var instance = (Font)obj; - - writer.WriteProperty("name", instance.name, ES3Type_string.Instance); - writer.WriteProperty("material", instance.material); - } - - protected override void ReadUnityObject(ES3Reader reader, object obj) - { - var instance = (Font)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - case "material": - instance.material = reader.Read(ES3Type_Material.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - - protected override object ReadUnityObject(ES3Reader reader) - { - var instance = new Font(reader.ReadProperty(ES3Type_string.Instance)); - ReadObject(reader, instance); - return instance; - } - } - - public class ES3Type_FontArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_FontArray() : base(typeof(Font[]), ES3Type_Font.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Font.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Font.cs.meta deleted file mode 100644 index e82c7b7..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Font.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b779410f33269447a8410aa5c60a3366 -timeCreated: 1519132294 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ForceOverLifetimeModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ForceOverLifetimeModule.cs deleted file mode 100644 index c40ea43..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ForceOverLifetimeModule.cs +++ /dev/null @@ -1,82 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "x", "y", "z", "xMultiplier", "yMultiplier", "zMultiplier", "space", "randomized")] - public class ES3Type_ForceOverLifetimeModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_ForceOverLifetimeModule() : base(typeof(ParticleSystem.ForceOverLifetimeModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.ForceOverLifetimeModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("x", instance.x, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("y", instance.y, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("z", instance.z, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("xMultiplier", instance.xMultiplier, ES3Type_float.Instance); - writer.WriteProperty("yMultiplier", instance.yMultiplier, ES3Type_float.Instance); - writer.WriteProperty("zMultiplier", instance.zMultiplier, ES3Type_float.Instance); - writer.WriteProperty("space", instance.space); - writer.WriteProperty("randomized", instance.randomized, ES3Type_bool.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.ForceOverLifetimeModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.ForceOverLifetimeModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "x": - instance.x = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "y": - instance.y = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "z": - instance.z = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "xMultiplier": - instance.xMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "yMultiplier": - instance.yMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "zMultiplier": - instance.zMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "space": - instance.space = reader.Read(); - break; - case "randomized": - instance.randomized = reader.Read(ES3Type_bool.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ForceOverLifetimeModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ForceOverLifetimeModule.cs.meta deleted file mode 100644 index 537835b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ForceOverLifetimeModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: fd5844fc025754c5399be113ca40fc39 -timeCreated: 1519132301 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs deleted file mode 100644 index fff9897..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs +++ /dev/null @@ -1,300 +0,0 @@ -using System; -using System.Collections.Generic; -using ES3Internal; -using UnityEngine; -using UnityEngine.Scripting; -using Object = UnityEngine.Object; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("layer", "isStatic", "tag", "name", "hideFlags", "children", "components")] - public class ES3Type_GameObject : ES3UnityObjectType - { - private const string prefabPropertyName = "es3Prefab"; - private const string transformPropertyName = "transformID"; - public static ES3Type Instance; - public bool saveChildren = false; - - public ES3Type_GameObject() : base(typeof(GameObject)) { Instance = this; } - - public override void WriteObject(object obj, ES3Writer writer, ES3.ReferenceMode mode) - { - if (WriteUsingDerivedType(obj, writer)) - return; - var instance = (GameObject)obj; - - if (mode != ES3.ReferenceMode.ByValue) - { - writer.WriteRef(instance); - - if (mode == ES3.ReferenceMode.ByRef) - return; - - var es3Prefab = instance.GetComponent(); - if (es3Prefab != null) - writer.WriteProperty(prefabPropertyName, es3Prefab, ES3Type_ES3PrefabInternal.Instance); - - // Write the ID of this Transform so we can assign it's ID when we load. - writer.WriteProperty(transformPropertyName, ES3ReferenceMgrBase.Current.Add(instance.transform)); - } - - var es3AutoSave = instance.GetComponent(); - - if (es3AutoSave == null || es3AutoSave.saveLayer) - writer.WriteProperty("layer", instance.layer, ES3Type_int.Instance); - if (es3AutoSave == null || es3AutoSave.saveTag) - writer.WriteProperty("tag", instance.tag, ES3Type_string.Instance); - if (es3AutoSave == null || es3AutoSave.saveName) - writer.WriteProperty("name", instance.name, ES3Type_string.Instance); - if (es3AutoSave == null || es3AutoSave.saveHideFlags) - writer.WriteProperty("hideFlags", instance.hideFlags); - if (es3AutoSave == null || es3AutoSave.saveActive) - writer.WriteProperty("active", instance.activeSelf); - - if (es3AutoSave == null && saveChildren || es3AutoSave != null && es3AutoSave.saveChildren) - writer.WriteProperty("children", GetChildren(instance), ES3.ReferenceMode.ByRefAndValue); - - List components; - - var es3GameObject = instance.GetComponent(); - - // If there's an ES3AutoSave attached and Components are marked to be saved, save these. - if (es3AutoSave != null) - components = es3AutoSave.componentsToSave; - // If there's an ES3GameObject attached, save these. - else if (es3GameObject != null) - components = es3GameObject.components; - // Otherwise, only save explicitly-supported Components, /*or those explicitly marked as Serializable*/. - else - { - components = new List(); - foreach (var component in instance.GetComponents()) - if (component != null && ES3TypeMgr.GetES3Type(component.GetType()) != null) - components.Add(component); - } - - if (components != null & components.Count > 0) - writer.WriteProperty("components", components, ES3.ReferenceMode.ByRefAndValue); - } - - protected override object ReadObject(ES3Reader reader) - { - Object obj = null; - var refMgr = ES3ReferenceMgrBase.Current; - long id = 0; - - // Read the intial properties regarding the instance we're loading. - while(true) - { - if (refMgr == null) - throw new InvalidOperationException("An Easy Save 3 Manager is required to load references. To add one to your scene, exit playmode and go to Tools > Easy Save 3 > Add Manager to Scene"); - - string propertyName = ReadPropertyName(reader); - - if (propertyName == typeFieldName) - return ES3TypeMgr.GetOrCreateES3Type(reader.ReadType()).Read(reader); - if (propertyName == ES3ReferenceMgrBase.referencePropertyName) - { - id = reader.Read_ref(); - obj = refMgr.Get(id, true); - } - else if (propertyName == transformPropertyName) - { - // Now load the Transform's ID and assign it to the Transform of our object. - long transformID = reader.Read_ref(); - if (obj == null) - obj = CreateNewGameObject(refMgr, id); - refMgr.Add(((GameObject)obj).transform, transformID); - } - else if (propertyName == prefabPropertyName) - { - if (obj != null || ES3ReferenceMgrBase.Current == null) - { - reader.ReadInto(obj); // ReadInto to apply the prefab references. - } - else - { - obj = reader.Read(ES3Type_ES3PrefabInternal.Instance); - ES3ReferenceMgrBase.Current.Add(obj, id); - } - } - else if (propertyName == null) - { - /*if (obj == null) - obj = CreateNewGameObject(refMgr, id);*/ - return obj; - } - else - { - reader.overridePropertiesName = propertyName; - break; - } - } - - if (obj == null) - obj = CreateNewGameObject(refMgr, id); - - ReadInto(reader, obj); - return obj; - } - - protected override void ReadObject(ES3Reader reader, object obj) - { - var instance = (GameObject)obj; - - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case ES3ReferenceMgrBase.referencePropertyName: - ES3ReferenceMgrBase.Current.Add(instance, reader.Read_ref()); - break; - case "prefab": - break; - case "layer": - instance.layer = reader.Read(ES3Type_int.Instance); - break; - case "tag": - instance.tag = reader.Read(ES3Type_string.Instance); - break; - case "name": - instance.name = reader.Read(ES3Type_string.Instance); - break; - case "hideFlags": - instance.hideFlags = reader.Read(); - break; - case "active": - instance.SetActive(reader.Read(ES3Type_bool.Instance)); - break; - case "children": - GameObject[] children = reader.Read(); - var parent = instance.transform; - // Set the parent of each child to this Transform in case the reference ID of the parent has changed. - foreach (var child in children) - child.transform.SetParent(parent); - break; - case "components": - ReadComponents(reader, instance); - break; - default: - reader.Skip(); - break; - } - } - } - - private void ReadComponents(ES3Reader reader, GameObject go) - { - if (reader.StartReadCollection()) - return; - - List components = new List(go.GetComponents()); - - // Read each Component in Components array - while(true) - { - if (!reader.StartReadCollectionItem()) - break; - - if (reader.StartReadObject()) - // We're reading null, so skip this Component. - continue; - - Type type = null; - - string propertyName; - while(true) - { - propertyName = ReadPropertyName(reader); - - if (propertyName == typeFieldName) - type = reader.ReadType(); - else if (propertyName == ES3ReferenceMgrBase.referencePropertyName) - { - if (type == null) - throw new InvalidOperationException("Cannot load Component because no type data has been stored with it, so it's not possible to determine it's type"); - - long componentRef = reader.Read_ref(); - - // Rather than loading by reference, load using the Components list. - var c = components.Find(x => x.GetType() == type); - // If the Component exists in the Component list, load into it and remove it from the list. - if (c != null) - { - if (ES3ReferenceMgrBase.Current != null) - ES3ReferenceMgrBase.Current.Add(c, componentRef); - - ES3TypeMgr.GetOrCreateES3Type(type).ReadInto(reader, c); - components.Remove(c); - } - // Else, create a new Component. - else - { - var component = go.AddComponent(type); - ES3TypeMgr.GetOrCreateES3Type(type).ReadInto(reader, component); - ES3ReferenceMgrBase.Current.Add(component, componentRef); - } - break; - } - else if (propertyName == null) - break; - else - { - reader.overridePropertiesName = propertyName; - ReadObject(reader); - break; - } - } - - reader.EndReadObject(); - - if (reader.EndReadCollectionItem()) - break; - } - - reader.EndReadCollection(); - } - - private GameObject CreateNewGameObject(ES3ReferenceMgrBase refMgr, long id) - { - var go = new GameObject(); - if (id != 0) - refMgr.Add(go, id); - else - refMgr.Add(go); - return go; - } - - /* - * Gets the direct children of this GameObject. - */ - public static List GetChildren(GameObject go) - { - var goTransform = go.transform; - List children = new List(); - - foreach (Transform child in goTransform) - // If a child has an Auto Save component, let it save itself. - //if(child.GetComponent() == null) - children.Add(child.gameObject); - - return children; - } - - // These are not used as we've overridden the ReadObject methods instead. - protected override void WriteUnityObject(object obj, ES3Writer writer) {} - protected override void ReadUnityObject(ES3Reader reader, object obj) {} - protected override object ReadUnityObject(ES3Reader reader) { return null; } - } - - public class ES3Type_GameObjectArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_GameObjectArray() : base(typeof(GameObject[]), ES3Type_GameObject.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs.meta deleted file mode 100644 index 0f59d3b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 1ca7947fbcbec457f89b984a9647a9d7 -timeCreated: 1519132281 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Gradient.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Gradient.cs deleted file mode 100644 index 515b29a..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Gradient.cs +++ /dev/null @@ -1,55 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("colorKeys", "alphaKeys", "mode")] - public class ES3Type_Gradient : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Gradient() : base(typeof(Gradient)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (Gradient)obj; - writer.WriteProperty("colorKeys", instance.colorKeys, ES3Type_GradientColorKeyArray.Instance); - writer.WriteProperty("alphaKeys", instance.alphaKeys, ES3Type_GradientAlphaKeyArray.Instance); - writer.WriteProperty("mode", instance.mode); - } - - public override object Read(ES3Reader reader) - { - var instance = new Gradient(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (Gradient)obj; - instance.SetKeys( - reader.ReadProperty(ES3Type_GradientColorKeyArray.Instance), - reader.ReadProperty(ES3Type_GradientAlphaKeyArray.Instance) - ); - - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - case "mode": - instance.mode = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Gradient.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Gradient.cs.meta deleted file mode 100644 index e400a6e..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Gradient.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a509023afeeee4a49965009b6ba4bc44 -timeCreated: 1519132293 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GradientAlphaKey.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GradientAlphaKey.cs deleted file mode 100644 index 8d743db..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GradientAlphaKey.cs +++ /dev/null @@ -1,41 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("alpha", "time")] - public class ES3Type_GradientAlphaKey : ES3Type - { - public static ES3Type Instance; - - public ES3Type_GradientAlphaKey() : base(typeof(GradientAlphaKey)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (GradientAlphaKey)obj; - - writer.WriteProperty("alpha", instance.alpha, ES3Type_float.Instance); - writer.WriteProperty("time", instance.time, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - return new GradientAlphaKey(reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance)); - } - } - - public class ES3Type_GradientAlphaKeyArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_GradientAlphaKeyArray() : base(typeof(GradientAlphaKey[]), ES3Type_GradientAlphaKey.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GradientAlphaKey.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GradientAlphaKey.cs.meta deleted file mode 100644 index 8b69cd8..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GradientAlphaKey.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 934a57ef826284a56bb97406bcf373fd -timeCreated: 1519132291 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GradientColorKey.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GradientColorKey.cs deleted file mode 100644 index cc072c1..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GradientColorKey.cs +++ /dev/null @@ -1,41 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("color", "time")] - public class ES3Type_GradientColorKey : ES3Type - { - public static ES3Type Instance; - - public ES3Type_GradientColorKey() : base(typeof(GradientColorKey)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (GradientColorKey)obj; - - writer.WriteProperty("color", instance.color, ES3Type_Color.Instance); - writer.WriteProperty("time", instance.time, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - return new GradientColorKey(reader.ReadProperty(ES3Type_Color.Instance), - reader.ReadProperty(ES3Type_float.Instance)); - } - } - - public class ES3Type_GradientColorKeyArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_GradientColorKeyArray() : base(typeof(GradientColorKey[]), ES3Type_GradientColorKey.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GradientColorKey.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GradientColorKey.cs.meta deleted file mode 100644 index b154e9a..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GradientColorKey.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9dcbf4e7ca28b4bd5a6eb0a9d256c082 -timeCreated: 1519132292 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Guid.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Guid.cs deleted file mode 100644 index 28026ef..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Guid.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("value")] - public class ES3Type_Guid : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Guid() : base(typeof(Guid)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var casted = (Guid)obj; - writer.WriteProperty("value", casted.ToString(), ES3Type_string.Instance); - } - - public override object Read(ES3Reader reader) - { - return Guid.Parse(reader.ReadProperty(ES3Type_string.Instance)); - } - } - - public class ES3Type_GuidArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_GuidArray() : base(typeof(Guid[]), ES3Type_Guid.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Guid.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Guid.cs.meta deleted file mode 100644 index 873d71f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Guid.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7e9441d85c177084db4be38cf2cb2aca -timeCreated: 1519132295 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_InheritVelocityModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_InheritVelocityModule.cs deleted file mode 100644 index b0a00fc..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_InheritVelocityModule.cs +++ /dev/null @@ -1,62 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "mode", "curve", "curveMultiplier")] - public class ES3Type_InheritVelocityModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_InheritVelocityModule() : base(typeof(ParticleSystem.InheritVelocityModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.InheritVelocityModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("mode", instance.mode); - writer.WriteProperty("curve", instance.curve, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("curveMultiplier", instance.curveMultiplier, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.InheritVelocityModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.InheritVelocityModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "mode": - instance.mode = reader.Read(); - break; - case "curve": - instance.curve = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "curveMultiplier": - instance.curveMultiplier = reader.Read(ES3Type_float.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_InheritVelocityModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_InheritVelocityModule.cs.meta deleted file mode 100644 index 35f3ffd..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_InheritVelocityModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c652805edba024e5c885fa799b3a5775 -timeCreated: 1519132296 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Keyframe.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Keyframe.cs deleted file mode 100644 index 5c9776d..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Keyframe.cs +++ /dev/null @@ -1,45 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("time", "value", "inTangent", "outTangent")] - public class ES3Type_Keyframe : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Keyframe() : base(typeof(Keyframe)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (Keyframe)obj; - - writer.WriteProperty("time", instance.time, ES3Type_float.Instance); - writer.WriteProperty("value", instance.value, ES3Type_float.Instance); - writer.WriteProperty("inTangent", instance.inTangent, ES3Type_float.Instance); - writer.WriteProperty("outTangent", instance.outTangent, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - return new Keyframe(reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance)); - } - } - - public class ES3Type_KeyframeArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_KeyframeArray() : base(typeof(Keyframe[]), ES3Type_Keyframe.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Keyframe.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Keyframe.cs.meta deleted file mode 100644 index 81154b3..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Keyframe.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 63eb0700074954e23aa09edcc4b81016 -timeCreated: 1519132287 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LayerMask.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LayerMask.cs deleted file mode 100644 index 8ae213c..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LayerMask.cs +++ /dev/null @@ -1,43 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("colorKeys", "alphaKeys", "mode")] - public class ES3Type_LayerMask : ES3Type - { - public static ES3Type Instance; - - public ES3Type_LayerMask() : base(typeof(LayerMask)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (LayerMask)obj; - - writer.WriteProperty("value", instance.value, ES3Type_int.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new LayerMask(); - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - case "value": - instance = reader.Read(ES3Type_int.Instance); - break; - default: - reader.Skip(); - break; - } - } - return instance; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LayerMask.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LayerMask.cs.meta deleted file mode 100644 index 45f770c..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LayerMask.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ad28544641a3c495b8ebbf10c51bf359 -timeCreated: 1519132293 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Light.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Light.cs deleted file mode 100644 index 69971fd..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Light.cs +++ /dev/null @@ -1,119 +0,0 @@ -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("type", "color", "intensity", "bounceIntensity", "shadows", "shadowStrength", "shadowResolution", "shadowCustomResolution", "shadowBias", "shadowNormalBias", "shadowNearPlane", "range", "spotAngle", "cookieSize", "cookie", "flare", "renderMode", "cullingMask", "areaSize", "lightmappingMode", "enabled", "hideFlags")] - public class ES3Type_Light : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_Light() : base(typeof(Light)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (Light)obj; - - writer.WriteProperty("type", instance.type); - writer.WriteProperty("color", instance.color, ES3Type_Color.Instance); - writer.WriteProperty("intensity", instance.intensity, ES3Type_float.Instance); - writer.WriteProperty("bounceIntensity", instance.bounceIntensity, ES3Type_float.Instance); - writer.WriteProperty("shadows", instance.shadows); - writer.WriteProperty("shadowStrength", instance.shadowStrength, ES3Type_float.Instance); - writer.WriteProperty("shadowResolution", instance.shadowResolution); - writer.WriteProperty("shadowCustomResolution", instance.shadowCustomResolution, ES3Type_int.Instance); - writer.WriteProperty("shadowBias", instance.shadowBias, ES3Type_float.Instance); - writer.WriteProperty("shadowNormalBias", instance.shadowNormalBias, ES3Type_float.Instance); - writer.WriteProperty("shadowNearPlane", instance.shadowNearPlane, ES3Type_float.Instance); - writer.WriteProperty("range", instance.range, ES3Type_float.Instance); - writer.WriteProperty("spotAngle", instance.spotAngle, ES3Type_float.Instance); - writer.WriteProperty("cookieSize", instance.cookieSize, ES3Type_float.Instance); - writer.WriteProperty("cookie", instance.cookie, ES3Type_Texture2D.Instance); - writer.WriteProperty("flare", instance.flare, ES3Type_Texture2D.Instance); - writer.WriteProperty("renderMode", instance.renderMode); - writer.WriteProperty("cullingMask", instance.cullingMask, ES3Type_int.Instance); - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("hideFlags", instance.hideFlags); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (Light)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "type": - instance.type = reader.Read(); - break; - case "color": - instance.color = reader.Read(ES3Type_Color.Instance); - break; - case "intensity": - instance.intensity = reader.Read(ES3Type_float.Instance); - break; - case "bounceIntensity": - instance.bounceIntensity = reader.Read(ES3Type_float.Instance); - break; - case "shadows": - instance.shadows = reader.Read(); - break; - case "shadowStrength": - instance.shadowStrength = reader.Read(ES3Type_float.Instance); - break; - case "shadowResolution": - instance.shadowResolution = reader.Read(); - break; - case "shadowCustomResolution": - instance.shadowCustomResolution = reader.Read(ES3Type_int.Instance); - break; - case "shadowBias": - instance.shadowBias = reader.Read(ES3Type_float.Instance); - break; - case "shadowNormalBias": - instance.shadowNormalBias = reader.Read(ES3Type_float.Instance); - break; - case "shadowNearPlane": - instance.shadowNearPlane = reader.Read(ES3Type_float.Instance); - break; - case "range": - instance.range = reader.Read(ES3Type_float.Instance); - break; - case "spotAngle": - instance.spotAngle = reader.Read(ES3Type_float.Instance); - break; - case "cookieSize": - instance.cookieSize = reader.Read(ES3Type_float.Instance); - break; - case "cookie": - instance.cookie = reader.Read(); - break; - case "flare": - instance.flare = reader.Read(); - break; - case "renderMode": - instance.renderMode = reader.Read(); - break; - case "cullingMask": - instance.cullingMask = reader.Read(ES3Type_int.Instance); - break; - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "hideFlags": - instance.hideFlags = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Light.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Light.cs.meta deleted file mode 100644 index 54c6c1b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Light.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ed020448eba3f489fafcf36e1bf3b7e0 -timeCreated: 1519132300 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LightsModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LightsModule.cs deleted file mode 100644 index 8ce3a2f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LightsModule.cs +++ /dev/null @@ -1,94 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "ratio", "useRandomDistribution", "light", "useParticleColor", "sizeAffectsRange", "alphaAffectsIntensity", "range", "rangeMultiplier", "intensity", "intensityMultiplier", "maxLights")] - public class ES3Type_LightsModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_LightsModule() : base(typeof(ParticleSystem.LightsModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.LightsModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("ratio", instance.ratio, ES3Type_float.Instance); - writer.WriteProperty("useRandomDistribution", instance.useRandomDistribution, ES3Type_bool.Instance); - writer.WritePropertyByRef("light", instance.light); - writer.WriteProperty("useParticleColor", instance.useParticleColor, ES3Type_bool.Instance); - writer.WriteProperty("sizeAffectsRange", instance.sizeAffectsRange, ES3Type_bool.Instance); - writer.WriteProperty("alphaAffectsIntensity", instance.alphaAffectsIntensity, ES3Type_bool.Instance); - writer.WriteProperty("range", instance.range, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("rangeMultiplier", instance.rangeMultiplier, ES3Type_float.Instance); - writer.WriteProperty("intensity", instance.intensity, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("intensityMultiplier", instance.intensityMultiplier, ES3Type_float.Instance); - writer.WriteProperty("maxLights", instance.maxLights, ES3Type_int.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.LightsModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.LightsModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "ratio": - instance.ratio = reader.Read(ES3Type_float.Instance); - break; - case "useRandomDistribution": - instance.useRandomDistribution = reader.Read(ES3Type_bool.Instance); - break; - case "light": - instance.light = reader.Read(ES3Type_Light.Instance); - break; - case "useParticleColor": - instance.useParticleColor = reader.Read(ES3Type_bool.Instance); - break; - case "sizeAffectsRange": - instance.sizeAffectsRange = reader.Read(ES3Type_bool.Instance); - break; - case "alphaAffectsIntensity": - instance.alphaAffectsIntensity = reader.Read(ES3Type_bool.Instance); - break; - case "range": - instance.range = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "rangeMultiplier": - instance.rangeMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "intensity": - instance.intensity = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "intensityMultiplier": - instance.intensityMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "maxLights": - instance.maxLights = reader.Read(ES3Type_int.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LightsModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LightsModule.cs.meta deleted file mode 100644 index c27d822..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LightsModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ca49590603e164a87a49d3c66013bede -timeCreated: 1519132296 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LimitVelocityOverLifetimeModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LimitVelocityOverLifetimeModule.cs deleted file mode 100644 index a2a122f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LimitVelocityOverLifetimeModule.cs +++ /dev/null @@ -1,94 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "limitX", "limitXMultiplier", "limitY", "limitYMultiplier", "limitZ", "limitZMultiplier", "limit", "limitMultiplier", "dampen", "separateAxes", "space")] - public class ES3Type_LimitVelocityOverLifetimeModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_LimitVelocityOverLifetimeModule() : base(typeof(ParticleSystem.LimitVelocityOverLifetimeModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.LimitVelocityOverLifetimeModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("limitX", instance.limitX, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("limitXMultiplier", instance.limitXMultiplier, ES3Type_float.Instance); - writer.WriteProperty("limitY", instance.limitY, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("limitYMultiplier", instance.limitYMultiplier, ES3Type_float.Instance); - writer.WriteProperty("limitZ", instance.limitZ, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("limitZMultiplier", instance.limitZMultiplier, ES3Type_float.Instance); - writer.WriteProperty("limit", instance.limit, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("limitMultiplier", instance.limitMultiplier, ES3Type_float.Instance); - writer.WriteProperty("dampen", instance.dampen, ES3Type_float.Instance); - writer.WriteProperty("separateAxes", instance.separateAxes, ES3Type_bool.Instance); - writer.WriteProperty("space", instance.space); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.LimitVelocityOverLifetimeModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.LimitVelocityOverLifetimeModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "limitX": - instance.limitX = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "limitXMultiplier": - instance.limitXMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "limitY": - instance.limitY = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "limitYMultiplier": - instance.limitYMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "limitZ": - instance.limitZ = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "limitZMultiplier": - instance.limitZMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "limit": - instance.limit = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "limitMultiplier": - instance.limitMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "dampen": - instance.dampen = reader.Read(ES3Type_float.Instance); - break; - case "separateAxes": - instance.separateAxes = reader.Read(ES3Type_bool.Instance); - break; - case "space": - instance.space = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LimitVelocityOverLifetimeModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LimitVelocityOverLifetimeModule.cs.meta deleted file mode 100644 index 7dbe48e..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_LimitVelocityOverLifetimeModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 1b26d58c373b9474591275b8c3b33514 -timeCreated: 1519132281 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MainModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MainModule.cs deleted file mode 100644 index 3db03c8..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MainModule.cs +++ /dev/null @@ -1,206 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("duration", "loop", "prewarm", "startDelay", "startDelayMultiplier", "startLifetime", "startLifetimeMultiplier", "startSpeed", "startSpeedMultiplier", "startSize3D", "startSize", "startSizeMultiplier", "startSizeX", "startSizeXMultiplier", "startSizeY", "startSizeYMultiplier", "startSizeZ", "startSizeZMultiplier", "startRotation3D", "startRotation", "startRotationMultiplier", "startRotationX", "startRotationXMultiplier", "startRotationY", "startRotationYMultiplier", "startRotationZ", "startRotationZMultiplier", "randomizeRotationDirection", "startColor", "gravityModifier", "gravityModifierMultiplier", "simulationSpace", "customSimulationSpace", "simulationSpeed", "scalingMode", "playOnAwake", "maxParticles")] - public class ES3Type_MainModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_MainModule() : base(typeof(ParticleSystem.MainModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.MainModule)obj; - - writer.WriteProperty("duration", instance.duration, ES3Type_float.Instance); - writer.WriteProperty("loop", instance.loop, ES3Type_bool.Instance); - writer.WriteProperty("prewarm", instance.prewarm, ES3Type_bool.Instance); - writer.WriteProperty("startDelay", instance.startDelay, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("startDelayMultiplier", instance.startDelayMultiplier, ES3Type_float.Instance); - writer.WriteProperty("startLifetime", instance.startLifetime, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("startLifetimeMultiplier", instance.startLifetimeMultiplier, ES3Type_float.Instance); - writer.WriteProperty("startSpeed", instance.startSpeed, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("startSpeedMultiplier", instance.startSpeedMultiplier, ES3Type_float.Instance); - writer.WriteProperty("startSize3D", instance.startSize3D, ES3Type_bool.Instance); - writer.WriteProperty("startSize", instance.startSize, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("startSizeMultiplier", instance.startSizeMultiplier, ES3Type_float.Instance); - writer.WriteProperty("startSizeX", instance.startSizeX, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("startSizeXMultiplier", instance.startSizeXMultiplier, ES3Type_float.Instance); - writer.WriteProperty("startSizeY", instance.startSizeY, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("startSizeYMultiplier", instance.startSizeYMultiplier, ES3Type_float.Instance); - writer.WriteProperty("startSizeZ", instance.startSizeZ, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("startSizeZMultiplier", instance.startSizeZMultiplier, ES3Type_float.Instance); - writer.WriteProperty("startRotation3D", instance.startRotation3D, ES3Type_bool.Instance); - writer.WriteProperty("startRotation", instance.startRotation, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("startRotationMultiplier", instance.startRotationMultiplier, ES3Type_float.Instance); - writer.WriteProperty("startRotationX", instance.startRotationX, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("startRotationXMultiplier", instance.startRotationXMultiplier, ES3Type_float.Instance); - writer.WriteProperty("startRotationY", instance.startRotationY, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("startRotationYMultiplier", instance.startRotationYMultiplier, ES3Type_float.Instance); - writer.WriteProperty("startRotationZ", instance.startRotationZ, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("startRotationZMultiplier", instance.startRotationZMultiplier, ES3Type_float.Instance); - #if UNITY_2018_1_OR_NEWER - writer.WriteProperty("flipRotation", instance.flipRotation, ES3Type_float.Instance); - #else - writer.WriteProperty("randomizeRotationDirection", instance.randomizeRotationDirection, ES3Type_float.Instance); - #endif - writer.WriteProperty("startColor", instance.startColor, ES3Type_MinMaxGradient.Instance); - writer.WriteProperty("gravityModifier", instance.gravityModifier, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("gravityModifierMultiplier", instance.gravityModifierMultiplier, ES3Type_float.Instance); - writer.WriteProperty("simulationSpace", instance.simulationSpace); - writer.WritePropertyByRef("customSimulationSpace", instance.customSimulationSpace); - writer.WriteProperty("simulationSpeed", instance.simulationSpeed, ES3Type_float.Instance); - writer.WriteProperty("scalingMode", instance.scalingMode); - writer.WriteProperty("playOnAwake", instance.playOnAwake, ES3Type_bool.Instance); - writer.WriteProperty("maxParticles", instance.maxParticles, ES3Type_int.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.MainModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.MainModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - case "duration": - instance.duration = reader.Read(ES3Type_float.Instance); - break; - case "loop": - instance.loop = reader.Read(ES3Type_bool.Instance); - break; - case "prewarm": - instance.prewarm = reader.Read(ES3Type_bool.Instance); - break; - case "startDelay": - instance.startDelay = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "startDelayMultiplier": - instance.startDelayMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "startLifetime": - instance.startLifetime = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "startLifetimeMultiplier": - instance.startLifetimeMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "startSpeed": - instance.startSpeed = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "startSpeedMultiplier": - instance.startSpeedMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "startSize3D": - instance.startSize3D = reader.Read(ES3Type_bool.Instance); - break; - case "startSize": - instance.startSize = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "startSizeMultiplier": - instance.startSizeMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "startSizeX": - instance.startSizeX = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "startSizeXMultiplier": - instance.startSizeXMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "startSizeY": - instance.startSizeY = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "startSizeYMultiplier": - instance.startSizeYMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "startSizeZ": - instance.startSizeZ = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "startSizeZMultiplier": - instance.startSizeZMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "startRotation3D": - instance.startRotation3D = reader.Read(ES3Type_bool.Instance); - break; - case "startRotation": - instance.startRotation = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "startRotationMultiplier": - instance.startRotationMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "startRotationX": - instance.startRotationX = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "startRotationXMultiplier": - instance.startRotationXMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "startRotationY": - instance.startRotationY = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "startRotationYMultiplier": - instance.startRotationYMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "startRotationZ": - instance.startRotationZ = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "startRotationZMultiplier": - instance.startRotationZMultiplier = reader.Read(ES3Type_float.Instance); - break; - #if UNITY_2018_1_OR_NEWER - case "flipRotation": - instance.flipRotation = reader.Read(ES3Type_float.Instance); - break; - case "randomizeRotationDirection": - instance.flipRotation = reader.Read(ES3Type_float.Instance); - break; - #else - case "randomizeRotationDirection": - instance.randomizeRotationDirection = reader.Read(ES3Type_float.Instance); - break; - #endif - case "startColor": - instance.startColor = reader.Read(ES3Type_MinMaxGradient.Instance); - break; - case "gravityModifier": - instance.gravityModifier = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "gravityModifierMultiplier": - instance.gravityModifierMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "simulationSpace": - instance.simulationSpace = reader.Read(); - break; - case "customSimulationSpace": - instance.customSimulationSpace = reader.Read(ES3Type_Transform.Instance); - break; - case "simulationSpeed": - instance.simulationSpeed = reader.Read(ES3Type_float.Instance); - break; - case "scalingMode": - instance.scalingMode = reader.Read(); - break; - case "playOnAwake": - instance.playOnAwake = reader.Read(ES3Type_bool.Instance); - break; - case "maxParticles": - instance.maxParticles = reader.Read(ES3Type_int.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MainModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MainModule.cs.meta deleted file mode 100644 index 945d296..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MainModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 55fa2d96d06d64809ad226f1874be169 -timeCreated: 1519132285 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Material.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Material.cs deleted file mode 100644 index 6daa07c..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Material.cs +++ /dev/null @@ -1,1311 +0,0 @@ -using System; -using ES3Internal; -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("shader", "renderQueue", "shaderKeywords", "globalIlluminationFlags", "properties")] - public class ES3Type_Material : ES3UnityObjectType - { - public static ES3Type Instance; - - public ES3Type_Material() : base(typeof(Material)) { Instance = this; } - - protected override void WriteUnityObject(object obj, ES3Writer writer) - { - var instance = (Material)obj; - - // Uncomment if you want "instance" to be removed from the name. - //instance.name = instance.name.Replace(" (Instance)", ""); - - writer.WriteProperty("name", instance.name); - writer.WriteProperty("shader", instance.shader); - writer.WriteProperty("renderQueue", instance.renderQueue, ES3Type_int.Instance); - writer.WriteProperty("shaderKeywords", instance.shaderKeywords); - writer.WriteProperty("globalIlluminationFlags", instance.globalIlluminationFlags); - - var shader = instance.shader; - - if (shader != null) - { -#if UNITY_2019_3_OR_NEWER - for (int i = 0; i < shader.GetPropertyCount(); i++) - { - string name = shader.GetPropertyName(i); - - switch (shader.GetPropertyType(i)) - { - case ShaderPropertyType.Color: - writer.WriteProperty(name, instance.GetColor(name)); - break; - case ShaderPropertyType.Float: - case ShaderPropertyType.Range: - writer.WriteProperty(name, instance.GetFloat(name)); - break; - case ShaderPropertyType.Texture: - var texture = instance.GetTexture(name); - - if (texture != null && texture.GetType() != typeof(Texture2D)) - { - ES3Debug.LogWarning($"The texture '{name}' of Material '{instance.name}' will not be saved as only Textures of type Texture2D can be saved at runtime, whereas '{name}' is of type '{texture.GetType()}'."); - break; - } - writer.WriteProperty(name, texture); - writer.WriteProperty(name + "_TextureOffset", instance.GetTextureOffset(name)); - writer.WriteProperty(name + "_TextureScale", instance.GetTextureScale(name)); - break; - case ShaderPropertyType.Vector: - writer.WriteProperty(name, instance.GetVector(name)); - break; - } - } - -#else - if(instance.HasProperty("_Color")) - writer.WriteProperty("_Color", instance.GetColor("_Color")); - if(instance.HasProperty("_SpecColor")) - writer.WriteProperty("_SpecColor", instance.GetColor("_SpecColor")); - if(instance.HasProperty("_Shininess")) - writer.WriteProperty("_Shininess", instance.GetFloat("_Shininess")); - if(instance.HasProperty("_MainTex")) - { - writer.WriteProperty("_MainTex", instance.GetTexture("_MainTex")); - writer.WriteProperty("_MainTex_Scale", instance.GetTextureScale("_MainTex")); - } - if(instance.HasProperty("_MainTex_TextureOffset")) - writer.WriteProperty("_MainTex_TextureOffset", instance.GetTextureOffset("_MainTex_TextureOffset")); - if(instance.HasProperty("_MainTex_TextureScale")) - writer.WriteProperty("_MainTex_TextureScale", instance.GetTextureScale("_MainTex_TextureScale")); - if(instance.HasProperty("_Illum")) - writer.WriteProperty("_Illum", instance.GetTexture("_Illum")); - if(instance.HasProperty("_Illum_TextureOffset")) - writer.WriteProperty("_Illum_TextureOffset", instance.GetTextureOffset("_Illum_TextureOffset")); - if(instance.HasProperty("_Illum_TextureScale")) - writer.WriteProperty("_Illum_TextureScale", instance.GetTextureScale("_Illum_TextureScale")); - if(instance.HasProperty("_BumpMap")) - writer.WriteProperty("_BumpMap", instance.GetTexture("_BumpMap")); - if(instance.HasProperty("_BumpMap_TextureOffset")) - writer.WriteProperty("_BumpMap_TextureOffset", instance.GetTextureOffset("_BumpMap_TextureOffset")); - if(instance.HasProperty("_BumpMap_TextureScale")) - writer.WriteProperty("_BumpMap_TextureScale", instance.GetTextureScale("_BumpMap_TextureScale")); - if(instance.HasProperty("_Emission")) - writer.WriteProperty("_Emission", instance.GetFloat("_Emission")); - if(instance.HasProperty("_Specular")) - writer.WriteProperty("_Specular", instance.GetColor("_Specular")); - if(instance.HasProperty("_MainBump")) - writer.WriteProperty("_MainBump", instance.GetTexture("_MainBump")); - if(instance.HasProperty("_MainBump_TextureOffset")) - writer.WriteProperty("_MainBump_TextureOffset", instance.GetTextureOffset("_MainBump_TextureOffset")); - if(instance.HasProperty("_MainBump_TextureScale")) - writer.WriteProperty("_MainBump_TextureScale", instance.GetTextureScale("_MainBump_TextureScale")); - if(instance.HasProperty("_Mask")) - writer.WriteProperty("_Mask", instance.GetTexture("_Mask")); - if(instance.HasProperty("_Mask_TextureOffset")) - writer.WriteProperty("_Mask_TextureOffset", instance.GetTextureOffset("_Mask_TextureOffset")); - if(instance.HasProperty("_Mask_TextureScale")) - writer.WriteProperty("_Mask_TextureScale", instance.GetTextureScale("_Mask_TextureScale")); - if(instance.HasProperty("_Focus")) - writer.WriteProperty("_Focus", instance.GetFloat("_Focus")); - if(instance.HasProperty("_StencilComp")) - writer.WriteProperty("_StencilComp", instance.GetFloat("_StencilComp")); - if(instance.HasProperty("_Stencil")) - writer.WriteProperty("_Stencil", instance.GetFloat("_Stencil")); - if(instance.HasProperty("_StencilOp")) - writer.WriteProperty("_StencilOp", instance.GetFloat("_StencilOp")); - if(instance.HasProperty("_StencilWriteMask")) - writer.WriteProperty("_StencilWriteMask", instance.GetFloat("_StencilWriteMask")); - if(instance.HasProperty("_StencilReadMask")) - writer.WriteProperty("_StencilReadMask", instance.GetFloat("_StencilReadMask")); - if(instance.HasProperty("_ColorMask")) - writer.WriteProperty("_ColorMask", instance.GetFloat("_ColorMask")); - if(instance.HasProperty("_UseUIAlphaClip")) - writer.WriteProperty("_UseUIAlphaClip", instance.GetFloat("_UseUIAlphaClip")); - if(instance.HasProperty("_SrcBlend")) - writer.WriteProperty("_SrcBlend", instance.GetFloat("_SrcBlend")); - if(instance.HasProperty("_DstBlend")) - writer.WriteProperty("_DstBlend", instance.GetFloat("_DstBlend")); - if(instance.HasProperty("_ReflectColor")) - writer.WriteProperty("_ReflectColor", instance.GetColor("_ReflectColor")); - if(instance.HasProperty("_Cube")) - writer.WriteProperty("_Cube", instance.GetTexture("_Cube")); - if(instance.HasProperty("_Cube_TextureOffset")) - writer.WriteProperty("_Cube_TextureOffset", instance.GetTextureOffset("_Cube_TextureOffset")); - if(instance.HasProperty("_Cube_TextureScale")) - writer.WriteProperty("_Cube_TextureScale", instance.GetTextureScale("_Cube_TextureScale")); - if(instance.HasProperty("_Tint")) - writer.WriteProperty("_Tint", instance.GetColor("_Tint")); - if(instance.HasProperty("_Exposure")) - writer.WriteProperty("_Exposure", instance.GetFloat("_Exposure")); - if(instance.HasProperty("_Rotation")) - writer.WriteProperty("_Rotation", instance.GetFloat("_Rotation")); - if(instance.HasProperty("_Tex")) - writer.WriteProperty("_Tex", instance.GetTexture("_Tex")); - if(instance.HasProperty("_Tex_TextureOffset")) - writer.WriteProperty("_Tex_TextureOffset", instance.GetTextureOffset("_Tex_TextureOffset")); - if(instance.HasProperty("_Tex_TextureScale")) - writer.WriteProperty("_Tex_TextureScale", instance.GetTextureScale("_Tex_TextureScale")); - if(instance.HasProperty("_Control")) - writer.WriteProperty("_Control", instance.GetTexture("_Control")); - if(instance.HasProperty("_Control_TextureOffset")) - writer.WriteProperty("_Control_TextureOffset", instance.GetTextureOffset("_Control_TextureOffset")); - if(instance.HasProperty("_Control_TextureScale")) - writer.WriteProperty("_Control_TextureScale", instance.GetTextureScale("_Control_TextureScale")); - if(instance.HasProperty("_Splat3")) - writer.WriteProperty("_Splat3", instance.GetTexture("_Splat3")); - if(instance.HasProperty("_Splat3_TextureOffset")) - writer.WriteProperty("_Splat3_TextureOffset", instance.GetTextureOffset("_Splat3_TextureOffset")); - if(instance.HasProperty("_Splat3_TextureScale")) - writer.WriteProperty("_Splat3_TextureScale", instance.GetTextureScale("_Splat3_TextureScale")); - if(instance.HasProperty("_Splat2")) - writer.WriteProperty("_Splat2", instance.GetTexture("_Splat2")); - if(instance.HasProperty("_Splat2_TextureOffset")) - writer.WriteProperty("_Splat2_TextureOffset", instance.GetTextureOffset("_Splat2_TextureOffset")); - if(instance.HasProperty("_Splat2_TextureScale")) - writer.WriteProperty("_Splat2_TextureScale", instance.GetTextureScale("_Splat2_TextureScale")); - if(instance.HasProperty("_Splat1")) - writer.WriteProperty("_Splat1", instance.GetTexture("_Splat1")); - if(instance.HasProperty("_Splat1_TextureOffset")) - writer.WriteProperty("_Splat1_TextureOffset", instance.GetTextureOffset("_Splat1_TextureOffset")); - if(instance.HasProperty("_Splat1_TextureScale")) - writer.WriteProperty("_Splat1_TextureScale", instance.GetTextureScale("_Splat1_TextureScale")); - if(instance.HasProperty("_Splat0")) - writer.WriteProperty("_Splat0", instance.GetTexture("_Splat0")); - if(instance.HasProperty("_Splat0_TextureOffset")) - writer.WriteProperty("_Splat0_TextureOffset", instance.GetTextureOffset("_Splat0_TextureOffset")); - if(instance.HasProperty("_Splat0_TextureScale")) - writer.WriteProperty("_Splat0_TextureScale", instance.GetTextureScale("_Splat0_TextureScale")); - if(instance.HasProperty("_Normal3")) - writer.WriteProperty("_Normal3", instance.GetTexture("_Normal3")); - if(instance.HasProperty("_Normal3_TextureOffset")) - writer.WriteProperty("_Normal3_TextureOffset", instance.GetTextureOffset("_Normal3_TextureOffset")); - if(instance.HasProperty("_Normal3_TextureScale")) - writer.WriteProperty("_Normal3_TextureScale", instance.GetTextureScale("_Normal3_TextureScale")); - if(instance.HasProperty("_Normal2")) - writer.WriteProperty("_Normal2", instance.GetTexture("_Normal2")); - if(instance.HasProperty("_Normal2_TextureOffset")) - writer.WriteProperty("_Normal2_TextureOffset", instance.GetTextureOffset("_Normal2_TextureOffset")); - if(instance.HasProperty("_Normal2_TextureScale")) - writer.WriteProperty("_Normal2_TextureScale", instance.GetTextureScale("_Normal2_TextureScale")); - if(instance.HasProperty("_Normal1")) - writer.WriteProperty("_Normal1", instance.GetTexture("_Normal1")); - if(instance.HasProperty("_Normal1_TextureOffset")) - writer.WriteProperty("_Normal1_TextureOffset", instance.GetTextureOffset("_Normal1_TextureOffset")); - if(instance.HasProperty("_Normal1_TextureScale")) - writer.WriteProperty("_Normal1_TextureScale", instance.GetTextureScale("_Normal1_TextureScale")); - if(instance.HasProperty("_Normal0")) - writer.WriteProperty("_Normal0", instance.GetTexture("_Normal0")); - if(instance.HasProperty("_Normal0_TextureOffset")) - writer.WriteProperty("_Normal0_TextureOffset", instance.GetTextureOffset("_Normal0_TextureOffset")); - if(instance.HasProperty("_Normal0_TextureScale")) - writer.WriteProperty("_Normal0_TextureScale", instance.GetTextureScale("_Normal0_TextureScale")); - if(instance.HasProperty("_Cutoff")) - writer.WriteProperty("_Cutoff", instance.GetFloat("_Cutoff")); - if(instance.HasProperty("_BaseLight")) - writer.WriteProperty("_BaseLight", instance.GetFloat("_BaseLight")); - if(instance.HasProperty("_AO")) - writer.WriteProperty("_AO", instance.GetFloat("_AO")); - if(instance.HasProperty("_Occlusion")) - writer.WriteProperty("_Occlusion", instance.GetFloat("_Occlusion")); - if(instance.HasProperty("_TreeInstanceColor")) - writer.WriteProperty("_TreeInstanceColor", instance.GetVector("_TreeInstanceColor")); - if(instance.HasProperty("_TreeInstanceScale")) - writer.WriteProperty("_TreeInstanceScale", instance.GetVector("_TreeInstanceScale")); - if(instance.HasProperty("_SquashAmount")) - writer.WriteProperty("_SquashAmount", instance.GetFloat("_SquashAmount")); - if(instance.HasProperty("_TranslucencyColor")) - writer.WriteProperty("_TranslucencyColor", instance.GetColor("_TranslucencyColor")); - if(instance.HasProperty("_TranslucencyViewDependency")) - writer.WriteProperty("_TranslucencyViewDependency", instance.GetFloat("_TranslucencyViewDependency")); - if(instance.HasProperty("_ShadowStrength")) - writer.WriteProperty("_ShadowStrength", instance.GetFloat("_ShadowStrength")); - if(instance.HasProperty("_ShadowOffsetScale")) - writer.WriteProperty("_ShadowOffsetScale", instance.GetFloat("_ShadowOffsetScale")); - if(instance.HasProperty("_ShadowTex")) - writer.WriteProperty("_ShadowTex", instance.GetTexture("_ShadowTex")); - if(instance.HasProperty("_ShadowTex_TextureOffset")) - writer.WriteProperty("_ShadowTex_TextureOffset", instance.GetTextureOffset("_ShadowTex_TextureOffset")); - if(instance.HasProperty("_ShadowTex_TextureScale")) - writer.WriteProperty("_ShadowTex_TextureScale", instance.GetTextureScale("_ShadowTex_TextureScale")); - if(instance.HasProperty("_BumpSpecMap")) - writer.WriteProperty("_BumpSpecMap", instance.GetTexture("_BumpSpecMap")); - if(instance.HasProperty("_BumpSpecMap_TextureOffset")) - writer.WriteProperty("_BumpSpecMap_TextureOffset", instance.GetTextureOffset("_BumpSpecMap_TextureOffset")); - if(instance.HasProperty("_BumpSpecMap_TextureScale")) - writer.WriteProperty("_BumpSpecMap_TextureScale", instance.GetTextureScale("_BumpSpecMap_TextureScale")); - if(instance.HasProperty("_TranslucencyMap")) - writer.WriteProperty("_TranslucencyMap", instance.GetTexture("_TranslucencyMap")); - if(instance.HasProperty("_TranslucencyMap_TextureOffset")) - writer.WriteProperty("_TranslucencyMap_TextureOffset", instance.GetTextureOffset("_TranslucencyMap_TextureOffset")); - if(instance.HasProperty("_TranslucencyMap_TextureScale")) - writer.WriteProperty("_TranslucencyMap_TextureScale", instance.GetTextureScale("_TranslucencyMap_TextureScale")); - if(instance.HasProperty("_LightMap")) - writer.WriteProperty("_LightMap", instance.GetTexture("_LightMap")); - if(instance.HasProperty("_LightMap_TextureOffset")) - writer.WriteProperty("_LightMap_TextureOffset", instance.GetTextureOffset("_LightMap_TextureOffset")); - if(instance.HasProperty("_LightMap_TextureScale")) - writer.WriteProperty("_LightMap_TextureScale", instance.GetTextureScale("_LightMap_TextureScale")); - if(instance.HasProperty("_DetailTex")) - writer.WriteProperty("_DetailTex", instance.GetTexture("_DetailTex")); - if(instance.HasProperty("_DetailTex_TextureOffset")) - writer.WriteProperty("_DetailTex_TextureOffset", instance.GetTextureOffset("_DetailTex_TextureOffset")); - if(instance.HasProperty("_DetailTex_TextureScale")) - writer.WriteProperty("_DetailTex_TextureScale", instance.GetTextureScale("_DetailTex_TextureScale")); - if(instance.HasProperty("_DetailBump")) - writer.WriteProperty("_DetailBump", instance.GetTexture("_DetailBump")); - if(instance.HasProperty("_DetailBump_TextureOffset")) - writer.WriteProperty("_DetailBump_TextureOffset", instance.GetTextureOffset("_DetailBump_TextureOffset")); - if(instance.HasProperty("_DetailBump_TextureScale")) - writer.WriteProperty("_DetailBump_TextureScale", instance.GetTextureScale("_DetailBump_TextureScale")); - if(instance.HasProperty("_Strength")) - writer.WriteProperty("_Strength", instance.GetFloat("_Strength")); - if(instance.HasProperty("_InvFade")) - writer.WriteProperty("_InvFade", instance.GetFloat("_InvFade")); - if(instance.HasProperty("_EmisColor")) - writer.WriteProperty("_EmisColor", instance.GetColor("_EmisColor")); - if(instance.HasProperty("_Parallax")) - writer.WriteProperty("_Parallax", instance.GetFloat("_Parallax")); - if(instance.HasProperty("_ParallaxMap")) - writer.WriteProperty("_ParallaxMap", instance.GetTexture("_ParallaxMap")); - if(instance.HasProperty("_ParallaxMap_TextureOffset")) - writer.WriteProperty("_ParallaxMap_TextureOffset", instance.GetTextureOffset("_ParallaxMap_TextureOffset")); - if(instance.HasProperty("_ParallaxMap_TextureScale")) - writer.WriteProperty("_ParallaxMap_TextureScale", instance.GetTextureScale("_ParallaxMap_TextureScale")); - if(instance.HasProperty("_DecalTex")) - writer.WriteProperty("_DecalTex", instance.GetTexture("_DecalTex")); - if(instance.HasProperty("_DecalTex_TextureOffset")) - writer.WriteProperty("_DecalTex_TextureOffset", instance.GetTextureOffset("_DecalTex_TextureOffset")); - if(instance.HasProperty("_DecalTex_TextureScale")) - writer.WriteProperty("_DecalTex_TextureScale", instance.GetTextureScale("_DecalTex_TextureScale")); - if(instance.HasProperty("_GlossMap")) - writer.WriteProperty("_GlossMap", instance.GetTexture("_GlossMap")); - if(instance.HasProperty("_GlossMap_TextureOffset")) - writer.WriteProperty("_GlossMap_TextureOffset", instance.GetTextureOffset("_GlossMap_TextureOffset")); - if(instance.HasProperty("_GlossMap_TextureScale")) - writer.WriteProperty("_GlossMap_TextureScale", instance.GetTextureScale("_GlossMap_TextureScale")); - if(instance.HasProperty("_ShadowOffset")) - writer.WriteProperty("_ShadowOffset", instance.GetTexture("_ShadowOffset")); - if(instance.HasProperty("_ShadowOffset_TextureOffset")) - writer.WriteProperty("_ShadowOffset_TextureOffset", instance.GetTextureOffset("_ShadowOffset_TextureOffset")); - if(instance.HasProperty("_ShadowOffset_TextureScale")) - writer.WriteProperty("_ShadowOffset_TextureScale", instance.GetTextureScale("_ShadowOffset_TextureScale")); - if(instance.HasProperty("_SunDisk")) - writer.WriteProperty("_SunDisk", instance.GetFloat("_SunDisk")); - if(instance.HasProperty("_SunSize")) - writer.WriteProperty("_SunSize", instance.GetFloat("_SunSize")); - if(instance.HasProperty("_AtmosphereThickness")) - writer.WriteProperty("_AtmosphereThickness", instance.GetFloat("_AtmosphereThickness")); - if(instance.HasProperty("_SkyTint")) - writer.WriteProperty("_SkyTint", instance.GetColor("_SkyTint")); - if(instance.HasProperty("_GroundColor")) - writer.WriteProperty("_GroundColor", instance.GetColor("_GroundColor")); - if(instance.HasProperty("_WireThickness")) - writer.WriteProperty("_WireThickness", instance.GetFloat("_WireThickness")); - if(instance.HasProperty("_ZWrite")) - writer.WriteProperty("_ZWrite", instance.GetFloat("_ZWrite")); - if(instance.HasProperty("_ZTest")) - writer.WriteProperty("_ZTest", instance.GetFloat("_ZTest")); - if(instance.HasProperty("_Cull")) - writer.WriteProperty("_Cull", instance.GetFloat("_Cull")); - if(instance.HasProperty("_ZBias")) - writer.WriteProperty("_ZBias", instance.GetFloat("_ZBias")); - if(instance.HasProperty("_HueVariation")) - writer.WriteProperty("_HueVariation", instance.GetColor("_HueVariation")); - if(instance.HasProperty("_WindQuality")) - writer.WriteProperty("_WindQuality", instance.GetFloat("_WindQuality")); - if(instance.HasProperty("_DetailMask")) - writer.WriteProperty("_DetailMask", instance.GetTexture("_DetailMask")); - if(instance.HasProperty("_DetailMask_TextureOffset")) - writer.WriteProperty("_DetailMask_TextureOffset", instance.GetTextureOffset("_DetailMask_TextureOffset")); - if(instance.HasProperty("_DetailMask_TextureScale")) - writer.WriteProperty("_DetailMask_TextureScale", instance.GetTextureScale("_DetailMask_TextureScale")); - if(instance.HasProperty("_MetallicTex")) - writer.WriteProperty("_MetallicTex", instance.GetTexture("_MetallicTex")); - if(instance.HasProperty("_MetallicTex_TextureOffset")) - writer.WriteProperty("_MetallicTex_TextureOffset", instance.GetTextureOffset("_MetallicTex_TextureOffset")); - if(instance.HasProperty("_MetallicTex_TextureScale")) - writer.WriteProperty("_MetallicTex_TextureScale", instance.GetTextureScale("_MetallicTex_TextureScale")); - if(instance.HasProperty("_Glossiness")) - writer.WriteProperty("_Glossiness", instance.GetFloat("_Glossiness")); - if(instance.HasProperty("_GlossMapScale")) - writer.WriteProperty("_GlossMapScale", instance.GetFloat("_GlossMapScale")); - if(instance.HasProperty("_SmoothnessTextureChannel")) - writer.WriteProperty("_SmoothnessTextureChannel", instance.GetFloat("_SmoothnessTextureChannel")); - if(instance.HasProperty("_Metallic")) - writer.WriteProperty("_Metallic", instance.GetFloat("_Metallic")); - if(instance.HasProperty("_MetallicGlossMap")) - writer.WriteProperty("_MetallicGlossMap", instance.GetTexture("_MetallicGlossMap")); - if(instance.HasProperty("_MetallicGlossMap_TextureOffset")) - writer.WriteProperty("_MetallicGlossMap_TextureOffset", instance.GetTextureOffset("_MetallicGlossMap_TextureOffset")); - if(instance.HasProperty("_MetallicGlossMap_TextureScale")) - writer.WriteProperty("_MetallicGlossMap_TextureScale", instance.GetTextureScale("_MetallicGlossMap_TextureScale")); - if(instance.HasProperty("_SpecularHighlights")) - writer.WriteProperty("_SpecularHighlights", instance.GetFloat("_SpecularHighlights")); - if(instance.HasProperty("_GlossyReflections")) - writer.WriteProperty("_GlossyReflections", instance.GetFloat("_GlossyReflections")); - if(instance.HasProperty("_BumpScale")) - writer.WriteProperty("_BumpScale", instance.GetFloat("_BumpScale")); - if(instance.HasProperty("_OcclusionStrength")) - writer.WriteProperty("_OcclusionStrength", instance.GetFloat("_OcclusionStrength")); - if(instance.HasProperty("_OcclusionMap")) - writer.WriteProperty("_OcclusionMap", instance.GetTexture("_OcclusionMap")); - if(instance.HasProperty("_OcclusionMap_TextureOffset")) - writer.WriteProperty("_OcclusionMap_TextureOffset", instance.GetTextureOffset("_OcclusionMap_TextureOffset")); - if(instance.HasProperty("_OcclusionMap_TextureScale")) - writer.WriteProperty("_OcclusionMap_TextureScale", instance.GetTextureScale("_OcclusionMap_TextureScale")); - if(instance.HasProperty("_EmissionColor")) - writer.WriteProperty("_EmissionColor", instance.GetColor("_EmissionColor")); - if(instance.HasProperty("_EmissionMap")) - writer.WriteProperty("_EmissionMap", instance.GetTexture("_EmissionMap")); - if(instance.HasProperty("_EmissionMap_TextureOffset")) - writer.WriteProperty("_EmissionMap_TextureOffset", instance.GetTextureOffset("_EmissionMap_TextureOffset")); - if(instance.HasProperty("_EmissionMap_TextureScale")) - writer.WriteProperty("_EmissionMap_TextureScale", instance.GetTextureScale("_EmissionMap_TextureScale")); - if(instance.HasProperty("_DetailAlbedoMap")) - writer.WriteProperty("_DetailAlbedoMap", instance.GetTexture("_DetailAlbedoMap")); - if(instance.HasProperty("_DetailAlbedoMap_TextureOffset")) - writer.WriteProperty("_DetailAlbedoMap_TextureOffset", instance.GetTextureOffset("_DetailAlbedoMap_TextureOffset")); - if(instance.HasProperty("_DetailAlbedoMap_TextureScale")) - writer.WriteProperty("_DetailAlbedoMap_TextureScale", instance.GetTextureScale("_DetailAlbedoMap_TextureScale")); - if(instance.HasProperty("_DetailNormalMapScale")) - writer.WriteProperty("_DetailNormalMapScale", instance.GetFloat("_DetailNormalMapScale")); - if(instance.HasProperty("_DetailNormalMap")) - writer.WriteProperty("_DetailNormalMap", instance.GetTexture("_DetailNormalMap")); - if(instance.HasProperty("_DetailNormalMap_TextureOffset")) - writer.WriteProperty("_DetailNormalMap_TextureOffset", instance.GetTextureOffset("_DetailNormalMap_TextureOffset")); - if(instance.HasProperty("_DetailNormalMap_TextureScale")) - writer.WriteProperty("_DetailNormalMap_TextureScale", instance.GetTextureScale("_DetailNormalMap_TextureScale")); - if(instance.HasProperty("_UVSec")) - writer.WriteProperty("_UVSec", instance.GetFloat("_UVSec")); - if(instance.HasProperty("_Mode")) - writer.WriteProperty("_Mode", instance.GetFloat("_Mode")); - if(instance.HasProperty("_TintColor")) - writer.WriteProperty("_TintColor", instance.GetColor("_TintColor")); - if(instance.HasProperty("_WavingTint")) - writer.WriteProperty("_WavingTint", instance.GetColor("_WavingTint")); - if(instance.HasProperty("_WaveAndDistance")) - writer.WriteProperty("_WaveAndDistance", instance.GetVector("_WaveAndDistance")); - if(instance.HasProperty("_LightTexture0")) - writer.WriteProperty("_LightTexture0", instance.GetTexture("_LightTexture0")); - if(instance.HasProperty("_LightTexture0_TextureOffset")) - writer.WriteProperty("_LightTexture0_TextureOffset", instance.GetTextureOffset("_LightTexture0_TextureOffset")); - if(instance.HasProperty("_LightTexture0_TextureScale")) - writer.WriteProperty("_LightTexture0_TextureScale", instance.GetTextureScale("_LightTexture0_TextureScale")); - if(instance.HasProperty("_LightTextureB0")) - writer.WriteProperty("_LightTextureB0", instance.GetTexture("_LightTextureB0")); - if(instance.HasProperty("_LightTextureB0_TextureOffset")) - writer.WriteProperty("_LightTextureB0_TextureOffset", instance.GetTextureOffset("_LightTextureB0_TextureOffset")); - if(instance.HasProperty("_LightTextureB0_TextureScale")) - writer.WriteProperty("_LightTextureB0_TextureScale", instance.GetTextureScale("_LightTextureB0_TextureScale")); - if(instance.HasProperty("_ShadowMapTexture")) - writer.WriteProperty("_ShadowMapTexture", instance.GetTexture("_ShadowMapTexture")); - if(instance.HasProperty("_ShadowMapTexture_TextureOffset")) - writer.WriteProperty("_ShadowMapTexture_TextureOffset", instance.GetTextureOffset("_ShadowMapTexture_TextureOffset")); - if(instance.HasProperty("_ShadowMapTexture_TextureScale")) - writer.WriteProperty("_ShadowMapTexture_TextureScale", instance.GetTextureScale("_ShadowMapTexture_TextureScale")); - if(instance.HasProperty("_SecondTex")) - writer.WriteProperty("_SecondTex", instance.GetTexture("_SecondTex")); - if(instance.HasProperty("_SecondTex_TextureOffset")) - writer.WriteProperty("_SecondTex_TextureOffset", instance.GetTextureOffset("_SecondTex_TextureOffset")); - if(instance.HasProperty("_SecondTex_TextureScale")) - writer.WriteProperty("_SecondTex_TextureScale", instance.GetTextureScale("_SecondTex_TextureScale")); - if(instance.HasProperty("_ThirdTex")) - writer.WriteProperty("_ThirdTex", instance.GetTexture("_ThirdTex")); - if(instance.HasProperty("_ThirdTex_TextureOffset")) - writer.WriteProperty("_ThirdTex_TextureOffset", instance.GetTextureOffset("_ThirdTex_TextureOffset")); - if(instance.HasProperty("_ThirdTex_TextureScale")) - writer.WriteProperty("_ThirdTex_TextureScale", instance.GetTextureScale("_ThirdTex_TextureScale")); - if(instance.HasProperty("PixelSnap")) - writer.WriteProperty("PixelSnap", instance.GetFloat("PixelSnap")); - if(instance.HasProperty("_RendererColor")) - writer.WriteProperty("_RendererColor", instance.GetColor("_RendererColor")); - if(instance.HasProperty("_Flip")) - writer.WriteProperty("_Flip", instance.GetVector("_Flip")); - if(instance.HasProperty("_AlphaTex")) - writer.WriteProperty("_AlphaTex", instance.GetTexture("_AlphaTex")); - if(instance.HasProperty("_AlphaTex_TextureOffset")) - writer.WriteProperty("_AlphaTex_TextureOffset", instance.GetTextureOffset("_AlphaTex_TextureOffset")); - if(instance.HasProperty("_AlphaTex_TextureScale")) - writer.WriteProperty("_AlphaTex_TextureScale", instance.GetTextureScale("_AlphaTex_TextureScale")); - if(instance.HasProperty("_EnableExternalAlpha")) - writer.WriteProperty("_EnableExternalAlpha", instance.GetFloat("_EnableExternalAlpha")); - if(instance.HasProperty("_Level")) - writer.WriteProperty("_Level", instance.GetFloat("_Level")); - if(instance.HasProperty("_SpecGlossMap")) - writer.WriteProperty("_SpecGlossMap", instance.GetTexture("_SpecGlossMap")); - if(instance.HasProperty("_SpecGlossMap_TextureOffset")) - writer.WriteProperty("_SpecGlossMap_TextureOffset", instance.GetTextureOffset("_SpecGlossMap_TextureOffset")); - if(instance.HasProperty("_SpecGlossMap_TextureScale")) - writer.WriteProperty("_SpecGlossMap_TextureScale", instance.GetTextureScale("_SpecGlossMap_TextureScale")); - if(instance.HasProperty("_FrontTex")) - writer.WriteProperty("_FrontTex", instance.GetTexture("_FrontTex")); - if(instance.HasProperty("_FrontTex_TextureOffset")) - writer.WriteProperty("_FrontTex_TextureOffset", instance.GetTextureOffset("_FrontTex_TextureOffset")); - if(instance.HasProperty("_FrontTex_TextureScale")) - writer.WriteProperty("_FrontTex_TextureScale", instance.GetTextureScale("_FrontTex_TextureScale")); - if(instance.HasProperty("_BackTex")) - writer.WriteProperty("_BackTex", instance.GetTexture("_BackTex")); - if(instance.HasProperty("_BackTex_TextureOffset")) - writer.WriteProperty("_BackTex_TextureOffset", instance.GetTextureOffset("_BackTex_TextureOffset")); - if(instance.HasProperty("_BackTex_TextureScale")) - writer.WriteProperty("_BackTex_TextureScale", instance.GetTextureScale("_BackTex_TextureScale")); - if(instance.HasProperty("_LeftTex")) - writer.WriteProperty("_LeftTex", instance.GetTexture("_LeftTex")); - if(instance.HasProperty("_LeftTex_TextureOffset")) - writer.WriteProperty("_LeftTex_TextureOffset", instance.GetTextureOffset("_LeftTex_TextureOffset")); - if(instance.HasProperty("_LeftTex_TextureScale")) - writer.WriteProperty("_LeftTex_TextureScale", instance.GetTextureScale("_LeftTex_TextureScale")); - if(instance.HasProperty("_RightTex")) - writer.WriteProperty("_RightTex", instance.GetTexture("_RightTex")); - if(instance.HasProperty("_RightTex_TextureOffset")) - writer.WriteProperty("_RightTex_TextureOffset", instance.GetTextureOffset("_RightTex_TextureOffset")); - if(instance.HasProperty("_RightTex_TextureScale")) - writer.WriteProperty("_RightTex_TextureScale", instance.GetTextureScale("_RightTex_TextureScale")); - if(instance.HasProperty("_UpTex")) - writer.WriteProperty("_UpTex", instance.GetTexture("_UpTex")); - if(instance.HasProperty("_UpTex_TextureOffset")) - writer.WriteProperty("_UpTex_TextureOffset", instance.GetTextureOffset("_UpTex_TextureOffset")); - if(instance.HasProperty("_UpTex_TextureScale")) - writer.WriteProperty("_UpTex_TextureScale", instance.GetTextureScale("_UpTex_TextureScale")); - if(instance.HasProperty("_DownTex")) - writer.WriteProperty("_DownTex", instance.GetTexture("_DownTex")); - if(instance.HasProperty("_DownTex_TextureOffset")) - writer.WriteProperty("_DownTex_TextureOffset", instance.GetTextureOffset("_DownTex_TextureOffset")); - if(instance.HasProperty("_DownTex_TextureScale")) - writer.WriteProperty("_DownTex_TextureScale", instance.GetTextureScale("_DownTex_TextureScale")); - if(instance.HasProperty("_Metallic0")) - writer.WriteProperty("_Metallic0", instance.GetFloat("_Metallic0")); - if(instance.HasProperty("_Metallic1")) - writer.WriteProperty("_Metallic1", instance.GetFloat("_Metallic1")); - if(instance.HasProperty("_Metallic2")) - writer.WriteProperty("_Metallic2", instance.GetFloat("_Metallic2")); - if(instance.HasProperty("_Metallic3")) - writer.WriteProperty("_Metallic3", instance.GetFloat("_Metallic3")); - if(instance.HasProperty("_Smoothness0")) - writer.WriteProperty("_Smoothness0", instance.GetFloat("_Smoothness0")); - if(instance.HasProperty("_Smoothness1")) - writer.WriteProperty("_Smoothness1", instance.GetFloat("_Smoothness1")); - if(instance.HasProperty("_Smoothness2")) - writer.WriteProperty("_Smoothness2", instance.GetFloat("_Smoothness2")); - if(instance.HasProperty("_Smoothness3")) - writer.WriteProperty("_Smoothness3", instance.GetFloat("_Smoothness3")); - if(instance.HasProperty("_TexA")) - writer.WriteProperty("_TexA", instance.GetTexture("_TexA")); - if(instance.HasProperty("_TexA_TextureOffset")) - writer.WriteProperty("_TexA_TextureOffset", instance.GetTextureOffset("_TexA_TextureOffset")); - if(instance.HasProperty("_TexA_TextureScale")) - writer.WriteProperty("_TexA_TextureScale", instance.GetTextureScale("_TexA_TextureScale")); - if(instance.HasProperty("_TexB")) - writer.WriteProperty("_TexB", instance.GetTexture("_TexB")); - if(instance.HasProperty("_TexB_TextureOffset")) - writer.WriteProperty("_TexB_TextureOffset", instance.GetTextureOffset("_TexB_TextureOffset")); - if(instance.HasProperty("_TexB_TextureScale")) - writer.WriteProperty("_TexB_TextureScale", instance.GetTextureScale("_TexB_TextureScale")); - if(instance.HasProperty("_value")) - writer.WriteProperty("_value", instance.GetFloat("_value")); - if(instance.HasProperty("_Texel")) - writer.WriteProperty("_Texel", instance.GetFloat("_Texel")); - if(instance.HasProperty("_Detail")) - writer.WriteProperty("_Detail", instance.GetTexture("_Detail")); - if(instance.HasProperty("_Detail_TextureOffset")) - writer.WriteProperty("_Detail_TextureOffset", instance.GetTextureOffset("_Detail_TextureOffset")); - if(instance.HasProperty("_Detail_TextureScale")) - writer.WriteProperty("_Detail_TextureScale", instance.GetTextureScale("_Detail_TextureScale")); - if(instance.HasProperty("_HalfOverCutoff")) - writer.WriteProperty("_HalfOverCutoff", instance.GetFloat("_HalfOverCutoff")); - #endif - } - } - - protected override object ReadUnityObject(ES3Reader reader) - { - var obj = new Material(Shader.Find("Diffuse")); - ReadUnityObject(reader, obj); - return obj; - } - - protected override void ReadUnityObject(ES3Reader reader, object obj) - { - var instance = (Material)obj; - -#if UNITY_2019_3_OR_NEWER - - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case "name": - instance.name = reader.Read(ES3Type_string.Instance); - break; - case "shader": - instance.shader = reader.Read(ES3Type_Shader.Instance); - break; - case "renderQueue": - instance.renderQueue = reader.Read(ES3Type_int.Instance); - break; - case "shaderKeywords": - string[] keywords = reader.Read(); - foreach (string keyword in keywords) - instance.EnableKeyword(keyword); - break; - case "globalIlluminationFlags": - instance.globalIlluminationFlags = reader.Read(); - break; - case "_MainTex_Scale": - instance.SetTextureScale("_MainTex", reader.Read()); - break; - default: - int propertyIndex = -1; - if (instance.shader != null && instance.HasProperty(propertyName) && (propertyIndex = instance.shader.FindPropertyIndex(propertyName)) != -1) - { - var propertyType = instance.shader.GetPropertyType(propertyIndex); - - switch (propertyType) - { - case ShaderPropertyType.Color: - instance.SetColor(propertyName, reader.Read()); - break; - case ShaderPropertyType.Float: - case ShaderPropertyType.Range: - instance.SetFloat(propertyName, reader.Read()); - break; - case ShaderPropertyType.Texture: - instance.SetTexture(propertyName, reader.Read()); - break; - case ShaderPropertyType.Vector: - instance.SetColor(propertyName, reader.Read()); - break; - } - } - else if (propertyName.EndsWith("_TextureScale")) - instance.SetTextureScale(propertyName.Split(new[] - { - "_TextureScale" - }, StringSplitOptions.None)[0], reader.Read()); - else if (propertyName.EndsWith("_TextureOffset")) - instance.SetTextureOffset(propertyName.Split(new[] - { - "_TextureOffset" - }, StringSplitOptions.None)[0], reader.Read()); - - reader.Skip(); - break; - } - } -#else - foreach (string propertyName in reader.Properties) - { - switch(propertyName) - { - case "name": - instance.name = reader.Read(ES3Type_string.Instance); - break; - case "shader": - instance.shader = reader.Read(ES3Type_Shader.Instance); - break; - case "renderQueue": - instance.renderQueue = reader.Read(ES3Type_int.Instance); - break; - case "shaderKeywords": - instance.shaderKeywords = reader.Read(); - break; - case "globalIlluminationFlags": - instance.globalIlluminationFlags = reader.Read(); - break; - case "_Color": - instance.SetColor("_Color", reader.Read()); - break; - case "_SpecColor": - instance.SetColor("_SpecColor", reader.Read()); - break; - case "_Shininess": - instance.SetFloat("_Shininess", reader.Read()); - break; - case "_MainTex": - instance.SetTexture("_MainTex", reader.Read()); - break; - case "_MainTex_TextureOffset": - instance.SetTextureOffset("_MainTex_TextureOffset", reader.Read()); - break; - case "_MainTex_TextureScale": - instance.SetTextureScale("_MainTex_TextureScale", reader.Read()); - break; - case "_Illum": - instance.SetTexture("_Illum", reader.Read()); - break; - case "_Illum_TextureOffset": - instance.SetTextureOffset("_Illum_TextureOffset", reader.Read()); - break; - case "_Illum_TextureScale": - instance.SetTextureScale("_Illum_TextureScale", reader.Read()); - break; - case "_BumpMap": - instance.SetTexture("_BumpMap", reader.Read()); - break; - case "_BumpMap_TextureOffset": - instance.SetTextureOffset("_BumpMap_TextureOffset", reader.Read()); - break; - case "_BumpMap_TextureScale": - instance.SetTextureScale("_BumpMap_TextureScale", reader.Read()); - break; - case "_Emission": - instance.SetFloat("_Emission", reader.Read()); - break; - case "_Specular": - instance.SetColor("_Specular", reader.Read()); - break; - case "_MainBump": - instance.SetTexture("_MainBump", reader.Read()); - break; - case "_MainBump_TextureOffset": - instance.SetTextureOffset("_MainBump_TextureOffset", reader.Read()); - break; - case "_MainBump_TextureScale": - instance.SetTextureScale("_MainBump_TextureScale", reader.Read()); - break; - case "_Mask": - instance.SetTexture("_Mask", reader.Read()); - break; - case "_Mask_TextureOffset": - instance.SetTextureOffset("_Mask_TextureOffset", reader.Read()); - break; - case "_Mask_TextureScale": - instance.SetTextureScale("_Mask_TextureScale", reader.Read()); - break; - case "_Focus": - instance.SetFloat("_Focus", reader.Read()); - break; - case "_StencilComp": - instance.SetFloat("_StencilComp", reader.Read()); - break; - case "_Stencil": - instance.SetFloat("_Stencil", reader.Read()); - break; - case "_StencilOp": - instance.SetFloat("_StencilOp", reader.Read()); - break; - case "_StencilWriteMask": - instance.SetFloat("_StencilWriteMask", reader.Read()); - break; - case "_StencilReadMask": - instance.SetFloat("_StencilReadMask", reader.Read()); - break; - case "_ColorMask": - instance.SetFloat("_ColorMask", reader.Read()); - break; - case "_UseUIAlphaClip": - instance.SetFloat("_UseUIAlphaClip", reader.Read()); - break; - case "_SrcBlend": - instance.SetFloat("_SrcBlend", reader.Read()); - break; - case "_DstBlend": - instance.SetFloat("_DstBlend", reader.Read()); - break; - case "_ReflectColor": - instance.SetColor("_ReflectColor", reader.Read()); - break; - case "_Cube": - instance.SetTexture("_Cube", reader.Read()); - break; - case "_Cube_TextureOffset": - instance.SetTextureOffset("_Cube_TextureOffset", reader.Read()); - break; - case "_Cube_TextureScale": - instance.SetTextureScale("_Cube_TextureScale", reader.Read()); - break; - case "_Tint": - instance.SetColor("_Tint", reader.Read()); - break; - case "_Exposure": - instance.SetFloat("_Exposure", reader.Read()); - break; - case "_Rotation": - instance.SetFloat("_Rotation", reader.Read()); - break; - case "_Tex": - instance.SetTexture("_Tex", reader.Read()); - break; - case "_Tex_TextureOffset": - instance.SetTextureOffset("_Tex_TextureOffset", reader.Read()); - break; - case "_Tex_TextureScale": - instance.SetTextureScale("_Tex_TextureScale", reader.Read()); - break; - case "_MainTex_Scale": - instance.SetTextureScale("_MainTex", reader.Read()); - break; - case "_Control": - instance.SetTexture("_Control", reader.Read()); - break; - case "_Control_TextureOffset": - instance.SetTextureOffset("_Control_TextureOffset", reader.Read()); - break; - case "_Control_TextureScale": - instance.SetTextureScale("_Control_TextureScale", reader.Read()); - break; - case "_Splat3": - instance.SetTexture("_Splat3", reader.Read()); - break; - case "_Splat3_TextureOffset": - instance.SetTextureOffset("_Splat3_TextureOffset", reader.Read()); - break; - case "_Splat3_TextureScale": - instance.SetTextureScale("_Splat3_TextureScale", reader.Read()); - break; - case "_Splat2": - instance.SetTexture("_Splat2", reader.Read()); - break; - case "_Splat2_TextureOffset": - instance.SetTextureOffset("_Splat2_TextureOffset", reader.Read()); - break; - case "_Splat2_TextureScale": - instance.SetTextureScale("_Splat2_TextureScale", reader.Read()); - break; - case "_Splat1": - instance.SetTexture("_Splat1", reader.Read()); - break; - case "_Splat1_TextureOffset": - instance.SetTextureOffset("_Splat1_TextureOffset", reader.Read()); - break; - case "_Splat1_TextureScale": - instance.SetTextureScale("_Splat1_TextureScale", reader.Read()); - break; - case "_Splat0": - instance.SetTexture("_Splat0", reader.Read()); - break; - case "_Splat0_TextureOffset": - instance.SetTextureOffset("_Splat0_TextureOffset", reader.Read()); - break; - case "_Splat0_TextureScale": - instance.SetTextureScale("_Splat0_TextureScale", reader.Read()); - break; - case "_Normal3": - instance.SetTexture("_Normal3", reader.Read()); - break; - case "_Normal3_TextureOffset": - instance.SetTextureOffset("_Normal3_TextureOffset", reader.Read()); - break; - case "_Normal3_TextureScale": - instance.SetTextureScale("_Normal3_TextureScale", reader.Read()); - break; - case "_Normal2": - instance.SetTexture("_Normal2", reader.Read()); - break; - case "_Normal2_TextureOffset": - instance.SetTextureOffset("_Normal2_TextureOffset", reader.Read()); - break; - case "_Normal2_TextureScale": - instance.SetTextureScale("_Normal2_TextureScale", reader.Read()); - break; - case "_Normal1": - instance.SetTexture("_Normal1", reader.Read()); - break; - case "_Normal1_TextureOffset": - instance.SetTextureOffset("_Normal1_TextureOffset", reader.Read()); - break; - case "_Normal1_TextureScale": - instance.SetTextureScale("_Normal1_TextureScale", reader.Read()); - break; - case "_Normal0": - instance.SetTexture("_Normal0", reader.Read()); - break; - case "_Normal0_TextureOffset": - instance.SetTextureOffset("_Normal0_TextureOffset", reader.Read()); - break; - case "_Normal0_TextureScale": - instance.SetTextureScale("_Normal0_TextureScale", reader.Read()); - break; - case "_Cutoff": - instance.SetFloat("_Cutoff", reader.Read()); - break; - case "_BaseLight": - instance.SetFloat("_BaseLight", reader.Read()); - break; - case "_AO": - instance.SetFloat("_AO", reader.Read()); - break; - case "_Occlusion": - instance.SetFloat("_Occlusion", reader.Read()); - break; - case "_TreeInstanceColor": - instance.SetVector("_TreeInstanceColor", reader.Read()); - break; - case "_TreeInstanceScale": - instance.SetVector("_TreeInstanceScale", reader.Read()); - break; - case "_SquashAmount": - instance.SetFloat("_SquashAmount", reader.Read()); - break; - case "_TranslucencyColor": - instance.SetColor("_TranslucencyColor", reader.Read()); - break; - case "_TranslucencyViewDependency": - instance.SetFloat("_TranslucencyViewDependency", reader.Read()); - break; - case "_ShadowStrength": - instance.SetFloat("_ShadowStrength", reader.Read()); - break; - case "_ShadowOffsetScale": - instance.SetFloat("_ShadowOffsetScale", reader.Read()); - break; - case "_ShadowTex": - instance.SetTexture("_ShadowTex", reader.Read()); - break; - case "_ShadowTex_TextureOffset": - instance.SetTextureOffset("_ShadowTex_TextureOffset", reader.Read()); - break; - case "_ShadowTex_TextureScale": - instance.SetTextureScale("_ShadowTex_TextureScale", reader.Read()); - break; - case "_BumpSpecMap": - instance.SetTexture("_BumpSpecMap", reader.Read()); - break; - case "_BumpSpecMap_TextureOffset": - instance.SetTextureOffset("_BumpSpecMap_TextureOffset", reader.Read()); - break; - case "_BumpSpecMap_TextureScale": - instance.SetTextureScale("_BumpSpecMap_TextureScale", reader.Read()); - break; - case "_TranslucencyMap": - instance.SetTexture("_TranslucencyMap", reader.Read()); - break; - case "_TranslucencyMap_TextureOffset": - instance.SetTextureOffset("_TranslucencyMap_TextureOffset", reader.Read()); - break; - case "_TranslucencyMap_TextureScale": - instance.SetTextureScale("_TranslucencyMap_TextureScale", reader.Read()); - break; - case "_LightMap": - instance.SetTexture("_LightMap", reader.Read()); - break; - case "_LightMap_TextureOffset": - instance.SetTextureOffset("_LightMap_TextureOffset", reader.Read()); - break; - case "_LightMap_TextureScale": - instance.SetTextureScale("_LightMap_TextureScale", reader.Read()); - break; - case "_DetailTex": - instance.SetTexture("_DetailTex", reader.Read()); - break; - case "_DetailTex_TextureOffset": - instance.SetTextureOffset("_DetailTex_TextureOffset", reader.Read()); - break; - case "_DetailTex_TextureScale": - instance.SetTextureScale("_DetailTex_TextureScale", reader.Read()); - break; - case "_DetailBump": - instance.SetTexture("_DetailBump", reader.Read()); - break; - case "_DetailBump_TextureOffset": - instance.SetTextureOffset("_DetailBump_TextureOffset", reader.Read()); - break; - case "_DetailBump_TextureScale": - instance.SetTextureScale("_DetailBump_TextureScale", reader.Read()); - break; - case "_Strength": - instance.SetFloat("_Strength", reader.Read()); - break; - case "_InvFade": - instance.SetFloat("_InvFade", reader.Read()); - break; - case "_EmisColor": - instance.SetColor("_EmisColor", reader.Read()); - break; - case "_Parallax": - instance.SetFloat("_Parallax", reader.Read()); - break; - case "_ParallaxMap": - instance.SetTexture("_ParallaxMap", reader.Read()); - break; - case "_ParallaxMap_TextureOffset": - instance.SetTextureOffset("_ParallaxMap_TextureOffset", reader.Read()); - break; - case "_ParallaxMap_TextureScale": - instance.SetTextureScale("_ParallaxMap_TextureScale", reader.Read()); - break; - case "_DecalTex": - instance.SetTexture("_DecalTex", reader.Read()); - break; - case "_DecalTex_TextureOffset": - instance.SetTextureOffset("_DecalTex_TextureOffset", reader.Read()); - break; - case "_DecalTex_TextureScale": - instance.SetTextureScale("_DecalTex_TextureScale", reader.Read()); - break; - case "_GlossMap": - instance.SetTexture("_GlossMap", reader.Read()); - break; - case "_GlossMap_TextureOffset": - instance.SetTextureOffset("_GlossMap_TextureOffset", reader.Read()); - break; - case "_GlossMap_TextureScale": - instance.SetTextureScale("_GlossMap_TextureScale", reader.Read()); - break; - case "_ShadowOffset": - instance.SetTexture("_ShadowOffset", reader.Read()); - break; - case "_ShadowOffset_TextureOffset": - instance.SetTextureOffset("_ShadowOffset_TextureOffset", reader.Read()); - break; - case "_ShadowOffset_TextureScale": - instance.SetTextureScale("_ShadowOffset_TextureScale", reader.Read()); - break; - case "_SunDisk": - instance.SetFloat("_SunDisk", reader.Read()); - break; - case "_SunSize": - instance.SetFloat("_SunSize", reader.Read()); - break; - case "_AtmosphereThickness": - instance.SetFloat("_AtmosphereThickness", reader.Read()); - break; - case "_SkyTint": - instance.SetColor("_SkyTint", reader.Read()); - break; - case "_GroundColor": - instance.SetColor("_GroundColor", reader.Read()); - break; - case "_WireThickness": - instance.SetFloat("_WireThickness", reader.Read()); - break; - case "_ZWrite": - instance.SetFloat("_ZWrite", reader.Read()); - break; - case "_ZTest": - instance.SetFloat("_ZTest", reader.Read()); - break; - case "_Cull": - instance.SetFloat("_Cull", reader.Read()); - break; - case "_ZBias": - instance.SetFloat("_ZBias", reader.Read()); - break; - case "_HueVariation": - instance.SetColor("_HueVariation", reader.Read()); - break; - case "_WindQuality": - instance.SetFloat("_WindQuality", reader.Read()); - break; - case "_DetailMask": - instance.SetTexture("_DetailMask", reader.Read()); - break; - case "_DetailMask_TextureOffset": - instance.SetTextureOffset("_DetailMask_TextureOffset", reader.Read()); - break; - case "_DetailMask_TextureScale": - instance.SetTextureScale("_DetailMask_TextureScale", reader.Read()); - break; - case "_MetallicTex": - instance.SetTexture("_MetallicTex", reader.Read()); - break; - case "_MetallicTex_TextureOffset": - instance.SetTextureOffset("_MetallicTex_TextureOffset", reader.Read()); - break; - case "_MetallicTex_TextureScale": - instance.SetTextureScale("_MetallicTex_TextureScale", reader.Read()); - break; - case "_Glossiness": - instance.SetFloat("_Glossiness", reader.Read()); - break; - case "_GlossMapScale": - instance.SetFloat("_GlossMapScale", reader.Read()); - break; - case "_SmoothnessTextureChannel": - instance.SetFloat("_SmoothnessTextureChannel", reader.Read()); - break; - case "_Metallic": - instance.SetFloat("_Metallic", reader.Read()); - break; - case "_MetallicGlossMap": - instance.SetTexture("_MetallicGlossMap", reader.Read()); - break; - case "_MetallicGlossMap_TextureOffset": - instance.SetTextureOffset("_MetallicGlossMap_TextureOffset", reader.Read()); - break; - case "_MetallicGlossMap_TextureScale": - instance.SetTextureScale("_MetallicGlossMap_TextureScale", reader.Read()); - break; - case "_SpecularHighlights": - instance.SetFloat("_SpecularHighlights", reader.Read()); - break; - case "_GlossyReflections": - instance.SetFloat("_GlossyReflections", reader.Read()); - break; - case "_BumpScale": - instance.SetFloat("_BumpScale", reader.Read()); - break; - case "_OcclusionStrength": - instance.SetFloat("_OcclusionStrength", reader.Read()); - break; - case "_OcclusionMap": - instance.SetTexture("_OcclusionMap", reader.Read()); - break; - case "_OcclusionMap_TextureOffset": - instance.SetTextureOffset("_OcclusionMap_TextureOffset", reader.Read()); - break; - case "_OcclusionMap_TextureScale": - instance.SetTextureScale("_OcclusionMap_TextureScale", reader.Read()); - break; - case "_EmissionColor": - instance.SetColor("_EmissionColor", reader.Read()); - break; - case "_EmissionMap": - instance.SetTexture("_EmissionMap", reader.Read()); - break; - case "_EmissionMap_TextureOffset": - instance.SetTextureOffset("_EmissionMap_TextureOffset", reader.Read()); - break; - case "_EmissionMap_TextureScale": - instance.SetTextureScale("_EmissionMap_TextureScale", reader.Read()); - break; - case "_DetailAlbedoMap": - instance.SetTexture("_DetailAlbedoMap", reader.Read()); - break; - case "_DetailAlbedoMap_TextureOffset": - instance.SetTextureOffset("_DetailAlbedoMap_TextureOffset", reader.Read()); - break; - case "_DetailAlbedoMap_TextureScale": - instance.SetTextureScale("_DetailAlbedoMap_TextureScale", reader.Read()); - break; - case "_DetailNormalMapScale": - instance.SetFloat("_DetailNormalMapScale", reader.Read()); - break; - case "_DetailNormalMap": - instance.SetTexture("_DetailNormalMap", reader.Read()); - break; - case "_DetailNormalMap_TextureOffset": - instance.SetTextureOffset("_DetailNormalMap_TextureOffset", reader.Read()); - break; - case "_DetailNormalMap_TextureScale": - instance.SetTextureScale("_DetailNormalMap_TextureScale", reader.Read()); - break; - case "_UVSec": - instance.SetFloat("_UVSec", reader.Read()); - break; - case "_Mode": - instance.SetFloat("_Mode", reader.Read()); - break; - case "_TintColor": - instance.SetColor("_TintColor", reader.Read()); - break; - case "_WavingTint": - instance.SetColor("_WavingTint", reader.Read()); - break; - case "_WaveAndDistance": - instance.SetVector("_WaveAndDistance", reader.Read()); - break; - case "_LightTexture0": - instance.SetTexture("_LightTexture0", reader.Read()); - break; - case "_LightTexture0_TextureOffset": - instance.SetTextureOffset("_LightTexture0_TextureOffset", reader.Read()); - break; - case "_LightTexture0_TextureScale": - instance.SetTextureScale("_LightTexture0_TextureScale", reader.Read()); - break; - case "_LightTextureB0": - instance.SetTexture("_LightTextureB0", reader.Read()); - break; - case "_LightTextureB0_TextureOffset": - instance.SetTextureOffset("_LightTextureB0_TextureOffset", reader.Read()); - break; - case "_LightTextureB0_TextureScale": - instance.SetTextureScale("_LightTextureB0_TextureScale", reader.Read()); - break; - case "_ShadowMapTexture": - instance.SetTexture("_ShadowMapTexture", reader.Read()); - break; - case "_ShadowMapTexture_TextureOffset": - instance.SetTextureOffset("_ShadowMapTexture_TextureOffset", reader.Read()); - break; - case "_ShadowMapTexture_TextureScale": - instance.SetTextureScale("_ShadowMapTexture_TextureScale", reader.Read()); - break; - case "_SecondTex": - instance.SetTexture("_SecondTex", reader.Read()); - break; - case "_SecondTex_TextureOffset": - instance.SetTextureOffset("_SecondTex_TextureOffset", reader.Read()); - break; - case "_SecondTex_TextureScale": - instance.SetTextureScale("_SecondTex_TextureScale", reader.Read()); - break; - case "_ThirdTex": - instance.SetTexture("_ThirdTex", reader.Read()); - break; - case "_ThirdTex_TextureOffset": - instance.SetTextureOffset("_ThirdTex_TextureOffset", reader.Read()); - break; - case "_ThirdTex_TextureScale": - instance.SetTextureScale("_ThirdTex_TextureScale", reader.Read()); - break; - case "PixelSnap": - instance.SetFloat("PixelSnap", reader.Read()); - break; - case "_RendererColor": - instance.SetColor("_RendererColor", reader.Read()); - break; - case "_Flip": - instance.SetVector("_Flip", reader.Read()); - break; - case "_AlphaTex": - instance.SetTexture("_AlphaTex", reader.Read()); - break; - case "_AlphaTex_TextureOffset": - instance.SetTextureOffset("_AlphaTex_TextureOffset", reader.Read()); - break; - case "_AlphaTex_TextureScale": - instance.SetTextureScale("_AlphaTex_TextureScale", reader.Read()); - break; - case "_EnableExternalAlpha": - instance.SetFloat("_EnableExternalAlpha", reader.Read()); - break; - case "_Level": - instance.SetFloat("_Level", reader.Read()); - break; - case "_SpecGlossMap": - instance.SetTexture("_SpecGlossMap", reader.Read()); - break; - case "_SpecGlossMap_TextureOffset": - instance.SetTextureOffset("_SpecGlossMap_TextureOffset", reader.Read()); - break; - case "_SpecGlossMap_TextureScale": - instance.SetTextureScale("_SpecGlossMap_TextureScale", reader.Read()); - break; - case "_FrontTex": - instance.SetTexture("_FrontTex", reader.Read()); - break; - case "_FrontTex_TextureOffset": - instance.SetTextureOffset("_FrontTex_TextureOffset", reader.Read()); - break; - case "_FrontTex_TextureScale": - instance.SetTextureScale("_FrontTex_TextureScale", reader.Read()); - break; - case "_BackTex": - instance.SetTexture("_BackTex", reader.Read()); - break; - case "_BackTex_TextureOffset": - instance.SetTextureOffset("_BackTex_TextureOffset", reader.Read()); - break; - case "_BackTex_TextureScale": - instance.SetTextureScale("_BackTex_TextureScale", reader.Read()); - break; - case "_LeftTex": - instance.SetTexture("_LeftTex", reader.Read()); - break; - case "_LeftTex_TextureOffset": - instance.SetTextureOffset("_LeftTex_TextureOffset", reader.Read()); - break; - case "_LeftTex_TextureScale": - instance.SetTextureScale("_LeftTex_TextureScale", reader.Read()); - break; - case "_RightTex": - instance.SetTexture("_RightTex", reader.Read()); - break; - case "_RightTex_TextureOffset": - instance.SetTextureOffset("_RightTex_TextureOffset", reader.Read()); - break; - case "_RightTex_TextureScale": - instance.SetTextureScale("_RightTex_TextureScale", reader.Read()); - break; - case "_UpTex": - instance.SetTexture("_UpTex", reader.Read()); - break; - case "_UpTex_TextureOffset": - instance.SetTextureOffset("_UpTex_TextureOffset", reader.Read()); - break; - case "_UpTex_TextureScale": - instance.SetTextureScale("_UpTex_TextureScale", reader.Read()); - break; - case "_DownTex": - instance.SetTexture("_DownTex", reader.Read()); - break; - case "_DownTex_TextureOffset": - instance.SetTextureOffset("_DownTex_TextureOffset", reader.Read()); - break; - case "_DownTex_TextureScale": - instance.SetTextureScale("_DownTex_TextureScale", reader.Read()); - break; - case "_Metallic0": - instance.SetFloat("_Metallic0", reader.Read()); - break; - case "_Metallic1": - instance.SetFloat("_Metallic1", reader.Read()); - break; - case "_Metallic2": - instance.SetFloat("_Metallic2", reader.Read()); - break; - case "_Metallic3": - instance.SetFloat("_Metallic3", reader.Read()); - break; - case "_Smoothness0": - instance.SetFloat("_Smoothness0", reader.Read()); - break; - case "_Smoothness1": - instance.SetFloat("_Smoothness1", reader.Read()); - break; - case "_Smoothness2": - instance.SetFloat("_Smoothness2", reader.Read()); - break; - case "_Smoothness3": - instance.SetFloat("_Smoothness3", reader.Read()); - break; - case "_TexA": - instance.SetTexture("_TexA", reader.Read()); - break; - case "_TexA_TextureOffset": - instance.SetTextureOffset("_TexA_TextureOffset", reader.Read()); - break; - case "_TexA_TextureScale": - instance.SetTextureScale("_TexA_TextureScale", reader.Read()); - break; - case "_TexB": - instance.SetTexture("_TexB", reader.Read()); - break; - case "_TexB_TextureOffset": - instance.SetTextureOffset("_TexB_TextureOffset", reader.Read()); - break; - case "_TexB_TextureScale": - instance.SetTextureScale("_TexB_TextureScale", reader.Read()); - break; - case "_value": - instance.SetFloat("_value", reader.Read()); - break; - case "_Texel": - instance.SetFloat("_Texel", reader.Read()); - break; - case "_Detail": - instance.SetTexture("_Detail", reader.Read()); - break; - case "_Detail_TextureOffset": - instance.SetTextureOffset("_Detail_TextureOffset", reader.Read()); - break; - case "_Detail_TextureScale": - instance.SetTextureScale("_Detail_TextureScale", reader.Read()); - break; - case "_HalfOverCutoff": - instance.SetFloat("_HalfOverCutoff", reader.Read()); - break; - - default: - reader.Skip(); - break; - } - } -#endif - } - } - - public class ES3Type_MaterialArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_MaterialArray() : base(typeof(Material[]), ES3Type_Material.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Material.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Material.cs.meta deleted file mode 100644 index 0240dd4..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Material.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e2fe9704b49ad41cbb997e2b68befc6e -timeCreated: 1519132298 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Matrix4x4.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Matrix4x4.cs deleted file mode 100644 index 04f350a..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Matrix4x4.cs +++ /dev/null @@ -1,46 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("col0", "col1", "col2", "col3")] - public class ES3Type_Matrix4x4 : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Matrix4x4() : base(typeof(Matrix4x4)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var casted = (Matrix4x4)obj; - writer.WriteProperty("col0", casted.GetColumn(0), ES3Type_Vector4.Instance); - writer.WriteProperty("col1", casted.GetColumn(1), ES3Type_Vector4.Instance); - writer.WriteProperty("col2", casted.GetColumn(2), ES3Type_Vector4.Instance); - writer.WriteProperty("col3", casted.GetColumn(3), ES3Type_Vector4.Instance); - } - - public override object Read(ES3Reader reader) - { - var matrix = new Matrix4x4(); - matrix.SetColumn(0, reader.ReadProperty(ES3Type_Vector4.Instance)); - matrix.SetColumn(1, reader.ReadProperty(ES3Type_Vector4.Instance)); - matrix.SetColumn(2, reader.ReadProperty(ES3Type_Vector4.Instance)); - matrix.SetColumn(3, reader.ReadProperty(ES3Type_Vector4.Instance)); - return matrix; - } - } - - public class ES3Type_Matrix4x4Array : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_Matrix4x4Array() : base(typeof(Matrix4x4[]), ES3Type_Matrix4x4.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Matrix4x4.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Matrix4x4.cs.meta deleted file mode 100644 index ee057a4..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Matrix4x4.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b08ac351ee185470bb1ccb5150c4082f -timeCreated: 1519132294 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Mesh.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Mesh.cs deleted file mode 100644 index f6926b3..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Mesh.cs +++ /dev/null @@ -1,171 +0,0 @@ -using ES3Internal; -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("bounds", "subMeshCount", "boneWeights", "bindposes", "vertices", "normals", "tangents", "uv", "uv2", "uv3", "uv4", "colors32", "triangles", "subMeshes")] - public class ES3Type_Mesh : ES3UnityObjectType - { - public static ES3Type Instance; - - public ES3Type_Mesh() : base(typeof(Mesh)) - { - Instance = this; - } - - protected override void WriteUnityObject(object obj, ES3Writer writer) - { - var instance = (Mesh)obj; - - if (!instance.isReadable) - { - ES3Debug.LogWarning("Easy Save cannot save the vertices for this Mesh because it is not marked as readable, so it will be stored by reference. To save the vertex data for this Mesh, check the 'Read/Write Enabled' checkbox in its Import Settings.", instance); - return; - } - - writer.WriteProperty("indexFormat", instance.indexFormat); - writer.WriteProperty("name", instance.name); - writer.WriteProperty("vertices", instance.vertices, ES3Type_Vector3Array.Instance); - writer.WriteProperty("triangles", instance.triangles, ES3Type_intArray.Instance); - writer.WriteProperty("bounds", instance.bounds, ES3Type_Bounds.Instance); - writer.WriteProperty("boneWeights", instance.boneWeights, ES3Type_BoneWeightArray.Instance); - writer.WriteProperty("bindposes", instance.bindposes, ES3Type_Matrix4x4Array.Instance); - writer.WriteProperty("normals", instance.normals, ES3Type_Vector3Array.Instance); - writer.WriteProperty("tangents", instance.tangents, ES3Type_Vector4Array.Instance); - writer.WriteProperty("uv", instance.uv, ES3Type_Vector2Array.Instance); - writer.WriteProperty("uv2", instance.uv2, ES3Type_Vector2Array.Instance); - writer.WriteProperty("uv3", instance.uv3, ES3Type_Vector2Array.Instance); - writer.WriteProperty("uv4", instance.uv4, ES3Type_Vector2Array.Instance); - writer.WriteProperty("colors32", instance.colors32, ES3Type_Color32Array.Instance); - writer.WriteProperty("subMeshCount", instance.subMeshCount, ES3Type_int.Instance); - for (int i = 0; i < instance.subMeshCount; i++) - writer.WriteProperty("subMesh" + i, instance.GetTriangles(i), ES3Type_intArray.Instance); - - // Blend shapes. - writer.WriteProperty("blendShapeCount", instance.blendShapeCount); - - for (int blendShapeIndex = 0; blendShapeIndex < instance.blendShapeCount; blendShapeIndex++) - { - writer.WriteProperty("GetBlendShapeName" + blendShapeIndex, instance.GetBlendShapeName(blendShapeIndex)); - writer.WriteProperty("GetBlendShapeFrameCount" + blendShapeIndex, instance.GetBlendShapeFrameCount(blendShapeIndex)); - - for (int frameIndex = 0; frameIndex < instance.GetBlendShapeFrameCount(blendShapeIndex); frameIndex++) - { - Vector3[] deltaVertices = new Vector3[instance.vertexCount]; - Vector3[] deltaNormals = new Vector3[instance.vertexCount]; - Vector3[] deltaTangents = new Vector3[instance.vertexCount]; - - instance.GetBlendShapeFrameVertices(blendShapeIndex, frameIndex, deltaVertices, deltaNormals, deltaTangents); - - writer.WriteProperty("blendShapeDeltaVertices" + blendShapeIndex + "_" + frameIndex, deltaVertices); - writer.WriteProperty("blendShapeDeltaNormals" + blendShapeIndex + "_" + frameIndex, deltaNormals); - writer.WriteProperty("blendShapeDeltaTangents" + blendShapeIndex + "_" + frameIndex, deltaTangents); - writer.WriteProperty("blendShapeFrameWeight" + blendShapeIndex + "_" + frameIndex, instance.GetBlendShapeFrameWeight(blendShapeIndex, frameIndex)); - } - } - } - - protected override object ReadUnityObject(ES3Reader reader) - { - var obj = new Mesh(); - ReadUnityObject(reader, obj); - return obj; - } - - protected override void ReadUnityObject(ES3Reader reader, object obj) - { - var instance = (Mesh)obj; - if (instance == null) - return; - - if (!instance.isReadable) - ES3Debug.LogWarning("Easy Save cannot load the vertices for this Mesh because it is not marked as readable, so it will be loaded by reference. To load the vertex data for this Mesh, check the 'Read/Write Enabled' checkbox in its Import Settings.", instance); - - foreach (string propertyName in reader.Properties) - { - // If this Mesh isn't readable, we should skip past all of its properties. - if (!instance.isReadable) - { - reader.Skip(); - continue; - } - - switch (propertyName) - { - case "indexFormat": - instance.indexFormat = reader.Read(); - break; - case "name": - instance.name = reader.Read(ES3Type_string.Instance); - break; - case "bounds": - instance.bounds = reader.Read(ES3Type_Bounds.Instance); - break; - case "boneWeights": - instance.boneWeights = reader.Read(ES3Type_BoneWeightArray.Instance); - break; - case "bindposes": - instance.bindposes = reader.Read(ES3Type_Matrix4x4Array.Instance); - break; - case "vertices": - instance.vertices = reader.Read(ES3Type_Vector3Array.Instance); - break; - case "normals": - instance.normals = reader.Read(ES3Type_Vector3Array.Instance); - break; - case "tangents": - instance.tangents = reader.Read(ES3Type_Vector4Array.Instance); - break; - case "uv": - instance.uv = reader.Read(ES3Type_Vector2Array.Instance); - break; - case "uv2": - instance.uv2 = reader.Read(ES3Type_Vector2Array.Instance); - break; - case "uv3": - instance.uv3 = reader.Read(ES3Type_Vector2Array.Instance); - break; - case "uv4": - instance.uv4 = reader.Read(ES3Type_Vector2Array.Instance); - break; - case "colors32": - instance.colors32 = reader.Read(ES3Type_Color32Array.Instance); - break; - case "triangles": - instance.triangles = reader.Read(ES3Type_intArray.Instance); - break; - case "subMeshCount": - instance.subMeshCount = reader.Read(ES3Type_int.Instance); - for (int i = 0; i < instance.subMeshCount; i++) - instance.SetTriangles(reader.ReadProperty(ES3Type_intArray.Instance), i); - break; - case "blendShapeCount": - instance.ClearBlendShapes(); - int blendShapeCount = reader.Read(ES3Type_int.Instance); - for (int blendShapeIndex = 0; blendShapeIndex < blendShapeCount; blendShapeIndex++) - { - string shapeName = reader.ReadProperty(); - int frameCount = reader.ReadProperty(); - - for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) - { - Vector3[] deltaVertices = reader.ReadProperty(); - Vector3[] deltaNormals = reader.ReadProperty(); - Vector3[] deltaTangents = reader.ReadProperty(); - float frameWeight = reader.ReadProperty(); - - instance.AddBlendShapeFrame(shapeName, frameWeight, deltaVertices, deltaNormals, deltaTangents); - } - } - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Mesh.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Mesh.cs.meta deleted file mode 100644 index d4f2333..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Mesh.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e39bdb3d7bcae4f1aa682cbc9ff72ce7 -timeCreated: 1519132298 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MinMaxCurve.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MinMaxCurve.cs deleted file mode 100644 index 4a0f56f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MinMaxCurve.cs +++ /dev/null @@ -1,114 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("mode", "curveMultiplier", "curveMax", "curveMin", "constantMax", "constantMin", "constant", "curve")] - public class ES3Type_MinMaxCurve : ES3Type - { - public static ES3Type Instance; - - public ES3Type_MinMaxCurve() : base(typeof(ParticleSystem.MinMaxCurve)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.MinMaxCurve)obj; - - writer.WriteProperty("mode", instance.mode); - writer.WriteProperty("curveMultiplier", instance.curveMultiplier, ES3Type_float.Instance); - writer.WriteProperty("curveMax", instance.curveMax, ES3Type_AnimationCurve.Instance); - writer.WriteProperty("curveMin", instance.curveMin, ES3Type_AnimationCurve.Instance); - writer.WriteProperty("constantMax", instance.constantMax, ES3Type_float.Instance); - writer.WriteProperty("constantMin", instance.constantMin, ES3Type_float.Instance); - writer.WriteProperty("constant", instance.constant, ES3Type_float.Instance); - writer.WriteProperty("curve", instance.curve, ES3Type_AnimationCurve.Instance); - } - - [Preserve] - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.MinMaxCurve(); - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "mode": - instance.mode = reader.Read(); - break; - case "curveMultiplier": - instance.curveMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "curveMax": - instance.curveMax = reader.Read(ES3Type_AnimationCurve.Instance); - break; - case "curveMin": - instance.curveMin = reader.Read(ES3Type_AnimationCurve.Instance); - break; - case "constantMax": - instance.constantMax = reader.Read(ES3Type_float.Instance); - break; - case "constantMin": - instance.constantMin = reader.Read(ES3Type_float.Instance); - break; - case "constant": - instance.constant = reader.Read(ES3Type_float.Instance); - break; - case "curve": - instance.curve = reader.Read(ES3Type_AnimationCurve.Instance); - break; - default: - reader.Skip(); - break; - } - } - return instance; - } - - [Preserve] - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.MinMaxCurve)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "mode": - instance.mode = reader.Read(); - break; - case "curveMultiplier": - instance.curveMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "curveMax": - instance.curveMax = reader.Read(ES3Type_AnimationCurve.Instance); - break; - case "curveMin": - instance.curveMin = reader.Read(ES3Type_AnimationCurve.Instance); - break; - case "constantMax": - instance.constantMax = reader.Read(ES3Type_float.Instance); - break; - case "constantMin": - instance.constantMin = reader.Read(ES3Type_float.Instance); - break; - case "constant": - instance.constant = reader.Read(ES3Type_float.Instance); - break; - case "curve": - instance.curve = reader.Read(ES3Type_AnimationCurve.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MinMaxCurve.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MinMaxCurve.cs.meta deleted file mode 100644 index 6c43b9e..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MinMaxCurve.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b63607ddb964c4897880a99d41c70efd -timeCreated: 1519132294 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MinMaxGradient.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MinMaxGradient.cs deleted file mode 100644 index 0588a19..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MinMaxGradient.cs +++ /dev/null @@ -1,68 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("mode", "gradientMax", "gradientMin", "colorMax", "colorMin", "color", "gradient")] - public class ES3Type_MinMaxGradient : ES3Type - { - public static ES3Type Instance; - - public ES3Type_MinMaxGradient() : base(typeof(ParticleSystem.MinMaxGradient)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.MinMaxGradient)obj; - - writer.WriteProperty("mode", instance.mode); - writer.WriteProperty("gradientMax", instance.gradientMax, ES3Type_Gradient.Instance); - writer.WriteProperty("gradientMin", instance.gradientMin, ES3Type_Gradient.Instance); - writer.WriteProperty("colorMax", instance.colorMax, ES3Type_Color.Instance); - writer.WriteProperty("colorMin", instance.colorMin, ES3Type_Color.Instance); - writer.WriteProperty("color", instance.color, ES3Type_Color.Instance); - writer.WriteProperty("gradient", instance.gradient, ES3Type_Gradient.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.MinMaxGradient(); - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "mode": - instance.mode = reader.Read(); - break; - case "gradientMax": - instance.gradientMax = reader.Read(ES3Type_Gradient.Instance); - break; - case "gradientMin": - instance.gradientMin = reader.Read(ES3Type_Gradient.Instance); - break; - case "colorMax": - instance.colorMax = reader.Read(ES3Type_Color.Instance); - break; - case "colorMin": - instance.colorMin = reader.Read(ES3Type_Color.Instance); - break; - case "color": - instance.color = reader.Read(ES3Type_Color.Instance); - break; - case "gradient": - instance.gradient = reader.Read(ES3Type_Gradient.Instance); - break; - default: - reader.Skip(); - break; - } - } - return instance; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MinMaxGradient.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MinMaxGradient.cs.meta deleted file mode 100644 index 72fe496..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_MinMaxGradient.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c5b12866f2f984f6a822a127d5be1f9c -timeCreated: 1519132296 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_NoiseModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_NoiseModule.cs deleted file mode 100644 index 912dcd3..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_NoiseModule.cs +++ /dev/null @@ -1,154 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "separateAxes", "strength", "strengthMultiplier", "strengthX", "strengthXMultiplier", "strengthY", "strengthYMultiplier", "strengthZ", "strengthZMultiplier", "frequency", "damping", "octaveCount", "octaveMultiplier", "octaveScale", "quality", "scrollSpeed", "scrollSpeedMultiplier", "remapEnabled", "remap", "remapMultiplier", "remapX", "remapXMultiplier", "remapY", "remapYMultiplier", "remapZ", "remapZMultiplier")] - public class ES3Type_NoiseModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_NoiseModule() : base(typeof(ParticleSystem.NoiseModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.NoiseModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("separateAxes", instance.separateAxes, ES3Type_bool.Instance); - writer.WriteProperty("strength", instance.strength, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("strengthMultiplier", instance.strengthMultiplier, ES3Type_float.Instance); - writer.WriteProperty("strengthX", instance.strengthX, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("strengthXMultiplier", instance.strengthXMultiplier, ES3Type_float.Instance); - writer.WriteProperty("strengthY", instance.strengthY, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("strengthYMultiplier", instance.strengthYMultiplier, ES3Type_float.Instance); - writer.WriteProperty("strengthZ", instance.strengthZ, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("strengthZMultiplier", instance.strengthZMultiplier, ES3Type_float.Instance); - writer.WriteProperty("frequency", instance.frequency, ES3Type_float.Instance); - writer.WriteProperty("damping", instance.damping, ES3Type_bool.Instance); - writer.WriteProperty("octaveCount", instance.octaveCount, ES3Type_int.Instance); - writer.WriteProperty("octaveMultiplier", instance.octaveMultiplier, ES3Type_float.Instance); - writer.WriteProperty("octaveScale", instance.octaveScale, ES3Type_float.Instance); - writer.WriteProperty("quality", instance.quality); - writer.WriteProperty("scrollSpeed", instance.scrollSpeed, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("scrollSpeedMultiplier", instance.scrollSpeedMultiplier, ES3Type_float.Instance); - writer.WriteProperty("remapEnabled", instance.remapEnabled, ES3Type_bool.Instance); - writer.WriteProperty("remap", instance.remap, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("remapMultiplier", instance.remapMultiplier, ES3Type_float.Instance); - writer.WriteProperty("remapX", instance.remapX, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("remapXMultiplier", instance.remapXMultiplier, ES3Type_float.Instance); - writer.WriteProperty("remapY", instance.remapY, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("remapYMultiplier", instance.remapYMultiplier, ES3Type_float.Instance); - writer.WriteProperty("remapZ", instance.remapZ, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("remapZMultiplier", instance.remapZMultiplier, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.NoiseModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.NoiseModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "separateAxes": - instance.separateAxes = reader.Read(ES3Type_bool.Instance); - break; - case "strength": - instance.strength = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "strengthMultiplier": - instance.strengthMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "strengthX": - instance.strengthX = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "strengthXMultiplier": - instance.strengthXMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "strengthY": - instance.strengthY = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "strengthYMultiplier": - instance.strengthYMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "strengthZ": - instance.strengthZ = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "strengthZMultiplier": - instance.strengthZMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "frequency": - instance.frequency = reader.Read(ES3Type_float.Instance); - break; - case "damping": - instance.damping = reader.Read(ES3Type_bool.Instance); - break; - case "octaveCount": - instance.octaveCount = reader.Read(ES3Type_int.Instance); - break; - case "octaveMultiplier": - instance.octaveMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "octaveScale": - instance.octaveScale = reader.Read(ES3Type_float.Instance); - break; - case "quality": - instance.quality = reader.Read(); - break; - case "scrollSpeed": - instance.scrollSpeed = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "scrollSpeedMultiplier": - instance.scrollSpeedMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "remapEnabled": - instance.remapEnabled = reader.Read(ES3Type_bool.Instance); - break; - case "remap": - instance.remap = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "remapMultiplier": - instance.remapMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "remapX": - instance.remapX = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "remapXMultiplier": - instance.remapXMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "remapY": - instance.remapY = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "remapYMultiplier": - instance.remapYMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "remapZ": - instance.remapZ = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "remapZMultiplier": - instance.remapZMultiplier = reader.Read(ES3Type_float.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_NoiseModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_NoiseModule.cs.meta deleted file mode 100644 index 8c93046..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_NoiseModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 95fd95820c7c942ef96f463a52c3d4ae -timeCreated: 1519132291 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_PhysicMaterial.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_PhysicMaterial.cs deleted file mode 100644 index ce73313..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_PhysicMaterial.cs +++ /dev/null @@ -1,72 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("dynamicFriction", "staticFriction", "bounciness", "frictionCombine", "bounceCombine")] - public class ES3Type_PhysicMaterial : ES3ObjectType - { - public static ES3Type Instance; - - public ES3Type_PhysicMaterial() : base(typeof(PhysicMaterial)) { Instance = this; } - - protected override void WriteObject(object obj, ES3Writer writer) - { - var instance = (PhysicMaterial)obj; - - writer.WriteProperty("dynamicFriction", instance.dynamicFriction, ES3Type_float.Instance); - writer.WriteProperty("staticFriction", instance.staticFriction, ES3Type_float.Instance); - writer.WriteProperty("bounciness", instance.bounciness, ES3Type_float.Instance); - writer.WriteProperty("frictionCombine", instance.frictionCombine); - writer.WriteProperty("bounceCombine", instance.bounceCombine); - } - - protected override void ReadObject(ES3Reader reader, object obj) - { - var instance = (PhysicMaterial)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "dynamicFriction": - instance.dynamicFriction = reader.Read(ES3Type_float.Instance); - break; - case "staticFriction": - instance.staticFriction = reader.Read(ES3Type_float.Instance); - break; - case "bounciness": - instance.bounciness = reader.Read(ES3Type_float.Instance); - break; - case "frictionCombine": - instance.frictionCombine = reader.Read(); - break; - case "bounceCombine": - instance.bounceCombine = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - - protected override object ReadObject(ES3Reader reader) - { - var instance = new PhysicMaterial(); - ReadObject(reader, instance); - return instance; - } - } - - public class ES3Type_PhysicMaterialArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_PhysicMaterialArray() : base(typeof(PhysicMaterial[]), ES3Type_PhysicMaterial.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_PhysicMaterial.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_PhysicMaterial.cs.meta deleted file mode 100644 index bbc3c12..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_PhysicMaterial.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f4b8d9e47b0dc49f48c834a160b6fe55 -timeCreated: 1519132300 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_PhysicsMaterial2D.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_PhysicsMaterial2D.cs deleted file mode 100644 index 79e9d7e..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_PhysicsMaterial2D.cs +++ /dev/null @@ -1,60 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("bounciness", "friction")] - public class ES3Type_PhysicsMaterial2D : ES3ObjectType - { - public static ES3Type Instance; - - public ES3Type_PhysicsMaterial2D() : base(typeof(PhysicsMaterial2D)) { Instance = this; } - - protected override void WriteObject(object obj, ES3Writer writer) - { - var instance = (PhysicsMaterial2D)obj; - - writer.WriteProperty("bounciness", instance.bounciness, ES3Type_float.Instance); - writer.WriteProperty("friction", instance.friction, ES3Type_float.Instance); - } - - protected override void ReadObject(ES3Reader reader, object obj) - { - var instance = (PhysicsMaterial2D)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "bounciness": - instance.bounciness = reader.Read(ES3Type_float.Instance); - break; - case "friction": - instance.friction = reader.Read(ES3Type_float.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - - protected override object ReadObject(ES3Reader reader) - { - var instance = new PhysicsMaterial2D(); - ReadObject(reader, instance); - return instance; - } - } - - public class ES3Type_PhysicsMaterial2DArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_PhysicsMaterial2DArray() : base(typeof(PhysicsMaterial2D[]), ES3Type_PhysicsMaterial2D.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_PhysicsMaterial2D.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_PhysicsMaterial2D.cs.meta deleted file mode 100644 index 765da0f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_PhysicsMaterial2D.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 456568556c632458bb73fffbb1be0c84 -timeCreated: 1519132284 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Quaternion.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Quaternion.cs deleted file mode 100644 index 9883c0e..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Quaternion.cs +++ /dev/null @@ -1,44 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("x", "y", "z", "w")] - public class ES3Type_Quaternion : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Quaternion() : base(typeof(Quaternion)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var casted = (Quaternion)obj; - writer.WriteProperty("x", casted.x, ES3Type_float.Instance); - writer.WriteProperty("y", casted.y, ES3Type_float.Instance); - writer.WriteProperty("z", casted.z, ES3Type_float.Instance); - writer.WriteProperty("w", casted.w, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - return new Quaternion(reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance)); - } - } - - public class ES3Type_QuaternionArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_QuaternionArray() : base(typeof(Quaternion[]), ES3Type_Quaternion.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Quaternion.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Quaternion.cs.meta deleted file mode 100644 index bb4c22a..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Quaternion.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d9975ecdd621d46a285708463dde7816 -timeCreated: 1519132297 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Rect.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Rect.cs deleted file mode 100644 index 3f22d75..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Rect.cs +++ /dev/null @@ -1,35 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("x", "y", "width", "height")] - public class ES3Type_Rect : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Rect() : base(typeof(Rect)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (Rect)obj; - - writer.WriteProperty("x", instance.x, ES3Type_float.Instance); - writer.WriteProperty("y", instance.y, ES3Type_float.Instance); - writer.WriteProperty("width", instance.width, ES3Type_float.Instance); - writer.WriteProperty("height", instance.height, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - return new Rect(reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance)); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Rect.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Rect.cs.meta deleted file mode 100644 index 1874834..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Rect.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d9b9aa6e5759a4a3e857f90a2de74e5f -timeCreated: 1519132297 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RectTransform.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RectTransform.cs deleted file mode 100644 index 46b8434..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RectTransform.cs +++ /dev/null @@ -1,96 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("anchorMin", "anchorMax", "anchoredPosition", "sizeDelta", "pivot", "offsetMin", "offsetMax", "localPosition", "localRotation", "localScale", "parent", "hideFlags")] - public class ES3Type_RectTransform : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_RectTransform() : base(typeof(RectTransform)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (RectTransform)obj; - - writer.WritePropertyByRef("parent", instance.parent); - writer.WriteProperty("anchorMin", instance.anchorMin, ES3Type_Vector2.Instance); - writer.WriteProperty("anchorMax", instance.anchorMax, ES3Type_Vector2.Instance); - writer.WriteProperty("anchoredPosition", instance.anchoredPosition, ES3Type_Vector2.Instance); - writer.WriteProperty("sizeDelta", instance.sizeDelta, ES3Type_Vector2.Instance); - writer.WriteProperty("pivot", instance.pivot, ES3Type_Vector2.Instance); - writer.WriteProperty("offsetMin", instance.offsetMin, ES3Type_Vector2.Instance); - writer.WriteProperty("offsetMax", instance.offsetMax, ES3Type_Vector2.Instance); - writer.WriteProperty("localPosition", instance.localPosition, ES3Type_Vector3.Instance); - writer.WriteProperty("localRotation", instance.localRotation, ES3Type_Quaternion.Instance); - writer.WriteProperty("localScale", instance.localScale, ES3Type_Vector3.Instance); - writer.WriteProperty("hideFlags", instance.hideFlags); - writer.WriteProperty("siblingIndex", instance.GetSiblingIndex()); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - if (obj.GetType() == typeof(Transform)) - obj = ((Transform)obj).gameObject.AddComponent(); - - var instance = (RectTransform)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "anchorMin": - instance.anchorMin = reader.Read(ES3Type_Vector2.Instance); - break; - case "anchorMax": - instance.anchorMax = reader.Read(ES3Type_Vector2.Instance); - break; - case "anchoredPosition": - instance.anchoredPosition = reader.Read(ES3Type_Vector2.Instance); - break; - case "sizeDelta": - instance.sizeDelta = reader.Read(ES3Type_Vector2.Instance); - break; - case "pivot": - instance.pivot = reader.Read(ES3Type_Vector2.Instance); - break; - case "offsetMin": - instance.offsetMin = reader.Read(ES3Type_Vector2.Instance); - break; - case "offsetMax": - instance.offsetMax = reader.Read(ES3Type_Vector2.Instance); - break; - case "localPosition": - instance.localPosition = reader.Read(ES3Type_Vector3.Instance); - break; - case "localRotation": - instance.localRotation = reader.Read(ES3Type_Quaternion.Instance); - break; - case "localScale": - instance.localScale = reader.Read(ES3Type_Vector3.Instance); - break; - case "parent": - instance.SetParent(reader.Read(ES3Type_Transform.Instance)); - break; - case "hierarchyCapacity": - instance.hierarchyCapacity = reader.Read(ES3Type_int.Instance); - break; - case "hideFlags": - instance.hideFlags = reader.Read(); - break; - case "siblingIndex": - instance.SetSiblingIndex(reader.Read()); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RectTransform.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RectTransform.cs.meta deleted file mode 100644 index 2386dc3..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RectTransform.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2f7556a7c1bb04cf5979c7e6e65c5e51 -timeCreated: 1519132282 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RenderTexture.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RenderTexture.cs deleted file mode 100644 index 91ce1ae..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RenderTexture.cs +++ /dev/null @@ -1,167 +0,0 @@ -using UnityEngine; -using UnityEngine.Experimental.Rendering; -using UnityEngine.Rendering; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("width", "height", "dimension", "graphicsFormat", "useMipMap", "vrUsage", "memorylessMode", "format", "stencilFormat", "autoGenerateMips", "volumeDepth", "antiAliasing", "bindTextureMS", "enableRandomWrite", "useDynamicScale", "isPowerOfTwo", "depth", "descriptor", "masterTextureLimit", "anisotropicFiltering", "wrapMode", "wrapModeU", "wrapModeV", "wrapModeW", "filterMode", "anisoLevel", "mipMapBias", "imageContentsHash", "streamingTextureForceLoadAll", "streamingTextureDiscardUnusedMips", "allowThreadedTextureCreation", "name")] - public class ES3Type_RenderTexture : ES3ObjectType - { - public static ES3Type Instance; - - public ES3Type_RenderTexture() : base(typeof(RenderTexture)) { Instance = this; } - - - protected override void WriteObject(object obj, ES3Writer writer) - { - var instance = (RenderTexture)obj; - - writer.WriteProperty("descriptor", instance.descriptor); - writer.WriteProperty("antiAliasing", instance.antiAliasing, ES3Type_int.Instance); - writer.WriteProperty("isPowerOfTwo", instance.isPowerOfTwo, ES3Type_bool.Instance); - writer.WriteProperty("anisotropicFiltering", Texture.anisotropicFiltering); - writer.WriteProperty("wrapMode", instance.wrapMode); - writer.WriteProperty("wrapModeU", instance.wrapModeU); - writer.WriteProperty("wrapModeV", instance.wrapModeV); - writer.WriteProperty("wrapModeW", instance.wrapModeW); - writer.WriteProperty("filterMode", instance.filterMode); - writer.WriteProperty("anisoLevel", instance.anisoLevel, ES3Type_int.Instance); - writer.WriteProperty("mipMapBias", instance.mipMapBias, ES3Type_float.Instance); - -#if UNITY_2020_1_OR_NEWER - writer.WriteProperty("streamingTextureForceLoadAll", Texture.streamingTextureForceLoadAll, ES3Type_bool.Instance); - writer.WriteProperty("streamingTextureDiscardUnusedMips", Texture.streamingTextureDiscardUnusedMips, ES3Type_bool.Instance); - writer.WriteProperty("allowThreadedTextureCreation", Texture.allowThreadedTextureCreation, ES3Type_bool.Instance); -#endif - } - - protected override void ReadObject(ES3Reader reader, object obj) - { - var instance = (RenderTexture)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case "width": - instance.width = reader.Read(ES3Type_int.Instance); - break; - case "height": - instance.height = reader.Read(ES3Type_int.Instance); - break; - case "dimension": - instance.dimension = reader.Read(); - break; - case "useMipMap": - instance.useMipMap = reader.Read(ES3Type_bool.Instance); - break; - case "memorylessMode": - instance.memorylessMode = reader.Read(); - break; - case "format": - instance.format = reader.Read(); - break; - case "autoGenerateMips": - instance.autoGenerateMips = reader.Read(ES3Type_bool.Instance); - break; - case "volumeDepth": - instance.volumeDepth = reader.Read(ES3Type_int.Instance); - break; - case "antiAliasing": - instance.antiAliasing = reader.Read(ES3Type_int.Instance); - break; - case "enableRandomWrite": - instance.enableRandomWrite = reader.Read(ES3Type_bool.Instance); - break; - case "isPowerOfTwo": - instance.isPowerOfTwo = reader.Read(ES3Type_bool.Instance); - break; - case "depth": - instance.depth = reader.Read(ES3Type_int.Instance); - break; - case "descriptor": - instance.descriptor = reader.Read(); - break; - case "anisotropicFiltering": - Texture.anisotropicFiltering = reader.Read(); - break; - case "wrapMode": - instance.wrapMode = reader.Read(); - break; - case "wrapModeU": - instance.wrapModeU = reader.Read(); - break; - case "wrapModeV": - instance.wrapModeV = reader.Read(); - break; - case "wrapModeW": - instance.wrapModeW = reader.Read(); - break; - case "filterMode": - instance.filterMode = reader.Read(); - break; - case "anisoLevel": - instance.anisoLevel = reader.Read(ES3Type_int.Instance); - break; - case "mipMapBias": - instance.mipMapBias = reader.Read(ES3Type_float.Instance); - break; - case "name": - instance.name = reader.Read(ES3Type_string.Instance); - break; - -#if UNITY_2020_1_OR_NEWER - case "vrUsage": - instance.vrUsage = reader.Read(); - break; - case "graphicsFormat": - instance.graphicsFormat = reader.Read(); - break; - case "stencilFormat": - instance.stencilFormat = reader.Read(); - break; - case "bindTextureMS": - instance.bindTextureMS = reader.Read(ES3Type_bool.Instance); - break; - case "useDynamicScale": - instance.useDynamicScale = reader.Read(ES3Type_bool.Instance); - break; - case "streamingTextureForceLoadAll": - Texture.streamingTextureForceLoadAll = reader.Read(ES3Type_bool.Instance); - break; - case "streamingTextureDiscardUnusedMips": - Texture.streamingTextureDiscardUnusedMips = reader.Read(ES3Type_bool.Instance); - break; - case "allowThreadedTextureCreation": - Texture.allowThreadedTextureCreation = reader.Read(ES3Type_bool.Instance); - break; -#endif - - default: - reader.Skip(); - break; - } - } - } - - protected override object ReadObject(ES3Reader reader) - { - var descriptor = reader.ReadProperty(); - var instance = new RenderTexture(descriptor); - ReadObject(reader, instance); - return instance; - } - } - - - public class ES3Type_RenderTextureArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_RenderTextureArray() : base(typeof(RenderTexture[]), ES3Type_RenderTexture.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RenderTexture.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RenderTexture.cs.meta deleted file mode 100644 index a0082df..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RenderTexture.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 589b7cd3ec938964197a399aa93bff00 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RotationBySpeedModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RotationBySpeedModule.cs deleted file mode 100644 index 54d8af3..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RotationBySpeedModule.cs +++ /dev/null @@ -1,82 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "x", "xMultiplier", "y", "yMultiplier", "z", "zMultiplier", "separateAxes", "range")] - public class ES3Type_RotationBySpeedModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_RotationBySpeedModule() : base(typeof(ParticleSystem.RotationBySpeedModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.RotationBySpeedModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("x", instance.x, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("xMultiplier", instance.xMultiplier, ES3Type_float.Instance); - writer.WriteProperty("y", instance.y, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("yMultiplier", instance.yMultiplier, ES3Type_float.Instance); - writer.WriteProperty("z", instance.z, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("zMultiplier", instance.zMultiplier, ES3Type_float.Instance); - writer.WriteProperty("separateAxes", instance.separateAxes, ES3Type_bool.Instance); - writer.WriteProperty("range", instance.range, ES3Type_Vector2.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.RotationBySpeedModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.RotationBySpeedModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "x": - instance.x = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "xMultiplier": - instance.xMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "y": - instance.y = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "yMultiplier": - instance.yMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "z": - instance.z = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "zMultiplier": - instance.zMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "separateAxes": - instance.separateAxes = reader.Read(ES3Type_bool.Instance); - break; - case "range": - instance.range = reader.Read(ES3Type_Vector2.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RotationBySpeedModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RotationBySpeedModule.cs.meta deleted file mode 100644 index 1f0bd64..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RotationBySpeedModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0a7279e70f63d4a2787489257b5e3ea9 -timeCreated: 1519132280 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RotationOverLifetimeModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RotationOverLifetimeModule.cs deleted file mode 100644 index f3539f6..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RotationOverLifetimeModule.cs +++ /dev/null @@ -1,78 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "x", "xMultiplier", "y", "yMultiplier", "z", "zMultiplier", "separateAxes")] - public class ES3Type_RotationOverLifetimeModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_RotationOverLifetimeModule() : base(typeof(ParticleSystem.RotationOverLifetimeModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.RotationOverLifetimeModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("x", instance.x, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("xMultiplier", instance.xMultiplier, ES3Type_float.Instance); - writer.WriteProperty("y", instance.y, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("yMultiplier", instance.yMultiplier, ES3Type_float.Instance); - writer.WriteProperty("z", instance.z, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("zMultiplier", instance.zMultiplier, ES3Type_float.Instance); - writer.WriteProperty("separateAxes", instance.separateAxes, ES3Type_bool.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.RotationOverLifetimeModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.RotationOverLifetimeModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "x": - instance.x = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "xMultiplier": - instance.xMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "y": - instance.y = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "yMultiplier": - instance.yMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "z": - instance.z = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "zMultiplier": - instance.zMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "separateAxes": - instance.separateAxes = reader.Read(ES3Type_bool.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RotationOverLifetimeModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RotationOverLifetimeModule.cs.meta deleted file mode 100644 index 6eeaf0a..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_RotationOverLifetimeModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e54d1e36b07864bc2b7f33a6182d124b -timeCreated: 1519132299 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Shader.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Shader.cs deleted file mode 100644 index 0898969..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Shader.cs +++ /dev/null @@ -1,61 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("name", "maximumLOD")] - public class ES3Type_Shader : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Shader() : base(typeof(Shader)) { Instance = this; } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (Shader)obj; - - writer.WriteProperty("name", instance.name, ES3Type_string.Instance); - writer.WriteProperty("maximumLOD", instance.maximumLOD, ES3Type_int.Instance); - } - - public override object Read(ES3Reader reader) - { - var obj = Shader.Find(reader.ReadProperty(ES3Type_string.Instance)); - if (obj == null) - obj = Shader.Find("Diffuse"); - ReadInto(reader, obj); - return obj; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (Shader)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case "name": - instance.name = reader.Read(ES3Type_string.Instance); - break; - case "maximumLOD": - instance.maximumLOD = reader.Read(ES3Type_int.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } - - public class ES3Type_ShaderArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_ShaderArray() : base(typeof(Shader[]), ES3Type_Shader.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Shader.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Shader.cs.meta deleted file mode 100644 index c980dbf..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Shader.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9d42e849fe2364f1b92d805b3fa7f874 -timeCreated: 1519132292 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ShapeModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ShapeModule.cs deleted file mode 100644 index c67cb41..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ShapeModule.cs +++ /dev/null @@ -1,132 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "shapeType", "randomDirectionAmount", "sphericalDirectionAmount", "alignToDirection", "radius", "angle", "length", "box", "meshShapeType", "mesh", "meshRenderer", "skinnedMeshRenderer", "useMeshMaterialIndex", "meshMaterialIndex", "useMeshColors", "normalOffset", "meshScale", "arc")] - public class ES3Type_ShapeModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_ShapeModule() : base(typeof(ParticleSystem.ShapeModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.ShapeModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("shapeType", instance.shapeType); - writer.WriteProperty("randomDirectionAmount", instance.randomDirectionAmount, ES3Type_float.Instance); - writer.WriteProperty("sphericalDirectionAmount", instance.sphericalDirectionAmount, ES3Type_float.Instance); - writer.WriteProperty("alignToDirection", instance.alignToDirection, ES3Type_bool.Instance); - writer.WriteProperty("radius", instance.radius, ES3Type_float.Instance); - writer.WriteProperty("angle", instance.angle, ES3Type_float.Instance); - writer.WriteProperty("length", instance.length, ES3Type_float.Instance); - #if UNITY_5 - writer.WriteProperty("box", instance.box, ES3Type_Vector3.Instance); - writer.WriteProperty("meshScale", instance.meshScale, ES3Type_float.Instance); - #else - writer.WriteProperty("scale", instance.scale, ES3Type_Vector3.Instance); - #endif - writer.WriteProperty("meshShapeType", instance.meshShapeType); - writer.WritePropertyByRef("mesh", instance.mesh); - writer.WritePropertyByRef("meshRenderer", instance.meshRenderer); - writer.WritePropertyByRef("skinnedMeshRenderer", instance.skinnedMeshRenderer); - writer.WriteProperty("useMeshMaterialIndex", instance.useMeshMaterialIndex, ES3Type_bool.Instance); - writer.WriteProperty("meshMaterialIndex", instance.meshMaterialIndex, ES3Type_int.Instance); - writer.WriteProperty("useMeshColors", instance.useMeshColors, ES3Type_bool.Instance); - writer.WriteProperty("normalOffset", instance.normalOffset, ES3Type_float.Instance); - writer.WriteProperty("arc", instance.arc, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.ShapeModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.ShapeModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "shapeType": - instance.shapeType = reader.Read(); - break; - case "randomDirectionAmount": - instance.randomDirectionAmount = reader.Read(ES3Type_float.Instance); - break; - case "sphericalDirectionAmount": - instance.sphericalDirectionAmount = reader.Read(ES3Type_float.Instance); - break; - case "alignToDirection": - instance.alignToDirection = reader.Read(ES3Type_bool.Instance); - break; - case "radius": - instance.radius = reader.Read(ES3Type_float.Instance); - break; - case "angle": - instance.angle = reader.Read(ES3Type_float.Instance); - break; - case "length": - instance.length = reader.Read(ES3Type_float.Instance); - break; - #if UNITY_5 - case "box": - instance.box = reader.Read(ES3Type_Vector3.Instance); - break; - case "meshScale": - instance.meshScale = reader.Read(ES3Type_float.Instance); - break; - #else - case "scale": - instance.scale = reader.Read(ES3Type_Vector3.Instance); - break; - #endif - case "meshShapeType": - instance.meshShapeType = reader.Read(); - break; - case "mesh": - instance.mesh = reader.Read(); - break; - case "meshRenderer": - instance.meshRenderer = reader.Read(); - break; - case "skinnedMeshRenderer": - instance.skinnedMeshRenderer = reader.Read(); - break; - case "useMeshMaterialIndex": - instance.useMeshMaterialIndex = reader.Read(ES3Type_bool.Instance); - break; - case "meshMaterialIndex": - instance.meshMaterialIndex = reader.Read(ES3Type_int.Instance); - break; - case "useMeshColors": - instance.useMeshColors = reader.Read(ES3Type_bool.Instance); - break; - case "normalOffset": - instance.normalOffset = reader.Read(ES3Type_float.Instance); - break; - case "arc": - instance.arc = reader.Read(ES3Type_float.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ShapeModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ShapeModule.cs.meta deleted file mode 100644 index a9a4b21..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_ShapeModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 238b82f3d73ce4b4ebeb3a5c22eff5e9 -timeCreated: 1519132281 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SizeBySpeedModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SizeBySpeedModule.cs deleted file mode 100644 index 116199f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SizeBySpeedModule.cs +++ /dev/null @@ -1,90 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "size", "sizeMultiplier", "x", "xMultiplier", "y", "yMultiplier", "z", "zMultiplier", "separateAxes", "range")] - public class ES3Type_SizeBySpeedModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_SizeBySpeedModule() : base(typeof(ParticleSystem.SizeBySpeedModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.SizeBySpeedModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("size", instance.size, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("sizeMultiplier", instance.sizeMultiplier, ES3Type_float.Instance); - writer.WriteProperty("x", instance.x, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("xMultiplier", instance.xMultiplier, ES3Type_float.Instance); - writer.WriteProperty("y", instance.y, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("yMultiplier", instance.yMultiplier, ES3Type_float.Instance); - writer.WriteProperty("z", instance.z, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("zMultiplier", instance.zMultiplier, ES3Type_float.Instance); - writer.WriteProperty("separateAxes", instance.separateAxes, ES3Type_bool.Instance); - writer.WriteProperty("range", instance.range, ES3Type_Vector2.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.SizeBySpeedModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.SizeBySpeedModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "size": - instance.size = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "sizeMultiplier": - instance.sizeMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "x": - instance.x = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "xMultiplier": - instance.xMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "y": - instance.y = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "yMultiplier": - instance.yMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "z": - instance.z = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "zMultiplier": - instance.zMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "separateAxes": - instance.separateAxes = reader.Read(ES3Type_bool.Instance); - break; - case "range": - instance.range = reader.Read(ES3Type_Vector2.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SizeBySpeedModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SizeBySpeedModule.cs.meta deleted file mode 100644 index 9a3e3e9..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SizeBySpeedModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 553dbccc70c984444a8e1e4fb140acaa -timeCreated: 1519132285 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SizeOverLifetimeModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SizeOverLifetimeModule.cs deleted file mode 100644 index 0f75b6e..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SizeOverLifetimeModule.cs +++ /dev/null @@ -1,86 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "size", "sizeMultiplier", "x", "xMultiplier", "y", "yMultiplier", "z", "zMultiplier", "separateAxes")] - public class ES3Type_SizeOverLifetimeModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_SizeOverLifetimeModule() : base(typeof(ParticleSystem.SizeOverLifetimeModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.SizeOverLifetimeModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("size", instance.size, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("sizeMultiplier", instance.sizeMultiplier, ES3Type_float.Instance); - writer.WriteProperty("x", instance.x, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("xMultiplier", instance.xMultiplier, ES3Type_float.Instance); - writer.WriteProperty("y", instance.y, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("yMultiplier", instance.yMultiplier, ES3Type_float.Instance); - writer.WriteProperty("z", instance.z, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("zMultiplier", instance.zMultiplier, ES3Type_float.Instance); - writer.WriteProperty("separateAxes", instance.separateAxes, ES3Type_bool.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.SizeOverLifetimeModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.SizeOverLifetimeModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "size": - instance.size = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "sizeMultiplier": - instance.sizeMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "x": - instance.x = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "xMultiplier": - instance.xMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "y": - instance.y = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "yMultiplier": - instance.yMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "z": - instance.z = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "zMultiplier": - instance.zMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "separateAxes": - instance.separateAxes = reader.Read(ES3Type_bool.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SizeOverLifetimeModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SizeOverLifetimeModule.cs.meta deleted file mode 100644 index a1511c2..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SizeOverLifetimeModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 414f41e320e5f4be0a7aa4b39344c5e4 -timeCreated: 1519132284 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SkinnedMeshRenderer.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SkinnedMeshRenderer.cs deleted file mode 100644 index a26f28f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SkinnedMeshRenderer.cs +++ /dev/null @@ -1,160 +0,0 @@ -using ES3Internal; -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("bones", "rootBone", "quality", "sharedMesh", "updateWhenOffscreen", "skinnedMotionVectors", "localBounds", "enabled", "shadowCastingMode", "receiveShadows", "sharedMaterials", "lightmapIndex", "realtimeLightmapIndex", "lightmapScaleOffset", "motionVectorGenerationMode", "realtimeLightmapScaleOffset", "lightProbeUsage", "lightProbeProxyVolumeOverride", "probeAnchor", "reflectionProbeUsage", "sortingLayerName", "sortingLayerID", "sortingOrder")] - public class ES3Type_SkinnedMeshRenderer : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_SkinnedMeshRenderer() : base(typeof(SkinnedMeshRenderer)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (SkinnedMeshRenderer)obj; - - writer.WriteProperty("bones", instance.bones); - writer.WriteProperty("rootBone", instance.rootBone); - writer.WriteProperty("quality", instance.quality); - writer.WriteProperty("sharedMesh", instance.sharedMesh); - writer.WriteProperty("updateWhenOffscreen", instance.updateWhenOffscreen, ES3Type_bool.Instance); - writer.WriteProperty("skinnedMotionVectors", instance.skinnedMotionVectors, ES3Type_bool.Instance); - writer.WriteProperty("localBounds", instance.localBounds, ES3Type_Bounds.Instance); - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("shadowCastingMode", instance.shadowCastingMode); - writer.WriteProperty("receiveShadows", instance.receiveShadows, ES3Type_bool.Instance); - writer.WriteProperty("sharedMaterials", instance.sharedMaterials); - writer.WriteProperty("lightmapIndex", instance.lightmapIndex, ES3Type_int.Instance); - writer.WriteProperty("realtimeLightmapIndex", instance.realtimeLightmapIndex, ES3Type_int.Instance); - writer.WriteProperty("lightmapScaleOffset", instance.lightmapScaleOffset, ES3Type_Vector4.Instance); - writer.WriteProperty("motionVectorGenerationMode", instance.motionVectorGenerationMode); - writer.WriteProperty("realtimeLightmapScaleOffset", instance.realtimeLightmapScaleOffset, ES3Type_Vector4.Instance); - writer.WriteProperty("lightProbeUsage", instance.lightProbeUsage); - writer.WriteProperty("lightProbeProxyVolumeOverride", instance.lightProbeProxyVolumeOverride); - writer.WriteProperty("probeAnchor", instance.probeAnchor); - writer.WriteProperty("reflectionProbeUsage", instance.reflectionProbeUsage); - writer.WriteProperty("sortingLayerName", instance.sortingLayerName, ES3Type_string.Instance); - writer.WriteProperty("sortingLayerID", instance.sortingLayerID, ES3Type_int.Instance); - writer.WriteProperty("sortingOrder", instance.sortingOrder, ES3Type_int.Instance); - - // Get BlendShapeWeights - if (instance.sharedMesh != null) - { - float[] blendShapeWeights = new float[instance.sharedMesh.blendShapeCount]; - for (int i = 0; i < blendShapeWeights.Length; i++) - blendShapeWeights[i] = instance.GetBlendShapeWeight(i); - writer.WriteProperty("blendShapeWeights", blendShapeWeights, ES3Type_floatArray.Instance); - } - - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (SkinnedMeshRenderer)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - - case "bones": - instance.bones = reader.Read(); - break; - case "rootBone": - instance.rootBone = reader.Read(ES3Type_Transform.Instance); - break; - case "quality": - instance.quality = reader.Read(); - break; - case "sharedMesh": - instance.sharedMesh = reader.Read(ES3Type_Mesh.Instance); - break; - case "updateWhenOffscreen": - instance.updateWhenOffscreen = reader.Read(ES3Type_bool.Instance); - break; - case "skinnedMotionVectors": - instance.skinnedMotionVectors = reader.Read(ES3Type_bool.Instance); - break; - case "localBounds": - instance.localBounds = reader.Read(ES3Type_Bounds.Instance); - break; - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "shadowCastingMode": - instance.shadowCastingMode = reader.Read(); - break; - case "receiveShadows": - instance.receiveShadows = reader.Read(ES3Type_bool.Instance); - break; - case "sharedMaterials": - instance.sharedMaterials = reader.Read(); - break; - case "lightmapIndex": - instance.lightmapIndex = reader.Read(ES3Type_int.Instance); - break; - case "realtimeLightmapIndex": - instance.realtimeLightmapIndex = reader.Read(ES3Type_int.Instance); - break; - case "lightmapScaleOffset": - instance.lightmapScaleOffset = reader.Read(ES3Type_Vector4.Instance); - break; - case "motionVectorGenerationMode": - instance.motionVectorGenerationMode = reader.Read(); - break; - case "realtimeLightmapScaleOffset": - instance.realtimeLightmapScaleOffset = reader.Read(ES3Type_Vector4.Instance); - break; - case "lightProbeUsage": - instance.lightProbeUsage = reader.Read(); - break; - case "lightProbeProxyVolumeOverride": - instance.lightProbeProxyVolumeOverride = reader.Read(ES3Type_GameObject.Instance); - break; - case "probeAnchor": - instance.probeAnchor = reader.Read(ES3Type_Transform.Instance); - break; - case "reflectionProbeUsage": - instance.reflectionProbeUsage = reader.Read(); - break; - case "sortingLayerName": - instance.sortingLayerName = reader.Read(ES3Type_string.Instance); - break; - case "sortingLayerID": - instance.sortingLayerID = reader.Read(ES3Type_int.Instance); - break; - case "sortingOrder": - instance.sortingOrder = reader.Read(ES3Type_int.Instance); - break; - case "blendShapeWeights": - float[] blendShapeWeights = reader.Read(ES3Type_floatArray.Instance); - if (instance.sharedMesh == null) break; - if (blendShapeWeights.Length != instance.sharedMesh.blendShapeCount) - ES3Debug.LogError("The number of blend shape weights we are loading does not match the number of blend shapes in this SkinnedMeshRenderer's Mesh"); - for (int i = 0; i < blendShapeWeights.Length; i++) - instance.SetBlendShapeWeight(i, blendShapeWeights[i]); - break; - default: - reader.Skip(); - break; - } - } - } - } - - public class ES3Type_SkinnedMeshRendererArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_SkinnedMeshRendererArray() : base(typeof(SkinnedMeshRenderer[]), ES3Type_SkinnedMeshRenderer.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SkinnedMeshRenderer.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SkinnedMeshRenderer.cs.meta deleted file mode 100644 index be24b9c..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SkinnedMeshRenderer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c60a9d4280a1740059c9784d75d00ad9 -timeCreated: 1519132296 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Sprite.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Sprite.cs deleted file mode 100644 index 70cc4ca..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Sprite.cs +++ /dev/null @@ -1,69 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("texture", "rect", "pivot", "pixelsPerUnit", "border")] - public class ES3Type_Sprite : ES3UnityObjectType - { - public static ES3Type Instance; - - public ES3Type_Sprite() : base(typeof(Sprite)) { Instance = this; } - - protected override void WriteUnityObject(object obj, ES3Writer writer) - { - var instance = (Sprite)obj; - - writer.WriteProperty("texture", instance.texture, ES3Type_Texture2D.Instance); - writer.WriteProperty("rect", instance.rect, ES3Type_Rect.Instance); - // Pivot value is in pixels, but we require a normalised pivot when using Sprite.Create during loading, so we normalise it here. - writer.WriteProperty("pivot", new Vector2(instance.pivot.x / instance.texture.width, instance.pivot.y / instance.texture.height), ES3Type_Vector2.Instance); - writer.WriteProperty("pixelsPerUnit", instance.pixelsPerUnit, ES3Type_float.Instance); - writer.WriteProperty("border", instance.border, ES3Type_Vector4.Instance); - } - - protected override void ReadUnityObject(ES3Reader reader, object obj) - { - foreach (string propertyName in reader.Properties) - reader.Skip(); - } - - protected override object ReadUnityObject(ES3Reader reader) - { - Texture2D texture = null; - var rect = Rect.zero; - var pivot = Vector2.zero; - float pixelsPerUnit = 0; - var border = Vector4.zero; - - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case "texture": - texture = reader.Read(ES3Type_Texture2D.Instance); - break; - case "textureRect": - case "rect": - rect = reader.Read(ES3Type_Rect.Instance); - break; - case "pivot": - pivot = reader.Read(ES3Type_Vector2.Instance); - break; - case "pixelsPerUnit": - pixelsPerUnit = reader.Read(ES3Type_float.Instance); - break; - case "border": - border = reader.Read(ES3Type_Vector4.Instance); - break; - default: - reader.Skip(); - break; - } - } - - return Sprite.Create(texture, rect, pivot, pixelsPerUnit, 0, SpriteMeshType.Tight, border); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Sprite.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Sprite.cs.meta deleted file mode 100644 index 24da62d..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Sprite.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: dd9947bd586c04b26ae52e608a032be9 -timeCreated: 1519132298 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SpriteRenderer.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SpriteRenderer.cs deleted file mode 100644 index 23c2978..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SpriteRenderer.cs +++ /dev/null @@ -1,128 +0,0 @@ -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("sprite", "color", "flipX", "flipY", "enabled", "shadowCastingMode", "receiveShadows", "sharedMaterials", "lightmapIndex", "realtimeLightmapIndex", "lightmapScaleOffset", "motionVectorGenerationMode", "realtimeLightmapScaleOffset", "lightProbeUsage", "lightProbeProxyVolumeOverride", "probeAnchor", "reflectionProbeUsage", "sortingLayerName", "sortingLayerID", "sortingOrder")] - public class ES3Type_SpriteRenderer : ES3ComponentType - { - public static ES3Type Instance; - - public ES3Type_SpriteRenderer() : base(typeof(SpriteRenderer)) - { - Instance = this; - } - - protected override void WriteComponent(object obj, ES3Writer writer) - { - var instance = (SpriteRenderer)obj; - - writer.WriteProperty("sprite", instance.sprite); - writer.WriteProperty("color", instance.color, ES3Type_Color.Instance); - writer.WriteProperty("flipX", instance.flipX, ES3Type_bool.Instance); - writer.WriteProperty("flipY", instance.flipY, ES3Type_bool.Instance); - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("shadowCastingMode", instance.shadowCastingMode); - writer.WriteProperty("receiveShadows", instance.receiveShadows, ES3Type_bool.Instance); - writer.WriteProperty("sharedMaterials", instance.sharedMaterials); - writer.WriteProperty("lightmapIndex", instance.lightmapIndex, ES3Type_int.Instance); - writer.WriteProperty("realtimeLightmapIndex", instance.realtimeLightmapIndex, ES3Type_int.Instance); - writer.WriteProperty("lightmapScaleOffset", instance.lightmapScaleOffset, ES3Type_Vector4.Instance); - writer.WriteProperty("motionVectorGenerationMode", instance.motionVectorGenerationMode); - writer.WriteProperty("realtimeLightmapScaleOffset", instance.realtimeLightmapScaleOffset, ES3Type_Vector4.Instance); - writer.WriteProperty("lightProbeUsage", instance.lightProbeUsage); - writer.WriteProperty("lightProbeProxyVolumeOverride", instance.lightProbeProxyVolumeOverride, ES3Type_GameObject.Instance); - writer.WriteProperty("probeAnchor", instance.probeAnchor, ES3Type_Transform.Instance); - writer.WriteProperty("reflectionProbeUsage", instance.reflectionProbeUsage); - writer.WriteProperty("sortingLayerName", instance.sortingLayerName, ES3Type_string.Instance); - writer.WriteProperty("sortingLayerID", instance.sortingLayerID, ES3Type_int.Instance); - writer.WriteProperty("sortingOrder", instance.sortingOrder, ES3Type_int.Instance); - } - - protected override void ReadComponent(ES3Reader reader, object obj) - { - var instance = (SpriteRenderer)obj; - foreach (string propertyName in reader.Properties) - { - switch (propertyName) - { - case "sprite": - instance.sprite = reader.Read(ES3Type_Sprite.Instance); - break; - case "color": - instance.color = reader.Read(ES3Type_Color.Instance); - break; - case "flipX": - instance.flipX = reader.Read(ES3Type_bool.Instance); - break; - case "flipY": - instance.flipY = reader.Read(ES3Type_bool.Instance); - break; - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "shadowCastingMode": - instance.shadowCastingMode = reader.Read(); - break; - case "receiveShadows": - instance.receiveShadows = reader.Read(ES3Type_bool.Instance); - break; - case "sharedMaterials": - instance.sharedMaterials = reader.Read(); - break; - case "lightmapIndex": - instance.lightmapIndex = reader.Read(ES3Type_int.Instance); - break; - case "realtimeLightmapIndex": - instance.realtimeLightmapIndex = reader.Read(ES3Type_int.Instance); - break; - case "lightmapScaleOffset": - instance.lightmapScaleOffset = reader.Read(ES3Type_Vector4.Instance); - break; - case "motionVectorGenerationMode": - instance.motionVectorGenerationMode = reader.Read(); - break; - case "realtimeLightmapScaleOffset": - instance.realtimeLightmapScaleOffset = reader.Read(ES3Type_Vector4.Instance); - break; - case "lightProbeUsage": - instance.lightProbeUsage = reader.Read(); - break; - case "lightProbeProxyVolumeOverride": - instance.lightProbeProxyVolumeOverride = reader.Read(ES3Type_GameObject.Instance); - break; - case "probeAnchor": - instance.probeAnchor = reader.Read(ES3Type_Transform.Instance); - break; - case "reflectionProbeUsage": - instance.reflectionProbeUsage = reader.Read(); - break; - case "sortingLayerName": - instance.sortingLayerName = reader.Read(ES3Type_string.Instance); - break; - case "sortingLayerID": - instance.sortingLayerID = reader.Read(ES3Type_int.Instance); - break; - case "sortingOrder": - instance.sortingOrder = reader.Read(ES3Type_int.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } - - public class ES3Type_SpriteRendererArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_SpriteRendererArray() : base(typeof(SpriteRenderer[]), ES3Type_SpriteRenderer.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SpriteRenderer.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SpriteRenderer.cs.meta deleted file mode 100644 index f5cf21b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SpriteRenderer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f9f81f5e14f124e78877586f0b733864 -timeCreated: 1519132301 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SubEmittersModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SubEmittersModule.cs deleted file mode 100644 index e56d52d..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SubEmittersModule.cs +++ /dev/null @@ -1,86 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("properties", "systems", "types")] - public class ES3Type_SubEmittersModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_SubEmittersModule() : base(typeof(ParticleSystem.SubEmittersModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.SubEmittersModule)obj; - - ParticleSystemSubEmitterProperties[] seProperties = new ParticleSystemSubEmitterProperties[instance.subEmittersCount]; - ParticleSystem[] seSystems = new ParticleSystem[instance.subEmittersCount]; - ParticleSystemSubEmitterType[] seTypes = new ParticleSystemSubEmitterType[instance.subEmittersCount]; - - for (int i = 0; i < instance.subEmittersCount; i++) - { - seProperties[i] = instance.GetSubEmitterProperties(i); - seSystems[i] = instance.GetSubEmitterSystem(i); - seTypes[i] = instance.GetSubEmitterType(i); - } - - writer.WriteProperty("properties", seProperties); - writer.WriteProperty("systems", seSystems); - writer.WriteProperty("types", seTypes); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.SubEmittersModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.SubEmittersModule)obj; - - ParticleSystemSubEmitterProperties[] seProperties = null; - ParticleSystem[] seSystems = null; - ParticleSystemSubEmitterType[] seTypes = null; - - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "properties": - seProperties = reader.Read(new ES3ArrayType(typeof(ParticleSystemSubEmitterProperties[]))); - break; - case "systems": - seSystems = reader.Read(); - break; - case "types": - seTypes = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - - if (seProperties != null) - { - for (int i = 0; i < seProperties.Length; i++) - { - instance.RemoveSubEmitter(i); - instance.AddSubEmitter(seSystems[i], seTypes[i], seProperties[i]); - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SubEmittersModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SubEmittersModule.cs.meta deleted file mode 100644 index 9dbb559..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_SubEmittersModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9cbb01bbb4bdc420fbb5b6621c3597ef -timeCreated: 1519132292 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Texture.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Texture.cs deleted file mode 100644 index b79c4dc..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Texture.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("filterMode", "anisoLevel", "wrapMode", "mipMapBias", "rawTextureData")] - public class ES3Type_Texture : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Texture() : base(typeof(Texture)) { Instance = this; } - - public override void Write(object obj, ES3Writer writer) - { - if (obj.GetType() == typeof(Texture2D)) - ES3Type_Texture2D.Instance.Write(obj, writer); - else - throw new NotSupportedException("Textures of type " + obj.GetType() + " are not currently supported."); - } - - public override void ReadInto(ES3Reader reader, object obj) - { - if (obj.GetType() == typeof(Texture2D)) - ES3Type_Texture2D.Instance.ReadInto(reader, obj); - else - throw new NotSupportedException("Textures of type " + obj.GetType() + " are not currently supported."); - } - - public override object Read(ES3Reader reader) - { - return ES3Type_Texture2D.Instance.Read(reader); - } - } - - public class ES3Type_TextureArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_TextureArray() : base(typeof(Texture[]), ES3Type_Texture.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Texture.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Texture.cs.meta deleted file mode 100644 index 7429668..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Texture.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 615cb2cf345144f858b56b5ff6690a9f -timeCreated: 1536306115 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Texture2D.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Texture2D.cs deleted file mode 100644 index feb0895..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Texture2D.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System; -using ES3Internal; -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("filterMode", "anisoLevel", "wrapMode", "mipMapBias", "rawTextureData")] - public class ES3Type_Texture2D : ES3UnityObjectType - { - public static ES3Type Instance; - - public ES3Type_Texture2D() : base(typeof(Texture2D)) { Instance = this; } - - protected override void WriteUnityObject(object obj, ES3Writer writer) - { - var instance = (Texture2D)obj; - - if (!IsReadable(instance)) - { - ES3Debug.LogWarning("Easy Save cannot save the pixels or properties of this Texture because it is not read/write enabled, so Easy Save will store it by reference instead. To save the pixel data, check the 'Read/Write Enabled' checkbox in the Texture's import settings. Clicking this warning will take you to the Texture, assuming it is not generated at runtime.", instance); - return; - } - - writer.WriteProperty("width", instance.width, ES3Type_int.Instance); - writer.WriteProperty("height", instance.height, ES3Type_int.Instance); - writer.WriteProperty("format", instance.format); - writer.WriteProperty("mipmapCount", instance.mipmapCount, ES3Type_int.Instance); - writer.WriteProperty("filterMode", instance.filterMode); - writer.WriteProperty("anisoLevel", instance.anisoLevel, ES3Type_int.Instance); - writer.WriteProperty("wrapMode", instance.wrapMode); - writer.WriteProperty("mipMapBias", instance.mipMapBias, ES3Type_float.Instance); - writer.WriteProperty("rawTextureData", instance.GetRawTextureData(), ES3Type_byteArray.Instance); - } - - protected override void ReadUnityObject(ES3Reader reader, object obj) - { - if (obj == null) - return; - - if (obj.GetType() == typeof(RenderTexture)) - { - ES3Type_RenderTexture.Instance.ReadInto(reader, obj); - return; - } - - var instance = (Texture2D)obj; - - if (!IsReadable(instance)) - ES3Debug.LogWarning("Easy Save cannot load the properties or pixels for this Texture because it is not read/write enabled, so it will be loaded by reference. To load the properties and pixels for this Texture, check the 'Read/Write Enabled' checkbox in its Import Settings.", instance); - - foreach (string propertyName in reader.Properties) - { - // If this Texture isn't readable, we should skip past all of its properties. - if (!IsReadable(instance)) - { - reader.Skip(); - continue; - } - - switch (propertyName) - { - case "filterMode": - instance.filterMode = reader.Read(); - break; - case "anisoLevel": - instance.anisoLevel = reader.Read(ES3Type_int.Instance); - break; - case "wrapMode": - instance.wrapMode = reader.Read(); - break; - case "mipMapBias": - instance.mipMapBias = reader.Read(ES3Type_float.Instance); - break; - case "rawTextureData": - // LoadRawTextureData requires that the correct width, height, TextureFormat and mipMaps are set before being called. - // If an error occurs here, it's likely that we're using LoadInto to load into a Texture which differs in these values. - // In this case, LoadInto should be avoided and Load should be used instead. - if (!IsReadable(instance)) - { - ES3Debug.LogWarning("Easy Save cannot load the pixels of this Texture because it is not read/write enabled, so Easy Save will ignore the pixel data. To load the pixel data, check the 'Read/Write Enabled' checkbox in the Texture's import settings. Clicking this warning will take you to the Texture, assuming it is not generated at runtime.", instance); - reader.Skip(); - } - else - { - try - { - instance.LoadRawTextureData(reader.Read(ES3Type_byteArray.Instance)); - instance.Apply(); - } - catch (Exception e) - { - ES3Debug.LogError("Easy Save encountered an error when trying to load this Texture, please see the end of this messasge for the error. This is most likely because the Texture format of the instance we are loading into is different to the Texture we saved.\n" + e, instance); - } - } - break; - default: - reader.Skip(); - break; - } - } - } - - protected override object ReadUnityObject(ES3Reader reader) - { - var instance = new Texture2D(reader.Read(ES3Type_int.Instance), // Property name has already been read in ES3UnityObjectType, so we only need to read the value. - reader.ReadProperty(ES3Type_int.Instance), - reader.ReadProperty(), - reader.ReadProperty(ES3Type_int.Instance) > 1); - ReadObject(reader, instance); - return instance; - } - - protected bool IsReadable(Texture2D instance) - { - #if UNITY_2018_3_OR_NEWER - return instance != null && instance.isReadable; - #else - return true; - #endif - } - } - - public class ES3Type_Texture2DArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_Texture2DArray() : base(typeof(Texture2D[]), ES3Type_Texture2D.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Texture2D.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Texture2D.cs.meta deleted file mode 100644 index 03717ba..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Texture2D.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 86d4ce7d016c24d0489778178716fa3d -timeCreated: 1519132290 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TextureSheetAnimationModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TextureSheetAnimationModule.cs deleted file mode 100644 index c109ac0..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TextureSheetAnimationModule.cs +++ /dev/null @@ -1,113 +0,0 @@ -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "numTilesX", "numTilesY", "animation", "useRandomRow", "frameOverTime", "frameOverTimeMultiplier", "startFrame", "startFrameMultiplier", "cycleCount", "rowIndex", "uvChannelMask", "flipU", "flipV")] - public class ES3Type_TextureSheetAnimationModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_TextureSheetAnimationModule() : base(typeof(ParticleSystem.TextureSheetAnimationModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.TextureSheetAnimationModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("numTilesX", instance.numTilesX, ES3Type_int.Instance); - writer.WriteProperty("numTilesY", instance.numTilesY, ES3Type_int.Instance); - writer.WriteProperty("animation", instance.animation); -#if UNITY_2019_1_OR_NEWER - writer.WriteProperty("useRandomRow", instance.rowMode); -#else - writer.WriteProperty("useRandomRow", instance.useRandomRow, ES3Type_bool.Instance); -#endif - writer.WriteProperty("frameOverTime", instance.frameOverTime, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("frameOverTimeMultiplier", instance.frameOverTimeMultiplier, ES3Type_float.Instance); - writer.WriteProperty("startFrame", instance.startFrame, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("startFrameMultiplier", instance.startFrameMultiplier, ES3Type_float.Instance); - writer.WriteProperty("cycleCount", instance.cycleCount, ES3Type_int.Instance); - writer.WriteProperty("rowIndex", instance.rowIndex, ES3Type_int.Instance); - writer.WriteProperty("uvChannelMask", instance.uvChannelMask); - //writer.WriteProperty("flipU", instance.flipU, ES3Type_float.Instance); - //writer.WriteProperty("flipV", instance.flipV, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.TextureSheetAnimationModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.TextureSheetAnimationModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "numTilesX": - instance.numTilesX = reader.Read(ES3Type_int.Instance); - break; - case "numTilesY": - instance.numTilesY = reader.Read(ES3Type_int.Instance); - break; - case "animation": - instance.animation = reader.Read(); - break; -#if UNITY_2019_1_OR_NEWER - case "rowMode": - instance.rowMode = reader.Read(); - break; -#else - case "useRandomRow": - instance.useRandomRow = reader.Read(ES3Type_bool.Instance); - break; -#endif - case "frameOverTime": - instance.frameOverTime = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "frameOverTimeMultiplier": - instance.frameOverTimeMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "startFrame": - instance.startFrame = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "startFrameMultiplier": - instance.startFrameMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "cycleCount": - instance.cycleCount = reader.Read(ES3Type_int.Instance); - break; - case "rowIndex": - instance.rowIndex = reader.Read(ES3Type_int.Instance); - break; - case "uvChannelMask": - instance.uvChannelMask = reader.Read(); - break; - /*case "flipU": - instance.flipU = reader.Read(ES3Type_float.Instance); - break; - case "flipV": - instance.flipV = reader.Read(ES3Type_float.Instance); - break;*/ - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TextureSheetAnimationModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TextureSheetAnimationModule.cs.meta deleted file mode 100644 index 9f58775..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TextureSheetAnimationModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 059be233c84494c01be9f48a8be8e89e -timeCreated: 1519132279 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TrailModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TrailModule.cs deleted file mode 100644 index 299d16b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TrailModule.cs +++ /dev/null @@ -1,106 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "ratio", "lifetime", "lifetimeMultiplier", "minVertexDistance", "textureMode", "worldSpace", "dieWithParticles", "sizeAffectsWidth", "sizeAffectsLifetime", "inheritParticleColor", "colorOverLifetime", "widthOverTrail", "widthOverTrailMultiplier", "colorOverTrail")] - public class ES3Type_TrailModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_TrailModule() : base(typeof(ParticleSystem.TrailModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.TrailModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("ratio", instance.ratio, ES3Type_float.Instance); - writer.WriteProperty("lifetime", instance.lifetime, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("lifetimeMultiplier", instance.lifetimeMultiplier, ES3Type_float.Instance); - writer.WriteProperty("minVertexDistance", instance.minVertexDistance, ES3Type_float.Instance); - writer.WriteProperty("textureMode", instance.textureMode); - writer.WriteProperty("worldSpace", instance.worldSpace, ES3Type_bool.Instance); - writer.WriteProperty("dieWithParticles", instance.dieWithParticles, ES3Type_bool.Instance); - writer.WriteProperty("sizeAffectsWidth", instance.sizeAffectsWidth, ES3Type_bool.Instance); - writer.WriteProperty("sizeAffectsLifetime", instance.sizeAffectsLifetime, ES3Type_bool.Instance); - writer.WriteProperty("inheritParticleColor", instance.inheritParticleColor, ES3Type_bool.Instance); - writer.WriteProperty("colorOverLifetime", instance.colorOverLifetime, ES3Type_MinMaxGradient.Instance); - writer.WriteProperty("widthOverTrail", instance.widthOverTrail, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("widthOverTrailMultiplier", instance.widthOverTrailMultiplier, ES3Type_float.Instance); - writer.WriteProperty("colorOverTrail", instance.colorOverTrail, ES3Type_MinMaxGradient.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.TrailModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.TrailModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "ratio": - instance.ratio = reader.Read(ES3Type_float.Instance); - break; - case "lifetime": - instance.lifetime = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "lifetimeMultiplier": - instance.lifetimeMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "minVertexDistance": - instance.minVertexDistance = reader.Read(ES3Type_float.Instance); - break; - case "textureMode": - instance.textureMode = reader.Read(); - break; - case "worldSpace": - instance.worldSpace = reader.Read(ES3Type_bool.Instance); - break; - case "dieWithParticles": - instance.dieWithParticles = reader.Read(ES3Type_bool.Instance); - break; - case "sizeAffectsWidth": - instance.sizeAffectsWidth = reader.Read(ES3Type_bool.Instance); - break; - case "sizeAffectsLifetime": - instance.sizeAffectsLifetime = reader.Read(ES3Type_bool.Instance); - break; - case "inheritParticleColor": - instance.inheritParticleColor = reader.Read(ES3Type_bool.Instance); - break; - case "colorOverLifetime": - instance.colorOverLifetime = reader.Read(ES3Type_MinMaxGradient.Instance); - break; - case "widthOverTrail": - instance.widthOverTrail = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "widthOverTrailMultiplier": - instance.widthOverTrailMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "colorOverTrail": - instance.colorOverTrail = reader.Read(ES3Type_MinMaxGradient.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TrailModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TrailModule.cs.meta deleted file mode 100644 index bdb0464..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TrailModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 56ad47761f46a452b84d1efde61de80c -timeCreated: 1519132285 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TriggerModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TriggerModule.cs deleted file mode 100644 index eeae568..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TriggerModule.cs +++ /dev/null @@ -1,70 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "inside", "outside", "enter", "exit", "radiusScale")] - public class ES3Type_TriggerModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_TriggerModule() : base(typeof(ParticleSystem.TriggerModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.TriggerModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("inside", instance.inside); - writer.WriteProperty("outside", instance.outside); - writer.WriteProperty("enter", instance.enter); - writer.WriteProperty("exit", instance.exit); - writer.WriteProperty("radiusScale", instance.radiusScale, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.TriggerModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.TriggerModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "inside": - instance.inside = reader.Read(); - break; - case "outside": - instance.outside = reader.Read(); - break; - case "enter": - instance.enter = reader.Read(); - break; - case "exit": - instance.exit = reader.Read(); - break; - case "radiusScale": - instance.radiusScale = reader.Read(ES3Type_float.Instance); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TriggerModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TriggerModule.cs.meta deleted file mode 100644 index 9aed376..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_TriggerModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7cf3d6f533d04498fb0601796570f998 -timeCreated: 1519132289 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector2.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector2.cs deleted file mode 100644 index 4be8e34..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector2.cs +++ /dev/null @@ -1,40 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("x", "y")] - public class ES3Type_Vector2 : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Vector2() : base(typeof(Vector2)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var casted = (Vector2)obj; - writer.WriteProperty("x", casted.x, ES3Type_float.Instance); - writer.WriteProperty("y", casted.y, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - return new Vector2(reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance)); - } - } - - public class ES3Type_Vector2Array : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_Vector2Array() : base(typeof(Vector2[]), ES3Type_Vector2.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector2.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector2.cs.meta deleted file mode 100644 index 6d94ec3..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector2.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6cdccaf6dcab94e45931bf15d2a90640 -timeCreated: 1519132287 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector2Int.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector2Int.cs deleted file mode 100644 index 50538a0..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector2Int.cs +++ /dev/null @@ -1,42 +0,0 @@ -#if UNITY_2017_2_OR_NEWER -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("x", "y")] - public class ES3Type_Vector2Int : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Vector2Int() : base(typeof(Vector2Int)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var casted = (Vector2Int)obj; - writer.WriteProperty("x", casted.x, ES3Type_int.Instance); - writer.WriteProperty("y", casted.y, ES3Type_int.Instance); - } - - public override object Read(ES3Reader reader) - { - return new Vector2Int(reader.ReadProperty(ES3Type_int.Instance), - reader.ReadProperty(ES3Type_int.Instance)); - } - } - - public class ES3Type_Vector2IntArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_Vector2IntArray() : base(typeof(Vector2Int[]), ES3Type_Vector2Int.Instance) - { - Instance = this; - } - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector2Int.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector2Int.cs.meta deleted file mode 100644 index a8cc143..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector2Int.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d4ce5526a479a4cdab37fa9c10dc3964 -timeCreated: 1519132287 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector3.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector3.cs deleted file mode 100644 index 90dfe14..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector3.cs +++ /dev/null @@ -1,42 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3Properties("x", "y", "z")] - public class ES3Type_Vector3 : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Vector3() : base(typeof(Vector3)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var casted = (Vector3)obj; - writer.WriteProperty("x", casted.x, ES3Type_float.Instance); - writer.WriteProperty("y", casted.y, ES3Type_float.Instance); - writer.WriteProperty("z", casted.z, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - return new Vector3(reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance)); - } - } - - public class ES3Type_Vector3Array : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_Vector3Array() : base(typeof(Vector3[]), ES3Type_Vector3.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector3.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector3.cs.meta deleted file mode 100644 index 80e53bb..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector3.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 65ba0614942de49678702985ca4ca357 -timeCreated: 1519132287 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector3Int.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector3Int.cs deleted file mode 100644 index 9e367f6..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector3Int.cs +++ /dev/null @@ -1,44 +0,0 @@ -#if UNITY_2017_2_OR_NEWER -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("x", "y", "z")] - public class ES3Type_Vector3Int : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Vector3Int() : base(typeof(Vector3Int)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var casted = (Vector3Int)obj; - writer.WriteProperty("x", casted.x, ES3Type_int.Instance); - writer.WriteProperty("y", casted.y, ES3Type_int.Instance); - writer.WriteProperty("z", casted.z, ES3Type_int.Instance); - } - - public override object Read(ES3Reader reader) - { - return new Vector3Int(reader.ReadProperty(ES3Type_int.Instance), - reader.ReadProperty(ES3Type_int.Instance), - reader.ReadProperty(ES3Type_int.Instance)); - } - } - - public class ES3Type_Vector3IntArray : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_Vector3IntArray() : base(typeof(Vector3Int[]), ES3Type_Vector3Int.Instance) - { - Instance = this; - } - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector3Int.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector3Int.cs.meta deleted file mode 100644 index cf4d455..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector3Int.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7e3a1d8e6e8144f71a61562fc86b2b2c -timeCreated: 1519132287 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector4.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector4.cs deleted file mode 100644 index fdaffb7..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector4.cs +++ /dev/null @@ -1,49 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("x", "y", "z", "w")] - public class ES3Type_Vector4 : ES3Type - { - public static ES3Type Instance; - - public ES3Type_Vector4() : base(typeof(Vector4)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var casted = (Vector4)obj; - writer.WriteProperty("x", casted.x, ES3Type_float.Instance); - writer.WriteProperty("y", casted.y, ES3Type_float.Instance); - writer.WriteProperty("z", casted.z, ES3Type_float.Instance); - writer.WriteProperty("w", casted.w, ES3Type_float.Instance); - } - - public override object Read(ES3Reader reader) - { - return new Vector4(reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance), - reader.ReadProperty(ES3Type_float.Instance)); - } - - public static bool Equals(Vector4 a, Vector4 b) - { - return Mathf.Approximately(a.x, b.x) && Mathf.Approximately(a.y, b.y) && Mathf.Approximately(a.z, b.z) && Mathf.Approximately(a.w, b.w); - } - } - - public class ES3Type_Vector4Array : ES3ArrayType - { - public static ES3Type Instance; - - public ES3Type_Vector4Array() : base(typeof(Vector4[]), ES3Type_Vector4.Instance) - { - Instance = this; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector4.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector4.cs.meta deleted file mode 100644 index 8b99b5c..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Vector4.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 970684b89a8e24102a42f02a5ed59a66 -timeCreated: 1519132292 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_VelocityOverLifetimeModule.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_VelocityOverLifetimeModule.cs deleted file mode 100644 index 1529f5f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_VelocityOverLifetimeModule.cs +++ /dev/null @@ -1,77 +0,0 @@ -using UnityEngine; -using UnityEngine.Scripting; - -namespace ES3Types -{ - [Preserve] - [ES3PropertiesAttribute("enabled", "x", "y", "z", "xMultiplier", "yMultiplier", "zMultiplier", "space")] - public class ES3Type_VelocityOverLifetimeModule : ES3Type - { - public static ES3Type Instance; - - public ES3Type_VelocityOverLifetimeModule() : base(typeof(ParticleSystem.VelocityOverLifetimeModule)) - { - Instance = this; - } - - public override void Write(object obj, ES3Writer writer) - { - var instance = (ParticleSystem.VelocityOverLifetimeModule)obj; - - writer.WriteProperty("enabled", instance.enabled, ES3Type_bool.Instance); - writer.WriteProperty("x", instance.x, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("y", instance.y, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("z", instance.z, ES3Type_MinMaxCurve.Instance); - writer.WriteProperty("xMultiplier", instance.xMultiplier, ES3Type_float.Instance); - writer.WriteProperty("yMultiplier", instance.yMultiplier, ES3Type_float.Instance); - writer.WriteProperty("zMultiplier", instance.zMultiplier, ES3Type_float.Instance); - writer.WriteProperty("space", instance.space); - } - - public override object Read(ES3Reader reader) - { - var instance = new ParticleSystem.VelocityOverLifetimeModule(); - ReadInto(reader, instance); - return instance; - } - - public override void ReadInto(ES3Reader reader, object obj) - { - var instance = (ParticleSystem.VelocityOverLifetimeModule)obj; - string propertyName; - while((propertyName = reader.ReadPropertyName()) != null) - { - switch (propertyName) - { - case "enabled": - instance.enabled = reader.Read(ES3Type_bool.Instance); - break; - case "x": - instance.x = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "y": - instance.y = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "z": - instance.z = reader.Read(ES3Type_MinMaxCurve.Instance); - break; - case "xMultiplier": - instance.xMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "yMultiplier": - instance.yMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "zMultiplier": - instance.zMultiplier = reader.Read(ES3Type_float.Instance); - break; - case "space": - instance.space = reader.Read(); - break; - default: - reader.Skip(); - break; - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_VelocityOverLifetimeModule.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_VelocityOverLifetimeModule.cs.meta deleted file mode 100644 index a344c8b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_VelocityOverLifetimeModule.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a4884364ae36a4916a8bc2bd6e5e9683 -timeCreated: 1519132293 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/UnityObjectType.cs b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/UnityObjectType.cs deleted file mode 100644 index 4fe4470..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/UnityObjectType.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -public class UnityObjectType : MonoBehaviour -{ - public List objs; // Assign to this in the Editor - - private void Start() - { - if (!ES3.KeyExists("this")) - ES3.Save("this", this); - else - ES3.LoadInto("this", this); - - foreach (var obj in objs) - Debug.Log(obj); - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/UnityObjectType.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/UnityObjectType.cs.meta deleted file mode 100644 index 412fb55..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/UnityObjectType.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 871617aa2d4bcfe428d9625de50b8f65 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Web.meta b/Assets/Plugins/Easy Save 3/Scripts/Web.meta deleted file mode 100644 index 454424f..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Web.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: a31790717a932467d825f30d95c413bb -folderAsset: yes -timeCreated: 1500448038 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Web/ES3Cloud.cs b/Assets/Plugins/Easy Save 3/Scripts/Web/ES3Cloud.cs deleted file mode 100644 index ddbe376..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Web/ES3Cloud.cs +++ /dev/null @@ -1,864 +0,0 @@ -#if !DISABLE_WEB -using System; -using System.Collections; -using System.Text; -using ES3Internal; -using Unity.VisualScripting; -using UnityEngine.Networking; -#if UNITY_VISUAL_SCRIPTING -[IncludeInSettings(true)] -#elif BOLT_VISUAL_SCRIPTING -[Ludiq.IncludeInSettings(true)] -#endif -public class ES3Cloud : ES3WebClass -{ - private readonly int timeout = 20; - - /// Constructs an new ES3Cloud object with the given URL to an ES3.php file. - /// The URL of the ES3.php file on your server you want to use. - public ES3Cloud(string url, string apiKey) : base(url, apiKey) - { - } - - public ES3Cloud(string url, string apiKey, int timeout) : base(url, apiKey) - { - this.timeout = timeout; - } - - #region Downloaded Data Handling - - /// The encoding to use when encoding and decoding data as strings. - public Encoding encoding = Encoding.UTF8; - - - /// - /// Any downloaded data, if applicable. This may also contain an error message, so you should check the 'ifError' - /// variable before reading data. - /// - public byte[] data { get; private set; } - - /// The downloaded data as text, decoded using the encoding specified by the 'encoding' variable. - public string text - { - get - { - if (data == null) - return null; - return encoding.GetString(data); - } - } - - /// - /// An array of filenames downloaded from the server. This must only be accessed after calling the - /// 'DownloadFilenames' routine. - /// - public string[] filenames - { - get - { - if (data == null || data.Length == 0) - return new string[0]; - return text.Split(new[] - { - ';' - }, StringSplitOptions.RemoveEmptyEntries); - } - - } - - /// - /// A UTC DateTime object representing the date and time a file on the server was last updated. This should only - /// be called after calling the 'DownloadTimestamp' routine. - /// - public DateTime timestamp - { - get - { - if (data == null || data.Length == 0) - return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); - - double timestamp; - if (!double.TryParse(text, out timestamp)) - throw new FormatException("Could not convert downloaded data to a timestamp. Data downloaded was: " + text); - - return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddSeconds(timestamp); - } - } - - #endregion - - #region Sync - - /// - /// Synchronises the default file with a file on the server. If the file on the server is newer than the local - /// copy, the local file will be overwritten by the file on the server. Otherwise, the file on the server will be - /// overwritten. - /// - public IEnumerator Sync() - { - return Sync(new ES3Settings(), "", ""); - } - - /// - /// Synchronises a local file with a file on the server. If the file on the server is newer than the local copy, - /// the local file will be overwritten by the file on the server. Otherwise, the file on the server will be - /// overwritten. - /// - /// The relative or absolute path of the local file we want to synchronise. - public IEnumerator Sync(string filePath) - { - return Sync(new ES3Settings(filePath), "", ""); - } - - /// - /// Synchronises a local file with a file on the server. If the file on the server is newer than the local copy, - /// the local file will be overwritten by the file on the server. Otherwise, the file on the server will be - /// overwritten. - /// - /// The relative or absolute path of the local file we want to synchronise. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - public IEnumerator Sync(string filePath, string user) - { - return Sync(new ES3Settings(filePath), user, ""); - } - - /// - /// Synchronises a local file with a file on the server. If the file on the server is newer than the local copy, - /// the local file will be overwritten by the file on the server. Otherwise, the file on the server will be - /// overwritten. - /// - /// The relative or absolute path of the local file we want to synchronise. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - public IEnumerator Sync(string filePath, string user, string password) - { - return Sync(new ES3Settings(filePath), user, password); - } - - /// - /// Synchronises a local file with a file on the server. If the file on the server is newer than the local copy, - /// the local file will be overwritten by the file on the server. Otherwise, the file on the server will be - /// overwritten. - /// - /// The relative or absolute path of the local file we want to synchronise. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - /// The settings we want to use to override the default settings. - public IEnumerator Sync(string filePath, ES3Settings settings) - { - return Sync(new ES3Settings(filePath, settings), "", ""); - } - - /// - /// Synchronises a local file with a file on the server. If the file on the server is newer than the local copy, - /// the local file will be overwritten by the file on the server. Otherwise, the file on the server will be - /// overwritten. - /// - /// The relative or absolute path of the file we want to use. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The settings we want to use to override the default settings. - public IEnumerator Sync(string filePath, string user, ES3Settings settings) - { - return Sync(new ES3Settings(filePath, settings), user, ""); - } - - /// - /// Synchronises a local file with a file on the server. If the file on the server is newer than the local copy, - /// the local file will be overwritten by the file on the server. Otherwise, the file on the server will be - /// overwritten. - /// - /// The relative or absolute path of the local file we want to synchronise. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - /// The settings we want to use to override the default settings. - public IEnumerator Sync(string filePath, string user, string password, ES3Settings settings) - { - return Sync(new ES3Settings(filePath, settings), user, password); - } - - /// - /// Synchronises a local file with a file on the server. If the file on the server is newer than the local copy, - /// the local file will be overwritten by the file on the server. Otherwise, the file on the server will be - /// overwritten. - /// - /// The settings we want to use to override the default settings. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - private IEnumerator Sync(ES3Settings settings, string user, string password) - { - Reset(); - - yield return DownloadFile(settings, user, password, GetFileTimestamp(settings)); - - if (errorCode == 3) - { - // Clear the error. - Reset(); - - // File does not exist on server, or is older than locally stored data, so upload the local file to the server if it exists. - if (ES3.FileExists(settings)) - yield return UploadFile(settings, user, password); - } - - isDone = true; - } - - #endregion - - #region UploadFile - - /// Uploads the default file to the server, overwriting any existing file. - public IEnumerator UploadFile() - { - return UploadFile(new ES3Settings(), "", ""); - } - - /// Uploads a local file to the server, overwriting any existing file. - /// The relative or absolute path of the file we want to use. - public IEnumerator UploadFile(string filePath) - { - return UploadFile(new ES3Settings(filePath), "", ""); - } - - /// Uploads a local file to the server, overwriting any existing file. - /// The relative or absolute path of the file we want to use. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - public IEnumerator UploadFile(string filePath, string user) - { - return UploadFile(new ES3Settings(filePath), user, ""); - } - - /// Uploads a local file to the server, overwriting any existing file. - /// The relative or absolute path of the file we want to use. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - public IEnumerator UploadFile(string filePath, string user, string password) - { - return UploadFile(new ES3Settings(filePath), user, password); - } - - /// Uploads a local file to the server, overwriting any existing file. - /// The relative or absolute path of the file we want to use. - /// The settings we want to use to override the default settings. - public IEnumerator UploadFile(string filePath, ES3Settings settings) - { - return UploadFile(new ES3Settings(filePath, settings), "", ""); - } - - /// Uploads a local file to the server, overwriting any existing file. - /// The relative or absolute path of the file we want to use. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The settings we want to use to override the default settings. - public IEnumerator UploadFile(string filePath, string user, ES3Settings settings) - { - return UploadFile(new ES3Settings(filePath, settings), user, ""); - } - - /// Uploads a local file to the server, overwriting any existing file. - /// The relative or absolute path of the file we want to use. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - /// The settings we want to use to override the default settings. - public IEnumerator UploadFile(string filePath, string user, string password, ES3Settings settings) - { - return UploadFile(new ES3Settings(filePath, settings), user, password); - } - - /// Uploads a local file to the server, overwriting any existing file. - /// An ES3File containing the data we want to upload. - public IEnumerator UploadFile(ES3File es3File) - { - return UploadFile(es3File.GetBytes(), es3File.settings, "", "", DateTimeToUnixTimestamp(DateTime.Now)); - } - - /// Uploads a local file to the server, overwriting any existing file. - /// An ES3File containing the data we want to upload. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - public IEnumerator UploadFile(ES3File es3File, string user) - { - return UploadFile(es3File.GetBytes(), es3File.settings, user, "", DateTimeToUnixTimestamp(DateTime.Now)); - } - - /// Uploads a local file to the server, overwriting any existing file. - /// An ES3File containing the data we want to upload. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - public IEnumerator UploadFile(ES3File es3File, string user, string password) - { - return UploadFile(es3File.GetBytes(), es3File.settings, user, password, DateTimeToUnixTimestamp(DateTime.Now)); - } - - /// Uploads a local file to the server, overwriting any existing file. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - public IEnumerator UploadFile(ES3Settings settings, string user, string password) - { - return UploadFile(ES3.LoadRawBytes(settings), settings, user, password); - } - - public IEnumerator UploadFile(byte[] bytes, ES3Settings settings, string user, string password) - { - return UploadFile(bytes, settings, user, password, DateTimeToUnixTimestamp(ES3.GetTimestamp(settings))); - } - - private IEnumerator UploadFile(byte[] bytes, ES3Settings settings, string user, string password, long fileTimestamp) - { - Reset(); - - var form = CreateWWWForm(); - form.AddField("apiKey", apiKey); - form.AddField("putFile", settings.path); - form.AddField("timestamp", fileTimestamp.ToString()); - form.AddField("user", GetUser(user, password)); - form.AddBinaryData("data", bytes, "data.dat", "multipart/form-data"); - - using (var webRequest = UnityWebRequest.Post(url, form)) - { - webRequest.timeout = timeout; - yield return SendWebRequest(webRequest); - HandleError(webRequest, true); - } - - isDone = true; - } - - #endregion - - #region DownloadFile - - /// - /// Downloads the default file from the server and saves it locally, overwriting the existing local default file. - /// An error is returned if the file does not exist. - /// - public IEnumerator DownloadFile() - { - return DownloadFile(new ES3Settings(), "", "", 0); - } - - /// - /// Downloads a file from the server and saves it locally, overwriting any existing local file. An error is - /// returned if the file does not exist. - /// - /// The relative or absolute path of the file we want to download. - public IEnumerator DownloadFile(string filePath) - { - return DownloadFile(new ES3Settings(filePath), "", "", 0); - } - - /// - /// Downloads a file from the server and saves it locally, overwriting any existing local file. An error is - /// returned if the file does not exist. - /// - /// The relative or absolute path of the file we want to download. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - public IEnumerator DownloadFile(string filePath, string user) - { - return DownloadFile(new ES3Settings(filePath), user, "", 0); - } - - /// - /// Downloads a file from the server and saves it locally, overwriting any existing local file. An error is - /// returned if the file does not exist. - /// - /// The relative or absolute path of the file we want to download. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - public IEnumerator DownloadFile(string filePath, string user, string password) - { - return DownloadFile(new ES3Settings(filePath), user, password, 0); - } - - /// - /// Downloads a file from the server and saves it locally, overwriting any existing local file. An error is - /// returned if the file does not exist. - /// - /// The relative or absolute path of the file we want to download. - /// The settings we want to use to override the default settings. - public IEnumerator DownloadFile(string filePath, ES3Settings settings) - { - return DownloadFile(new ES3Settings(filePath, settings), "", "", 0); - } - - /// - /// Downloads a file from the server and saves it locally, overwriting any existing local file. An error is - /// returned if the file does not exist. - /// - /// The relative or absolute path of the file we want to download. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The settings we want to use to override the default settings. - public IEnumerator DownloadFile(string filePath, string user, ES3Settings settings) - { - return DownloadFile(new ES3Settings(filePath, settings), user, "", 0); - } - - /// - /// Downloads a file from the server and saves it locally, overwriting any existing local file. An error is - /// returned if the file does not exist. - /// - /// The relative or absolute path of the file we want to download. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - /// The settings we want to use to override the default settings. - public IEnumerator DownloadFile(string filePath, string user, string password, ES3Settings settings) - { - return DownloadFile(new ES3Settings(filePath, settings), user, password, 0); - } - - /// - /// Downloads a file from the server and saves it locally, overwriting any existing local file. An error is - /// returned if the file does not exist. - /// - /// - /// The ES3File we want to load our data into. The filename in the settings of the ES3File will be - /// used when downloading. - /// - public IEnumerator DownloadFile(ES3File es3File) - { - return DownloadFile(es3File, "", "", 0); - } - - /// - /// Downloads a file from the server and saves it locally, overwriting any existing local file. An error is - /// returned if the file does not exist. - /// - /// - /// The ES3File we want to load our data into. The filename in the settings of the ES3File will be - /// used when downloading. - /// - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - public IEnumerator DownloadFile(ES3File es3File, string user) - { - return DownloadFile(es3File, user, "", 0); - } - - /// - /// Downloads a file from the server and saves it locally, overwriting any existing local file. An error is - /// returned if the file does not exist. - /// - /// - /// The ES3File we want to load our data into. The filename in the settings of the ES3File will be - /// used when downloading. - /// - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - public IEnumerator DownloadFile(ES3File es3File, string user, string password) - { - return DownloadFile(es3File, user, password, 0); - } - - private IEnumerator DownloadFile(ES3File es3File, string user, string password, long timestamp) - { - Reset(); - - var form = CreateWWWForm(); - form.AddField("apiKey", apiKey); - form.AddField("getFile", es3File.settings.path); - form.AddField("user", GetUser(user, password)); - if (timestamp > 0) - form.AddField("timestamp", timestamp.ToString()); - - using (var webRequest = UnityWebRequest.Post(url, form)) - { - webRequest.timeout = timeout; - - yield return SendWebRequest(webRequest); - - if (!HandleError(webRequest, false)) - { - if (webRequest.downloadedBytes > 0) - { - es3File.Clear(); - es3File.SaveRaw(webRequest.downloadHandler.data); - } - else - { - error = string.Format("File {0} was not found on the server.", es3File.settings.path); - errorCode = 3; - } - } - } - - isDone = true; - } - - private IEnumerator DownloadFile(ES3Settings settings, string user, string password, long timestamp) - { - Reset(); - - var form = CreateWWWForm(); - form.AddField("apiKey", apiKey); - form.AddField("getFile", settings.path); - form.AddField("user", GetUser(user, password)); - if (timestamp > 0) - form.AddField("timestamp", timestamp.ToString()); - - using (var webRequest = UnityWebRequest.Post(url, form)) - { - webRequest.timeout = timeout; - - yield return SendWebRequest(webRequest); - if (!HandleError(webRequest, false)) - { - if (webRequest.downloadedBytes > 0) - { - ES3.SaveRaw(webRequest.downloadHandler.data, settings); - } - else - { - error = string.Format("File {0} was not found on the server.", settings.path); - errorCode = 3; - } - } - } - - isDone = true; - } - - #endregion - - #region DeleteFile - - /// Deletes the default file from the server. An error is *not* returned if the file does not exist. - public IEnumerator DeleteFile() - { - return DeleteFile(new ES3Settings(), "", ""); - } - - /// Deletes a file from the server. An error is *not* returned if the file does not exist. - /// The relative or absolute path of the file we want to delete. - public IEnumerator DeleteFile(string filePath) - { - return DeleteFile(new ES3Settings(filePath), "", ""); - } - - /// Deletes a file from the server. An error is *not* returned if the file does not exist. - /// The relative or absolute path of the file we want to delete. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - public IEnumerator DeleteFile(string filePath, string user) - { - return DeleteFile(new ES3Settings(filePath), user, ""); - } - - /// Deletes a file from the server. An error is *not* returned if the file does not exist. - /// The relative or absolute path of the file we want to delete. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - public IEnumerator DeleteFile(string filePath, string user, string password) - { - return DeleteFile(new ES3Settings(filePath), user, password); - } - - /// Deletes a file from the server. An error is *not* returned if the file does not exist. - /// The relative or absolute path of the file we want to delete. - /// The settings we want to use to override the default settings. - public IEnumerator DeleteFile(string filePath, ES3Settings settings) - { - return DeleteFile(new ES3Settings(filePath, settings), "", ""); - } - - /// Deletes a file from the server. An error is *not* returned if the file does not exist. - /// The relative or absolute path of the file we want to delete. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The settings we want to use to override the default settings. - public IEnumerator DeleteFile(string filePath, string user, ES3Settings settings) - { - return DeleteFile(new ES3Settings(filePath, settings), user, ""); - } - - /// Deletes a file from the server. An error is *not* returned if the file does not exist. - /// The relative or absolute path of the file we want to delete. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - /// The settings we want to use to override the default settings. - public IEnumerator DeleteFile(string filePath, string user, string password, ES3Settings settings) - { - return DeleteFile(new ES3Settings(filePath, settings), user, password); - } - - private IEnumerator DeleteFile(ES3Settings settings, string user, string password) - { - Reset(); - - var form = CreateWWWForm(); - form.AddField("apiKey", apiKey); - form.AddField("deleteFile", settings.path); - form.AddField("user", GetUser(user, password)); - - using (var webRequest = UnityWebRequest.Post(url, form)) - { - webRequest.timeout = timeout; - - yield return SendWebRequest(webRequest); - HandleError(webRequest, true); - } - - isDone = true; - } - - #endregion - - #region RenameFile - - /// Renames a file from the server. An error is *not* returned if the file does not exist. - /// The relative or absolute path of the file we want to delete. - public IEnumerator RenameFile(string filePath, string newFilePath) - { - return RenameFile(new ES3Settings(filePath), new ES3Settings(newFilePath), "", ""); - } - - /// Renames a file from the server. An error is *not* returned if the file does not exist. - /// The relative or absolute path of the file we want to delete. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - public IEnumerator RenameFile(string filePath, string newFilePath, string user) - { - return RenameFile(new ES3Settings(filePath), new ES3Settings(newFilePath), user, ""); - } - - /// Renames a file from the server. An error is *not* returned if the file does not exist. - /// The relative or absolute path of the file we want to delete. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - public IEnumerator RenameFile(string filePath, string newFilePath, string user, string password) - { - return RenameFile(new ES3Settings(filePath), new ES3Settings(newFilePath), user, password); - } - - /// Renames a file from the server. An error is *not* returned if the file does not exist. - /// The relative or absolute path of the file we want to delete. - /// The settings we want to use to override the default settings. - public IEnumerator RenameFile(string filePath, string newFilePath, ES3Settings settings) - { - return RenameFile(new ES3Settings(filePath, settings), new ES3Settings(newFilePath, settings), "", ""); - } - - /// Renames a file from the server. An error is *not* returned if the file does not exist. - /// The relative or absolute path of the file we want to delete. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The settings we want to use to override the default settings. - public IEnumerator RenameFile(string filePath, string newFilePath, string user, ES3Settings settings) - { - return RenameFile(new ES3Settings(filePath, settings), new ES3Settings(newFilePath, settings), user, ""); - } - - /// Renames a file from the server. An error is *not* returned if the file does not exist. - /// The relative or absolute path of the file we want to delete. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - /// The settings we want to use to override the default settings. - public IEnumerator RenameFile(string filePath, string newFilePath, string user, string password, ES3Settings settings) - { - return RenameFile(new ES3Settings(filePath, settings), new ES3Settings(newFilePath, settings), user, password); - } - - private IEnumerator RenameFile(ES3Settings settings, ES3Settings newSettings, string user, string password) - { - Reset(); - - var form = CreateWWWForm(); - form.AddField("apiKey", apiKey); - form.AddField("renameFile", settings.path); - form.AddField("newFilename", newSettings.path); - form.AddField("user", GetUser(user, password)); - - using (var webRequest = UnityWebRequest.Post(url, form)) - { - webRequest.timeout = timeout; - - yield return SendWebRequest(webRequest); - HandleError(webRequest, true); - } - - isDone = true; - } - - #endregion - - #region DownloadFilenames - - /// - /// Downloads the names of all of the files on the server. Downloaded filenames are stored in the 'filenames' - /// variable of the ES3Cloud object. - /// - /// The unique name of the user we want to find the filenames of. - /// The password of the user we want to find the filenames of. - public IEnumerator DownloadFilenames(string user = "", string password = "") - { - Reset(); - - var form = CreateWWWForm(); - form.AddField("apiKey", apiKey); - form.AddField("getFilenames", ""); - form.AddField("user", GetUser(user, password)); - - using (var webRequest = UnityWebRequest.Post(url, form)) - { - webRequest.timeout = timeout; - - yield return SendWebRequest(webRequest); - if (!HandleError(webRequest, false)) - data = webRequest.downloadHandler.data; - } - - isDone = true; - } - - /// - /// Downloads the names of all of the files on the server. Downloaded filenames are stored in the 'filenames' - /// variable of the ES3Cloud object. - /// - /// The unique name of the user we want to find the filenames of. - /// The password of the user we want to find the filenames of. - /// - /// A search pattern containing '%' or '_' wildcards where '%' represents zero, one, or - /// multiple characters, and '_' represents a single character. - /// - public IEnumerator SearchFilenames(string searchPattern, string user = "", string password = "") - { - Reset(); - - var form = CreateWWWForm(); - form.AddField("apiKey", apiKey); - form.AddField("getFilenames", ""); - form.AddField("user", GetUser(user, password)); - if (!string.IsNullOrEmpty(searchPattern)) - form.AddField("pattern", searchPattern); - - using (var webRequest = UnityWebRequest.Post(url, form)) - { - webRequest.timeout = timeout; - - yield return SendWebRequest(webRequest); - if (!HandleError(webRequest, false)) - data = webRequest.downloadHandler.data; - } - - isDone = true; - } - - #endregion - - #region DownloadTimestamp - - /// - /// Downloads the timestamp representing when the server file was last updated. The downloaded timestamp is stored - /// in the 'timestamp' variable of the ES3Cloud object. - /// - public IEnumerator DownloadTimestamp() - { - return DownloadTimestamp(new ES3Settings(), "", ""); - } - - /// - /// Downloads the timestamp representing when the server file was last updated. The downloaded timestamp is stored - /// in the 'timestamp' variable of the ES3Cloud object. - /// - /// The relative or absolute path of the file we want to get the timestamp of. - public IEnumerator DownloadTimestamp(string filePath) - { - return DownloadTimestamp(new ES3Settings(filePath), "", ""); - } - - /// - /// Downloads the timestamp representing when the server file was last updated. The downloaded timestamp is stored - /// in the 'timestamp' variable of the ES3Cloud object. - /// - /// The relative or absolute path of the file we want to get the timestamp of. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - public IEnumerator DownloadTimestamp(string filePath, string user) - { - return DownloadTimestamp(new ES3Settings(filePath), user, ""); - } - - /// - /// Downloads the timestamp representing when the server file was last updated. The downloaded timestamp is stored - /// in the 'timestamp' variable of the ES3Cloud object. - /// - /// The relative or absolute path of the file we want to get the timestamp of. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - public IEnumerator DownloadTimestamp(string filePath, string user, string password) - { - return DownloadTimestamp(new ES3Settings(filePath), user, password); - } - - /// - /// Downloads the timestamp representing when the server file was last updated. The downloaded timestamp is stored - /// in the 'timestamp' variable of the ES3Cloud object. - /// - /// The relative or absolute path of the file we want to get the timestamp of. - /// The settings we want to use to override the default settings. - public IEnumerator DownloadTimestamp(string filePath, ES3Settings settings) - { - return DownloadTimestamp(new ES3Settings(filePath, settings), "", ""); - } - - /// - /// Downloads the timestamp representing when the server file was last updated. The downloaded timestamp is stored - /// in the 'timestamp' variable of the ES3Cloud object. - /// - /// The relative or absolute path of the file we want to get the timestamp of. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The settings we want to use to override the default settings. - public IEnumerator DownloadTimestamp(string filePath, string user, ES3Settings settings) - { - return DownloadTimestamp(new ES3Settings(filePath, settings), user, ""); - } - - /// - /// Downloads the timestamp representing when the server file was last updated. The downloaded timestamp is stored - /// in the 'timestamp' variable of the ES3Cloud object. - /// - /// The relative or absolute path of the file we want to get the timestamp of. - /// The unique name of the user this file belongs to, if the file isn't globally accessible. - /// The password of the user this file belongs to. - /// The settings we want to use to override the default settings. - public IEnumerator DownloadTimestamp(string filePath, string user, string password, ES3Settings settings) - { - return DownloadTimestamp(new ES3Settings(filePath, settings), user, password); - } - - private IEnumerator DownloadTimestamp(ES3Settings settings, string user, string password) - { - Reset(); - - var form = CreateWWWForm(); - form.AddField("apiKey", apiKey); - form.AddField("getTimestamp", settings.path); - form.AddField("user", GetUser(user, password)); - - using (var webRequest = UnityWebRequest.Post(url, form)) - { - webRequest.timeout = timeout; - - yield return SendWebRequest(webRequest); - if (!HandleError(webRequest, false)) - data = webRequest.downloadHandler.data; - } - - isDone = true; - } - - #endregion - - #region Internal Methods - - private long DateTimeToUnixTimestamp(DateTime dt) - { - return Convert.ToInt64((dt.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds); - } - - private long GetFileTimestamp(ES3Settings settings) - { - return DateTimeToUnixTimestamp(ES3.GetTimestamp(settings)); - } - - protected override void Reset() - { - data = null; - base.Reset(); - } - - #endregion -} - -#endif \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Web/ES3Cloud.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Web/ES3Cloud.cs.meta deleted file mode 100644 index 02e505e..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Web/ES3Cloud.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e639a3698613946f0951d104a492f138 -timeCreated: 1500448165 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Web/ES3WebClass.cs b/Assets/Plugins/Easy Save 3/Scripts/Web/ES3WebClass.cs deleted file mode 100644 index 839830b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Web/ES3WebClass.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.Networking; - -namespace ES3Internal -{ - public class ES3WebClass - { - protected UnityWebRequest _webRequest; - protected string apiKey; - - protected List> formData = new List>(); - - - public bool isDone; - protected string url; - - protected ES3WebClass(string url, string apiKey) - { - this.url = url; - this.apiKey = apiKey; - } - public float uploadProgress - { - get - { - if (_webRequest == null) - return 0; - return _webRequest.uploadProgress; - } - } - - public float downloadProgress - { - get - { - if (_webRequest == null) - return 0; - return _webRequest.downloadProgress; - } - } - -#region Other Methods - - /// - /// Adds POST data to any requests sent by this ES3Cloud object. Use this if you are sending data to a custom - /// script on your server. - /// - /// The name of the POST field we want to add. - /// The string value of the POST field we want to add. - public void AddPOSTField(string fieldName, string value) - { - formData.Add(new KeyValuePair(fieldName, value)); - } - -#endregion - - #region Error Handling - - /// An error message, if an error occurred. - public string error; - /// This is set to true if an error occurred while performing an operation. - public bool isError { get { return !string.IsNullOrEmpty(error) || errorCode > 0; } } - /// - /// The error code relating to the error, if one occurred. If it's a server error, this will return the HTTP error - /// code. - /// - public long errorCode; - - public static bool IsNetworkError(UnityWebRequest www) - { -#if UNITY_2020_1_OR_NEWER - return www.result == UnityWebRequest.Result.ConnectionError; -#else - return www.isNetworkError; -#endif - } - -#endregion - -#region Internal Methods - - protected string GetUser(string user, string password) - { - if (string.IsNullOrEmpty(user)) - return ""; - // Final user string is a combination of the username and password, and hashed if encryption is enabled. - if (!string.IsNullOrEmpty(password)) - user += password; - -#if !DISABLE_ENCRYPTION && !DISABLE_HASHING - user = ES3Hash.SHA1Hash(user); -#endif - return user; - } - - protected WWWForm CreateWWWForm() - { - var form = new WWWForm(); - foreach (KeyValuePair kvp in formData) - form.AddField(kvp.Key, kvp.Value); - return form; - } - - /* Checks if an error occurred and sets relevant details, and returns true if an error did occur */ - protected bool HandleError(UnityWebRequest webRequest, bool errorIfDataIsDownloaded) - { - if (IsNetworkError(webRequest)) - { - errorCode = 1; - error = "Error: " + webRequest.error; - } - else if (webRequest.responseCode >= 400) - { - errorCode = webRequest.responseCode; - if (string.IsNullOrEmpty(webRequest.downloadHandler.text)) - error = string.Format("Server returned {0} error with no message", webRequest.responseCode); - else - error = webRequest.downloadHandler.text; - } - else if (errorIfDataIsDownloaded && webRequest.downloadedBytes > 0) - { - errorCode = 2; - error = "Server error: '" + webRequest.downloadHandler.text + "'"; - } - else - return false; - return true; - } - - protected IEnumerator SendWebRequest(UnityWebRequest webRequest) - { - _webRequest = webRequest; -#if !UNITY_2017_2_OR_NEWER - yield return webRequest.Send(); -#else - yield return webRequest.SendWebRequest(); -#endif - } - - protected virtual void Reset() - { - error = null; - errorCode = 0; - isDone = false; - } - -#endregion - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Web/ES3WebClass.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Web/ES3WebClass.cs.meta deleted file mode 100644 index c290041..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Web/ES3WebClass.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 338b6919533e14c37afa52e7b0a91a6d -timeCreated: 1502349814 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Writers.meta b/Assets/Plugins/Easy Save 3/Scripts/Writers.meta deleted file mode 100644 index e867721..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Writers.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: f81e45d5acda04835b484a483f4aa7e0 -folderAsset: yes -timeCreated: 1499764821 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Binary.cs b/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Binary.cs deleted file mode 100644 index 4677efe..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Binary.cs +++ /dev/null @@ -1,182 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace ES3Internal -{ - internal enum ES3SpecialByte : byte - { - Null = 0, - Bool = 1, - Byte = 2, - Sbyte = 3, - Char = 4, - Decimal = 5, - Double = 6, - Float = 7, - Int = 8, - Uint = 9, - Long = 10, - Ulong = 11, - Short = 12, - Ushort = 13, - String = 14, - ByteArray = 15, - Collection = 128, - Dictionary = 129, - CollectionItem = 130, - Object = 254, - Terminator = 255 - } - - internal static class ES3Binary - { - internal const string ObjectTerminator = "."; - - internal static readonly Dictionary IdToType = new Dictionary - { - { - ES3SpecialByte.Null, null - }, - { - ES3SpecialByte.Bool, typeof(bool) - }, - { - ES3SpecialByte.Byte, typeof(byte) - }, - { - ES3SpecialByte.Sbyte, typeof(sbyte) - }, - { - ES3SpecialByte.Char, typeof(char) - }, - { - ES3SpecialByte.Decimal, typeof(decimal) - }, - { - ES3SpecialByte.Double, typeof(double) - }, - { - ES3SpecialByte.Float, typeof(float) - }, - { - ES3SpecialByte.Int, typeof(int) - }, - { - ES3SpecialByte.Uint, typeof(uint) - }, - { - ES3SpecialByte.Long, typeof(long) - }, - { - ES3SpecialByte.Ulong, typeof(ulong) - }, - { - ES3SpecialByte.Short, typeof(short) - }, - { - ES3SpecialByte.Ushort, typeof(ushort) - }, - { - ES3SpecialByte.String, typeof(string) - }, - { - ES3SpecialByte.ByteArray, typeof(byte[]) - } - }; - - internal static readonly Dictionary TypeToId = new Dictionary - { - { - typeof(bool), ES3SpecialByte.Bool - }, - { - typeof(byte), ES3SpecialByte.Byte - }, - { - typeof(sbyte), ES3SpecialByte.Sbyte - }, - { - typeof(char), ES3SpecialByte.Char - }, - { - typeof(decimal), ES3SpecialByte.Decimal - }, - { - typeof(double), ES3SpecialByte.Double - }, - { - typeof(float), ES3SpecialByte.Float - }, - { - typeof(int), ES3SpecialByte.Int - }, - { - typeof(uint), ES3SpecialByte.Uint - }, - { - typeof(long), ES3SpecialByte.Long - }, - { - typeof(ulong), ES3SpecialByte.Ulong - }, - { - typeof(short), ES3SpecialByte.Short - }, - { - typeof(ushort), ES3SpecialByte.Ushort - }, - { - typeof(string), ES3SpecialByte.String - }, - { - typeof(byte[]), ES3SpecialByte.ByteArray - } - }; - - internal static ES3SpecialByte TypeToByte(Type type) - { - ES3SpecialByte b; - if (TypeToId.TryGetValue(type, out b)) - return b; - return ES3SpecialByte.Object; - } - - internal static Type ByteToType(ES3SpecialByte b) - { - return ByteToType((byte)b); - } - - internal static Type ByteToType(byte b) - { - Type type; - if (IdToType.TryGetValue((ES3SpecialByte)b, out type)) - return type; - return typeof(object); - } - - internal static bool IsPrimitive(ES3SpecialByte b) - { - switch (b) - { - case ES3SpecialByte.Bool: - case ES3SpecialByte.Byte: - case ES3SpecialByte.Sbyte: - case ES3SpecialByte.Char: - case ES3SpecialByte.Decimal: - case ES3SpecialByte.Double: - case ES3SpecialByte.Float: - case ES3SpecialByte.Int: - case ES3SpecialByte.Uint: - case ES3SpecialByte.Long: - case ES3SpecialByte.Ulong: - case ES3SpecialByte.Short: - case ES3SpecialByte.Ushort: - case ES3SpecialByte.String: - case ES3SpecialByte.ByteArray: - return true; - default: - return false; - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Binary.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Binary.cs.meta deleted file mode 100644 index 9019d8b..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Binary.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 9398c7a61f9679e41af5e48cac61f763 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3BinaryWriter.cs b/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3BinaryWriter.cs deleted file mode 100644 index 3850d28..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3BinaryWriter.cs +++ /dev/null @@ -1,4 +0,0 @@ -/* - * BinaryWriter is not implemented. - * See this post for more info: https://moodkie.com/forum/viewtopic.php?p=7478#p7478 - */ diff --git a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3BinaryWriter.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3BinaryWriter.cs.meta deleted file mode 100644 index 4b787bf..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3BinaryWriter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 890d1774e6bacdc43bf99692dfc5360a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3CacheWriter.cs b/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3CacheWriter.cs deleted file mode 100644 index 45f0146..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3CacheWriter.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System; -using System.ComponentModel; - -namespace ES3Internal -{ - internal class ES3CacheWriter : ES3Writer - { - private readonly ES3File es3File; - - internal ES3CacheWriter(ES3Settings settings, bool writeHeaderAndFooter, bool mergeKeys) : base(settings, writeHeaderAndFooter, mergeKeys) - { - es3File = new ES3File(settings); - } - - public override void Dispose() {} - - /* User-facing methods used when writing randomly-accessible Key-Value pairs. */ - #region Write(key, value) Methods - - /// Writes a value to the writer with the given key. - /// The key which uniquely identifies this value. - /// The value we want to write. - public override void Write(string key, object value) - { - es3File.Save(key, (T)value); - } - - internal override void Write(string key, Type type, byte[] value) - { - ES3Debug.LogError("Not implemented"); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public override void Write(Type type, string key, object value) - { - es3File.Save(key, value); - } - - #endregion - - - #region WritePrimitive(value) methods. - - internal override void WritePrimitive(int value) {} - internal override void WritePrimitive(float value) {} - internal override void WritePrimitive(bool value) {} - internal override void WritePrimitive(decimal value) {} - internal override void WritePrimitive(double value) {} - internal override void WritePrimitive(long value) {} - internal override void WritePrimitive(ulong value) {} - internal override void WritePrimitive(uint value) {} - internal override void WritePrimitive(byte value) {} - internal override void WritePrimitive(sbyte value) {} - internal override void WritePrimitive(short value) {} - internal override void WritePrimitive(ushort value) {} - internal override void WritePrimitive(char value) {} - internal override void WritePrimitive(byte[] value) {} - - - internal override void WritePrimitive(string value) - { - } - - internal override void WriteNull() - { - } - - #endregion - - #region Format-specific methods - - private static bool CharacterRequiresEscaping(char c) - { - return false; - } - - private void WriteCommaIfRequired() - { - } - - internal override void WriteRawProperty(string name, byte[] value) - { - } - - internal override void StartWriteFile() - { - } - - internal override void EndWriteFile() - { - } - - internal override void StartWriteProperty(string name) - { - base.StartWriteProperty(name); - } - - internal override void EndWriteProperty(string name) - { - } - - internal override void StartWriteObject(string name) - { - } - - internal override void EndWriteObject(string name) - { - } - - internal override void StartWriteCollection() - { - } - - internal override void EndWriteCollection() - { - } - - internal override void StartWriteCollectionItem(int index) - { - } - - internal override void EndWriteCollectionItem(int index) - { - } - - internal override void StartWriteDictionary() - { - } - - internal override void EndWriteDictionary() - { - } - - internal override void StartWriteDictionaryKey(int index) - { - } - - internal override void EndWriteDictionaryKey(int index) - { - } - - internal override void StartWriteDictionaryValue(int index) - { - } - - internal override void EndWriteDictionaryValue(int index) - { - } - - #endregion - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3CacheWriter.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3CacheWriter.cs.meta deleted file mode 100644 index fe20eeb..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3CacheWriter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 52e4ba456dd1422409a95cdc6bf43f6b -timeCreated: 1499764822 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3JSONWriter.cs b/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3JSONWriter.cs deleted file mode 100644 index 2d20ca7..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3JSONWriter.cs +++ /dev/null @@ -1,231 +0,0 @@ -using System; -using System.Globalization; -using System.IO; - -namespace ES3Internal -{ - internal class ES3JSONWriter : ES3Writer - { - internal StreamWriter baseWriter; - - private bool isFirstProperty = true; - - public ES3JSONWriter(Stream stream, ES3Settings settings) : this(stream, settings, true, true) {} - - internal ES3JSONWriter(Stream stream, ES3Settings settings, bool writeHeaderAndFooter, bool mergeKeys) : base(settings, writeHeaderAndFooter, mergeKeys) - { - baseWriter = new StreamWriter(stream); - StartWriteFile(); - } - - public override void Dispose() - { - baseWriter.Dispose(); - } - - public void WriteNewlineAndTabs() - { - if (settings.prettyPrint) - { - baseWriter.Write(Environment.NewLine); - for (int i = 0; i < serializationDepth; i++) - baseWriter.Write('\t'); - } - } - - #region WritePrimitive(value) methods. - - internal override void WritePrimitive(int value) { baseWriter.Write(value); } - internal override void WritePrimitive(float value) { baseWriter.Write(value.ToString("R", CultureInfo.InvariantCulture)); } - internal override void WritePrimitive(bool value) { baseWriter.Write(value ? "true" : "false"); } - internal override void WritePrimitive(decimal value) { baseWriter.Write(value.ToString(CultureInfo.InvariantCulture)); } - internal override void WritePrimitive(double value) { baseWriter.Write(value.ToString("R", CultureInfo.InvariantCulture)); } - internal override void WritePrimitive(long value) { baseWriter.Write(value); } - internal override void WritePrimitive(ulong value) { baseWriter.Write(value); } - internal override void WritePrimitive(uint value) { baseWriter.Write(value); } - internal override void WritePrimitive(byte value) { baseWriter.Write(Convert.ToInt32(value)); } - internal override void WritePrimitive(sbyte value) { baseWriter.Write(Convert.ToInt32(value)); } - internal override void WritePrimitive(short value) { baseWriter.Write(Convert.ToInt32(value)); } - internal override void WritePrimitive(ushort value) { baseWriter.Write(Convert.ToInt32(value)); } - internal override void WritePrimitive(char value) { WritePrimitive(value.ToString()); } - internal override void WritePrimitive(byte[] value) { WritePrimitive(Convert.ToBase64String(value)); } - - - internal override void WritePrimitive(string value) - { - baseWriter.Write("\""); - - // Escape any quotation marks within the string. - for (int i = 0; i < value.Length; i++) - { - char c = value[i]; - switch (c) - { - case '\"': - case '“': - case '”': - case '\\': - case '/': - baseWriter.Write('\\'); - baseWriter.Write(c); - break; - case '\b': - baseWriter.Write("\\b"); - break; - case '\f': - baseWriter.Write("\\f"); - break; - case '\n': - baseWriter.Write("\\n"); - break; - case '\r': - baseWriter.Write("\\r"); - break; - case '\t': - baseWriter.Write("\\t"); - break; - default: - baseWriter.Write(c); - break; - } - } - baseWriter.Write("\""); - } - - internal override void WriteNull() - { - baseWriter.Write("null"); - } - - #endregion - - #region Format-specific methods - - private static bool CharacterRequiresEscaping(char c) - { - return c == '\"' || c == '\\' || c == '“' || c == '”'; - } - - private void WriteCommaIfRequired() - { - if (!isFirstProperty) - baseWriter.Write(','); - else - isFirstProperty = false; - WriteNewlineAndTabs(); - } - - internal override void WriteRawProperty(string name, byte[] value) - { - StartWriteProperty(name); - baseWriter.Write(settings.encoding.GetString(value, 0, value.Length)); - EndWriteProperty(name); - } - - internal override void StartWriteFile() - { - if (writeHeaderAndFooter) - baseWriter.Write('{'); - base.StartWriteFile(); - } - - internal override void EndWriteFile() - { - base.EndWriteFile(); - WriteNewlineAndTabs(); - if (writeHeaderAndFooter) - baseWriter.Write('}'); - } - - internal override void StartWriteProperty(string name) - { - base.StartWriteProperty(name); - WriteCommaIfRequired(); - Write(name); - - if (settings.prettyPrint) - baseWriter.Write(' '); - baseWriter.Write(':'); - if (settings.prettyPrint) - baseWriter.Write(' '); - } - - internal override void EndWriteProperty(string name) - { - // It's not necessary to perform any operations after writing the property in JSON. - base.EndWriteProperty(name); - } - - internal override void StartWriteObject(string name) - { - base.StartWriteObject(name); - isFirstProperty = true; - baseWriter.Write('{'); - } - - internal override void EndWriteObject(string name) - { - base.EndWriteObject(name); - // Set isFirstProperty to false incase we didn't write any properties, in which case - // WriteCommaIfRequired() is never called. - isFirstProperty = false; - WriteNewlineAndTabs(); - baseWriter.Write('}'); - } - - internal override void StartWriteCollection() - { - base.StartWriteCollection(); - baseWriter.Write('['); - WriteNewlineAndTabs(); - } - - internal override void EndWriteCollection() - { - base.EndWriteCollection(); - WriteNewlineAndTabs(); - baseWriter.Write(']'); - } - - internal override void StartWriteCollectionItem(int index) - { - if (index != 0) - baseWriter.Write(','); - } - - internal override void EndWriteCollectionItem(int index) - { - } - - internal override void StartWriteDictionary() - { - StartWriteObject(null); - } - - internal override void EndWriteDictionary() - { - EndWriteObject(null); - } - - internal override void StartWriteDictionaryKey(int index) - { - if (index != 0) - baseWriter.Write(','); - } - - internal override void EndWriteDictionaryKey(int index) - { - baseWriter.Write(':'); - } - - internal override void StartWriteDictionaryValue(int index) - { - } - - internal override void EndWriteDictionaryValue(int index) - { - } - - #endregion - } -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3JSONWriter.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3JSONWriter.cs.meta deleted file mode 100644 index fa57b27..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3JSONWriter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c58189baf582845eda4b66f9bb92a671 -timeCreated: 1499764822 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Writer.cs b/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Writer.cs deleted file mode 100644 index d1ee6d7..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Writer.cs +++ /dev/null @@ -1,505 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.IO; -using ES3Internal; -using ES3Types; -using UnityEngine; -using Object = UnityEngine.Object; -public abstract class ES3Writer : IDisposable -{ - protected HashSet keysToDelete = new HashSet(); - internal bool overwriteKeys = true; - - protected int serializationDepth; - public ES3Settings settings; - - internal bool writeHeaderAndFooter = true; - - protected ES3Writer(ES3Settings settings, bool writeHeaderAndFooter, bool overwriteKeys) - { - this.settings = settings; - this.writeHeaderAndFooter = writeHeaderAndFooter; - this.overwriteKeys = overwriteKeys; - } - - /* - * Checks whether serialization depth limit has been exceeded - */ - [EditorBrowsable(EditorBrowsableState.Never)] - protected bool SerializationDepthLimitExceeded() - { - if (serializationDepth > settings.serializationDepthLimit) - { - ES3Debug.LogWarning("Serialization depth limit of " + settings.serializationDepthLimit + " has been exceeded, indicating that there may be a circular reference.\nIf this is not a circular reference, you can increase the depth by going to Window > Easy Save 3 > Settings > Advanced Settings > Serialization Depth Limit"); - return true; - } - return false; - } - - /* - * Marks a key for deletion. - * When merging files, keys marked for deletion will not be included. - */ - [EditorBrowsable(EditorBrowsableState.Never)] - public virtual void MarkKeyForDeletion(string key) - { - keysToDelete.Add(key); - } - - /* - * Merges the contents of the non-temporary file with this ES3Writer, - * ignoring any keys which are marked for deletion. - */ - protected void Merge() - { - using (var reader = ES3Reader.Create(settings)) - { - if (reader == null) - return; - Merge(reader); - } - } - - /* - * Merges the contents of the ES3Reader with this ES3Writer, - * ignoring any keys which are marked for deletion. - */ - protected void Merge(ES3Reader reader) - { - foreach (KeyValuePair kvp in reader.RawEnumerator) - if (!keysToDelete.Contains(kvp.Key) || kvp.Value.type == null) // Don't add keys whose data is of a type which no longer exists in the project. - Write(kvp.Key, kvp.Value.type.type, kvp.Value.bytes); - } - - /// Stores the contents of the writer and overwrites any existing keys if overwriting is enabled. - public virtual void Save() - { - Save(overwriteKeys); - } - - /// Stores the contents of the writer and overwrites any existing keys if overwriting is enabled. - /// Whether we should overwrite existing keys. - public virtual void Save(bool overwriteKeys) - { - if (overwriteKeys) - Merge(); - EndWriteFile(); - Dispose(); - - // If we're writing to a location which can become corrupted, rename the backup file to the file we want. - // This prevents corrupt data. - if (settings.location == ES3.Location.File || settings.location == ES3.Location.PlayerPrefs) - ES3IO.CommitBackup(settings); - } - - #region ES3Writer Abstract Methods - - internal abstract void WriteNull(); - - internal virtual void StartWriteFile() - { - serializationDepth++; - } - - internal virtual void EndWriteFile() - { - serializationDepth--; - } - - internal virtual void StartWriteObject(string name) - { - serializationDepth++; - } - - internal virtual void EndWriteObject(string name) - { - serializationDepth--; - } - - internal virtual void StartWriteProperty(string name) - { - if (name == null) - throw new ArgumentNullException("Key or field name cannot be NULL when saving data."); - ES3Debug.Log("" + name + " (writing property)", null, serializationDepth); - } - - internal virtual void EndWriteProperty(string name) - { - } - - internal virtual void StartWriteCollection() - { - serializationDepth++; - } - - internal virtual void EndWriteCollection() - { - serializationDepth--; - } - - internal abstract void StartWriteCollectionItem(int index); - internal abstract void EndWriteCollectionItem(int index); - - internal abstract void StartWriteDictionary(); - internal abstract void EndWriteDictionary(); - internal abstract void StartWriteDictionaryKey(int index); - internal abstract void EndWriteDictionaryKey(int index); - internal abstract void StartWriteDictionaryValue(int index); - internal abstract void EndWriteDictionaryValue(int index); - - public abstract void Dispose(); - - #endregion - - #region ES3Writer Interface abstract methods - - internal abstract void WriteRawProperty(string name, byte[] bytes); - - internal abstract void WritePrimitive(int value); - internal abstract void WritePrimitive(float value); - internal abstract void WritePrimitive(bool value); - internal abstract void WritePrimitive(decimal value); - internal abstract void WritePrimitive(double value); - internal abstract void WritePrimitive(long value); - internal abstract void WritePrimitive(ulong value); - internal abstract void WritePrimitive(uint value); - internal abstract void WritePrimitive(byte value); - internal abstract void WritePrimitive(sbyte value); - internal abstract void WritePrimitive(short value); - internal abstract void WritePrimitive(ushort value); - internal abstract void WritePrimitive(char value); - internal abstract void WritePrimitive(string value); - internal abstract void WritePrimitive(byte[] value); - - #endregion - - /* User-facing methods used when writing randomly-accessible Key-Value pairs. */ - #region Write(key, value) Methods - - internal virtual void Write(string key, Type type, byte[] value) - { - StartWriteProperty(key); - StartWriteObject(key); - WriteType(type); - WriteRawProperty("value", value); - EndWriteObject(key); - EndWriteProperty(key); - MarkKeyForDeletion(key); - } - - /// Writes a value to the writer with the given key. - /// The key which uniquely identifies this value. - /// The value we want to write. - public virtual void Write(string key, object value) - { - if (typeof(T) == typeof(object)) - Write(value.GetType(), key, value); - else - Write(typeof(T), key, value); - } - - /// Writes a value to the writer with the given key, using the given type rather than the generic parameter. - /// The key which uniquely identifies this value. - /// The value we want to write. - /// The type we want to use for the header, and to retrieve an ES3Type. - [EditorBrowsable(EditorBrowsableState.Never)] - public virtual void Write(Type type, string key, object value) - { - StartWriteProperty(key); - StartWriteObject(key); - WriteType(type); - WriteProperty("value", value, ES3TypeMgr.GetOrCreateES3Type(type), settings.referenceMode); - EndWriteObject(key); - EndWriteProperty(key); - MarkKeyForDeletion(key); - } - - #endregion - - #region Write(value) & Write(value, ES3Type) Methods - - /// Writes a value to the writer. Note that this should only be called within an ES3Type. - /// The value we want to write. - /// - /// Whether we want to write UnityEngine.Object fields and properties by reference, by - /// value, or both. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public virtual void Write(object value, ES3.ReferenceMode memberReferenceMode = ES3.ReferenceMode.ByRef) - { - if (value == null) - { - WriteNull(); - return; - } - - var type = ES3TypeMgr.GetOrCreateES3Type(value.GetType()); - Write(value, type, memberReferenceMode); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public virtual void Write(object value, ES3Type type, ES3.ReferenceMode memberReferenceMode = ES3.ReferenceMode.ByRef) - { - // Note that we have to check UnityEngine.Object types for null by casting it first, otherwise - // it will always return false. - if (value == null || ES3Reflection.IsAssignableFrom(typeof(Object), value.GetType()) && value as Object == null) - { - WriteNull(); - return; - } - - // Deal with System.Objects - if (type == null || type.type == typeof(object)) - { - var valueType = value.GetType(); - type = ES3TypeMgr.GetOrCreateES3Type(valueType); - - if (type == null) - throw new NotSupportedException("Types of " + valueType + " are not supported. Please see the Supported Types guide for more information: https://docs.moodkie.com/easy-save-3/es3-supported-types/"); - - if (!type.isCollection && !type.isDictionary) - { - StartWriteObject(null); - WriteType(valueType); - - type.Write(value, this); - - EndWriteObject(null); - return; - } - } - - if (type == null) - throw new ArgumentNullException("ES3Type argument cannot be null."); - if (type.isUnsupported) - { - if (type.isCollection || type.isDictionary) - throw new NotSupportedException(type.type + " is not supported because it's element type is not supported. Please see the Supported Types guide for more information: https://docs.moodkie.com/easy-save-3/es3-supported-types/"); - throw new NotSupportedException("Types of " + type.type + " are not supported. Please see the Supported Types guide for more information: https://docs.moodkie.com/easy-save-3/es3-supported-types/"); - } - - if (type.isPrimitive || type.isEnum) - type.Write(value, this); - else if (type.isCollection) - { - StartWriteCollection(); - ((ES3CollectionType)type).Write(value, this, memberReferenceMode); - EndWriteCollection(); - } - else if (type.isDictionary) - { - StartWriteDictionary(); - ((ES3DictionaryType)type).Write(value, this, memberReferenceMode); - EndWriteDictionary(); - } - else - { - if (type.type == typeof(GameObject)) - ((ES3Type_GameObject)type).saveChildren = settings.saveChildren; - - StartWriteObject(null); - - if (type.isES3TypeUnityObject) - ((ES3UnityObjectType)type).WriteObject(value, this, memberReferenceMode); - else - type.Write(value, this); - EndWriteObject(null); - } - } - - internal virtual void WriteRef(Object obj) - { - var refMgr = ES3ReferenceMgrBase.Current; - if (refMgr == null) - throw new InvalidOperationException("An Easy Save 3 Manager is required to save references. To add one to your scene, exit playmode and go to Tools > Easy Save 3 > Add Manager to Scene"); - - // Get the reference ID, if it exists, and store it. - long id = refMgr.Get(obj); - // If reference ID doesn't exist, create reference. - if (id == -1) - id = refMgr.Add(obj); - WriteProperty(ES3ReferenceMgrBase.referencePropertyName, id.ToString()); - } - - #endregion - - /* Writes a property as a name value pair. */ - #region WriteProperty(name, value) methods - - /// Writes a field or property to the writer. Note that this should only be called within an ES3Type. - /// The name of the field or property. - /// The value we want to write. - public virtual void WriteProperty(string name, object value) - { - WriteProperty(name, value, settings.memberReferenceMode); - } - - /// Writes a field or property to the writer. Note that this should only be called within an ES3Type. - /// The name of the field or property. - /// The value we want to write. - /// Whether we want to write the property by reference, by value, or both. - public virtual void WriteProperty(string name, object value, ES3.ReferenceMode memberReferenceMode) - { - if (SerializationDepthLimitExceeded()) - return; - - StartWriteProperty(name); - Write(value, memberReferenceMode); - EndWriteProperty(name); - } - - /// Writes a field or property to the writer. Note that this should only be called within an ES3Type. - /// The name of the field or property. - /// The value we want to write. - public virtual void WriteProperty(string name, object value) - { - WriteProperty(name, value, ES3TypeMgr.GetOrCreateES3Type(typeof(T)), settings.memberReferenceMode); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public virtual void WriteProperty(string name, object value, ES3Type type) - { - WriteProperty(name, value, type, settings.memberReferenceMode); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public virtual void WriteProperty(string name, object value, ES3Type type, ES3.ReferenceMode memberReferenceMode) - { - if (SerializationDepthLimitExceeded()) - return; - - StartWriteProperty(name); - Write(value, type, memberReferenceMode); - EndWriteProperty(name); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public virtual void WritePropertyByRef(string name, Object value) - { - if (SerializationDepthLimitExceeded()) - return; - - StartWriteProperty(name); - if (value == null) - { - WriteNull(); - return; - } - ; - StartWriteObject(name); - WriteRef(value); - EndWriteObject(name); - EndWriteProperty(name); - } - - /// Writes a private property to the writer. Note that this should only be called within an ES3Type. - /// The name of the property. - /// The object containing the property we want to write. - public void WritePrivateProperty(string name, object objectContainingProperty) - { - var property = ES3Reflection.GetES3ReflectedProperty(objectContainingProperty.GetType(), name); - if (property.IsNull) - throw new MissingMemberException("A private property named " + name + " does not exist in the type " + objectContainingProperty.GetType()); - WriteProperty(name, property.GetValue(objectContainingProperty), ES3TypeMgr.GetOrCreateES3Type(property.MemberType)); - } - - /// Writes a private field to the writer. Note that this should only be called within an ES3Type. - /// The name of the field. - /// The object containing the property we want to write. - public void WritePrivateField(string name, object objectContainingField) - { - var field = ES3Reflection.GetES3ReflectedMember(objectContainingField.GetType(), name); - if (field.IsNull) - throw new MissingMemberException("A private field named " + name + " does not exist in the type " + objectContainingField.GetType()); - WriteProperty(name, field.GetValue(objectContainingField), ES3TypeMgr.GetOrCreateES3Type(field.MemberType)); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void WritePrivateProperty(string name, object objectContainingProperty, ES3Type type) - { - var property = ES3Reflection.GetES3ReflectedProperty(objectContainingProperty.GetType(), name); - if (property.IsNull) - throw new MissingMemberException("A private property named " + name + " does not exist in the type " + objectContainingProperty.GetType()); - WriteProperty(name, property.GetValue(objectContainingProperty), type); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void WritePrivateField(string name, object objectContainingField, ES3Type type) - { - var field = ES3Reflection.GetES3ReflectedMember(objectContainingField.GetType(), name); - if (field.IsNull) - throw new MissingMemberException("A private field named " + name + " does not exist in the type " + objectContainingField.GetType()); - WriteProperty(name, field.GetValue(objectContainingField), type); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void WritePrivatePropertyByRef(string name, object objectContainingProperty) - { - var property = ES3Reflection.GetES3ReflectedProperty(objectContainingProperty.GetType(), name); - if (property.IsNull) - throw new MissingMemberException("A private property named " + name + " does not exist in the type " + objectContainingProperty.GetType()); - WritePropertyByRef(name, (Object)property.GetValue(objectContainingProperty)); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void WritePrivateFieldByRef(string name, object objectContainingField) - { - var field = ES3Reflection.GetES3ReflectedMember(objectContainingField.GetType(), name); - if (field.IsNull) - throw new MissingMemberException("A private field named " + name + " does not exist in the type " + objectContainingField.GetType()); - WritePropertyByRef(name, (Object)field.GetValue(objectContainingField)); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void WriteType(Type type) - { - WriteProperty(ES3Type.typeFieldName, ES3Reflection.GetTypeString(type)); - } - - #endregion - - #region Create methods - - /// Creates a new ES3Writer. - /// The relative or absolute path of the file we want to write to. - /// The settings we want to use to override the default settings. - public static ES3Writer Create(string filePath, ES3Settings settings) - { - return Create(new ES3Settings(filePath, settings)); - } - - /// Creates a new ES3Writer. - /// The settings we want to use to override the default settings. - public static ES3Writer Create(ES3Settings settings) - { - return Create(settings, true, true, false); - } - - // Implicit Stream Methods. - internal static ES3Writer Create(ES3Settings settings, bool writeHeaderAndFooter, bool overwriteKeys, bool append) - { - var stream = ES3Stream.CreateStream(settings, append ? ES3FileMode.Append : ES3FileMode.Write); - if (stream == null) - return null; - return Create(stream, settings, writeHeaderAndFooter, overwriteKeys); - } - - // Explicit Stream Methods. - - internal static ES3Writer Create(Stream stream, ES3Settings settings, bool writeHeaderAndFooter, bool overwriteKeys) - { - if (stream.GetType() == typeof(MemoryStream)) - { - settings = (ES3Settings)settings.Clone(); - settings.location = ES3.Location.InternalMS; - } - - // Get the baseWriter using the given Stream. - if (settings.format == ES3.Format.JSON) - return new ES3JSONWriter(stream, settings, writeHeaderAndFooter, overwriteKeys); - return null; - } - - #endregion -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Writer.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Writer.cs.meta deleted file mode 100644 index e0973a9..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Writer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 09319508912db4c13bd924c6dc89f661 -timeCreated: 1499764821 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3XMLWriter.cs b/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3XMLWriter.cs deleted file mode 100644 index d115078..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3XMLWriter.cs +++ /dev/null @@ -1,4 +0,0 @@ -public class ES3XMLWriter -{ - // Not implemented -} \ No newline at end of file diff --git a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3XMLWriter.cs.meta b/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3XMLWriter.cs.meta deleted file mode 100644 index 6831603..0000000 --- a/Assets/Plugins/Easy Save 3/Scripts/Writers/ES3XMLWriter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3bac03a64f52fa94ea3bdcafecad8788 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Web.meta b/Assets/Plugins/Easy Save 3/Web.meta deleted file mode 100644 index 814186e..0000000 --- a/Assets/Plugins/Easy Save 3/Web.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: b6fb14c673b174696ac55b1a7869f3a9 -folderAsset: yes -timeCreated: 1501844154 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Easy Save 3/Web/ES3Cloud.php b/Assets/Plugins/Easy Save 3/Web/ES3Cloud.php deleted file mode 100644 index 28878da..0000000 --- a/Assets/Plugins/Easy Save 3/Web/ES3Cloud.php +++ /dev/null @@ -1,304 +0,0 @@ - PDO::ERRMODE_EXCEPTION)); -} -catch(PDOException $e) -{ - Error("Could not connect to database.", $e->getMessage(), 501); -} - -if(!isset($_POST["apiKey"])) -{ - echo "ES3Cloud is functioning correctly."; - exit(); -} - -if($_POST["apiKey"] != $api_key) - Error("Incorrect API Key", "Incorrect API Key", 403); - -// ----- GET FILE ----- -if(isset($_POST["getFile"])) -{ - $stmt = $db->prepare("SELECT $fileDataField FROM $tableName WHERE $filenameField = :filename AND $userField = :user AND $lastUpdatedField > :timestamp LIMIT 1"); - $stmt->bindParam(":filename", $_POST["getFile"]); - $postUser = GetPOSTUser(); - $stmt->bindParam(":user", $postUser); - $postTimestamp = GetPOSTTimestamp(); - $stmt->bindParam(":timestamp", $postTimestamp); - $stmt->execute(); - if($stmt->rowCount() > 0) - { - $data = $stmt->fetchColumn(); - // Manually set the content length so WWW.progress works. - header($_SERVER["SERVER_PROTOCOL"] . " 200 OK"); - header("Cache-Control: public"); - header("Content-Type: application/octet-stream"); - header("Content-Transfer-Encoding: Binary"); - header("Content-Length:".strlen($data)); - echo $data; - } -} - -// ----- PUT FILE ----- -else if(isset($_POST["putFile"])) -{ - // Get uploaded data. - $filePath = $_FILES["data"]["tmp_name"]; - - // If file doesn't exist or it contains no data, throw an error. - if(!file_exists($filePath) || filesize($filePath) == 0) - Error("Uploaded file does not exist or is empty.", "Uploaded file does not exist or is empty.", 400); - - $fp = fopen($filePath, 'rb'); - - $stmt = $db->prepare("INSERT INTO $tableName ($filenameField, $fileDataField, $userField, $lastUpdatedField) VALUES (:filename, :data, :user, :timestamp) ON DUPLICATE KEY UPDATE $fileDataField = VALUES($fileDataField), $lastUpdatedField = VALUES($lastUpdatedField)"); - $stmt->bindParam(":filename", $_POST["putFile"]); - $stmt->bindParam(":data", $fp, PDO::PARAM_LOB); - $postUser = GetPOSTUser(); - $stmt->bindParam(":user", $postUser); - $postTimestamp = GetPOSTTimestamp(); - $stmt->bindParam(":timestamp", $postTimestamp); - - $stmt->execute(); -} - -// ----- RENAME FILE ----- -else if(isset($_POST["renameFile"])) -{ - $stmt = $db->prepare("UPDATE $tableName SET $filenameField = :newFilename WHERE $filenameField = :filename AND $userField = :user"); - $stmt->bindParam(":filename", $_POST["renameFile"]); - $stmt->bindParam(":newFilename", $_POST["newFilename"]); - $postUser = GetPOSTUser(); - $stmt->bindParam(":user", $postUser); - $stmt->execute(); -} - -// ----- DELETE FILE ----- -else if(isset($_POST["deleteFile"])) -{ - - $stmt = $db->prepare("DELETE FROM $tableName WHERE $filenameField = :filename AND $userField = :user"); - $stmt->bindParam(":filename", $_POST["deleteFile"]); - $postUser = GetPOSTUser(); - $stmt->bindParam(":user", $postUser); - $stmt->execute(); -} - -// ----- GET FILENAMES WITH PATTERN ----- -else if(isset($_POST["getFilenames"]) && isset($_POST["pattern"])) -{ - $stmt = $db->prepare("SELECT $filenameField FROM $tableName WHERE $userField = :user AND $filenameField LIKE :pattern"); - $postUser = GetPOSTUser(); - $stmt->bindParam(":user", $postUser); - $stmt->bindParam(":pattern", $_POST["pattern"]); - $stmt->execute(); - $rows = $stmt->fetchAll(); - foreach($rows as $row) - echo $row[$filenameField] . ";"; -} - -// ----- GET FILENAMES ----- -else if(isset($_POST["getFilenames"])) -{ - $stmt = $db->prepare("SELECT $filenameField FROM $tableName WHERE $userField = :user"); - $postUser = GetPOSTUser(); - $stmt->bindParam(":user", $postUser); - $stmt->execute(); - $rows = $stmt->fetchAll(); - foreach($rows as $row) - echo $row[$filenameField] . ";"; -} - -// ----- GET TIMESTAMP ----- -else if(isset($_POST["getTimestamp"])) -{ - $stmt = $db->prepare("SELECT $lastUpdatedField FROM $tableName WHERE $filenameField = :filename AND $userField = :user LIMIT 1"); - $stmt->bindParam(":filename", $_POST["getTimestamp"]); - $postUser = GetPOSTUser(); - $stmt->bindParam(":user", $postUser); - $stmt->execute(); - if($stmt->rowCount() > 0) - echo $stmt->fetchColumn(); - else - Error("Could not get timestamp as file does not exist.", "Could not get timestamp as file does not exist.", 400); -} - -else - Error("No valid operation was specified", "No valid operation was specified", 400); - -// Close the connection to the database by nullifying the variable. -$db = null; - -function GetPOSTUser() -{ - return isset($_POST["user"]) ? $_POST["user"] : ""; -} - -function GetPOSTTimestamp() -{ - return isset($_POST["timestamp"]) ? $_POST["timestamp"] : 0; -} - -function Error($headerMsg, $msg, $code) -{ - header($headerMsg, true, $code); - print_r($msg); - if(isset($GLOBALS['db'])) - $GLOBALS['db'] = null; - exit(); -} - -// ------- INSTALL METHODS ------- - -function PreInstall() -{ - echo '
-

ES3 Cloud Installation

-

This will install the ES3 Cloud tables on your MySQL database, and add the required ES3Variables.php file to your server.

-

Please enter your database details below:

-

-

- Database Host:
- -
-
- Database User:
- -
-
- Database Password:
- -
-
- Database Name:
- -
-
- -
-

-
'; -} - -function Install($dbHost, $dbUser, $dbPassword, $dbName, $tableName, $filenameField, $fileDataField, $userField, $lastUpdatedField) -{ - try - { - $db = new PDO("mysql:host=$dbHost;dbname=$dbName", $dbUser, $dbPassword, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_TIMEOUT => 5)); - - $tableExists = $db->query("SELECT * FROM information_schema.tables WHERE table_schema = '$dbName' AND table_name = '$tableName' LIMIT 1;"); - if($tableExists->rowCount() == 0) - { - - // Create the table if it doesn't already exist. - try - { - $createTableQuery = -"CREATE TABLE IF NOT EXISTS `$tableName` ( -`$filenameField` varchar(200) NOT NULL, -`$fileDataField` longblob NOT NULL, -`$userField` varchar(64) NOT NULL, -`$lastUpdatedField` int(11) unsigned NOT NULL DEFAULT '0', -PRIMARY KEY (`$filenameField`,`$userField`) -) ENGINE=InnoDB COLLATE=utf8_unicode_ci CHARSET=utf8;"; - $db->query($createTableQuery); - } - catch (PDOException $e) - { - echo "

Could not create tables on database. Database threw error:

".$e->getMessage()."

-

To manually install the MySQL tables, please run the following SQL code on your database:

-
$createTableQuery
"; - exit(); - } - } - - - try - { - $apiKey = substr(md5(microtime()),rand(0,26),12); - $phpScript = -""; - - // Check that path is writable or file_put_contents is supported. - if(!function_exists("file_put_contents")) - { - ManuallyInstall($phpScript); - exit(); - } - else - { - file_put_contents("ES3Variables.php", $phpScript); - } - } - catch(Exception $e) - { - ManuallyInstall($phpScript); - exit(); - } - - if(!file_exists("ES3Variables.php")) - { - ManuallyInstall($phpScript); - exit(); - } - - echo - " -
-

Successfully installed ES3Cloud

-

IMPORTANT:
Please take note of your API key below. You will need to use it whenever using the API.

-

Your API key can also be found in the ES3Variables.php file which has just been installed.

-

API Key: $apiKey

-
- "; - } - catch(PDOException $e) - { - echo "

Database could not be accessed with these details. The database returned the following error:

" . $e->getMessage() . "

"; - PreInstall(); - exit(); - } -} - -function ManuallyInstall($phpScript) -{ - echo "

Couldn't create PHP file on your server. This could be because file_put_contents is not supported on your server, or you do not have permission to write files to this folder on your server.

-

To manually install the PHP file, please create a file named ES3Variables.php in the same directory as your ES3Cloud.php file with the following contents:

-
$phpScript
-

After creating this file, installation will be complete.

"; -} - -?> \ No newline at end of file diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 534b720..b3e4c24 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -123,7 +123,7 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &43803870 +--- !u!1 &963133975 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -131,91 +131,58 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 43803872} - - component: {fileID: 43803871} + - component: {fileID: 963133978} + - component: {fileID: 963133977} + - component: {fileID: 963133976} m_Layer: 0 - m_Name: Systems + m_Name: EventSystem m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &43803871 +--- !u!114 &963133976 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 43803870} + m_GameObject: {fileID: 963133975} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ee87409a8bbc74fd597a44cc71e46e4c, type: 3} + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!4 &43803872 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 43803870} - serializedVersion: 2 - 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: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &485452622 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 485452624} - - component: {fileID: 485452623} - m_Layer: 0 - m_Name: RainbowHierarchyRuleset - m_TagString: EditorOnly - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &485452623 + m_SendPointerHoverToParent: 1 + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &963133977 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 485452622} + m_GameObject: {fileID: 963133975} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -1774853514, guid: ebe26e22332665d4c8332b2a624e5e8b, type: 3} + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} m_Name: m_EditorClassIdentifier: - Rules: - - Type: 0 - Name: - GameObject: {fileID: 43803870} - Ordinal: 0 - Priority: 0 - IconType: 109000 - IconTexture: {fileID: 0} - IsIconRecursive: 0 - BackgroundType: 1000 - BackgroundTexture: {fileID: 0} - IsBackgroundRecursive: 0 - IsHidden: 0 ---- !u!4 &485452624 + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &963133978 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 485452622} + m_GameObject: {fileID: 963133975} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} @@ -316,10 +283,111 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2097787834 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2097787838} + - component: {fileID: 2097787837} + - component: {fileID: 2097787836} + - component: {fileID: 2097787835} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2097787835 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2097787834} + 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: 55 +--- !u!114 &2097787836 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2097787834} + 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 &2097787837 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2097787834} + 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_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &2097787838 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2097787834} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 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!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 m_Roots: - {fileID: 2011406669} - - {fileID: 43803872} - - {fileID: 485452624} + - {fileID: 2097787838} + - {fileID: 963133978} diff --git a/Assets/Scenes/SceneTemplate/Scene/T-Canvas.unity b/Assets/Scenes/SceneTemplate/Scene/T-Canvas.unity new file mode 100644 index 0000000..5104e77 --- /dev/null +++ b/Assets/Scenes/SceneTemplate/Scene/T-Canvas.unity @@ -0,0 +1,393 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &929306518 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 929306521} + - component: {fileID: 929306520} + - component: {fileID: 929306519} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &929306519 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 929306518} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &929306520 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 929306518} + 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 &929306521 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 929306518} + serializedVersion: 2 + 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: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1073977167 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1073977171} + - component: {fileID: 1073977170} + - component: {fileID: 1073977169} + - component: {fileID: 1073977168} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1073977168 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073977167} + 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: 55 +--- !u!114 &1073977169 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073977167} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &1073977170 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073977167} + 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_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &1073977171 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073977167} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 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!1 &1295524029 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1295524032} + - component: {fileID: 1295524031} + - component: {fileID: 1295524030} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1295524030 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1295524029} + m_Enabled: 1 +--- !u!20 &1295524031 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1295524029} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1295524032 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1295524029} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1295524032} + - {fileID: 1073977171} + - {fileID: 929306521} diff --git a/Assets/Plugins/Easy Save 3/Web/ES3Cloud.php.meta b/Assets/Scenes/SceneTemplate/Scene/T-Canvas.unity.meta similarity index 74% rename from Assets/Plugins/Easy Save 3/Web/ES3Cloud.php.meta rename to Assets/Scenes/SceneTemplate/Scene/T-Canvas.unity.meta index da1459d..7d7ead1 100644 --- a/Assets/Plugins/Easy Save 3/Web/ES3Cloud.php.meta +++ b/Assets/Scenes/SceneTemplate/Scene/T-Canvas.unity.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5b891e253fd1a40e999dd9064b8a0d6f +guid: 426094fa87b523f4abd2a1bff05d3463 DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Scenes/SceneTemplate/Scene/T-MainScene.unity b/Assets/Scenes/SceneTemplate/Scene/T-MainScene.unity index 260027b..6ea67dd 100644 --- a/Assets/Scenes/SceneTemplate/Scene/T-MainScene.unity +++ b/Assets/Scenes/SceneTemplate/Scene/T-MainScene.unity @@ -793,31 +793,7 @@ MonoBehaviour: m_Script: {fileID: -1774853514, guid: ebe26e22332665d4c8332b2a624e5e8b, type: 3} m_Name: m_EditorClassIdentifier: - Rules: - - Type: 0 - Name: - GameObject: {fileID: 345342244} - Ordinal: 0 - Priority: 0 - IconType: 168500 - IconTexture: {fileID: 0} - IsIconRecursive: 0 - BackgroundType: 4000 - BackgroundTexture: {fileID: 0} - IsBackgroundRecursive: 0 - IsHidden: 0 - - Type: 0 - Name: - GameObject: {fileID: 1503614891} - Ordinal: 1 - Priority: 0 - IconType: 290000 - IconTexture: {fileID: 0} - IsIconRecursive: 0 - BackgroundType: 0 - BackgroundTexture: {fileID: 0} - IsBackgroundRecursive: 0 - IsHidden: 0 + Rules: [] --- !u!4 &1688790270 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/SceneTemplate/Template/Canvas.scenetemplate b/Assets/Scenes/SceneTemplate/Template/Canvas.scenetemplate new file mode 100644 index 0000000..b793f8a --- /dev/null +++ b/Assets/Scenes/SceneTemplate/Template/Canvas.scenetemplate @@ -0,0 +1,22 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 13966, guid: 0000000000000000e000000000000000, type: 0} + m_Name: Canvas + m_EditorClassIdentifier: + templateScene: {fileID: 102900000, guid: 426094fa87b523f4abd2a1bff05d3463, type: 3} + templateName: + description: + preview: {fileID: 0} + dependencies: [] + templatePipeline: {fileID: 0} + badge: {fileID: 0} + addToDefaults: 0 diff --git a/Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset.meta b/Assets/Scenes/SceneTemplate/Template/Canvas.scenetemplate.meta similarity index 79% rename from Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset.meta rename to Assets/Scenes/SceneTemplate/Template/Canvas.scenetemplate.meta index 59d030d..6cdfd59 100644 --- a/Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset.meta +++ b/Assets/Scenes/SceneTemplate/Template/Canvas.scenetemplate.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 64ad674dc691def4bab10c337bdc495b +guid: 2675a66fcda07f84bac36b11f05762df NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Assets/Scenes/UI.meta b/Assets/Scenes/UI.meta new file mode 100644 index 0000000..6ce6209 --- /dev/null +++ b/Assets/Scenes/UI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 67546c1ae9a93be469210aa49f47f2bb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/UI/Manufacturer_Page.unity b/Assets/Scenes/UI/Manufacturer_Page.unity new file mode 100644 index 0000000..2162afe --- /dev/null +++ b/Assets/Scenes/UI/Manufacturer_Page.unity @@ -0,0 +1,545 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &215593100 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 215593101} + - component: {fileID: 215593103} + - component: {fileID: 215593102} + m_Layer: 5 + m_Name: Common_Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &215593101 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 215593100} + 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: 1073977171} + 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: 1920, y: 1080} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &215593102 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 215593100} + 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: 92487f7207006c94f965bb75bf2df685, 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!222 &215593103 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 215593100} + m_CullTransparentMesh: 1 +--- !u!1 &353832460 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 353832461} + - component: {fileID: 353832463} + - component: {fileID: 353832462} + m_Layer: 5 + m_Name: Mp_Logo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &353832461 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353832460} + 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: 1073977171} + 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: 434, y: 518} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &353832462 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353832460} + 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: a8807547c4cfb394f8e1f817327f176a, 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!222 &353832463 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353832460} + m_CullTransparentMesh: 1 +--- !u!1 &929306518 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 929306521} + - component: {fileID: 929306520} + - component: {fileID: 929306519} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &929306519 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 929306518} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &929306520 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 929306518} + 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 &929306521 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 929306518} + serializedVersion: 2 + 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: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1073977167 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1073977171} + - component: {fileID: 1073977170} + - component: {fileID: 1073977169} + - component: {fileID: 1073977168} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1073977168 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073977167} + 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: 55 +--- !u!114 &1073977169 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073977167} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &1073977170 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073977167} + 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_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &1073977171 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073977167} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 215593101} + - {fileID: 353832461} + m_Father: {fileID: 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!1 &1295524029 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1295524032} + - component: {fileID: 1295524031} + - component: {fileID: 1295524030} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1295524030 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1295524029} + m_Enabled: 1 +--- !u!20 &1295524031 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1295524029} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1295524032 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1295524029} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1295524032} + - {fileID: 1073977171} + - {fileID: 929306521} diff --git a/Assets/Plugins/Easy Save 3/Editor/EasySave3Editor.asmdef.disabled.meta b/Assets/Scenes/UI/Manufacturer_Page.unity.meta similarity index 74% rename from Assets/Plugins/Easy Save 3/Editor/EasySave3Editor.asmdef.disabled.meta rename to Assets/Scenes/UI/Manufacturer_Page.unity.meta index 5de07cc..3003f2c 100644 --- a/Assets/Plugins/Easy Save 3/Editor/EasySave3Editor.asmdef.disabled.meta +++ b/Assets/Scenes/UI/Manufacturer_Page.unity.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5c64090e866862f449075dc1f3e5ab06 +guid: 18d38a4bd4a5a134cae7a9e4fffc6fa7 DefaultImporter: externalObjects: {} userData: diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 4117f10..46b0d55 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -771,7 +771,7 @@ PlayerSettings: webGLDebugSymbols: 1 webGLEmscriptenArgs: ' -s TOTAL_MEMORY=128MB' webGLModulesDirectory: - webGLTemplate: APPLICATION:Default + webGLTemplate: APPLICATION:Minimal webGLAnalyzeBuildSize: 0 webGLUseEmbeddedResources: 0 webGLCompressionFormat: 2 diff --git a/project.config.json b/project.config.json index 265eaf4..2349842 100644 --- a/project.config.json +++ b/project.config.json @@ -3,17 +3,18 @@ "projectname": "SmallGame", "unity": { "build": { - "webgl": "/Users/yyl/Desktop/wasm/webgl_package-20240812_172358.zip", + "webgl": "C:\\Users\\PDean\\Desktop\\wasm\\webgl_package-20240903_015435.zip", "native": { "il2cpp": "", - "apk": "" + "apk": "", + "fullApk": "" }, "instantGame": "" }, "publishType": "2", - "starkSdkVersion": "5.50.398", - "unityToolsVersion": "3.30.4", + "starkSdkVersion": "5.50.418", + "unityToolsVersion": "3.31.2", "unityEngineVersion": "2022.3.13f1", "arch": "both" } -} +} \ No newline at end of file