private void CreateObjects() { this.btnTab = base.transform.Find("tab").GetComponent<UIToggle>(); EventDelegate.Add(this.btnTab.onChange, new EventDelegate.Callback(this.OnTabCheckChanged)); this.txtTab = this.btnTab.transform.Find("tabTxt").GetComponent<UILabel>(); this.txtTab2 = this.btnTab.transform.Find("tabCheck/tabTxt").GetComponent<UILabel>(); Transform transform = base.transform.Find("tabPanel"); this.topBtn = GameUITools.RegisterClickEvent("TopBtn", new UIEventListener.VoidDelegate(this.OnTopBtnClick), transform.gameObject); this.topBtn.SetActive(false); this.bottomBtn = GameUITools.RegisterClickEvent("BottomBtn", new UIEventListener.VoidDelegate(this.OnBottomBtnClick), transform.gameObject); this.bottomBtn.SetActive(false); this.btnsTable = transform.Find("tabBtnsPanel/tabBtns").GetComponent<UITable>(); this.scrollBar = transform.Find("scrollBar").GetComponent<UIScrollBar>(); EventDelegate.Add(this.scrollBar.onChange, new EventDelegate.Callback(this.OnScrollBarValueChange)); this.txtTab.text = this.initData.strName; this.txtTab2.text = this.initData.strName; if (this.initData.strName.Length > 2) { this.txtTab.spacingX = 5; this.txtTab2.spacingX = 5; } this.infoTable = transform.Find("bg/infoPanel/infoContents").GetComponent<UITable>(); this.infoTitle = this.infoTable.transform.Find("Label0").GetComponent<UILabel>(); this.infoTitle.spaceIsNewLine = false; this.infoContent = this.infoTable.transform.Find("Label1").GetComponent<UILabel>(); this.infoContent.spaceIsNewLine = false; UIEventListener expr_206 = UIEventListener.Get(this.infoContent.gameObject); expr_206.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_206.onClick, new UIEventListener.VoidDelegate(this.OnInfoContentClick)); }
protected override void Awake() { base.Awake(); Arguments.ValidateNotNull(rowPrefab); _table = gameObject.GetSafeFirstMonoBehaviourInChildren<UITable>(); _table.sorting = UITable.Sorting.Custom; _cmdLookup = new Dictionary<GameObject, IFleetCmdItem>(); }
public void Init() { this.ResetTimer = base.transform.Find("time1").GetComponent<UILabel>(); Transform transform = base.transform.Find("RewardBK"); this.Title = transform.transform.Find("Title").GetComponent<UILabel>(); this.Reward = transform.transform.Find("Reward"); this.Price = transform.transform.Find("Price").GetComponent<UILabel>(); this.OffPrice = transform.transform.Find("OffPrice").GetComponent<UILabel>(); this.BuyVIPLevel = transform.transform.Find("BuyVIPLevel").GetComponent<UILabel>(); this.CurVipLevel = transform.transform.Find("CurVipLevel").GetComponent<UILabel>(); this.ToBuy = transform.transform.Find("GoBtn"); this.Buyed = transform.transform.Find("Buy"); UIEventListener expr_105 = UIEventListener.Get(this.ToBuy.gameObject); expr_105.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_105.onClick, new UIEventListener.VoidDelegate(this.OnBuyVipWeekReward)); this.rewardScrollView = base.transform.Find("rewardPanel").GetComponent<UIScrollView>(); this.rewardTable = this.rewardScrollView.transform.Find("rewardContents").GetComponent<UITable>(); for (int i = 0; i <= 15; i++) { this.VIPLevel[i] = this.rewardTable.transform.Find(string.Format("{0:D2}", i)).GetComponent<UISprite>(); UIEventListener expr_1A7 = UIEventListener.Get(this.VIPLevel[i].gameObject); expr_1A7.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_1A7.onClick, new UIEventListener.VoidDelegate(this.OnVIPLevelClicked)); } this.mTabBtnScrollBar = base.transform.Find("scrollBar").GetComponent<UIScrollBar>(); EventDelegate.Add(this.mTabBtnScrollBar.onChange, new EventDelegate.Callback(this.OnScrollBarValueChange)); this.leftBtn = base.transform.Find("LeftBtn").gameObject; this.rightBtn = base.transform.Find("RightBtn").gameObject; UIEventListener expr_24D = UIEventListener.Get(this.leftBtn); expr_24D.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_24D.onClick, new UIEventListener.VoidDelegate(this.OnLeftBtnClicked)); UIEventListener expr_279 = UIEventListener.Get(this.rightBtn); expr_279.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_279.onClick, new UIEventListener.VoidDelegate(this.OnRightBtnClicked)); this.RefreshCurLevelToggle(); this.RefreshCurLevelInfo(); }
public override void Awake() { base.Awake(); _uiTable = GetComponent<UITable>(); _uiGrid = GetComponent<UIGrid>(); _itemTemplate = gameObject.GetComponent<NguiListItemTemplate>(); }
override protected void OnUpdate (float factor, bool isFinished) { Vector3 result = from * (1f - factor) + to * factor; if (result.x < 0.00001f && result.x > -0.00001f) { result = new Vector3(0.001f, result.y, result.z); Mogo.Util.LoggerHelper.Debug("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ MaiFeo Debug when divid zero"); } if (result.y < 0.00001f && result.y > -0.00001f) { result = new Vector3(result.x, 0.001f, result.z); Mogo.Util.LoggerHelper.Debug("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ MaiFeo Debug when divid zero"); } if (result.z < 0.00001f && result.z > -0.00001f) { result = new Vector3(result.x, result.y, 0.001f); Mogo.Util.LoggerHelper.Debug("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ MaiFeo Debug when divid zero"); } cachedTransform.localScale = result; if (updateTable) { if (mTable == null) { mTable = NGUITools.FindInParents<UITable>(gameObject); if (mTable == null) { updateTable = false; return; } } mTable.repositionNow = true; } }
private void Awake() { this.rechargeScrollView = base.transform.FindChild("contentsPanel").GetComponent<UIScrollView>(); this.rechargeTable = this.rechargeScrollView.transform.FindChild("infoContents").gameObject.AddComponent<UITable>(); this.rechargeTable.columns = 3; this.rechargeTable.direction = UITable.Direction.Down; this.rechargeTable.sorting = UITable.Sorting.None; this.rechargeTable.hideInactive = true; this.rechargeTable.keepWithinPanel = true; this.rechargeTable.padding = new Vector2(6f, 0f); int privilege = Globals.Instance.CliSession.Privilege; foreach (PayInfo current in Globals.Instance.AttDB.PayDict.Values) { if (!current.Test || privilege > 0) { if (current.Type == 0) { UIRechargeItem uIRechargeItem = UIRechargeItem.CreateItem(this.rechargeTable.transform, this.rechargeScrollView); uIRechargeItem.Init(current); } else { UIMonthCard uIMonthCard = UIMonthCard.CreateItem(this.rechargeTable.transform, this.rechargeScrollView); uIMonthCard.Init(current); } } } }
protected override void Awake() { base.Awake(); Arguments.ValidateNotNull(rowPrefab); _table = gameObject.GetSafeFirstMonoBehaviourInChildren<UITable>(); _table.sorting = UITable.Sorting.Custom; _systemLookup = new Dictionary<GameObject, ISystemItem>(); _doneButtonGo = gameObject.GetComponentInChildren<InputModeControlButton>().gameObject; }
private static int RepositionOnlyOneLevel(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 1); UITable uITable = (UITable)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UITable"); uITable.RepositionOnlyOneLevel(); return(0); }
protected virtual void OnDragDropRelease(GameObject surface) { if (!this.cloneOnDrag) { UIDragScrollView[] componentsInChildren = base.GetComponentsInChildren <UIDragScrollView>(); UIDragScrollView[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { UIDragScrollView uIDragScrollView = array[i]; uIDragScrollView.scrollView = null; } if (this.mButton != null) { this.mButton.isEnabled = true; } else if (this.mCollider != null) { this.mCollider.enabled = true; } else if (this.mCollider2D != null) { this.mCollider2D.enabled = true; } UIDragDropContainer uIDragDropContainer = (!surface) ? null : NGUITools.FindInParents <UIDragDropContainer>(surface); if (uIDragDropContainer != null) { this.mTrans.parent = ((!(uIDragDropContainer.reparentTarget != null)) ? uIDragDropContainer.transform : uIDragDropContainer.reparentTarget); Vector3 localPosition = this.mTrans.localPosition; localPosition.z = 0f; this.mTrans.localPosition = localPosition; } else { this.mTrans.parent = this.mParent; } this.mParent = this.mTrans.parent; this.mGrid = NGUITools.FindInParents <UIGrid>(this.mParent); this.mTable = NGUITools.FindInParents <UITable>(this.mParent); if (this.mDragScrollView != null) { base.Invoke("EnableDragScrollView", 0.001f); } NGUITools.MarkParentAsChanged(base.gameObject); if (this.mTable != null) { this.mTable.repositionNow = true; } if (this.mGrid != null) { this.mGrid.repositionNow = true; } } this.OnDragDropEnd(); if (this.cloneOnDrag) { this.DestroySelf(); } }
public void Init() { GameUITools.RegisterClickEvent("FadeBG", new UIEventListener.VoidDelegate(this.OnCloseClick), base.gameObject); this.mWinBG = GameUITools.FindGameObject("winBG", base.gameObject); this.mCloseBtn = GameUITools.RegisterClickEvent("closeBtn", new UIEventListener.VoidDelegate(this.OnCloseClick), this.mWinBG); this.mFinishBtn = GameUITools.RegisterClickEvent("finishBtn", new UIEventListener.VoidDelegate(this.OnFinishClick), this.mWinBG); this.mPanel = GameUITools.FindGameObject("panel", this.mWinBG).GetComponent<UIPanel>(); this.mTable = GameUITools.FindGameObject("contents", this.mPanel.gameObject).GetComponent<UITable>(); }
/// <summary> /// Update the table, if there is one. /// </summary> void UpdateTable() { UITable table = NGUITools.FindInParents <UITable>(gameObject); if (table != null) { table.repositionNow = true; } }
void Start() { mGrid = gameObject.GetComponentInChildren <UITable>(); mScrollView = gameObject.GetComponent <UIScrollView>(); mScrollBar = gameObject.transform.parent.GetComponentInChildren <UIScrollBar>(); _Panel = gameObject.GetComponent <UIPanel>(); mDragonMallCellList = new List <UIDragonMallCell>(); InitCell(); }
private void OnFinished() { isPlaying = false; if (uiTable != null) { uiTable.Reposition(); uiTable = null; } }
static int GetChildList(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 1); UITable obj = (UITable)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UITable"); List <Transform> o = obj.GetChildList(); LuaScriptMgr.PushObject(L, o); return(1); }
public override void OnEnter() { table = gameObject.Value.GetComponent <UITable> (); table.Reposition(); if (!everyFrame) { Finish(); } }
/// <summary> /// Perform any logic related to starting the drag & drop operation. /// </summary> protected virtual void OnDragDropStart() { // Automatically disable the scroll view if (mDragScrollView != null) { mDragScrollView.enabled = false; } // Disable the collider so that it doesn't intercept events if (mCollider != null) { mCollider.enabled = false; } mTouchID = UICamera.currentTouchID; mParent = mTrans.parent; mRoot = NGUITools.FindInParents <UIRoot>(mParent); mGrid = NGUITools.FindInParents <UIGrid>(mParent); mTable = NGUITools.FindInParents <UITable>(mParent); // Re-parent the item if (UIDragDropRoot.root != null) { mTrans.parent = UIDragDropRoot.root; } Vector3 pos = mTrans.localPosition; pos.z = 0f; mTrans.localPosition = pos; TweenPosition tp = GetComponent <TweenPosition>(); if (tp != null) { tp.enabled = false; } SpringPosition sp = GetComponent <SpringPosition>(); if (sp != null) { sp.enabled = false; } // Notify the widgets that the parent has changed NGUITools.MarkParentAsChanged(gameObject); if (mTable != null) { mTable.repositionNow = true; } if (mGrid != null) { mGrid.repositionNow = true; } }
private void UpdateTable() { UITable uitable = NGUITools.FindInParents <UITable>(base.gameObject); if (uitable != null) { uitable.repositionNow = true; } }
private void CreateObjects() { Transform transform = base.transform.Find("commonArea"); this.mCommonTable = transform.Find("commonLayer/commonContents").GetComponent<UITable>(); this.mGUICommonItem = this.mCommonTable.transform.Find("commonLabelContents").gameObject.AddComponent<GUICommonItem>(); this.mGUICommonItem.gameObject.SetActive(false); UIEventListener expr_68 = UIEventListener.Get(transform.gameObject); expr_68.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_68.onClick, new UIEventListener.VoidDelegate(this.OnBgClick)); }
void Awake() { tableComp = table.GetComponent <UITable>(); scenesViewController = gameObject.GetComponent <ScenesViewController>(); scenesViewController.dataSource = DataSource; itemViewList = new List <SceneTypeItemView>(); picIdList = new List <string>(); assetIdList = new List <int>(); }
void OnDestroy() { mInput = null; mUITable2 = null; mFreeNum = null; MessageMgr.GetInstance().Clear(); _instance = null; }
public override void OnLoadedUI(bool close3dTouch, object args) { base.OnLoadedUI(close3dTouch, args); _closeButton = transform.Find("chat_forward/botton_close").gameObject; _toggleSound = transform.Find("chat_forward/sound_swith").GetComponent <UIToggle>(); _chatTemplate = transform.Find("chat_forward/chat_scroll/chat_template").gameObject; _tableChatPanel = transform.Find("chat_forward/chat_scroll/Table").GetComponent <UITable>(); _chatScrollView = transform.Find("chat_forward/chat_scroll").GetComponent <UIScrollView>(); _chatPanel = transform.Find("chat_forward/chat_scroll").GetComponent <UIPanel>(); _gridChanel = transform.Find("chat_forward/grid_chanel").GetComponent <UIGrid>(); _chanelTemplate = transform.Find("chat_forward/chanel_button_template").gameObject; _sendButton = transform.Find("chat_forward/send_group/botton_send").gameObject; _recordButton = transform.Find("chat_forward/send_group/botton_v").gameObject; _inputBox = transform.Find("chat_forward/send_group").GetComponent <UIInput>(); _playTweeen = transform.Find("chat_forward/send_group/botton_menu").GetComponent <UIPlayTween>(); _popMenu = transform.Find("Panel/Pop"); _lockMessage = transform.Find("Panel/Message").gameObject; _labelLock = transform.Find("Panel/Message/Label").GetComponent <UILabel>(); chatDataList = ChatDataManager.GetInstance().chatDataList; _tablePosition = _tableChatPanel.transform.localPosition; _scrollPosition = _chatScrollView.transform.localPosition; _panelOffset = _chatPanel.clipOffset; needIgnoreList = new List <Transform> { _popMenu, _playTweeen.transform }; _chatInfoItems = new TableItemList <ChatDetailItem>(null, this); chatType = enumChatType.CHANEL_CURRENT; HideLockMessage(); _popMenu.gameObject.SetActive(false); _chanelTemplate.SetActive(false); _chatTemplate.SetActive(false); EventDelegate.Add(_inputBox.onChange, InputTextChange); EventDelegate.Add(_toggleSound.onChange, () => { _isAutoAudioList[(int)chatType] = _toggleSound.value; }); _chatScrollView.onMomentumMove = () => { if (CheckChatPanelBottom() && _lockMessgeNum > 0) { RefreshChangeTap(); } }; _gridChanel.CreateScrollView(_chanelTemplate, GameConst.ChanelList, FillChanelItem); RegistUIBase <ChatUIPopMenu>(_popMenu); RegistUIButton(_closeButton, CloseClick); RegistUIButton(_sendButton, SendClick); RegistUIButton(_recordButton, RecordClick); RegistUIButton(_lockMessage, LockClick); }
protected virtual void OnDragDropRelease(GameObject surface) { if (!this.cloneOnDrag) { if (this.mButton != null) { this.mButton.isEnabled = true; } else { if (this.mCollider != null) { this.mCollider.enabled = true; } else { if (this.mCollider2D != null) { this.mCollider2D.enabled = true; } } } UIDragDropContainer uIDragDropContainer = (!surface) ? null : NGUITools.FindInParents <UIDragDropContainer>(surface); if (uIDragDropContainer != null) { this.mTrans.parent = ((!(uIDragDropContainer.reparentTarget != null)) ? uIDragDropContainer.transform : uIDragDropContainer.reparentTarget); Vector3 localPosition = this.mTrans.localPosition; localPosition.z = 0f; this.mTrans.localPosition = localPosition; } else { this.mTrans.parent = this.mParent; } this.mParent = this.mTrans.parent; this.mGrid = NGUITools.FindInParents <UIGrid>(this.mParent); this.mTable = NGUITools.FindInParents <UITable>(this.mParent); if (this.mDragScrollView != null) { base.Invoke("EnableDragScrollView", 0.001f); } NGUITools.MarkParentAsChanged(base.gameObject); if (this.mTable != null) { this.mTable.repositionNow = true; } if (this.mGrid != null) { this.mGrid.repositionNow = true; } } else { NGUITools.Destroy(base.gameObject); } this.OnDragDropEnd(); }
public void InitCreateGame() { serverNameInput = GameObject.Find("Input-ServerName").GetComponent <UIInput>(); noPlayersInput = GameObject.Find("Input-NoPlayers").GetComponent <UIPopupList>(); difficultyInput = GameObject.Find("Input-Difficulty").GetComponent <UIPopupList>(); passwordInput = GameObject.Find("Input-Password").GetComponent <UIInput>(); levelInput = GameObject.Find("Input-Level").GetComponent <UIPopupList>(); playerList = GameObject.Find("PlayerList").GetComponent <UITable>(); }
/// <summary> /// Drop the item onto the specified object. /// </summary> protected virtual void OnDragDropRelease(GameObject surface) { if (!cloneOnDrag) { mTouchID = int.MinValue; if (mCollider != null) { mCollider.enabled = true; } // Is there a droppable container? UIDragDropContainer container = surface ? NGUITools.FindInParents <UIDragDropContainer>(surface) : null; if (container != null) { // Container found -- parent this object to the container mTrans.parent = (container.reparentTarget != null) ? container.reparentTarget : container.transform; Vector3 pos = mTrans.localPosition; pos.z = 0f; mTrans.localPosition = pos; } else { // No valid container under the mouse -- revert the item's parent mTrans.parent = mParent; } // Update the grid and table references mParent = mTrans.parent; mGrid = NGUITools.FindInParents <UIGrid>(mParent); mTable = NGUITools.FindInParents <UITable>(mParent); // Re-enable the drag scroll view script if (mDragScrollView != null) { mDragScrollView.enabled = true; } // Notify the widgets that the parent has changed NGUITools.MarkParentAsChanged(gameObject); if (mTable != null) { mTable.repositionNow = true; } if (mGrid != null) { mGrid.repositionNow = true; } } else { NGUITools.Destroy(gameObject); } }
protected virtual void OnDragDropStart() { if (!UIDragDropItem.draggedItems.Contains(this)) { UIDragDropItem.draggedItems.Add(this); } if (this.mDragScrollView != null) { this.mDragScrollView.enabled = false; } if (this.mButton != null) { this.mButton.isEnabled = false; } else if (this.mCollider != null) { this.mCollider.enabled = false; } else if (this.mCollider2D != null) { this.mCollider2D.enabled = false; } this.mParent = this.mTrans.parent; this.mRoot = NGUITools.FindInParents <UIRoot>(this.mParent); this.mGrid = NGUITools.FindInParents <UIGrid>(this.mParent); this.mTable = NGUITools.FindInParents <UITable>(this.mParent); if (UIDragDropRoot.root != null) { this.mTrans.parent = UIDragDropRoot.root; } Vector3 localPosition = this.mTrans.localPosition; localPosition.z = 0f; this.mTrans.localPosition = localPosition; TweenPosition component = base.GetComponent <TweenPosition>(); if (component != null) { component.enabled = false; } SpringPosition component2 = base.GetComponent <SpringPosition>(); if (component2 != null) { component2.enabled = false; } NGUITools.MarkParentAsChanged(base.gameObject); if (this.mTable != null) { this.mTable.repositionNow = true; } if (this.mGrid != null) { this.mGrid.repositionNow = true; } }
private void CreateObjects() { this.mBG = GameUITools.FindGameObject("BG", base.gameObject); GameUITools.RegisterClickEvent("CloseBtn", new UIEventListener.VoidDelegate(this.OnCloseClick), this.mBG); this.mContents = GameUITools.FindGameObject("GetRewardItems/Panel/Contents", this.mBG).GetComponent<UITable>(); GameUITools.RegisterClickEvent("StartBtn", new UIEventListener.VoidDelegate(this.OnStartBtnClick), this.mBG); this.mTimeBtns.Add(GameUITools.FindGameObject("0", this.mBG).AddComponent<GUICostumePartyStartPopUp.TimeBtn>().Init(0, new GUICostumePartyStartPopUp.TimeBtn.ChangeCallBack(this.RefreshItem))); this.mTimeBtns.Add(GameUITools.FindGameObject("1", this.mBG).AddComponent<GUICostumePartyStartPopUp.TimeBtn>().Init(1, new GUICostumePartyStartPopUp.TimeBtn.ChangeCallBack(this.RefreshItem))); this.mTimeBtns.Add(GameUITools.FindGameObject("2", this.mBG).AddComponent<GUICostumePartyStartPopUp.TimeBtn>().Init(2, new GUICostumePartyStartPopUp.TimeBtn.ChangeCallBack(this.RefreshItem))); }
void Awake() { UIEventListener.Get(closeButton).onClick = CloseProductView; UIEventListener.Get(cover).onClick = CloseProductView; UIEventListener.Get(leftButton).onClick = LeftButtonClick; UIEventListener.Get(rightButton).onClick = RightButtonClick; tableComp = infoContent.GetComponent <UITable>(); tableComp.onReposition = OnReposition; }
private void OnDestroy() { UserInterfacePortManager.ReleaseUtils.Release(ref this.BackGround, false); UserInterfacePortManager.ReleaseUtils.Release(ref this.weaponName); UserInterfacePortManager.ReleaseUtils.Release(ref this.weaponTypeIcon); UserInterfacePortManager.ReleaseUtils.Release(ref this.weaponImage, false); UserInterfacePortManager.ReleaseUtils.Release(ref this.mLock_Icon); this.mPrefab_UIRemodelSlotItemChangePreviewInParameter = null; this.paramTable = null; }
public override void OnInspectorGUI() { UITable myTarget = (UITable)target; DrawDefaultInspector(); if (GUILayout.Button("Update")) { myTarget.UpdateTable(null); } }
void Awake() { tableComp = table.GetComponent <UITable>(); itemViewList = new List <RecommendItemView>(); picIdList = new List <string>(); assetIdList = new List <int>(); UIScrollView scrollComp = table.transform.parent.gameObject.GetComponent <UIScrollView>(); scrollComp.onDragFinished = DragFinished; }
private UILabel CreateInputLabel(UITable controllerTable, string inputName) { UILabel controllerLabel = NGUITools.AddWidget <UILabel>(controllerTable.gameObject); controllerLabel.font = labelFont; controllerLabel.pivot = UIWidget.Pivot.Left; controllerLabel.name = inputName; controllerLabel.text = inputName + ":"; controllerLabel.MakePixelPerfect(); return(controllerLabel); }
private void CreateControllerTable(UITable controllerTable, string prefix) { for (int i = 0; i < inputNames.Length; i++) { string inputName = prefix + inputNames[i]; UILabel label = CreateInputLabel(controllerTable, inputName); mInputValues.Add(inputName, label); } controllerTable.Reposition(); }
public static LobbyRowType2 Create(DataLobby data, UITable parent) { GameObject go = GameObject.Instantiate(Resources.Load("Prefabs/Lobby/LobbyRowType2")) as GameObject; go.transform.parent = parent.transform; go.transform.localPosition = Vector3.zero; go.transform.localScale = Vector3.one; go.name = data.roomId + " - " + data.roomName; LobbyRowType2 item = go.GetComponent<LobbyRowType2>(); item.StartCoroutine(item.setData(data)); return item; }
protected virtual void OnDragDropStart() { if (this.mDragScrollView != null) { this.mDragScrollView.enabled = false; } if (this.mButton != null) { this.mButton.isEnabled = false; } else if (this.mCollider != null) { this.mCollider.enabled = false; } this.mTouchID = UICamera.currentTouchID; this.mParent = this.mTrans.parent; if (this.mRoot == null) { this.mRoot = NGUITools.FindInParents <UIRoot>(this.mParent); } this.mGrid = NGUITools.FindInParents <UIGrid>(this.mParent); this.mTable = NGUITools.FindInParents <UITable>(this.mParent); if (UIDragDropRoot.root != null) { this.mTrans.parent = UIDragDropRoot.root; } Vector3 localPosition = this.mTrans.localPosition; localPosition.z = 0f; this.mTrans.localPosition = localPosition; TweenPosition component = base.GetComponent <TweenPosition>(); if (component != null) { component.enabled = false; } SpringPosition component2 = base.GetComponent <SpringPosition>(); if (component2 != null) { component2.enabled = false; } NGUITools.MarkParentAsChanged(base.gameObject); if (this.mTable != null) { this.mTable.repositionNow = true; } if (this.mGrid != null) { this.mGrid.repositionNow = true; } EventDelegate.Execute(this.onStart); }
public override void Awake() { base.Awake(); _groupNumber = Random.Range(1, 10000); if (_usedGroupNumbers.Contains(_groupNumber)) _groupNumber++; _usedGroupNumbers.Add(_groupNumber); _uiTable = GetComponent<UITable>(); _uiGrid = GetComponent<UIGrid>(); _itemTemplate = gameObject.GetComponent<NguiListItemTemplate>(); scrollRect = transform.parent.GetComponent<ScrollRect>(); }
public void OnShow() { if (mGrid2 == null) { if (obj != null) { mGrid2 = obj.GetComponent <UITable>(); } } Invoke("SendMeg", 0.3f); ComLoading.Open(); }
static public int get_keepWithinPanel(IntPtr l) { try { UITable self = (UITable)checkSelf(l); pushValue(l, true); pushValue(l, self.keepWithinPanel); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int get_direction(IntPtr l) { try { UITable self = (UITable)checkSelf(l); pushValue(l, true); pushEnum(l, (int)self.direction); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int Reposition(IntPtr l) { try { UITable self = (UITable)checkSelf(l); self.Reposition(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int get_columns(IntPtr l) { try { UITable self = (UITable)checkSelf(l); pushValue(l, true); pushValue(l, self.columns); return(2); } catch (Exception e) { return(error(l, e)); } }
protected override void Reposition() { if (mTable == null) { mTable = mDMono.GetComponent <UITable>(); } mTable.transform.localPosition = mTableOrigionPosition; mTable.Reposition(); base.Reposition(); }
void showGames() { if (mRoom == null || mGames == null) { return; } setText(transform, "title/roomid", "房间号:" + mRoom.room_id); setText(transform, "title/desc", mRoom.info.huafen + "/" + mRoom.info.huafen + (mRoom.info.maima ? "带苍蝇" : "不带苍蝇") + mRoom.info.maxGames + "局"); for (int i = 0; i < mGames.Count; i++) { HistoryGame game = mGames[i]; Transform item = getItem(i); setText(item, "id", "" + (game.game_index + 1)); setText(item, "time", PUtils.formatTime(game.create_time, "yyyy/MM/dd HH:mm:ss")); Transform seats = item.Find("seats"); UITable table = seats.GetComponent <UITable>(); List <HistorySeats> ss = mRoom.info.seats; int j = 0; for (; j < seats.childCount && j < ss.Count; j++) { Transform seat = seats.GetChild(j); HistorySeats s = ss[j]; seat.gameObject.SetActive(true); setText(seat, "name", s.name); setText(seat, "score", "" + game.result [j]); setIcon(seat, "bghead/icon", s.uid); } for (int k = j; k < seats.childCount; k++) { Transform seat = seats.GetChild(k); seat.gameObject.SetActive(false); } table.Reposition(); setBtnEvent(item, "btn_share", () => { }); setBtnEvent(item, "btn_replay", () => { onBtnReplay(game.id); }); } updateItems(mGames.Count); }
public static LobbyRowType1 Create(DataLobby data, UITable parent, Action<DataLobby> callBack) { GameObject go = GameObject.Instantiate(Resources.Load("Prefabs/Lobby/LobbyRowType1")) as GameObject; go.transform.parent = parent.transform; go.transform.localPosition = Vector3.zero; go.transform.localScale = Vector3.one; go.GetComponent<UIDragScrollView>().scrollView = parent.GetComponentInParent<UIScrollView>(); go.name = "#" + data.roomId; LobbyRowType1 item = go.GetComponent<LobbyRowType1>(); item.setData(data); item.action = callBack; return item; }
/// <summary> /// Tween the value. /// </summary> protected override void OnUpdate (float factor, bool isFinished) { value = Mathf.RoundToInt(from * (1f - factor) + to * factor); if (updateTable) { if (mTable == null) { mTable = NGUITools.FindInParents<UITable>(gameObject); if (mTable == null) { updateTable = false; return; } } mTable.repositionNow = true; } }
protected override void OnUpdate (float factor, bool isFinished) { cachedTransform.localScale = from * (1f - factor) + to * factor; if (updateTable) { if (mTable == null) { mTable = NGUITools.FindInParents<UITable>(gameObject); if (mTable == null) { updateTable = false; return; } } mTable.repositionNow = true; } }
public void DestroyRows() { if(tableEvidencias == null) tableEvidencias = GetComponent<UITable>(); foreach (var item in tableEvidencias.GetChildList()) { Destroy (item.gameObject); } if(evidencias != null) evidencias.Clear(); else Debug.Log("null evidencias"); }
public override void Awake() { base.Awake(); if(!prefabCell){ prefabCell=getChildren(table.transform)[0]; // prefabCell.parent=null; poolAdd(prefabCell); foreach(Transform e in table.transform){ Destroy(e.gameObject); } } if(!table)table=GetComponent<UITable>(); }
private void CreateObjects() { GameObject gameObject = base.transform.Find("winBG").gameObject; GameObject gameObject2 = gameObject.transform.Find("closeBtn").gameObject; UIEventListener expr_32 = UIEventListener.Get(gameObject2); expr_32.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_32.onClick, new UIEventListener.VoidDelegate(this.OnCloseClick)); this.mContentsTable = gameObject.transform.Find("contentsBg/contentsPanel/contents").GetComponent<UITable>(); this.mContentsTable.sorting = UITable.Sorting.None; this.mC1 = this.mContentsTable.transform.Find("c1").GetComponent<UILabel>(); for (int i = 0; i < this.mRewardItems.Length; i++) { this.mRewardItems[i] = this.mContentsTable.transform.Find(string.Format("ruleInfoLine{0}", i)).gameObject.AddComponent<GUIWBRuleInfoRewardItem>(); this.mRewardItems[i].InitWithBaseScene(); } }
private void CreateObjects() { this.mRightInfoTable = base.transform.Find("contents").gameObject.AddComponent<UITable>(); this.mRightInfoTable.columns = 1; this.mRightInfoTable.direction = UITable.Direction.Down; this.mRightInfoTable.sorting = UITable.Sorting.Alphabetic; this.mRightInfoTable.hideInactive = true; this.mRightInfoTable.keepWithinPanel = true; this.mRightInfoTable.padding = new Vector2(0f, 2f); this.mValues = GameUITools.FindGameObject("a", this.mRightInfoTable.gameObject).AddComponent<GUIAttributeValue>(); this.mSkills = GameUITools.FindGameObject("b", this.mRightInfoTable.gameObject).AddComponent<LopetInfoSkillLayer>(); this.mSkills.Init(); this.mLopetDescSp = this.mRightInfoTable.transform.Find("e").GetComponent<UISprite>(); this.mDesc = GameUITools.FindUILabel("desc", this.mLopetDescSp.gameObject); }
public static LobbyTab Create(DataChannel data,UITable parent,int index){ GameObject gobj = null; if (index != 0) gobj = GameObject.Instantiate (Resources.Load ("Prefabs/Lobby/LobbyTabCenter")) as GameObject; else { gobj = GameObject.Instantiate (Resources.Load ("Prefabs/Lobby/LobbyTabLeft")) as GameObject; } gobj.name = data.zoneId + "-" + data.name; gobj.transform.parent = parent.transform; gobj.transform.localPosition = Vector3.zero; gobj.transform.localScale = Vector3.one; LobbyTab item = gobj.GetComponent<LobbyTab> (); item.SetData (data,index); return item; }
protected override void OnUpdate(float factor, bool isFinished) { this.cachedWidget.width = Mathf.RoundToInt((this.from * (1f - factor)) + (this.to * factor)); if (this.updateTable) { if (this.mTable == null) { this.mTable = NGUITools.FindInParents<UITable>(base.gameObject); if (this.mTable == null) { this.updateTable = false; return; } } this.mTable.repositionNow = true; } }
protected override void OnUpdate(float factor, bool isFinished) { this.cachedTransform.localScale = (Vector3) ((this.from * (1f - factor)) + (this.to * factor)); if (this.updateTable) { if (this.mTable == null) { this.mTable = NGUITools.FindInParents<UITable>(base.gameObject); if (this.mTable == null) { this.updateTable = false; return; } } this.mTable.repositionNow = true; } }
private void CreateObjects() { GameObject gameObject = base.transform.Find("winBG").gameObject; this.mTitle = gameObject.transform.Find("title").GetComponent<UILabel>(); this.mInfo = gameObject.transform.Find("contentsPanel/contents/info").GetComponent<UILabel>(); this.mInfo.spaceIsNewLine = false; GameObject gameObject2 = gameObject.transform.Find("closeBtn").gameObject; UIEventListener expr_74 = UIEventListener.Get(gameObject2); expr_74.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_74.onClick, new UIEventListener.VoidDelegate(this.OnCloseBtnClick)); this.mContentTable = gameObject.transform.Find("contentsPanel/contents").gameObject.AddComponent<UITable>(); this.mContentTable.columns = 1; this.mContentTable.direction = UITable.Direction.Down; this.mContentTable.sorting = UITable.Sorting.None; this.mContentTable.hideInactive = true; this.mContentTable.keepWithinPanel = true; this.mContentTable.padding = new Vector2(0f, 2f); this.mScrollBar = gameObject.transform.Find("contentsScrollBar").GetComponent<UIScrollBar>(); }
public void Init() { if (this.PushTxtDuration <= 0f) { this.PushTxtDuration = 1f; } if (this.ExpandDuration <= 0f) { this.ExpandDuration = 1f; } this.mBG = GameUITools.FindUISprite("BG", base.gameObject); this.mArrowBtn = GameUITools.RegisterClickEvent("ArrowBtn", new UIEventListener.VoidDelegate(this.OnMsgArrowBtnClick), base.gameObject).GetComponent<UISprite>(); this.mScrollBar = GameUITools.FindGameObject("BgPanelScrollBar", base.gameObject).GetComponent<UIScrollBar>(); this.mPanel = GameUITools.FindGameObject("Panel", base.gameObject).GetComponent<UIPanel>(); this.mContent = GameUITools.FindGameObject("Content", this.mPanel.gameObject).GetComponent<UITable>(); this.mMsgLabel = GameUITools.FindUILabel("MsgLabel", this.mContent.gameObject); this.mMsgLabel.text = string.Empty; }
public void Init(GameUIAdventureReady advReady, List<MS2C_PveResult> data) { this.mBaseScene = advReady; base.transform.localPosition = new Vector3(0f, 0f, -550f); this.mWinBG = base.transform.Find("winBG"); this.mCloseBtn = this.mWinBG.Find("closeBtn").gameObject; this.mCloseBtn.SetActive(false); UIEventListener expr_6E = UIEventListener.Get(this.mCloseBtn); expr_6E.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_6E.onClick, new UIEventListener.VoidDelegate(this.OnCloseBtnClicked)); UIEventListener expr_A9 = UIEventListener.Get(base.transform.Find("FadeBG").gameObject); expr_A9.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_A9.onClick, new UIEventListener.VoidDelegate(this.OnCloseBtnClicked)); this.mFarmCollider = this.mWinBG.FindChild("FarmCollider").gameObject; this.mFarmCollider.SetActive(true); this.mMapFarmTable = this.mWinBG.FindChild("bagPanel/bagContents").gameObject.GetComponent<UITable>(); this.mMapFarmTable.columns = 1; this.isPlaying = false; GameUIManager.mInstance.uiState.PlayerEnergy -= this.mBaseScene.sceneInfo.CostValue * data.Count; base.StartCoroutine(this.RefreshMapFarmItems(data)); }
public override void OnLoadedUI(bool close3dTouch, object args) { base.OnLoadedUI(close3dTouch, args); _chatPanel = transform.Find("all_bf").gameObject; _chatWidget = transform.Find("all_bf/xinxikuang/Container").GetComponent<UIWidget>(); _btnTextInput = transform.Find("all_bf/text_button").gameObject; _btnVoiceInput = transform.Find("all_bf/voice_button ").gameObject; _chatScrollPanel = transform.Find("all_bf/xinxikuang/Container/Scroll View").GetComponent<UIPanel>(); _chatScrollView = transform.Find("all_bf/xinxikuang/Container/Scroll View").GetComponent<UIScrollView>(); _tableChatPanel = transform.Find("all_bf/xinxikuang/Container/Scroll View/Table").GetComponent<UITable>(); _lockMessage = transform.Find("all_bf/xinxikuang/Container/Panel/Message").gameObject; _labelLock = transform.Find("all_bf/xinxikuang/Container/Panel/Message/Label").GetComponent<UILabel>(); _textTemplate = transform.Find("all_bf/xinxikuang/Container/Scroll View/text_template").gameObject; _microPhoneInput = _chatPanel.GetComponent<MicroPhoneInput>(); _voiceOn = transform.Find("all_bf/voice_button /buttom_on").gameObject; _textTemplate.SetActive(false); _chatInfoItems = new TableItemList<ChatInfoItem>(null, this); _playName = "王五"; _tablePosition = _tableChatPanel.transform.localPosition; _scrollPosition = _chatScrollView.transform.localPosition; _panelOffset = _chatScrollPanel.clipOffset; _chatDataList = ChatDataManager.GetInstance().chatDataList; HideLockMessage(); _chatScrollView.onMomentumMove = () => { if (CheckChatPanelBottom() && _lockMessgeNum > 0) { RefreshChatPanel(); HideLockMessage(); } }; #region 注册点击函数 RegistOnPress(_btnVoiceInput, VoiceInputPress); RegistUIButton(_lockMessage, LockClick); RegistUIButton(_btnTextInput, (go) => { GetParentUI<ChatView>().chatDetailView.RefreshOpen(); }); #endregion }
// Use this for initialization void Start() { GameObject newCategory; for(int i = 0; i < numberOfCategories; ++i) { newCategory = (GameObject)Instantiate(category); int j = 0; while(newCategory.transform.childCount > 0) { Transform child = newCategory.transform.GetChild (0); child.parent = this.transform; //child.name = (i+1).ToString () + child.name; child.name = indexOfNPC.ToString() + (i+1).ToString () + child.name; if(j % 2 == 1) { // prepare expandable sub-menu child.gameObject.GetComponent<AnalyticsPopulateTable>().type = i + 1; child.gameObject.GetComponent<AnalyticsPopulateTable>().indexOfNPC = indexOfNPC; child.gameObject.GetComponent<AnalyticsPopulateTable>().Populate(); // disable expandable section Vector3 temp_vector = child.position; child.gameObject.SetActive (false); child.localPosition = temp_vector; } ++j; } Destroy(newCategory); } table = this.GetComponent<UITable>(); // fix Z-position (bring in front) -- don't know cause right now table.transform.localPosition = new Vector3(table.transform.localPosition.x, table.transform.localPosition.y, -99); table.repositionNow = true; // Problem PopulateCategory(1,"Emotion"); PopulateCategory(2,"Comprehension"); PopulateCategory(3,"Initiate Conversation"); PopulateCategory(4,"Maintain Conversation"); PopulateCategory(5,"Problem Solving"); this.gameObject.SetActive (false); }
protected override void OnUpdate (float factor, bool isFinished) { value = from * (1f - factor) + to * factor; if (updateTable) { if (mTable == null) { base.mTable = NGUITools.FindInParents<UITable>(gameObject); if (base.mTable == null) { updateTable = false; return; } if (base.mTable != null) mTable1 = NGUITools.FindInParents<UITable>(base.mTable.transform.parent.gameObject); } base.mTable.repositionNow = true; if (mTable1 != null) mTable1.repositionNow = true; } }
public void Init() { base.transform.localPosition = new Vector3(0f, 0f, -550f); this.mWinBG = base.transform.Find("winBG"); this.mTargetTable = this.mWinBG.FindChild("bagPanel/bagContents").gameObject.GetComponent<UITable>(); this.mTargetTable.columns = 1; this.mTargetTable.direction = UITable.Direction.Down; GameObject gameObject = this.mWinBG.FindChild("closeBtn").gameObject; UIEventListener expr_89 = UIEventListener.Get(gameObject); expr_89.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_89.onClick, new UIEventListener.VoidDelegate(this.OnCloseTargetList)); UIEventListener expr_B5 = UIEventListener.Get(base.gameObject); expr_B5.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_B5.onClick, new UIEventListener.VoidDelegate(this.OnCloseTargetList)); this.CurStamina = this.mWinBG.FindChild("CurStamina/num").GetComponent<UILabel>(); this.ConstStamina = this.mWinBG.FindChild("Stamina/num").GetComponent<UILabel>(); this.BtnRefresh = this.mWinBG.FindChild("BtnRefresh").GetComponent<UIButton>(); UIEventListener expr_137 = UIEventListener.Get(this.BtnRefresh.gameObject); expr_137.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_137.onClick, new UIEventListener.VoidDelegate(this.OnBtnRefreshClicked)); this.BtnRefreshText = this.BtnRefresh.transform.Find("Label").GetComponent<UILabel>(); this.BtnRefreshText.text = Singleton<StringManager>.Instance.GetString("Pillage17"); this.BtnRefresh.isEnabled = true; }
/// <summary> /// Drop the item onto the specified object. /// </summary> protected virtual void OnDragDropRelease (GameObject surface) { if (!cloneOnDrag) { // Re-enable the collider if (mButton != null) mButton.isEnabled = true; else if (mCollider != null) mCollider.enabled = true; else if (mCollider2D != null) mCollider2D.enabled = true; // Is there a droppable container? UIDragDropContainer container = surface ? NGUITools.FindInParents<UIDragDropContainer>(surface) : null; if (container != null) { // Container found -- parent this object to the container mTrans.parent = (container.reparentTarget != null) ? container.reparentTarget : container.transform; Vector3 pos = mTrans.localPosition; pos.z = 0f; mTrans.localPosition = pos; } else { // No valid container under the mouse -- revert the item's parent mTrans.parent = mParent; } // Update the grid and table references mParent = mTrans.parent; mGrid = NGUITools.FindInParents<UIGrid>(mParent); mTable = NGUITools.FindInParents<UITable>(mParent); // Re-enable the drag scroll view script if (mDragScrollView != null) StartCoroutine(EnableDragScrollView()); // Notify the widgets that the parent has changed NGUITools.MarkParentAsChanged(gameObject); if (mTable != null) mTable.repositionNow = true; if (mGrid != null) mGrid.repositionNow = true; // We're now done OnDragDropEnd(); } else NGUITools.Destroy(gameObject); }