private GameObject CreateLayerGameObject(string name, E_LayerType type) { GameObject layer = new GameObject(name); layer.transform.SetParent(AppFacade.Instance.GetManager <UIMgr>(ManagerName.UI).UIContainer, false); layer.transform.localPosition = new Vector3(0f, 0f, (int)type) * -1f; layer.layer = _parentTransform.gameObject.layer; return(layer); }
/// <summary> /// 初始化,还没有显示,可以在重载中设置打开界面的动画方式,以及背景样式 /// </summary> protected virtual void OnInit() { _uiStyle = E_UIStyle.BackClose; _animationStyle = E_UIShowAnimStyle.Normal; _maskStype = E_UIMaskStyle.None; _uiLayerType = E_LayerType.NormalUI; Collider[] colliders = this.GetComponentsInChildren <Collider>(true); for (int i = 0, len = colliders.Length; i < len; i++) { Collider collider = colliders[i]; UIEventListener listener = UIEventListener.Get(collider.gameObject); listener.onClick = OnBtnClick; _listCollider.Add(collider); } }