Skip to content

Commit e75da7a

Browse files
committed
chore: template
1 parent 20cbeb4 commit e75da7a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Template/Template_MethodGenerator.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using UnityEditor;
1313
//[UnitySourceGenerator(typeof(#SCRIPTNAME#), OverwriteIfFileExists = false)]
1414
public partial class #SCRIPTNAME#
1515
{
16-
#if UNITY_EDITOR // USG: Generator methods should not be included in build
16+
#if UNITY_EDITOR // USG: class definition is required to avoid build error but methods are not.
1717
#pragma warning disable IDE0051
1818

1919
readonly static string MEMBER_ACCESS = "internal";
@@ -23,7 +23,7 @@ using UnityEditor;
2323
static bool Emit(USGContext context, StringBuilder sb)
2424
{
2525
// USG: static classes are IsAbstract is set.
26-
if (!context.TargetClass.IsClass || context.TargetClass.IsAbstract)
26+
if (!context.TargetClass.IsClass)
2727
return false; // return false to tell USG doesn't write file.
2828

2929
// USG: you can modify output path. default file name is that USG generated.

Template/Template_SelfEmitGenerator.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using UnityEditor;
1313
[UnitySourceGenerator(OverwriteIfFileExists = false)]
1414
partial class #SCRIPTNAME#
1515
{
16-
#if UNITY_EDITOR // USG: Generator methods should not be included in build
16+
#if UNITY_EDITOR // USG: class definition is required to avoid build error but methods are not.
1717
#pragma warning disable IDE0051
1818

1919
readonly static string MEMBER_ACCESS = "internal";
@@ -23,7 +23,7 @@ using UnityEditor;
2323
static bool Emit(USGContext context, StringBuilder sb)
2424
{
2525
// USG: static classes are IsAbstract is set.
26-
if (!context.TargetClass.IsClass || context.TargetClass.IsAbstract)
26+
if (!context.TargetClass.IsClass)
2727
return false; // return false to tell USG doesn't write file.
2828

2929
// USG: you can modify output path. default file name is that USG generated.

0 commit comments

Comments
 (0)