Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEditor;
- using UnityEngine;
- namespace Varguiniano
- {
- /// <inheritdoc />
- /// <summary>
- /// Class with some utilities for editors.
- /// </summary>
- public class ExtendedEditor<T> : Editor where T : MonoBehaviour
- {
- /// <summary>
- /// Reference to the object being edited.
- /// </summary>
- protected T TargetObject => (T) target;
- /// <summary>
- /// Paints the property given.
- /// </summary>
- /// <param name="name">Name of that property.</param>
- /// <param name="includeChildren">Should it include children?</param>
- protected void PaintProperty(string name, bool includeChildren = false)
- {
- var property = serializedObject.FindProperty(name);
- EditorGUILayout.PropertyField(property, includeChildren);
- }
- }
- }
Add Comment
Please, Sign In to add comment