protected override void OnViewInit()
    {
        //Debug.Log("Customise init");

        if (!GuiOptions.customControlsInitialised)
        {
            GuiHUD.StoreControlsPositions();
        }

        m_Controls.Add(new CustomControl()
        {
            m_Name = "FireDummy", m_OptionsPos = GuiOptions.FireUseButton
        });
        m_Controls.Add(new CustomControl()
        {
            m_Name = "ReloadDummy", m_OptionsPos = GuiOptions.ReloadButton
        });
        m_Controls.Add(new CustomControl()
        {
            m_Name = "RollDummy", m_OptionsPos = GuiOptions.RollButton
        });
        m_Controls.Add(new CustomControl()
        {
            m_Name = moveDummyName, m_OptionsPos = GuiOptions.MoveStick
        });
        m_Controls.Add(new CustomControl()
        {
            m_Name = "WeaponsDummy", m_OptionsPos = GuiOptions.WeaponButton
        });
        //m_Controls.Add(new CustomControl(){m_Name = "PauseDummy", m_OptionsPos = GuiOptions.PauseButton});
        m_Controls.Add(new CustomControl()
        {
            m_Name = "SprintDummy", m_OptionsPos = GuiOptions.SprintButton
        });

        for (int i = 0; i < GuiOptions.GadgetButtons.Length; i++)
        {
            m_Controls.Add(new CustomControl()
            {
                m_Name = gadgetDummnyName + (i + 1), m_OptionsPos = GuiOptions.GadgetButtons[i]
            });
        }

        //init all sprites
        foreach (CustomControl c in m_Controls)
        {
            GUIBase_Sprite sprite = GuiBaseUtils.PrepareSprite(m_ScreenLayout, c.m_Name);
            c.m_WidgetDummy = sprite.Widget;
            c.m_Transform   = c.m_WidgetDummy.transform;
        }
    }
Beispiel #2
0
    void WaitForLogGui()
    {
        // TODO - potrebuji robustni test, jestli uz byl level obsahujici GUI doloadovan a vse z nej bylo inicializovano
        // To co nasleduje rozhodne ROBUSTNI test neni
        // snazim se najit root platformu a pokud tam je, mela by byt zaregistrovana (ze sveho Startu), podivam se, jestli se uz updatla
        // To znamena, ze vse uz je loadle, zaregistrovane a uz se updatuje...

        // Debug.Log("mission waitfor gui");

        GUIBase_Platform p = MFGuiManager.Instance.FindPlatform("Gui_16_9");

        if (p && p.IsInitialized())
        {
            GuiHUD.StoreControlsPositions();
            StartCoroutine(PrepareForStart());
        }
        else
        {
            Invoke("WaitForLogGui", 0.1f);
        }
    }