Class SerenityRecipeLoader
Reads a .serenity-recipe.json file from disk and parses it into a SerenityRecipe
using Unity's UnityEngine.JsonUtility. All failure modes are reported as blockers rather than thrown.
Inherited Members
Namespace: Serenity.ProjectRecipe.Infrastructure.Editor
Assembly: Serenity.UnityProjectRecipe.Infrastructure.Editor.dll
Syntax
public static class SerenityRecipeLoader
Methods
TryLoad(string, SerenityRecipeReport, out SerenityRecipe)
Attempts to read and parse a recipe file.
Declaration
public static bool TryLoad(string filePath, SerenityRecipeReport report, out SerenityRecipe recipe)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filePath | Absolute or project path to the recipe JSON file. |
| SerenityRecipeReport | report | The report to write blockers into. |
| SerenityRecipe | recipe | The parsed recipe, when successful. |
Returns
| Type | Description |
|---|---|
| bool | True when the recipe parsed; false (with a blocker recorded) otherwise. |
TryParse(string, SerenityRecipeReport, out SerenityRecipe)
Parses recipe JSON text. Exposed for tests that supply JSON directly.
Declaration
public static bool TryParse(string json, SerenityRecipeReport report, out SerenityRecipe recipe)
Parameters
| Type | Name | Description |
|---|---|---|
| string | json | The recipe JSON text. |
| SerenityRecipeReport | report | The report to write blockers into. |
| SerenityRecipe | recipe | The parsed recipe, when successful. |
Returns
| Type | Description |
|---|---|
| bool | True when the recipe parsed; false otherwise. |