Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxartz15/validator
Unity project validator framework.
https://github.com/maxartz15/validator
editor project unity validator
Last synced: 3 months ago
JSON representation
Unity project validator framework.
- Host: GitHub
- URL: https://github.com/maxartz15/validator
- Owner: maxartz15
- License: mit
- Created: 2021-12-26T01:15:36.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-07-21T00:05:21.000Z (over 2 years ago)
- Last Synced: 2024-10-11T10:13:45.812Z (3 months ago)
- Topics: editor, project, unity, validator
- Language: C#
- Homepage:
- Size: 65.4 KB
- Stars: 10
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Validator
![ValidatorWindow](Documentation~/Images/ValidatorWindow_01.png)
Unity project validator framework.
## Getting Started
Add a custom validate check using the `IValidatable` interface:
```C#
using Validator;public class MyBehaviour : MonoBehaviour, IValidatable
{
[SerializeField] private float startHealth = 10; // If someone was to put it to low <= 0, it would be invalid.#if UNITY_EDITOR
public void Validate(Report report)
{
// Check if health is valid.
if(startHealth <= 0)
{
// If not, log it.
report.Log(this, WarningType.Warning, ReportCategories.Design, $"{nameof(startHealth)} is to low", $"Make value > 0");
}
}
#endif
}
```Add a validate check using `[Required]` attribute:
```C#
[SerializeField, Required] private GameObject playerPrefab = null; // If someone forgets to assign it, it would be invalid.
```Open Validator Window:
> Window -> General -> ValidatorRun the validator:
> Click the 'run/play' button and wait for the report to be generated.## Install
[Installing from a Git URL](https://docs.unity3d.com/Manual/upm-ui-giturl.html)
## LICENSE
Overall package is licensed under [MIT](/LICENSE.md), unless otherwise noted in the [3rd party licenses](/THIRD%20PARTY%20NOTICES.md) file and/or source code.