mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 12:07:41 +02:00
minigame template
This commit is contained in:
@ -21,7 +21,7 @@ using System.IO;
|
||||
|
||||
namespace HeavenStudio
|
||||
{
|
||||
[UnitySourceGenerator(typeof(MinigameLoaderGenerator), OverwriteIfFileExists = false)]
|
||||
[UnitySourceGenerator(typeof(MinigameLoaderGenerator), OverwriteIfFileExists = true)]
|
||||
public partial class Minigames
|
||||
{
|
||||
public enum RecommendedControlStyle
|
||||
|
@ -110,7 +110,12 @@ namespace {context.TargetClass.Namespace}
|
||||
");
|
||||
|
||||
// USG: return true to tell USG to write content into OutputPath. false to do nothing.
|
||||
return true;
|
||||
// only write if changes are made.
|
||||
if (!System.IO.File.Exists(context.OutputPath))
|
||||
return true;
|
||||
|
||||
string oldContent = System.IO.File.ReadAllText(context.OutputPath);
|
||||
return sb.ToString() != oldContent;
|
||||
}
|
||||
|
||||
#pragma warning restore IDE0051
|
||||
|
Reference in New Issue
Block a user