daily pastebin goal
3%
SHARE
TWEET

Untitled

a guest Dec 17th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEditor;
  2. using UnityEngine;
  3.  
  4. namespace Varguiniano
  5. {
  6.     /// <inheritdoc />
  7.     /// <summary>
  8.     /// Class with some utilities for editors.
  9.     /// </summary>
  10.     public class ExtendedEditor<T> : Editor where T : MonoBehaviour
  11.     {
  12.         /// <summary>
  13.         /// Reference to the object being edited.
  14.         /// </summary>
  15.         protected T TargetObject => (T) target;
  16.        
  17.         /// <summary>
  18.         /// Paints the property given.
  19.         /// </summary>
  20.         /// <param name="name">Name of that property.</param>
  21.         /// <param name="includeChildren">Should it include children?</param>
  22.         protected void PaintProperty(string name, bool includeChildren = false)
  23.         {
  24.             var property = serializedObject.FindProperty(name);
  25.             EditorGUILayout.PropertyField(property, includeChildren);
  26.         }
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top