-
-
Save JohannesMP/8afa58e4f400387c36e9608d918999ef to your computer and use it in GitHub Desktop.
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
#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