Skip to content

Instantly share code, notes, and snippets.

@JPBotelho
Last active October 6, 2017 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JPBotelho/b55bc8d502e3aa2a48fedec519455deb to your computer and use it in GitHub Desktop.
Save JPBotelho/b55bc8d502e3aa2a48fedec519455deb to your computer and use it in GitHub Desktop.
Unity Script Templates
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
public class NewBehaviourScript : MonoBehaviour
{
void Start ()
{
}
void Update ()
{
}
}
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
[CustomEditor(typeof())]
public class PreferenceEditor : Editor
{
public void OnEnable ()
{
}
public override void OnInspectorGUI ()
{
serializedObject.Update();
base.OnInspectorGUI();
serializedObject.ApplyModifiedProperties();
}
}
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
[ExecuteInEditMode]
public class NewBehaviourScript : MonoBehaviour
{
void Update ()
{
}
}
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer(typeof())]
public class NewPropertyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
property.serializedObject.Update();
SerializedProperty = property.FindPropertyRelative("");
property.serializedObject.ApplyModifiedProperties();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment