فهرست منبع

Added Layer Attribute

James Peret 2 سال پیش
والد
کامیت
b0356fd037

+ 19 - 0
Editor/LayerAttributeEditor.cs

@@ -0,0 +1,19 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEditor;
+using KairoEngine.Core;
+
+namespace KairoEngine.Core.Editor
+{
+    [CustomPropertyDrawer(typeof(LayerAttribute))]
+    class LayerAttributeEditor : PropertyDrawer
+    {
+
+        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
+        {
+            // One line of  oxygen free code.
+            property.intValue = EditorGUI.LayerField(position, label,  property.intValue);
+        }
+    }
+}

+ 11 - 0
Editor/LayerAttributeEditor.cs.meta

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

+ 14 - 0
Runtime/Attributes/LayerAttribute.cs

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

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

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