Hi Tony,
I'm wondering if I can use the built in menu system to add sort of a death screen like so:
Player death event triggered, death music plays, screen fades to black, cinemachine zoom onto the player's dead body. Then a restart from last save point option appears. Is the menu system the best way to go about doing this?
Menu system - death screen?
Re: Menu system - death screen?
I don't think you need the menu system for that part (loading the last save). You can just call PixelCrushers.SaveSystem.LoadFromSlot(#), where # is your saved game slot. If the player can save in multiple slots, you can keep track of the last slot number saved and specify that for #. If you're using the Menu Framework, you can check the PlayerPrefs key "savedgame_lastSlotNum":
Code: Select all
if (PlayerPrefs.HasKey("savedgame_lastSlotNum"))
{
int slot = PlayerPrefs.GetInt("savedgame_lastSlotNum");
PixelCrushers.SaveSystem.LoadFromSlot(slot);
}
I'm not clear on the order of events here. If you fade to black, won't the player be unable to see the dead body?chrislow19 wrote: ↑Sun Mar 15, 2020 2:16 pmPlayer death event triggered, death music plays, screen fades to black, cinemachine zoom onto the player's dead body.
-
- Posts: 34
- Joined: Mon Dec 30, 2019 4:26 pm
Re: Menu system - death screen?
Hi Tony, thanks! Good point, I have an idea in my head of how I want it to play out but I suppose I can't describe it quite as well. I'll figure that part out.
As far as the menu system goes, I just want to give the option to load from a save slot or quit to main menu once player death does occur, rather than an immediate reload.
As far as the menu system goes, I just want to give the option to load from a save slot or quit to main menu once player death does occur, rather than an immediate reload.
Re: Menu system - death screen?
In that case, you can make a new panel in the MenuSystem. Maybe start by duplicating the PausePanel. Delete all buttons except for Load Game and Quit To Menu. When the player dies, call this panel's UIPanel.Open() method.chrislow19 wrote: ↑Sun Mar 15, 2020 4:50 pmAs far as the menu system goes, I just want to give the option to load from a save slot or quit to main menu once player death does occur, rather than an immediate reload.
-
- Posts: 34
- Joined: Mon Dec 30, 2019 4:26 pm
Re: Menu system - death screen?
Hey! Got it working. Thanks! I didn't realize it would be that simple.
Re: Menu system - death screen?
Awesome! Glad to help.