mirror of
https://github.com/OMGeeky/UnityCodeGenerators.git
synced 2025-12-27 14:59:20 +01:00
Initial commit
Included generators: - an attribute that allows for easy GetComponent with just one method for all UI: - Attribute for generating UxmlTraits and needed stuff for custom UIElement-attributes/fields - Attribute for easily getting Elements from the Uxml file with a single method for all
This commit is contained in:
31
TestConsole/Program.cs
Normal file
31
TestConsole/Program.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
|
||||
using System.Diagnostics;
|
||||
|
||||
|
||||
namespace ConsoleApp;
|
||||
|
||||
partial class Program
|
||||
{
|
||||
static void Main( string[] args ) { HelloFrom( "Generated Code" ); }
|
||||
|
||||
static partial void HelloFrom( string name );
|
||||
}
|
||||
|
||||
public partial class Test1 : AtVisualElement
|
||||
{
|
||||
// [UxmlTrait( "health" , 9 )]
|
||||
// public int MyProperty { get; set; }
|
||||
|
||||
[UxmlTrait( "health2" , 8)] public int MyField;
|
||||
[UxmlTrait( "health1" , 8)] public int MyField2{get; set; }
|
||||
[UxmlTrait( "health1" , false)] public bool MyBoolField2;
|
||||
[UxmlTrait( "health1" , "hi")] public string MyStringField2;
|
||||
public void Test123()
|
||||
{
|
||||
Debug.Write( "test" );
|
||||
// Test987();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class AtVisualElement { }
|
||||
Reference in New Issue
Block a user