Forum rules - please read before posting.

can't find coroutine RecalcWebMenus

I hope someone can offer me a quick headsup for this problem,
Exporting for PC&Mac works just fine, but whenever I want to export for HTML 5
I get this error:

Assets\AdventureCreator\Scripts\Controls\PlayerMenus.cs(190,20): error CS0103: The name 'RecalcWebMenus' does not exist in the current context

I'm working on 2020.31f1(LTS) with AC v.1.74.4

Comments

  • I commented out this peace, and it compiles..
    But I'm not shure what I just switched off....

    /* #if (UNITY_WEBPLAYER || UNITY_WEBGL) && !UNITY_EDITOR
    // WebPlayer takes another second to get the correct screen dimensions
    StartCoroutine (RecalcWebMenus ());
    KickStarter.eventManager.Call_OnGenerateMenus ();
    #else
    KickStarter.eventManager.Call_OnGenerateMenus ();
    CycleMouseOverUIs ();
    #endif
    */

  • Welcome to the community, @Henk. My apologies for the trouble.

    Commenting out the code entirely will cause some other knock-on issues with your menus. Instead, uncomment the lines and add the following function beneath:

    private IEnumerator RecalcWebMenus ()
    {
        yield return null;
        foreach (AC.Menu menu in menus)
        {
            menu.Recalculate ();
        }
        CycleMouseOverUIs ();
    }
    

    I shall make the same change to the official release - thanks for the alert.

  • edited December 2021

    Thanks for making me feel welcome Chris and thanks for the quick response.
    I will follow your advise

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.