Merge branch 'require-script' of https://github.com/Tryibion/FlaxEngine into Tryibion-require-script
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace FlaxEngine;
|
||||
|
||||
/// <summary>
|
||||
/// This attribute is used to check for if a script requires an Actor type.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class RequireActorAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// The required type.
|
||||
/// </summary>
|
||||
public Type RequiredType;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RequireActorAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="type">The required type.</param>
|
||||
public RequireActorAttribute(Type type)
|
||||
{
|
||||
RequiredType = type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
|
||||
namespace FlaxEngine;
|
||||
|
||||
/// <summary>
|
||||
/// This attribute is used to check for if a script requires other script types.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class RequireScriptAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// The required types.
|
||||
/// </summary>
|
||||
public Type[] RequiredTypes;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RequireScriptAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="type">The required type.</param>
|
||||
public RequireScriptAttribute(Type type)
|
||||
{
|
||||
RequiredTypes = new[] { type };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RequireScriptAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="types">The required types.</param>
|
||||
public RequireScriptAttribute(Type[] types)
|
||||
{
|
||||
RequiredTypes = types;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user