From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001
From: chai <chaifix@163.com>
Date: Wed, 14 Aug 2019 22:50:43 +0800
Subject: +Unity Runtime code

---
 Runtime/Graphs/UnityEngine.Graphs/Attributes.cs | 96 +++++++++++++++++++++++++
 1 file changed, 96 insertions(+)
 create mode 100644 Runtime/Graphs/UnityEngine.Graphs/Attributes.cs

(limited to 'Runtime/Graphs/UnityEngine.Graphs/Attributes.cs')

diff --git a/Runtime/Graphs/UnityEngine.Graphs/Attributes.cs b/Runtime/Graphs/UnityEngine.Graphs/Attributes.cs
new file mode 100644
index 0000000..1e6bca9
--- /dev/null
+++ b/Runtime/Graphs/UnityEngine.Graphs/Attributes.cs
@@ -0,0 +1,96 @@
+using System;
+
+namespace UnityEngine.Graphs.LogicGraph
+{
+	[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter)]
+	public class SettingAttribute : Attribute { }
+
+	// TODO : should be abstract
+	// for almost everything logic graph related (classes, functions, variables, ...)
+	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Event | AttributeTargets.Field | AttributeTargets.Property)]
+	public class CodeGeneratingLogicAttribute : Attribute
+	{
+		public Type type;
+		public Type inputsType;
+		public Type stateType;
+	}
+
+	// for almost everything logic graph related (classes, functions, variables, ...)
+	public class LogicAttribute : CodeGeneratingLogicAttribute
+	{
+		public LogicAttribute() { type = null; }
+		public LogicAttribute(Type type) { this.type = type; }
+		public LogicAttribute(Type type, Type inputsType)
+		{
+			base.type = type;
+			base.inputsType = inputsType;
+		}
+		public LogicAttribute(Type type, Type inputsType, Type stateType)
+		{
+			base.type = type;
+			base.inputsType = inputsType;
+			base.stateType = stateType;
+		}
+	}
+
+	// for evaluator nodes
+	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
+	public class LogicEvalAttribute : Attribute
+	{
+		public Type type;
+		public Type stateType;
+
+		public LogicEvalAttribute() { type = null; }
+		public LogicEvalAttribute(Type type) { this.type = type; }
+		public LogicEvalAttribute(Type type, Type stateType)
+		{
+			this.type = type;
+			this.stateType = stateType;
+		}
+	}
+
+	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field)]
+	public class LogicExpressionAttribute: Attribute
+	{
+		public string name;
+		public LogicExpressionAttribute() { name = string.Empty;}
+		public LogicExpressionAttribute(string name) { this.name = name; }
+	}
+
+	[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
+	public class LogicTargetAttribute : Attribute { }
+
+	[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
+	public class TitleAttribute : Attribute
+	{
+		public string title;
+		public TitleAttribute(string title) { this.title = title; }		
+	}
+
+	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Event | AttributeTargets.Field | AttributeTargets.Property)]
+	public class ValidateAttribute : Attribute
+	{
+		public string validateFunction;
+		public ValidateAttribute(string validateFunction) { this.validateFunction = validateFunction; }
+	}
+	
+	#if UNITY_ANIMATION_GRAPH
+	// for almost everything logic graph related (classes, functions, variables, ...)
+	public class AnimationLogicAttribute : CodeGeneratingLogicAttribute
+	{
+		public AnimationLogicAttribute() { type = null; }
+		public AnimationLogicAttribute(Type type) { base.type = type; }
+		public AnimationLogicAttribute(Type type, Type inputsType)
+		{
+			base.type = type;
+			base.inputsType = inputsType;
+		}
+		public AnimationLogicAttribute(Type type, Type inputsType, Type stateType)
+		{
+			base.type = type;
+			base.inputsType = inputsType;
+			base.stateType = stateType;
+		}
+	}
+	#endif
+}
-- 
cgit v1.1-26-g67d0