Skip to content

Instantly share code, notes, and snippets.

@JohannesMP
Created April 7, 2017 15:15
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 JohannesMP/8afa58e4f400387c36e9608d918999ef to your computer and use it in GitHub Desktop.
Save JohannesMP/8afa58e4f400387c36e9608d918999ef to your computer and use it in GitHub Desktop.
#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