Created
December 6, 2016 08:34
-
-
Save JohannesDeml/bf72f439355f59dabe2ef27ee5182cd4 to your computer and use it in GitHub Desktop.
Unity Custom inspector template
This file contains 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
// -------------------------------------------------------------------------------------------------------------------- | |
// <copyright file="#SCRIPTNAME#.cs" company="Supyrb"> | |
// Copyright (c) #YEAR# Supyrb. All rights reserved. | |
// </copyright> | |
// <author> | |
// Johannes Deml | |
// send@johannesdeml.com | |
// </author> | |
// -------------------------------------------------------------------------------------------------------------------- | |
namespace Supyrb | |
{ | |
using UnityEditor; | |
using UnityEngine; | |
//[CustomEditor(typeof(...))] | |
[CanEditMultipleObjects] | |
public class #SCRIPTNAME# : Editor | |
{ | |
public override void OnInspectorGUI() | |
{ | |
serializedObject.Update(); | |
// Show "Script" at the top | |
EditorGUI.BeginDisabledGroup(true); | |
SerializedProperty prop = serializedObject.FindProperty("m_Script"); | |
EditorGUILayout.PropertyField(prop, true, new GUILayoutOption[0]); | |
EditorGUI.EndDisabledGroup(); | |
serializedObject.ApplyModifiedProperties(); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment