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.
This commit is contained in:
1 parent
42c5fcc323
commit
e351336b39
21 files changed
+25
-268
No files matched your search
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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:
|
||||
@@ -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
|
||||
@@ -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}
|
||||
@@ -1,8 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0a9850b320183b4ab8b8f66c1b494f4
|
||||
guid: e7ae479e051350144a4869fdc7e689ab
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 4890085278179872738
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File renamed without changes.
@@ -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<PlaySceneWindow>("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();
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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<AnimationClip> 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)
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user