diff --git a/Assets/Desert/Assets/Animations/Hover.anim b/Assets/Desert/Assets/Animations/Hover.anim deleted file mode 100644 index 541c7c6..0000000 --- a/Assets/Desert/Assets/Animations/Hover.anim +++ /dev/null @@ -1,227 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Hover - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: - - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: {x: 0, y: 1.5, z: 0} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: 0} - tangentMode: 0 - weightedMode: 0 - inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - - serializedVersion: 3 - time: 4 - value: {x: 0, y: 1.54, z: 0} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: 0} - tangentMode: 0 - weightedMode: 0 - inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - - serializedVersion: 3 - time: 8 - value: {x: 0, y: 1.5, z: 0} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: 0} - tangentMode: 0 - weightedMode: 0 - inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - path: Origin - - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: {x: 0, y: 0, z: 0} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: -0.00315} - tangentMode: 0 - weightedMode: 0 - inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - - serializedVersion: 3 - time: 2 - value: {x: 0, y: 0, z: -0.0063} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: 0} - tangentMode: 0 - weightedMode: 0 - inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - - serializedVersion: 3 - time: 6 - value: {x: 0, y: 0, z: 0.0063} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: 0} - tangentMode: 0 - weightedMode: 0 - inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - - serializedVersion: 3 - time: 8 - value: {x: 0, y: 0, z: 0} - inSlope: {x: 0, y: 0, z: -0.00315} - outSlope: {x: 0, y: 0, z: 0} - tangentMode: 0 - weightedMode: 0 - inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - path: Origin/Ring - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: [] - m_SampleRate: 60 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: - - serializedVersion: 2 - path: 1818259597 - attribute: 1 - script: {fileID: 0} - typeID: 4 - customType: 0 - isPPtrCurve: 0 - - serializedVersion: 2 - path: 684716456 - attribute: 1 - script: {fileID: 0} - typeID: 4 - customType: 0 - isPPtrCurve: 0 - pptrCurveMapping: [] - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 8 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: - - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 1.5 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 4 - value: 1.54 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 8 - value: 1.5 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: m_LocalPosition.y - path: Origin - classID: 4 - script: {fileID: 0} - - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: -0.00315 - tangentMode: 69 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 2 - value: -0.0063 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 6 - value: 0.0063 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 8 - value: 0 - inSlope: -0.00315 - outSlope: 0 - tangentMode: 69 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: m_LocalPosition.z - path: Origin/Ring - classID: 4 - script: {fileID: 0} - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Assets/Desert/Assets/Desert.asset b/Assets/Desert/Assets/Desert.asset index 6ece19e..9073d5c 100644 --- a/Assets/Desert/Assets/Desert.asset +++ b/Assets/Desert/Assets/Desert.asset @@ -12,8 +12,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 28d04249c1c4438da94b524e7d4afff2, type: 3} m_Name: Desert m_EditorClassIdentifier: - minRoomSize: {x: 3, y: 3} - playSpace: {x: 3, y: 5} + minRoomSize: {x: 2, y: 2} + playSpace: {x: 2, y: 4} spaceTile: {fileID: 3229991053255736984, guid: b8f192f7cebe686468af6b1a71c4605b, type: 3} environment: {fileID: 5743657079028767629, guid: 17ecdbaca50efaa4ab503614dfec54a8, @@ -32,8 +32,4 @@ MonoBehaviour: - {fileID: 11400000, guid: 83d6800536b1df14287ff2cd8e0d58ce, type: 2} puzzleCount: {x: 1, y: 2} puzzleTypes: - - {fileID: 11400000, guid: 3f79d37154e44ca47b54bb43bbe8d9aa, type: 2} - - {fileID: 11400000, guid: 8707242279bb6c541a12dc4491388c42, type: 2} - - {fileID: 11400000, guid: 3e5e65f1afdbf7f458b2bcc8b90ec1ff, type: 2} - - {fileID: 11400000, guid: 15dcebb677f5df940839eaaa50274294, type: 2} - - {fileID: 11400000, guid: ecc412010abd45a4aaa7d364b6c3789c, type: 2} + - {fileID: 11400000, guid: ee5a44432e80cd64689be3ff34750339, type: 2} diff --git a/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_AlbedoTransparency.png.meta b/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_AlbedoTransparency.png.meta index d48165d..0e1fd82 100644 --- a/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_AlbedoTransparency.png.meta +++ b/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_AlbedoTransparency.png.meta @@ -69,7 +69,7 @@ TextureImporter: platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 + maxTextureSize: 4096 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 diff --git a/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_Emission.png.meta b/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_Emission.png.meta index 7c32f46..1cc6933 100644 --- a/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_Emission.png.meta +++ b/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_Emission.png.meta @@ -69,7 +69,7 @@ TextureImporter: platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 + maxTextureSize: 4096 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 diff --git a/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_MetallicSmoothness.png.meta b/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_MetallicSmoothness.png.meta index ee0ec6e..04fd26d 100644 --- a/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_MetallicSmoothness.png.meta +++ b/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_MetallicSmoothness.png.meta @@ -69,7 +69,7 @@ TextureImporter: platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 + maxTextureSize: 4096 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 diff --git a/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_Normal.png.meta b/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_Normal.png.meta index 6791ca9..917bced 100644 --- a/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_Normal.png.meta +++ b/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_Normal.png.meta @@ -69,7 +69,7 @@ TextureImporter: platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 + maxTextureSize: 4096 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 diff --git a/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_Occlusion.png.meta b/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_Occlusion.png.meta index 2b06d64..bd7bede 100644 --- a/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_Occlusion.png.meta +++ b/Assets/Desert/Assets/Materials/Textures/Hole Orb/Hole Orb_Holes_Occlusion.png.meta @@ -69,7 +69,7 @@ TextureImporter: platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 + maxTextureSize: 4096 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 diff --git a/Assets/Desert/Assets/Modules/Puzzle C/Easy/Dispenser Easy.asset b/Assets/Desert/Assets/Modules/Puzzle C/Easy/Dispenser Easy.asset index d19a254..5b976ad 100644 --- a/Assets/Desert/Assets/Modules/Puzzle C/Easy/Dispenser Easy.asset +++ b/Assets/Desert/Assets/Modules/Puzzle C/Easy/Dispenser Easy.asset @@ -13,7 +13,7 @@ MonoBehaviour: m_Name: Dispenser Easy m_EditorClassIdentifier: types: 03000000 - modulePrefab: {fileID: 3942114796521670514, guid: 20c9cfab710bbe04ca6f81d44a01b025, + modulePrefab: {fileID: 8291735269762471888, guid: 8253a7c07eeea3b48832a42b847cf0f1, type: 3} preconditionRequirements: [] placementRequirements: diff --git a/Assets/Desert/Assets/Modules/Puzzle C/Easy/Puzzle C Easy Dispenser.prefab b/Assets/Desert/Assets/Modules/Puzzle C/Easy/Puzzle C Easy Dispenser.prefab new file mode 100644 index 0000000..45a38cf --- /dev/null +++ b/Assets/Desert/Assets/Modules/Puzzle C/Easy/Puzzle C Easy Dispenser.prefab @@ -0,0 +1,113 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &5019013083343442082 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 2 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4826747451102095092, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: m_Name + value: Puzzle C Easy Dispenser + objectReference: {fileID: 0} + - target: {fileID: 8200130174738179068, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: lights.Array.data[0].lights.Array.data[0] + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8200130174738179068, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: lights.Array.data[0].lights.Array.data[5] + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8200130174738179068, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: lights.Array.data[1].lights.Array.data[1] + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8200130174738179068, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: lights.Array.data[1].lights.Array.data[4] + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8200130174738179068, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: lights.Array.data[4].lights.Array.data[1] + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8200130174738179068, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: lights.Array.data[4].lights.Array.data[4] + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8200130174738179068, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: lights.Array.data[5].lights.Array.data[0] + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8200130174738179068, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + propertyPath: lights.Array.data[5].lights.Array.data[5] + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_AddedGameObjects: [] + m_SourcePrefab: {fileID: 100100000, guid: 20c9cfab710bbe04ca6f81d44a01b025, type: 3} diff --git a/Assets/Desert/Assets/Modules/Puzzle C/Easy/Puzzle C Easy Dispenser.prefab.meta b/Assets/Desert/Assets/Modules/Puzzle C/Easy/Puzzle C Easy Dispenser.prefab.meta new file mode 100644 index 0000000..dd53330 --- /dev/null +++ b/Assets/Desert/Assets/Modules/Puzzle C/Easy/Puzzle C Easy Dispenser.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8253a7c07eeea3b48832a42b847cf0f1 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Desert/Assets/Modules/Puzzle D/Easy.meta b/Assets/Desert/Assets/Modules/Puzzle D/Easy.meta new file mode 100644 index 0000000..8c52e78 --- /dev/null +++ b/Assets/Desert/Assets/Modules/Puzzle D/Easy.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c0b6cc57235be04428908f37c5c33f3c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Desert/Assets/Modules/Puzzle D/Easy/Dispenser Easy Relation.asset b/Assets/Desert/Assets/Modules/Puzzle D/Easy/Dispenser Easy Relation.asset new file mode 100644 index 0000000..abbfdbe --- /dev/null +++ b/Assets/Desert/Assets/Modules/Puzzle D/Easy/Dispenser Easy Relation.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6e3f3bf07aae4a03834a7943c255f37d, type: 3} + m_Name: Dispenser Easy Relation + m_EditorClassIdentifier: + relatedModule: {fileID: 11400000, guid: 2ae9786d52faa1f4c82b3a3eeae9f538, type: 2} diff --git a/Assets/Desert/Assets/Animations/Hover.anim.meta b/Assets/Desert/Assets/Modules/Puzzle D/Easy/Dispenser Easy Relation.asset.meta similarity index 64% rename from Assets/Desert/Assets/Animations/Hover.anim.meta rename to Assets/Desert/Assets/Modules/Puzzle D/Easy/Dispenser Easy Relation.asset.meta index d3240b5..0f917a4 100644 --- a/Assets/Desert/Assets/Animations/Hover.anim.meta +++ b/Assets/Desert/Assets/Modules/Puzzle D/Easy/Dispenser Easy Relation.asset.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: 11e962d632c515e4ea1a885b3fbc1692 +guid: 2393bf2b32e06f647a014688e3d8a8d9 NativeFormatImporter: externalObjects: {} - mainObjectFileID: 7400000 + mainObjectFileID: 11400000 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Desert/Assets/Modules/Puzzle D/Easy/Dispenser Easy.asset b/Assets/Desert/Assets/Modules/Puzzle D/Easy/Dispenser Easy.asset new file mode 100644 index 0000000..d19a254 --- /dev/null +++ b/Assets/Desert/Assets/Modules/Puzzle D/Easy/Dispenser Easy.asset @@ -0,0 +1,22 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: abf4a405f6c64073995bded39977563e, type: 3} + m_Name: Dispenser Easy + m_EditorClassIdentifier: + types: 03000000 + modulePrefab: {fileID: 3942114796521670514, guid: 20c9cfab710bbe04ca6f81d44a01b025, + type: 3} + preconditionRequirements: [] + placementRequirements: + - {fileID: 11400000, guid: ed4830127e9381245a6af07e42c52422, type: 2} + - {fileID: 11400000, guid: 1f1825b71bae09c438a1cb52603347d6, type: 2} + - {fileID: 11400000, guid: 43eb2a566a244964aa3a3319eaafe1a8, type: 2} diff --git a/Assets/Desert/Assets/Modules/Puzzle D/Easy/Dispenser Easy.asset.meta b/Assets/Desert/Assets/Modules/Puzzle D/Easy/Dispenser Easy.asset.meta new file mode 100644 index 0000000..e15d99f --- /dev/null +++ b/Assets/Desert/Assets/Modules/Puzzle D/Easy/Dispenser Easy.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2ae9786d52faa1f4c82b3a3eeae9f538 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Desert/Assets/Modules/Puzzle D/Easy/Puzzle D Easy.asset b/Assets/Desert/Assets/Modules/Puzzle D/Easy/Puzzle D Easy.asset new file mode 100644 index 0000000..222a166 --- /dev/null +++ b/Assets/Desert/Assets/Modules/Puzzle D/Easy/Puzzle D Easy.asset @@ -0,0 +1,21 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f928b97941e3469a9015316bb5ac1309, type: 3} + m_Name: Puzzle D Easy + m_EditorClassIdentifier: + types: 02000000 + modulePrefab: {fileID: 6853723365353446933, guid: c6f4a21ce6c0ce84584c90804c96ad80, + type: 3} + preconditionRequirements: + - {fileID: 11400000, guid: 2393bf2b32e06f647a014688e3d8a8d9, type: 2} + placementRequirements: + - {fileID: 11400000, guid: be3144e12a689e84fbfe2ce50f61dcc7, type: 2} diff --git a/Assets/Desert/Assets/Modules/Puzzle D/Easy/Puzzle D Easy.asset.meta b/Assets/Desert/Assets/Modules/Puzzle D/Easy/Puzzle D Easy.asset.meta new file mode 100644 index 0000000..d68435f --- /dev/null +++ b/Assets/Desert/Assets/Modules/Puzzle D/Easy/Puzzle D Easy.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ee5a44432e80cd64689be3ff34750339 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Desert/Assets/Prefabs/Desert Space Tile.prefab b/Assets/Desert/Assets/Prefabs/Desert Space Tile.prefab index b7dc76b..be0ce5d 100644 --- a/Assets/Desert/Assets/Prefabs/Desert Space Tile.prefab +++ b/Assets/Desert/Assets/Prefabs/Desert Space Tile.prefab @@ -10,6 +10,7 @@ GameObject: m_Component: - component: {fileID: 8664788757336834019} - component: {fileID: 3229991053255736984} + - component: {fileID: 7880032434625960893} m_Layer: 0 m_Name: Desert Space Tile m_TagString: Untagged @@ -45,16 +46,46 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: tilePrefabs: - keys: 000000000100000002000000030000000400000005000000060000000700000008000000 - values: - - {fileID: 2171430479842946829, guid: 77b4684295838884782186a211a5a6cb, type: 3} - - {fileID: 2423305530833545252, guid: 77b4684295838884782186a211a5a6cb, type: 3} - - {fileID: -8565254895107937726, guid: 77b4684295838884782186a211a5a6cb, type: 3} - - {fileID: -4929169701154996116, guid: 77b4684295838884782186a211a5a6cb, type: 3} - - {fileID: -2334870282328881315, guid: 77b4684295838884782186a211a5a6cb, type: 3} - - {fileID: -929614819956293028, guid: 77b4684295838884782186a211a5a6cb, type: 3} - - {fileID: 4483222258087546740, guid: 77b4684295838884782186a211a5a6cb, type: 3} - - {fileID: -1447634327028791381, guid: 77b4684295838884782186a211a5a6cb, type: 3} - - {fileID: -5212206449543053848, guid: 77b4684295838884782186a211a5a6cb, type: 3} + - location: 6 + prefab: {fileID: 4483222258087546740, guid: 77b4684295838884782186a211a5a6cb, + type: 3} + - location: 7 + prefab: {fileID: -1447634327028791381, guid: 77b4684295838884782186a211a5a6cb, + type: 3} + - location: 8 + prefab: {fileID: -5212206449543053848, guid: 77b4684295838884782186a211a5a6cb, + type: 3} + - location: 3 + prefab: {fileID: -4929169701154996116, guid: 77b4684295838884782186a211a5a6cb, + type: 3} + - location: 4 + prefab: {fileID: -2334870282328881315, guid: 77b4684295838884782186a211a5a6cb, + type: 3} + - location: 5 + prefab: {fileID: -929614819956293028, guid: 77b4684295838884782186a211a5a6cb, + type: 3} + - location: 0 + prefab: {fileID: 2171430479842946829, guid: 77b4684295838884782186a211a5a6cb, + type: 3} + - location: 1 + prefab: {fileID: 2423305530833545252, guid: 77b4684295838884782186a211a5a6cb, + type: 3} + - location: 2 + prefab: {fileID: -8565254895107937726, guid: 77b4684295838884782186a211a5a6cb, + type: 3} material: {fileID: 2100000, guid: 627fd7178942c81449aae5e08ad11d21, type: 2} showTile: 0 +--- !u!64 &7880032434625960893 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8664788757336834016} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 0} diff --git a/Assets/Desert/Assets/Prefabs/Dispenser/Dispenser.prefab b/Assets/Desert/Assets/Prefabs/Dispenser/Dispenser.prefab index 2494cab..72a0bba 100644 --- a/Assets/Desert/Assets/Prefabs/Dispenser/Dispenser.prefab +++ b/Assets/Desert/Assets/Prefabs/Dispenser/Dispenser.prefab @@ -622,12 +622,12 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: lights: - - lights: 010000000001 - - lights: 000100000100 - lights: 000000000000 - lights: 000000000000 - - lights: 000100000100 - - lights: 010000000001 + - lights: 000000000000 + - lights: 000000000000 + - lights: 000000000000 + - lights: 000000000000 lightPrefab: {fileID: 5209397971498272420, guid: 2b9310245ad42eb4699083590fdd5f51, type: 3} gridDimensions: {x: 6, y: 6} diff --git a/Assets/Desert/Assets/Prefabs/Puzzle D.prefab b/Assets/Desert/Assets/Prefabs/Puzzle D.prefab index 5b7c674..7724adc 100644 --- a/Assets/Desert/Assets/Prefabs/Puzzle D.prefab +++ b/Assets/Desert/Assets/Prefabs/Puzzle D.prefab @@ -217,7 +217,6 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1431476700248791042} - - {fileID: 7187554344845375949} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -567,80 +566,3 @@ MonoBehaviour: m_EditorClassIdentifier: color: {r: 8, g: 3.5137255, b: 0, a: 1} emissionRenderer: {fileID: 1782781022534132745} ---- !u!1001 &2485194224317594919 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 2 - m_TransformParent: {fileID: 2966546982734834469} - m_Modifications: - - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, - type: 3} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, - type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, - type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4826747451102095092, guid: 20c9cfab710bbe04ca6f81d44a01b025, - type: 3} - propertyPath: m_Name - value: Dispenser - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_AddedGameObjects: [] - m_SourcePrefab: {fileID: 100100000, guid: 20c9cfab710bbe04ca6f81d44a01b025, type: 3} ---- !u!4 &7187554344845375949 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 4738486521284232426, guid: 20c9cfab710bbe04ca6f81d44a01b025, - type: 3} - m_PrefabInstance: {fileID: 2485194224317594919} - m_PrefabAsset: {fileID: 0} diff --git a/Assets/Desert/Runtime/Hoop.cs b/Assets/Desert/Runtime/Hoop.cs index a3dd58c..9ee024d 100644 --- a/Assets/Desert/Runtime/Hoop.cs +++ b/Assets/Desert/Runtime/Hoop.cs @@ -1,30 +1,98 @@ -using System.Collections.Generic; +using System.Collections; +using System.Collections.Generic; +using EscapeRoomEngine.Desert.Runtime.Dispenser; +using EscapeRoomEngine.Engine.Runtime.Modules; +using EscapeRoomEngine.Engine.Runtime.Utilities; using NaughtyAttributes; using UnityEngine; namespace EscapeRoomEngine.Desert.Runtime { [RequireComponent(typeof(Collider))] - public class Hoop : MonoBehaviour + public class Hoop : StatePuzzle { + public float updateDelay; [BoxGroup("Internal")] [SerializeField] private List rings; - - public bool Solved + + private readonly HashSet _orbs = new(); + private Dispenser.Dispenser _dispenser; + + protected override void Start() { - set + base.Start(); + + PuzzleEvent += (_, type) => { - if (value) + // ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault + switch (type) { - rings.ForEach(ring => ring.color = ); - } - else - { - + case PuzzleEventType.Restarted: + var color = Engine.Runtime.Engine.DefaultEngine.theme.puzzleColor; + rings.ForEach(ring => ring.color = color.hdr); + _dispenser.Reset(); + break; + case PuzzleEventType.Solved: + color = Engine.Runtime.Engine.DefaultEngine.theme.solvedColor; + rings.ForEach(ring => ring.color = color.hdr); + _dispenser.Solve(); + break; } + }; + } + + protected override void SetState(int index, int value, bool checkSolution) + { + base.SetState(index, value, checkSolution); + + for (var i = 0; i < rings.Count; i++) + { + rings[i].active = i < value; } } - private int _orbCount; + private IEnumerator SetOrbCount() + { + if (!Solved) + { + yield return new WaitForSeconds(updateDelay); + SetState(0, _orbs.Count, true); + } + } + + private void OnTriggerEnter(Collider other) + { + var orb = other.GetComponent(); + if (orb) + { + _orbs.Add(orb.gameObject); + StartCoroutine(SetOrbCount()); + } + } + + private void OnTriggerExit(Collider other) + { + var orb = other.GetComponent(); + if (orb) + { + _orbs.Remove(orb.gameObject); + StartCoroutine(SetOrbCount()); + } + } + + public override void SetModule(Module module) + { + base.SetModule(module); + + var firstRelatedModule = Module.relatedModules[0]; + if (firstRelatedModule.State is Dispenser.Dispenser dispenser) + { + _dispenser = dispenser; + } + else + { + throw new EngineException("Hoop was not assigned a related Dispenser."); + } + } } } \ No newline at end of file diff --git a/Assets/Desert/Runtime/Puzzle C/Holes.cs b/Assets/Desert/Runtime/Puzzle C/Holes.cs index 19bbf6b..2ac51db 100644 --- a/Assets/Desert/Runtime/Puzzle C/Holes.cs +++ b/Assets/Desert/Runtime/Puzzle C/Holes.cs @@ -82,7 +82,7 @@ namespace EscapeRoomEngine.Desert.Runtime.Puzzle_C } else { - throw new EngineException("Terminal was not assigned a related Ball."); + throw new EngineException("Holes were not assigned a related Dispenser."); } } } diff --git a/Assets/Engine/Assets/Requirements/Place With Related Module.asset b/Assets/Engine/Assets/Requirements/Place With Related Module.asset new file mode 100644 index 0000000..11e226d --- /dev/null +++ b/Assets/Engine/Assets/Requirements/Place With Related Module.asset @@ -0,0 +1,14 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 406f215d83114f4c9b3a92c8a0ea8d73, type: 3} + m_Name: Place With Related Module + m_EditorClassIdentifier: diff --git a/Assets/Engine/Assets/Requirements/Place With Related Module.asset.meta b/Assets/Engine/Assets/Requirements/Place With Related Module.asset.meta new file mode 100644 index 0000000..4e94515 --- /dev/null +++ b/Assets/Engine/Assets/Requirements/Place With Related Module.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be3144e12a689e84fbfe2ce50f61dcc7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Engine/Runtime/Requirements/PlaceWithRelatedModule.cs b/Assets/Engine/Runtime/Requirements/PlaceWithRelatedModule.cs new file mode 100644 index 0000000..1095890 --- /dev/null +++ b/Assets/Engine/Runtime/Requirements/PlaceWithRelatedModule.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using System.Linq; +using EscapeRoomEngine.Engine.Runtime.Modules; +using NaughtyAttributes; +using UnityEngine; + +namespace EscapeRoomEngine.Engine.Runtime.Requirements +{ + [CreateAssetMenu(menuName = "Requirements/Place With Related Module")] + public class PlaceWithRelatedModule : PlacementRequirement + { + protected override List FilterCandidates(List candidates, Module module, Space space) + { + return new List { module.relatedModules[0].srPlacement }; + } + } +} \ No newline at end of file diff --git a/Assets/Engine/Runtime/Requirements/PlaceWithRelatedModule.cs.meta b/Assets/Engine/Runtime/Requirements/PlaceWithRelatedModule.cs.meta new file mode 100644 index 0000000..b379936 --- /dev/null +++ b/Assets/Engine/Runtime/Requirements/PlaceWithRelatedModule.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 406f215d83114f4c9b3a92c8a0ea8d73 +timeCreated: 1670537230 \ No newline at end of file diff --git a/Assets/Engine/Runtime/SpaceTile.cs b/Assets/Engine/Runtime/SpaceTile.cs index 4546abc..9b79ed3 100644 --- a/Assets/Engine/Runtime/SpaceTile.cs +++ b/Assets/Engine/Runtime/SpaceTile.cs @@ -1,6 +1,6 @@ +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using EscapeRoomEngine.Engine.Runtime.Utilities; using NaughtyAttributes; using UnityEngine; @@ -14,6 +14,13 @@ namespace EscapeRoomEngine.Engine.Runtime SW, S, SE } + [Serializable] + public struct TilePrefab + { + public TileLocation location; + public GameObject prefab; + } + public class SpaceTile : MonoBehaviour { public static HashSet EveryTileLocation => new(new[] @@ -24,7 +31,7 @@ namespace EscapeRoomEngine.Engine.Runtime }); [BoxGroup("Style Prefabs")] [SerializeField] - private UDictionary tilePrefabs; + private List tilePrefabs; [BoxGroup("Style Prefabs")] [SerializeField] private Material material; @@ -53,9 +60,13 @@ namespace EscapeRoomEngine.Engine.Runtime Destroy(_tile); } - _tile = Instantiate(tilePrefabs[showTile], transform); + _tile = Instantiate(tilePrefabs.Find(tilePrefab => tilePrefab.location == showTile).prefab, transform); _tile.isStatic = true; _tile.GetComponent().material = material; + + var tileCollider = _tile.AddComponent(); + tileCollider.convex = true; + tileCollider.sharedMesh = _tile.GetComponent().sharedMesh; _showTile = showTile; } diff --git a/Assets/Engine/Runtime/Utilities/UDictionary.cs b/Assets/Engine/Runtime/Utilities/UDictionary.cs deleted file mode 100644 index c3ce6b3..0000000 --- a/Assets/Engine/Runtime/Utilities/UDictionary.cs +++ /dev/null @@ -1,449 +0,0 @@ -// https://gist.github.com/Moe-Baker/e36610361012d586b1393994febeb5d2 - -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEditor; -using UnityEditorInternal; -using UnityEngine; - -namespace EscapeRoomEngine.Engine.Runtime.Utilities -{ - [Serializable] - public class UDictionary - { - public class SplitAttribute : PropertyAttribute - { - public float Key { get; protected set; } - public float Value { get; protected set; } - - public SplitAttribute(float key, float value) - { - this.Key = key; - this.Value = value; - } - } - -#if UNITY_EDITOR - [CustomPropertyDrawer(typeof(SplitAttribute), true)] - [CustomPropertyDrawer(typeof(UDictionary), true)] - public class Drawer : PropertyDrawer - { - SerializedProperty property; - - public bool IsExpanded - { - get => property.isExpanded; - set => property.isExpanded = value; - } - - SerializedProperty keys; - SerializedProperty values; - - public bool IsAligned => keys.arraySize == values.arraySize; - - ReorderableList list; - - GUIContent label; - - SplitAttribute split; - - public float KeySplit => split == null ? 30f : split.Key; - public float ValueSplit => split == null ? 70f : split.Value; - - public static float SingleLineHeight => EditorGUIUtility.singleLineHeight; - - public const float ElementHeightPadding = 6f; - public const float ElementSpacing = 10f; - public const float ElementFoldoutPadding = 20f; - - public const float TopPadding = 5f; - public const float BottomPadding = 5f; - - void Init(SerializedProperty value) - { - if (SerializedProperty.EqualContents(value, property)) return; - - property = value; - - keys = property.FindPropertyRelative(nameof(keys)); - values = property.FindPropertyRelative(nameof(values)); - - split = attribute as SplitAttribute; - - list = new ReorderableList(property.serializedObject, keys, true, true, true, true); - - list.drawHeaderCallback = DrawHeader; - - list.onAddCallback = Add; - list.onRemoveCallback = Remove; - - list.elementHeightCallback = GetElementHeight; - - list.drawElementCallback = DrawElement; - - list.onReorderCallbackWithDetails += Reorder; - } - - public override float GetPropertyHeight(SerializedProperty property, GUIContent label) - { - Init(property); - - var height = TopPadding + BottomPadding; - - if (IsAligned) - height += IsExpanded ? list.GetHeight() : list.headerHeight; - else - height += SingleLineHeight; - - return height; - } - - public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label) - { - label.text = $" {label.text}"; - - this.label = label; - - Init(property); - - rect = EditorGUI.IndentedRect(rect); - - rect.y += TopPadding; - rect.height -= TopPadding + BottomPadding; - - if (IsAligned == false) - { - DrawAlignmentWarning(ref rect); - return; - } - - if (IsExpanded) - DrawList(ref rect); - else - DrawCompleteHeader(ref rect); - } - - void DrawList(ref Rect rect) - { - EditorGUIUtility.labelWidth = 80f; - EditorGUIUtility.fieldWidth = 80f; - - list.DoList(rect); - } - - void DrawAlignmentWarning(ref Rect rect) - { - var width = 80f; - var spacing = 5f; - - rect.width -= width; - - EditorGUI.HelpBox(rect, " Misalignment Detected", MessageType.Error); - - rect.x += rect.width + spacing; - rect.width = width - spacing; - - if (GUI.Button(rect, "Fix")) - { - if (keys.arraySize > values.arraySize) - { - var difference = keys.arraySize - values.arraySize; - - for (int i = 0; i < difference; i++) - keys.DeleteArrayElementAtIndex(keys.arraySize - 1); - } - else if (keys.arraySize < values.arraySize) - { - var difference = values.arraySize - keys.arraySize; - - for (int i = 0; i < difference; i++) - values.DeleteArrayElementAtIndex(values.arraySize - 1); - } - } - } - - #region Draw Header - - void DrawHeader(Rect rect) - { - rect.x += 10f; - - IsExpanded = EditorGUI.Foldout(rect, IsExpanded, label, true); - } - - void DrawCompleteHeader(ref Rect rect) - { - ReorderableList.defaultBehaviours.DrawHeaderBackground(rect); - - rect.x += 6; - rect.y += 0; - - DrawHeader(rect); - } - - #endregion - - float GetElementHeight(int index) - { - SerializedProperty key = keys.GetArrayElementAtIndex(index); - SerializedProperty value = values.GetArrayElementAtIndex(index); - - var kHeight = GetChildernSingleHeight(key); - var vHeight = GetChildernSingleHeight(value); - - var max = Math.Max(kHeight, vHeight); - - if (max < SingleLineHeight) max = SingleLineHeight; - - return max + ElementHeightPadding; - } - - #region Draw Element - - void DrawElement(Rect rect, int index, bool isActive, bool isFocused) - { - rect.height -= ElementHeightPadding; - rect.y += ElementHeightPadding / 2; - - var areas = Split(rect, KeySplit, ValueSplit); - - DrawKey(areas[0], index); - DrawValue(areas[1], index); - } - - void DrawKey(Rect rect, int index) - { - var property = keys.GetArrayElementAtIndex(index); - - rect.x += ElementSpacing / 2f; - rect.width -= ElementSpacing; - - DrawField(rect, property); - } - - void DrawValue(Rect rect, int index) - { - var property = values.GetArrayElementAtIndex(index); - - rect.x += ElementSpacing / 2f; - rect.width -= ElementSpacing; - - DrawField(rect, property); - } - - void DrawField(Rect rect, SerializedProperty property) - { - rect.height = SingleLineHeight; - - if (IsInline(property)) - { - EditorGUI.PropertyField(rect, property, GUIContent.none); - } - else - { - rect.x += ElementSpacing / 2f; - rect.width -= ElementSpacing; - - foreach (var child in IterateChildern(property)) - { - EditorGUI.PropertyField(rect, child, false); - - rect.y += SingleLineHeight + +2f; - } - } - } - - #endregion - - void Reorder(ReorderableList list, int oldIndex, int newIndex) - { - values.MoveArrayElement(oldIndex, newIndex); - } - - void Add(ReorderableList list) - { - values.InsertArrayElementAtIndex(values.arraySize); - - ReorderableList.defaultBehaviours.DoAddButton(list); - } - - void Remove(ReorderableList list) - { - values.DeleteArrayElementAtIndex(list.index); - - ReorderableList.defaultBehaviours.DoRemoveButton(list); - } - - //Static Utility - static Rect[] Split(Rect source, params float[] cuts) - { - var rects = new Rect[cuts.Length]; - - var x = 0f; - - for (int i = 0; i < cuts.Length; i++) - { - rects[i] = new Rect(source); - - rects[i].x += x; - rects[i].width *= cuts[i] / 100; - - x += rects[i].width; - } - - return rects; - } - - static bool IsInline(SerializedProperty property) - { - switch (property.propertyType) - { - case SerializedPropertyType.Generic: - return property.hasVisibleChildren == false; - } - - return true; - } - - static IEnumerable IterateChildern(SerializedProperty property) - { - var path = property.propertyPath; - - property.Next(true); - - while (true) - { - yield return property; - - if (property.NextVisible(false) == false) break; - if (property.propertyPath.StartsWith(path) == false) break; - } - } - - float GetChildernSingleHeight(SerializedProperty property) - { - if (IsInline(property)) return SingleLineHeight; - - var height = 0f; - - foreach (var child in IterateChildern(property)) - height += SingleLineHeight + 2f; - - return height; - } - } -#endif - } - - [Serializable] - public class UDictionary : UDictionary, IDictionary - { - [SerializeField] List keys; - public List Keys => keys; - ICollection IDictionary.Keys => keys; - - [SerializeField] List values; - public List Values => values; - ICollection IDictionary.Values => values; - - public int Count => keys.Count; - - public bool IsReadOnly => false; - - Dictionary cache; - - public bool Cached => cache != null; - - public Dictionary Dictionary - { - get - { - if (cache == null) - { - cache = new Dictionary(); - - for (int i = 0; i < keys.Count; i++) - { - if (keys[i] == null) continue; - if (cache.ContainsKey(keys[i])) continue; - - cache.Add(keys[i], values[i]); - } - } - - return cache; - } - } - - public TValue this[TKey key] - { - get => Dictionary[key]; - set - { - var index = keys.IndexOf(key); - - if (index < 0) - { - Add(key, value); - } - else - { - values[index] = value; - if (Cached) Dictionary[key] = value; - } - } - } - - public bool TryGetValue(TKey key, out TValue value) => Dictionary.TryGetValue(key, out value); - - public bool ContainsKey(TKey key) => Dictionary.ContainsKey(key); - public bool Contains(KeyValuePair item) => ContainsKey(item.Key); - - public void Add(TKey key, TValue value) - { - keys.Add(key); - values.Add(value); - - if (Cached) Dictionary.Add(key, value); - } - - public void Add(KeyValuePair item) => Add(item.Key, item.Value); - - public bool Remove(TKey key) - { - var index = keys.IndexOf(key); - - if (index < 0) return false; - - keys.RemoveAt(index); - values.RemoveAt(index); - - if (Cached) Dictionary.Remove(key); - - return true; - } - - public bool Remove(KeyValuePair item) => Remove(item.Key); - - public void Clear() - { - keys.Clear(); - values.Clear(); - - if (Cached) Dictionary.Clear(); - } - - public void CopyTo(KeyValuePair[] array, int arrayIndex) => - (Dictionary as IDictionary).CopyTo(array, arrayIndex); - - public IEnumerator> GetEnumerator() => Dictionary.GetEnumerator(); - IEnumerator IEnumerable.GetEnumerator() => Dictionary.GetEnumerator(); - - public UDictionary() - { - values = new List(); - keys = new List(); - } - } -} \ No newline at end of file diff --git a/Assets/Engine/Runtime/Utilities/UDictionary.cs.meta b/Assets/Engine/Runtime/Utilities/UDictionary.cs.meta deleted file mode 100644 index dbaabe8..0000000 --- a/Assets/Engine/Runtime/Utilities/UDictionary.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 238265e493429c44ebcd511153a19322 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Gizmos/EscapeRoomEngine/Engine/Runtime/Requirements/PlaceWithRelatedModule icon.png b/Assets/Gizmos/EscapeRoomEngine/Engine/Runtime/Requirements/PlaceWithRelatedModule icon.png new file mode 100644 index 0000000..727b08d --- /dev/null +++ b/Assets/Gizmos/EscapeRoomEngine/Engine/Runtime/Requirements/PlaceWithRelatedModule icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:705adb124719582a5c198210f6add197d02ab3f80aa57604fdfcb8bf70e6003c +size 1036 diff --git a/Assets/Gizmos/EscapeRoomEngine/Engine/Runtime/Requirements/PlaceWithRelatedModule icon.png.meta b/Assets/Gizmos/EscapeRoomEngine/Engine/Runtime/Requirements/PlaceWithRelatedModule icon.png.meta new file mode 100644 index 0000000..2d2d2b9 --- /dev/null +++ b/Assets/Gizmos/EscapeRoomEngine/Engine/Runtime/Requirements/PlaceWithRelatedModule icon.png.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 414b94700c9b4f419c6415f60e5dfb2a +timeCreated: 1670537525 \ No newline at end of file