5 Commits 2769df218b ... d203f9590a

Author SHA1 Message Date
  James Peret d203f9590a Bumped package to v0.2.7 2 years ago
  James Peret 1c0f331e92 Added random seed to IMapDataGenerator 2 years ago
  James Peret db8907f328 Added Vector3 Generic Event 2 years ago
  James Peret d15bd70cee Added Tag Attribute 2 years ago
  James Peret b0356fd037 Added Layer Attribute 2 years ago

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

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

+ 3 - 32
Readme.md

@@ -1,4 +1,6 @@
-# 📦 KairoEngine.Core v0.2.5
+# 📦 KairoEngine.Core v0.2.7
+
+[Change Log](ChangeLog.md)
 
 
 This contains the base code that other packages will use. It includes code for the module system, event system and common interfaces.
 This contains the base code that other packages will use. It includes code for the module system, event system and common interfaces.
 
 
@@ -23,37 +25,6 @@ This contains the base code that other packages will use. It includes code for t
 
 
 - `KairoEngine.Core.ModuleSystem`
 - `KairoEngine.Core.ModuleSystem`
 
 
-### 📄Changelog
-
-##### v0.2.6
-- Added the Cronometer utility
-- Added IMapDataGenerator interface
-- Added HideInspectorDerivedAttribute
-- Fixed bug in TimeToString utility function
-
-##### v0.2.5
-- Updated the ResolutionOptions to include all types of displays with a minimum size
-
-##### v0.2.4
-- Added ExecuteRealTimeNotDisposable to Timer class
-- Added String Boolean Generic Event
-
-##### v0.2.3
-- Fixed IconFoldoutGroup icon path
-- Added OpenUrlGameAction
-
-##### v0.2.2
-- Fixed WaitGameAction icon path to find the file instead of using a fixed path
-- Added FindFileByName function to Utilities
-- Fixed bug in IconFoldoutGroupAttributeDrawer icon path
-
-##### v0.2.1
-- Added TriggerGenericEvent GameAction
-
-##### v0.2.0
-
-- Upgraded GameModule system
-
 ### 🎈Back Log
 ### 🎈Back Log
 
 
 - [ ] Game State register and check
 - [ ] Game State register and check

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

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

+ 39 - 0
Runtime/EventManager/GenericEvents.cs

@@ -360,6 +360,45 @@ namespace KairoEngine.Core
         }
         }
         #endregion
         #endregion
 
 
+        #region Vector3_Event
+        
+        public static Dictionary<string, System.Action<Vector3>> listVector3 = new Dictionary<string, System.Action<Vector3>>();
+        
+        public static void StartListening(string title, System.Action<Vector3> listener)
+        {
+            System.Action<Vector3> action = null;
+            if (listVector3.TryGetValue(title, out action))
+            {
+                action += listener;
+                listVector3[title] = action;
+            }
+            else
+            {
+                action += listener;
+                listVector3.Add(title, action);
+            }
+        }
+
+        public static void StopListening(string title, System.Action<Vector3> listener)
+        {
+            System.Action<Vector3> action = null;
+            if (listVector3.TryGetValue(title, out action))
+            {
+                action -= listener;
+                listVector3[title] = action;
+            }
+        }
+
+        public static void Trigger(string title, Vector3 value)
+        {
+            System.Action<Vector3> action = null;
+            if (listVector3.TryGetValue(title, out action))
+            {
+                if(action != null) action(value);
+            }
+        }
+        #endregion
+
         #region String_Vector3_Event
         #region String_Vector3_Event
         
         
         public static Dictionary<string, System.Action<string, Vector3>> listStringVector3 = new Dictionary<string, System.Action<string, Vector3>>();
         public static Dictionary<string, System.Action<string, Vector3>> listStringVector3 = new Dictionary<string, System.Action<string, Vector3>>();

+ 1 - 0
Runtime/IMapDataGenerator.cs

@@ -6,6 +6,7 @@ namespace KairoEngine.Core
 {
 {
     public interface IMapDataGenerator
     public interface IMapDataGenerator
     {
     {
+        public void SetSeed(int newSeed);
         public float SamplePoint(float x, float y);
         public float SamplePoint(float x, float y);
         public uint SamplePointColor(float x, float y, float value);
         public uint SamplePointColor(float x, float y, float value);
     }
     }

+ 34 - 0
changelog.md

@@ -1,5 +1,39 @@
 # Changelog
 # Changelog
 
 
+##### v0.2.7
+- Added Tag Attribute
+- Added Layer Attribute
+- Added Vector3 Generic Event
+- Added random seed to IMapDataGenerator
+
+##### v0.2.6
+- Added the Cronometer utility
+- Added IMapDataGenerator interface
+- Added HideInspectorDerivedAttribute
+- Fixed bug in TimeToString utility function
+
+##### v0.2.5
+- Updated the ResolutionOptions to include all types of displays with a minimum size
+
+##### v0.2.4
+- Added ExecuteRealTimeNotDisposable to Timer class
+- Added String Boolean Generic Event
+
+##### v0.2.3
+- Fixed IconFoldoutGroup icon path
+- Added OpenUrlGameAction
+
+##### v0.2.2
+- Fixed WaitGameAction icon path to find the file instead of using a fixed path
+- Added FindFileByName function to Utilities
+- Fixed bug in IconFoldoutGroupAttributeDrawer icon path
+
+##### v0.2.1
+- Added TriggerGenericEvent GameAction
+
+##### v0.2.0
+
+- Upgraded GameModule system
 
 
 ### v0.1.4
 ### v0.1.4
 
 

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
 {
   "name": "at.kairoscope.kairoengine.core",
   "name": "at.kairoscope.kairoengine.core",
   "displayName" : "KairoEngine Core",
   "displayName" : "KairoEngine Core",
-  "version": "0.2.6",
+  "version": "0.2.7",
   "unity": "2020.3",
   "unity": "2020.3",
   "description": "Base package for the KairoEngine library by Kairoscope",
   "description": "Base package for the KairoEngine library by Kairoscope",
   "repository": {
   "repository": {