projectEli/Assets/NeoFPS/Core/Utilities/ComponentOnObjectAttribute.cs
2022-11-06 20:28:33 -05:00

49 lines
976 B
C#

using System;
using UnityEngine;
namespace NeoFPS
{
public class ComponentOnObjectAttribute : PropertyAttribute
{
public Type componentType
{
get;
private set;
}
public bool allowSelf
{
get;
private set;
}
public bool required
{
get;
private set;
}
public ComponentOnObjectAttribute(Type t)
{
componentType = t;
required = true;
allowSelf = false;
}
public ComponentOnObjectAttribute(Type t, bool allowSelf)
{
componentType = t;
required = true;
this.allowSelf = allowSelf;
}
public ComponentOnObjectAttribute(Type t, bool allowSelf, bool required)
{
componentType = t;
this.allowSelf = allowSelf;
this.required = required;
}
}
}