Implements "RequiredType" validation attribute#346
Implements "RequiredType" validation attribute#346demirmusa wants to merge 5 commits intodbrizov:masterfrom
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; |
|
Merge branch 'demirmusa-validate-interface' into 'v2' - 0c8745b |

That pr implements
RequiredTypevalidation attribute. You can useRequiredTypeattribute 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