From b66d30dac84a4b5b52f2d732bd3d4816f9b7fbdc Mon Sep 17 00:00:00 2001 From: thomasbousquet Date: Sun, 22 Oct 2023 00:05:10 +0200 Subject: [PATCH 1/4] Added: * EditorModeOverlay: a ToolbarOverlay that offers the same functionality as the Edit Mode GUI found before; plus a button to toggle Realtime CSG On/Off. * Icons for each edit mode Modified * CSGSettings: added a static Action iinvoked when EnableRealtimeCSG value changes. * EditModeManager: Added an Action invoked when the EditMode changes. Added a static property to access it from other classes. * EditModeSelection.GUI: surrounded the display of the former Area by #if !UNITY_2021_3_OR_NEWER so it isn't displayed beyond this version * CSG_GUIStyleUtility: move the initialization of BrushEditModeContent and brushEditModeTooltips in a separate static function, so they can be called separately and used from EditorModeOverlay. --- Plugins/Editor/Resources/GUI/CSG_Icon.png | Bin 0 -> 1398 bytes .../Editor/Resources/GUI/CSG_Icon.png.meta | 127 ++++++++++++++++ Plugins/Editor/Resources/GUI/CSG_Icon_off.png | Bin 0 -> 1293 bytes .../Resources/GUI/CSG_Icon_off.png.meta | 127 ++++++++++++++++ Plugins/Editor/Resources/GUI/Clip.png | Bin 0 -> 3763 bytes Plugins/Editor/Resources/GUI/Clip.png.meta | 127 ++++++++++++++++ Plugins/Editor/Resources/GUI/Edit.png | Bin 0 -> 2981 bytes Plugins/Editor/Resources/GUI/Edit.png.meta | 127 ++++++++++++++++ Plugins/Editor/Resources/GUI/Generate.png | Bin 0 -> 402 bytes .../Editor/Resources/GUI/Generate.png.meta | 127 ++++++++++++++++ Plugins/Editor/Resources/GUI/Place.png | Bin 0 -> 3534 bytes Plugins/Editor/Resources/GUI/Place.png.meta | 127 ++++++++++++++++ Plugins/Editor/Resources/GUI/Surface.png | Bin 0 -> 192 bytes Plugins/Editor/Resources/GUI/Surface.png.meta | 127 ++++++++++++++++ .../Scripts/Data/Settings/CSGSettings.cs | 2 + .../View/GUI/EditModeGUI/EditModeManager.cs | 22 ++- .../GUI/EditModeGUI/EditModeSelection.GUI.cs | 5 +- .../Scripts/View/GUI/EditModeGUI/Overlay.meta | 8 + .../EditModeGUI/Overlay/EditorModeOverlay.cs | 139 ++++++++++++++++++ .../Overlay/EditorModeOverlay.cs.meta | 11 ++ .../View/GUI/Utility/CSG_GUIStyleUtility.cs | 41 +++--- 21 files changed, 1096 insertions(+), 21 deletions(-) create mode 100644 Plugins/Editor/Resources/GUI/CSG_Icon.png create mode 100644 Plugins/Editor/Resources/GUI/CSG_Icon.png.meta create mode 100644 Plugins/Editor/Resources/GUI/CSG_Icon_off.png create mode 100644 Plugins/Editor/Resources/GUI/CSG_Icon_off.png.meta create mode 100644 Plugins/Editor/Resources/GUI/Clip.png create mode 100644 Plugins/Editor/Resources/GUI/Clip.png.meta create mode 100644 Plugins/Editor/Resources/GUI/Edit.png create mode 100644 Plugins/Editor/Resources/GUI/Edit.png.meta create mode 100644 Plugins/Editor/Resources/GUI/Generate.png create mode 100644 Plugins/Editor/Resources/GUI/Generate.png.meta create mode 100644 Plugins/Editor/Resources/GUI/Place.png create mode 100644 Plugins/Editor/Resources/GUI/Place.png.meta create mode 100644 Plugins/Editor/Resources/GUI/Surface.png create mode 100644 Plugins/Editor/Resources/GUI/Surface.png.meta create mode 100644 Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay.meta create mode 100644 Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs create mode 100644 Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs.meta diff --git a/Plugins/Editor/Resources/GUI/CSG_Icon.png b/Plugins/Editor/Resources/GUI/CSG_Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..bd4c44abf888debd3e9a4361301d1e9519db74f0 GIT binary patch literal 1398 zcmV-+1&R8JP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!T}^$tbM2gjk4KBT$&i;AR$JRrd3}m#y*HaeDOgA5r)LJn6$J8I{IKu zYGYzeXsLArMyy?8slJ4>4pnvxP8W2YpG|$N$h3Ck`J$nLBqWe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J-*FHX!R4zc9Lff>aimb?})t2o4x*9>MBhgkAr zV0LkcB`*r;AP%wQok6;YLo9ixkxt?eOCBTL#37bEARWaa?OtBGibLA9ymS_av|D-U dE{@|k?*DK(sOLPH+4=wg002ovPDHLkV1msj*VF(2 literal 0 HcmV?d00001 diff --git a/Plugins/Editor/Resources/GUI/Clip.png.meta b/Plugins/Editor/Resources/GUI/Clip.png.meta new file mode 100644 index 0000000..93f0ee2 --- /dev/null +++ b/Plugins/Editor/Resources/GUI/Clip.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 94f02f62dd201634987d13362d598510 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Editor/Resources/GUI/Edit.png b/Plugins/Editor/Resources/GUI/Edit.png new file mode 100644 index 0000000000000000000000000000000000000000..3371dba74d389cef4dd68613ad1e6ecc331315e5 GIT binary patch literal 2981 zcmV;W3tIGvP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D3pz}Jj=B>M{r@LqB z2SvTiWTw0R{XA7qXR4Y=Boc{4B9TZW5{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WFUb%Vmrdo^7ydCn5>Y)qtAp5O7FH_-I9SLRL&VR>|i$FY@B~98sq)8XqFx$*o zqJZm?w!fSl+WvdiZaq!J-l?v0S_*OO~jm+yl?lwGv@*9^i2v z;N>-I){v&ACiYkwxKvz?ct|jQ@{Ql@yXA2;iNJypelGAbsH0!7sHCl}jr8>NsPBx= zygt;Whvnko_44v^GBh+aw~QCR*+)B;If+lKAeC^oux!~fh0dg4eF{Brmh(ifwz+$oC~IHK z#f1Lh{h>{0qZc$Q(>Z~%YSk)~bz#Wz8XFtg!*wwg#(0J+4LkV21>kDqfjY{tvRqE+ z3nYwxixw@K^EhZje+7d<^7{2__E2QK7#;Hf7Rk@8@Z`Q52V7iS%*tkWJIDsOfQdj~ zjg5_=s9Oue;vGMJTsd;&2&t;7Vv`RDr5*%>Pf)Z2c`m{yYuo}c_9Kjd$Ks*H(W6Jn zv17-~7?OTAZQ8_qHcvF>QE0F_SEpCik6zEkge^R%yTqmftUsubbFWdWR5othh_WF} zs|^7=J3C2VUmvS$T`Ay!Yp$XViL@@Xrly8$*sy_|J9o~o2Et7Bz<~owS63HvpZtKi zyU1lA7;c-vUE)qtAP^v-P>2b)dGqGXx=M*eB9TZW5{X12kw_#Gi9{liNF)-8L?V%- bf{_0M*O7<`SR5~<00000NkvXXu0mjf+r*tF literal 0 HcmV?d00001 diff --git a/Plugins/Editor/Resources/GUI/Edit.png.meta b/Plugins/Editor/Resources/GUI/Edit.png.meta new file mode 100644 index 0000000..03f7cba --- /dev/null +++ b/Plugins/Editor/Resources/GUI/Edit.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 64a6272aaf9f99b4e93489112f14934b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Editor/Resources/GUI/Generate.png b/Plugins/Editor/Resources/GUI/Generate.png new file mode 100644 index 0000000000000000000000000000000000000000..a9a99f9ff7c170651cd751bc49fb8f9109f75c8e GIT binary patch literal 402 zcmV;D0d4+?P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0VhdBK~zXf?US); z0znXlXACDu48%qYNfA&4xq#1M<@5Le>I0(|Ch)aR{xFk!w0ktgn1HE>v*>TG4JD;Ey}ckUt@(e32zdQhoUxj zXY*v*@e?4&x3DS}EyJ#1m&pGt%LQ@;Ge%s&;y1|E;OmfRB~ua(1%#f^KB|AgPA5pd z!QRcdK|V45fgs-L4Dl=M*}Nmc*i2ClN^}bIClA6%J0tE+J0`Z^cgaj~{hjdric%Jc w(iULeYGlQ?M9%z8Kxl#H3zvMQnT!mg9VS3bO8NK-`~Uy|07*qoM6N<$g8aXx6aWAK literal 0 HcmV?d00001 diff --git a/Plugins/Editor/Resources/GUI/Generate.png.meta b/Plugins/Editor/Resources/GUI/Generate.png.meta new file mode 100644 index 0000000..10cc1cf --- /dev/null +++ b/Plugins/Editor/Resources/GUI/Generate.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 4ce4e69bb7715e744bbe26968b77d2f2 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Editor/Resources/GUI/Place.png b/Plugins/Editor/Resources/GUI/Place.png new file mode 100644 index 0000000000000000000000000000000000000000..36ca05e2aba89f61803ad00ef4221ccb2ced04f6 GIT binary patch literal 3534 zcmZu!S5Om-)}$K|NJ0rMw2;u7M1c=O3!y_O8tIV|5Jj4R1f&;92q;aYe4!(#6cOo> z8U#@(VnbR8BJzP~1OW};@4fRs+_`ff_U!DOIs33LXO`@QwG!l);^*Mt5VWzzxcuR; zKOh45{>%eNqxm1=jC8R=b2Lvt*Z&Bfi)IdH92~8;P8|61{?W(7t=%IzIE04(1ih|*ZRSiM+R-Fr#i?WWy1rfI! z%yMiRzc-vyW%6dAzwx!8!C^F2yAfjAu?Es0CMWM6V&wYQOgoH3d)dLFoTxjm8KbN`3OKn2gmCb~J@e`GXkl-wz@hDpbC+0%+( z1Xif#q8;7a*g3w^`c-N;px2g`Myxc@>=06*tj!~eZj?otzGjmgAs1lA<|wx-GO6Ge z_*-XTdou2wDJ;^8B|ohZh93B9={(9MzLb<9qqaNjNbr!{LyH2{4NXz@wWs7ivHAqK zt8cr7KLj|VE;=_ueLMr*MPp*b$Vq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}wffg@6H@2KZO`d8sj1y_4nA&Rx{W5?^s+Fh$kGG4FM%7-`9_308 z!{v>=E-}*f4wp0ca_D9b`E z>rAsLUAFXLU|ZB|7n60yYoPGv$x!=Zf;>G8V@c|h$E)ae#FEF}Big0+cuchMS}^#h z;b6$UY7E0&Dt)a3T%#2l1lst>zW2uP0XMEhAe3>Bxou%wd$B6$0hfkk9x%AUf5kLN*YqO{TBWhKc=eq-4Q%U`U| z1+~Ob+#>jueH6--p$x0+>hR9e5GqbKp^D?~*B5eA$Vrg)%;4UJcWNDGG1N=Hn}aGX z4hTYyt1-L~U$O?`#jAqk(h0d0n2c!7h$n!odM5jVSi~T=Mcjw?<>9YYHnTa_$GJk; zg@Xaro7|maHru5MKFlOh$?poYgZZ%%!umtp#*v50!fGfM)T?)D_R@*PUi-2=fE7E} z{9Dpv!J)j|uCiW$qrfWi>0jWe1|n2o1e{|^{$7l1o#=00#tLmz@t7KnaRSDmxnJdF zk7P}-K$sSz7aZZ}N#{<$2YXd!1bb$dPx8^Xg|dkRJyeWY$Y8@bC(LNL+nzptw5fFc zrOxqG#`ZeSHOo!6-$n4FVbV4=Zz1FD?|pN2qj5L=G>U;p5!-y}gZUDvgXCV{};avGrP{ztF* h|9Z0wA*=i{k-pb6SC!0{^rwSy*jQjO&1j$0{{!H?c8dT2 literal 0 HcmV?d00001 diff --git a/Plugins/Editor/Resources/GUI/Place.png.meta b/Plugins/Editor/Resources/GUI/Place.png.meta new file mode 100644 index 0000000..7f1ab62 --- /dev/null +++ b/Plugins/Editor/Resources/GUI/Place.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 1fdab970e57d01d4a8e4dbf7cb4c39ff +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Editor/Resources/GUI/Surface.png b/Plugins/Editor/Resources/GUI/Surface.png new file mode 100644 index 0000000000000000000000000000000000000000..4665cbd1e307c9b8d5e979c772ada402d3398bf2 GIT binary patch literal 192 zcmeAS@N?(olHy`uVBq!ia0vp^`9NI3!VDz&EH)MZDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheYymzYuK(M0{{R2K!rns^D8gCb5m^k>d>DiokLRyQ0SY>Mx;TbJ9DaLd zBQJvj5A(qdjBobqh{|?OG24~DwpeBD OnRealtimeCSGEnabledChanged; static public void SetRealtimeCSGEnabled(bool isEnabled) { RealtimeCSG.CSGSettings.EnableRealtimeCSG = isEnabled; @@ -313,6 +314,7 @@ static public void SetRealtimeCSGEnabled(bool isEnabled) EditModeManager.UpdateTool(); RealtimeCSG.CSGSettings.UpdateWireframeModes(); RealtimeCSG.CSGSettings.Save(); + OnRealtimeCSGEnabledChanged(CSGSettings.EnableRealtimeCSG); } diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModeManager.cs b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModeManager.cs index 50be54c..17553a4 100644 --- a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModeManager.cs +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModeManager.cs @@ -25,8 +25,23 @@ internal sealed class EditModeManager : ScriptableObject public static FilteredSelection FilteredSelection { get { InitTools(); return instance.filteredSelection; } } public static IEditMode ActiveTool { get { InitTools(); return instance.activeTool; } } - - + + + Action onEditModeChanged; + + public static Action OnEditModeChanged + { + get { + InitTools(); + return instance.onEditModeChanged; + } + set + { + InitTools(); + instance.onEditModeChanged = value; + } + } + public static ToolEditMode EditMode { get @@ -39,6 +54,9 @@ public static ToolEditMode EditMode if (instance.editMode == value) return; + if(OnEditModeChanged != null) + OnEditModeChanged(value); + Undo.RecordObject(instance, "Changed edit mode"); instance.editMode = value; diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModeSelection.GUI.cs b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModeSelection.GUI.cs index db304c4..158f14c 100644 --- a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModeSelection.GUI.cs +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/EditModeSelection.GUI.cs @@ -130,7 +130,7 @@ static void OnEditModeSelectionSceneGUI() var bounds = new Rect(10, 10 + topBarSize, 500, 40); - +#if !UNITY_2021_3_OR_NEWER GUILayout.BeginArea(bounds, ContentTitleLabel, windowStyle); { //GUILayout.Space(bounds.height); @@ -164,7 +164,8 @@ static void OnEditModeSelectionSceneGUI() GUI.Label(versionArea, VersionLabel, CSG_GUIStyleUtility.versionLabelStyle); } GUILayout.EndArea(); - +#endif + int controlID = GUIUtility.GetControlID(SceneViewBrushEditorOverlayHash, FocusType.Keyboard, bounds); switch (Event.current.GetTypeForControl(controlID)) { diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay.meta b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay.meta new file mode 100644 index 0000000..3b5c2e2 --- /dev/null +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cab706ff126407449a02eb64fce2b583 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs new file mode 100644 index 0000000..da9ae40 --- /dev/null +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs @@ -0,0 +1,139 @@ +using UnityEditor; +using UnityEditor.Overlays; +using UnityEditor.Toolbars; +using UnityEngine; +using UnityEngine.UIElements; + +namespace RealtimeCSG +{ + [Overlay(typeof(SceneView), displayName: "Realtime CSG", id : _id, defaultDisplay = true)] + internal class EditorModeOverlay: ToolbarOverlay + { + public const string iconPath = "Packages/com.prenominal.realtimecsg/Plugins/Editor/Resources/GUI/"; + public const string _id = "RealtimeCSG"; + + public EditorModeOverlay() + : base( + + CSGActivateToggleButton._id, + PlaceEditorModeButton._id, + GenerateEditorModeButton._id, + EditEditorModeButton._id, + ClipEditorModeButton._id, + SurfaceEditorModeButton._id + ) + { + } + + } + + [EditorToolbarElement(_id, typeof(SceneView))] + internal class CSGActivateToggleButton : EditorToolbarToggle + { + public const string _id = EditorModeOverlay._id + "/CSGActivateToggle"; + public CSGActivateToggleButton() + { + tooltip = "Toggle CSG Realtime"; + + onIcon = AssetDatabase.LoadAssetAtPath(EditorModeOverlay.iconPath + "CSG_Icon.png"); + offIcon = AssetDatabase.LoadAssetAtPath(EditorModeOverlay.iconPath + "CSG_Icon_off.png"); + + this.RegisterValueChangedCallback(x => OnClicked()); + CSGSettings.OnRealtimeCSGEnabledChanged += OnRealtimeCSGEnabledChanged; + + value = CSGSettings.EnableRealtimeCSG; + } + + private void OnClicked() + { + RealtimeCSG.CSGSettings.SetRealtimeCSGEnabled(value); + OnRealtimeCSGEnabledChanged(value); + } + + void OnRealtimeCSGEnabledChanged(bool isEnabled) + { + value = isEnabled; + foreach (EditorModeButton button in parent.Query().ToList()) + { + button.SetEnabled(isEnabled); + } + } + } + + internal class EditorModeButton : EditorToolbarToggle + { + ToolEditMode mode; + public EditorModeButton(string iconName, ToolEditMode _mode) + { + mode = _mode; + + CSG_GUIStyleUtility.InitializeEditModeTexts(); + ToolTip tt = CSG_GUIStyleUtility.brushEditModeTooltips[(int)mode]; + tooltip = $"{tt.TitleString()}\n{tt.ContentsString()}\n{tt.KeyString()}"; + + icon = AssetDatabase.LoadAssetAtPath(EditorModeOverlay.iconPath + iconName); + + this.RegisterValueChangedCallback(x => OnClicked()); + + value = EditModeManager.EditMode == mode; + + EditModeManager.OnEditModeChanged += OnEditModeChanged; + + SetEnabled(CSGSettings.EnableRealtimeCSG); + } + + void OnEditModeChanged(ToolEditMode _mode) => SetValueWithoutNotify(_mode == mode); + + private void OnClicked() + { + //do nothing if clicking on an already clicked toggle button, and reactivate it + if (!value) + value = true; + if (value) + RealtimeCSG.CSGSettings.SetRealtimeCSGEnabled(true); + EditModeManager.EditMode = mode; + } + } + + #region Buttons class for each Mode + [EditorToolbarElement(_id, typeof(SceneView))] + internal class PlaceEditorModeButton : EditorModeButton + { + public const string _id = EditorModeOverlay._id + "/Place"; + public PlaceEditorModeButton() : base ("Place.png", ToolEditMode.Place){} + } + + + [EditorToolbarElement(_id, typeof(SceneView))] + internal class GenerateEditorModeButton : EditorModeButton + { + public const string _id = EditorModeOverlay._id + "/Generate"; + public GenerateEditorModeButton() : base("Generate.png", ToolEditMode.Generate) { } + } + + [EditorToolbarElement(_id, typeof(SceneView))] + internal class EditEditorModeButton : EditorModeButton + { + public const string _id = EditorModeOverlay._id + "/Edit"; + public EditEditorModeButton() : base("Edit.png", ToolEditMode.Edit) { } + } + + [EditorToolbarElement(_id, typeof(SceneView))] + internal class ClipEditorModeButton : EditorModeButton + { + public const string _id = EditorModeOverlay._id + "/Clip"; + public ClipEditorModeButton() : base("Clip.png", ToolEditMode.Clip) { } + } + + [EditorToolbarElement(_id, typeof(SceneView))] + internal class SurfaceEditorModeButton : EditorModeButton + { + public const string _id = EditorModeOverlay._id + "/Surfaces"; + public SurfaceEditorModeButton() : base("Surface.png", ToolEditMode.Surfaces) { } + } + + #endregion + + + +} \ No newline at end of file diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs.meta b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs.meta new file mode 100644 index 0000000..cb75e27 --- /dev/null +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f3b913e2037de6a4f9455c23e2953466 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Editor/Scripts/View/GUI/Utility/CSG_GUIStyleUtility.cs b/Plugins/Editor/Scripts/View/GUI/Utility/CSG_GUIStyleUtility.cs index c97399e..e185034 100644 --- a/Plugins/Editor/Scripts/View/GUI/Utility/CSG_GUIStyleUtility.cs +++ b/Plugins/Editor/Scripts/View/GUI/Utility/CSG_GUIStyleUtility.cs @@ -435,23 +435,7 @@ public static void InitStyles() //BottomToolBarStyle.fixedHeight = BottomToolBarHeight; - brushEditModeContent = new GUIContent[] - { - new GUIContent("Place"), - new GUIContent("Generate"), - new GUIContent("Edit"), - new GUIContent("Clip"), - new GUIContent("Surfaces") - }; - - brushEditModeTooltips = new ToolTip[] - { - new ToolTip("Place mode", "In this mode you can place, rotate and scale brushes", Keys.SwitchToObjectEditMode), - new ToolTip("Generate mode", "In this mode you can create brushes using several generators", Keys.SwitchToGenerateEditMode), - new ToolTip("Edit mode", "In this mode you can edit the shapes of brushes", Keys.SwitchToMeshEditMode), - new ToolTip("Clip mode", "In this mode you can split or clip brushes", Keys.SwitchToClipEditMode), - new ToolTip("Surfaces mode", "In this mode you can modify the texturing and everything else related to brush surfaces", Keys.SwitchToSurfaceEditMode) - }; + InitializeEditModeTexts(); var enum_type = typeof(ToolEditMode); brushEditModeNames = (from name in System.Enum.GetNames(enum_type) select ObjectNames.NicifyVariableName(name)).ToArray(); @@ -594,6 +578,29 @@ public static void InitStyles() GUI.skin = oldSkin; } + public static void InitializeEditModeTexts() + { + if (brushEditModeContent != null) + return; + + brushEditModeContent = new GUIContent[] + { + new GUIContent("Place"), + new GUIContent("Generate"), + new GUIContent("Edit"), + new GUIContent("Clip"), + new GUIContent("Surfaces") + }; + + brushEditModeTooltips = new ToolTip[] + { + new ToolTip("Place mode", "In this mode you can place, rotate and scale brushes", Keys.SwitchToObjectEditMode), + new ToolTip("Generate mode", "In this mode you can create brushes using several generators", Keys.SwitchToGenerateEditMode), + new ToolTip("Edit mode", "In this mode you can edit the shapes of brushes", Keys.SwitchToMeshEditMode), + new ToolTip("Clip mode", "In this mode you can split or clip brushes", Keys.SwitchToClipEditMode), + new ToolTip("Surfaces mode", "In this mode you can modify the texturing and everything else related to brush surfaces", Keys.SwitchToSurfaceEditMode) + }; + } public static void ResetGUIState() { GUI.skin = null; From 396856979467c243d00a311464cae77e6eb5408d Mon Sep 17 00:00:00 2001 From: thomasbousquet Date: Sun, 22 Oct 2023 00:25:18 +0200 Subject: [PATCH 2/4] Fixed: compilation and runtime failure in Unity 2020. --- Plugins/Editor/Scripts/Data/Settings/CSGSettings.cs | 3 ++- .../View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Plugins/Editor/Scripts/Data/Settings/CSGSettings.cs b/Plugins/Editor/Scripts/Data/Settings/CSGSettings.cs index 3b5e2b9..613c1c4 100644 --- a/Plugins/Editor/Scripts/Data/Settings/CSGSettings.cs +++ b/Plugins/Editor/Scripts/Data/Settings/CSGSettings.cs @@ -314,7 +314,8 @@ static public void SetRealtimeCSGEnabled(bool isEnabled) EditModeManager.UpdateTool(); RealtimeCSG.CSGSettings.UpdateWireframeModes(); RealtimeCSG.CSGSettings.Save(); - OnRealtimeCSGEnabledChanged(CSGSettings.EnableRealtimeCSG); + if(OnRealtimeCSGEnabledChanged != null) + OnRealtimeCSGEnabledChanged(CSGSettings.EnableRealtimeCSG); } diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs index da9ae40..b43dfbb 100644 --- a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs @@ -1,3 +1,4 @@ +#if UNITY_2021_3_OR_NEWER using UnityEditor; using UnityEditor.Overlays; using UnityEditor.Toolbars; @@ -95,7 +96,7 @@ private void OnClicked() } } - #region Buttons class for each Mode +#region Buttons class for each Mode [EditorToolbarElement(_id, typeof(SceneView))] internal class PlaceEditorModeButton : EditorModeButton { @@ -132,8 +133,8 @@ internal class SurfaceEditorModeButton : EditorModeButton public SurfaceEditorModeButton() : base("Surface.png", ToolEditMode.Surfaces) { } } - #endregion +#endregion - -} \ No newline at end of file +} +#endif \ No newline at end of file From b3350ef193b4f6908edb12853ca8c79112ccba7b Mon Sep 17 00:00:00 2001 From: thomasbousquet Date: Mon, 23 Oct 2023 02:22:20 +0200 Subject: [PATCH 3/4] Fix compilation error in 2021 - though setting the defaultDisplay value on OverlayTab doesn't seem to have any effect. --- .../View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs index b43dfbb..623f062 100644 --- a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs @@ -7,7 +7,12 @@ namespace RealtimeCSG { - [Overlay(typeof(SceneView), displayName: "Realtime CSG", id : _id, defaultDisplay = true)] + [Overlay(typeof(SceneView), displayName: "Realtime CSG", id : _id, defaultDisplay: true +#if !UNITY_2022_3_OR_NEWER + ,ussName: "RealtimeCSG" +#endif + )] + internal class EditorModeOverlay: ToolbarOverlay { public const string iconPath = "Packages/com.prenominal.realtimecsg/Plugins/Editor/Resources/GUI/"; From 27185ab3eb510668f63352b2f76721d4f69a5f0a Mon Sep 17 00:00:00 2001 From: thomasbousquet Date: Mon, 23 Oct 2023 02:27:02 +0200 Subject: [PATCH 4/4] Default the layout of the OverlayTab to Vertiical. --- .../Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs index 623f062..260292f 100644 --- a/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs +++ b/Plugins/Editor/Scripts/View/GUI/EditModeGUI/Overlay/EditorModeOverlay.cs @@ -10,6 +10,8 @@ namespace RealtimeCSG [Overlay(typeof(SceneView), displayName: "Realtime CSG", id : _id, defaultDisplay: true #if !UNITY_2022_3_OR_NEWER ,ussName: "RealtimeCSG" +#else + ,defaultLayout = Layout.VerticalToolbar #endif )]