Ejemplo n.º 1
0
    void Update()
    {
                #if UNITY_EDITOR
        if (UnityEditor.EditorApplication.isCompiling)
        {
            OnAssemblyReload();
        }
                #endif

        if (!IsReady())
        {
            StartCoroutine(InitializeUISystemRenderer());
        }

        if (m_UISystem != null)
        {
            IsUpdating = true;

            //CheckIfMouseOnUI(); // we do not need this for Mixed Reality JB

            m_UISystem.ClearTextures();
            if (m_LiveViewHandlesArray.Length > 0)
            {
                m_UISystem.UserImagesChanged(m_LiveViewHandlesArray, (uint)m_LiveViewHandlesArray.Length);
            }

            // UISystem.Advance() should be called before View.Layout() when using Dx9 renderer or
            // UI textures won't be recreated on application resizing that triggers Dx9 DeviceLost;
            // this is also recommended for optimal performance in all renderers
            m_UISystem.Advance();
            for (int i = 0; i < m_Views.Count; ++i)
            {
                m_Views[i].Layout();
            }

            if (m_ReadyHandlers.Count > 0)
            {
                foreach (var handler in m_ReadyHandlers)
                {
                    handler();
                }
                m_ReadyHandlers.Clear();
            }

            TrackInputFocus();

            SendShiftEventData();

            IsUpdating = false;
        }
    }