mirror of
https://github.com/OMGeeky/UnityCodeGenerators.git
synced 2025-12-27 23:08:04 +01:00
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
32 lines
775 B
C#
32 lines
775 B
C#
// 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 { }
|