-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
12,462 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Nautilus.Utility; | ||
|
||
namespace Nautilus.Assets; | ||
|
||
/// <summary> | ||
/// Represents extension methods for the <see cref="CustomPrefab"/> class. | ||
/// </summary> | ||
public static class CustomPrefabExtensions | ||
{ | ||
/// <summary> | ||
/// Removes the current prefab from the prefab cache and doesn't allow it to get cached later. | ||
/// </summary> | ||
/// <param name="customPrefab">The custom prefab to remove from the prefab cache.</param> | ||
/// <returns>A reference to this instance after the operation has completed.</returns> | ||
public static ICustomPrefab RemoveFromCache(this CustomPrefab customPrefab) | ||
{ | ||
if (customPrefab.Info == default) | ||
{ | ||
return customPrefab; | ||
} | ||
|
||
if (string.IsNullOrWhiteSpace(customPrefab.Info.ClassID)) | ||
{ | ||
InternalLogger.Error($"Couldn't remove prefab '{customPrefab.Info}' from cache because the class ID is null."); | ||
return customPrefab; | ||
} | ||
|
||
ModPrefabCache.RemovePrefabFromCache(customPrefab.Info.ClassID); | ||
|
||
return customPrefab; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.