Last active
October 6, 2017 22:21
-
-
Save JPBotelho/b55bc8d502e3aa2a48fedec519455deb to your computer and use it in GitHub Desktop.
Unity Script Templates
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
using UnityEngine; | |
using UnityEditor; | |
using System.Collections.Generic; | |
public class NewBehaviourScript : MonoBehaviour | |
{ | |
void Start () | |
{ | |
} | |
void Update () | |
{ | |
} | |
} |
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
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(); | |
} | |
} |
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
using UnityEngine; | |
using UnityEditor; | |
using System.Collections.Generic; | |
[ExecuteInEditMode] | |
public class NewBehaviourScript : MonoBehaviour | |
{ | |
void Update () | |
{ | |
} | |
} |
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
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