Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Tag Attribute Drawer #6

Merged
merged 1 commit into from
Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Attributes/Editor/TagAttributeDrawer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using UnityEditor;
using UnityEngine;

[CustomPropertyDrawer(typeof(TagAttribute))]
public class TagAttributeDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
property.stringValue = EditorGUI.TagField(position, label, property.stringValue);
}
}
11 changes: 11 additions & 0 deletions Attributes/Editor/TagAttributeDrawer.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Attributes/TagAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using UnityEngine;

public class TagAttribute : PropertyAttribute
{
}
11 changes: 11 additions & 0 deletions Attributes/TagAttribute.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.