Browse Source

Added Tag Attribute

James Peret 1 year ago
parent
commit
d15bd70cee

+ 18 - 0
Editor/TagAttributeEditor.cs

@@ -0,0 +1,18 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEditor;
+using KairoEngine.Core;
+
+namespace KairoEngine.Core.Editor
+{
+    [CustomPropertyDrawer(typeof(TagAttribute))]
+    class TagAttributeEditor : PropertyDrawer
+    {
+
+        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
+        {
+            property.stringValue = EditorGUI.TagField(position, label, property.stringValue);
+        }
+    }
+}

+ 11 - 0
Editor/TagAttributeEditor.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 289621e2fc1693642bd0c1dd539e4a60
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 4 - 0
Readme.md

@@ -25,6 +25,10 @@ This contains the base code that other packages will use. It includes code for t
 
 ### 📄Changelog
 
+##### v0.2.7
+- Added Tag Attribute
+- Added Layer Attribute
+
 ##### v0.2.6
 - Added the Cronometer utility
 - Added IMapDataGenerator interface

+ 14 - 0
Runtime/Attributes/TagAttribute.cs

@@ -0,0 +1,14 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace KairoEngine.Core
+{
+     /// <summary>
+    /// Attribute to select a single tag.
+    /// </summary>
+    public class TagAttribute : PropertyAttribute
+    { 
+        // NOTHING - just oxygen.
+    }
+}

+ 11 - 0
Runtime/Attributes/TagAttribute.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f738032602d9aee48be33acfbc23dc89
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: