Insanely huge initial commit

This commit is contained in:
2026-02-21 17:04:05 -08:00
parent 9cdd36191a
commit 613d75914a
22525 changed files with 4035207 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
using System;
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Reflection;
namespace MoreMountains.Tools
{
[CanEditMultipleObjects()]
[CustomEditor(typeof(MMRendererSortingLayer))]
public class MMRendererLayerEditor : Editor
{
int popupMenuIndex;
string[] sortingLayerNames;
protected MMRendererSortingLayer _mmRendererSortingLayer;
protected Renderer _renderer;
void OnEnable()
{
sortingLayerNames = GetSortingLayerNames();
_mmRendererSortingLayer = (MMRendererSortingLayer)target;
_renderer = _mmRendererSortingLayer.GetComponent<Renderer> ();
for (int i = 0; i<sortingLayerNames.Length;i++) //here we initialize our popupMenuIndex with the current Sort Layer Name
{
if (sortingLayerNames[i] == _renderer.sortingLayerName)
popupMenuIndex = i;
}
}
public override void OnInspectorGUI()
{
DrawDefaultInspector();
if (_renderer == null)
{
return;
}
popupMenuIndex = EditorGUILayout.Popup("Sorting Layer", popupMenuIndex, sortingLayerNames);
int newSortingLayerOrder = EditorGUILayout.IntField("Order in Layer", _renderer.sortingOrder);
if (sortingLayerNames[popupMenuIndex] != _renderer.sortingLayerName
|| newSortingLayerOrder != _renderer.sortingOrder)
{
Undo.RecordObject(_renderer, "Change Particle System Renderer Order");
_renderer.sortingLayerName = sortingLayerNames[popupMenuIndex];
_renderer.sortingOrder = newSortingLayerOrder;
EditorUtility.SetDirty(_renderer);
}
}
public string[] GetSortingLayerNames()
{
Type internalEditorUtilityType = typeof(InternalEditorUtility);
PropertyInfo sortingLayersProperty = internalEditorUtilityType.GetProperty("sortingLayerNames", BindingFlags.Static | BindingFlags.NonPublic);
return (string[])sortingLayersProperty.GetValue(null, new object[0]);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0ca3ff8bc8827e24ab1490c416d7839f
timeCreated: 1491156263
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,62 @@
using System;
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Reflection;
namespace MoreMountains.Tools
{
[CanEditMultipleObjects()]
[CustomEditor(typeof(MMTrailRendererSortingLayer))]
public class MMTrailRendererLayerEditor : Editor
{
int popupMenuIndex;
string[] sortingLayerNames;
protected MMTrailRendererSortingLayer _mmTrailRendererSortingLayer;
protected TrailRenderer _trailRenderer;
void OnEnable()
{
sortingLayerNames = GetSortingLayerNames();
_mmTrailRendererSortingLayer = (MMTrailRendererSortingLayer)target;
_trailRenderer = _mmTrailRendererSortingLayer.GetComponent<TrailRenderer> ();
for (int i = 0; i<sortingLayerNames.Length;i++) //here we initialize our popupMenuIndex with the current Sort Layer Name
{
if (sortingLayerNames[i] == _trailRenderer.sortingLayerName)
popupMenuIndex = i;
}
}
public override void OnInspectorGUI()
{
DrawDefaultInspector();
if (_trailRenderer == null)
{
return;
}
popupMenuIndex = EditorGUILayout.Popup("Sorting Layer", popupMenuIndex, sortingLayerNames);
int newSortingLayerOrder = EditorGUILayout.IntField("Order in Layer", _trailRenderer.sortingOrder);
if (sortingLayerNames[popupMenuIndex] != _trailRenderer.sortingLayerName
|| newSortingLayerOrder != _trailRenderer.sortingOrder)
{
Undo.RecordObject(_trailRenderer, "Change Particle System Renderer Order");
_trailRenderer.sortingLayerName = sortingLayerNames[popupMenuIndex];
_trailRenderer.sortingOrder = newSortingLayerOrder;
EditorUtility.SetDirty(_trailRenderer);
}
}
public string[] GetSortingLayerNames()
{
Type internalEditorUtilityType = typeof(InternalEditorUtility);
PropertyInfo sortingLayersProperty = internalEditorUtilityType.GetProperty("sortingLayerNames", BindingFlags.Static | BindingFlags.NonPublic);
return (string[])sortingLayersProperty.GetValue(null, new object[0]);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f767333d7f0eaf24892e4778169d0d37
timeCreated: 1491156263
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: