diff --git a/FRBDK/Glue/EntityInputMovementPlugin/MainEntityInputMovementPlugin.cs b/FRBDK/Glue/EntityInputMovementPlugin/MainEntityInputMovementPlugin.cs
index 117330fdd..e90d79f94 100644
--- a/FRBDK/Glue/EntityInputMovementPlugin/MainEntityInputMovementPlugin.cs
+++ b/FRBDK/Glue/EntityInputMovementPlugin/MainEntityInputMovementPlugin.cs
@@ -114,7 +114,14 @@ private static void UpdatePlatformerCodePresenceInProject()
FlatRedBall.PlatformerPlugin.Generators.EnumFileGenerator.Self.GenerateAndSave();
FlatRedBall.PlatformerPlugin.Generators.IPlatformerCodeGenerator.Self.GenerateAndSave();
FlatRedBall.PlatformerPlugin.Generators.PlatformerAnimationControllerGenerator.Self.GenerateAndSave();
+ }
+ else
+ {
+ // see if there are any references to files which do not exist. If so, let's remove them:
+ GlueCommands.Self.ProjectCommands.RemoveFromProjects(FlatRedBall.PlatformerPlugin.Generators.EnumFileGenerator.Self.FileLocation);
+ GlueCommands.Self.ProjectCommands.RemoveFromProjects(FlatRedBall.PlatformerPlugin.Generators.IPlatformerCodeGenerator.Self.FileLocation);
+ GlueCommands.Self.ProjectCommands.RemoveFromProjects(FlatRedBall.PlatformerPlugin.Generators.PlatformerAnimationControllerGenerator.Self.FileLocation);
}
}
diff --git a/FRBDK/Glue/Glue/Plugins/ExportedInterfaces/CommandInterfaces/IProjectCommands.cs b/FRBDK/Glue/Glue/Plugins/ExportedInterfaces/CommandInterfaces/IProjectCommands.cs
index f68ece97f..2c47d8dde 100644
--- a/FRBDK/Glue/Glue/Plugins/ExportedInterfaces/CommandInterfaces/IProjectCommands.cs
+++ b/FRBDK/Glue/Glue/Plugins/ExportedInterfaces/CommandInterfaces/IProjectCommands.cs
@@ -63,7 +63,8 @@ public interface IProjectCommands
void MakeGeneratedCodeItemsNested();
///
- /// Removes the argument filePath from all currently-loaded files, and saves the projects.
+ /// Removes the argument filePath from all currently-loaded files, and optionally saves the projects if any file was removed
+ /// and if saveAfterRemoving is true..
///
/// The file path to remove
void RemoveFromProjects(FilePath filePath, bool saveAfterRemoving = true);
diff --git a/FRBDK/Glue/PlatformerPlugin/CodeGenerators/EnumFileGenerator.cs b/FRBDK/Glue/PlatformerPlugin/CodeGenerators/EnumFileGenerator.cs
index b44c04fe2..f2d683713 100644
--- a/FRBDK/Glue/PlatformerPlugin/CodeGenerators/EnumFileGenerator.cs
+++ b/FRBDK/Glue/PlatformerPlugin/CodeGenerators/EnumFileGenerator.cs
@@ -13,7 +13,8 @@ namespace FlatRedBall.PlatformerPlugin.Generators
{
public class EnumFileGenerator : Singleton
{
- string RelativeFileLocation => "Platformer/Enums.Generated.cs";
+ public string RelativeFileLocation => "Platformer/Enums.Generated.cs";
+ public FilePath FileLocation => (GlueState.Self.CurrentGlueProjectDirectory + RelativeFileLocation);
public void GenerateAndSave()
{
diff --git a/FRBDK/Glue/PlatformerPlugin/CodeGenerators/IPlatformerCodeGenerator.cs b/FRBDK/Glue/PlatformerPlugin/CodeGenerators/IPlatformerCodeGenerator.cs
index 03b99cac8..2b7fc17f8 100644
--- a/FRBDK/Glue/PlatformerPlugin/CodeGenerators/IPlatformerCodeGenerator.cs
+++ b/FRBDK/Glue/PlatformerPlugin/CodeGenerators/IPlatformerCodeGenerator.cs
@@ -10,6 +10,7 @@ namespace FlatRedBall.PlatformerPlugin.Generators
public class IPlatformerCodeGenerator : Singleton
{
string RelativeFileLocation => "Platformer/IPlatformer.Generated.cs";
+ public FilePath FileLocation => GlueState.Self.CurrentGlueProjectDirectory + RelativeFileLocation;
public void GenerateAndSave()
{
diff --git a/FRBDK/Glue/PlatformerPlugin/CodeGenerators/PlatformerAnimationControllerGenerator.cs b/FRBDK/Glue/PlatformerPlugin/CodeGenerators/PlatformerAnimationControllerGenerator.cs
index 473e2c4cf..246084d2d 100644
--- a/FRBDK/Glue/PlatformerPlugin/CodeGenerators/PlatformerAnimationControllerGenerator.cs
+++ b/FRBDK/Glue/PlatformerPlugin/CodeGenerators/PlatformerAnimationControllerGenerator.cs
@@ -1,6 +1,7 @@
using FlatRedBall.Glue.Managers;
using FlatRedBall.Glue.Plugins.ExportedImplementations;
using FlatRedBall.Glue.SaveClasses;
+using FlatRedBall.IO;
using System;
using System.Collections.Generic;
using System.Text;
@@ -10,6 +11,7 @@ namespace FlatRedBall.PlatformerPlugin.Generators
public class PlatformerAnimationControllerGenerator : Singleton
{
string RelativeFileLocation => "Platformer/PlatformerAnimationController.Generated.cs";
+ public FilePath FileLocation => GlueState.Self.CurrentGlueProjectDirectory + RelativeFileLocation;
public void GenerateAndSave()