Forum rules - please read before posting.

Event for when menus have faded out

Working with the Input System I came across a cursor related problem when closing menus during direct navigation.

I found a solution, but it required me to add an event to AC that fires each time a menu transition has completed (after being turned off). I can't use the OnMenuTurnOff event because it triggers before the menu is animated, it needs to trigger when the transitions has finished - that is to say at the end of Menu.EndTransitionOff().

I'd like to request an event like that be added to EventManager - maybe it could be called OnMenuTurnedOff or OnMenuTurnOffCompleted.

Thanks

Comments

  • Have you tried a coroutine? i.e.:

    void OnEnable () { EventManager.OnMenuTurnOff += OnMenuTurnOff; }
    void OnDisable () { EventManager.OnMenuTurnOff -= OnMenuTurnOff; }
    
    void OnMenuTurnOff (Menu menu, bool isInstant)
    {
        StartCoroutine (OnMenuTurnOffCo (menu, isInstant));
    }
    
    IEnumerator OnMenuTurnOffCo (Menu menu, bool isInstant)
    {
        if (!isInstant)
        {
            yield return new WaitForSeconds (menu.fadeSpeed);
        }   
        // Complete
    }
    
  • Ah, yes I can use that instead, thanks!

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.