Forum rules - please read before posting.

Unity UI-based menus and changing background

Hello.
Sry for my english.

I have several Unity based UI menus. Is there any way to change the image-background? I have already done this in another menu using animation, which I started immediately after calling the menu in Action Lists. Now I need to do the same trick with the pause menu and I'm a little confused because I can't start the animation immediately after opening the menu using hotkeys.

In other words, I can do this with a menu that is called only from Action Lists. But I can't do this with those menus that I launch using hotkeys or from another menu ("Menu to switch to"). Because I do not know how in this case to start the animation immediately after opening the menu, as I did before.

Thx

Comments

  • Why can't you start the animation, wouldn't it be possible to set the Animator to unscaled time, so it runs even when paused?
    Doesn't it work with Object -> Animate in your action list, right after pressing the button?

  • In fact, the main problem was the main pause menu. I didn't know how to launch the Action List immediately after loading the menu, if I launch the menu using a hotkey (for example escape). I remembered about AC Active Input Editor (It has an option "Action List When Trigger") and now my problem is solved.

    Thanks.

  • I have a new question.
    I can't realised skipping the cutscene from the pause menu in any way.
    I can do this with a hotkey, and I can assign a hotkey to a menu button. But I can't get the menu to close automatically when I click on the menu button to which the hotkey is attached. In order for this to work now, I need to click on the skip cutscene button in the menu, and then manually close the pause menu.

    I didn't find any other realisation besides the "EndCutscene input button."
    Thx Alot

  • With scripting, you can hook into the OnSkipCutscene custom event to close the Pause menu when a cutscene is skipped.

    Try this: copy/paste the code below into a C# file named ClosePauseMenuWhenSkipCutscene, and attach it to a GameObject in your scene.

    using UnityEngine;
    using AC;
    
    public class ClosePauseMenuWhenSkipCutscene : MonoBehaviour
    {
    
        private void OnEnable () { EventManager.OnSkipCutscene += OnSkipCutscene; }
        private void OnDisable () { EventManager.OnSkipCutscene -= OnSkipCutscene; }
    
        private void OnSkipCutscene ()
        {
            PlayerMenus.GetMenuWithName ("Pause").TurnOff ();
        }
    
    }
    

    However, skipping input itself is only registered while the game is in "Cutscene" mode - not when the game is paused.

    You can override this, however, by running the EndCutscene function manually through script:

    AC.KickStarter.actionListManager.EndCutscene ();
    
  • Thank you so much for your time, Chris.
    Now I have more clarity. It works perfectly.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.