Use GameManager.instance.ChangeToScene() won't work, because it doesn't set up all the environment (e.g. enter/leave) necessary for a GG fight. It doesn't trigger USceneManager.activeSceneChanged event for mod to detect transition, too.
The following approaches are closer to normal game, which has the benefits of covering some of the necessary environment automatically.
The code which selects challenge level in the menu assumes that the menu started at challenge 0.
This can be wrong assumption because menu can remember last challenge position.
// warp
HeroController.instance.gameObject.transform.position = StatuePos;
// interact with menu
yield return new WaitForSeconds(0.1f);
yield return Up(0.1f);
yield return new WaitForSeconds(1);
for (int i = 0; i < ChallengeLevel; i++)
{
yield return Down(0.1f);
}
yield return Jump(0.1f);
Anti-approach
Use
GameManager.instance.ChangeToScene()
won't work, because it doesn't set up all the environment (e.g. enter/leave) necessary for a GG fight. It doesn't triggerUSceneManager.activeSceneChanged
event for mod to detect transition, too.The following approaches are closer to normal game, which has the benefits of covering some of the necessary environment automatically.
Source code for the following approaches:
https://github.com/royitaqi/HollowKnight.BossAttacks/blob/ad3b2a8023d9e2f00789344aad193d6ccd7486ef/BossAttacks/Utils/E2eTestUtils.cs
Approach 1: via Scene Change
Notes:
Approach 2: via HoG Statue
Notes:
Assumptions:
Approach 3: via Challenge Menu
Notes:
Assumptions: