-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix null reference exception when no element is selected
- Loading branch information
Showing
11 changed files
with
110 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
public class RosalinaConstants | ||
{ | ||
public const string Version = "1.0.0"; | ||
public const string Version = "1.0.1"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,36 @@ | ||
internal class RosalinaGenerationResult | ||
using System.IO; | ||
|
||
/// <summary> | ||
/// Describes a generation result. | ||
/// </summary> | ||
internal class RosalinaGenerationResult | ||
{ | ||
/// <summary> | ||
/// Gets the generated code. | ||
/// </summary> | ||
public string Code { get; } | ||
|
||
/// <summary> | ||
/// Gets the output file path. | ||
/// </summary> | ||
public string OutputFilePath { get; } | ||
|
||
/// <summary> | ||
/// Creates a new <see cref="RosalinaGenerationResult"/> instance. | ||
/// </summary> | ||
/// <param name="code">Generated code.</param> | ||
/// <param name="outputFilePath">Output file path.</param> | ||
public RosalinaGenerationResult(string code, string outputFilePath) | ||
{ | ||
Code = code; | ||
OutputFilePath = outputFilePath; | ||
} | ||
|
||
/// <summary> | ||
/// Saves the result to the output path. | ||
/// </summary> | ||
public void Save() | ||
{ | ||
File.WriteAllText(OutputFilePath, Code); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
internal static class RosalinaGenerator | ||
{ | ||
/// <summary> | ||
/// Generates a C# script containing the bindings of the given UI document. | ||
/// </summary> | ||
/// <param name="document">UI Document.</param> | ||
/// <param name="outputFileName">C# script output file.</param> | ||
/// <returns>Rosalina generation result.</returns> | ||
public static RosalinaGenerationResult GenerateBindings(UIDocumentAsset document, string outputFileName) | ||
{ | ||
return new RosalinaBindingsGenerator().Generate(document, outputFileName); | ||
} | ||
|
||
/// <summary> | ||
/// Geneartes a C# script for the UI logic. | ||
/// </summary> | ||
/// <param name="document">UI Document asset information.</param> | ||
/// <param name="outputFileName">Output file name.</param> | ||
/// <returns>Rosalina generation result.</returns> | ||
public static RosalinaGenerationResult GenerateScript(UIDocumentAsset document, string outputFileName) | ||
{ | ||
return new RosalinaScriptGenerator().Generate(document, outputFileName); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
Editor/Scripts/IRosalinaGenerator.cs.meta → Editor/Scripts/RosalinaGenerator.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
{ | ||
"name": "com.eastylabs.rosalina", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"type": "tool", | ||
"displayName": "Rosalina", | ||
"unity": "2021.2", | ||
"description": "Rosalina is an UI Toolkit extension tool that generates C# binding scripts based on a UXML template." | ||
"description": "Rosalina is an UI Toolkit extension tool that generates C# binding scripts based on a UXML template.", | ||
"hideInEditor": true, | ||
"unityRelease": "7f1" | ||
} |