diff --git a/Carter Games.meta b/Carter Games.meta
new file mode 100644
index 0000000..c41e57f
--- /dev/null
+++ b/Carter Games.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3a9dc99e7c62f514897c3ae3ee6bf75f
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene.meta b/Carter Games/Multi Scene.meta
new file mode 100644
index 0000000..7783afb
--- /dev/null
+++ b/Carter Games/Multi Scene.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3385257a5b985f342ad675e16dda8868
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Art.meta b/Carter Games/Multi Scene/Art.meta
new file mode 100644
index 0000000..953f0b0
--- /dev/null
+++ b/Carter Games/Multi Scene/Art.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 29bfdb7fa93d4f43b5baa22b69d73a11
+timeCreated: 1716403118
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Art/File Icons.meta b/Carter Games/Multi Scene/Art/File Icons.meta
new file mode 100644
index 0000000..1edae47
--- /dev/null
+++ b/Carter Games/Multi Scene/Art/File Icons.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 65708761e7334de98b14062fc6e08dce
+timeCreated: 1716403622
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_BookIcon.png b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_BookIcon.png
new file mode 100644
index 0000000..d35e030
Binary files /dev/null and b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_BookIcon.png differ
diff --git a/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_BookIcon.png.meta b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_BookIcon.png.meta
new file mode 100644
index 0000000..184b39c
--- /dev/null
+++ b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_BookIcon.png.meta
@@ -0,0 +1,132 @@
+fileFormatVersion: 2
+guid: 65a64cdde33454b4dae05f56cefd732a
+TextureImporter:
+ internalIDToNameTable: []
+ externalObjects: {}
+ serializedVersion: 11
+ 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
+ isReadable: 0
+ streamingMipmaps: 0
+ streamingMipmapsPriority: 0
+ vTOnly: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 0
+ seamlessCubemap: 0
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: -1
+ aniso: 1
+ mipBias: -100
+ 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: 2
+ textureShape: 1
+ singleChannelComponent: 0
+ flipbookRows: 1
+ flipbookColumns: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ ignorePngGamma: 0
+ applyGammaDecoding: 0
+ platformSettings:
+ - serializedVersion: 3
+ buildTarget: DefaultTexturePlatform
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Standalone
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Android
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: WebGL
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ physicsShape: []
+ bones: []
+ spriteID:
+ internalID: 0
+ vertices: []
+ indices:
+ edges: []
+ weights: []
+ secondaryTextures: []
+ spritePackingTag:
+ pSDRemoveMatte: 0
+ pSDShowRemoveMatteOption: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_IndexIcon.png b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_IndexIcon.png
new file mode 100644
index 0000000..da7dce3
Binary files /dev/null and b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_IndexIcon.png differ
diff --git a/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_IndexIcon.png.meta b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_IndexIcon.png.meta
new file mode 100644
index 0000000..3d56b3b
--- /dev/null
+++ b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_IndexIcon.png.meta
@@ -0,0 +1,132 @@
+fileFormatVersion: 2
+guid: 929be2b78e1df4c438fc55fe2ae52463
+TextureImporter:
+ internalIDToNameTable: []
+ externalObjects: {}
+ serializedVersion: 11
+ 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
+ isReadable: 0
+ streamingMipmaps: 0
+ streamingMipmapsPriority: 0
+ vTOnly: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 0
+ seamlessCubemap: 0
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: -1
+ aniso: 1
+ mipBias: -100
+ 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: 2
+ textureShape: 1
+ singleChannelComponent: 0
+ flipbookRows: 1
+ flipbookColumns: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ ignorePngGamma: 0
+ applyGammaDecoding: 0
+ platformSettings:
+ - serializedVersion: 3
+ buildTarget: DefaultTexturePlatform
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Standalone
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Android
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: WebGL
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ physicsShape: []
+ bones: []
+ spriteID:
+ internalID: 0
+ vertices: []
+ indices:
+ edges: []
+ weights: []
+ secondaryTextures: []
+ spritePackingTag:
+ pSDRemoveMatte: 0
+ pSDShowRemoveMatteOption: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Editor/Art/MultiSceneLogo.png b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_Logo_Transparent.png
similarity index 100%
rename from Editor/Art/MultiSceneLogo.png
rename to Carter Games/Multi Scene/Art/File Icons/T_MultiScene_Logo_Transparent.png
diff --git a/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_Logo_Transparent.png.meta b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_Logo_Transparent.png.meta
new file mode 100644
index 0000000..d35838a
--- /dev/null
+++ b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_Logo_Transparent.png.meta
@@ -0,0 +1,132 @@
+fileFormatVersion: 2
+guid: ec937c9290cbd3c4c94eb84467545a97
+TextureImporter:
+ internalIDToNameTable: []
+ externalObjects: {}
+ serializedVersion: 11
+ 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
+ isReadable: 0
+ streamingMipmaps: 0
+ streamingMipmapsPriority: 0
+ vTOnly: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 0
+ seamlessCubemap: 0
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: 1
+ aniso: 1
+ mipBias: 0
+ wrapU: 1
+ wrapV: 1
+ wrapW: 0
+ nPOTScale: 0
+ lightmap: 0
+ compressionQuality: 50
+ spriteMode: 1
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spritePixelsToUnits: 100
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spriteGenerateFallbackPhysicsShape: 1
+ alphaUsage: 1
+ alphaIsTransparency: 1
+ spriteTessellationDetail: -1
+ textureType: 2
+ textureShape: 1
+ singleChannelComponent: 0
+ flipbookRows: 1
+ flipbookColumns: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ ignorePngGamma: 0
+ applyGammaDecoding: 0
+ platformSettings:
+ - serializedVersion: 3
+ buildTarget: DefaultTexturePlatform
+ maxTextureSize: 256
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Standalone
+ maxTextureSize: 256
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: iPhone
+ maxTextureSize: 256
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Android
+ maxTextureSize: 256
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ physicsShape: []
+ bones: []
+ spriteID: 5e97eb03825dee720800000000000000
+ internalID: 0
+ vertices: []
+ indices:
+ edges: []
+ weights: []
+ secondaryTextures: []
+ spritePackingTag:
+ pSDRemoveMatte: 0
+ pSDShowRemoveMatteOption: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_ScriptIcon.png b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_ScriptIcon.png
new file mode 100644
index 0000000..b1805c0
Binary files /dev/null and b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_ScriptIcon.png differ
diff --git a/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_ScriptIcon.png.meta b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_ScriptIcon.png.meta
new file mode 100644
index 0000000..94cf88a
--- /dev/null
+++ b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_ScriptIcon.png.meta
@@ -0,0 +1,132 @@
+fileFormatVersion: 2
+guid: f82d46e5e26774d4baf6eb999379a0dd
+TextureImporter:
+ internalIDToNameTable: []
+ externalObjects: {}
+ serializedVersion: 11
+ 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
+ isReadable: 0
+ streamingMipmaps: 0
+ streamingMipmapsPriority: 0
+ vTOnly: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 0
+ seamlessCubemap: 0
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: -1
+ aniso: 1
+ mipBias: -100
+ 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: 2
+ textureShape: 1
+ singleChannelComponent: 0
+ flipbookRows: 1
+ flipbookColumns: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ ignorePngGamma: 0
+ applyGammaDecoding: 0
+ platformSettings:
+ - serializedVersion: 3
+ buildTarget: DefaultTexturePlatform
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Standalone
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Android
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: WebGL
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ physicsShape: []
+ bones: []
+ spriteID:
+ internalID: 0
+ vertices: []
+ indices:
+ edges: []
+ weights: []
+ secondaryTextures: []
+ spritePackingTag:
+ pSDRemoveMatte: 0
+ pSDShowRemoveMatteOption: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_SettingsIcon.png b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_SettingsIcon.png
new file mode 100644
index 0000000..6887787
Binary files /dev/null and b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_SettingsIcon.png differ
diff --git a/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_SettingsIcon.png.meta b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_SettingsIcon.png.meta
new file mode 100644
index 0000000..fbb5772
--- /dev/null
+++ b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_SettingsIcon.png.meta
@@ -0,0 +1,132 @@
+fileFormatVersion: 2
+guid: aa08e3ea1b2fe054487e19b0e6cd65ae
+TextureImporter:
+ internalIDToNameTable: []
+ externalObjects: {}
+ serializedVersion: 11
+ 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
+ isReadable: 0
+ streamingMipmaps: 0
+ streamingMipmapsPriority: 0
+ vTOnly: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 0
+ seamlessCubemap: 0
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: -1
+ aniso: 1
+ mipBias: -100
+ 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: 2
+ textureShape: 1
+ singleChannelComponent: 0
+ flipbookRows: 1
+ flipbookColumns: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ ignorePngGamma: 0
+ applyGammaDecoding: 0
+ platformSettings:
+ - serializedVersion: 3
+ buildTarget: DefaultTexturePlatform
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Standalone
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Android
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: WebGL
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ physicsShape: []
+ bones: []
+ spriteID:
+ internalID: 0
+ vertices: []
+ indices:
+ edges: []
+ weights: []
+ secondaryTextures: []
+ spritePackingTag:
+ pSDRemoveMatte: 0
+ pSDShowRemoveMatteOption: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_Transparent_Logo.png b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_Transparent_Logo.png
new file mode 100644
index 0000000..1694b5b
Binary files /dev/null and b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_Transparent_Logo.png differ
diff --git a/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_Transparent_Logo.png.meta b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_Transparent_Logo.png.meta
new file mode 100644
index 0000000..d35838a
--- /dev/null
+++ b/Carter Games/Multi Scene/Art/File Icons/T_MultiScene_Transparent_Logo.png.meta
@@ -0,0 +1,132 @@
+fileFormatVersion: 2
+guid: ec937c9290cbd3c4c94eb84467545a97
+TextureImporter:
+ internalIDToNameTable: []
+ externalObjects: {}
+ serializedVersion: 11
+ 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
+ isReadable: 0
+ streamingMipmaps: 0
+ streamingMipmapsPriority: 0
+ vTOnly: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 0
+ seamlessCubemap: 0
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: 1
+ aniso: 1
+ mipBias: 0
+ wrapU: 1
+ wrapV: 1
+ wrapW: 0
+ nPOTScale: 0
+ lightmap: 0
+ compressionQuality: 50
+ spriteMode: 1
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spritePixelsToUnits: 100
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spriteGenerateFallbackPhysicsShape: 1
+ alphaUsage: 1
+ alphaIsTransparency: 1
+ spriteTessellationDetail: -1
+ textureType: 2
+ textureShape: 1
+ singleChannelComponent: 0
+ flipbookRows: 1
+ flipbookColumns: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ ignorePngGamma: 0
+ applyGammaDecoding: 0
+ platformSettings:
+ - serializedVersion: 3
+ buildTarget: DefaultTexturePlatform
+ maxTextureSize: 256
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Standalone
+ maxTextureSize: 256
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: iPhone
+ maxTextureSize: 256
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Android
+ maxTextureSize: 256
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ physicsShape: []
+ bones: []
+ spriteID: 5e97eb03825dee720800000000000000
+ internalID: 0
+ vertices: []
+ indices:
+ edges: []
+ weights: []
+ secondaryTextures: []
+ spritePackingTag:
+ pSDRemoveMatte: 0
+ pSDShowRemoveMatteOption: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Art/Logos.meta b/Carter Games/Multi Scene/Art/Logos.meta
new file mode 100644
index 0000000..32de9ab
--- /dev/null
+++ b/Carter Games/Multi Scene/Art/Logos.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 0dc4f0e6460e44209685e1e4c31a4e6c
+timeCreated: 1716403625
\ No newline at end of file
diff --git a/Editor/Art/CarterGamesBanner.png b/Carter Games/Multi Scene/Art/Logos/T_MultiScene_CarterGamesBanner.png
similarity index 100%
rename from Editor/Art/CarterGamesBanner.png
rename to Carter Games/Multi Scene/Art/Logos/T_MultiScene_CarterGamesBanner.png
diff --git a/Carter Games/Multi Scene/Art/Logos/T_MultiScene_CarterGamesBanner.png.meta b/Carter Games/Multi Scene/Art/Logos/T_MultiScene_CarterGamesBanner.png.meta
new file mode 100644
index 0000000..d708fe8
--- /dev/null
+++ b/Carter Games/Multi Scene/Art/Logos/T_MultiScene_CarterGamesBanner.png.meta
@@ -0,0 +1,132 @@
+fileFormatVersion: 2
+guid: 58a0085126b61ae4bb235ea61474bd07
+TextureImporter:
+ internalIDToNameTable: []
+ externalObjects: {}
+ serializedVersion: 11
+ 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
+ isReadable: 0
+ streamingMipmaps: 0
+ streamingMipmapsPriority: 0
+ vTOnly: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 0
+ seamlessCubemap: 0
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: 1
+ aniso: 1
+ mipBias: 0
+ wrapU: 1
+ wrapV: 1
+ wrapW: 0
+ nPOTScale: 0
+ lightmap: 0
+ compressionQuality: 50
+ spriteMode: 0
+ 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: 2
+ textureShape: 1
+ singleChannelComponent: 0
+ flipbookRows: 1
+ flipbookColumns: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ ignorePngGamma: 0
+ applyGammaDecoding: 0
+ platformSettings:
+ - serializedVersion: 3
+ buildTarget: DefaultTexturePlatform
+ maxTextureSize: 256
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Standalone
+ maxTextureSize: 256
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Android
+ maxTextureSize: 256
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: iPhone
+ maxTextureSize: 256
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ physicsShape: []
+ bones: []
+ spriteID:
+ internalID: 0
+ vertices: []
+ indices:
+ edges: []
+ weights: []
+ secondaryTextures: []
+ spritePackingTag:
+ pSDRemoveMatte: 0
+ pSDShowRemoveMatteOption: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Art/Logos/T_MultiScene_Logo.png b/Carter Games/Multi Scene/Art/Logos/T_MultiScene_Logo.png
new file mode 100644
index 0000000..e527980
Binary files /dev/null and b/Carter Games/Multi Scene/Art/Logos/T_MultiScene_Logo.png differ
diff --git a/Carter Games/Multi Scene/Art/Logos/T_MultiScene_Logo.png.meta b/Carter Games/Multi Scene/Art/Logos/T_MultiScene_Logo.png.meta
new file mode 100644
index 0000000..1573d37
--- /dev/null
+++ b/Carter Games/Multi Scene/Art/Logos/T_MultiScene_Logo.png.meta
@@ -0,0 +1,132 @@
+fileFormatVersion: 2
+guid: 7099966836e44914d9db3e9403627b31
+TextureImporter:
+ internalIDToNameTable: []
+ externalObjects: {}
+ serializedVersion: 11
+ 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
+ isReadable: 0
+ streamingMipmaps: 0
+ streamingMipmapsPriority: 0
+ vTOnly: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 0
+ seamlessCubemap: 0
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: -1
+ aniso: 1
+ mipBias: -100
+ 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: 2
+ textureShape: 1
+ singleChannelComponent: 0
+ flipbookRows: 1
+ flipbookColumns: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ ignorePngGamma: 0
+ applyGammaDecoding: 0
+ platformSettings:
+ - serializedVersion: 3
+ buildTarget: DefaultTexturePlatform
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Standalone
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Android
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: WebGL
+ maxTextureSize: 512
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 1
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ physicsShape: []
+ bones: []
+ spriteID:
+ internalID: 0
+ vertices: []
+ indices:
+ edges: []
+ weights: []
+ secondaryTextures: []
+ spritePackingTag:
+ pSDRemoveMatte: 0
+ pSDShowRemoveMatteOption: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code.meta b/Carter Games/Multi Scene/Code.meta
new file mode 100644
index 0000000..978d3d2
--- /dev/null
+++ b/Carter Games/Multi Scene/Code.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: d67cd8744406485592e00608118b69eb
+timeCreated: 1716403478
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor.meta b/Carter Games/Multi Scene/Code/Editor.meta
new file mode 100644
index 0000000..fd621fb
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 8768dc760a2d82740ba11d0fe74b2be6
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Editor/CarterGames.MultiScene.Editor.asmdef b/Carter Games/Multi Scene/Code/Editor/CarterGames.MultiScene.Editor.asmdef
similarity index 81%
rename from Editor/CarterGames.MultiScene.Editor.asmdef
rename to Carter Games/Multi Scene/Code/Editor/CarterGames.MultiScene.Editor.asmdef
index 0829d59..5194c7f 100644
--- a/Editor/CarterGames.MultiScene.Editor.asmdef
+++ b/Carter Games/Multi Scene/Code/Editor/CarterGames.MultiScene.Editor.asmdef
@@ -2,7 +2,8 @@
"name": "CarterGames.MultiScene.Editor",
"rootNamespace": "CarterGames.Experimental.MultiScene.Editor",
"references": [
- "GUID:dbcc0ddf7638b7144b4a852688291428"
+ "GUID:dbcc0ddf7638b7144b4a852688291428",
+ "GUID:7577fcaa29c957d43a7833215b0209ed"
],
"includePlatforms": [
"Editor"
diff --git a/Carter Games/Multi Scene/Code/Editor/CarterGames.MultiScene.Editor.asmdef.meta b/Carter Games/Multi Scene/Code/Editor/CarterGames.MultiScene.Editor.asmdef.meta
new file mode 100644
index 0000000..bb91e15
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/CarterGames.MultiScene.Editor.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: f87678a7e2b8e594dbc9c0da0f2d688b
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Custom Editors.meta b/Carter Games/Multi Scene/Code/Editor/Custom Editors.meta
new file mode 100644
index 0000000..1ee95e4
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 454ae7520ee9b83459b1616a5b3275c7
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors.meta b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors.meta
new file mode 100644
index 0000000..bc6aa86
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 3eb684f4750542aea3e2c9a90a43e437
+timeCreated: 1662062353
\ No newline at end of file
diff --git a/Editor/Custom Editors/Inspectors/SettingsAssetEditor.cs b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors/AssetGlobalRuntimeSettingsEditor.cs
similarity index 70%
rename from Editor/Custom Editors/Inspectors/SettingsAssetEditor.cs
rename to Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors/AssetGlobalRuntimeSettingsEditor.cs
index 67262f9..e0672ba 100644
--- a/Editor/Custom Editors/Inspectors/SettingsAssetEditor.cs
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors/AssetGlobalRuntimeSettingsEditor.cs
@@ -1,4 +1,27 @@
-using UnityEditor;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using UnityEditor;
using UnityEngine;
namespace CarterGames.Experimental.MultiScene.Editor
@@ -6,8 +29,8 @@ namespace CarterGames.Experimental.MultiScene.Editor
///
/// Custom Inspector for the Multi Scene Settings Asset...
///
- [CustomEditor(typeof(MultiSceneSettingsAsset))]
- public sealed class SettingsAssetEditor : UnityEditor.Editor
+ [CustomEditor(typeof(AssetGlobalRuntimeSettings))]
+ public sealed class AssetGlobalRuntimeSettingsEditor : UnityEditor.Editor
{
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Fields
@@ -19,7 +42,6 @@ public sealed class SettingsAssetEditor : UnityEditor.Editor
private SerializedProperty listenerFreqProp;
private SerializedProperty unloadResourcesProp;
- private SerializedProperty showLogsProp;
private SerializedProperty userGroupProp;
private SerializedProperty defaultGroupProp;
@@ -34,20 +56,17 @@ public sealed class SettingsAssetEditor : UnityEditor.Editor
private void OnEnable()
{
- loadModeProp = serializedObject.FindProperty("sceneGroupLoadMode");
- startGroupProp = serializedObject.FindProperty("startGroup");
- lastGroupProp = serializedObject.FindProperty("lastGroupLoaded");
-
- listenerFreqProp = serializedObject.FindProperty("listenerFrequency");
- unloadResourcesProp = serializedObject.FindProperty("useUnloadResources");
- showLogsProp = serializedObject.FindProperty("showLogs");
+ loadModeProp = serializedObject.Fp("sceneGroupLoadMode");
+ startGroupProp = serializedObject.Fp("startGroup");
+ lastGroupProp = serializedObject.Fp("lastGroupLoaded");
- userGroupProp = serializedObject.FindProperty("userGroupCategories");
- defaultGroupProp = serializedObject.FindProperty("defaultCategories");
- showUserGroupProp = serializedObject.FindProperty("showUserGroupsInSetAsset");
- showDefaultGroupProp = serializedObject.FindProperty("showDefaultGroupsInSetAsset");
+ listenerFreqProp = serializedObject.Fp("listenerFrequency");
+ unloadResourcesProp = serializedObject.Fp("useUnloadResources");
- defaultBackgroundColor = GUI.backgroundColor;
+ userGroupProp = serializedObject.Fp("userGroupCategories");
+ defaultGroupProp = serializedObject.Fp("defaultCategories");
+ showUserGroupProp = serializedObject.Fp("showUserGroupsInSetAsset");
+ showDefaultGroupProp = serializedObject.Fp("showDefaultGroupsInSetAsset");
MultiSceneEditorEvents.Settings.OnSettingChanged.Add(OnSettingUpdate);
}
@@ -61,13 +80,18 @@ private void OnDisable()
public override void OnInspectorGUI()
{
- MultiSceneEditorUtil.DrawSettingsIconOnly();
+ GUILayout.Space(7.5f);
DrawScriptSection();
- DrawEditSettingsButton();
+ GUILayout.Space(5f);
+
DrawGeneralOptions();
+ GUILayout.Space(5f);
DrawSceneGroupOptions();
+ GUILayout.Space(5f);
DrawDefaultSceneGroupCategory();
DrawUserSceneGroupCategory();
+ GUILayout.Space(5f);
+
serializedObject.Update();
}
@@ -89,24 +113,16 @@ private void DrawScriptSection()
EditorGUILayout.BeginVertical("HelpBox");
GUILayout.Space(1.5f);
- GUI.enabled = false;
- EditorGUILayout.ObjectField("Script:", MonoScript.FromScriptableObject(target as MultiSceneSettingsAsset), typeof(MultiSceneSettingsAsset), false);
- GUI.enabled = true;
- }
-
-
- ///
- /// Draws the settings button in the custom inspector...
- ///
- private void DrawEditSettingsButton()
- {
- GUILayout.Space(2f);
- GUI.backgroundColor = MultiSceneEditorUtil.Green;
+ UtilEditor.DrawSoScriptSection((AssetGlobalRuntimeSettings) target);
- if (GUILayout.Button("Edit Settings", GUILayout.Height(25f)))
+ GUILayout.Space(2.5f);
+ UtilEditor.DrawHorizontalGUILine();
+ GUILayout.Space(2.5f);
+
+ if (GUILayout.Button("Edit Settings"))
+ {
SettingsService.OpenProjectSettings("Project/Carter Games/Multi Scene");
-
- GUI.backgroundColor = defaultBackgroundColor;
+ }
GUILayout.Space(2.5f);
EditorGUILayout.EndVertical();
@@ -122,12 +138,12 @@ private void DrawGeneralOptions()
GUILayout.Space(1.5f);
EditorGUILayout.LabelField("General Options", EditorStyles.boldLabel);
+ UtilEditor.DrawHorizontalGUILine();
- GUI.enabled = false;
+ EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.PropertyField(listenerFreqProp);
EditorGUILayout.PropertyField(unloadResourcesProp);
- EditorGUILayout.PropertyField(showLogsProp);
- GUI.enabled = true;
+ EditorGUI.EndDisabledGroup();
GUILayout.Space(2.5f);
EditorGUILayout.EndVertical();
@@ -143,12 +159,13 @@ private void DrawSceneGroupOptions()
GUILayout.Space(1.5f);
EditorGUILayout.LabelField("Scene Group Options", EditorStyles.boldLabel);
+ UtilEditor.DrawHorizontalGUILine();
- GUI.enabled = false;
+ EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.PropertyField(loadModeProp);
EditorGUILayout.PropertyField(startGroupProp);
EditorGUILayout.PropertyField(lastGroupProp);
- GUI.enabled = true;
+ EditorGUI.EndDisabledGroup();
GUILayout.Space(2.5f);
EditorGUILayout.EndVertical();
@@ -164,13 +181,16 @@ private void DrawDefaultSceneGroupCategory()
GUILayout.Space(1.5f);
EditorGUILayout.LabelField("Scene Group Categories", EditorStyles.boldLabel);
+ UtilEditor.DrawHorizontalGUILine();
- GUI.enabled = false;
+ EditorGUI.BeginDisabledGroup(true);
EditorGUI.indentLevel++;
EditorGUI.BeginChangeCheck();
+
showDefaultGroupProp.boolValue = EditorGUILayout.Foldout(showDefaultGroupProp.boolValue, "Pre Defined");
+
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
@@ -186,9 +206,9 @@ private void DrawDefaultSceneGroupCategory()
for (var i = 0; i < defaultGroupProp.arraySize; i++)
{
- var name = defaultGroupProp.GetArrayElementAtIndex(i).FindPropertyRelative("groupName");
- var index = defaultGroupProp.GetArrayElementAtIndex(i).FindPropertyRelative("groupIndex");
- var show = defaultGroupProp.GetArrayElementAtIndex(i).FindPropertyRelative("showGroup");
+ var name = defaultGroupProp.GetIndex(i).Fpr("groupName");
+ var index = defaultGroupProp.GetIndex(i).Fpr("groupIndex");
+ var show = defaultGroupProp.GetIndex(i).Fpr("showGroup");
EditorGUILayout.BeginHorizontal();
EditorGUILayout.PropertyField(name, new GUIContent(name.stringValue.Length > 0 ? name.stringValue : "Element " + i));
@@ -200,6 +220,8 @@ private void DrawDefaultSceneGroupCategory()
GUILayout.Space(2f);
EditorGUILayout.EndVertical();
}
+
+ EditorGUI.EndDisabledGroup();
}
@@ -208,10 +230,13 @@ private void DrawDefaultSceneGroupCategory()
///
private void DrawUserSceneGroupCategory()
{
+ EditorGUI.BeginDisabledGroup(true);
EditorGUI.indentLevel++;
EditorGUI.BeginChangeCheck();
+
showUserGroupProp.boolValue = EditorGUILayout.Foldout(showUserGroupProp.boolValue, "User Defined");
+
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
@@ -227,9 +252,9 @@ private void DrawUserSceneGroupCategory()
for (var i = 0; i < userGroupProp.arraySize; i++)
{
- var name = userGroupProp.GetArrayElementAtIndex(i).FindPropertyRelative("groupName");
- var index = userGroupProp.GetArrayElementAtIndex(i).FindPropertyRelative("groupIndex");
- var show = userGroupProp.GetArrayElementAtIndex(i).FindPropertyRelative("showGroup");
+ var name = userGroupProp.GetIndex(i).Fpr("groupName");
+ var index = userGroupProp.GetIndex(i).Fpr("groupIndex");
+ var show = userGroupProp.GetIndex(i).Fpr("showGroup");
EditorGUILayout.BeginHorizontal();
EditorGUILayout.PropertyField(name, new GUIContent(name.stringValue.Length > 0 ? name.stringValue : "Element " + i));
@@ -242,7 +267,7 @@ private void DrawUserSceneGroupCategory()
EditorGUILayout.EndVertical();
}
- GUI.enabled = true;
+ EditorGUI.EndDisabledGroup();
GUILayout.Space(2.5f);
EditorGUILayout.EndVertical();
}
diff --git a/Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors/AssetGlobalRuntimeSettingsEditor.cs.meta b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors/AssetGlobalRuntimeSettingsEditor.cs.meta
new file mode 100644
index 0000000..44ffc3a
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors/AssetGlobalRuntimeSettingsEditor.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c7327dae71694992bfed288d3eb21d61
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Editor/Custom Editors/Inspectors/SceneGroupEditor.cs b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors/SceneGroupEditor.cs
similarity index 60%
rename from Editor/Custom Editors/Inspectors/SceneGroupEditor.cs
rename to Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors/SceneGroupEditor.cs
index c3c0929..97ddb96 100644
--- a/Editor/Custom Editors/Inspectors/SceneGroupEditor.cs
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors/SceneGroupEditor.cs
@@ -1,4 +1,27 @@
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
@@ -25,9 +48,6 @@ public sealed class SceneGroupEditor : UnityEditor.Editor
private SerializedProperty scenes;
private SceneGroup sceneGroupRef;
-
- private static Color _defaultBgCol;
- private static Color _defaultGUICol;
private string[] allGroupOptions;
private string[] buildSettingsOptions;
@@ -40,17 +60,14 @@ private void OnEnable()
{
sceneGroupRef = target as SceneGroup;
- groupIndex = serializedObject.FindProperty("groupCategoryIndex");
- group = serializedObject.FindProperty("groupCategory");
- index = serializedObject.FindProperty("buttonIndex");
- color = serializedObject.FindProperty("buttonColor");
- label = serializedObject.FindProperty("buttonLabel");
- scenes = serializedObject.FindProperty("scenes");
-
- _defaultBgCol = GUI.backgroundColor;
- _defaultGUICol = GUI.color;
+ groupIndex = serializedObject.Fp("groupCategoryIndex");
+ group = serializedObject.Fp("groupCategory");
+ index = serializedObject.Fp("buttonIndex");
+ color = serializedObject.Fp("buttonColor");
+ label = serializedObject.Fp("buttonLabel");
+ scenes = serializedObject.Fp("scenes");
- allGroupOptions = MultiSceneEditorUtil.Settings.AllGroupCategories.Select(t => t.groupName).ToList().ToDisplayOptions();
+ allGroupOptions = UtilEditor.RuntimeSettings.AllGroupCategories.Select(t => t.groupName).ToList().ToDisplayOptions();
buildSettingsOptions = EditorSceneHelper.ScenesInBuildSettings.ToDisplayOptions();
EditorSceneHelper.UpdateCaches();
@@ -69,15 +86,18 @@ private void OnDisable()
public override void OnInspectorGUI()
{
- MultiSceneEditorUtil.DrawLogoOnly();
-
// Renders the title for the group...
- DrawSceneGroupTitle();
+ GUILayout.Space(7.5f);
DrawScriptSection();
+ GUILayout.Space(5f);
DrawHelpBox();
+ GUILayout.Space(5f);
DrawMetaData();
+ GUILayout.Space(5f);
DrawToolsSection();
+ GUILayout.Space(5f);
DrawScenesSection();
+ GUILayout.Space(5f);
DrawDangerZoneSection();
// Applies changes if changes have been made...
@@ -98,19 +118,6 @@ private void UpdateSceneNames()
{
buildSettingsOptions = EditorSceneHelper.ScenesInBuildSettings.ToDisplayOptions();
}
-
-
- ///
- /// Renders the title section of the editor...
- ///
- private static void DrawSceneGroupTitle()
- {
- EditorGUILayout.BeginHorizontal();
- GUILayout.FlexibleSpace();
- EditorGUILayout.LabelField(" Scene Group ", EditorStyles.boldLabel, GUILayout.Width(MultiSceneEditorUtil.TextWidth(" Scene Group ")));
- GUILayout.FlexibleSpace();
- EditorGUILayout.EndHorizontal();
- }
///
@@ -118,7 +125,6 @@ private static void DrawSceneGroupTitle()
///
private void DrawScriptSection()
{
- GUILayout.Space(4.5f);
EditorGUILayout.BeginVertical("HelpBox");
GUILayout.Space(1.5f);
@@ -152,21 +158,22 @@ private void DrawMetaData()
GUILayout.Space(1.5f);
EditorGUILayout.LabelField("Meta Data", EditorStyles.boldLabel);
+ UtilEditor.DrawHorizontalGUILine();
EditorGUI.BeginChangeCheck();
- groupIndex.intValue = EditorGUILayout.Popup(new GUIContent("Group Name"), groupIndex.intValue, allGroupOptions);
+ groupIndex.intValue = EditorGUILayout.Popup(new GUIContent("Group Name"), groupIndex.intValue, allGroupOptions);
+ EditorGUILayout.PropertyField(index, new GUIContent("Order In Group"));
+ EditorGUILayout.PropertyField(label, new GUIContent("Button Label"));
+ color.colorValue = EditorGUILayout.ColorField(new GUIContent("Button Colour"), color.colorValue, true, false, false);
+
if (EditorGUI.EndChangeCheck())
{
- group.stringValue = MultiSceneEditorUtil.Settings.AllGroupCategories[groupIndex.intValue].groupName;
+ group.stringValue = UtilEditor.RuntimeSettings.AllGroupCategories[groupIndex.intValue].groupName;
serializedObject.ApplyModifiedProperties();
MultiSceneEditorEvents.SceneGroups.OnSceneGroupCategoryChanged.Raise();
}
- EditorGUILayout.PropertyField(index, new GUIContent("Order In Group"));
- EditorGUILayout.PropertyField(label, new GUIContent("Button Label"));
- color.colorValue = EditorGUILayout.ColorField(new GUIContent("Button Colour"), color.colorValue, true, false, false);
-
GUILayout.Space(1.5f);
EditorGUILayout.EndVertical();
GUILayout.Space(1.5f);
@@ -183,13 +190,16 @@ private void DrawToolsSection()
GUILayout.Space(1.5f);
EditorGUILayout.LabelField("Tools", EditorStyles.boldLabel);
+ UtilEditor.DrawHorizontalGUILine();
- GUI.enabled = sceneGroupRef.IsValid;
+ EditorGUI.BeginDisabledGroup(!sceneGroupRef.IsValid);
+
if (GUILayout.Button("Load Scenes"))
{
LoadSceneGroupInEditor();
}
- GUI.enabled = true;
+
+ EditorGUI.EndDisabledGroup();
GUILayout.Space(1.5f);
EditorGUILayout.EndVertical();
@@ -207,37 +217,33 @@ private void DrawScenesSection()
GUILayout.Space(1.5f);
EditorGUILayout.LabelField("Scenes", EditorStyles.boldLabel);
+ UtilEditor.DrawHorizontalGUILine();
- scenes ??= serializedObject.FindProperty("scenes");
+ scenes ??= serializedObject.Fp("scenes");
// Shows the base field button if there are no entries in the scene group...
if (scenes.arraySize <= 0)
{
- GUI.backgroundColor = MultiSceneEditorUtil.Green;
+ GUI.backgroundColor = UtilEditor.Green;
if (GUILayout.Button("Add Main Scene"))
+ {
CallAddBaseField();
+ }
- GUI.backgroundColor = _defaultBgCol;
+ GUI.backgroundColor = Color.white;
}
else if (scenes.arraySize > 0)
{
+ EditorGUILayout.BeginVertical("Box");
RenderBaseSceneField();
-
- if (scenes.arraySize > 1)
- RenderAdditiveSceneFields();
- else
- {
- if (sceneGroupRef.IsValid)
- {
- GUI.backgroundColor = MultiSceneEditorUtil.Yellow;
-
- if (GUILayout.Button("Add Additive Scene"))
- CallAddNewAdditiveScene();
-
- GUI.backgroundColor = _defaultBgCol;
- }
- }
+ EditorGUILayout.EndVertical();
+
+ GUILayout.Space(2.5f);
+
+ EditorGUILayout.BeginVertical("Box");
+ RenderAdditiveSceneFields();
+ EditorGUILayout.EndVertical();
}
GUILayout.Space(1.5f);
@@ -251,21 +257,27 @@ private void DrawScenesSection()
///
private void DrawDangerZoneSection()
{
+ GUI.backgroundColor = UtilEditor.Red;
+
GUILayout.Space(1.5f);
EditorGUILayout.BeginVertical("HelpBox");
GUILayout.Space(1.5f);
EditorGUILayout.LabelField("Danger Zone", EditorStyles.boldLabel);
- GUI.backgroundColor = MultiSceneEditorUtil.Red;
-
+ GUI.backgroundColor = Color.white;
+ UtilEditor.DrawHorizontalGUILine();
+ GUI.backgroundColor = UtilEditor.Red;
+
if (GUILayout.Button("Reset Group"))
+ {
CallResetGroup();
+ }
- GUI.backgroundColor = _defaultBgCol;
-
GUILayout.Space(1.5f);
EditorGUILayout.EndVertical();
+
+ GUI.backgroundColor = Color.white;
}
@@ -274,7 +286,7 @@ private void DrawDangerZoneSection()
///
private void CallAddBaseField()
{
- scenes.InsertArrayElementAtIndex(0);
+ scenes.InsertIndex(0);
}
@@ -283,30 +295,31 @@ private void CallAddBaseField()
///
private void RenderBaseSceneField()
{
- GUI.backgroundColor = MultiSceneEditorUtil.Green;
- GUI.color = MultiSceneEditorUtil.Green;
+ GUI.backgroundColor = UtilEditor.Green;
+
EditorGUILayout.LabelField("Main Scene", EditorStyles.boldLabel);
- GUI.color = _defaultGUICol;
EditorGUI.BeginChangeCheck();
- scenes.GetArrayElementAtIndex(0).FindPropertyRelative("sceneName").stringValue =
- EditorSceneHelper.ConvertIntToScene(EditorGUILayout.Popup(EditorSceneHelper.ConvertStringToIndex(scenes.GetArrayElementAtIndex(0).FindPropertyRelative("sceneName").stringValue), buildSettingsOptions));
+ var options = UnusedSceneOptions(scenes.GetIndex(0).Fpr("sceneName").stringValue);
+
+ scenes.GetIndex(0).Fpr("sceneName").stringValue =
+ EditorSceneHelper.ConvertIntToScene(EditorGUILayout.Popup(EditorSceneHelper.ConvertStringToIndex(scenes.GetIndex(0).Fpr("sceneName").stringValue, options), options), options);
if (EditorGUI.EndChangeCheck())
{
- var sceneName = scenes.GetArrayElementAtIndex(0).FindPropertyRelative("sceneName").stringValue;
+ var sceneName = scenes.GetIndex(0).Fpr("sceneName").stringValue;
if (EditorSceneHelper.GetAllScenesInProject().ContainsKey(sceneName))
{
- scenes.GetArrayElementAtIndex(0).FindPropertyRelative("scenePath").stringValue = EditorSceneHelper.ScenesInBuildSettings[sceneName];
- scenes.GetArrayElementAtIndex(0).FindPropertyRelative("isInBuildSettings").boolValue = EditorSceneHelper.AllSceneNamesInProject.Contains(sceneName);
+ scenes.GetIndex(0).Fpr("scenePath").stringValue = EditorSceneHelper.ScenesInBuildSettings[sceneName];
+ scenes.GetIndex(0).Fpr("isInBuildSettings").boolValue = EditorSceneHelper.AllSceneNamesInProject.Contains(sceneName);
}
- scenes.GetArrayElementAtIndex(0).serializedObject.ApplyModifiedProperties();
+ scenes.GetIndex(0).serializedObject.ApplyModifiedProperties();
}
- GUI.backgroundColor = _defaultBgCol;
+ GUI.backgroundColor = Color.white;
}
@@ -315,54 +328,75 @@ private void RenderBaseSceneField()
///
private void RenderAdditiveSceneFields()
{
- GUI.backgroundColor = MultiSceneEditorUtil.Yellow;
- GUI.color = MultiSceneEditorUtil.Yellow;
+ GUI.backgroundColor = UtilEditor.Yellow;
+
EditorGUILayout.LabelField("Additive Scene(s)", EditorStyles.boldLabel);
- GUI.color = _defaultGUICol;
- for (var i = 1; i < scenes.arraySize; i++)
+ if (scenes.arraySize <= 1)
{
- EditorGUILayout.BeginHorizontal();
-
- GUI.backgroundColor = MultiSceneEditorUtil.Yellow;
+ if (sceneGroupRef.IsValid)
+ {
+ GUI.backgroundColor = UtilEditor.Yellow;
- EditorGUI.BeginChangeCheck();
- scenes.GetArrayElementAtIndex(i).FindPropertyRelative("sceneName").stringValue =
- EditorSceneHelper.ConvertIntToScene(EditorGUILayout.Popup(
- EditorSceneHelper.ConvertStringToIndex(scenes.GetArrayElementAtIndex(i)
- .FindPropertyRelative("sceneName").stringValue), buildSettingsOptions));
+ if (GUILayout.Button("Add Additive Scene"))
+ {
+ CallAddNewAdditiveScene();
+ }
- if (EditorGUI.EndChangeCheck())
+ GUI.backgroundColor = Color.white;
+ }
+ }
+ else
+ {
+ for (var i = 1; i < scenes.arraySize; i++)
{
- var sceneName = scenes.GetArrayElementAtIndex(i).FindPropertyRelative("sceneName").stringValue;
+ EditorGUILayout.BeginHorizontal();
+
+ GUI.backgroundColor = UtilEditor.Yellow;
+
+ EditorGUI.BeginChangeCheck();
+
+ var options = UnusedSceneOptions(scenes.GetIndex(i).Fpr("sceneName").stringValue);
+
+ scenes.GetIndex(i).Fpr("sceneName").stringValue =
+ EditorSceneHelper.ConvertIntToScene(EditorGUILayout.Popup(
+ EditorSceneHelper.ConvertStringToIndex(scenes.GetIndex(i)
+ .Fpr("sceneName").stringValue, options), options), options);
+
+ if (EditorGUI.EndChangeCheck())
+ {
+ var sceneName = scenes.GetIndex(i).Fpr("sceneName").stringValue;
- if (EditorSceneHelper.GetAllScenesInProject().ContainsKey(sceneName))
+ if (EditorSceneHelper.GetAllScenesInProject().ContainsKey(sceneName))
+ {
+ scenes.GetIndex(i).Fpr("scenePath").stringValue = EditorSceneHelper.GetAllScenesInProject()[sceneName];
+ scenes.GetIndex(i).Fpr("isInBuildSettings").boolValue = EditorSceneHelper.AllSceneNamesInProject.Contains(sceneName);
+ }
+
+ scenes.GetIndex(i).serializedObject.ApplyModifiedProperties();
+ }
+
+ GUI.backgroundColor = UtilEditor.Green;
+
+ if (GUILayout.Button("+", GUILayout.Width(" + ".Width())))
{
- scenes.GetArrayElementAtIndex(i).FindPropertyRelative("scenePath").stringValue =
- EditorSceneHelper.GetAllScenesInProject()[sceneName];
- scenes.GetArrayElementAtIndex(i).FindPropertyRelative("isInBuildSettings").boolValue =
- EditorSceneHelper.AllSceneNamesInProject.Contains(sceneName);
+ CallAddNewAdditiveScene(scenes, i);
}
- scenes.GetArrayElementAtIndex(i).serializedObject.ApplyModifiedProperties();
- }
+ GUI.backgroundColor = UtilEditor.Red;
- GUI.backgroundColor = MultiSceneEditorUtil.Green;
-
- if (GUILayout.Button("+", GUILayout.Width(MultiSceneEditorUtil.TextWidth(" + "))))
- CallAddNewAdditiveScene(scenes, i);
-
- GUI.backgroundColor = MultiSceneEditorUtil.Red;
+ if (GUILayout.Button("-", GUILayout.Width(" - ".Width())))
+ {
+ CallRemoveElementAtIndex(scenes, i);
+ }
- if (GUILayout.Button("-", GUILayout.Width(MultiSceneEditorUtil.TextWidth(" - "))))
- CallRemoveElementAtIndex(scenes, i);
+ GUI.backgroundColor = Color.white;
- GUI.backgroundColor = _defaultBgCol;
-
- EditorGUILayout.EndHorizontal();
+ EditorGUILayout.EndHorizontal();
+ }
}
- GUI.backgroundColor = _defaultBgCol;
+ GUI.backgroundColor = Color.white;
}
@@ -372,19 +406,20 @@ private void RenderAdditiveSceneFields()
/// The element to edit
private void CallRemoveElementAtIndex(SerializedProperty prop, int i)
{
- prop.DeleteArrayElementAtIndex(i);
+ prop.DeleteIndex(i);
}
+
///
/// Adds a new element to the scenes list that is blank at the element entered.
///
/// The element to edit
private void CallAddNewAdditiveScene(SerializedProperty prop, int i)
{
- prop.InsertArrayElementAtIndex(i);
- prop.GetArrayElementAtIndex(i + 1).FindPropertyRelative("sceneName").stringValue = string.Empty;
- scenes.GetArrayElementAtIndex(scenes.arraySize - 1).FindPropertyRelative("scenePath").stringValue = string.Empty;
- scenes.GetArrayElementAtIndex(scenes.arraySize - 1).FindPropertyRelative("isInBuildSettings").boolValue = false;
+ prop.InsertIndex(i);
+ prop.GetIndex(i + 1).Fpr("sceneName").stringValue = string.Empty;
+ scenes.GetIndex(scenes.arraySize - 1).Fpr("scenePath").stringValue = string.Empty;
+ scenes.GetIndex(scenes.arraySize - 1).Fpr("isInBuildSettings").boolValue = false;
}
@@ -393,10 +428,10 @@ private void CallAddNewAdditiveScene(SerializedProperty prop, int i)
///
private void CallAddNewAdditiveScene()
{
- scenes.InsertArrayElementAtIndex(scenes.arraySize - 1);
- scenes.GetArrayElementAtIndex(scenes.arraySize - 1).FindPropertyRelative("sceneName").stringValue = string.Empty;
- scenes.GetArrayElementAtIndex(scenes.arraySize - 1).FindPropertyRelative("scenePath").stringValue = string.Empty;
- scenes.GetArrayElementAtIndex(scenes.arraySize - 1).FindPropertyRelative("isInBuildSettings").boolValue = false;
+ scenes.InsertIndex(scenes.arraySize - 1);
+ scenes.GetIndex(scenes.arraySize - 1).Fpr("sceneName").stringValue = string.Empty;
+ scenes.GetIndex(scenes.arraySize - 1).Fpr("scenePath").stringValue = string.Empty;
+ scenes.GetIndex(scenes.arraySize - 1).Fpr("isInBuildSettings").boolValue = false;
scenes.serializedObject.ApplyModifiedProperties();
scenes.serializedObject.Update();
}
@@ -421,33 +456,39 @@ private void CallResetGroup()
///
private void LoadSceneGroupInEditor()
{
- var _sceneList = new List();
+ var sceneList = new List();
for (var i = 0; i < scenes.arraySize; i++)
{
- var path = scenes.GetArrayElementAtIndex(i).FindPropertyRelative("scenePath").stringValue;
+ var path = scenes.GetIndex(i).Fpr("scenePath").stringValue;
+
if (path.Length <= 0)
{
- MsLog.Error(
+ MultiSceneLogger.Error(
"Unable to load group in editor as a scene doesn't have a valid path to load from...");
return;
}
- _sceneList.Add(scenes.GetArrayElementAtIndex(i).FindPropertyRelative("scenePath").stringValue);
+
+ sceneList.Add(scenes.GetIndex(i).Fpr("scenePath").stringValue);
}
- if (_sceneList.Count <= 0) return;
+ if (sceneList.Count <= 0) return;
- for (var i = 0; i < _sceneList.Count; i++)
+ for (var i = 0; i < sceneList.Count; i++)
{
- var _scene = _sceneList[i];
+ var _scene = sceneList[i];
if (i.Equals(0))
+ {
EditorSceneManager.OpenScene(_scene, OpenSceneMode.Single);
+ }
else
+ {
EditorSceneManager.OpenScene(_scene, OpenSceneMode.Additive);
+ }
}
- MultiSceneEditorUtil.Settings.LastGroup = target as SceneGroup;
+ UtilEditor.RuntimeSettings.LastGroup = target as SceneGroup;
MultiSceneEditorEvents.SceneGroups.OnSceneGroupLoadedInEditor.Raise();
}
@@ -457,18 +498,46 @@ private void LoadSceneGroupInEditor()
private void RefreshCategoryOptions()
{
- allGroupOptions = MultiSceneEditorUtil.Settings.AllGroupCategories.Select(t => t.groupName).ToList().ToDisplayOptions();
+ allGroupOptions = UtilEditor.RuntimeSettings.AllGroupCategories.Select(t => t.groupName).ToList().ToDisplayOptions();
if (groupIndex.intValue >= allGroupOptions.Length)
{
groupIndex.intValue = 0;
- group.stringValue = MultiSceneEditorUtil.Settings.AllGroupCategories[groupIndex.intValue].groupName;
+ group.stringValue = UtilEditor.RuntimeSettings.AllGroupCategories[groupIndex.intValue].groupName;
- MsLog.Warning($"The category that was selected by: {target.name} has been removed. The group was moved to unassigned automatically due to this change.");
+ MultiSceneLogger.Warning($"The category that was selected by: {target.name} has been removed. The group was moved to unassigned automatically due to this change.");
}
serializedObject.ApplyModifiedProperties();
serializedObject.Update();
}
+
+
+ private string[] UnusedSceneOptions(string currentlySelected)
+ {
+ var list = new List();
+
+ foreach (var sceneName in buildSettingsOptions)
+ {
+ if (currentlySelected != null)
+ {
+ if (sceneName == currentlySelected)
+ {
+ list.Add(sceneName);
+ continue;
+ }
+ }
+
+ for (var i = 0; i < scenes.arraySize; i++)
+ {
+ if (scenes.GetIndex(i).Fpr("sceneName").stringValue == sceneName) goto SkipAdd;
+ }
+
+ list.Add(sceneName);
+ SkipAdd: ;
+ }
+
+ return list.ToArray();
+ }
}
}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors/SceneGroupEditor.cs.meta b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors/SceneGroupEditor.cs.meta
new file mode 100644
index 0000000..8cbff8b
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Inspectors/SceneGroupEditor.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 11f2dde539f6cf34694598b921214ca9
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers.meta b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers.meta
new file mode 100644
index 0000000..a07e930
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 8be8b49c3f9d43f897d3824b60d4815d
+timeCreated: 1662017123
\ No newline at end of file
diff --git a/Editor/Custom Editors/Property Drawers/DefaultGroupCategoryDrawer.cs b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers/DefaultGroupCategoryDrawer.cs
similarity index 57%
rename from Editor/Custom Editors/Property Drawers/DefaultGroupCategoryDrawer.cs
rename to Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers/DefaultGroupCategoryDrawer.cs
index 1594f68..5cc79ae 100644
--- a/Editor/Custom Editors/Property Drawers/DefaultGroupCategoryDrawer.cs
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers/DefaultGroupCategoryDrawer.cs
@@ -1,4 +1,27 @@
-using UnityEditor;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using UnityEditor;
using UnityEngine;
namespace CarterGames.Experimental.MultiScene.Editor
@@ -13,8 +36,8 @@ public sealed class DefaultGroupCategoryDrawer : PropertyDrawer
| Fields
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
- private static SerializedProperty _nameProp;
- private static SerializedProperty _indexProp;
+ private static SerializedProperty nameProp;
+ private static SerializedProperty indexProp;
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Drawer Method
@@ -25,24 +48,26 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
label = EditorGUI.BeginProperty(position, label, property);
position = EditorGUI.PrefixLabel(position, label);
- _nameProp = property.FindPropertyRelative("groupName");
- _indexProp = property.FindPropertyRelative("groupIndex");
+ nameProp = property.Fpr("groupName");
+ indexProp = property.Fpr("groupIndex");
EditorGUI.BeginChangeCheck();
int indent = EditorGUI.indentLevel;
EditorGUI.indentLevel = 0;
- var _left = new Rect(position.x, position.y, (position.width / 4) * 3 - 1.5f, EditorGUIUtility.singleLineHeight);
- var _right = new Rect(position.x + position.width / 4 * 3 + 1.5f, position.y, (position.width / 4) - 1.5f, EditorGUIUtility.singleLineHeight);
+ var leftRect = new Rect(position.x, position.y, (position.width / 4) * 3 - 1.5f, EditorGUIUtility.singleLineHeight);
+ var rightRect = new Rect(position.x + position.width / 4 * 3 + 1.5f, position.y, (position.width / 4) - 1.5f, EditorGUIUtility.singleLineHeight);
GUI.enabled = false;
- EditorGUI.PropertyField(_left, _nameProp, GUIContent.none);
+ EditorGUI.PropertyField(leftRect, nameProp, GUIContent.none);
GUI.enabled = true;
- EditorGUI.PropertyField(_right, _indexProp, GUIContent.none);
+ EditorGUI.PropertyField(rightRect, indexProp, GUIContent.none);
if (EditorGUI.EndChangeCheck())
- property.serializedObject.ApplyModifiedProperties();
+ {
+ property.serializedObject.ApplyModifiedProperties();
+ }
EditorGUI.indentLevel = indent;
EditorGUI.EndProperty();
diff --git a/Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers/DefaultGroupCategoryDrawer.cs.meta b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers/DefaultGroupCategoryDrawer.cs.meta
new file mode 100644
index 0000000..399f19b
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers/DefaultGroupCategoryDrawer.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 886ed522ba4845b1a875e3a48d6d3bd1
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Editor/Custom Editors/Property Drawers/GroupCategoryDrawer.cs b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers/GroupCategoryDrawer.cs
similarity index 56%
rename from Editor/Custom Editors/Property Drawers/GroupCategoryDrawer.cs
rename to Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers/GroupCategoryDrawer.cs
index ba20ab6..93094f2 100644
--- a/Editor/Custom Editors/Property Drawers/GroupCategoryDrawer.cs
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers/GroupCategoryDrawer.cs
@@ -1,4 +1,27 @@
-using UnityEditor;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using UnityEditor;
using UnityEngine;
namespace CarterGames.Experimental.MultiScene.Editor
@@ -13,8 +36,8 @@ public sealed class GroupCategoryDrawer : PropertyDrawer
| Fields
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
- private static SerializedProperty _nameProp;
- private static SerializedProperty _indexProp;
+ private static SerializedProperty nameProp;
+ private static SerializedProperty indexProp;
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Drawer Method
@@ -25,22 +48,24 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
label = EditorGUI.BeginProperty(position, label, property);
position = EditorGUI.PrefixLabel(position, label);
- _nameProp = property.FindPropertyRelative("groupName");
- _indexProp = property.FindPropertyRelative("groupIndex");
+ nameProp = property.Fpr("groupName");
+ indexProp = property.Fpr("groupIndex");
EditorGUI.BeginChangeCheck();
int indent = EditorGUI.indentLevel;
EditorGUI.indentLevel = 0;
- var _left = new Rect(position.x, position.y, (position.width / 4) * 3 - 1.5f, EditorGUIUtility.singleLineHeight);
- var _right = new Rect(position.x + position.width / 4 * 3 + 1.5f, position.y, (position.width / 4) - 1.5f, EditorGUIUtility.singleLineHeight);
+ var leftRect = new Rect(position.x, position.y, (position.width / 4) * 3 - 1.5f, EditorGUIUtility.singleLineHeight);
+ var rightRect = new Rect(position.x + position.width / 4 * 3 + 1.5f, position.y, (position.width / 4) - 1.5f, EditorGUIUtility.singleLineHeight);
- EditorGUI.PropertyField(_left, _nameProp, GUIContent.none);
- EditorGUI.PropertyField(_right, _indexProp, GUIContent.none);
+ EditorGUI.PropertyField(leftRect, nameProp, GUIContent.none);
+ EditorGUI.PropertyField(rightRect, indexProp, GUIContent.none);
if (EditorGUI.EndChangeCheck())
- property.serializedObject.ApplyModifiedProperties();
+ {
+ property.serializedObject.ApplyModifiedProperties();
+ }
EditorGUI.indentLevel = indent;
EditorGUI.EndProperty();
diff --git a/Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers/GroupCategoryDrawer.cs.meta b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers/GroupCategoryDrawer.cs.meta
new file mode 100644
index 0000000..b9ed813
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Property Drawers/GroupCategoryDrawer.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6fd0d64a6add4aa6addfa958aab34a9e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Custom Editors/Windows.meta b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Windows.meta
new file mode 100644
index 0000000..1df74e7
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Windows.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 727e9420aa8b4d3fa94e995331041604
+timeCreated: 1716405347
\ No newline at end of file
diff --git a/Editor/Editor Windows/SceneGroupLoader.cs b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Windows/SceneGroupLoader.cs
similarity index 79%
rename from Editor/Editor Windows/SceneGroupLoader.cs
rename to Carter Games/Multi Scene/Code/Editor/Custom Editors/Windows/SceneGroupLoader.cs
index ddd39b6..e5a194e 100644
--- a/Editor/Editor Windows/SceneGroupLoader.cs
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Windows/SceneGroupLoader.cs
@@ -1,4 +1,27 @@
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEditor.SceneManagement;
@@ -38,7 +61,7 @@ private static void ShowWindow()
var window = GetWindow();
window.titleContent = new GUIContent("Scene Group Loader")
{
- image = MultiSceneEditorUtil.LogoTransparent
+ image = UtilEditor.MultiSceneTransparentLogo
};
window.Show();
@@ -56,7 +79,7 @@ private void OnEnable()
MultiSceneEditorEvents.SceneGroups.OnSceneGroupCreated.Add(UpdateData);
MultiSceneEditorEvents.SceneGroups.OnSceneGroupCategoryChanged.Add(UpdateData);
- allCategories = MultiSceneEditorUtil.Settings.AllGroupCategories;
+ allCategories = UtilEditor.RuntimeSettings.AllGroupCategories;
backgroundColor = GUI.backgroundColor;
GetAllGroups();
UpdateData();
@@ -88,7 +111,9 @@ private void OnGUI()
if (allGroups == null)
+ {
GetAllGroups();
+ }
if (allGroups == null) return;
@@ -101,8 +126,7 @@ private void OnGUI()
DrawGroupsAndButtons(GUI.enabled);
EditorGUILayout.EndScrollView();
}
-
-
+
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Methods
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
@@ -161,18 +185,20 @@ private void DrawGroupsAndButtons(bool isEnabled)
EditorGUILayout.BeginVertical("HelpBox");
EditorGUI.BeginChangeCheck();
+
groupCat.showGroup = EditorGUILayout.Foldout(groupCat.showGroup, groupCat.groupName.Length > 0 ? groupCat.groupName : "No Category");
+
if (EditorGUI.EndChangeCheck())
{
- var obj = MultiSceneSettings.SettingsAssetObject;
+ var obj = MultiSceneSettingsProvider.SettingsAssetObject;
- var dGroups = obj.FindProperty("defaultCategories");
- var uGroups = obj.FindProperty("userGroupCategories");
+ var dGroups = obj.Fp("defaultCategories");
+ var uGroups = obj.Fp("userGroupCategories");
for (var i = 0; i < dGroups.arraySize; i++)
{
- if (!dGroups.GetArrayElementAtIndex(i).FindPropertyRelative("groupName").stringValue.Equals(groupCat.groupName)) continue;
- dGroups.GetArrayElementAtIndex(i).FindPropertyRelative("showGroup").boolValue = groupCat.showGroup;
+ if (!dGroups.GetIndex(i).Fpr("groupName").stringValue.Equals(groupCat.groupName)) continue;
+ dGroups.GetIndex(i).Fpr("showGroup").boolValue = groupCat.showGroup;
obj.ApplyModifiedProperties();
obj.Update();
goto EndCheck;
@@ -180,8 +206,8 @@ private void DrawGroupsAndButtons(bool isEnabled)
for (var i = 0; i < uGroups.arraySize; i++)
{
- if (!uGroups.GetArrayElementAtIndex(i).FindPropertyRelative("groupName").stringValue.Equals(groupCat.groupName)) continue;
- uGroups.GetArrayElementAtIndex(i).FindPropertyRelative("showGroup").boolValue = groupCat.showGroup;
+ if (!uGroups.GetIndex(i).Fpr("groupName").stringValue.Equals(groupCat.groupName)) continue;
+ uGroups.GetIndex(i).Fpr("showGroup").boolValue = groupCat.showGroup;
obj.ApplyModifiedProperties();
obj.Update();
}
@@ -226,7 +252,7 @@ private void DrawGroupsAndButtons(bool isEnabled)
///
private void UpdateCachedValues()
{
- allCategories = MultiSceneEditorUtil.Settings.AllGroupCategories;
+ allCategories = UtilEditor.RuntimeSettings.AllGroupCategories;
}
@@ -235,19 +261,7 @@ private void UpdateCachedValues()
///
private void GetAllGroups()
{
- var _assetsFound = AssetDatabase.FindAssets("t:scenegroup", null);
-
- if (_assetsFound.Length <= 0) return;
-
- allGroups = new List();
-
- foreach (var _asset in _assetsFound)
- {
- var _path = AssetDatabase.GUIDToAssetPath(_asset);
- var _loadedGroup = (SceneGroup)AssetDatabase.LoadAssetAtPath(_path, typeof(SceneGroup));
-
- allGroups.Add(_loadedGroup);
- }
+ allGroups = AssetAccessor.GetAssets().Where(t => t != null).ToList();
}
@@ -257,26 +271,31 @@ private void GetAllGroups()
/// The group to load.
private static void LoadSceneGroupInEditor(SceneGroup group)
{
- var _sceneList = new List();
+ var sceneList = new List();
for (var i = 0; i < group.scenes.Count; i++)
- _sceneList.Add(group.scenes[i].sceneName);
+ sceneList.Add(group.scenes[i].sceneName);
- var _paths = GetScenePaths();
- if (_sceneList.Count <= 0) return;
+ var paths = GetScenePaths();
+
+ if (sceneList.Count <= 0) return;
- for (var i = 0; i < _sceneList.Count; i++)
+ for (var i = 0; i < sceneList.Count; i++)
{
- var _scene = _sceneList[i];
- var _path = _paths.FirstOrDefault(t => t.Contains(_scene));
+ var scene = sceneList[i];
+ var path = paths.FirstOrDefault(t => t.Contains(scene));
if (i.Equals(0))
- EditorSceneManager.OpenScene(_path, OpenSceneMode.Single);
+ {
+ EditorSceneManager.OpenScene(path, OpenSceneMode.Single);
+ }
else
- EditorSceneManager.OpenScene(_path, OpenSceneMode.Additive);
+ {
+ EditorSceneManager.OpenScene(path, OpenSceneMode.Additive);
+ }
}
- MultiSceneEditorUtil.Settings.LastGroup = group;
+ UtilEditor.RuntimeSettings.LastGroup = group;
MultiSceneEditorEvents.SceneGroups.OnSceneGroupLoadedInEditor.Raise();
}
@@ -288,11 +307,12 @@ private static void LoadSceneGroupInEditor(SceneGroup group)
private static List GetScenePaths()
{
var sceneNumber = SceneManager.sceneCountInBuildSettings;
- string[] arrayOfNames;
- arrayOfNames = new string[sceneNumber];
+ var arrayOfNames = new string[sceneNumber];
- for (int i = 0; i < sceneNumber; i++)
+ for (var i = 0; i < sceneNumber; i++)
+ {
arrayOfNames[i] = SceneUtility.GetScenePathByBuildIndex(i);
+ }
return arrayOfNames.ToList();
}
diff --git a/Carter Games/Multi Scene/Code/Editor/Custom Editors/Windows/SceneGroupLoader.cs.meta b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Windows/SceneGroupLoader.cs.meta
new file mode 100644
index 0000000..9c902d5
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Custom Editors/Windows/SceneGroupLoader.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 885917583a24c714a9159cd4a363e736
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Settings Provider.meta b/Carter Games/Multi Scene/Code/Editor/Settings Provider.meta
new file mode 100644
index 0000000..b4ba352
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Settings Provider.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a84c0661feab9d64da31b4202110bea9
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Editor/Settings/MultiSceneSettings.cs b/Carter Games/Multi Scene/Code/Editor/Settings Provider/MultiSceneSettingsProvider.cs
similarity index 67%
rename from Editor/Settings/MultiSceneSettings.cs
rename to Carter Games/Multi Scene/Code/Editor/Settings Provider/MultiSceneSettingsProvider.cs
index 01280ca..9093c8d 100644
--- a/Editor/Settings/MultiSceneSettings.cs
+++ b/Carter Games/Multi Scene/Code/Editor/Settings Provider/MultiSceneSettingsProvider.cs
@@ -1,4 +1,27 @@
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
@@ -7,7 +30,7 @@ namespace CarterGames.Experimental.MultiScene.Editor
///
/// Handles the settings window for the asset.
///
- public static class MultiSceneSettings
+ public static class MultiSceneSettingsProvider
{
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Fields
@@ -24,15 +47,7 @@ public static class MultiSceneSettings
///
/// Gets the settings asset in the project as a SerializedObject.
///
- public static SerializedObject SettingsAssetObject
- {
- get
- {
- if (settingsAssetObject != null) return settingsAssetObject;
- settingsAssetObject = new SerializedObject(MultiSceneEditorUtil.Settings);
- return settingsAssetObject;
- }
- }
+ public static SerializedObject SettingsAssetObject => UtilEditor.SettingsObject;
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Menu Items
@@ -80,13 +95,13 @@ public static SettingsProvider MultiSceneSettingsDrawer()
{
ListenForEvents();
- var provider = new SettingsProvider(MultiSceneEditorUtil.SettingsWindowPath, SettingsScope.Project)
+ var provider = new SettingsProvider(UtilEditor.SettingsWindowPath, SettingsScope.Project)
{
guiHandler = (searchContext) =>
{
- if (!MultiSceneEditorUtil.HasSettingsFile) return;
+ if (UtilEditor.RuntimeSettings == null) return;
- MultiSceneEditorUtil.DrawHeader();
+ UtilEditor.DrawHeader();
DrawInfo();
EditorGUILayout.BeginVertical("HelpBox");
@@ -97,8 +112,8 @@ public static SettingsProvider MultiSceneSettingsDrawer()
EditorGUI.BeginChangeCheck();
- DrawGeneralOptions();
- DrawSceneGroupOptions();
+ DrawEditorOptions();
+ DrawSceneManagementOptions();
DrawSceneGroupCategoryOptions();
if (EditorGUI.EndChangeCheck())
@@ -132,7 +147,13 @@ private static void DrawInfo()
EditorGUILayout.LabelField("Info", EditorStyles.boldLabel);
- EditorGUILayout.LabelField(new GUIContent("Version", "The version of the asset in use."), new GUIContent(AssetVersionData.VersionNumber));
+ EditorGUILayout.BeginHorizontal();
+
+ EditorGUILayout.LabelField(new GUIContent("Version"), new GUIContent(AssetVersionData.VersionNumber));
+ VersionEditorGUI.DrawCheckForUpdatesButton();
+
+ EditorGUILayout.EndHorizontal();
+
EditorGUILayout.LabelField(new GUIContent("Release Date", "The date this version of the asset was published on."), new GUIContent(AssetVersionData.ReleaseDate));
GUILayout.Space(2.5f);
@@ -143,27 +164,44 @@ private static void DrawInfo()
///
/// Draws the general options section of the window.
///
- private static void DrawGeneralOptions()
+ private static void DrawEditorOptions()
{
EditorGUILayout.BeginVertical("HelpBox");
GUILayout.Space(1.5f);
- SettingsAssetObject.FindProperty("showGeneralOptions").boolValue = EditorGUILayout.Foldout(SettingsAssetObject.FindProperty("showGeneralOptions").boolValue, " General Options");
+ PerUserSettings.SettingsEditorDropdown = EditorGUILayout.Foldout(PerUserSettings.SettingsEditorDropdown, "Editor");
- if (SettingsAssetObject.FindProperty("showGeneralOptions").boolValue)
+ if (PerUserSettings.SettingsEditorDropdown)
{
- // Listener Frequency...
- EditorGUILayout.PropertyField(SettingsAssetObject.FindProperty("listenerFrequency"),
- new GUIContent("Listener Frequency",
- "Controls how many listeners execute per frame. The higher the number the more intensive the scene group loading can be."));
+ EditorGUI.indentLevel++;
+ EditorGUILayout.BeginVertical("Box");
+
+ // Version validation
+ PerUserSettings.VersionValidationAutoCheckOnLoad = EditorGUILayout.Toggle(new GUIContent("Update Check On Load",
+ "Checks for any updates to the asset from the GitHub page when you load the project."),
+ PerUserSettings.VersionValidationAutoCheckOnLoad);
- // Use Unload Resources...
- EditorGUILayout.PropertyField(SettingsAssetObject.FindProperty("useUnloadResources"),
- new GUIContent("Use Unload Resources?", "Runs Resources.UnloadUnusedAssets() if enabled."));
// Show Logs...
- EditorGUILayout.PropertyField(SettingsAssetObject.FindProperty("showLogs"),
- new GUIContent("Show Log Messages?", "Shows log messages for any errors as well as some handy debugging information."));
+ PerUserSettingsRuntime.ShowDebugLogs = EditorGUILayout.Toggle(
+ new GUIContent("Show Log Messages?",
+ "Shows log messages for any errors as well as some handy debugging information."),
+ PerUserSettingsRuntime.ShowDebugLogs);
+
+
+ if (GUILayout.Button("Reset Settings"))
+ {
+ if (EditorUtility.DisplayDialog("Reset Multi Scene Settings",
+ "Are you sure that you want to reset all settings for the asset to their defaults. This only applies to you. Other users of the project will have to do this for their settings themselves.",
+ "Reset Settings", "Cancel"))
+ {
+ PerUserSettings.ResetPrefs();
+ PerUserSettingsRuntime.ResetPrefs();
+ }
+ }
+
+ EditorGUILayout.EndVertical();
+ EditorGUI.indentLevel--;
}
GUILayout.Space(2.5f);
@@ -174,15 +212,40 @@ private static void DrawGeneralOptions()
///
/// Draws the scene group options section of the window.
///
- private static void DrawSceneGroupOptions()
+ private static void DrawSceneManagementOptions()
{
EditorGUILayout.BeginVertical("HelpBox");
GUILayout.Space(1.5f);
- SettingsAssetObject.FindProperty("showSceneGroupOptions").boolValue = EditorGUILayout.Foldout(SettingsAssetObject.FindProperty("showSceneGroupOptions").boolValue, " Scene Group Management");
+ PerUserSettings.SettingsSceneManagementDropdown = EditorGUILayout.Foldout(PerUserSettings.SettingsSceneManagementDropdown, "Scene Management");
- if (SettingsAssetObject.FindProperty("showSceneGroupOptions").boolValue)
+ if (PerUserSettings.SettingsSceneManagementDropdown)
{
+ EditorGUI.indentLevel++;
+ EditorGUILayout.BeginVertical("Box");
+
+ GUILayout.Space(1.5f);
+
+ // Settings label...
+ EditorGUILayout.LabelField("Settings", EditorStyles.boldLabel);
+ UtilEditor.DrawHorizontalGUILine();
+
+ // Listener Frequency...
+ EditorGUILayout.PropertyField(SettingsAssetObject.FindProperty("listenerFrequency"),
+ new GUIContent("Listener Frequency",
+ "Controls how many listeners execute per frame. The higher the number the more intensive the scene group loading can be."));
+
+ // Use Unload Resources...
+ EditorGUILayout.PropertyField(SettingsAssetObject.FindProperty("useUnloadResources"),
+ new GUIContent("Use Unload Resources?", "Runs Resources.UnloadUnusedAssets() if enabled."));
+
+
+ GUILayout.Space(12.5f);
+
+ // Settings label...
+ EditorGUILayout.LabelField("Scene Group Auto Loading", EditorStyles.boldLabel);
+ UtilEditor.DrawHorizontalGUILine();
+
EditorGUILayout.PropertyField(SettingsAssetObject.FindProperty("sceneGroupLoadMode"),
new GUIContent("Group Load Mode", "Defines which group will load on play mode."));
@@ -195,6 +258,9 @@ private static void DrawSceneGroupOptions()
new GUIContent("Last Scene Group Loaded", "The last scene group to be loaded in the editor."));
GUI.enabled = true;
+
+ EditorGUILayout.EndVertical();
+ EditorGUI.indentLevel--;
}
GUILayout.Space(2.5f);
@@ -222,8 +288,8 @@ private static void DrawSceneGroupCategoryOptions()
if (EditorGUI.EndChangeCheck())
{
- settingsAssetObject.ApplyModifiedProperties();
- settingsAssetObject.Update();
+ SettingsAssetObject.ApplyModifiedProperties();
+ SettingsAssetObject.Update();
MultiSceneEditorEvents.Settings.OnGroupCategoriesChanged.Raise();
}
@@ -233,8 +299,8 @@ private static void DrawSceneGroupCategoryOptions()
if (EditorGUI.EndChangeCheck())
{
- settingsAssetObject.ApplyModifiedProperties();
- settingsAssetObject.Update();
+ SettingsAssetObject.ApplyModifiedProperties();
+ SettingsAssetObject.Update();
MultiSceneEditorEvents.Settings.OnGroupCategoriesChanged.Raise();
}
}
@@ -251,44 +317,46 @@ private static void DrawButtons()
{
EditorGUILayout.BeginHorizontal();
+ if (GUILayout.Button("Buy Me A Coffee", GUILayout.Height(30), GUILayout.MinWidth(100)))
+ {
+ Application.OpenURL("https://carter.games/donate");
+ }
+
if (GUILayout.Button("GitHub", GUILayout.Height(30), GUILayout.MinWidth(100)))
+ {
Application.OpenURL("https://github.com/CarterGames/MultiScene");
+ }
if (GUILayout.Button("Documentation", GUILayout.Height(30), GUILayout.MinWidth(100)))
- Application.OpenURL("https://carter.games/multiscene");
-
- if (GUILayout.Button("Change Log", GUILayout.Height(30), GUILayout.MinWidth(100)))
- Application.OpenURL("https://carter.games/multiscene/changelog");
-
- EditorGUILayout.EndHorizontal();
-
- EditorGUILayout.BeginHorizontal();
-
- if (GUILayout.Button("Email", GUILayout.Height(30), GUILayout.MinWidth(100)))
- Application.OpenURL("mailto:support@carter.games?subject=Multi-Scene asset enquiry");
-
- if (GUILayout.Button("Discord", GUILayout.Height(30), GUILayout.MinWidth(100)))
- Application.OpenURL("https://carter.games/discord");
+ {
+ Application.OpenURL("https://carter.games/multiscene/");
+ }
- if (GUILayout.Button("Report Issues", GUILayout.Height(30), GUILayout.MinWidth(100)))
- Application.OpenURL("https://carter.games/report");
+ if (GUILayout.Button("Support", GUILayout.Height(30), GUILayout.MinWidth(100)))
+ {
+ Application.OpenURL("https://carter.games/contact");
+ }
EditorGUILayout.EndHorizontal();
- if (MultiSceneEditorUtil.CarterGamesBanner != null)
+ if (UtilEditor.CarterGamesBanner != null)
{
var defaultTextColour = GUI.contentColor;
GUI.contentColor = new Color(1, 1, 1, .75f);
- if (GUILayout.Button(MultiSceneEditorUtil.CarterGamesBanner, GUILayout.MaxHeight(40)))
+ if (GUILayout.Button(UtilEditor.CarterGamesBanner, GUILayout.MaxHeight(40)))
+ {
Application.OpenURL("https://carter.games");
+ }
GUI.contentColor = defaultTextColour;
}
else
{
if (GUILayout.Button("Carter Games", GUILayout.MaxHeight(40)))
+ {
Application.OpenURL("https://carter.games");
+ }
}
}
}
diff --git a/Carter Games/Multi Scene/Code/Editor/Settings Provider/MultiSceneSettingsProvider.cs.meta b/Carter Games/Multi Scene/Code/Editor/Settings Provider/MultiSceneSettingsProvider.cs.meta
new file mode 100644
index 0000000..488cf4c
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Settings Provider/MultiSceneSettingsProvider.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2e1abe62a8f84c2c918295e1a25cf4a0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems.meta b/Carter Games/Multi Scene/Code/Editor/Systems.meta
new file mode 100644
index 0000000..d011b08
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3d7e25a90612d9943baf3a2577894dbf
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index.meta
new file mode 100644
index 0000000..1a3c4d4
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 77e931cb523241c0a2722c6f627f3914
+timeCreated: 1716404639
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index/AssetIndexEditor.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index/AssetIndexEditor.cs
new file mode 100644
index 0000000..c8b7e39
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index/AssetIndexEditor.cs
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
+using UnityEditor;
+using UnityEngine;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// Handles the custom inspector for the Audio Manager asset index.
+ ///
+ [CustomEditor(typeof(AssetIndex))]
+ public sealed class AudioManagerAssetIndexEditor : UnityEditor.Editor
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private Dictionary entryLookup = new Dictionary();
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Unity Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private void OnEnable()
+ {
+ entryLookup ??= new Dictionary();
+ entryLookup?.Clear();
+
+ if (serializedObject.Fp("assets").Fpr("list").arraySize <= 0) return;
+
+ for (var i = 0; i < serializedObject.Fp("assets").Fpr("list").arraySize; i++)
+ {
+ entryLookup.Add(serializedObject.Fp("assets").Fpr("list").GetIndex(i).Fpr("key").stringValue, i);
+ }
+ }
+
+
+ public override void OnInspectorGUI()
+ {
+ GUILayout.Space(12.5f);
+
+ UtilEditor.DrawSoScriptSection((AssetIndex) target);
+ GUILayout.Space(12.5f);
+
+ DrawRequireReferencesSection();
+
+ GUILayout.Space(7.5f);
+
+ DrawAllReferencesSection();
+
+ serializedObject.ApplyModifiedProperties();
+ serializedObject.Update();
+ }
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Draws the required references GUI.
+ ///
+ private void DrawRequireReferencesSection()
+ {
+ EditorGUILayout.BeginVertical("HelpBox");
+ GUILayout.Space(1.5f);
+
+ EditorGUILayout.LabelField("Required References", EditorStyles.boldLabel);
+ UtilEditor.DrawHorizontalGUILine();
+
+ if (entryLookup.ContainsKey(typeof(AssetGlobalRuntimeSettings).FullName) && serializedObject.Fp("assets").Fpr("list").arraySize > 0)
+ {
+ EditorGUILayout.BeginHorizontal();
+ EditorGUILayout.LabelField("Settings Reference: ", GUILayout.Width("Settings Reference:".Width()));
+
+ var hasLibRef = serializedObject.Fp("assets").Fpr("list")
+ .GetIndex(entryLookup[typeof(AssetGlobalRuntimeSettings).FullName]).Fpr("value").arraySize > 0;
+
+ GUI.contentColor = hasLibRef ? UtilEditor.Green : UtilEditor.Red;
+ EditorGUILayout.LabelField(hasLibRef ? "True" : "False");
+ GUI.contentColor = Color.white;
+
+ EditorGUILayout.EndHorizontal();
+ }
+ else
+ {
+ EditorGUILayout.BeginHorizontal();
+ EditorGUILayout.LabelField("Settings Reference: ", GUILayout.Width("Settings Reference:".Width()));
+
+ GUI.contentColor = UtilEditor.Red;
+ EditorGUILayout.LabelField("False");
+ GUI.contentColor = Color.white;
+
+ EditorGUILayout.EndHorizontal();
+ }
+
+ GUILayout.Space(1.5f);
+ EditorGUILayout.EndVertical();
+ }
+
+
+ ///
+ /// Draws the all references GUI.
+ ///
+ private void DrawAllReferencesSection()
+ {
+ EditorGUILayout.BeginVertical("HelpBox");
+ GUILayout.Space(1.5f);
+
+ EditorGUILayout.LabelField("All References", EditorStyles.boldLabel);
+ UtilEditor.DrawHorizontalGUILine();
+
+ EditorGUI.indentLevel++;
+
+ EditorGUI.BeginDisabledGroup(Application.isPlaying);
+ EditorGUILayout.PropertyField(serializedObject.Fp("assets"));
+ EditorGUI.EndDisabledGroup();
+
+ EditorGUI.indentLevel--;
+
+ GUILayout.Space(1.5f);
+ EditorGUILayout.EndVertical();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index/AssetIndexEditor.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index/AssetIndexEditor.cs.meta
new file mode 100644
index 0000000..8444b47
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index/AssetIndexEditor.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c2fd1ce0370e455fad56aa18e16118fc
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index/AssetIndexHandler.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index/AssetIndexHandler.cs
new file mode 100644
index 0000000..7c2050f
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index/AssetIndexHandler.cs
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
+using UnityEditor;
+using UnityEditor.Build;
+using UnityEditor.Build.Reporting;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// Handles the setup of the asset index for runtime references to scriptable objects used for the asset.
+ ///
+ public sealed class AssetIndexHandler : IPreprocessBuildWithReport, IAssetEditorInitialize
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private static readonly string AssetFilter = $"t:{nameof(MultiSceneAsset)}";
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | IAssetEditorInitialize Implementation
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Defines the order that this initializer run at.
+ ///
+ public int InitializeOrder => 1;
+
+
+ ///
+ /// Runs when the asset initialize flow is used.
+ ///
+ public void OnEditorInitialized()
+ {
+ UpdateIndex();
+ }
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | IPreprocessBuildWithReport Implementation
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// The order this script is processed in, in this case its the default.
+ ///
+ public int callbackOrder => 0;
+
+
+ ///
+ /// Runs before a build is executed.
+ ///
+ /// The report about the build (I don't need it, but its a param for the method).
+ public void OnPreprocessBuild(BuildReport report)
+ {
+ UpdateIndex();
+ }
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Initializes the event subscription needed for this to work in editor.
+ ///
+ [InitializeOnLoadMethod]
+ private static void Initialize()
+ {
+ EditorApplication.update -= OnEditorUpdate;
+ EditorApplication.update += OnEditorUpdate;
+ }
+
+
+ ///
+ /// Runs when the editor has updated.
+ ///
+ private static void OnEditorUpdate()
+ {
+ // If the user is about to enter play-mode, update the index, otherwise leave it be.
+ if (!EditorApplication.isPlayingOrWillChangePlaymode || EditorApplication.isPlaying) return;
+ UpdateIndex();
+ }
+
+
+ ///
+ /// Updates the index with all the save manager asset scriptable objects in the project.
+ ///
+ [MenuItem("Tools/Carter Games/Multi Scene/Update Asset Index", priority = 17)]
+ public static void UpdateIndex()
+ {
+ var foundAssets = new List();
+ var asset = AssetDatabase.FindAssets(AssetFilter, null);
+
+ if (asset == null || asset.Length <= 0) return;
+
+ foreach (var assetInstance in asset)
+ {
+ var assetPath = AssetDatabase.GUIDToAssetPath(assetInstance);
+ var assetObj = (MultiSceneAsset) AssetDatabase.LoadAssetAtPath(assetPath, typeof(MultiSceneAsset));
+
+ // Doesn't include editor only or the index itself.
+ if (assetObj == null) continue;
+ if (assetObj.GetType() == typeof(AssetIndex)) continue;
+ foundAssets.Add((MultiSceneAsset) AssetDatabase.LoadAssetAtPath(assetPath, typeof(MultiSceneAsset)));
+ }
+
+ var indexProp = new SerializedObject(UtilEditor.AssetIndex);
+
+ RemoveNullReferences(indexProp);
+ UpdateIndexReferences(foundAssets ,indexProp);
+
+ indexProp.ApplyModifiedProperties();
+ indexProp.Update();
+ }
+
+
+ private static void RemoveNullReferences(SerializedObject indexProp)
+ {
+ for (var i = 0; i < indexProp.Fp("assets").Fpr("list").arraySize; i++)
+ {
+ var entry = indexProp.Fp("assets").Fpr("list").GetIndex(i);
+ var jIndexAdjustment = 0;
+
+ for (var j = 0; j < entry.Fpr("value").arraySize; j++)
+ {
+ if (entry.Fpr("value").GetIndex(j - jIndexAdjustment).objectReferenceValue != null) continue;
+ entry.Fpr("value").DeleteIndex(j);
+ jIndexAdjustment++;
+ }
+ }
+ }
+
+
+ private static void UpdateIndexReferences(IReadOnlyList foundAssets, SerializedObject indexProp)
+ {
+ indexProp.Fp("assets").Fpr("list").ClearArray();
+
+ for (var i = 0; i < foundAssets.Count; i++)
+ {
+ for (var j = 0; j < indexProp.Fp("assets").Fpr("list").arraySize; j++)
+ {
+ var entry = indexProp.Fp("assets").Fpr("list").GetIndex(j);
+
+ if (entry.Fpr("key").stringValue.Equals(foundAssets[i].GetType().ToString()))
+ {
+ for (var k = 0; k < entry.Fpr("value").arraySize; k++)
+ {
+ if (entry.Fpr("value").GetIndex(k).objectReferenceValue == foundAssets[i]) goto AlreadyExists;
+ }
+
+ entry.Fpr("value").InsertIndex(entry.Fpr("value").arraySize);
+ entry.Fpr("value").GetIndex(entry.Fpr("value").arraySize - 1).objectReferenceValue = foundAssets[i];
+ goto AlreadyExists;
+ }
+ }
+
+ indexProp.Fp("assets").Fpr("list").InsertIndex(indexProp.Fp("assets").Fpr("list").arraySize);
+ indexProp.Fp("assets").Fpr("list").GetIndex(indexProp.Fp("assets").Fpr("list").arraySize - 1).Fpr("key").stringValue = foundAssets[i].GetType().ToString();
+
+ if (indexProp.Fp("assets").Fpr("list").GetIndex(indexProp.Fp("assets").Fpr("list").arraySize - 1).Fpr("value").arraySize > 0)
+ {
+ indexProp.Fp("assets").Fpr("list").GetIndex(indexProp.Fp("assets").Fpr("list").arraySize - 1)
+ .Fpr("value").ClearArray();
+ }
+
+ indexProp.Fp("assets").Fpr("list").GetIndex(indexProp.Fp("assets").Fpr("list").arraySize - 1).Fpr("value").InsertIndex(0);
+ indexProp.Fp("assets").Fpr("list").GetIndex(indexProp.Fp("assets").Fpr("list").arraySize - 1)
+ .Fpr("value").GetIndex(0).objectReferenceValue = foundAssets[i];
+
+ AlreadyExists: ;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index/AssetIndexHandler.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index/AssetIndexHandler.cs.meta
new file mode 100644
index 0000000..cf04c3d
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Asset Index/AssetIndexHandler.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 095afb09356f4679ad06b0c4b9d3caa7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Detection.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Detection.meta
new file mode 100644
index 0000000..eab1da0
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Detection.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e793f25a1fd848c0bd1c047c32ba71e3
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Detection/EditorEvtDetector.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Detection/EditorEvtDetector.cs
new file mode 100644
index 0000000..fa71e49
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Detection/EditorEvtDetector.cs
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using UnityEditor;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// Detects events in the engine and processes them for use in the asset.
+ ///
+ public sealed class EditorEvtDetector : AssetPostprocessor, IAssetEditorReload
+ {
+ private static string[] importedAssetsCache;
+
+
+ ///
+ /// Runs when any file has finished being added to the project.
+ ///
+ /// array of all imported assets.
+ /// array of all deleted assets.
+ /// array of all moved assets.
+ /// array of all moved assets to a new path.
+ private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
+ {
+ importedAssetsCache = importedAssets;
+ }
+
+
+ public void OnEditorReloaded()
+ {
+ if (importedAssetsCache == null) return;
+
+ foreach (var asset in importedAssetsCache)
+ {
+ if (!asset.Contains(".asset")) continue;
+ MultiSceneEditorEvents.SceneGroups.OnSceneGroupCreated.Raise();
+ return;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Detection/EditorEvtDetector.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Detection/EditorEvtDetector.cs.meta
new file mode 100644
index 0000000..e22955e
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Detection/EditorEvtDetector.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7b142a28805c4909b3899939c3984935
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Editor Events.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Editor Events.meta
new file mode 100644
index 0000000..3b086b5
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Editor Events.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d859190e98075fa41aeab745e6d3aabf
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Editor/Editor Events/MultiSceneEditorEvents.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Editor Events/MultiSceneEditorEvents.cs
similarity index 62%
rename from Editor/Editor Events/MultiSceneEditorEvents.cs
rename to Carter Games/Multi Scene/Code/Editor/Systems/Editor Events/MultiSceneEditorEvents.cs
index 359504e..2e0c281 100644
--- a/Editor/Editor Events/MultiSceneEditorEvents.cs
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Editor Events/MultiSceneEditorEvents.cs
@@ -1,4 +1,29 @@
-namespace CarterGames.Experimental.MultiScene.Editor
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using CarterGames.Common;
+
+namespace CarterGames.Experimental.MultiScene.Editor
{
///
/// Container class for events used to broadcast info in the editor space only...
@@ -17,19 +42,19 @@ public struct SceneGroups
///
/// Raises when a category is changed...
///
- public static readonly MultiSceneEvt OnSceneGroupCreated = new MultiSceneEvt();
+ public static readonly Evt OnSceneGroupCreated = new Evt();
///
/// Raises when a category is changed...
///
- public static readonly MultiSceneEvt OnSceneGroupCategoryChanged = new MultiSceneEvt();
+ public static readonly Evt OnSceneGroupCategoryChanged = new Evt();
///
/// Raises when a scene group is loaded in the editor only...
///
- public static readonly MultiSceneEvt OnSceneGroupLoadedInEditor = new MultiSceneEvt();
+ public static readonly Evt OnSceneGroupLoadedInEditor = new Evt();
}
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
@@ -44,19 +69,19 @@ public struct Settings
///
/// Raises when the settings asset is modified...
///
- public static readonly MultiSceneEvt OnSettingChanged = new MultiSceneEvt();
+ public static readonly Evt OnSettingChanged = new Evt();
///
/// Raises when a new settings asset is generated after an existing one is deleted...
///
- public static readonly MultiSceneEvt OnSettingsAssetRegenerated = new MultiSceneEvt();
+ public static readonly Evt OnSettingsAssetRegenerated = new Evt();
///
/// Raises when the group categories are edited in the settings window...
///
- public static readonly MultiSceneEvt OnGroupCategoriesChanged = new MultiSceneEvt();
+ public static readonly Evt OnGroupCategoriesChanged = new Evt();
}
}
}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Editor Events/MultiSceneEditorEvents.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Editor Events/MultiSceneEditorEvents.cs.meta
new file mode 100644
index 0000000..1898533
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Editor Events/MultiSceneEditorEvents.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4fdf41f8d27842c9ad6db7e891d120a4
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Helpers.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Helpers.meta
new file mode 100644
index 0000000..235543f
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Helpers.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: da1dbe3de8d9670418d547a0ef191a6c
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Editor/Helpers/DisplayExtensions.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Helpers/DisplayExtensions.cs
similarity index 58%
rename from Editor/Helpers/DisplayExtensions.cs
rename to Carter Games/Multi Scene/Code/Editor/Systems/Helpers/DisplayExtensions.cs
index 13fc58c..2ead5ba 100644
--- a/Editor/Helpers/DisplayExtensions.cs
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Helpers/DisplayExtensions.cs
@@ -1,4 +1,27 @@
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
using System.Linq;
namespace CarterGames.Experimental.MultiScene.Editor
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Helpers/DisplayExtensions.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Helpers/DisplayExtensions.cs.meta
new file mode 100644
index 0000000..f878531
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Helpers/DisplayExtensions.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2cb0ef8199744c76921b79749a039ed6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Editor/Helpers/EditorSceneHelper.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Helpers/EditorSceneHelper.cs
similarity index 71%
rename from Editor/Helpers/EditorSceneHelper.cs
rename to Carter Games/Multi Scene/Code/Editor/Systems/Helpers/EditorSceneHelper.cs
index 0ebd760..e2b1057 100644
--- a/Editor/Helpers/EditorSceneHelper.cs
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Helpers/EditorSceneHelper.cs
@@ -1,5 +1,29 @@
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
using System.Linq;
+using CarterGames.Common;
using UnityEditor;
namespace CarterGames.Experimental.MultiScene.Editor
@@ -7,18 +31,18 @@ namespace CarterGames.Experimental.MultiScene.Editor
///
/// Helps with getting the scenes in the project in different formats for other elements of the asset.
///
- public sealed class EditorSceneHelper : AssetPostprocessor
+ public static class EditorSceneHelper
{
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Fields
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
- private static List _cacheAllSceneNamesInProject = new List();
- private static Dictionary _cachedScenesInBuildSettings = new Dictionary();
- private static List _cachedScenesInBuildSettingsKeys = new List();
+ private static List cacheAllSceneNamesInProject = new List();
+ private static Dictionary cachedScenesInBuildSettings = new Dictionary();
+ private static List cachedScenesInBuildSettingsKeys = new List();
- private static bool _hasCache;
- private static bool _isListening;
+ private static bool hasCache;
+ private static bool isListening;
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Properties
@@ -31,9 +55,9 @@ public static List AllSceneNamesInProject
{
get
{
- if (_hasCache) return _cacheAllSceneNamesInProject;
+ if (hasCache) return cacheAllSceneNamesInProject;
UpdateCaches();
- return _cacheAllSceneNamesInProject;
+ return cacheAllSceneNamesInProject;
}
}
@@ -45,9 +69,9 @@ public static Dictionary ScenesInBuildSettings
{
get
{
- if (_hasCache) return _cachedScenesInBuildSettings;
+ if (hasCache) return cachedScenesInBuildSettings;
UpdateCaches();
- return _cachedScenesInBuildSettings;
+ return cachedScenesInBuildSettings;
}
}
@@ -59,9 +83,9 @@ private static List ScenesInBuildSettingsKeys
{
get
{
- if (_hasCache) return _cachedScenesInBuildSettingsKeys;
+ if (hasCache) return cachedScenesInBuildSettingsKeys;
UpdateCaches();
- return _cachedScenesInBuildSettingsKeys;
+ return cachedScenesInBuildSettingsKeys;
}
}
@@ -72,7 +96,7 @@ private static List ScenesInBuildSettingsKeys
///
/// Raises when the build settings are modified to update the cache.
///
- public static readonly MultiSceneEvt OnCacheUpdate = new MultiSceneEvt();
+ public static readonly Evt OnCacheUpdate = new Evt();
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| General Methods
@@ -84,14 +108,16 @@ private static List ScenesInBuildSettingsKeys
///
public static void UpdateCaches()
{
- _cacheAllSceneNamesInProject = GetNamesOfScenesInProject();
- _cachedScenesInBuildSettings = GetAllScenesInProject();
- _hasCache = true;
+ cacheAllSceneNamesInProject = GetNamesOfScenesInProject();
+ cachedScenesInBuildSettings = GetAllScenesInProject();
+ hasCache = true;
- if (_isListening) return;
+ if (isListening) return;
+ EditorBuildSettings.sceneListChanged -= OnSceneListChanged;
EditorBuildSettings.sceneListChanged += OnSceneListChanged;
- _isListening = true;
+
+ isListening = true;
// _isListening doesn't reset as we only want to sub to it once.
}
@@ -101,7 +127,7 @@ public static void UpdateCaches()
///
private static void OnSceneListChanged()
{
- _hasCache = false;
+ hasCache = false;
OnCacheUpdate.Raise();
}
@@ -112,7 +138,7 @@ private static void OnSceneListChanged()
/// A list of scene names in string format.
private static List GetNamesOfScenesInProject()
{
- if (_hasCache) return _cacheAllSceneNamesInProject;
+ if (hasCache) return cacheAllSceneNamesInProject;
var assets = AssetDatabase.FindAssets("t:scene", null);
@@ -135,23 +161,27 @@ private static List GetNamesOfScenesInProject()
/// An organised dictionary.
public static Dictionary GetAllScenesInProject()
{
- if (_hasCache) return _cachedScenesInBuildSettings;
+ if (hasCache) return cachedScenesInBuildSettings;
- var _scenes = EditorBuildSettings.scenes;
+ var scenes = EditorBuildSettings.scenes;
var buildSettingsScenes = new Dictionary { { "", "" } };
- foreach (var scene in _scenes)
+ foreach (var scene in scenes)
{
var filteredPath = scene.path.Replace("Assets/", "").Replace(".unity", "");
var split = filteredPath.Split('/');
if (buildSettingsScenes.ContainsKey(split[split.Length - 1]))
+ {
buildSettingsScenes.Add(split[split.Length - 2] + "/" + split[split.Length - 1], scene.path);
+ }
else
+ {
buildSettingsScenes.Add(split[split.Length - 1], scene.path);
+ }
}
- _cachedScenesInBuildSettingsKeys = buildSettingsScenes.Keys.ToList();
+ cachedScenesInBuildSettingsKeys = buildSettingsScenes.Keys.ToList();
return buildSettingsScenes;
}
@@ -167,12 +197,10 @@ public static Dictionary GetAllScenesInProject()
///
/// The int to convert.
/// The scene name.
- public static string ConvertIntToScene(int value)
+ public static string ConvertIntToScene(int value, string[] optionsShown)
{
- if (value.Equals(-1))
- return "";
-
- return ScenesInBuildSettingsKeys[value];
+ if (value.Equals(-1)) return "";
+ return optionsShown[value];
}
@@ -181,9 +209,9 @@ public static string ConvertIntToScene(int value)
///
/// The string to convert.
/// The index of the scene name.
- public static int ConvertStringToIndex(string value)
+ public static int ConvertStringToIndex(string value, string[] optionsShown)
{
- return ScenesInBuildSettingsKeys.IndexOf(value);
+ return optionsShown.ToList().IndexOf(value);
}
}
}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Helpers/EditorSceneHelper.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Helpers/EditorSceneHelper.cs.meta
new file mode 100644
index 0000000..8821a2a
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Helpers/EditorSceneHelper.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1881a64eca774725b3d3bfc748f1e88a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Initialize.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize.meta
new file mode 100644
index 0000000..ff4c6ac
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 443de8d0c2fd38e469a4d9bb1fefd018
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/AssetInitializer.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/AssetInitializer.cs
new file mode 100644
index 0000000..0315eed
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/AssetInitializer.cs
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Linq;
+using System.Threading.Tasks;
+using CarterGames.Common;
+using UnityEditor;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// Handles any initial listeners in the project for the asset.
+ ///
+ public static class AssetInitializer
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ // The key for if the asset has been initialized.
+ private static readonly string AssetInitializeKey = $"{FileEditorUtil.AssetName}_Session_EditorInitialize";
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Properties
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Gets if the asset is initialized or not.
+ ///
+ public static bool IsInitialized
+ {
+ get => SessionState.GetBool(AssetInitializeKey, false);
+ private set => SessionState.SetBool(AssetInitializeKey, value);
+ }
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Events
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Is raised when the asset is initialized.
+ ///
+ public static readonly Evt Initialized = new Evt();
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Initializes the editor logic for the asset when called.
+ ///
+ [InitializeOnLoadMethod]
+ private static void TryInitialize()
+ {
+ if (IsInitialized) return;
+ InitializeEditorClasses();
+ }
+
+
+ ///
+ /// Runs through all interfaces for initializing the editor asset logic and runs each in the defined order.
+ ///
+ private static async void InitializeEditorClasses()
+ {
+ var initClasses = InterfaceHelper.GetAllInterfacesInstancesOfType();
+
+ if (initClasses.Length > 0)
+ {
+ foreach (var init in initClasses.OrderBy(t => t.InitializeOrder))
+ {
+ init.OnEditorInitialized();
+ await Task.Yield();
+ }
+ }
+
+ OnAllClassesInitialized();
+ }
+
+
+ ///
+ /// Runs any post initialize logic to complete the process.
+ ///
+ private static void OnAllClassesInitialized()
+ {
+ AssetDatabase.SaveAssets();
+ AssetDatabase.Refresh();
+
+ IsInitialized = true;
+ Initialized.Raise();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/AssetInitializer.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/AssetInitializer.cs.meta
new file mode 100644
index 0000000..b31e9ba
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/AssetInitializer.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 51b6b0dd07b54a61b77aced33d86e313
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/AssetReloadHandler.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/AssetReloadHandler.cs
new file mode 100644
index 0000000..45cd55c
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/AssetReloadHandler.cs
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Threading.Tasks;
+using CarterGames.Common;
+using UnityEditor;
+using UnityEditor.Callbacks;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// Handles any reload listeners in the project for the asset.
+ ///
+ public static class AssetReloadHandler
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Events
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Raises when the reload has occured.
+ ///
+ public static readonly Evt Reloaded = new Evt();
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Add subscription to the delay call when scripts reload.
+ ///
+ [DidReloadScripts]
+ private static void FireReloadCalls()
+ {
+ if (EditorApplication.isCompiling || EditorApplication.isUpdating)
+ {
+ EditorApplication.delayCall -= CallListeners;
+ EditorApplication.delayCall += CallListeners;
+ return;
+ }
+
+ EditorApplication.delayCall -= CallListeners;
+ EditorApplication.delayCall += CallListeners;
+ }
+
+
+ ///
+ /// Updates all the listeners when called.
+ ///
+ private static async void CallListeners()
+ {
+ var reloadClasses = InterfaceHelper.GetAllInterfacesInstancesOfType();
+
+ if (reloadClasses.Length > 0)
+ {
+ foreach (var init in reloadClasses)
+ {
+ init.OnEditorReloaded();
+ await Task.Yield();
+ }
+ }
+
+ Reloaded.Raise();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/AssetReloadHandler.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/AssetReloadHandler.cs.meta
new file mode 100644
index 0000000..387c112
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/AssetReloadHandler.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 75e3a464fb254ffdb8cb5f4cafe6eef1
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/IAssetEditorInitialize.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/IAssetEditorInitialize.cs
new file mode 100644
index 0000000..d1c684e
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/IAssetEditorInitialize.cs
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ public interface IAssetEditorInitialize
+ {
+ int InitializeOrder { get; }
+ void OnEditorInitialized();
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/IAssetEditorInitialize.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/IAssetEditorInitialize.cs.meta
new file mode 100644
index 0000000..5911df9
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/IAssetEditorInitialize.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7abca68fdc9a99349859efcbf508e336
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/IAssetEditorReload.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/IAssetEditorReload.cs
new file mode 100644
index 0000000..f2a9852
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/IAssetEditorReload.cs
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ public interface IAssetEditorReload
+ {
+ void OnEditorReloaded();
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/IAssetEditorReload.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/IAssetEditorReload.cs.meta
new file mode 100644
index 0000000..a3d7ab3
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Initialize/IAssetEditorReload.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 36a162b68b534cc09a98445852981a75
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation.meta
new file mode 100644
index 0000000..23b4393
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 370e8a67178f44c1b257109a248b69f2
+timeCreated: 1716405166
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionAutoCheck.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionAutoCheck.cs
new file mode 100644
index 0000000..e96a2e3
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionAutoCheck.cs
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using UnityEditor;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// Handles the auto update checker for the asset.
+ ///
+ [InitializeOnLoad]
+ public sealed class VersionAutoCheck
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// The key for the session pref... should be per asset based on the version key to check...
+ ///
+ private static readonly string AutoVersionCheckSessionInitKey = $"{VersionInfo.Key.Trim()}_Editor_Settings_AutoVersionCheckRan";
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Constructors
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Runs when the editor is opened or needs to reload.
+ ///
+ static VersionAutoCheck()
+ {
+ // Ensures that this logic only runs once per editor use, so it doesn't appear when they make a code change etc.
+ if (SessionState.GetBool(AutoVersionCheckSessionInitKey, false)) return;
+ EditorApplication.delayCall += OnEditorLoad;
+ }
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Runs when the editor has loaded to check for the latest version of the asset.
+ ///
+ private static void OnEditorLoad()
+ {
+ EditorApplication.delayCall -= OnEditorLoad;
+ SessionState.SetBool(AutoVersionCheckSessionInitKey, true);
+
+ if (!PerUserSettings.VersionValidationAutoCheckOnLoad) return;
+ AutoVersionCheckInit();
+ }
+
+
+ ///
+ /// Runs the version check logic and listens for its response.
+ ///
+ private static void AutoVersionCheckInit()
+ {
+ VersionChecker.GetLatestVersions();
+ VersionChecker.ResponseReceived.Add(OnVersionCheckResponse);
+ }
+
+
+ ///
+ /// Runs when the response is received and only shows a new version is available, not if its on the latest.
+ ///
+ private static void OnVersionCheckResponse()
+ {
+ VersionChecker.ResponseReceived.Remove(OnVersionCheckResponse);
+ VersionEditorGUI.ShowResponseDialogue(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionAutoCheck.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionAutoCheck.cs.meta
new file mode 100644
index 0000000..35d7c2f
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionAutoCheck.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9c1f33e851df428eb3b33e82b34712ff
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionChecker.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionChecker.cs
new file mode 100644
index 0000000..5206ce7
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionChecker.cs
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using CarterGames.Common;
+using UnityEngine;
+using UnityEngine.Networking;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// Handles checking for the latest version.
+ ///
+ public static class VersionChecker
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// The download URL for the latest version.
+ ///
+ public static string DownloadURL => VersionInfo.DownloadBaseUrl + Versions.Data.Version;
+
+
+ ///
+ /// Gets if the latest version is this version.
+ ///
+ public static bool IsLatestVersion => Versions.Data.Match(VersionInfo.ProjectVersionNumber);
+
+
+ ///
+ /// Gets if the version here is higher that the latest version.
+ ///
+ public static bool IsNewerVersion => Versions.Data.IsHigherVersion(VersionInfo.ProjectVersionNumber);
+
+
+ ///
+ /// Gets the version data downloaded.
+ ///
+ public static VersionPacket Versions { get; private set; }
+
+
+ ///
+ /// The latest version string.
+ ///
+ public static string LatestVersionNumberString => Versions.Data.Version;
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Events
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Raises when the data has been downloaded.
+ ///
+ public static Evt ResponseReceived { get; private set; } = new Evt();
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Gets the latest version data when called.
+ ///
+ public static void GetLatestVersions()
+ {
+ RequestLatestVersionData();
+ }
+
+
+ ///
+ /// Makes the web request & handles the response.
+ ///
+ private static void RequestLatestVersionData()
+ {
+ var request = UnityWebRequest.Get(VersionInfo.ValidationUrl);
+ var async = request.SendWebRequest();
+
+ async.completed += (a) =>
+ {
+ if (request.result != UnityWebRequest.Result.Success) return;
+
+ Versions = JsonUtility.FromJson(request.downloadHandler.text);
+ ResponseReceived.Raise();
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionChecker.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionChecker.cs.meta
new file mode 100644
index 0000000..0fba3e6
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionChecker.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 78d7db4bcbce4994b2ddc033d14adfbe
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionData.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionData.cs
new file mode 100644
index 0000000..656fb92
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionData.cs
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using UnityEngine;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// A copy of the Json data for each entry stored on the server.
+ ///
+ [Serializable]
+ public sealed class VersionData
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ [SerializeField] private string key;
+ [SerializeField] private string version;
+ [SerializeField] private string releaseDate;
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Properties
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// The key for the entry.
+ ///
+ public string Key
+ {
+ get => key;
+ set => key = value;
+ }
+
+
+ ///
+ /// The version for the entry.
+ ///
+ public string Version
+ {
+ get => version;
+ set => version = value;
+ }
+
+
+ ///
+ /// The release date for the entry.
+ ///
+ public string ReleaseDate
+ {
+ get => releaseDate;
+ set => releaseDate = value;
+ }
+
+
+ ///
+ /// The version number for the entry.
+ ///
+ public VersionNumber VersionNumber => new VersionNumber(Version);
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Gets if the entry version number matches the entered string.
+ ///
+ /// The version string to compare.
+ /// If the entry is a match or not on all values (major/minor/patch).
+ public bool Match(string toCompare)
+ {
+ var current = VersionNumber;
+ var remote = new VersionNumber(toCompare);
+
+ return current.Major.Equals(remote.Major) &&
+ current.Minor.Equals(remote.Minor) &&
+ current.Patch.Equals(remote.Patch);
+ }
+
+
+ ///
+ /// Gets if the entry is a higher version than the converted version.
+ ///
+ /// The version string to compare.
+ /// If the entry is greater on any (major/minor/patch) value.
+ public bool IsHigherVersion(string toCompare)
+ {
+ var current = VersionNumber;
+ var remote = new VersionNumber(toCompare);
+
+ if (Match(toCompare))
+ {
+ return false;
+ }
+
+ if (current.Major < remote.Major) return true;
+ if (current.Major.Equals(remote.Major) && current.Minor < remote.Minor) return true;
+
+ return current.Major.Equals(remote.Major) &&
+ current.Minor.Equals(remote.Minor) &&
+ current.Patch < remote.Patch;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionData.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionData.cs.meta
new file mode 100644
index 0000000..c06948c
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionData.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 708bb46845e14bbe838d2787cc6389b0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionEditorGUI.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionEditorGUI.cs
new file mode 100644
index 0000000..296b734
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionEditorGUI.cs
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using UnityEditor;
+using UnityEngine;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// A helper class for using the version system on editor.
+ ///
+ public static class VersionEditorGUI
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Draws a check for updates button when called with dialogues to show the results.
+ ///
+ public static void DrawCheckForUpdatesButton()
+ {
+ if (!GUILayout.Button("Check For Updates", GUILayout.MaxWidth(135))) return;
+
+ VersionChecker.GetLatestVersions();
+
+ VersionChecker.ResponseReceived.AddAnonymous("versionCheckManual", () => ShowResponseDialogue());
+ }
+
+
+ ///
+ /// Shows the response to a version check call as a dialogue box.
+ ///
+ /// Should the box appear if the version is upto date?
+ public static void ShowResponseDialogue(bool showIfUptoDate = true)
+ {
+ VersionChecker.ResponseReceived.RemoveAnonymous("versionCheckManual");
+
+ if (VersionChecker.Versions.Data == null)
+ {
+ EditorUtility.DisplayDialog("Update Checker",
+ $"Either you are offline or the system for version checking is broken or missing an entry.",
+ "Continue");
+
+ return;
+ }
+
+ if (VersionChecker.IsNewerVersion)
+ {
+ if (!showIfUptoDate) return;
+ EditorUtility.DisplayDialog("Update Checker",
+ $"You are using a newer version than the currently released one.\n\nYours: {VersionInfo.ProjectVersionNumber}\nLatest: {VersionChecker.LatestVersionNumberString}",
+ "Continue");
+ }
+ else if (!VersionChecker.IsLatestVersion)
+ {
+ if (EditorUtility.DisplayDialog("Update Checker",
+ $"You are using an older version of this package.\n\nCurrent: {VersionInfo.ProjectVersionNumber}\nLatest: {VersionChecker.LatestVersionNumberString}",
+ "Latest Release", "Continue"))
+ {
+ Application.OpenURL(VersionChecker.DownloadURL);
+ }
+ }
+ else
+ {
+ if (!showIfUptoDate) return;
+ EditorUtility.DisplayDialog("Update Checker",
+ "You are using the latest version!",
+ "Continue");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionEditorGUI.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionEditorGUI.cs.meta
new file mode 100644
index 0000000..4c3d76a
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionEditorGUI.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0f2c15f561114f05a85f65527c4e1dac
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionInfo.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionInfo.cs
new file mode 100644
index 0000000..10481b8
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionInfo.cs
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// The info used in the version validation system.
+ ///
+ public static class VersionInfo
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// The Url to request the versions from.
+ ///
+ public const string ValidationUrl = "https://carter.games/validation/versions.json";
+
+
+ ///
+ /// The download Url for the latest version of this package.
+ ///
+ public const string DownloadBaseUrl = "https://github.com/CarterGames/MultiScene/releases/tag/";
+
+
+ ///
+ /// The key of the package to get from the JSON blob.
+ ///
+ public const string Key = "Multi Scene";
+
+
+ ///
+ /// The version string for the package.
+ ///
+ public static string ProjectVersionNumber => AssetVersionData.VersionNumber;
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionInfo.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionInfo.cs.meta
new file mode 100644
index 0000000..fa062cd
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7b27854de69e47ba8aa5f386703a6e6f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionNumber.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionNumber.cs
new file mode 100644
index 0000000..4c72039
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionNumber.cs
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using UnityEngine;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// A data class to hold a x.x.x version number for comparisons.
+ ///
+ [Serializable]
+ public sealed class VersionNumber
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ [SerializeField] private int major;
+ [SerializeField] private int minor;
+ [SerializeField] private int patch;
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Properties
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// The major version number.
+ ///
+ public int Major => major;
+
+
+ ///
+ /// The minor version number.
+ ///
+ public int Minor => minor;
+
+
+ ///
+ /// The patch version number.
+ ///
+ public int Patch => patch;
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Constructors
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// The blank constructor.
+ ///
+ public VersionNumber() { }
+
+
+ ///
+ /// Makes a new version number with the string entered.
+ ///
+ /// The string to convert.
+ public VersionNumber(string value)
+ {
+ var split = value.Split('.');
+
+ if (split.Length != 3) return;
+
+ major = int.Parse(split[0]);
+ minor = int.Parse(split[1]);
+ patch = int.Parse(split[2]);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionNumber.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionNumber.cs.meta
new file mode 100644
index 0000000..cca3044
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionNumber.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2a083d6e9d044ab48462cfea555a8b2b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionPacket.cs b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionPacket.cs
new file mode 100644
index 0000000..8b24521
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionPacket.cs
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Linq;
+using UnityEngine;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// A data class to hold the data downloaded from the server when requested.
+ ///
+ [Serializable]
+ public sealed class VersionPacket
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ [SerializeField] private VersionData[] data;
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Properties
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// The data received for this package.
+ ///
+ public VersionData Data => data.FirstOrDefault(t => t.Key.Equals(VersionInfo.Key));
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionPacket.cs.meta b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionPacket.cs.meta
new file mode 100644
index 0000000..277330b
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Systems/Version Validation/VersionPacket.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 67ff64a0cd7f46d69c321f97deaf6354
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility.meta b/Carter Games/Multi Scene/Code/Editor/Utility.meta
new file mode 100644
index 0000000..cc33c12
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: c1a08d1c789c4cf1b1dc731b75e77a3b
+timeCreated: 1716403945
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/AssetVersionData.cs b/Carter Games/Multi Scene/Code/Editor/Utility/AssetVersionData.cs
new file mode 100644
index 0000000..4326682
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/AssetVersionData.cs
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// Contains details for the asset.
+ ///
+ public static class AssetVersionData
+ {
+ ///
+ /// The version number of the asset.
+ ///
+ public static string VersionNumber => "0.3.0";
+
+
+ ///
+ /// The date this release of the asset was submitted for release.
+ ///
+ ///
+ /// Asset owner is in the UK, so its D/M/Y format.
+ ///
+ public static string ReleaseDate => "24/05/2024";
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/AssetVersionData.cs.meta b/Carter Games/Multi Scene/Code/Editor/Utility/AssetVersionData.cs.meta
new file mode 100644
index 0000000..02d6d14
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/AssetVersionData.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d03dc77bf74b407ba879d5e5176285ce
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid.meta b/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid.meta
new file mode 100644
index 0000000..fe5853f
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: f0e99ef16e8c4aa29eb723c00c04b538
+timeCreated: 1716403952
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid/InterfaceHelper.cs b/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid/InterfaceHelper.cs
new file mode 100644
index 0000000..7e3116b
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid/InterfaceHelper.cs
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Linq;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ public static class InterfaceHelper
+ {
+ ///
+ /// Gets all the interface implementations and returns the result (Editor Only)
+ ///
+ /// An Array of the interface type
+ public static T[] GetAllInterfacesInstancesOfType()
+ {
+ var types = AppDomain.CurrentDomain.GetAssemblies()
+ .SelectMany(x => x.GetTypes())
+ .Where(x => x.IsClass && typeof(T).IsAssignableFrom(x));
+
+ return types.Select(type => (T)Activator.CreateInstance(type)).ToArray();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid/InterfaceHelper.cs.meta b/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid/InterfaceHelper.cs.meta
new file mode 100644
index 0000000..ba8ee15
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid/InterfaceHelper.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: cc9b024f40894f91ad74dcbd5d2d1bbd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid/SerializedPropertyHelper.cs b/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid/SerializedPropertyHelper.cs
new file mode 100644
index 0000000..114eb69
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid/SerializedPropertyHelper.cs
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using UnityEditor;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// A helper class to aid with editor scripting where the API is really wordy...
+ ///
+ public static class SerializedPropertyHelper
+ {
+ ///
+ /// Calls InsertArrayElementAtIndex()
+ ///
+ /// The property.
+ /// The index.
+ public static void InsertIndex(this SerializedProperty property, int index)
+ {
+ property.InsertArrayElementAtIndex(index);
+ }
+
+
+ ///
+ /// Calls DeleteArrayElementAtIndex()
+ ///
+ /// The property.
+ /// The index.
+ public static void DeleteIndex(this SerializedProperty property, int index)
+ {
+ property.DeleteArrayElementAtIndex(index);
+ }
+
+
+ ///
+ /// Calls GetArrayElementAtIndex()
+ ///
+ /// The property.
+ /// The index.
+ /// The property at the index entered.
+ public static SerializedProperty GetIndex(this SerializedProperty property, int index)
+ {
+ return property.GetArrayElementAtIndex(index);
+ }
+
+
+ ///
+ /// Calls FindProperty()
+ ///
+ /// The target object.
+ /// The name of the property.
+ /// The found property.
+ public static SerializedProperty Fp(this SerializedObject serializedObject, string propName)
+ {
+ return serializedObject.FindProperty(propName);
+ }
+
+
+ ///
+ /// Calls FindPropertyRelative()
+ ///
+ /// The target property.
+ /// The name of the property.
+ /// The found property.
+ public static SerializedProperty Fpr(this SerializedProperty property, string propName)
+ {
+ return property.FindPropertyRelative(propName);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid/SerializedPropertyHelper.cs.meta b/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid/SerializedPropertyHelper.cs.meta
new file mode 100644
index 0000000..3a15c21
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Editor Method Aid/SerializedPropertyHelper.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2a702b1b98af4538bf0bbdab3e8f7aba
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings.meta b/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings.meta
new file mode 100644
index 0000000..cddb12d
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 2eccf08c23d54825be34b3a8fc1d049c
+timeCreated: 1716404006
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings/PerUserSettings.cs b/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings/PerUserSettings.cs
new file mode 100644
index 0000000..1b6f46e
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings/PerUserSettings.cs
@@ -0,0 +1,299 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using UnityEditor;
+using UnityEngine;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// Handles the editor settings per user, instead of an editor asset like before.
+ ///
+ public static class PerUserSettings
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private const string UniqueIdId = "CarterGames_MultiScene_Editor_UUID";
+
+ private static readonly string AutoValidationAutoCheckId = $"{UniqueId}_CarterGames_MultiScene_EditorSettings_AutoVersionCheck";
+
+ private static readonly string SettingsEditorDropdownId = $"{UniqueId}_CarterGames_MultiScene_EditorSettings_EditorSettingsDropdownToggle";
+ private static readonly string SettingsSceneManagementDropdownId = $"{UniqueId}_CarterGames_MultiScene_EditorSettings_EditorSceneManagementDropdownToggle";
+ private static readonly string SettingsSceneGroupDropdownId = $"{UniqueId}_CarterGames_MultiScene_EditorSettings_EditorSceneGroupDropdownToggle";
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Properties
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// The unique if for the assets settings to be per project...
+ ///
+ ///
+ /// Saved to player pref to allow settings to be different per project in the same editor version.
+ ///
+ private static string UniqueId => (string)GetOrCreateValue(UniqueIdId, SettingType.PlayerPref, Guid.NewGuid().ToString());
+
+
+ ///
+ /// Should the validator check for a new version on load for the user?
+ ///
+ public static bool VersionValidationAutoCheckOnLoad
+ {
+ get => (bool) GetOrCreateValue(AutoValidationAutoCheckId, SettingType.EditorPref, true);
+ set => SetValue(AutoValidationAutoCheckId, SettingType.EditorPref, value);
+ }
+
+
+ public static bool SettingsEditorDropdown
+ {
+ get => (bool) GetOrCreateValue(SettingsEditorDropdownId, SettingType.EditorPref, true);
+ set => SetValue(SettingsEditorDropdownId, SettingType.EditorPref, value);
+ }
+
+
+ public static bool SettingsSceneManagementDropdown
+ {
+ get => (bool) GetOrCreateValue(SettingsSceneManagementDropdownId, SettingType.EditorPref, true);
+ set => SetValue(SettingsSceneManagementDropdownId, SettingType.EditorPref, value);
+ }
+
+
+ public static bool SettingsSceneGroupDropdown
+ {
+ get => (bool) GetOrCreateValue(SettingsSceneGroupDropdownId, SettingType.EditorPref, true);
+ set => SetValue(SettingsSceneGroupDropdownId, SettingType.EditorPref, value);
+ }
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private static object GetOrCreateValue(string key, SettingType type, object defaultValue = null)
+ {
+ switch (type)
+ {
+ case SettingType.EditorPref:
+
+ if (EditorPrefs.HasKey(key))
+ {
+ switch (typeof(T))
+ {
+ case var x when x == typeof(bool):
+ return EditorPrefs.GetBool(key);
+ case var x when x == typeof(int):
+ return EditorPrefs.GetInt(key);
+ case var x when x == typeof(float):
+ return EditorPrefs.GetFloat(key);
+ case var x when x == typeof(string):
+ return EditorPrefs.GetString(key);
+ case var x when x == typeof(Vector2):
+ return JsonUtility.FromJson(EditorPrefs.GetString(key));
+ default:
+ return null;
+ }
+ }
+
+ switch (typeof(T))
+ {
+ case var x when x == typeof(bool):
+ EditorPrefs.SetBool(key, defaultValue == null ? false : (bool)defaultValue);
+ return EditorPrefs.GetBool(key);
+ case var x when x == typeof(int):
+ EditorPrefs.SetInt(key, defaultValue == null ? 0 : (int)defaultValue);
+ return EditorPrefs.GetInt(key);
+ case var x when x == typeof(float):
+ EditorPrefs.SetFloat(key, defaultValue == null ? 0 : (float)defaultValue);
+ return EditorPrefs.GetFloat(key);
+ case var x when x == typeof(string):
+ EditorPrefs.SetString(key, (string)defaultValue);
+ return EditorPrefs.GetString(key);
+ case var x when x == typeof(Vector2):
+ EditorPrefs.SetString(key,
+ defaultValue == null
+ ? JsonUtility.ToJson(Vector2.zero)
+ : JsonUtility.ToJson(defaultValue));
+ return JsonUtility.FromJson(EditorPrefs.GetString(key));
+ default:
+ return null;
+ }
+
+ case SettingType.PlayerPref:
+
+ if (PlayerPrefs.HasKey(key))
+ {
+ switch (typeof(T))
+ {
+ case var x when x == typeof(bool):
+ return PlayerPrefs.GetInt(key) == 1;
+ case var x when x == typeof(int):
+ return PlayerPrefs.GetInt(key);
+ case var x when x == typeof(float):
+ return PlayerPrefs.GetFloat(key);
+ case var x when x == typeof(string):
+ return PlayerPrefs.GetString(key);
+ case var x when x == typeof(Vector2):
+ return JsonUtility.FromJson(PlayerPrefs.GetString(key));
+ default:
+ return null;
+ }
+ }
+
+ switch (typeof(T))
+ {
+ case var x when x == typeof(bool):
+ PlayerPrefs.SetInt(key,
+ defaultValue == null ? 0 : defaultValue.ToString().ToLower() == "true" ? 1 : 0);
+ return PlayerPrefs.GetInt(key) == 1;
+ case var x when x == typeof(int):
+ PlayerPrefs.SetInt(key, defaultValue == null ? 0 : (int)defaultValue);
+ return PlayerPrefs.GetInt(key);
+ case var x when x == typeof(float):
+ PlayerPrefs.SetFloat(key, defaultValue == null ? 0 : (float)defaultValue);
+ return PlayerPrefs.GetFloat(key);
+ case var x when x == typeof(string):
+ PlayerPrefs.SetString(key, (string)defaultValue);
+ return PlayerPrefs.GetString(key);
+ case var x when x == typeof(Vector2):
+ PlayerPrefs.SetString(key,
+ defaultValue == null
+ ? JsonUtility.ToJson(Vector2.zero)
+ : JsonUtility.ToJson(defaultValue));
+ return JsonUtility.FromJson(PlayerPrefs.GetString(key));
+ default:
+ return null;
+ }
+
+ case SettingType.SessionState:
+
+ switch (typeof(T))
+ {
+ case var x when x == typeof(bool):
+ return SessionState.GetBool(key, defaultValue == null ? false : (bool)defaultValue);
+ case var x when x == typeof(int):
+ return SessionState.GetInt(key, defaultValue == null ? 0 : (int)defaultValue);
+ case var x when x == typeof(float):
+ return SessionState.GetFloat(key, defaultValue == null ? 0 : (float)defaultValue);
+ case var x when x == typeof(string):
+ return SessionState.GetString(key, (string)defaultValue);
+ case var x when x == typeof(Vector2):
+ return JsonUtility.FromJson(SessionState.GetString(key,
+ JsonUtility.ToJson(defaultValue)));
+ default:
+ return null;
+ }
+
+ default:
+ return null;
+ }
+ }
+
+
+ private static void SetValue(string key, SettingType type, object value)
+ {
+ switch (type)
+ {
+ case SettingType.EditorPref:
+
+ switch (typeof(T))
+ {
+ case var x when x == typeof(bool):
+ EditorPrefs.SetBool(key, (bool)value);
+ break;
+ case var x when x == typeof(int):
+ EditorPrefs.SetInt(key, (int)value);
+ break;
+ case var x when x == typeof(float):
+ EditorPrefs.SetFloat(key, (float)value);
+ break;
+ case var x when x == typeof(string):
+ EditorPrefs.SetString(key, (string)value);
+ break;
+ case var x when x == typeof(Vector2):
+ EditorPrefs.SetString(key, JsonUtility.ToJson(value));
+ break;
+ }
+
+ break;
+ case SettingType.PlayerPref:
+
+ switch (typeof(T))
+ {
+ case var x when x == typeof(bool):
+ PlayerPrefs.SetInt(key, ((bool)value) ? 1 : 0);
+ break;
+ case var x when x == typeof(int):
+ PlayerPrefs.SetInt(key, (int)value);
+ break;
+ case var x when x == typeof(float):
+ PlayerPrefs.SetFloat(key, (float)value);
+ break;
+ case var x when x == typeof(string):
+ PlayerPrefs.SetString(key, (string)value);
+ break;
+ case var x when x == typeof(Vector2):
+ PlayerPrefs.SetString(key, JsonUtility.ToJson(value));
+ break;
+ }
+
+ PlayerPrefs.Save();
+
+ break;
+ case SettingType.SessionState:
+
+ switch (typeof(T))
+ {
+ case var x when x == typeof(bool):
+ SessionState.SetBool(key, (bool)value);
+ break;
+ case var x when x == typeof(int):
+ SessionState.SetInt(key, (int)value);
+ break;
+ case var x when x == typeof(float):
+ SessionState.SetFloat(key, (float)value);
+ break;
+ case var x when x == typeof(string):
+ SessionState.SetString(key, (string)value);
+ break;
+ case var x when x == typeof(Vector2):
+ SessionState.SetString(key, JsonUtility.ToJson(value));
+ break;
+ }
+
+ break;
+ }
+ }
+
+
+ ///
+ /// Resets all user editor settings for this asset when called.
+ ///
+ [MenuItem("Tools/Carter Games/Multi Scene/Reset User Editor Settings")]
+ public static void ResetPrefs()
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings/PerUserSettings.cs.meta b/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings/PerUserSettings.cs.meta
new file mode 100644
index 0000000..29bdc3c
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings/PerUserSettings.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 557e869932c54b4ebbac4b5a1b035f3c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings/SettingType.cs b/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings/SettingType.cs
new file mode 100644
index 0000000..5212ae1
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings/SettingType.cs
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ public enum SettingType
+ {
+ EditorPref,
+ PlayerPref,
+ SessionState,
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings/SettingType.cs.meta b/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings/SettingType.cs.meta
new file mode 100644
index 0000000..50741eb
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Per User Settings/SettingType.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a63892fa4d674ed586adf599da76f7b8
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets.meta b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets.meta
new file mode 100644
index 0000000..f6cec38
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: dd1b1586ba524fd3a5d3d6e2fe395dd4
+timeCreated: 1716404274
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/FileEditorUtil.cs b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/FileEditorUtil.cs
new file mode 100644
index 0000000..3abe73e
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/FileEditorUtil.cs
@@ -0,0 +1,324 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Linq.Expressions;
+using UnityEditor;
+using UnityEngine;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// Handles finding assets in the project in editor space and creating/referencing/caching them for use.
+ ///
+ public static class FileEditorUtil
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// The name of the asset, used in path checks.
+ ///
+ public const string AssetName = "Multi Scene";
+
+
+ ///
+ /// The path to a script in the asset to verify the asset base path.
+ ///
+ private static readonly string BasePathScriptPath = $"/Carter Games/{AssetName}/Code/Editor/Utility/{BasePathScriptName}.cs";
+
+
+ ///
+ /// The base path check script name.
+ ///
+ private const string BasePathScriptName = "UtilEditor";
+
+
+ ///
+ /// The base path cache.
+ ///
+ private static string basePath = "";
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Properties
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// The base path for the asset code.
+ ///
+ public static string AssetBasePath
+ {
+ get
+ {
+ if (basePath.Length > 0) return basePath;
+ basePath = GetBaseAssetPath();
+ return basePath;
+ }
+ }
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Getter Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Gets the base path of the asset code, will break if the code is split up by the user.
+ ///
+ /// The base path found.
+ private static string GetBaseAssetPath()
+ {
+ string path = string.Empty;
+ var containsChecks = new List { AssetName, $"/{BasePathScriptName}.cs" };
+
+ foreach (var scriptFound in AssetDatabase.FindAssets($"t:Script {nameof(UtilEditor)}"))
+ {
+ path = AssetDatabase.GUIDToAssetPath(scriptFound);
+
+ foreach (var check in containsChecks)
+ {
+ if (!path.Contains(check)) goto SkipAndLoop;
+ }
+
+ path = AssetDatabase.GUIDToAssetPath(scriptFound);
+ path = path.Replace(BasePathScriptPath, "");
+
+ return path;
+
+ // Skips the return as the path contained an invalid element for the asset...
+ SkipAndLoop: ;
+ }
+
+ return path;
+ }
+
+
+ ///
+ /// Gets a script file in the asset.
+ ///
+ /// The path to the script.
+ /// Parts of a string the path should contain.
+ /// The type.
+ /// The found file as an object if found successfully.
+ public static object GetScriptInAsset(string assetPath, params string[] pathContains)
+ {
+ string path = string.Empty;
+
+ foreach (var scriptFound in AssetDatabase.FindAssets($"t:Script {nameof(T)}"))
+ {
+ path = AssetDatabase.GUIDToAssetPath(scriptFound);
+
+ foreach (var containCheck in pathContains)
+ {
+ if (!path.Contains(containCheck)) goto Loop;
+ }
+
+ path = AssetDatabase.GUIDToAssetPath(scriptFound);
+ return AssetDatabase.LoadAssetAtPath(path, typeof(T));
+ Loop: ;
+ }
+
+ return null;
+ }
+
+
+ ///
+ /// Gets a asset file in the asset.
+ ///
+ /// The filter to check.
+ /// Parts of a string the path should contain.
+ /// The type.
+ /// The found file as an object if found successfully.
+ public static object GetAssetInstance(string filter, params string[] pathContains)
+ {
+ string path = string.Empty;
+
+ foreach (var assetFound in AssetDatabase.FindAssets(filter, null))
+ {
+ path = AssetDatabase.GUIDToAssetPath(assetFound);
+
+ foreach (var containCheck in pathContains)
+ {
+ if (!path.Contains(containCheck)) goto Loop;
+ }
+
+ path = AssetDatabase.GUIDToAssetPath(assetFound);
+ return AssetDatabase.LoadAssetAtPath(path, typeof(T));
+ Loop: ;
+ }
+
+ return null;
+ }
+
+
+ ///
+ /// Gets a asset file in the asset.
+ ///
+ /// The filter to check.
+ /// The path to check.
+ /// Parts of a string the path should contain.
+ /// The type.
+ /// The found file as an object if found successfully.
+ public static object GetAssetInstance(string filter, string assetPath, params string[] pathContains)
+ {
+ if (AssetDatabase.AssetPathToGUID(assetPath).Length > 0)
+ {
+ return AssetDatabase.LoadAssetAtPath(assetPath, typeof(T));
+ }
+
+ string path = string.Empty;
+
+ foreach (var assetFound in AssetDatabase.FindAssets(filter, null))
+ {
+ path = AssetDatabase.GUIDToAssetPath(assetFound);
+
+ foreach (var containCheck in pathContains)
+ {
+ if (!path.Contains(containCheck)) goto Loop;
+ }
+
+ path = AssetDatabase.GUIDToAssetPath(assetFound);
+ return AssetDatabase.LoadAssetAtPath(path, typeof(T));
+ Loop: ;
+ }
+
+ return null;
+ }
+
+
+ ///
+ /// Does the traditional get or assign cache method but with the new get asset instance variant.
+ ///
+ /// The cache to update.
+ /// The filter to search for.
+ /// The strings to match in the path for the asset.
+ /// The type to get.
+ /// The updated cache.
+ public static T GetOrAssignCache(ref T cache, string filter, params string[] pathContains)
+ {
+ if (cache != null) return cache;
+ cache = (T) GetAssetInstance(filter, pathContains);
+ return cache;
+ }
+
+
+ ///
+ /// Creates a scriptable object or assigns the cache to an existing instance if one is found.
+ ///
+ /// The cache to check.
+ /// The filter to use.
+ /// The path to create the asset to if not found.
+ /// Any string that should be in the path to make sure its the right asset.
+ /// The type to check for.
+ /// The found or created asset.
+ public static T CreateSoGetOrAssignAssetCache(ref T cache, string filter, string path, params string[] pathContains) where T : ScriptableObject
+ {
+ if (cache != null) return cache;
+
+ cache = (T)GetAssetInstance(filter, path, pathContains);
+
+ if (cache == null)
+ {
+ cache = CreateScriptableObject(path);
+ }
+
+ AssetIndexHandler.UpdateIndex();
+
+ return cache;
+ }
+
+
+ ///
+ /// Creates, gets or assigns a serialized object reference.
+ ///
+ /// The cache to assign to.
+ /// The reference to set from.,
+ /// The type to reference.
+ /// The updated cache.
+ public static SerializedObject CreateGetOrAssignSerializedObjectCache(ref SerializedObject cache, T reference)
+ {
+ if (cache != null && cache.targetObject != null) return cache;
+ cache = new SerializedObject(reference as Object);
+ return cache;
+ }
+
+
+ ///
+ /// Creates a scriptable object of the type entered when called.
+ ///
+ /// The path to create the new asset at.
+ /// The type to make.
+ /// The newly created asset.
+ private static T CreateScriptableObject(string path) where T : ScriptableObject
+ {
+ var instance = ScriptableObject.CreateInstance(typeof(T));
+
+ CreateToDirectory(path);
+
+ AssetDatabase.CreateAsset(instance, path);
+ AssetDatabase.Refresh();
+
+ return (T)instance;
+ }
+
+
+ ///
+ /// Creates all the folders to a path if they don't exist already.
+ ///
+ /// The path to create to.
+ public static void CreateToDirectory(string path)
+ {
+ var currentPath = string.Empty;
+ var split = path.Split('/');
+
+ for (var i = 0; i < path.Split('/').Length; i++)
+ {
+ var element = path.Split('/')[i];
+ currentPath += element + "/";
+
+ if (i.Equals(split.Length - 1))continue;
+ if (Directory.Exists(currentPath))continue;
+
+ Directory.CreateDirectory(currentPath);
+ }
+ }
+
+
+ ///
+ /// Deletes a directory and any assets within when called.
+ ///
+ /// The path to delete.
+ public static void DeleteDirectoryAndContents(string path)
+ {
+ foreach (var file in Directory.GetFiles(path).ToList())
+ {
+ AssetDatabase.DeleteAsset(file);
+ }
+
+ AssetDatabase.DeleteAsset(path);
+ AssetDatabase.SaveAssets();
+ AssetDatabase.Refresh();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/FileEditorUtil.cs.meta b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/FileEditorUtil.cs.meta
new file mode 100644
index 0000000..0cae728
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/FileEditorUtil.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4a23881518d540d598d5b0ca7773ca8b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/ScriptableObjectInitialize.cs b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/ScriptableObjectInitialize.cs
new file mode 100644
index 0000000..3e4fcb8
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/ScriptableObjectInitialize.cs
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// Handles any logic for generating/updating the scriptable objects for the asset where needed.
+ ///
+ public class ScriptableObjectInitialize : IAssetEditorInitialize, IAssetEditorReload
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | IAssetEditorInitialize
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Defines the order that this initializer run at.
+ ///
+ public int InitializeOrder => -1;
+
+
+ ///
+ /// Runs when the asset initialize flow is used.
+ ///
+ public void OnEditorInitialized()
+ {
+ if (ScriptableRef.HasAllAssets) return;
+ ScriptableRef.TryCreateAssets();
+ }
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | IAssetEditorReload
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Runs when the asset reload flow is used.
+ ///
+ public void OnEditorReloaded()
+ {
+ if (ScriptableRef.HasAllAssets) return;
+ ScriptableRef.TryCreateAssets();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/ScriptableObjectInitialize.cs.meta b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/ScriptableObjectInitialize.cs.meta
new file mode 100644
index 0000000..f6ea499
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/ScriptableObjectInitialize.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2ace92c032fb443e89e547462e9a1323
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/ScriptableRef.cs b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/ScriptableRef.cs
new file mode 100644
index 0000000..82b49ca
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/ScriptableRef.cs
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.IO;
+using UnityEditor;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// Handles references to scriptable objects in the asset that need generating without user input etc.
+ ///
+ public static class ScriptableRef
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ // Asset Paths
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+ private static readonly string AssetIndexPath = $"{AssetBasePath}/Carter Games/{AssetName}/Resources/Asset Index.asset";
+ private static readonly string SettingsAssetPath = $"{AssetBasePath}/Carter Games/{AssetName}/Data/Runtime Settings.asset";
+
+
+ // Asset Filters
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+ private static readonly string RuntimeSettingsFilter = $"t:{typeof(AssetGlobalRuntimeSettings).FullName}";
+ private static readonly string AssetIndexFilter = $"t:{typeof(AssetIndex).FullName}";
+
+
+ // Asset Caches
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+ private static AssetGlobalRuntimeSettings assetGlobalRuntimeSettingsCache;
+ private static AssetIndex assetIndexCache;
+
+
+ // SerializedObject Caches
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+ private static SerializedObject settingsAssetRuntimeObjectCache;
+ private static SerializedObject settingsAssetEditorObjectCache;
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Properties
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ // Helper Properties
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Gets the path where the asset code is located.
+ ///
+ private static string AssetBasePath => FileEditorUtil.AssetBasePath;
+
+
+ ///
+ /// Gets the asset name stored in the file util editor class.
+ ///
+ private static string AssetName => FileEditorUtil.AssetName;
+
+
+ // Asset Properties
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// The asset index for the asset.
+ ///
+ public static AssetIndex AssetIndex =>
+ FileEditorUtil.CreateSoGetOrAssignAssetCache(ref assetIndexCache, AssetIndexFilter, AssetIndexPath, AssetName, $"{AssetName}/Resources/Asset Index.asset");
+
+
+ ///
+ /// The runtime settings for the asset.
+ ///
+ public static AssetGlobalRuntimeSettings RuntimeAssetGlobalRuntimeSettings =>
+ FileEditorUtil.CreateSoGetOrAssignAssetCache(ref assetGlobalRuntimeSettingsCache, RuntimeSettingsFilter, SettingsAssetPath, AssetName, $"{AssetName}/Data/Runtime Settings.asset");
+
+ // Object Properties
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// The runtime SerializedObject for the asset.
+ ///
+ public static SerializedObject RuntimeSettingsObject =>
+ FileEditorUtil.CreateGetOrAssignSerializedObjectCache(ref settingsAssetRuntimeObjectCache, RuntimeAssetGlobalRuntimeSettings);
+
+ // Assets Initialized Check
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Gets if all the assets needed for the asset to function are in the project at the expected paths.
+ ///
+ public static bool HasAllAssets =>
+ File.Exists(AssetIndexPath) && File.Exists(SettingsAssetPath);
+
+
+ ///
+ /// Tries to create any missing assets when called.
+ ///
+ public static void TryCreateAssets()
+ {
+ if (assetIndexCache == null)
+ {
+ FileEditorUtil.CreateSoGetOrAssignAssetCache(
+ ref assetIndexCache,
+ AssetIndexFilter,
+ AssetIndexPath,
+ AssetName, $"{AssetName}/Resources/Asset Index.asset");
+ }
+
+
+ if (assetGlobalRuntimeSettingsCache == null)
+ {
+ FileEditorUtil.CreateSoGetOrAssignAssetCache(
+ ref assetGlobalRuntimeSettingsCache,
+ RuntimeSettingsFilter,
+ SettingsAssetPath,
+ AssetName, $"{AssetName}/Data/Runtime Settings.asset");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/ScriptableRef.cs.meta b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/ScriptableRef.cs.meta
new file mode 100644
index 0000000..d63ae83
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/Scriptable Assets/ScriptableRef.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d43c96a7c2c241629aeea034d1964b98
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/UtilEditor.cs b/Carter Games/Multi Scene/Code/Editor/Utility/UtilEditor.cs
new file mode 100644
index 0000000..9011dba
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/UtilEditor.cs
@@ -0,0 +1,363 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections;
+using System.Collections.Generic;
+using UnityEditor;
+using UnityEngine;
+
+namespace CarterGames.Experimental.MultiScene.Editor
+{
+ ///
+ /// The primary utility class for the multi scene's editor logic. Should only be used in the editor space!
+ ///
+ public static class UtilEditor
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ // Paths
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+ public const string SettingsWindowPath = "Project/Carter Games/Multi Scene";
+
+
+ // Filters
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ // Graphics
+ private const string MultiSceneLogoFilter = "T_MultiScene_Logo";
+ private const string MultiSceneLogoTransparentFilter = "T_MultiScene_Transparent_Logo";
+ private const string CarterGamesBannerFilter = "T_MultiScene_CarterGamesBanner";
+
+
+ // Texture Caches
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+ private static Texture2D multiSceneLogoCache;
+ private static Texture2D multiSceneLogoTransparentCache;
+ private static Texture2D carterGamesBannerCache;
+
+
+ // Asset Caches
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+ private static AssetGlobalRuntimeSettings assetGlobalRuntimeSettingsCache;
+ private static SerializedObject settingsObjectCache;
+ private static SerializedObject editorSettingsObjectCache;
+ private static AssetIndex assetIndexCache;
+
+
+ // Colours
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Green Apple (Green) Color
+ ///
+ ///
+ public static readonly Color Green = new Color32(76, 196, 23, 255);
+
+
+ ///
+ /// Rubber Ducky Yellow (Yellow) Color
+ ///
+ ///
+ public static readonly Color Yellow = new Color32(255, 216, 1, 255);
+
+
+ ///
+ /// Scarlet Red (Red) Color
+ ///
+ ///
+ public static readonly Color Red = new Color32(255, 36, 23, 255);
+
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Properties
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Gets the path where the asset code is located.
+ ///
+ private static string AssetBasePath => FileEditorUtil.AssetBasePath;
+
+
+ // Textures/Graphics
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Gets the multi scene logo.
+ ///
+ public static Texture2D MultiSceneLogo => FileEditorUtil.GetOrAssignCache(ref multiSceneLogoCache, MultiSceneLogoFilter);
+
+
+ ///
+ /// Gets the carter games banner.
+ ///
+ public static Texture2D CarterGamesBanner =>
+ FileEditorUtil.GetOrAssignCache(ref carterGamesBannerCache, CarterGamesBannerFilter);
+
+
+ ///
+ /// Gets the multi scene transparent logo.
+ ///
+ public static Texture2D MultiSceneTransparentLogo =>
+ FileEditorUtil.GetOrAssignCache(ref multiSceneLogoTransparentCache, MultiSceneLogoTransparentFilter);
+
+
+ // Assets
+ /* ────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Gets if there is a settings asset in the project.
+ ///
+ public static bool HasInitialized
+ {
+ get
+ {
+ AssetIndexHandler.UpdateIndex();
+ return ScriptableRef.HasAllAssets;
+ }
+ }
+
+
+ ///
+ /// Gets/Sets the save manager settings asset.
+ ///
+ public static AssetGlobalRuntimeSettings RuntimeSettings => ScriptableRef.RuntimeAssetGlobalRuntimeSettings;
+
+
+ ///
+ /// Gets/Sets the save manager editor settings asset.
+ ///
+ public static SerializedObject SettingsObject => ScriptableRef.RuntimeSettingsObject;
+
+
+ ///
+ /// Gets/Sets the save manager save data asset.
+ ///
+ public static AssetIndex AssetIndex => ScriptableRef.AssetIndex;
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Draw Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Draws the default Banner Logo header for the asset...
+ ///
+ public static void DrawHeader()
+ {
+ GUILayout.Space(5f);
+
+ EditorGUILayout.BeginHorizontal();
+ GUILayout.FlexibleSpace();
+
+ if (MultiSceneLogo != null)
+ {
+ if (GUILayout.Button(MultiSceneLogo, GUIStyle.none, GUILayout.MaxHeight(110)))
+ {
+ GUI.FocusControl(null);
+ }
+ }
+
+ GUILayout.FlexibleSpace();
+ EditorGUILayout.EndHorizontal();
+
+ GUILayout.Space(5f);
+ }
+
+
+ ///
+ /// Draws the script fields in the custom inspector...
+ ///
+ public static void DrawMonoScriptSection(T target) where T : MonoBehaviour
+ {
+ EditorGUILayout.BeginVertical("HelpBox");
+ GUILayout.Space(1.5f);
+
+ EditorGUI.BeginDisabledGroup(true);
+ EditorGUILayout.ObjectField("Script:", MonoScript.FromMonoBehaviour(target), typeof(T), false);
+ EditorGUI.EndDisabledGroup();
+
+ GUILayout.Space(1.5f);
+ EditorGUILayout.EndVertical();
+ }
+
+
+ ///
+ /// Draws the script fields in the custom inspector...
+ ///
+ public static void DrawSoScriptSection(object target)
+ {
+ EditorGUI.BeginDisabledGroup(true);
+ EditorGUILayout.ObjectField("Script:", MonoScript.FromScriptableObject((ScriptableObject)target),
+ typeof(object), false);
+ EditorGUI.EndDisabledGroup();
+ }
+
+
+ ///
+ /// Draws a horizontal line
+ ///
+ public static void DrawHorizontalGUILine()
+ {
+ GUIStyle boxStyle = new GUIStyle(GUI.skin.box);
+ boxStyle.normal.background = new Texture2D(1, 1);
+ boxStyle.normal.background.SetPixel(0, 0, Color.grey);
+ boxStyle.normal.background.Apply();
+
+ var one = EditorGUILayout.BeginHorizontal();
+ GUILayout.Box("", boxStyle, GUILayout.ExpandWidth(true), GUILayout.Height(2));
+ EditorGUILayout.EndHorizontal();
+ }
+
+
+ ///
+ /// Creates a deselect zone to let users click outside of any editor window to unfocus from their last selected field.
+ ///
+ /// The rect to draw on.
+ public static void CreateDeselectZone(ref Rect rect)
+ {
+ if (rect.width <= 0)
+ {
+ rect = new Rect(0, 0, Screen.width, Screen.height);
+ }
+
+ if (GUI.Button(rect, string.Empty, GUIStyle.none))
+ {
+ GUI.FocusControl(null);
+ }
+ }
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Helper Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ public static void Initialize()
+ {
+ AssetDatabase.Refresh();
+
+ if (assetIndexCache == null)
+ {
+ assetIndexCache = AssetIndex;
+ }
+
+ if (assetGlobalRuntimeSettingsCache == null)
+ {
+ assetGlobalRuntimeSettingsCache = RuntimeSettings;
+ }
+
+ AssetIndexHandler.UpdateIndex();
+ EditorUtility.SetDirty(AssetIndex);
+
+ AssetDatabase.SaveAssets();
+ AssetDatabase.Refresh();
+ }
+
+
+ public static T[] GetAllInstances() where T : MultiSceneAsset
+ {
+ var guids = AssetDatabase.FindAssets("t:"+ typeof(T).Name);
+ var a = new T[guids.Length];
+
+ for (var i =0;i(path);
+ }
+
+ return a;
+ }
+
+
+ ///
+ /// Checks to see if a list has any null entries.
+ ///
+ /// The list to check.
+ /// If there was a null entry or not.
+ public static bool HasNullEntries(this IList list)
+ {
+ if (list == null || list.Count <= 0) return false;
+
+ for (var i = list.Count - 1; i > -1; i--)
+ {
+ if (list[i] != null) continue;
+ return true;
+ }
+
+ return false;
+ }
+
+
+ ///
+ /// Removes missing entries in a list when called.
+ ///
+ /// The list to edit.
+ /// The list with no null entries.
+ public static IList RemoveMissing(this IList list)
+ {
+ for (var i = list.Count - 1; i > -1; i--)
+ {
+ if (list[i] == null)
+ {
+ list.RemoveAt(i);
+ }
+ }
+
+ return list;
+ }
+
+
+ ///
+ /// Removed any duplicate entries from the list entered.
+ ///
+ /// The list to edit.
+ /// The type for the list.
+ /// The list with no null entries.
+ public static IList RemoveDuplicates(this IList list)
+ {
+ var validateList = new List();
+
+ for (var i = list.Count - 1; i > -1; i--)
+ {
+ if (validateList.Contains((T)list[i])) continue;
+ validateList.Add((T)list[i]);
+ }
+
+ return validateList;
+ }
+
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Editor Extension Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Gets the width of a string's GUI.
+ ///
+ /// The text to size.
+ /// The resulting size.
+ public static float Width(this string text)
+ {
+ return GUI.skin.label.CalcSize(new GUIContent(text)).x + 1.5f;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Editor/Utility/UtilEditor.cs.meta b/Carter Games/Multi Scene/Code/Editor/Utility/UtilEditor.cs.meta
new file mode 100644
index 0000000..6df0063
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Editor/Utility/UtilEditor.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b4087d7505b54d41b45909bb7bfe2e27
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime.meta b/Carter Games/Multi Scene/Code/Runtime.meta
new file mode 100644
index 0000000..37e3ee5
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ecbb33183c7eedb40a545faca7678d98
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/CarterGames.MultiScene.Runtime.asmdef b/Carter Games/Multi Scene/Code/Runtime/CarterGames.MultiScene.Runtime.asmdef
similarity index 83%
rename from Runtime/CarterGames.MultiScene.Runtime.asmdef
rename to Carter Games/Multi Scene/Code/Runtime/CarterGames.MultiScene.Runtime.asmdef
index 0a99724..21f2e2a 100644
--- a/Runtime/CarterGames.MultiScene.Runtime.asmdef
+++ b/Carter Games/Multi Scene/Code/Runtime/CarterGames.MultiScene.Runtime.asmdef
@@ -1,7 +1,9 @@
{
"name": "CarterGames.MultiScene.Runtime",
"rootNamespace": "CarterGames.Experimental.MultiScene",
- "references": [],
+ "references": [
+ "GUID:7577fcaa29c957d43a7833215b0209ed"
+ ],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
diff --git a/Carter Games/Multi Scene/Code/Runtime/CarterGames.MultiScene.Runtime.asmdef.meta b/Carter Games/Multi Scene/Code/Runtime/CarterGames.MultiScene.Runtime.asmdef.meta
new file mode 100644
index 0000000..1191320
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/CarterGames.MultiScene.Runtime.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: dbcc0ddf7638b7144b4a852688291428
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Common.meta b/Carter Games/Multi Scene/Code/Runtime/Common.meta
new file mode 100644
index 0000000..dafcb53
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Common.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: b65c3a096d2c4e2aa03713ce5803d1b5
+timeCreated: 1716404713
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Common/CarterGames.MultiScene.Common.asmdef b/Carter Games/Multi Scene/Code/Runtime/Common/CarterGames.MultiScene.Common.asmdef
new file mode 100644
index 0000000..9ae5174
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Common/CarterGames.MultiScene.Common.asmdef
@@ -0,0 +1,14 @@
+{
+ "name": "CarterGames.MultiScene.Common",
+ "rootNamespace": "CarterGames.Common",
+ "references": [],
+ "includePlatforms": [],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": false
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Common/CarterGames.MultiScene.Common.asmdef.meta b/Carter Games/Multi Scene/Code/Runtime/Common/CarterGames.MultiScene.Common.asmdef.meta
new file mode 100644
index 0000000..6bcad53
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Common/CarterGames.MultiScene.Common.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 7577fcaa29c957d43a7833215b0209ed
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Common/Evt.cs b/Carter Games/Multi Scene/Code/Runtime/Common/Evt.cs
new file mode 100644
index 0000000..ca8ddd9
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Common/Evt.cs
@@ -0,0 +1,891 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace CarterGames.Common
+{
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | No Parameters Evt
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+
+ ///
+ /// A custom event class that helps avoid over subscription and more.
+ ///
+ public sealed class Evt
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private readonly Dictionary anonymous = new Dictionary();
+ private event Action Action = delegate { };
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Raises the event to all listeners.
+ ///
+ public void Raise()
+ {
+ Action?.Invoke();
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The listener to add.
+ public void Add(Action listener)
+ {
+ Action -= listener;
+ Action += listener;
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The id to refer to this listener.
+ /// The listener to add.
+ public void AddAnonymous(string id, Action listener)
+ {
+ if (anonymous.TryGetValue(id, out var anon))
+ {
+ Add(anon);
+ return;
+ }
+
+ anonymous.Add(id, listener);
+ Add(anonymous[id]);
+ }
+
+
+ ///
+ /// Removes the action/method from the event listeners.
+ ///
+ /// The listener to remove.
+ public void Remove(Action listener)
+ {
+ Action -= listener;
+ }
+
+
+ ///
+ /// Removes the action/method from the event listeners.
+ ///
+ /// The id of the listener to remove.
+ public void RemoveAnonymous(string id)
+ {
+ if (!anonymous.ContainsKey(id)) return;
+ Remove(anonymous[id]);
+ anonymous.Remove(id);
+ }
+
+
+ ///
+ /// Clears all listeners from the event.
+ ///
+ public void Clear()
+ {
+ anonymous.Clear();
+ Action = null;
+ }
+ }
+
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | 1 Parameter Evt
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+
+ ///
+ /// A custom event class that helps avoid over subscription and more.
+ ///
+ public sealed class Evt
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private readonly Dictionary> anonymous = new Dictionary>();
+ private event Action Action = delegate { };
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Raises the event to all listeners.
+ ///
+ /// The params to pass through when raising.
+ public void Raise(T param)
+ {
+ Action?.Invoke(param);
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The listener to add.
+ public void Add(Action listener)
+ {
+ Action -= listener;
+ Action += listener;
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The id to refer to this listener.
+ /// The listener to add.
+ public void AddAnonymous(string id, Action listener)
+ {
+ if (anonymous.TryGetValue(id, out var anon))
+ {
+ Add(anon);
+ return;
+ }
+
+ anonymous.Add(id, listener);
+ Add(anonymous[id]);
+ }
+
+
+ ///
+ /// Removes the action/method to the event listeners.
+ ///
+ /// The listener to remove.
+ public void Remove(Action listener)
+ {
+ Action -= listener;
+ }
+
+
+ ///
+ /// Removes the action/method from the event listeners.
+ ///
+ /// The id of the listener to remove.
+ public void RemoveAnonymous(string id)
+ {
+ if (!anonymous.ContainsKey(id)) return;
+ Remove(anonymous[id]);
+ anonymous.Remove(id);
+ }
+
+
+ ///
+ /// Clears all listeners from the event.
+ ///
+ public void Clear()
+ {
+ anonymous.Clear();
+ Action = null;
+ }
+ }
+
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | 2 Parameter Evt
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+
+ ///
+ /// A custom event class that helps avoid over subscription and more.
+ ///
+ public sealed class Evt
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private readonly Dictionary> anonymous = new Dictionary>();
+ private event Action Action = delegate { };
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Raises the event to all listeners.
+ ///
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ public void Raise(T1 param1, T2 param2)
+ {
+ Action?.Invoke(param1, param2);
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The listener to add.
+ public void Add(Action listener)
+ {
+ Action -= listener;
+ Action += listener;
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The id to refer to this listener.
+ /// The listener to add.
+ public void AddAnonymous(string id, Action listener)
+ {
+ if (anonymous.TryGetValue(id, out var anon))
+ {
+ Add(anon);
+ return;
+ }
+
+ anonymous.Add(id, listener);
+ Add(anonymous[id]);
+ }
+
+
+ ///
+ /// Removes the action/method to the event listeners.
+ ///
+ /// The listener to remove.
+ public void Remove(Action listener)
+ {
+ Action -= listener;
+ }
+
+
+ ///
+ /// Removes the action/method from the event listeners.
+ ///
+ /// The id of the listener to remove.
+ public void RemoveAnonymous(string id)
+ {
+ if (!anonymous.ContainsKey(id)) return;
+ Remove(anonymous[id]);
+ anonymous.Remove(id);
+ }
+
+
+ ///
+ /// Clears all listeners from the event.
+ ///
+ public void Clear()
+ {
+ anonymous.Clear();
+ Action = null;
+ }
+ }
+
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | 3 Parameter Evt
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+
+ ///
+ /// A custom event class that helps avoid over subscription and more.
+ ///
+ public sealed class Evt
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private readonly Dictionary> anonymous = new Dictionary>();
+ private event Action Action = delegate { };
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Raises the event to all listeners.
+ ///
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ public void Raise(T1 param1, T2 param2, T3 param3)
+ {
+ Action?.Invoke(param1, param2, param3);
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The listener to add.
+ public void Add(Action listener)
+ {
+ Action -= listener;
+ Action += listener;
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The id to refer to this listener.
+ /// The listener to add.
+ public void AddAnonymous(string id, Action listener)
+ {
+ if (anonymous.TryGetValue(id, out var anon))
+ {
+ Add(anon);
+ return;
+ }
+
+ anonymous.Add(id, listener);
+ Add(anonymous[id]);
+ }
+
+
+ ///
+ /// Removes the action/method to the event listeners.
+ ///
+ /// The listener to remove.
+ public void Remove(Action listener)
+ {
+ Action -= listener;
+ }
+
+
+ ///
+ /// Removes the action/method from the event listeners.
+ ///
+ /// The id of the listener to remove.
+ public void RemoveAnonymous(string id)
+ {
+ if (!anonymous.ContainsKey(id)) return;
+ Remove(anonymous[id]);
+ anonymous.Remove(id);
+ }
+
+
+ ///
+ /// Clears all listeners from the event.
+ ///
+ public void Clear()
+ {
+ anonymous.Clear();
+ Action = null;
+ }
+ }
+
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | 4 Parameter Evt
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+
+ ///
+ /// A custom event class that helps avoid over subscription and more.
+ ///
+ public sealed class Evt
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private readonly Dictionary> anonymous = new Dictionary>();
+ private event Action Action = delegate { };
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Raises the event to all listeners.
+ ///
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ public void Raise(T1 param1, T2 param2, T3 param3, T4 param4)
+ {
+ Action?.Invoke(param1, param2, param3, param4);
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The listener to add.
+ public void Add(Action listener)
+ {
+ Action -= listener;
+ Action += listener;
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The id to refer to this listener.
+ /// The listener to add.
+ public void AddAnonymous(string id, Action listener)
+ {
+ if (anonymous.TryGetValue(id, out var anon))
+ {
+ Add(anon);
+ return;
+ }
+
+ anonymous.Add(id, listener);
+ Add(anonymous[id]);
+ }
+
+
+ ///
+ /// Removes the action/method to the event listeners.
+ ///
+ /// The listener to remove.
+ public void Remove(Action listener)
+ {
+ Action -= listener;
+ }
+
+
+ ///
+ /// Removes the action/method from the event listeners.
+ ///
+ /// The id of the listener to remove.
+ public void RemoveAnonymous(string id)
+ {
+ if (!anonymous.ContainsKey(id)) return;
+ Remove(anonymous[id]);
+ anonymous.Remove(id);
+ }
+
+
+ ///
+ /// Clears all listeners from the event.
+ ///
+ public void Clear()
+ {
+ anonymous.Clear();
+ Action = null;
+ }
+ }
+
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | 5 Parameter Evt
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+
+ ///
+ /// A custom event class that helps avoid over subscription and more.
+ ///
+ public sealed class Evt
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private readonly Dictionary> anonymous = new Dictionary>();
+ private event Action Action = delegate { };
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Raises the event to all listeners.
+ ///
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ public void Raise(T1 param1, T2 param2, T3 param3, T4 param4, T5 param5)
+ {
+ Action?.Invoke(param1, param2, param3, param4, param5);
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The listener to add.
+ public void Add(Action listener)
+ {
+ Action -= listener;
+ Action += listener;
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The id to refer to this listener.
+ /// The listener to add.
+ public void AddAnonymous(string id, Action listener)
+ {
+ if (anonymous.TryGetValue(id, out var anon))
+ {
+ Add(anon);
+ return;
+ }
+
+ anonymous.Add(id, listener);
+ Add(anonymous[id]);
+ }
+
+
+ ///
+ /// Removes the action/method to the event listeners.
+ ///
+ /// The listener to remove.
+ public void Remove(Action listener)
+ {
+ Action -= listener;
+ }
+
+
+ ///
+ /// Removes the action/method from the event listeners.
+ ///
+ /// The id of the listener to remove.
+ public void RemoveAnonymous(string id)
+ {
+ if (!anonymous.ContainsKey(id)) return;
+ Remove(anonymous[id]);
+ anonymous.Remove(id);
+ }
+
+
+ ///
+ /// Clears all listeners from the event.
+ ///
+ public void Clear()
+ {
+ anonymous.Clear();
+ Action = null;
+ }
+ }
+
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | 6 Parameter Evt
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+
+ ///
+ /// A custom event class that helps avoid over subscription and more.
+ ///
+ public sealed class Evt
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private readonly Dictionary> anonymous = new Dictionary>();
+ private event Action Action = delegate { };
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Raises the event to all listeners.
+ ///
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ public void Raise(T1 param1, T2 param2, T3 param3, T4 param4, T5 param5, T6 param6)
+ {
+ Action?.Invoke(param1, param2, param3, param4, param5, param6);
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The listener to add.
+ public void Add(Action listener)
+ {
+ Action -= listener;
+ Action += listener;
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The id to refer to this listener.
+ /// The listener to add.
+ public void AddAnonymous(string id, Action listener)
+ {
+ if (anonymous.TryGetValue(id, out var anon))
+ {
+ Add(anon);
+ return;
+ }
+
+ anonymous.Add(id, listener);
+ Add(anonymous[id]);
+ }
+
+
+ ///
+ /// Removes the action/method to the event listeners.
+ ///
+ /// The listener to remove.
+ public void Remove(Action listener)
+ {
+ Action -= listener;
+ }
+
+
+ ///
+ /// Removes the action/method from the event listeners.
+ ///
+ /// The id of the listener to remove.
+ public void RemoveAnonymous(string id)
+ {
+ if (!anonymous.ContainsKey(id)) return;
+ Remove(anonymous[id]);
+ anonymous.Remove(id);
+ }
+
+
+ ///
+ /// Clears all listeners from the event.
+ ///
+ public void Clear()
+ {
+ anonymous.Clear();
+ Action = null;
+ }
+ }
+
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | 7 Parameter Evt
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+
+ ///
+ /// A custom event class that helps avoid over subscription and more.
+ ///
+ public sealed class Evt
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private readonly Dictionary> anonymous = new Dictionary>();
+ private event Action Action = delegate { };
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Raises the event to all listeners.
+ ///
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ public void Raise(T1 param1, T2 param2, T3 param3, T4 param4, T5 param5, T6 param6, T7 param7)
+ {
+ Action?.Invoke(param1, param2, param3, param4, param5, param6, param7);
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The listener to add.
+ public void Add(Action listener)
+ {
+ Action -= listener;
+ Action += listener;
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The id to refer to this listener.
+ /// The listener to add.
+ public void AddAnonymous(string id, Action listener)
+ {
+ if (anonymous.TryGetValue(id, out var anon))
+ {
+ Add(anon);
+ return;
+ }
+
+ anonymous.Add(id, listener);
+ Add(anonymous[id]);
+ }
+
+
+ ///
+ /// Removes the action/method to the event listeners.
+ ///
+ /// The listener to remove.
+ public void Remove(Action listener)
+ {
+ Action -= listener;
+ }
+
+
+ ///
+ /// Removes the action/method from the event listeners.
+ ///
+ /// The id of the listener to remove.
+ public void RemoveAnonymous(string id)
+ {
+ if (!anonymous.ContainsKey(id)) return;
+ Remove(anonymous[id]);
+ anonymous.Remove(id);
+ }
+
+
+ ///
+ /// Clears all listeners from the event.
+ ///
+ public void Clear()
+ {
+ anonymous.Clear();
+ Action = null;
+ }
+ }
+
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | 8 Parameter Evt
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+
+ ///
+ /// A custom event class that helps avoid over subscription and more.
+ ///
+ public sealed class Evt
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private readonly Dictionary> anonymous = new Dictionary>();
+ private event Action Action = delegate { };
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Raises the event to all listeners.
+ ///
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ /// A param to pass through when raising.
+ public void Raise(T1 param1, T2 param2, T3 param3, T4 param4, T5 param5, T6 param6, T7 param7, T8 param8)
+ {
+ Action?.Invoke(param1, param2, param3, param4, param5, param6, param7, param8);
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The listener to add.
+ public void Add(Action listener)
+ {
+ Action -= listener;
+ Action += listener;
+ }
+
+
+ ///
+ /// Adds the action/method to the event listeners.
+ ///
+ /// The id to refer to this listener.
+ /// The listener to add.
+ public void AddAnonymous(string id, Action listener)
+ {
+ if (anonymous.TryGetValue(id, out var anon))
+ {
+ Add(anon);
+ return;
+ }
+
+ anonymous.Add(id, listener);
+ Add(anonymous[id]);
+ }
+
+
+ ///
+ /// Removes the action/method to the event listeners.
+ ///
+ /// The listener to remove.
+ public void Remove(Action listener)
+ {
+ Action -= listener;
+ }
+
+
+ ///
+ /// Removes the action/method from the event listeners.
+ ///
+ /// The id of the listener to remove.
+ public void RemoveAnonymous(string id)
+ {
+ if (!anonymous.ContainsKey(id)) return;
+ Remove(anonymous[id]);
+ anonymous.Remove(id);
+ }
+
+
+ ///
+ /// Clears all listeners from the event.
+ ///
+ public void Clear()
+ {
+ anonymous.Clear();
+ Action = null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Common/Evt.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Common/Evt.cs.meta
new file mode 100644
index 0000000..ba5e75f
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Common/Evt.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fbd0e88aa29e4de7b697391353537aed
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Common/Ref.cs b/Carter Games/Multi Scene/Code/Runtime/Common/Ref.cs
new file mode 100644
index 0000000..9aff3af
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Common/Ref.cs
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.SceneManagement;
+
+namespace CarterGames.Common
+{
+ ///
+ /// A helper class for getting references to other scripts.
+ ///
+ public static class Ref
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Methods
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// Gets the first of any and all of the type requested from the active scene.
+ ///
+ /// The type to get
+ /// First instance of the type found in the active scene
+ public static T GetComponentFromScene()
+ {
+ var allOfType = GetComponentsFromScene();
+
+ return allOfType.Count > 0
+ ? allOfType[0]
+ : default;
+ }
+
+
+ ///
+ /// Gets the first of any and all of the type requested from all scenes...
+ ///
+ /// The type to get
+ /// First instance of the type found in all scenes
+ public static T GetComponentFromAllScenes()
+ {
+ var allOfType = GetComponentsFromAllScenes();
+
+ return allOfType.Count > 0
+ ? allOfType[0]
+ : default;
+ }
+
+
+ ///
+ /// Gets any and all of the type requested from the active scene...
+ ///
+ /// The type to get
+ /// List of any instances of the type found in the scene
+ public static List GetComponentsFromScene()
+ {
+ var objs = new List();
+ var scene = SceneManager.GetActiveScene();
+ var validObjectsFromScene = new List();
+
+ scene.GetRootGameObjects(objs);
+
+ foreach (var go in objs)
+ {
+ validObjectsFromScene.AddRange(go.GetComponentsInChildren(true));
+ }
+
+ return validObjectsFromScene;
+ }
+
+
+ ///
+ /// Gets any and all of the type requested from all scenes...
+ ///
+ /// The type to get
+ /// List of any instances of the type found in all scenes
+ public static List GetComponentsFromAllScenes()
+ {
+ var objs = new List();
+ var scenes = new List();
+ var validObjectsFromScene = new List();
+
+ for (var i = 0; i < SceneManager.sceneCount; i++)
+ {
+ scenes.Add(SceneManager.GetSceneAt(i));
+ }
+
+ foreach (var scene in scenes)
+ {
+ objs.AddRange(scene.GetRootGameObjects());
+ }
+
+ foreach (var go in objs)
+ {
+ validObjectsFromScene.AddRange(go.GetComponentsInChildren(true));
+ }
+
+ return validObjectsFromScene;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Common/Ref.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Common/Ref.cs.meta
new file mode 100644
index 0000000..babb105
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Common/Ref.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: acd0caa45d2c48baa83ed19059cfda5a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Common/Serialization.meta b/Carter Games/Multi Scene/Code/Runtime/Common/Serialization.meta
new file mode 100644
index 0000000..1c89326
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Common/Serialization.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: e7bda86e0a13483b8fa0560fbd00a869
+timeCreated: 1716404749
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary.meta b/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary.meta
new file mode 100644
index 0000000..3951a9d
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 8681b65c86ab4c769f7ce6590a56b354
+timeCreated: 1716404754
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary/SerializableDIctionary.cs b/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary/SerializableDIctionary.cs
new file mode 100644
index 0000000..183100b
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary/SerializableDIctionary.cs
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace CarterGames.Common
+{
+ ///
+ /// A custom dictionary class to store a serializable version of a dictionaries data.
+ ///
+ /// The key type.
+ /// The value type.
+ [Serializable]
+ public class SerializableDictionary : Dictionary, ISerializationCallbackReceiver
+ {
+ /* —————————————————————————————————————————————————————————————————————————————————————————————————————————————
+ | Fields
+ ————————————————————————————————————————————————————————————————————————————————————————————————————————————— */
+
+ [SerializeField] private List> list = new List>();
+
+ /* —————————————————————————————————————————————————————————————————————————————————————————————————————————————
+ | ISerializationCallbackReceiver Implementation
+ ————————————————————————————————————————————————————————————————————————————————————————————————————————————— */
+
+ ///
+ /// Runs before the class is serialized.
+ ///
+ public void OnBeforeSerialize()
+ {
+ if (list.Count > Count)
+ {
+ AddNewValue();
+ }
+ else
+ {
+ UpdateSerializedValues();
+ }
+ }
+
+
+ ///
+ /// Runs after the class is deserialized.
+ ///
+ public void OnAfterDeserialize()
+ {
+ Clear();
+
+ for (var i = 0; list != null && i < list.Count; i++)
+ {
+ var current = list[i];
+
+#if UNITY_2021_1_OR_NEWER
+ if (current.key != null)
+ {
+ TryAdd(current.key, current.value);
+ }
+#elif UNITY_2020
+ if (current.key != null)
+ {
+ if (ContainsKey(current.key)) continue;
+ Add(current.key, current.value);
+ }
+#endif
+ }
+ }
+
+ /* —————————————————————————————————————————————————————————————————————————————————————————————————————————————
+ | Methods
+ ————————————————————————————————————————————————————————————————————————————————————————————————————————————— */
+
+ ///
+ /// Updates the list when called.
+ ///
+ private void UpdateSerializedValues()
+ {
+ list.Clear();
+
+ foreach(var pair in this)
+ {
+ list.Add(pair);
+ }
+ }
+
+
+ ///
+ /// Adds a new value when called
+ ///
+ private void AddNewValue()
+ {
+#if UNITY_2021_1_OR_NEWER
+ var current = list[^1];
+
+ if (current.key != null)
+ {
+ TryAdd(current.Key, current.value);
+ }
+#elif UNITY_2020
+ var current = list[list.Count - 1];
+
+ if (current.key != null)
+ {
+ if (ContainsKey(current.key)) return;
+ Add(current.key, current.value);
+ }
+#endif
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary/SerializableDIctionary.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary/SerializableDIctionary.cs.meta
new file mode 100644
index 0000000..7974d3e
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary/SerializableDIctionary.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 81e9f4a7dfe040e89c9f9665cb4fdcb0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary/SerialzableKeyValuePair.cs b/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary/SerialzableKeyValuePair.cs
new file mode 100644
index 0000000..1807550
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary/SerialzableKeyValuePair.cs
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace CarterGames.Common
+{
+ ///
+ /// Defines a data structure for a key pair value that is serializable.
+ ///
+ /// The key type.
+ /// The value type.
+ [Serializable]
+ public class SerializableKeyValuePair : IEquatable>
+ {
+ /* —————————————————————————————————————————————————————————————————————————————————————————————————————————————
+ | Fields
+ ————————————————————————————————————————————————————————————————————————————————————————————————————————————— */
+
+ [SerializeField] public TKey key;
+ [SerializeField] public TValue value;
+
+ /* —————————————————————————————————————————————————————————————————————————————————————————————————————————————
+ | Properties
+ ————————————————————————————————————————————————————————————————————————————————————————————————————————————— */
+
+ ///
+ /// The key for the entry.
+ ///
+ public TKey Key => key;
+
+
+ ///
+ /// The value for the entry.
+ ///
+ public TValue Value
+ {
+ get => value;
+ set => this.value = value;
+ }
+
+ /* —————————————————————————————————————————————————————————————————————————————————————————————————————————————
+ | Constructors
+ ————————————————————————————————————————————————————————————————————————————————————————————————————————————— */
+
+ ///
+ /// Makes a new blank key value pair.
+ ///
+ public SerializableKeyValuePair()
+ { }
+
+
+ ///
+ /// Makes a new blank key value pair with the data entered.
+ ///
+ /// The key to set.
+ /// The value to set.
+ public SerializableKeyValuePair(TKey key, TValue value)
+ {
+ this.key = key;
+ this.value = value;
+ }
+
+ /* —————————————————————————————————————————————————————————————————————————————————————————————————————————————
+ | Operators
+ ————————————————————————————————————————————————————————————————————————————————————————————————————————————— */
+
+ ///
+ /// Implicitly converts a normal version to the this type.
+ ///
+ /// The pair to convert.
+ /// A new instance of this type with the pair data entered.
+ public static implicit operator SerializableKeyValuePair(KeyValuePair pair)
+ {
+ return new SerializableKeyValuePair(pair.Key, pair.Value);
+ }
+
+
+ ///
+ /// Implicitly converts a this type to the normal version.
+ ///
+ /// The pair to convert.
+ /// A new instance of the standard type with the pair data entered.
+ public static implicit operator KeyValuePair(SerializableKeyValuePair pair)
+ {
+ return new KeyValuePair(pair.key, pair.value);
+ }
+
+ /* —————————————————————————————————————————————————————————————————————————————————————————————————————————————
+ | IEquatable
+ ————————————————————————————————————————————————————————————————————————————————————————————————————————————— */
+
+ ///
+ /// defines the equals check for the class.
+ ///
+ /// the other class to compare to.
+ /// The result of the comparision.
+ public bool Equals(SerializableKeyValuePair other)
+ {
+ var comparer1 = EqualityComparer.Default;
+ var comparer2 = EqualityComparer.Default;
+
+ return comparer1.Equals(key, other.key) && comparer2.Equals(value, other.value);
+ }
+
+
+ ///
+ /// Overrides the hash code setup for this class.
+ ///
+ /// The hash code for the class.
+ public override int GetHashCode()
+ {
+ var comparer1 = EqualityComparer.Default;
+ var comparer2 = EqualityComparer.Default;
+
+ int h0;
+ h0 = comparer1.GetHashCode(key);
+ h0 = (h0 << 5) + h0 ^ comparer2.GetHashCode(value);
+ return h0;
+ }
+
+
+ ///
+ /// Overrides the ToString conversion for the class.
+ ///
+ /// The string format for the class.
+ public override string ToString()
+ {
+ return $"(Key: {key}, Value: {value})";
+ }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary/SerialzableKeyValuePair.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary/SerialzableKeyValuePair.cs.meta
new file mode 100644
index 0000000..9db21b0
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Common/Serialization/Dictionary/SerialzableKeyValuePair.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2b38cd80fd4348668bc3054001149409
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Logger.meta b/Carter Games/Multi Scene/Code/Runtime/Logger.meta
new file mode 100644
index 0000000..9b79fc0
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Logger.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 07f9d4381e2c437b8a64b2e6e6fe9277
+timeCreated: 1661953956
\ No newline at end of file
diff --git a/Runtime/Logger/MsLog.cs b/Carter Games/Multi Scene/Code/Runtime/Logger/MultiSceneLogger.cs
similarity index 70%
rename from Runtime/Logger/MsLog.cs
rename to Carter Games/Multi Scene/Code/Runtime/Logger/MultiSceneLogger.cs
index 83a8d82..0da23d8 100644
--- a/Runtime/Logger/MsLog.cs
+++ b/Carter Games/Multi Scene/Code/Runtime/Logger/MultiSceneLogger.cs
@@ -1,9 +1,25 @@
-// ----------------------------------------------------------------------------
-// MSLog.cs
-//
-// Author: Jonathan Carter (A.K.A. J)
-// Date: 31/08/2022
-// ----------------------------------------------------------------------------
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
using UnityEngine;
@@ -12,7 +28,7 @@ namespace CarterGames.Experimental.MultiScene
///
/// A logging class for messages within the asset.
///
- public sealed class MsLog
+ public sealed class MultiSceneLogger
{
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Constants
diff --git a/Carter Games/Multi Scene/Code/Runtime/Logger/MultiSceneLogger.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Logger/MultiSceneLogger.cs.meta
new file mode 100644
index 0000000..aa33908
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Logger/MultiSceneLogger.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 96882ac5662843cdab50c967b3e03742
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/MultiSceneManager.cs b/Carter Games/Multi Scene/Code/Runtime/MultiSceneManager.cs
similarity index 76%
rename from Runtime/MultiSceneManager.cs
rename to Carter Games/Multi Scene/Code/Runtime/MultiSceneManager.cs
index 5f73aed..1e40a84 100644
--- a/Runtime/MultiSceneManager.cs
+++ b/Carter Games/Multi Scene/Code/Runtime/MultiSceneManager.cs
@@ -1,4 +1,28 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
using System.Collections.Generic;
+using CarterGames.Common;
using CarterGames.Experimental.MultiScene.Editor;
using UnityEngine;
using UnityEngine.SceneManagement;
@@ -16,10 +40,9 @@ public static class MultiSceneManager
private const string PlaceholderSceneName = "Multi Scene Placeholder Scene";
private const string MonoObjectName = "Multi Scene (Mono Reference)";
- private static List _activeSceneNames;
- private static bool _hasCachedScenesList;
- private static MultiSceneSettingsAsset _settings;
- private static MultiSceneMono _mono;
+ private static List activeSceneNames;
+ private static bool hasCachedScenesList;
+ private static MultiSceneMono monoInstance;
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Properties
@@ -34,29 +57,21 @@ public static class MultiSceneManager
///
/// Gets the settings asset for this asset for use...
///
- private static MultiSceneSettingsAsset Settings
- {
- get
- {
- if (_settings != null) return _settings;
- _settings = AssetAccessor.GetAsset();
- return _settings;
- }
- }
+ private static AssetGlobalRuntimeSettings Settings => AssetAccessor.GetAsset();
///
/// Gets the mono script for use...
///
- public static MultiSceneMono Mono
+ public static MultiSceneMono MonoInstance
{
get
{
- if (_mono != null) return _mono;
+ if (monoInstance != null) return monoInstance;
var go = new GameObject(MonoObjectName);
go.AddComponent();
- _mono = go.GetComponent();
- return _mono;
+ monoInstance = go.GetComponent();
+ return monoInstance;
}
}
@@ -67,32 +82,37 @@ public static MultiSceneMono Mono
///
/// Runs before a scene group loads
///
- public static MultiSceneEvt BeforeScenesLoaded = new MultiSceneEvt();
+ public static readonly Evt BeforeScenesLoaded = new Evt();
+
///
/// Runs after a scene group has loaded & all listeners have been called
///
- public static MultiSceneEvt PostScenesLoaded = new MultiSceneEvt();
+ public static readonly Evt PostScenesLoaded = new Evt();
+
///
/// Runs when each scene is loaded
///
- public static MultiSceneEvt OnSceneLoaded = new MultiSceneEvt();
+ public static readonly Evt OnSceneLoaded = new Evt();
+
///
/// Runs when each scene is loaded
///
- public static MultiSceneEvt OnSceneUnloaded = new MultiSceneEvt();
+ public static readonly Evt OnSceneUnloaded = new Evt();
+
///
/// Runs when a scene group has loaded
///
- public static MultiSceneEvt OnSceneGroupLoaded = new MultiSceneEvt();
+ public static readonly Evt OnSceneGroupLoaded = new Evt();
+
///
/// Runs when a scene group has loaded & returns the group as a parameter
///
- public static MultiSceneEvt OnSceneGroupLoadedWithCtx = new MultiSceneEvt();
+ public static readonly Evt OnSceneGroupLoadedWithCtx = new Evt();
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
@@ -123,10 +143,12 @@ public static MultiSceneMono Mono
/// True/False
public static bool IsSceneLoaded(string sceneName)
{
- if (!_hasCachedScenesList)
+ if (!hasCachedScenesList)
+ {
UpdateActiveSceneNames();
+ }
- return _activeSceneNames.Contains(sceneName);
+ return activeSceneNames.Contains(sceneName);
}
@@ -146,13 +168,15 @@ public static void SetGroup(SceneGroup group)
///
private static void UpdateActiveSceneNames()
{
- var _list = new List();
+ var activeSceneNamesList = new List();
for (var i = SceneManager.sceneCount - 1; i >= 0; i--)
- _list.Add(SceneManager.GetSceneAt(i).name);
+ {
+ activeSceneNamesList.Add(SceneManager.GetSceneAt(i).name);
+ }
- _activeSceneNames = _list;
- _hasCachedScenesList = true;
+ activeSceneNames = activeSceneNamesList;
+ hasCachedScenesList = true;
}
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
@@ -178,7 +202,10 @@ private static void Initialise()
/// Loads all scenes in the start group, reloading and dup scenes as it goes by default.
///
/// Should scenes in the start group that are loaded already be reloaded?
- public static void LoadScenes(bool reloadDupScenes = true) => LoadScenes(Settings.StartGroup, reloadDupScenes);
+ public static void LoadScenes(bool reloadDupScenes = true)
+ {
+ LoadScenes(Settings.StartGroup, reloadDupScenes);
+ }
///
@@ -186,7 +213,10 @@ private static void Initialise()
///
/// The group to load.
/// Should scenes in the start group that are loaded already be reloaded?
- public static void LoadScenes(SceneGroup group, bool reloadDupScenes = true) => RunSceneLoading(group, reloadDupScenes);
+ public static void LoadScenes(SceneGroup group, bool reloadDupScenes = true)
+ {
+ RunSceneLoading(group, reloadDupScenes);
+ }
///
@@ -210,7 +240,9 @@ private static void RunSceneLoading(SceneGroup group, bool? reloadDupScenes = tr
UnloadAllActiveScenes();
for (var i = 0; i < SceneManager.sceneCount; i++)
+ {
loadedScenes.Add(SceneManager.GetSceneAt(i).name);
+ }
// Loads the new scenes...
@@ -220,11 +252,15 @@ private static void RunSceneLoading(SceneGroup group, bool? reloadDupScenes = tr
// Calls for the listeners to fire when the last scene in the group is loaded...
if (i.Equals(ActiveSceneGroup.scenes.Count - 1))
+ {
SceneManager.sceneLoaded += ListenerHandler.CallListeners;
+ }
// Skips if scenes are not the be reloaded...
if (reloadDupScenes == false)
+ {
if (loadedScenes.Contains(sceneData.sceneName)) continue;
+ }
// Loads the scene via the path...
SceneManager.LoadSceneAsync(sceneData.scenePath, new LoadSceneParameters(i.Equals(0)
@@ -236,7 +272,9 @@ private static void RunSceneLoading(SceneGroup group, bool? reloadDupScenes = tr
}
if (loadedScenes.Contains(PlaceholderSceneName))
+ {
SceneManager.UnloadSceneAsync(PlaceholderSceneName);
+ }
OnSceneGroupLoaded.Raise();
OnSceneGroupLoadedWithCtx.Raise(group);
@@ -253,23 +291,23 @@ public static void UnloadAllActiveScenes()
SceneManager.CreateScene(PlaceholderSceneName);
SceneManager.SetActiveScene(SceneManager.GetSceneByName(PlaceholderSceneName));
- var _scenes = new List();
+ var sceneNamesList = new List();
for (var i = SceneManager.sceneCount - 1; i >= 0; i--)
{
var scene = SceneManager.GetSceneAt(i);
if (scene.buildIndex < 0) continue;
- _scenes.Add(scene.name);
+ sceneNamesList.Add(scene.name);
}
- foreach (var _s in _scenes)
+ foreach (var sceneName in sceneNamesList)
{
- if (_s.Equals(PlaceholderSceneName)) continue;
- SceneManager.UnloadSceneAsync(_s);
- OnSceneUnloaded.Raise(_s);
+ if (sceneName.Equals(PlaceholderSceneName)) continue;
+ SceneManager.UnloadSceneAsync(sceneName);
+ OnSceneUnloaded.Raise(sceneName);
}
- if (!AssetAccessor.GetAsset().UseUnloadResources) return;
+ if (!AssetAccessor.GetAsset().UseUnloadResources) return;
Resources.UnloadUnusedAssets();
}
@@ -279,22 +317,22 @@ public static void UnloadAllActiveScenes()
///
public static void UnloadAllAdditiveScenes()
{
- var _scenes = new List();
- var _activeScene = SceneManager.GetActiveScene().name;
+ var sceneNames = new List();
+ var activeSceneName = SceneManager.GetActiveScene().name;
for (var i = SceneManager.sceneCount - 1; i >= 0; i--)
{
- if (SceneManager.GetSceneAt(i).name.Equals(_activeScene)) continue;
- _scenes.Add(SceneManager.GetSceneAt(i).name);
+ if (SceneManager.GetSceneAt(i).name.Equals(activeSceneName)) continue;
+ sceneNames.Add(SceneManager.GetSceneAt(i).name);
}
- foreach (var scene in _scenes)
+ foreach (var scene in sceneNames)
{
SceneManager.UnloadSceneAsync(scene);
OnSceneUnloaded.Raise(scene);
}
- if (!AssetAccessor.GetAsset().UseUnloadResources) return;
+ if (!AssetAccessor.GetAsset().UseUnloadResources) return;
Resources.UnloadUnusedAssets();
}
diff --git a/Carter Games/Multi Scene/Code/Runtime/MultiSceneManager.cs.meta b/Carter Games/Multi Scene/Code/Runtime/MultiSceneManager.cs.meta
new file mode 100644
index 0000000..2fb1b5a
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/MultiSceneManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ae3b40c8a4863fa44aafba3318c00f82
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems.meta b/Carter Games/Multi Scene/Code/Runtime/Systems.meta
new file mode 100644
index 0000000..7bcd81b
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 7c105bbea9f543008ce334559c4b1727
+timeCreated: 1716408938
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets.meta
new file mode 100644
index 0000000..a304712
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: ad179a2878424bb89c3f487af0ca7815
+timeCreated: 1660939713
\ No newline at end of file
diff --git a/Runtime/Assets/AssetAccessor.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/AssetAccessor.cs
similarity index 52%
rename from Runtime/Assets/AssetAccessor.cs
rename to Carter Games/Multi Scene/Code/Runtime/Systems/Assets/AssetAccessor.cs
index 1732b62..b37516b 100644
--- a/Runtime/Assets/AssetAccessor.cs
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/AssetAccessor.cs
@@ -1,20 +1,45 @@
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace CarterGames.Experimental.MultiScene
{
///
- /// Allows access to any scriptable object in this asset.
+ /// Handles accessing the scriptable object data assets for this asset.
///
public static class AssetAccessor
{
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Fields
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ private const string IndexPath = "Asset Index";
- // a cache of all the assets found...
- private static MultiSceneAsset[] assets;
+ // A cache of all the assets found...
+ private static AssetIndex indexCache;
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Properties
@@ -23,28 +48,49 @@ public static class AssetAccessor
///
/// Gets all the assets from the build versions asset...
///
- private static IEnumerable Assets
+ private static AssetIndex Index
{
get
{
- if (assets != null) return assets;
- assets = Resources.LoadAll("Carter Games/Multi Scene", typeof(MultiSceneAsset)).Cast().ToArray();
- return assets;
+ if (indexCache != null) return indexCache;
+ indexCache = (AssetIndex) Resources.Load(IndexPath, typeof(AssetIndex));
+ return indexCache;
}
}
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Methods
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
-
+
///
- /// Gets the Build Versions Asset requested...
+ /// Gets the Save Manager Asset requested.
///
- /// The build versions asset to get.
+ /// The save manager asset to get.
/// The asset if it exists.
public static T GetAsset() where T : MultiSceneAsset
{
- return (T)Assets.FirstOrDefault(t => t.GetType() == typeof(T));
+ if (Index.Lookup.ContainsKey(typeof(T).ToString()))
+ {
+ return (T)Index.Lookup[typeof(T).ToString()][0];
+ }
+
+ return null;
+ }
+
+
+ ///
+ /// Gets the Save Manager Asset requested.
+ ///
+ /// The save manager asset to get.
+ /// The asset if it exists.
+ public static List GetAssets() where T : MultiSceneAsset
+ {
+ if (Index.Lookup.ContainsKey(typeof(T).ToString()))
+ {
+ return Index.Lookup[typeof(T).ToString()].Cast().ToList();
+ }
+
+ return null;
}
}
}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/AssetAccessor.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/AssetAccessor.cs.meta
new file mode 100644
index 0000000..d21ec91
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/AssetAccessor.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4c4f6d7f64a348d49ae48072bb0b0ebb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups.meta
new file mode 100644
index 0000000..af1eeae
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: d4b4618b0706499ea7e56f4011a26eec
+timeCreated: 1716405082
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups/DefaultGroupCategory.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups/DefaultGroupCategory.cs
new file mode 100644
index 0000000..44d3291
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups/DefaultGroupCategory.cs
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+
+namespace CarterGames.Experimental.MultiScene
+{
+ ///
+ /// The data class for the default scene groups.
+ ///
+ [Serializable]
+ public sealed class DefaultGroupCategory : GroupCategory
+ {
+ public DefaultGroupCategory(string groupName) : base(groupName) { }
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups/DefaultGroupCategory.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups/DefaultGroupCategory.cs.meta
new file mode 100644
index 0000000..f5ad29c
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups/DefaultGroupCategory.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 62ac58a7f9a3428aa34999cad9a24e22
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/Assets/GroupCategory.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups/GroupCategory.cs
similarity index 67%
rename from Runtime/Assets/GroupCategory.cs
rename to Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups/GroupCategory.cs
index 829dba5..6127184 100644
--- a/Runtime/Assets/GroupCategory.cs
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups/GroupCategory.cs
@@ -1,9 +1,25 @@
-// ----------------------------------------------------------------------------
-// GroupCategory.cs
-//
-// Author: Jonathan Carter (A.K.A. J)
-// Date: 25/08/2022
-// ----------------------------------------------------------------------------
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
using System;
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups/GroupCategory.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups/GroupCategory.cs.meta
new file mode 100644
index 0000000..368563a
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Groups/GroupCategory.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6965b47b628a4e768b202dd068776840
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Index.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Index.meta
new file mode 100644
index 0000000..5f7a438
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Index.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: c2cc586ab83746ffaecaa7ed813c9f94
+timeCreated: 1716404675
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Index/AssetIndex.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Index/AssetIndex.cs
new file mode 100644
index 0000000..1ece635
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Index/AssetIndex.cs
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
+using CarterGames.Common;
+using UnityEngine;
+
+namespace CarterGames.Experimental.MultiScene
+{
+ ///
+ /// Handles a data store of all the scriptable objects for the asset that are used at runtime.
+ ///
+ [CreateAssetMenu(fileName = "Asset Index", menuName = "Carter Games/Multi Scene/Asset Index Asset", order = 1)]
+ public sealed class AssetIndex : MultiSceneAsset
+ {
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Fields
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ [SerializeField] private SerializableDictionary> assets;
+
+ /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ | Properties
+ ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
+
+ ///
+ /// A lookup of all the assets in the project that can be used at runtime.
+ ///
+ public SerializableDictionary> Lookup => assets;
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Index/AssetIndex.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Index/AssetIndex.cs.meta
new file mode 100644
index 0000000..5b3b47d
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Index/AssetIndex.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 99358c782b2543f68771d5a76a62ebbf
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: 65a64cdde33454b4dae05f56cefd732a, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/MultiSceneAsset.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/MultiSceneAsset.cs
new file mode 100644
index 0000000..d7a4722
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/MultiSceneAsset.cs
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using UnityEngine;
+
+namespace CarterGames.Experimental.MultiScene
+{
+ ///
+ /// Used to define a scriptable object in the asset.
+ ///
+ public class MultiSceneAsset : ScriptableObject { }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/MultiSceneAsset.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/MultiSceneAsset.cs.meta
new file mode 100644
index 0000000..24972ac
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/MultiSceneAsset.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a9ec121f295f48de88f2813341b7f31d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/MultiSceneMono.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/MultiSceneMono.cs
new file mode 100644
index 0000000..defad5b
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/MultiSceneMono.cs
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using UnityEngine;
+
+namespace CarterGames.Experimental.MultiScene
+{
+ ///
+ /// Used to access a MonoBehaviour for classes that don't derive from it.
+ ///
+ public sealed class MultiSceneMono : MonoBehaviour { }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/MultiSceneMono.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/MultiSceneMono.cs.meta
new file mode 100644
index 0000000..d0c2fb4
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/MultiSceneMono.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b1d8170e6e7a4d6785b133f9ab71d3a6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Settings.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Settings.meta
new file mode 100644
index 0000000..70a2330
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Settings.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: a2ca9a6a277f437bb33fe034abe8d5d4
+timeCreated: 1716405010
\ No newline at end of file
diff --git a/Runtime/Assets/MultiSceneSettingsAsset.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Settings/AssetGlobalRuntimeSettings.cs
similarity index 95%
rename from Runtime/Assets/MultiSceneSettingsAsset.cs
rename to Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Settings/AssetGlobalRuntimeSettings.cs
index 8edc3db..edd7e8d 100644
--- a/Runtime/Assets/MultiSceneSettingsAsset.cs
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Settings/AssetGlobalRuntimeSettings.cs
@@ -2,12 +2,9 @@
using System.Linq;
using UnityEngine;
-namespace CarterGames.Experimental.MultiScene.Editor
+namespace CarterGames.Experimental.MultiScene
{
- ///
- /// Handles the settings for the asset.
- ///
- public sealed class MultiSceneSettingsAsset : MultiSceneAsset
+ public class AssetGlobalRuntimeSettings : MultiSceneAsset
{
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Fields
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Settings/AssetGlobalRuntimeSettings.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Settings/AssetGlobalRuntimeSettings.cs.meta
new file mode 100644
index 0000000..b593e74
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Assets/Settings/AssetGlobalRuntimeSettings.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 91ae6d02d8154bf38967a27e1945348a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: aa08e3ea1b2fe054487e19b0e6cd65ae, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes.meta
new file mode 100644
index 0000000..3c8ef62
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 885e32696358f8e43a431a5c5fe0a749
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute.meta
new file mode 100644
index 0000000..c01d9a9
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: ec5bd0db5b5743dea76091354fd9d13f
+timeCreated: 1716448631
\ No newline at end of file
diff --git a/Runtime/Attributes/MultiSceneOrderedAttribute.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/MultiSceneOrderedAttribute.cs
similarity index 68%
rename from Runtime/Attributes/MultiSceneOrderedAttribute.cs
rename to Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/MultiSceneOrderedAttribute.cs
index a37a1f3..c824088 100644
--- a/Runtime/Attributes/MultiSceneOrderedAttribute.cs
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/MultiSceneOrderedAttribute.cs
@@ -1,4 +1,27 @@
-using System;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
namespace CarterGames.Experimental.MultiScene
{
@@ -30,6 +53,7 @@ public MultiSceneOrderedAttribute()
order = 0;
}
+
///
/// A attribute with a defined order.
///
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/MultiSceneOrderedAttribute.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/MultiSceneOrderedAttribute.cs.meta
new file mode 100644
index 0000000..27faef9
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/MultiSceneOrderedAttribute.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 084aee3f0f78438886f06680e83ad405
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/Attributes/OrderedHandler.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/OrderedHandler.cs
similarity index 62%
rename from Runtime/Attributes/OrderedHandler.cs
rename to Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/OrderedHandler.cs
index be41dd9..1588c3c 100644
--- a/Runtime/Attributes/OrderedHandler.cs
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/OrderedHandler.cs
@@ -1,4 +1,27 @@
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
using System.Linq;
using System.Reflection;
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/OrderedHandler.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/OrderedHandler.cs.meta
new file mode 100644
index 0000000..3792b06
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/OrderedHandler.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7de4874c04ff4397aa3fe27bb145ef19
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/Attributes/OrderedListenerData.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/OrderedListenerData.cs
similarity index 74%
rename from Runtime/Attributes/OrderedListenerData.cs
rename to Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/OrderedListenerData.cs
index c74fe8b..bdd7e05 100644
--- a/Runtime/Attributes/OrderedListenerData.cs
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/OrderedListenerData.cs
@@ -1,6 +1,25 @@
-// Multi Scene - Core
-// A data class to help handle the ordering of the listeners based on the ordering attribute.
-// Author: Jonathan Carter - https://carter.games
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
using System;
using UnityEngine;
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/OrderedListenerData.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/OrderedListenerData.cs.meta
new file mode 100644
index 0000000..580cb1e
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Attributes/Ordered Attribute/OrderedListenerData.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3d26799314f84541b0d8705d8cea56b3
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Built-In Extensions.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Built-In Extensions.meta
new file mode 100644
index 0000000..6173a67
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Built-In Extensions.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 99db7a127b6b33047a63f20e1ea9c3c2
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Built-In Extensions/Do Not Destroy.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Built-In Extensions/Do Not Destroy.meta
new file mode 100644
index 0000000..09cbd57
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Built-In Extensions/Do Not Destroy.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 059dbf4d89dfa9549b30d6c6b2699501
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/Built-In Extensions/Do Not Destroy/DoNotDestroyAccessor.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Built-In Extensions/Do Not Destroy/DoNotDestroyAccessor.cs
similarity index 62%
rename from Runtime/Built-In Extensions/Do Not Destroy/DoNotDestroyAccessor.cs
rename to Carter Games/Multi Scene/Code/Runtime/Systems/Built-In Extensions/Do Not Destroy/DoNotDestroyAccessor.cs
index fbe9780..380e702 100644
--- a/Runtime/Built-In Extensions/Do Not Destroy/DoNotDestroyAccessor.cs
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Built-In Extensions/Do Not Destroy/DoNotDestroyAccessor.cs
@@ -1,4 +1,27 @@
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
using System.Linq;
using CarterGames.Experimental.MultiScene.Editor;
using UnityEngine;
@@ -15,7 +38,7 @@ public sealed class DoNotDestroyAccessor : MonoBehaviour
| Fields
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
- private static DoNotDestroyAccessor _instance;
+ private static DoNotDestroyAccessor instance;
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Methods
@@ -24,9 +47,9 @@ public sealed class DoNotDestroyAccessor : MonoBehaviour
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
private static void Initialise()
{
- if (_instance != null) return;
+ if (instance != null) return;
- var obj = new GameObject("Multi Scene (Do Not Destroy Accessor)");
+ var obj = new GameObject("[Multi Scene]: Do Not Destroy Accessor");
DontDestroyOnLoad(obj);
obj.AddComponent();
}
@@ -34,8 +57,8 @@ private static void Initialise()
private void Awake()
{
- if (_instance != null) Destroy(this.gameObject);
- _instance = this;
+ if (instance != null) Destroy(this.gameObject);
+ instance = this;
}
@@ -45,7 +68,7 @@ private void Awake()
/// A list of all the valid root gameObjects the spy can find.
public static List GetRootGameObjectsInDoNotDestroy()
{
- return _instance.gameObject.scene.GetRootGameObjects().ToList();
+ return instance.gameObject.scene.GetRootGameObjects().ToList();
}
@@ -56,7 +79,7 @@ public static List GetRootGameObjectsInDoNotDestroy()
/// Was the move successful?
public static void MoveObjectToSceneInDoNotDestroy(GameObject obj)
{
- SceneManager.MoveGameObjectToScene(obj, _instance.gameObject.scene);
+ SceneManager.MoveGameObjectToScene(obj, instance.gameObject.scene);
}
@@ -68,7 +91,9 @@ public static void MoveObjectToSceneInDoNotDestroy(GameObject obj)
public static void MoveObjectsToSceneInDoNotDestroy(List obj)
{
foreach (var i in obj)
- SceneManager.MoveGameObjectToScene(i, _instance.gameObject.scene);
+ {
+ SceneManager.MoveGameObjectToScene(i, instance.gameObject.scene);
+ }
}
@@ -83,8 +108,10 @@ public static GameObject FindObjectInDoNotDestroy(string name)
if (obj.Count > 0) return FindObjectsInDoNotDestroy(name)[0];
- if (AssetAccessor.GetAsset().UseLogs)
- MsLog.Normal($"Unable to find object of name: {name} in the Do Not Destroy scene.");
+ if (AssetAccessor.GetAsset().UseLogs)
+ {
+ MultiSceneLogger.Normal($"Unable to find object of name: {name} in the Do Not Destroy scene.");
+ }
return null;
}
@@ -97,15 +124,19 @@ public static GameObject FindObjectInDoNotDestroy(string name)
/// List of all the objects found in the scene
public static List FindObjectsInDoNotDestroy(string name)
{
- var _objects = new List();
- var _validObjectsFromScene = new List();
+ var objs = new List();
+ var validObjectsFromScene = new List();
- _instance.gameObject.scene.GetRootGameObjects(_objects);
+ instance.gameObject.scene.GetRootGameObjects(objs);
- foreach (var _go in _objects)
- _validObjectsFromScene.AddRange(from Transform _child in _go.transform where _child.name.Equals(name) select _child.gameObject);
+ foreach (var go in objs)
+ {
+ validObjectsFromScene.AddRange(from Transform child in go.transform
+ where child.name.Equals(name)
+ select child.gameObject);
+ }
- return _validObjectsFromScene;
+ return validObjectsFromScene;
}
@@ -116,12 +147,15 @@ public static List FindObjectsInDoNotDestroy(string name)
/// The first found object of the type in the do not destroy scene
public static T GetComponentInDoNotDestroy()
{
- var _get = GetComponentsInDoNotDestroy();
+ var get = GetComponentsInDoNotDestroy();
- if (_get.Count > 0) return _get[0];
+ if (get.Count > 0) return get[0];
- if (AssetAccessor.GetAsset().UseLogs)
- MsLog.Normal($"Unable to get any component of the type {typeof(T)} in the Do Not Destroy scene.");
+ if (AssetAccessor.GetAsset().UseLogs)
+ {
+ MultiSceneLogger.Normal(
+ $"Unable to get any component of the type {typeof(T)} in the Do Not Destroy scene.");
+ }
return default;
}
@@ -134,13 +168,15 @@ public static T GetComponentInDoNotDestroy()
/// A list of all the found objects of the type in the do not destroy scene
public static List GetComponentsInDoNotDestroy()
{
- var _scene = _instance.gameObject.scene.GetRootGameObjects();
- var _find = new List();
+ var scene = instance.gameObject.scene.GetRootGameObjects();
+ var find = new List();
- foreach (var _obj in _scene)
- _find.AddRange(_obj.GetComponentsInChildren());
+ foreach (var obj in scene)
+ {
+ find.AddRange(obj.GetComponentsInChildren());
+ }
- return _find;
+ return find;
}
}
}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Built-In Extensions/Do Not Destroy/DoNotDestroyAccessor.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Built-In Extensions/Do Not Destroy/DoNotDestroyAccessor.cs.meta
new file mode 100644
index 0000000..401a604
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Built-In Extensions/Do Not Destroy/DoNotDestroyAccessor.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5389e06e78163be4b8b5a940aae16d2c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners.meta
new file mode 100644
index 0000000..472fbd1
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 971c048408df0844bbabebd9300f26f9
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneAwake.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneAwake.cs
new file mode 100644
index 0000000..f525a7b
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneAwake.cs
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace CarterGames.Experimental.MultiScene
+{
+ ///
+ /// An interface for syncing logic to when scene groups are loaded.
+ ///
+ /// Awake is run first out of the interfaces.
+ public interface IMultiSceneAwake
+ {
+ void OnMultiSceneAwake();
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneAwake.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneAwake.cs.meta
new file mode 100644
index 0000000..9912e67
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneAwake.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3e577c62cac314f4eb1d9b0bca8c0383
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneEnable.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneEnable.cs
new file mode 100644
index 0000000..af6b83f
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneEnable.cs
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace CarterGames.Experimental.MultiScene
+{
+ ///
+ /// An interface for syncing logic to when scene groups are loaded.
+ ///
+ /// Enable is run second out of the interfaces.
+ public interface IMultiSceneEnable
+ {
+ void OnMultiSceneEnable();
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneEnable.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneEnable.cs.meta
new file mode 100644
index 0000000..fd8ccc3
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneEnable.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3bd2e7350ca753f49a17d6652795e4b7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneStart.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneStart.cs
new file mode 100644
index 0000000..267df5a
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneStart.cs
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace CarterGames.Experimental.MultiScene
+{
+ ///
+ /// An interface for syncing logic to when scene groups are loaded.
+ ///
+ /// Start is run last out of the interfaces.
+ public interface IMultiSceneStart
+ {
+ void OnMultiSceneStart();
+ }
+}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneStart.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneStart.cs.meta
new file mode 100644
index 0000000..3f62348
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/IMultiSceneStart.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4a0d9be5a5b1e37428548531f082f4bc
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/Listeners/ListenerHandler.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/ListenerHandler.cs
similarity index 53%
rename from Runtime/Listeners/ListenerHandler.cs
rename to Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/ListenerHandler.cs
index 14296a8..43d1080 100644
--- a/Runtime/Listeners/ListenerHandler.cs
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/ListenerHandler.cs
@@ -1,4 +1,27 @@
-using System.Collections;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using CarterGames.Experimental.MultiScene.Editor;
@@ -19,10 +42,9 @@ public static class ListenerHandler
private const string EnableMethodName = "OnMultiSceneEnable";
private const string StartMethodName = "OnMultiSceneStart";
-
- private static List> _awakeOrderedListeners;
- private static List> _enableOrderedListeners;
- private static List> _startOrderedListeners;
+ private static List> awakeOrderedListeners;
+ private static List> enableOrderedListeners;
+ private static List> startOrderedListeners;
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Methods
@@ -33,9 +55,9 @@ public static class ListenerHandler
///
private static void GetSortedListeners()
{
- _awakeOrderedListeners = OrderedHandler.OrderListeners(MultiSceneRef.GetComponentsFromAllScenes(), AwakeMethodName);
- _enableOrderedListeners = OrderedHandler.OrderListeners(MultiSceneRef.GetComponentsFromAllScenes(), EnableMethodName);
- _startOrderedListeners = OrderedHandler.OrderListeners(MultiSceneRef.GetComponentsFromAllScenes(), StartMethodName);
+ awakeOrderedListeners = OrderedHandler.OrderListeners(MultiSceneRef.GetComponentsFromAllScenes(), AwakeMethodName);
+ enableOrderedListeners = OrderedHandler.OrderListeners(MultiSceneRef.GetComponentsFromAllScenes(), EnableMethodName);
+ startOrderedListeners = OrderedHandler.OrderListeners(MultiSceneRef.GetComponentsFromAllScenes(), StartMethodName);
}
@@ -47,77 +69,51 @@ public static void CallListeners(Scene s, LoadSceneMode l)
MultiSceneManager.OnSceneLoaded.Raise(s.name);
if (!s.name.Equals(MultiSceneManager.ActiveSceneGroup.scenes[MultiSceneManager.ActiveSceneGroup.scenes.Count - 1].sceneName))
+ {
return;
+ }
GetSortedListeners();
typeof(MultiSceneManager).GetMethod("UpdateActiveSceneNames", BindingFlags.Static)?.Invoke(null, null);
- MultiSceneManager.Mono.StartCoroutine(CallMultiSceneAwake());
+ MultiSceneManager.MonoInstance.StartCoroutine(CallMultiSceneListeners());
SceneManager.sceneLoaded -= CallListeners;
}
-
- ///
- /// Calls all IMultiSceneAwake implementations in the project.
- ///
- private static IEnumerator CallMultiSceneAwake()
- {
- var count = 0;
- for (var i = 0; i < _awakeOrderedListeners.Count; i++)
- {
- _awakeOrderedListeners[i].Listener.OnMultiSceneAwake();
- count++;
+ private static IEnumerator CallMultiSceneListeners()
+ {
+ yield return CallListeners(awakeOrderedListeners, "OnMultiSceneAwake");
+ yield return null;
+ yield return CallListeners(enableOrderedListeners, "OnMultiSceneEnable");
+ yield return null;
+ yield return CallListeners(startOrderedListeners, "OnMultiSceneStart");
+ }
- if (count < AssetAccessor.GetAsset().ListenerFrequency) continue;
- count = 0;
- yield return null;
- }
- MultiSceneManager.Mono.StartCoroutine(CallMultiSceneEnable());
- }
-
-
- ///
- /// Calls all IMultiSceneEnable implementations in the project.
- ///
- private static IEnumerator CallMultiSceneEnable()
+ private static IEnumerator CallListeners(List> orderedListeners, string methodName)
{
var count = 0;
- for (var i = 0; i < _enableOrderedListeners.Count; i++)
+ if (methodName.Equals(string.Empty))
{
- _enableOrderedListeners[i].Listener.OnMultiSceneEnable();
- count++;
-
- if (count < AssetAccessor.GetAsset().ListenerFrequency) continue;
- count = 0;
- yield return null;
+ MultiSceneLogger.Warning("Unable to find the interface type to send listeners for... skipping.");
+ yield break;
}
-
- MultiSceneManager.Mono.StartCoroutine(CallMultiSceneStart());
- }
-
-
- ///
- /// Calls all IMultiSceneStart implementations in the project.
- ///
- private static IEnumerator CallMultiSceneStart()
- {
- var count = 0;
- for (var i = 0; i < _startOrderedListeners.Count; i++)
+ if (orderedListeners.Count <= 0) yield break;
+
+ foreach (var listener in orderedListeners)
{
- _startOrderedListeners[i].Listener.OnMultiSceneStart();
+ listener.Listener.GetType().GetMethod(methodName, BindingFlags.Public | BindingFlags.Instance)?.Invoke(listener.Listener, null);
count++;
+
+ if (count < AssetAccessor.GetAsset().ListenerFrequency) continue;
- if (count < AssetAccessor.GetAsset().ListenerFrequency) continue;
count = 0;
yield return null;
}
-
- MultiSceneManager.PostScenesLoaded.Raise();
}
}
}
\ No newline at end of file
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/ListenerHandler.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/ListenerHandler.cs.meta
new file mode 100644
index 0000000..0d149c8
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Listeners/ListenerHandler.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8af640d803c7479eb287744a76642073
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Popup Dialogues.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Popup Dialogues.meta
new file mode 100644
index 0000000..7c45d0a
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Popup Dialogues.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: c21fe2ec403a4ca1a5655e794aacaa2d
+timeCreated: 1662133183
\ No newline at end of file
diff --git a/Runtime/Popup Dialogues/MultiScenePopups.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Popup Dialogues/MultiScenePopups.cs
similarity index 65%
rename from Runtime/Popup Dialogues/MultiScenePopups.cs
rename to Carter Games/Multi Scene/Code/Runtime/Systems/Popup Dialogues/MultiScenePopups.cs
index fa42263..9719095 100644
--- a/Runtime/Popup Dialogues/MultiScenePopups.cs
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Popup Dialogues/MultiScenePopups.cs
@@ -1,5 +1,29 @@
-#if UNITY_EDITOR
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#if UNITY_EDITOR
+
+using CarterGames.Common;
using UnityEditor;
namespace CarterGames.Experimental.MultiScene.Editor
@@ -16,7 +40,7 @@ public static class MultiScenePopups
///
/// Broadcasts the result of a editor dialogue popups for use...
///
- public static readonly MultiSceneEvt OnPopupResolved = new MultiSceneEvt();
+ public static readonly Evt OnPopupResolved = new Evt();
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Popup Dialogues/MultiScenePopups.cs.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Popup Dialogues/MultiScenePopups.cs.meta
new file mode 100644
index 0000000..b6b2b57
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Popup Dialogues/MultiScenePopups.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: bcfbe21d808f43958e86366a3b46939b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: f82d46e5e26774d4baf6eb999379a0dd, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Carter Games/Multi Scene/Code/Runtime/Systems/Referencing.meta b/Carter Games/Multi Scene/Code/Runtime/Systems/Referencing.meta
new file mode 100644
index 0000000..e3ce099
--- /dev/null
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Referencing.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9f23e08a3c430b549adf25633c0a06d6
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/Referencing/MultiSceneRef.cs b/Carter Games/Multi Scene/Code/Runtime/Systems/Referencing/MultiSceneRef.cs
similarity index 50%
rename from Runtime/Referencing/MultiSceneRef.cs
rename to Carter Games/Multi Scene/Code/Runtime/Systems/Referencing/MultiSceneRef.cs
index 23886ef..ee864f3 100644
--- a/Runtime/Referencing/MultiSceneRef.cs
+++ b/Carter Games/Multi Scene/Code/Runtime/Systems/Referencing/MultiSceneRef.cs
@@ -1,4 +1,27 @@
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2024 Carter Games
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.SceneManagement;
@@ -14,12 +37,12 @@ public static class MultiSceneRef
///
/// Gets the root objects in the scene requested.
///
- /// The scene to search through
+ /// The scene to search through
/// The objects in said scene
- public static GameObject[] GetRootObjects(string scene)
+ public static GameObject[] GetRootObjects(string sceneName)
{
- var _scene = SceneManager.GetSceneByName(scene);
- return _scene.GetRootGameObjects();
+ var scene = SceneManager.GetSceneByName(sceneName);
+ return scene.GetRootGameObjects();
}
@@ -27,12 +50,12 @@ public static GameObject[] GetRootObjects(string scene)
/// Moves the object entered in the scene string entered...
///
/// The object to move
- /// The scene to move to
+ /// The scene to move to
/// Was the move successful?
- public static void MoveObjectToScene(GameObject obj, string scene)
+ public static void MoveObjectToScene(GameObject obj, string sceneName)
{
- var _scene = SceneManager.GetSceneByName(scene);
- SceneManager.MoveGameObjectToScene(obj, _scene);
+ var scene = SceneManager.GetSceneByName(sceneName);
+ SceneManager.MoveGameObjectToScene(obj, scene);
}
@@ -40,13 +63,16 @@ public static void MoveObjectToScene(GameObject obj, string scene)
/// Moves the objects entered in the scene string entered...
///
/// The objects to move
- /// The scene to move to
+ /// The scene to move to
/// Was the move successful?
- public static void MoveObjectsToScene(List obj, string scene)
+ public static void MoveObjectsToScene(List obj, string sceneName)
{
- var _scene = SceneManager.GetSceneByName(scene);
+ var scene = SceneManager.GetSceneByName(sceneName);
+
foreach (var i in obj)
- SceneManager.MoveGameObjectToScene(i, _scene);
+ {
+ SceneManager.MoveGameObjectToScene(i, scene);
+ }
}
@@ -54,12 +80,12 @@ public static void MoveObjectsToScene(List obj, string scene)
/// Finds the first object that matches the name entered...
///
/// Alternative to GameObject.Find()
- /// The scene name to find.
+ /// The scene name to find.
/// The name of the object to find.
/// The object found
- public static GameObject FindObject(string scene, string name)
+ public static GameObject FindObject(string sceneName, string name)
{
- return FindObjects(scene, name)[0];
+ return FindObjects(sceneName, name)[0];
}
@@ -82,20 +108,28 @@ public static GameObject FindObject(string name)
/// List of all the objects found in the scene
public static List FindAllObjects(string name)
{
- var _objects = new List();
- var _scenes = new List();
- var _validObjectsFromScene = new List();
+ var objs = new List();
+ var scenes = new List();
+ var validObjectsFromScene = new List();
for (var i = 0; i < SceneManager.sceneCount; i++)
- _scenes.Add(SceneManager.GetSceneAt(i));
+ {
+ scenes.Add(SceneManager.GetSceneAt(i));
+ }
- foreach (var _s in _scenes)
- _objects.AddRange(_s.GetRootGameObjects());
+ foreach (var scene in scenes)
+ {
+ objs.AddRange(scene.GetRootGameObjects());
+ }
- foreach (var _go in _objects)
- _validObjectsFromScene.AddRange(from Transform _child in _go.transform where _child.name.Equals(name) select _child.gameObject);
+ foreach (var go in objs)
+ {
+ validObjectsFromScene.AddRange(from Transform child in go.transform
+ where child.name.Equals(name)
+ select child.gameObject);
+ }
- return _validObjectsFromScene;
+ return validObjectsFromScene;
}
@@ -106,37 +140,45 @@ public static List FindAllObjects(string name)
/// List of all the objects found in the scene
public static List FindObjects(string name)
{
- var _objects = new List();
- var _scene = SceneManager.GetActiveScene();
- var _validObjectsFromScene = new List();
+ var objs = new List();
+ var scene = SceneManager.GetActiveScene();
+ var validObjectsFromScene = new List();
- _scene.GetRootGameObjects(_objects);
+ scene.GetRootGameObjects(objs);
- foreach (var _go in _objects)
- _validObjectsFromScene.AddRange(from Transform _child in _go.transform where _child.name.Equals(name) select _child.gameObject);
+ foreach (var go in objs)
+ {
+ validObjectsFromScene.AddRange(from Transform child in go.transform
+ where child.name.Equals(name)
+ select child.gameObject);
+ }
- return _validObjectsFromScene;
+ return validObjectsFromScene;
}
///
/// Finds all the objects that matches the name entered...
///
- /// The scene name to search through.
+ /// The scene name to search through.
/// The name of the object to find.
/// List of all the objects found in the scene
- public static List FindObjects(string scene, string name)
+ public static List FindObjects(string sceneName, string name)
{
- var _objects = new List();
- var _scene = SceneManager.GetSceneByName(scene);
- var _validObjectsFromScene = new List();
+ var objs = new List();
+ var scene = SceneManager.GetSceneByName(sceneName);
+ var validObjectsFromScene = new List();
- _scene.GetRootGameObjects(_objects);
+ scene.GetRootGameObjects(objs);
- foreach (var _go in _objects)
- _validObjectsFromScene.AddRange(from Transform _child in _go.transform where _child.name.Equals(name) select _child.gameObject);
+ foreach (var go in objs)
+ {
+ validObjectsFromScene.AddRange(from Transform child in go.transform
+ where child.name.Equals(name)
+ select child.gameObject);
+ }
- return _validObjectsFromScene;
+ return validObjectsFromScene;
}
@@ -147,16 +189,18 @@ public static List FindObjects(string scene, string name)
/// List of any instances of the type found in the scene
public static List GetComponentsFromActiveScene()
{
- var _objects = new List();
- var _scene = SceneManager.GetActiveScene();
- var _validObjectsFromScene = new List();
+ var objs = new List();
+ var scene = SceneManager.GetActiveScene();
+ var validObjectsFromScene = new List();
- _scene.GetRootGameObjects(_objects);
+ scene.GetRootGameObjects(objs);
- foreach (var _go in _objects)
- _validObjectsFromScene.AddRange(_go.GetComponentsInChildren(true));
+ foreach (var go in objs)
+ {
+ validObjectsFromScene.AddRange(go.GetComponentsInChildren