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 UnityEditor.UI; | |
using UnityEngine; | |
using UnityEngine.UI; | |
[CustomEditor(typeof(Image))] | |
public class CustomImageEditor : ImageEditor | |
{ | |
public override void OnInspectorGUI() | |
{ |
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.Reflection; | |
using UnityEditor; | |
using UnityEngine; | |
[CustomEditor(typeof(ParticleSystem))] | |
public class CustomParticleSystemEditor : Editor | |
{ | |
private Editor _builtInEditor; | |
private void OnEnable() |
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 UnityEditor; | |
using UnityEditor.EditorTools; | |
[EditorTool("Orbit Parent Tool", typeof(Transform))] | |
class OrbitParentTool : EditorTool | |
{ | |
[SerializeField] | |
private Texture2D _toolIcon; |


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 System.Collections.Generic; | |
using UnityEngine; | |
public struct GUIBackgroundColorScope : IDisposable | |
{ | |
private static readonly Stack<Color> _colorStack = new Stack<Color>(); | |
public GUIBackgroundColorScope(Color color) | |
{ |
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
/// <summary> | |
/// Undocumented Unity callback. More info here: | |
/// https://forum.unity.com/threads/editor-how-do-i-set-the-bounds-of-an-empty-gameobject-for-focus-f-key.427093/ | |
/// </summary> | |
/// <returns></returns> | |
public bool HasFrameBounds() | |
{ | |
return true; | |
} |
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
// Somewhere in your OnSceneGUI() ... | |
// Draw dotted lines. | |
var handlesColorBkp = Handles.color; | |
Handles.color = new Color(0f, 0f, 0.5f); | |
for (int i = 0; i < points.Length - 1; i++) | |
{ | |
Handles.DrawDottedLine(points[i], points[i + 1], DOTTED_LINE_SIZE); | |
} |
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
/* | |
* @brief Editor menu item and shortcut for capturing the game view into the system clipboard. | |
* | |
* @setup The System.Drawing and System.Windows.Forms Mono DLLs need to be referenced. See the documentation for | |
* CopyTextureToClipboard below. | |
* | |
* @usage Access from the menu item or use the shortcut. Both are defined below as attribute of GameViewToClipboard(), | |
* defaults to Shift+S | |
* | |
* @author Aurelio Provedo |
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
/* | |
* @brief Editor menu item for turning a prefab into a variant of a new empty prefab. | |
* | |
* @usage Access from the MenuItem defined in the code. As right-click or from the menu bar. | |
* | |
* @author Aurelio Provedo | |
* Contact: [email protected] | |
* | |
*/ |
NewerOlder