public void SetLayer(GameObject go, EUILayerType type) { int t = (int)type; GameObject layerobj = mLayerDic[t]; CSAssist.SetParent(mLayerDic[t].transform, go, true); }
private void AddWindowToWidgetRoot <T>(Transform transform) { UIManager.Instance.CreatePanel <T>((ui) => { CSAssist.SetParent(transform, ui.gameObject, true); }); }
private GameObject CreateLayerGameObject(string name, Transform parent, EUILayerType type) { GameObject layer = new GameObject(name); CSAssist.SetParent(parent, layer); RectTransform rectTransform = layer.AddComponent <RectTransform>();; rectTransform.anchorMax = Vector2.one; rectTransform.anchorMin = Vector2.zero; rectTransform.offsetMax = Vector2.zero; rectTransform.offsetMin = Vector2.zero; int z = ((int)type) * -1; //由于界面上存在层级设置,不能再直接修改UILayerType的层级(新增可以 修改不行) 所以之后的z轴修改在这里处理 layer.transform.localPosition = new Vector3(0f, 0f, z); return(layer); }