diff options
Diffstat (limited to 'Runtime/Export/Internal')
-rw-r--r-- | Runtime/Export/Internal/DefaultValueAttribute.cs | 43 | ||||
-rw-r--r-- | Runtime/Export/Internal/ExcludeFromDocs.cs | 16 |
2 files changed, 59 insertions, 0 deletions
diff --git a/Runtime/Export/Internal/DefaultValueAttribute.cs b/Runtime/Export/Internal/DefaultValueAttribute.cs new file mode 100644 index 0000000..a664aa4 --- /dev/null +++ b/Runtime/Export/Internal/DefaultValueAttribute.cs @@ -0,0 +1,43 @@ +using System; + +namespace UnityEngine.Internal +{ + /// <summary> + /// Adds default value information for optional parameters + /// </summary> + [Serializable] + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.GenericParameter)] + public class DefaultValueAttribute : Attribute + { + private object DefaultValue; + + public DefaultValueAttribute (string value) + { + DefaultValue = value; + } + + public object Value { + get { return DefaultValue; } + } + + public override bool Equals (object obj) + { + DefaultValueAttribute dva = (obj as DefaultValueAttribute); + if (dva == null) + return false; + + if (DefaultValue == null) + return (dva.Value == null); + + return DefaultValue.Equals (dva.Value); + } + + public override int GetHashCode() + { + if (DefaultValue == null) + return base.GetHashCode (); + return DefaultValue.GetHashCode(); + } + + } +} diff --git a/Runtime/Export/Internal/ExcludeFromDocs.cs b/Runtime/Export/Internal/ExcludeFromDocs.cs new file mode 100644 index 0000000..42cfdbb --- /dev/null +++ b/Runtime/Export/Internal/ExcludeFromDocs.cs @@ -0,0 +1,16 @@ +using System; + +namespace UnityEngine.Internal +{ + /// <summary> + /// Adds default value information for optional parameters + /// </summary> + [Serializable] + [AttributeUsage(AttributeTargets.Method)] + public class ExcludeFromDocsAttribute : Attribute + { + public ExcludeFromDocsAttribute() + { + } + } +} |