-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Helper Methods for Scene Loading #93
base: main
Are you sure you want to change the base?
Conversation
BoneLib/BoneLib/HelperMethods.cs
Outdated
MelonCoroutines.Start(FadeIntoLevel(new Barcode(levelBarcode), new Barcode(loadLevelBarcode), fastFade)); | ||
} | ||
|
||
private static IEnumerator FadeIntoLevel(Barcode level, Barcode loadScene, bool fastFade = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method has errors, fixed:
private static System.Collections.IEnumerator FadeIntoLevel(Barcode level, Barcode loadScene, bool fastFade = false)
{
if (fastFade)
{
SpawnCrate(CommonBarcodes.Misc.LoadFadeFast, Vector3.zero);
yield return new WaitForSeconds(0.5f);
}
else
{
SpawnCrate(CommonBarcodes.Misc.LoadFade, Vector3.zero);
yield return new WaitForSeconds(2);
}
LoadLevel(level.ID, loadScene.ID);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, should be fixed now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested (pressed the "Load Random Level" in the DefaultMenu which was updated to use FadeLoadLevel. I do not believe it needs more testing than that as most of the code is the same), seems to work just fine
Also added the two types of LoadFade barcodes to CommonBarcodes
(this was all done on a chromebook via vscode, there may be errors and stuff)