2020-12-22 03:13:43 +00:00
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
2020-03-22 19:05:26 +00:00
|
|
|
|
|
|
|
|
|
|
public class NameAttribute : Attribute
|
|
|
|
|
|
{
|
|
|
|
|
|
public string Name;
|
|
|
|
|
|
|
|
|
|
|
|
public NameAttribute(string name)
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = name;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-03-26 02:49:09 +00:00
|
|
|
|
[AttributeUsage(AttributeTargets.Class)]
|
|
|
|
|
|
public class RethinkTableAttribute : Attribute
|
|
|
|
|
|
{
|
|
|
|
|
|
public string TableName;
|
|
|
|
|
|
|
|
|
|
|
|
public RethinkTableAttribute(string tableName)
|
|
|
|
|
|
{
|
|
|
|
|
|
TableName = tableName;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-13 22:35:56 +01:00
|
|
|
|
public class OrderAttribute : Attribute
|
2020-03-22 19:05:26 +00:00
|
|
|
|
{
|
|
|
|
|
|
public int Order;
|
|
|
|
|
|
|
2020-05-13 22:35:56 +01:00
|
|
|
|
public OrderAttribute(int order)
|
2020-03-22 19:05:26 +00:00
|
|
|
|
{
|
|
|
|
|
|
Order = order;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-09 10:33:16 +01:00
|
|
|
|
[AttributeUsage(AttributeTargets.Class)]
|
|
|
|
|
|
public class EntityTypeRestrictionAttribute : Attribute
|
|
|
|
|
|
{
|
2020-04-11 19:18:02 +01:00
|
|
|
|
public readonly HullType Type;
|
2020-04-09 10:33:16 +01:00
|
|
|
|
|
2020-04-11 19:18:02 +01:00
|
|
|
|
public EntityTypeRestrictionAttribute(HullType type)
|
2020-04-09 10:33:16 +01:00
|
|
|
|
{
|
|
|
|
|
|
Type = type;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-31 03:10:11 +01:00
|
|
|
|
public class RuntimeInspectable : Attribute { }
|
|
|
|
|
|
|
2020-03-22 19:05:26 +00:00
|
|
|
|
[AttributeUsage(AttributeTargets.Class)]
|
|
|
|
|
|
public class InspectableAttribute : Attribute { }
|
|
|
|
|
|
|
|
|
|
|
|
public class InspectableFieldAttribute : Attribute { }
|
|
|
|
|
|
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Field)]
|
|
|
|
|
|
public class InspectableTextAttribute : InspectableFieldAttribute { }
|
|
|
|
|
|
|
2020-12-22 03:13:43 +00:00
|
|
|
|
[AttributeUsage(AttributeTargets.Field)]
|
|
|
|
|
|
public class InspectableUnityObjectAttribute : InspectableFieldAttribute
|
|
|
|
|
|
{
|
|
|
|
|
|
public Type ObjectType;
|
|
|
|
|
|
|
|
|
|
|
|
public InspectableUnityObjectAttribute(Type type)
|
|
|
|
|
|
{
|
|
|
|
|
|
ObjectType = type;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-03-22 19:05:26 +00:00
|
|
|
|
[AttributeUsage(AttributeTargets.Field)]
|
|
|
|
|
|
public class InspectablePrefabAttribute : InspectableFieldAttribute { }
|
|
|
|
|
|
|
2020-05-10 00:16:33 +01:00
|
|
|
|
[AttributeUsage(AttributeTargets.Field)]
|
|
|
|
|
|
public class InspectableTextureAttribute : InspectableFieldAttribute { }
|
|
|
|
|
|
|
2020-03-22 19:05:26 +00:00
|
|
|
|
[AttributeUsage(AttributeTargets.Field)]
|
|
|
|
|
|
public class TemperatureInspectableAttribute : InspectableFieldAttribute { }
|
|
|
|
|
|
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Field)]
|
|
|
|
|
|
public class InspectableAnimationCurveAttribute : InspectableFieldAttribute { }
|
|
|
|
|
|
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Field)]
|
|
|
|
|
|
public class InspectableDatabaseLinkAttribute : InspectableFieldAttribute
|
|
|
|
|
|
{
|
|
|
|
|
|
public readonly Type EntryType;
|
|
|
|
|
|
|
|
|
|
|
|
public InspectableDatabaseLinkAttribute(Type entryType)
|
|
|
|
|
|
{
|
|
|
|
|
|
EntryType = entryType;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Field)]
|
|
|
|
|
|
public class RangedFloatInspectableAttribute : InspectableFieldAttribute
|
|
|
|
|
|
{
|
|
|
|
|
|
public readonly float Min, Max;
|
|
|
|
|
|
|
|
|
|
|
|
public RangedFloatInspectableAttribute(float min, float max)
|
|
|
|
|
|
{
|
|
|
|
|
|
Min = min;
|
|
|
|
|
|
Max = max;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Field)]
|
|
|
|
|
|
public class RangedIntInspectableAttribute : InspectableFieldAttribute
|
|
|
|
|
|
{
|
|
|
|
|
|
public readonly int Min, Max;
|
|
|
|
|
|
|
|
|
|
|
|
public RangedIntInspectableAttribute(int min, int max)
|
|
|
|
|
|
{
|
|
|
|
|
|
Min = min;
|
|
|
|
|
|
Max = max;
|
|
|
|
|
|
}
|
2020-04-09 07:48:45 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class InspectableTypeAttribute : InspectableFieldAttribute
|
|
|
|
|
|
{
|
|
|
|
|
|
public readonly Type Type;
|
|
|
|
|
|
|
|
|
|
|
|
public InspectableTypeAttribute(Type type)
|
|
|
|
|
|
{
|
|
|
|
|
|
Type = type;
|
|
|
|
|
|
}
|
2020-05-21 01:53:06 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Field)]
|
2020-05-23 01:19:07 +01:00
|
|
|
|
public class SimplePerformanceStatAttribute : Attribute { }
|
|
|
|
|
|
|
2021-01-25 05:53:36 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// <para>Specify a tooltip for a field in the Inspector window.</para>
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
|
|
|
|
|
public class TooltipAttribute : Attribute
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// <para>The tooltip text.</para>
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public readonly string tooltip;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// <para>Specify a tooltip for a field.</para>
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="tooltip">The tooltip text.</param>
|
|
|
|
|
|
public TooltipAttribute(string tooltip) => this.tooltip = tooltip;
|
|
|
|
|
|
}
|
2020-05-23 01:19:07 +01:00
|
|
|
|
// public class CategoryAttribute : Attribute
|
|
|
|
|
|
// {
|
|
|
|
|
|
// public readonly Type Type;
|
|
|
|
|
|
//
|
|
|
|
|
|
// public CategoryAttribute(Type type)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// Type = type;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|