Skip to content

Commit

Permalink
Skippable saber model pre-init
Browse files Browse the repository at this point in the history
  • Loading branch information
Auros committed May 22, 2023
1 parent ca4f5c9 commit 4dc3ee0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion SiraUtil/Interfaces/IPreSaberModelInit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public interface IPreSaberModelInit
/// </summary>
/// <param name="parent">The parent of the saber model.</param>
/// <param name="saber">The saber component associated with the current model.</param>
void PreInit(Transform parent, Saber saber);
/// <returns>Do you want the original Init to run?</returns>
bool PreInit(Transform parent, Saber saber);
}
}
6 changes: 3 additions & 3 deletions SiraUtil/Sabers/SaberModelProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ private void DefaultSaberPrefabSwap(ref SaberModelContainer __instance, ref Sabe

[AffinityPrefix]
[AffinityPatch(typeof(SaberModelController), nameof(SaberModelController.Init))]
private void PreInit(ref SaberModelController __instance, Transform parent, Saber saber)
private bool PreInit(ref SaberModelController __instance, Transform parent, Saber saber)
{
var runner = __instance.GetComponent<IPreSaberModelInit>();
if (runner == null)
return;
return true;

runner.PreInit(parent, saber);
return runner.PreInit(parent, saber);
}


Expand Down
2 changes: 1 addition & 1 deletion SiraUtil/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "SiraUtil",
"name": "SiraUtil",
"author": "Auros",
"version": "3.1.3-dev.2",
"version": "3.1.3-dev.3",
"icon": "SiraUtil.Resources.logo.png",
"description": "A powerful utility mod which expands the capabilities and provides more tools to Beat Saber modders.",
"gameVersion": "1.29.4",
Expand Down

0 comments on commit 4dc3ee0

Please sign in to comment.