Skip to content

Instantly share code, notes, and snippets.

@JohannesMP
Created April 7, 2017 15:15
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
#if UNITY_EDITOR
using UnityEditor;
#endif
public class SpriteMaskingComponent : MonoBehaviour
{
// ...
}
#if UNITY_EDITOR
[CustomEditor(typeof(SpriteMaskingComponent))]
public class SpriteMaskingComponentEditor : Editor
{
public override void OnInspectorGUI()
{
SpriteMaskingComponent comp = (SpriteMaskingComponent)target;
base.OnInspectorGUI();
if(comp.owner != null)
{
string msg = "Instance ID: " + comp.owner.GetInstanceID() + "\n"
+ "Stencil ID: " + comp.owner.stencilId;
EditorGUILayout.HelpBox(msg, MessageType.None);
}
}
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment