public void UseBlurChanged(AbstractUI ui, bool enable) { if (m_isBlurActive && ui.get_gameObject().get_activeInHierarchy() && m_uiToNode.ContainsKey(ui)) { m_updateOrder = true; } }
public void EnableStateChanged(AbstractUI ui, bool enable) { if (m_uiToNode.ContainsKey(ui)) { m_updateOrder = true; } }
public void NotifyUIDepthChanged(AbstractUI ui, StateContext state, int index = -1) { if (m_uiToNode.TryGetValue(ui, out Node value)) { value.uis.Remove(ui); m_uiToNode.Remove(ui); } else { ui.canvas.set_worldCamera(m_cameraPrefab); } Node orCreateNode = GetOrCreateNode(state); if (index == -1) { orCreateNode.uis.Add(ui); } else { orCreateNode.uis.Insert(index, ui); } m_uiToNode.Add(ui, orCreateNode); if (ui.get_gameObject().get_activeInHierarchy()) { m_updateOrder = true; } }
public void ActiveBlurFor(AbstractUI linkedUI) { m_hasBlur = true; EnableBlur(value: true); m_linkedBlurUI = linkedUI; m_linkedBlurUI.onBlurFactorIsFull = OnBlurFactorIsFull; m_linkedBlurUI.onBlurFactorStartDecrease = OnBlurFactorStartDecrease; }
private void SetUINodeOrder(Node node, ref UICamera uiCamera, ref int sortingOrder) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) List <Node> children = node.children; int count = children.Count; for (int i = 0; i < count; i++) { Node node2 = children[i]; if (node2.renderBeforeParent) { SetUINodeOrder(node2, ref uiCamera, ref sortingOrder); } } List <AbstractUI> uis = node.uis; int count2 = uis.Count; for (int j = 0; j < count2; j++) { AbstractUI abstractUI = uis[j]; if (!abstractUI.get_gameObject().get_activeInHierarchy()) { continue; } if ((int)abstractUI.canvas.get_renderMode() == 0) { abstractUI.canvas.set_sortingOrder(sortingOrder); sortingOrder++; continue; } if (m_isBlurActive && abstractUI.useBlur) { UICamera child = uiCamera; uiCamera = m_cameraPool.Get(); uiCamera.ActiveBlurFor(abstractUI); uiCamera.child = child; } if (uiCamera == null) { uiCamera = m_cameraPool.Get(); } uiCamera.uis.Add(abstractUI); abstractUI.canvas.set_worldCamera(uiCamera.camera); } for (int k = 0; k < count; k++) { Node node3 = children[k]; if (!node3.renderBeforeParent) { SetUINodeOrder(node3, ref uiCamera, ref sortingOrder); } } }
public void Clean() { m_hasBlur = false; EnableBlur(value: false); if (m_linkedBlurUI != null) { m_linkedBlurUI.onBlurFactorIsFull = null; m_linkedBlurUI.onBlurFactorStartDecrease = null; m_linkedBlurUI = null; } uis.Clear(); child = null; }
private void UpdateOrder() { m_cameraPool.ReleaseAll(); if (m_uiToNode.Count == 0) { return; } int sortingOrder = 0; UICamera uiCamera = null; int count = m_rootNodes.Count; for (int i = 0; i < count; i++) { Node node = m_rootNodes[i]; SetUINodeOrder(node, ref uiCamera, ref sortingOrder); } bool flag = false; float num = 0f; for (int num2 = m_cameraPool.busyCameras.Count - 1; num2 >= 0; num2--) { UICamera uICamera = m_cameraPool.busyCameras[num2]; uICamera.camera.set_nearClipPlane(num); num += (float)m_defaultUiStep; for (int num3 = uICamera.uis.Count - 1; num3 >= 0; num3--) { AbstractUI abstractUI = uICamera.uis[num3]; num += (float)m_defaultUiDepth; abstractUI.canvas.set_planeDistance(num); } num += (float)m_defaultUiStep; uICamera.camera.set_farClipPlane(num); if (uICamera.hasBlur) { if (flag) { uICamera.NeedToDisplayBlur(value: false); } else { uICamera.NeedToDisplayBlur(value: true); flag = uICamera.isFullBlur; } } } lastSortingOrder = sortingOrder; lastDepth = num; }
public void NotifyUIDestroyed(AbstractUI ui) { if (!m_uiToNode.TryGetValue(ui, out Node value)) { return; } value.uis.Remove(ui); m_uiToNode.Remove(ui); if (CanBeRemoved(value)) { Node parent = value.parent; while (parent != null && parent.children.Count == 1 && parent.uis.Count == 0) { value = parent; parent = value.parent; } RemoveNode(value); } m_updateOrder = true; }