mirror of
https://github.com/OMGeeky/UnityCodeGenerators.git
synced 2025-12-28 07:18:06 +01:00
cleanup
This commit is contained in:
@@ -108,13 +108,8 @@ internal class {Helpers.UiElementAttribute} : Attribute
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
List<ISymbol> elementFields = fieldsList.Where( f => GetUiElementAttributeData( f , uiElementAttributeSymbol ) != null ).ToList();
|
List<ISymbol> elementFields = fieldsList.Where( f => GetUiElementAttributeData( f , uiElementAttributeSymbol ) != null ).ToList();
|
||||||
|
List<ISymbol> uxmlTraitFields = fieldsList.Where( f => GetUxmlTraitAttributeData( f , uxmlTraitAttributeSymbol ) != null ).ToList();
|
||||||
foreach ( var VARIABLE in elementFields )
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
var uxmlTraitFields = fieldsList.Where( f => GetUxmlTraitAttributeData( f , uxmlTraitAttributeSymbol ) != null ).ToList();
|
|
||||||
var source = new StringBuilder( $@"// <auto-generated/>
|
var source = new StringBuilder( $@"// <auto-generated/>
|
||||||
|
|
||||||
using UnityEngine.UIElements;
|
using UnityEngine.UIElements;
|
||||||
@@ -146,7 +141,7 @@ public partial class {classSymbol.Name}
|
|||||||
|
|
||||||
foreach ( ISymbol fieldSymbol in uxmlTraitFields )
|
foreach ( ISymbol fieldSymbol in uxmlTraitFields )
|
||||||
{
|
{
|
||||||
source.AppendLine( GetAttributeInitialization( fieldSymbol , uxmlTraitAttributeSymbol ) );
|
source.AppendLine( GetAttributeInitialization( fieldSymbol ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
source.Append( $@" }}
|
source.Append( $@" }}
|
||||||
@@ -333,7 +328,7 @@ public partial class {classSymbol.Name}
|
|||||||
|
|
||||||
private static string GetQualifyingTypeName( ITypeSymbol type ) { return type.ToDisplayString( SymbolDisplayFormat.FullyQualifiedFormat ); }
|
private static string GetQualifyingTypeName( ITypeSymbol type ) { return type.ToDisplayString( SymbolDisplayFormat.FullyQualifiedFormat ); }
|
||||||
|
|
||||||
private string GetAttributeInitialization( ISymbol symbol , ISymbol attributeSymbol )
|
private string GetAttributeInitialization( ISymbol symbol )
|
||||||
{
|
{
|
||||||
// self.PlayerHealth = m_PlayerHealth.GetValueFromBag( bag , cc );
|
// self.PlayerHealth = m_PlayerHealth.GetValueFromBag( bag , cc );
|
||||||
return $" self.{symbol.Name} = {GetAttributeDescriptionName( symbol.Name )}.GetValueFromBag( bag , cc );";
|
return $" self.{symbol.Name} = {GetAttributeDescriptionName( symbol.Name )}.GetValueFromBag( bag , cc );";
|
||||||
|
|||||||
Reference in New Issue
Block a user