-
-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements "RequiredType" validation attribute #346
base: master
Are you sure you want to change the base?
Conversation
Hi @dbrizov |
Hi @dbrizov |
Hi, @demirmusa |
Hi @dbrizov, Apart from that, I love this project and would like to contribute/help as much as I can. |
Would really love to see this merged, any progress? :) |
For anyone who is still waiting for this PR, I have a project that can co-work with NaughtyAttributes with this feature so you don't need to switch: using SaintsField;
public interface IMyInterface {}
public class MyInter1: MonoBehaviour, IMyInterface {}
public class MySubInter: MyInter1 {}
public class MyInter2: MonoBehaviour, IMyInterface {}
[RequireType(typeof(IMyInterface))] public SpriteRenderer interSr;
[RequireType(typeof(IMyInterface), typeof(SpriteRenderer))] public GameObject interfaceGo;
[RequireType(true, typeof(IMyInterface))] public SpriteRenderer srNoPickerFreeSign;
[RequireType(true, typeof(IMyInterface))] public GameObject goNoPickerFreeSign; |
That pr implements
RequiredType
validation attribute. You can useRequiredType
attribute on gameobjects or any kind of components to validate that gameobject property that use that attribute has required component(s).Example Usage:
Checking an Interface
Checking a Component
Checking Multiple Types
Result
Resolves #351