This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEditor; | |
using UnityEngine; | |
public static class GroupGameObjects | |
{ | |
[MenuItem("Edit/Group Items %g")] | |
public static void GroupSelected() | |
{ | |
if (Selection.gameObjects.Length > 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Rendering.PostProcessing; | |
[ExecuteInEditMode] | |
[RequireComponent(typeof(PostProcessVolume))] | |
public class LocalPostProcessProfile : MonoBehaviour | |
{ | |
[SerializeField, HideInInspector] | |
private PostProcessProfile _profile; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Text; | |
public static class JsonFormatter | |
{ | |
private const string Indent = " "; | |
public static string PrettyPrint(string input) | |
{ | |
var output = new StringBuilder(input.Length * 2); | |
char? quote = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
public static class EditorUtils | |
{ | |
/// <summary> | |
/// Verify whether it can be converted to the specified component. | |
/// </summary> | |
public static bool CanConvertTo<T>(Object context) where T : MonoBehaviour | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
public static class LockComponentEditor | |
{ | |
[MenuItem("CONTEXT/Component/Lock Component")] | |
public static void LockComponent(MenuCommand command) | |
{ | |
Component component = (Component)command.context; | |
component.hideFlags |= HideFlags.NotEditable; |
OlderNewer