public static void ResetDialogsCamera() { // NoFightMainView mainView = NoFightMainView.Inst; NGUI2DRootPanel uiRoot = NGUI2DRootPanel.Inst; Camera cam = uiRoot.mUICamera.GetComponent <Camera>(); for (int i = 0; i < mShowDialogs.Count; ++i) { if (mShowDialogs[i].DialogType == PopupDialogType.Bubble && mShowDialogs[i].DialogType == PopupDialogType.Bubble) { // if (null != mainView) // mShowDialogs[i].transform.parent = mainView.transform; } else { mShowDialogs[i].transform.parent = uiRoot.transform; } UIAnchor anchor = mShowDialogs[i].GetComponent <UIAnchor>(); if (null != anchor) { anchor.uiCamera = cam; anchor.enabled = true; } UIAnchor[] anchors = mShowDialogs[i].GetComponentsInChildren <UIAnchor>(); for (int n = 0; n < anchors.Length; ++n) { anchors[n].uiCamera = cam; anchors[n].enabled = true; } } }
void Start() { NGUI2DRootPanel root = NGUI2DRootPanel.Inst; if (null == root) { Debug.LogError("创建ScrollTableView[" + name + "]时NGUIRoot还未创建!"); Destroy(gameObject); return; } 滚动视图.onDragStarted = () => { OnStoppedMoving(); if (null != OnDragStarted) { OnDragStarted(); } }; 滚动视图.onDragFinished = () => { if (null != OnDragOvered) { OnDragOvered(); } }; 滚动视图.onStoppedMoving = OnStoppedMoving; 表格.OnReposed += new ScrollTableContainer.ReposEventHandler(OnTableReposed); }