From e351336b39c895299b85773d6ef036c3b4ca950a Mon Sep 17 00:00:00 2001 From: MelekTaus Moribundus Date: Mon, 29 Jun 2026 16:23:50 +0200 Subject: [PATCH] Reorganize project folders and clean up editor tooling Move editor scripts to Assets/Scripts/Editor (PlaySceneWindow, SceneCollection), move DefaultNetworkPrefabs and the Main Camera custom blends asset into Assets/Settings, and shelve the unused HeroCutout shader/include under Assets/Unused. Rename the Chameleon background texture, delete the obsolete DefaultParentForEditor script and New Lighting Settings asset, add a The Room SceneCollection asset, and drop the redundant Assets menu entry from the StraightenKnees tool. --- Assets/DefaultParentForEditor.cs | 45 ------ Assets/DefaultParentForEditor.cs.meta | 11 -- Assets/New Lighting Settings.lighting | 69 --------- Assets/Scenes/The Room.asset | 17 +++ .../The Room.asset.meta} | 4 +- Assets/{ => Scripts}/Editor.meta | 0 .../{ => Scripts}/Editor/PlaySceneWindow.cs | 138 +----------------- .../Editor/PlaySceneWindow.cs.meta | 0 .../{ => Scripts}/Editor/SceneCollection.cs | 0 .../Editor/SceneCollection.cs.meta | 0 .../DefaultNetworkPrefabs.asset | 0 .../DefaultNetworkPrefabs.asset.meta | 0 .../Main Camera Custom Blends.asset | 0 .../Main Camera Custom Blends.asset.meta | 0 ...kground 1.png => Chameleon Background.png} | Bin ...png.meta => Chameleon Background.png.meta} | 0 Assets/Unused/Editor/StraightenKneesTool.cs | 9 +- Assets/{Shaders => Unused}/HeroCutout.hlsl | 0 .../{Shaders => Unused}/HeroCutout.hlsl.meta | 0 .../{Shaders => Unused}/HeroCutoutLit.shader | 0 .../HeroCutoutLit.shader.meta | 0 21 files changed, 25 insertions(+), 268 deletions(-) delete mode 100644 Assets/DefaultParentForEditor.cs delete mode 100644 Assets/DefaultParentForEditor.cs.meta delete mode 100644 Assets/New Lighting Settings.lighting create mode 100644 Assets/Scenes/The Room.asset rename Assets/{New Lighting Settings.lighting.meta => Scenes/The Room.asset.meta} (60%) rename Assets/{ => Scripts}/Editor.meta (100%) rename Assets/{ => Scripts}/Editor/PlaySceneWindow.cs (64%) rename Assets/{ => Scripts}/Editor/PlaySceneWindow.cs.meta (100%) rename Assets/{ => Scripts}/Editor/SceneCollection.cs (100%) rename Assets/{ => Scripts}/Editor/SceneCollection.cs.meta (100%) rename Assets/{ => Settings}/DefaultNetworkPrefabs.asset (100%) rename Assets/{ => Settings}/DefaultNetworkPrefabs.asset.meta (100%) rename Assets/{ => Settings}/Main Camera Custom Blends.asset (100%) rename Assets/{ => Settings}/Main Camera Custom Blends.asset.meta (100%) rename Assets/Textures/{Chameleon Background 1.png => Chameleon Background.png} (100%) rename Assets/Textures/{Chameleon Background 1.png.meta => Chameleon Background.png.meta} (100%) rename Assets/{Shaders => Unused}/HeroCutout.hlsl (100%) rename Assets/{Shaders => Unused}/HeroCutout.hlsl.meta (100%) rename Assets/{Shaders => Unused}/HeroCutoutLit.shader (100%) rename Assets/{Shaders => Unused}/HeroCutoutLit.shader.meta (100%) diff --git a/Assets/DefaultParentForEditor.cs b/Assets/DefaultParentForEditor.cs deleted file mode 100644 index 6678f6e..0000000 --- a/Assets/DefaultParentForEditor.cs +++ /dev/null @@ -1,45 +0,0 @@ -#if UNITY_EDITOR -using UnityEditor; -#endif - -using UnityEngine; - -namespace Chameleon -{ - [ExecuteAlways] - [AddComponentMenu("Tools/Chameleon/Default Parent (Editor)")] - public class DefaultParentForEditor : MonoBehaviour - { -#if UNITY_EDITOR - static DefaultParentForEditor selection; - - [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] - static void Init() => selection = null; - - void Update() - { - if (Application.isPlaying) - return; - - var activeGameObject = Selection.activeGameObject; - if (activeGameObject != gameObject) - return; - - if (!activeGameObject.TryGetComponent(out DefaultParentForEditor defaultParent)) - return; - - if (selection && selection != defaultParent) - { - selection = null; - EditorUtility.ClearDefaultParentObject(); - } - - if (!selection) - { - selection = this; - EditorUtility.SetDefaultParentObject(gameObject); - } - } -#endif - } -} diff --git a/Assets/DefaultParentForEditor.cs.meta b/Assets/DefaultParentForEditor.cs.meta deleted file mode 100644 index 15eab20..0000000 --- a/Assets/DefaultParentForEditor.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 00d9c432a5ead1540b39d22553c41f76 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: a360cdd2cf64e48469885fdcb0737dd1, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/New Lighting Settings.lighting b/Assets/New Lighting Settings.lighting deleted file mode 100644 index 0f257b9..0000000 --- a/Assets/New Lighting Settings.lighting +++ /dev/null @@ -1,69 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!850595691 &4890085278179872738 -LightingSettings: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: New Lighting Settings - serializedVersion: 10 - m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 1 - m_RealtimeEnvironmentLighting: 1 - m_BounceScale: 1 - m_AlbedoBoost: 1 - m_IndirectOutputScale: 1 - m_UsingShadowmask: 1 - m_BakeBackend: 2 - m_LightmapMaxSize: 1024 - m_LightmapSizeFixed: 0 - m_UseMipmapLimits: 1 - m_BakeResolution: 40 - m_Padding: 2 - m_LightmapCompression: 3 - m_LightmapPackingMode: 0 - m_LightmapPackingMethod: 1 - m_XAtlasPackingAttempts: 16384 - m_XAtlasBruteForce: 0 - m_XAtlasBlockAlign: 0 - m_XAtlasRepackUnderutilizedLightmaps: 1 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 1 - m_CompAOExponentDirect: 0 - m_ExtractAO: 0 - m_MixedBakeMode: 2 - m_LightmapsBakeMode: 1 - m_FilterMode: 1 - m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} - m_ExportTrainingData: 0 - m_EnableWorkerProcessBaking: 1 - m_TrainingDataDestination: TrainingData - m_RealtimeResolution: 2 - m_ForceWhiteAlbedo: 0 - m_ForceUpdates: 0 - m_PVRCulling: 1 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 512 - m_PVREnvironmentSampleCount: 256 - m_PVREnvironmentReferencePointCount: 2048 - m_LightProbeSampleCountMultiplier: 4 - m_PVRBounces: 2 - m_PVRMinBounces: 2 - m_PVREnvironmentImportanceSampling: 1 - m_PVRFilteringMode: 1 - m_PVRDenoiserTypeDirect: 1 - m_PVRDenoiserTypeIndirect: 1 - m_PVRDenoiserTypeAO: 1 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 1 - m_PVRFilteringGaussRadiusAO: 1 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 - m_RespectSceneVisibilityWhenBakingGI: 0 diff --git a/Assets/Scenes/The Room.asset b/Assets/Scenes/The Room.asset new file mode 100644 index 0000000..9f0965f --- /dev/null +++ b/Assets/Scenes/The Room.asset @@ -0,0 +1,17 @@ +%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: 0d51f5e57ffbddc4dab2f2d0f5d8e693, type: 3} + m_Name: The Room + m_EditorClassIdentifier: Assembly-CSharp-Editor::Chameleon.Editor.SceneCollection + sceneAssets: + - {fileID: 102900000, guid: 99c9720ab356a0642a771bea13969a05, type: 3} + - {fileID: 102900000, guid: 0882ff510b3c00241bee77e6b8ab5ab8, type: 3} diff --git a/Assets/New Lighting Settings.lighting.meta b/Assets/Scenes/The Room.asset.meta similarity index 60% rename from Assets/New Lighting Settings.lighting.meta rename to Assets/Scenes/The Room.asset.meta index 6b8ccbf..0e456ce 100644 --- a/Assets/New Lighting Settings.lighting.meta +++ b/Assets/Scenes/The Room.asset.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: d0a9850b320183b4ab8b8f66c1b494f4 +guid: e7ae479e051350144a4869fdc7e689ab NativeFormatImporter: externalObjects: {} - mainObjectFileID: 4890085278179872738 + mainObjectFileID: 11400000 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Editor.meta b/Assets/Scripts/Editor.meta similarity index 100% rename from Assets/Editor.meta rename to Assets/Scripts/Editor.meta diff --git a/Assets/Editor/PlaySceneWindow.cs b/Assets/Scripts/Editor/PlaySceneWindow.cs similarity index 64% rename from Assets/Editor/PlaySceneWindow.cs rename to Assets/Scripts/Editor/PlaySceneWindow.cs index 00995b0..62958b9 100644 --- a/Assets/Editor/PlaySceneWindow.cs +++ b/Assets/Scripts/Editor/PlaySceneWindow.cs @@ -8,14 +8,12 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using F = System.Reflection.BindingFlags; - namespace Chameleon.Editor { [ExecuteAlways] public class PlaySceneWindow : EditorWindow { - [MenuItem("Tools/Chameleon/Play Scene/Open Window")] + [MenuItem("Tools/Chameleon/Play Scene")] public static void Open() => _ = GetWindow("Play Scene"); @@ -208,11 +206,12 @@ namespace Chameleon.Editor sceneIndex = EditorGUILayout.Popup(sceneIndex, sceneNames); GUI.enabled = !isPlaying; - var disabled = !EditorSettings.enterPlayModeOptionsEnabled; + //var disabled = !EditorSettings.enterPlayModeOptionsEnabled; + var disabled = EditorSettings.enterPlayModeOptions != EnterPlayModeOptions.DisableDomainReload; GUI.color = disabled ? new(1, .75f, .5f) : new(.825f, .825f, .825f); disabled = EditorGUILayout.Toggle(disabled, GUILayout.Width(14)); EditorGUILayout.LabelField("Reload Domain", GUILayout.Width(86)); - EditorSettings.enterPlayModeOptionsEnabled = !disabled; + //EditorSettings.enterPlayModeOptionsEnabled = !disabled; EditorSettings.enterPlayModeOptions = EnterPlayModeOptions.DisableDomainReload | EnterPlayModeOptions.DisableSceneReload; @@ -221,134 +220,5 @@ namespace Chameleon.Editor action?.Invoke(); } - - [MenuItem("Tools/Chameleon/Play Scene/Focus Selection")] - static void FocusSelection() - { - Collapse(); - - var gameObject = Selection.activeGameObject; - if (gameObject) - { - EditorGUIUtility.PingObject(gameObject); - SceneManager.SetActiveScene(Selection.activeGameObject.scene); - } - - var rootGameObjects = SceneManager - .GetActiveScene() - .GetRootGameObjects(); - - var parent = rootGameObjects.FirstOrDefault( - x => x.TryGetComponent(out DefaultParentForEditor _) - ); - - if (parent) - { - EditorUtility.SetDefaultParentObject(parent); - if (!gameObject) - gameObject = parent; - } - - if (!gameObject) - { - gameObject = rootGameObjects.FirstOrDefault(); - if (!gameObject) - return; - } - - if (parent) - { - var transform = gameObject.transform; - if (transform.childCount > 0) - gameObject = transform.GetChild(0).gameObject; - } - - EditorGUIUtility.PingObject(gameObject); - } - - [MenuItem("Tools/Chameleon/Play Scene/Focus Scene")] - static void FocusScene() - { - Collapse(); - - var gameObject = Selection.activeGameObject; - if (gameObject) - SceneManager.SetActiveScene(Selection.activeGameObject.scene); - - var rootGameObjects = SceneManager - .GetActiveScene() - .GetRootGameObjects(); - - gameObject = rootGameObjects.FirstOrDefault( - x => x.TryGetComponent(out DefaultParentForEditor _) - ); - - if (gameObject) - { - EditorUtility.SetDefaultParentObject(gameObject); - var transform = gameObject.transform; - if (transform.childCount > 0) - gameObject = transform.GetChild(0).gameObject; - } - else - { - gameObject = rootGameObjects.FirstOrDefault(); - if (!gameObject) - return; - } - - EditorGUIUtility.PingObject(gameObject); - Selection.activeObject = null; - } - - static void Collapse() - { - var activeObject = Selection.activeObject; - Collapse(repaint: false); - Collapse(repaint: true); - Selection.activeObject = activeObject; - } - - static void Collapse(bool repaint) - { - Selection.activeObject = null; - - var scopeFlags = F.Public | F.NonPublic; - var instanceFlags = scopeFlags | F.Instance; - - var window = typeof(EditorWindow).Assembly - .GetType("UnityEditor.SceneHierarchyWindow") - .GetField("s_LastInteractedHierarchy", scopeFlags | F.Static) - .GetValue(null) as EditorWindow; - - if (!window) - return; - - var treeOwner = window - .GetType() - .GetField("m_SceneHierarchy", instanceFlags) - .GetValue(window); - - var tree = treeOwner - .GetType() - .GetField("m_TreeView", instanceFlags) - .GetValue(treeOwner); - - if (tree is null) - return; - - var source = tree - .GetType() - .GetProperty("data", instanceFlags) - .GetValue(tree, null); - - source - .GetType() - .GetMethod("SetExpandedIDs", instanceFlags) - .Invoke(source, new[] { new int[0] }); - - if (repaint) - window.Repaint(); - } } } diff --git a/Assets/Editor/PlaySceneWindow.cs.meta b/Assets/Scripts/Editor/PlaySceneWindow.cs.meta similarity index 100% rename from Assets/Editor/PlaySceneWindow.cs.meta rename to Assets/Scripts/Editor/PlaySceneWindow.cs.meta diff --git a/Assets/Editor/SceneCollection.cs b/Assets/Scripts/Editor/SceneCollection.cs similarity index 100% rename from Assets/Editor/SceneCollection.cs rename to Assets/Scripts/Editor/SceneCollection.cs diff --git a/Assets/Editor/SceneCollection.cs.meta b/Assets/Scripts/Editor/SceneCollection.cs.meta similarity index 100% rename from Assets/Editor/SceneCollection.cs.meta rename to Assets/Scripts/Editor/SceneCollection.cs.meta diff --git a/Assets/DefaultNetworkPrefabs.asset b/Assets/Settings/DefaultNetworkPrefabs.asset similarity index 100% rename from Assets/DefaultNetworkPrefabs.asset rename to Assets/Settings/DefaultNetworkPrefabs.asset diff --git a/Assets/DefaultNetworkPrefabs.asset.meta b/Assets/Settings/DefaultNetworkPrefabs.asset.meta similarity index 100% rename from Assets/DefaultNetworkPrefabs.asset.meta rename to Assets/Settings/DefaultNetworkPrefabs.asset.meta diff --git a/Assets/Main Camera Custom Blends.asset b/Assets/Settings/Main Camera Custom Blends.asset similarity index 100% rename from Assets/Main Camera Custom Blends.asset rename to Assets/Settings/Main Camera Custom Blends.asset diff --git a/Assets/Main Camera Custom Blends.asset.meta b/Assets/Settings/Main Camera Custom Blends.asset.meta similarity index 100% rename from Assets/Main Camera Custom Blends.asset.meta rename to Assets/Settings/Main Camera Custom Blends.asset.meta diff --git a/Assets/Textures/Chameleon Background 1.png b/Assets/Textures/Chameleon Background.png similarity index 100% rename from Assets/Textures/Chameleon Background 1.png rename to Assets/Textures/Chameleon Background.png diff --git a/Assets/Textures/Chameleon Background 1.png.meta b/Assets/Textures/Chameleon Background.png.meta similarity index 100% rename from Assets/Textures/Chameleon Background 1.png.meta rename to Assets/Textures/Chameleon Background.png.meta diff --git a/Assets/Unused/Editor/StraightenKneesTool.cs b/Assets/Unused/Editor/StraightenKneesTool.cs index 15457cf..acdbb37 100644 --- a/Assets/Unused/Editor/StraightenKneesTool.cs +++ b/Assets/Unused/Editor/StraightenKneesTool.cs @@ -20,11 +20,7 @@ public static class StraightenKneesTool private const string RightStretch = "Right Lower Leg Stretch"; private const float StraightValue = 1f; // muscle value that maps to a fully straight knee on this avatar - private const string ToolsMenu = "Tools/Chameleon/Straighten Knees (Selected Clips)"; - private const string AssetsMenu = "Assets/Chameleon/Straighten Knees"; - - [MenuItem(ToolsMenu, false, 100)] - [MenuItem(AssetsMenu, false, 100)] + [MenuItem("Tools/Chameleon/Straighten Knees (Selected Clips)", false, 100)] private static void StraightenSelected() { List clips = GetSelectedClips(); @@ -49,8 +45,7 @@ public static class StraightenKneesTool (skipped > 0 ? $", skipped {skipped} (non-.anim or non-humanoid)." : ".")); } - [MenuItem(ToolsMenu, true)] - [MenuItem(AssetsMenu, true)] + [MenuItem("Tools/Chameleon/Straighten Knees (Selected Clips)", true)] private static bool StraightenSelectedValidate() => GetSelectedClips().Count > 0; private static bool StraightenClip(AnimationClip clip) diff --git a/Assets/Shaders/HeroCutout.hlsl b/Assets/Unused/HeroCutout.hlsl similarity index 100% rename from Assets/Shaders/HeroCutout.hlsl rename to Assets/Unused/HeroCutout.hlsl diff --git a/Assets/Shaders/HeroCutout.hlsl.meta b/Assets/Unused/HeroCutout.hlsl.meta similarity index 100% rename from Assets/Shaders/HeroCutout.hlsl.meta rename to Assets/Unused/HeroCutout.hlsl.meta diff --git a/Assets/Shaders/HeroCutoutLit.shader b/Assets/Unused/HeroCutoutLit.shader similarity index 100% rename from Assets/Shaders/HeroCutoutLit.shader rename to Assets/Unused/HeroCutoutLit.shader diff --git a/Assets/Shaders/HeroCutoutLit.shader.meta b/Assets/Unused/HeroCutoutLit.shader.meta similarity index 100% rename from Assets/Shaders/HeroCutoutLit.shader.meta rename to Assets/Unused/HeroCutoutLit.shader.meta