public XY_UILayer.Layer GetUILayer() { // 2014.06.19 添加层次信息 XY_UILayer uiLayer = gameObject.GetComponent <XY_UILayer>(); //Layer = uiLayer.layer; if (uiLayer == null) { return(XY_UILayer.Layer.MainBarLayer); } return(uiLayer.layer); }
static void RefreshPanelDepth(GameObject goPanel) { XY_UILayer uiLayer = goPanel.GetComponent <XY_UILayer>(); if (uiLayer) { int nDelta = 400 * uiLayer.GetLayerbase(); int nZDelta = -1000 * uiLayer.GetLayerbase(); UIPanel[] uiPanels = goPanel.GetComponentsInChildren <UIPanel>(true); if (uiPanels.Length > 0) { Vector3 pos = uiPanels[0].gameObject.transform.localPosition; pos.z += nZDelta; uiPanels[0].gameObject.transform.localPosition = pos; } for (int i = 0; i < uiPanels.Length; ++i) { uiPanels[i].depth += nDelta; } } }