From 9af52ba043082d9588adb1cbd7fd2329f18f2f60 Mon Sep 17 00:00:00 2001 From: Braedon Date: Sun, 16 Jan 2022 17:51:57 -0500 Subject: [PATCH] Game event selector broken, unity ui fucking sucks --- .../Sprites/Editor/ui/GameEventArrow.png | Bin 0 -> 3585 bytes .../Sprites/Editor/ui/GameEventArrow.png.meta | 96 +++ Assets/Scenes/Editor.unity | 554 ++++++++++++++---- Assets/Scripts/LevelEditor/BoxSelection.cs | 2 - .../Scripts/LevelEditor/GridGameSelector.cs | 71 ++- Assets/Scripts/LevelEditor/Selections.cs | 11 + 6 files changed, 610 insertions(+), 124 deletions(-) create mode 100644 Assets/Resources/Sprites/Editor/ui/GameEventArrow.png create mode 100644 Assets/Resources/Sprites/Editor/ui/GameEventArrow.png.meta diff --git a/Assets/Resources/Sprites/Editor/ui/GameEventArrow.png b/Assets/Resources/Sprites/Editor/ui/GameEventArrow.png new file mode 100644 index 0000000000000000000000000000000000000000..37fa820333d7d7e78c7ef385972de51d87612fe8 GIT binary patch literal 3585 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 Qss5xnJG#>I?EUxs0r#QT2><{9 literal 0 HcmV?d00001 diff --git a/Assets/Resources/Sprites/Editor/ui/GameEventArrow.png.meta b/Assets/Resources/Sprites/Editor/ui/GameEventArrow.png.meta new file mode 100644 index 00000000..89911038 --- /dev/null +++ b/Assets/Resources/Sprites/Editor/ui/GameEventArrow.png.meta @@ -0,0 +1,96 @@ +fileFormatVersion: 2 +guid: b7a1fac8b59b4d14289fa198206ef47e +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: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + 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/Assets/Scenes/Editor.unity b/Assets/Scenes/Editor.unity index 42c8dbcb..4dc61a00 100644 --- a/Assets/Scenes/Editor.unity +++ b/Assets/Scenes/Editor.unity @@ -261,7 +261,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &93132553 RectTransform: m_ObjectHideFlags: 0 @@ -609,8 +609,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: 6.940094, y: 2} - m_SizeDelta: {x: 13.88, y: 49.92} + m_AnchoredPosition: {x: -289.15, y: 2} + m_SizeDelta: {x: -578.29, y: 49.92} m_Pivot: {x: 0.5, y: 0} --- !u!114 &156962255 MonoBehaviour: @@ -1060,6 +1060,140 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 238901180} m_CullTransparentMesh: 1 +--- !u!1 &246861488 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 246861489} + - component: {fileID: 246861491} + - component: {fileID: 246861490} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &246861489 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 246861488} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 575663593} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 120.754, y: 291.348} + m_SizeDelta: {x: 538.241, y: 35.293} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &246861490 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 246861488} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Select events for "Game Manager" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 35949c950a936b744936efd75ae436ea, type: 2} + m_sharedMaterial: {fileID: -212896991529246517, guid: 35949c950a936b744936efd75ae436ea, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24.3 + m_fontSizeBase: 24.3 + m_fontWeight: 400 + m_enableAutoSizing: 1 + m_fontSizeMin: 8 + m_fontSizeMax: 24.3 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 1024 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &246861491 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 246861488} + m_CullTransparentMesh: 1 --- !u!1 &258006091 GameObject: m_ObjectHideFlags: 0 @@ -1505,6 +1639,7 @@ GameObject: m_Component: - component: {fileID: 358789044} - component: {fileID: 358789045} + - component: {fileID: 358789046} m_Layer: 5 m_Name: Content m_TagString: Untagged @@ -1523,14 +1658,14 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 1149103345} + - {fileID: 1549727852} m_Father: {fileID: 590210126} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -0.0000076293945, y: 0} + m_AnchoredPosition: {x: 3.4249878, y: -20.69043} + m_SizeDelta: {x: -6.849988, y: -41.380432} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &358789045 MonoBehaviour: @@ -1539,7 +1674,7 @@ MonoBehaviour: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 358789043} - m_Enabled: 1 + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} m_Name: @@ -1558,6 +1693,20 @@ MonoBehaviour: m_ChildScaleWidth: 0 m_ChildScaleHeight: 1 m_ReverseArrangement: 0 +--- !u!114 &358789046 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 358789043} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3312d7739989d2b4e91e6319e9a96d76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: {x: 0, y: 0, z: 0, w: 0} + m_Softness: {x: 0, y: 0} --- !u!1 &411779173 GameObject: m_ObjectHideFlags: 0 @@ -2310,6 +2459,157 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 558010759} m_CullTransparentMesh: 1 +--- !u!1 &566999362 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 566999363} + - component: {fileID: 566999365} + - component: {fileID: 566999364} + m_Layer: 5 + m_Name: Seperator_Top + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &566999363 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 566999362} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1050802356} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 2} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &566999364 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 566999362} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &566999365 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 566999362} + m_CullTransparentMesh: 1 +--- !u!1 &575663592 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 575663593} + - component: {fileID: 575663595} + - component: {fileID: 575663594} + m_Layer: 5 + m_Name: Seperator_Bottom + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &575663593 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 575663592} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 246861489} + m_Father: {fileID: 1050802356} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 2} + m_Pivot: {x: 0.5, y: 0} +--- !u!114 &575663594 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 575663592} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &575663595 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 575663592} + m_CullTransparentMesh: 1 --- !u!1 &580861937 GameObject: m_ObjectHideFlags: 0 @@ -2530,6 +2830,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 590210126} + - component: {fileID: 590210127} m_Layer: 5 m_Name: Holder m_TagString: Untagged @@ -2548,16 +2849,29 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 841081096} - {fileID: 358789044} m_Father: {fileID: 1056099132} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: -13039.025} + m_SizeDelta: {x: 0, y: 26078.07} m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &590210127 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 590210125} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3312d7739989d2b4e91e6319e9a96d76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: {x: 0, y: 0, z: 0, w: 41.38} + m_Softness: {x: 0, y: 0} --- !u!1 &608588497 GameObject: m_ObjectHideFlags: 0 @@ -2720,6 +3034,81 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: -20, y: -20} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &643814082 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 643814083} + - component: {fileID: 643814085} + - component: {fileID: 643814084} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &643814083 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 643814082} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1056099132} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -0.00012207031, y: -41.38065} + m_SizeDelta: {x: -40, y: 2} + m_Pivot: {x: 0.5, y: 0} +--- !u!114 &643814084 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 643814082} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &643814085 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 643814082} + m_CullTransparentMesh: 1 --- !u!1 &660967736 GameObject: m_ObjectHideFlags: 0 @@ -3835,18 +4224,18 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 841081095} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 590210126} + m_Father: {fileID: 1549727852} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 24.850006, y: -42.509995} - m_SizeDelta: {x: 15, y: 15} - m_Pivot: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -60} + m_SizeDelta: {x: 35, y: 35} + m_Pivot: {x: 0, y: 0} --- !u!114 &841081097 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3867,7 +4256,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 21300000, guid: e3b85a6fda50d2343a8dfb2fc70c2b32, type: 3} + m_Sprite: {fileID: 21300000, guid: b7a1fac8b59b4d14289fa198206ef47e, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -4643,6 +5032,8 @@ RectTransform: - {fileID: 1154875943} - {fileID: 1056099132} - {fileID: 1997273393} + - {fileID: 566999363} + - {fileID: 575663593} m_Father: {fileID: 1791483803} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -4683,13 +5074,14 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 590210126} + - {fileID: 643814083} m_Father: {fileID: 1050802356} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 120.81002, y: 26.952806} - m_SizeDelta: {x: 578.36, y: 260.16} + m_AnchoredPosition: {x: 120.81002, y: -0.0011005} + m_SizeDelta: {x: 578.36, y: 314.07} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1056099133 MonoBehaviour: @@ -5075,18 +5467,18 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1149103344} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 358789044} - m_RootOrder: 0 + m_Father: {fileID: 1549727852} + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 205.495, y: -42.510002} - m_SizeDelta: {x: 320.99, y: 25.02} - m_Pivot: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 45, y: -60} + m_SizeDelta: {x: 320, y: 35} + m_Pivot: {x: 0, y: 0} --- !u!114 &1149103346 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5134,15 +5526,15 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 21.69 - m_fontSizeBase: 21.69 + m_fontSize: 25 + m_fontSizeBase: 25 m_fontWeight: 400 m_enableAutoSizing: 0 m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 m_HorizontalAlignment: 1 - m_VerticalAlignment: 256 + m_VerticalAlignment: 512 m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 @@ -5221,8 +5613,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} - m_AnchoredPosition: {x: -288.675, y: 26.954} - m_SizeDelta: {x: -577.35, y: 260.16} + m_AnchoredPosition: {x: -288.675, y: 25.955} + m_SizeDelta: {x: -577.35, y: 258.16} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1154875944 MonoBehaviour: @@ -5303,6 +5695,8 @@ MonoBehaviour: EventRef: {fileID: 1149103344} CurrentSelected: {fileID: 841081095} currentEventIndex: 0 + posDif: 15 + ignoreSelectCount: 2 --- !u!1 &1196204502 GameObject: m_ObjectHideFlags: 0 @@ -6865,7 +7259,7 @@ MonoBehaviour: m_EditorClassIdentifier: snap: 1 count: 0 ---- !u!1 &1556269003 +--- !u!1 &1549727851 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -6873,97 +7267,35 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1556269007} - - component: {fileID: 1556269006} - - component: {fileID: 1556269005} - - component: {fileID: 1556269004} + - component: {fileID: 1549727852} m_Layer: 5 - m_Name: BoxSelectionCanvas + m_Name: GameObject m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &1556269004 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1556269003} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &1556269005 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1556269003} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 1 ---- !u!223 &1556269006 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1556269003} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 2 - m_Camera: {fileID: 2047408675} - m_PlaneDistance: 100 - m_PixelPerfect: 1 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 - m_SortingLayerID: 0 - m_SortingOrder: 10 - m_TargetDisplay: 0 ---- !u!224 &1556269007 +--- !u!224 &1549727852 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1556269003} + m_GameObject: {fileID: 1549727851} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 4 + m_Children: + - {fileID: 841081096} + - {fileID: 1149103345} + m_Father: {fileID: 358789044} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 1280, y: 720} - m_Pivot: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -99999} + m_SizeDelta: {x: 0, y: 99999} + m_Pivot: {x: 0, y: 0} --- !u!1 &1567318395 GameObject: m_ObjectHideFlags: 0 @@ -8900,10 +9232,10 @@ RectTransform: m_Father: {fileID: 1050802356} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -168.316, y: 27} - m_SizeDelta: {x: 2, y: 247.81} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: -168.316, y: 0} + m_SizeDelta: {x: 2, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1997273394 MonoBehaviour: diff --git a/Assets/Scripts/LevelEditor/BoxSelection.cs b/Assets/Scripts/LevelEditor/BoxSelection.cs index 2d624468..3e4e2364 100644 --- a/Assets/Scripts/LevelEditor/BoxSelection.cs +++ b/Assets/Scripts/LevelEditor/BoxSelection.cs @@ -123,8 +123,6 @@ namespace RhythmHeavenMania.Editor if (selectionBox.Overlaps(GetWorldRect(e.GetComponent()))) { - print(selectionBox); - print(GetWorldRect(e.GetComponent())); Selections.instance.DragSelect(e); selected++; } diff --git a/Assets/Scripts/LevelEditor/GridGameSelector.cs b/Assets/Scripts/LevelEditor/GridGameSelector.cs index a751a295..2384a6ef 100644 --- a/Assets/Scripts/LevelEditor/GridGameSelector.cs +++ b/Assets/Scripts/LevelEditor/GridGameSelector.cs @@ -23,6 +23,8 @@ namespace RhythmHeavenMania.Editor private bool gameOpen; [SerializeField] private int currentEventIndex; private int dragTimes; + public float posDif; + public int ignoreSelectCount; private void Update() { @@ -30,13 +32,18 @@ namespace RhythmHeavenMania.Editor { if (Input.GetKeyDown(KeyCode.DownArrow)) { - UpdateIndex(1); + UpdateIndex(currentEventIndex + 1); } else if (Input.GetKeyDown(KeyCode.UpArrow)) { - UpdateIndex(-1); + UpdateIndex(currentEventIndex - 1); } } + + if (Input.mouseScrollDelta.y != 0) + { + UpdateIndex(currentEventIndex - Mathf.RoundToInt(Input.mouseScrollDelta.y)); + } } #region Events @@ -72,27 +79,67 @@ namespace RhythmHeavenMania.Editor public void UpdateIndex(int amount) { - currentEventIndex += amount; + currentEventIndex = amount; + + EventRef.transform.parent.parent.DOKill(); + CurrentSelected.transform.DOKill(); if (currentEventIndex < 0) { - currentEventIndex = EventRef.transform.parent.childCount - 2; + currentEventIndex = EventRef.transform.parent.childCount - (ignoreSelectCount + 1); } - else if (currentEventIndex > EventRef.transform.parent.childCount - 2) + else if (currentEventIndex > EventRef.transform.parent.childCount - (ignoreSelectCount + 1)) { currentEventIndex = 0; } if (currentEventIndex > 2) { - EventRef.transform.parent.parent.transform.DOLocalMoveY((EventRef.GetComponent().sizeDelta.y + 5) * (currentEventIndex - 2), 0.35f).SetEase(Ease.OutExpo); + if (EventRef.transform.parent.childCount - ignoreSelectCount - 4 > currentEventIndex) + { + EventRef.transform.parent.parent.DOLocalMoveY((EventRef.GetComponent().sizeDelta.y + 5) * (currentEventIndex - 2), 0.35f).SetEase(Ease.OutExpo); + } + else + { + EventRef.transform.parent.parent.DOLocalMoveY((EventRef.GetComponent().sizeDelta.y + 5) * (EventRef.transform.parent.childCount - 9), 0.35f).SetEase(Ease.OutExpo); + } } else { EventRef.transform.parent.parent.transform.DOLocalMoveY(0, 0.35f).SetEase(Ease.OutExpo); } - CurrentSelected.transform.DOLocalMoveY(EventRef.transform.parent.GetChild(currentEventIndex + 1).transform.localPosition.y, 0.35f).SetEase(Ease.OutExpo); + for (int i = ignoreSelectCount; i < EventRef.transform.parent.childCount; i++) + { + float easeTime = 0.35f; + Ease ease = Ease.OutCirc; + int curIndex = currentEventIndex + ignoreSelectCount; + + EventRef.transform.parent.GetChild(i).DOKill(); + + EventRef.transform.parent.GetChild(i).localPosition = new Vector3(EventRef.transform.parent.GetChild(i).localPosition.x, EventRef.transform.localPosition.y - ((i - ignoreSelectCount) * EventRef.GetComponent().sizeDelta.y)); + + if (i < curIndex) + { + EventRef.transform.parent.GetChild(i).transform.DOLocalMove(new Vector3 + (EventRef.transform.localPosition.x + (posDif), + EventRef.transform.parent.GetChild(i).transform.localPosition.y), easeTime).SetEase(ease); + } + else if (i > curIndex) + { + EventRef.transform.parent.GetChild(i).transform.DOLocalMove(new Vector3 + (EventRef.transform.localPosition.x + (posDif), + EventRef.transform.parent.GetChild(i).transform.localPosition.y), easeTime).SetEase(ease); + } + else if (i == curIndex) + { + EventRef.transform.parent.GetChild(i).transform.DOLocalMove(new Vector3 + (EventRef.transform.localPosition.x, + EventRef.transform.parent.GetChild(i).transform.localPosition.y), easeTime).SetEase(ease); + } + } + + CurrentSelected.transform.DOLocalMoveY(EventRef.transform.parent.GetChild(currentEventIndex + ignoreSelectCount).transform.localPosition.y, 0.35f).SetEase(Ease.OutExpo); SetColor(currentEventIndex); } @@ -110,8 +157,10 @@ namespace RhythmHeavenMania.Editor AddEvents(); gameOpen = true; + currentEventIndex = 0; - SetColor(0); + + UpdateIndex(0); } private void AddEvents() @@ -136,12 +185,12 @@ namespace RhythmHeavenMania.Editor private void SetColor(int ind) { - for (int i = 0; i < EventRef.transform.parent.childCount; i++) + for (int i = ignoreSelectCount; i < EventRef.transform.parent.childCount; i++) { EventRef.transform.parent.GetChild(i).GetComponent().color = EditorTheme.theme.properties.EventNormalCol.Hex2RGB(); } - EventRef.transform.parent.GetChild(ind + 1).GetComponent().color = EditorTheme.theme.properties.EventSelectedCol.Hex2RGB(); + EventRef.transform.parent.GetChild(ind + ignoreSelectCount).GetComponent().color = EditorTheme.theme.properties.EventSelectedCol.Hex2RGB(); CurrentSelected.GetComponent().color = EditorTheme.theme.properties.EventSelectedCol.Hex2RGB(); } @@ -152,7 +201,7 @@ namespace RhythmHeavenMania.Editor transform.GetChild(i).GetChild(0).gameObject.SetActive(false); } - for (int i = 1; i < EventRef.transform.parent.childCount; i++) + for (int i = ignoreSelectCount; i < EventRef.transform.parent.childCount; i++) { Destroy(EventRef.transform.parent.GetChild(i).gameObject); } diff --git a/Assets/Scripts/LevelEditor/Selections.cs b/Assets/Scripts/LevelEditor/Selections.cs index 82386c9e..675ad226 100644 --- a/Assets/Scripts/LevelEditor/Selections.cs +++ b/Assets/Scripts/LevelEditor/Selections.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using System.Linq; using UnityEngine; namespace RhythmHeavenMania.Editor @@ -15,6 +16,16 @@ namespace RhythmHeavenMania.Editor instance = this; } + private void Update() + { + var buggedSelections = eventsSelected.FindAll(c => c == null); + if (buggedSelections.Count > 0) + { + for (int i = 0; i < buggedSelections.Count; i++) + Deselect(buggedSelections[i]); + } + } + public void ClickSelect(TimelineEventObj eventToAdd) { DeselectAll();