소스 검색

Added Layer Attribute

James Peret 2 년 전
부모
커밋
b0356fd037
4개의 변경된 파일55개의 추가작업 그리고 0개의 파일을 삭제
  1. 19 0
      Editor/LayerAttributeEditor.cs
  2. 11 0
      Editor/LayerAttributeEditor.cs.meta
  3. 14 0
      Runtime/Attributes/LayerAttribute.cs
  4. 11 0
      Runtime/Attributes/LayerAttribute.cs.meta

+ 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: