void OnPress(bool pressed) { if (isInvalid) { return; } verticalScrollView.Press(pressed); horizontalScrollView.Press(pressed); }
/// <summary> /// Create a plane on which we will be performing the dragging. /// </summary> void OnPress(bool pressed) { // If the scroll view has been set manually, don't try to find it again if (mAutoFind && mScroll != scrollView) { mScroll = scrollView; mAutoFind = false; } if (scrollView && enabled && NGUITools.GetActive(gameObject)) { //wxl if (scrollView.centerOnChildForMain == null) { scrollView.Press(pressed); } else { this.CancelPress(pressed); // scrollView.OnPressForMain(pressed); } if (!pressed && mAutoFind) { scrollView = NGUITools.FindInParents <UIScrollView>(mTrans); mScroll = scrollView; } } }
/// <summary> /// Create a plane on which we will be performing the dragging. /// </summary> void OnPress(bool pressed) { if (enabled && NGUITools.GetActive(gameObject) && scrollView != null) { scrollView.Press(pressed); } }
/// <summary> /// Stop the active dragging operation. /// </summary> void OnDisable() { if (mScroll != null) { mScroll.Press(false); mScroll = null; } }
/// <summary> /// Stop the active dragging operation. /// </summary> void OnDisable() { if (mPressed && mScroll != null && mScroll.GetComponentInChildren <UIWrapContent>() == null) { mScroll.Press(false); mScroll = null; } }
private static int Press(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 2); UIScrollView uIScrollView = (UIScrollView)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIScrollView"); bool boolean = LuaScriptMgr.GetBoolean(L, 2); uIScrollView.Press(boolean); return(0); }
static int Press(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 2); UIScrollView obj = (UIScrollView)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIScrollView"); bool arg0 = LuaScriptMgr.GetBoolean(L, 2); obj.Press(arg0); return(0); }
/// <summary> /// Create a plane on which we will be performing the dragging. /// </summary> void OnPress(bool pressed) { if (scrollView && enabled && NGUITools.GetActive(gameObject)) { scrollView.Press(pressed); if (!pressed && mAutoFind) { scrollView = NGUITools.FindInParents <UIScrollView>(mTrans); } } }
static public int Press(IntPtr l) { try { UIScrollView self = (UIScrollView)checkSelf(l); System.Boolean a1; checkType(l, 2, out a1); self.Press(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static int Press(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UIScrollView obj = (UIScrollView)ToLua.CheckObject <UIScrollView>(L, 1); bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.Press(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void OnPress(bool pressed) { if (mAutoFind && mScroll != scrollView) { mScroll = scrollView; mAutoFind = false; } if ((bool)scrollView && base.enabled && NGUITools.GetActive(base.gameObject)) { scrollView.Press(pressed); if (!pressed && mAutoFind) { scrollView = NGUITools.FindInParents <UIScrollView>(mTrans); mScroll = scrollView; } } }
private static int Press(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 2); UIScrollView uIScrollView = (UIScrollView)ToLua.CheckObject(L, 1, typeof(UIScrollView)); bool pressed = LuaDLL.luaL_checkboolean(L, 2); uIScrollView.Press(pressed); result = 0; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
private void OnPress(bool pressed) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown if (mAutoFind && mScroll != scrollView) { mScroll = scrollView; mAutoFind = false; } if (Object.op_Implicit(scrollView) && this.get_enabled() && NGUITools.GetActive(this.get_gameObject())) { scrollView.Press(pressed); if (!pressed && mAutoFind) { scrollView = NGUITools.FindInParents<UIScrollView>(mTrans); mScroll = scrollView; } } }
public static int Press(IntPtr l) { int result; try { UIScrollView uIScrollView = (UIScrollView)LuaObject.checkSelf(l); bool pressed; LuaObject.checkType(l, 2, out pressed); uIScrollView.Press(pressed); LuaObject.pushValue(l, true); result = 1; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
/// <summary> /// Create a plane on which we will be performing the dragging. /// </summary> void OnPress(bool pressed) { // If the scroll view has been set manually, don't try to find it again if (mAutoFind && mScroll != scrollView) { mScroll = scrollView; mAutoFind = false; } if (scrollView && enabled && NGUITools.GetActive(gameObject)) { scrollView.Press(pressed); if (!pressed && mAutoFind) { scrollView = NGUITools.FindInParents <UIScrollView>(mTrans); mScroll = scrollView; } } }
public void SetEnableUIInput(bool is_enable) { if (enableUIInput != is_enable) { enableUIInput = is_enable; if (is_enable) { nguiCamera.useTouch = initUseTouch; nguiCamera.useMouse = initUseMouse; } else { nguiCamera.useTouch = false; nguiCamera.useMouse = false; if (!nguiCamera.allowMultiTouch && UICamera.CountInputSources() == 1) { UICamera.MouseOrTouch touch = UICamera.GetTouch(1, false); if (touch != null && touch.pressed != null) { UIButton component = touch.pressed.GetComponent <UIButton>(); if (component != null) { component.SetState(UIButtonColor.State.Normal, true); } UIScrollView componentInParent = touch.pressed.GetComponentInParent <UIScrollView>(); if (componentInParent != null) { componentInParent.Press(false); } touch.pressed = null; } if (UICamera.currentTouch != null) { nguiCamera.ProcessTouch(false, true); } } } } }
static int _m_Press(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UIScrollView gen_to_be_invoked = (UIScrollView)translator.FastGetCSObj(L, 1); { bool _pressed = LuaAPI.lua_toboolean(L, 2); gen_to_be_invoked.Press(_pressed); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
void CreateUpObject() { if (UpCreateObject == null) { return; } if ((NowIndex) <= FirstCreateCount) { NotCreatePanel = 0; scrollView.MaxLineSize = Vector3.zero; //< 갱신하기위함 if (!scrollViewUpdate) { scrollViewUpdate = true; scrollView.Press(false); } return; } else { scrollViewUpdate = false; } float LastCreatePos = UpCreateObject.transform.localPosition.y; if (ScrollType == eScrollType.Horizontal) { LastCreatePos = UpCreateObject.transform.localPosition.x; } for (int i = 0; i < CreateCount; i++) { NowIndex--; if ((NowIndex) < FirstCreateCount) { NowIndex = FirstCreateCount; } CreateObj = RecycleObject(false); CreateObj.transform.parent = NowGridPanel.transform; CreateObj.transform.localScale = new Vector3(1, 1, 1); if (ScrollType == eScrollType.Vertical) { CreateObj.transform.localPosition = new Vector3(((CreateCount - 1) - i) * cellWidth, LastCreatePos + cellHeight, 0); } else { CreateObj.transform.localPosition = new Vector3(LastCreatePos - cellWidth, -(((CreateCount - 1) - i) * cellHeight), 0); } //< 생성했던 클래스로 셋업하도록 보냄 if (CreateCallBack != null) { if ((NowIndex) - FirstCreateCount >= 0) { CreateCallBack((NowIndex) - FirstCreateCount, CreateObj); } } } //< 스크롤 범위를 늘려줌 if (ScrollType == eScrollType.Vertical) { scrollView.MaxLineSize = new Vector3(0, (((MaxIndex / CreateCount)) * cellHeight), 0); //< 위 스크롤 기준을 만들어준다 DragPos.x = ((CreateObj.transform.localPosition.y - NowGridPanel.transform.localPosition.y) * -1); //< 마지막 스크롤 위치값을 대입해준다. DragPos.y = ((DownCreateObject.transform.localPosition.y + NowGridPanel.transform.localPosition.y) * -1); DragPos.y -= BottomLimit; } else { scrollView.MaxLineSize = new Vector3((((MaxIndex / CreateCount)) * cellWidth), 0, 0); //< 위 스크롤 기준을 만들어준다 DragPos.x = ((CreateObj.transform.localPosition.x - NowGridPanel.transform.localPosition.x) * -1); //< 마지막 스크롤 위치값을 대입해준다. DragPos.y = ((DownCreateObject.transform.localPosition.x + NowGridPanel.transform.localPosition.x) * -1); DragPos.y -= BottomLimit; } NotCreatePanel = NotCreatePanelTime; }
public void ShowMissionList(sg.GS2C_Enter_City_Res res) { mMissionItemList.Clear(); Globals.Instance.MSceneManager.ChangeCameraActiveState(SceneManager.CameraActiveState.MAINCAMERA); this.SetVisible(true); if (res.cityId == 9) { CityInforDaily.text = res.taskLis.Count.ToString() + "/" + 20; NGUITools.SetActive(CityInfor.gameObject, false); NGUITools.SetActive(CityInforDaily.gameObject, true); } else { NGUITools.SetActive(CityInforDaily.gameObject, false); NGUITools.SetActive(CityInfor.gameObject, true); } NGUITools.SetActive(FriendsView, false); NGUITools.SetActive(NoMissionInfo, false); mRefreshTaskSpendMoney = res.refreshMoney; mRefreshTaskCount = res.refreshCount; Globals.Instance.MTaskManager.mTaskDailyData.CurrentCityID = res.cityId; Map_Citys MapCity = Globals.Instance.MDataTableManager.GetConfig <Map_Citys>(); Map_Citys.Map_CitysObject MapObj = MapCity.GetMap_CitysObjectByID(res.cityId); if (MapObj == null) { return; } CityNameLabel.text = MapObj.Citys_Name; MissionNumLabel.text = res.taskLis.Count.ToString(); HelpUtil.DelListInfo(MainTable.transform); foreach (sg.GS2C_Enter_City_Res.completedTask completetask in res.compLis) { GameObject completeMissionObj = GameObject.Instantiate(CompleteMissionItemPrefab) as GameObject; completeMissionObj.transform.parent = MainTable.transform; completeMissionObj.transform.localScale = Vector3.one; completeMissionObj.transform.localPosition = new Vector3(0, 0, 0); GameObject completeMissionBase = completeMissionObj.transform.Find("MissionBase").gameObject; GameObject completeStars = completeMissionBase.transform.Find("Stars").gameObject; GameObject completeTween = completeMissionObj.transform.Find("Tween").gameObject; NGUITools.SetActive(completeTween.gameObject, false); //基础信息-----// UISprite rankSprite = completeMissionBase.transform.Find("Rank").GetComponent <UISprite>(); UISprite PassSprite = completeMissionBase.transform.Find("Pass").GetComponent <UISprite>(); UISprite SexSprite = completeMissionBase.transform.Find("SexSprite").GetComponent <UISprite>(); UILabel JingLiNumLabel = completeMissionBase.transform.Find("JingLiNumLabel").GetComponent <UILabel>(); UILabel NameLabel = completeMissionBase.transform.Find("NameLabel").GetComponent <UILabel>(); UIButton DareButton = completeMissionBase.transform.Find("DareButton").GetComponent <UIButton>(); //详细信息---// UILabel completeMissionBriefing = completeTween.transform.Find("MissionBriefingLabel").GetComponent <UILabel>(); UILabel completeMoneyLabel = completeTween.transform.Find("MoneyLabel").GetComponent <UILabel>(); UILabel completeFansLabel = completeTween.transform.Find("FansLabel").GetComponent <UILabel>(); UILabel completeNoRewardLabel = completeTween.transform.Find("NoRewardLabel").GetComponent <UILabel>(); UIButton completeRankButton = completeTween.transform.Find("RankButton").GetComponent <UIButton>(); Task comtask = Globals.Instance.MDataTableManager.GetConfig <Task>(); Task.TaskObject completeElement = null; bool hasData = comtask.GetTaskObject(completetask.taskId, out completeElement); if (!hasData) { Debug.Log(" completetask ================ Null" + completetask.taskId); return; } completeMissionObj.name = "AMission" + completetask.taskId; rankSprite.spriteName = HangyeDengji[FinalEvaluation(completetask.level)]; PassSprite.spriteName = FinalEvaluation(completetask.level) == 4 ? "IconManfen":"IconPass"; SexSprite.spriteName = completeElement.Sex_Icon; NameLabel.text = completeElement.Name; completeMissionBriefing.text = completeElement.Task_Desc; if (FinalEvaluation(completetask.level) == 0 && completeElement.Progress_Count <= 0) { NGUITools.SetActive(completeStars, false); NGUITools.SetActive(rankSprite.gameObject, false); } else { string[] stars = { "Green", "Blue", "Purple", "Red", "Yellow" }; string[] starBg = { "GreenBg", "BlueBg", "PurpleBg", "RedBg", "YellowBg" }; for (int i = 0; i < 5; i++) { UISprite currentStar = completeStars.transform.Find(stars[i]).GetComponent <UISprite>(); UISprite currentStarbg = completeStars.transform.Find(starBg[i]).GetComponent <UISprite>(); if (i <= FinalEvaluation(completetask.level)) { NGUITools.SetActive(currentStarbg.gameObject, false); NGUITools.SetActive(currentStar.gameObject, true); } else { NGUITools.SetActive(currentStarbg.gameObject, true); NGUITools.SetActive(currentStar.gameObject, false); } } } NGUITools.SetActive(completeMoneyLabel.gameObject, false); NGUITools.SetActive(completeFansLabel.gameObject, false); NGUITools.SetActive(completeNoRewardLabel.gameObject, false); List <string[]> RewardArray = ParsingRewards(completeElement.Rewards); if (!completetask.costEnergy) { NGUITools.SetActive(JingLiNumLabel.gameObject, false); NGUITools.SetActive(completeNoRewardLabel.gameObject, true); } else { JingLiNumLabel.text = "-" + completeElement.Need_Energy.ToString(); NGUITools.SetActive(JingLiNumLabel.gameObject, true); bool isReward = false; for (int i = 0; i < RewardArray.Count; i++) { switch (StrParser.ParseDecInt(RewardArray[i][0], -1)) { case (int)TaskRewardTypeEnum.ROLE_ATTR: switch (StrParser.ParseDecInt(RewardArray[i][1], -1)) { case (int)BaseRewardType.MONEY: isReward = true; NGUITools.SetActive(completeMoneyLabel.gameObject, true); completeMoneyLabel.text = (StrParser.ParseDecInt(RewardArray[i][2], -1) / 2.0 == StrParser.ParseDecInt(RewardArray[i][2], -1) / 2? StrParser.ParseDecInt(RewardArray[i][2], -1) / 2: StrParser.ParseDecInt(RewardArray[i][2], -1) / 2 + 1).ToString(); break; } break; case (int)TaskRewardTypeEnum.FANS_NUM: isReward = true; NGUITools.SetActive(completeFansLabel.gameObject, true); completeFansLabel.text = (StrParser.ParseDecInt(RewardArray[i][2], -1) / 2.0 == StrParser.ParseDecInt(RewardArray[i][2], -1) / 2? StrParser.ParseDecInt(RewardArray[i][2], -1) / 2: StrParser.ParseDecInt(RewardArray[i][2], -1) / 2 + 1).ToString(); break; } } if (!isReward) { NGUITools.SetActive(completeNoRewardLabel.gameObject, true); } } DareButton.Data = completetask; UIEventListener.Get(DareButton.gameObject).onClick += OnClickChallengeAgain; } foreach (sg.GS2C_Enter_City_Res.visibleTask taskInfo in res.taskLis) { GameObject MissionObj = GameObject.Instantiate(MissionItemPrefab) as GameObject; MissionObj.transform.parent = MainTable.transform; MissionObj.transform.localScale = Vector3.one; MissionObj.transform.localPosition = new Vector3(0, 0, 0); UIToggle Toggle = MissionObj.transform.GetComponent <UIToggle>(); GameObject MissionBase = MissionObj.transform.Find("MissionBase").gameObject; GameObject Tween = MissionObj.transform.Find("Tween").gameObject; UISprite Unlocked = MissionObj.transform.Find("Unlocked").GetComponent <UISprite>(); //基础信息-----// UITexture GradeTexture = MissionBase.transform.Find("GradeTexture").GetComponent <UITexture>(); UISprite IssuedSprite = MissionBase.transform.Find("IssuedSprite").GetComponent <UISprite>(); UISprite SexSprite = MissionBase.transform.Find("SexSprite").GetComponent <UISprite>(); UILabel JingLiNumLabel = MissionBase.transform.Find("JingLiNumLabel").GetComponent <UILabel>(); UILabel NameLabel = MissionBase.transform.Find("NameLabel").GetComponent <UILabel>(); UIButton DareButton = MissionBase.transform.Find("DareButton").GetComponent <UIButton>(); //详细信息---// UILabel MissionBriefingLabel = Tween.transform.Find("MissionBriefingLabel").GetComponent <UILabel>(); UILabel MoneyLabel = Tween.transform.Find("MoneyLabel").GetComponent <UILabel>(); UILabel FansLabel = Tween.transform.Find("FansLabel").GetComponent <UILabel>(); UILabel DiamondLabel = Tween.transform.Find("DiamondLabel").GetComponent <UILabel>(); UILabel NoRewardLabel = Tween.transform.Find("NoRewardLabel").GetComponent <UILabel>(); UITexture RewardItemOne = Tween.transform.Find("RewardItemOne").GetComponent <UITexture>(); UITexture RewardItemTwo = Tween.transform.Find("RewardItemTwo").GetComponent <UITexture>(); UIButton ChangeButton = Tween.transform.Find("ChangeButton").GetComponent <UIButton>(); //未解锁信息--// UILabel LockLabel = Unlocked.transform.Find("LockLabel").GetComponent <UILabel>(); UILabel TimeLabel = Unlocked.transform.Find("TimeLabel").GetComponent <UILabel>(); Task task = Globals.Instance.MDataTableManager.GetConfig <Task>(); Task.TaskObject element = null; bool hasData = task.GetTaskObject(taskInfo.taskId, out element); if (!hasData) { Debug.Log(" Task ================ Null" + taskInfo.taskId); return; } SexSprite.spriteName = element.Sex_Icon; if (element.Task_Category == (int)TaskCategoryEnum.DAILY) { NGUITools.SetActive(ChangeButton.gameObject, true); } else { NGUITools.SetActive(ChangeButton.gameObject, false); } if (element.Publish_Type == -1) { NGUITools.SetActive(IssuedSprite.gameObject, false); } else { NGUITools.SetActive(IssuedSprite.gameObject, true); } NameLabel.text = element.Name; JingLiNumLabel.text = "-" + element.Need_Energy.ToString(); NGUITools.SetActive(Tween.gameObject, false); if (taskInfo.isLock) { MissionObj.name = "CMission" + taskInfo.taskId; NGUITools.SetActive(Unlocked.gameObject, true); BoxCollider BtnBox = DareButton.gameObject.transform.GetComponent <BoxCollider>(); Destroy(BtnBox); // 解锁条件 -- // if (taskInfo.remainTime > 0) { TimeLabel.text = taskInfo.remainTime.ToString(); } else { NGUITools.SetActive(TimeLabel.gameObject, false); } foreach (sg.BI_Condition condition in taskInfo.unlockConditions) { switch (condition.type) { case (int)TaskRequireVisibleTypeEnum.SEXLIMIT: LockLabel.text = "1"; break; case (int)TaskRequireVisibleTypeEnum.ITEMCOUNT: LockLabel.text = "2"; break; case (int)TaskRequireVisibleTypeEnum.BEFORETASKID: Task.TaskObject Specify = null; bool SpecifyBool = task.GetTaskObject(condition.itemId, out Specify); if (!SpecifyBool) { return; } LockLabel.text = Specify.Name; break; case (int)TaskRequireVisibleTypeEnum.ROLEATTR: break; case (int)TaskRequireVisibleTypeEnum.HAVEARTIST: break; case (int)TaskRequireVisibleTypeEnum.FANSNUM: break; } } UIButton btn = MissionObj.transform.GetComponent <UIButton>(); btn.onClick.Clear(); TweenHeight th = MissionObj.transform.GetComponent <TweenHeight>(); Destroy(th); TweenRotation tr = MissionObj.transform.Find("Picture").transform.Find("ArrowObject").transform.GetComponent <TweenRotation>(); Destroy(tr); } else { int RewardItemState = 0; MissionObj.name = "BMission" + taskInfo.taskId; NGUITools.SetActive(Unlocked.gameObject, false); //已经解锁、 详细信息赋值// MissionBriefingLabel.text = element.Task_Desc; NGUITools.SetActive(MoneyLabel.gameObject, false); NGUITools.SetActive(FansLabel.gameObject, false); NGUITools.SetActive(DiamondLabel.gameObject, false); NGUITools.SetActive(RewardItemOne.gameObject, false); NGUITools.SetActive(RewardItemTwo.gameObject, false); NGUITools.SetActive(NoRewardLabel.gameObject, false); List <string[]> RewardArray = ParsingRewards(element.Rewards); if (RewardArray.Count <= 0) { NGUITools.SetActive(NoRewardLabel.gameObject, true); } else { for (int i = 0; i < RewardArray.Count; i++) { } } } Toggle.Data = taskInfo.isLock; UIEventListener.Get(Toggle.gameObject).onClick += OnClickToggle; ChangeButton.Data = taskInfo.taskId; UIEventListener.Get(ChangeButton.gameObject).onClick += OnClickChangeButton; DareButton.Data = taskInfo.taskId; UIEventListener.Get(DareButton.gameObject).onClick += OnClickDareButton; mMissionItemList.Add(taskInfo.taskId, MissionObj); } MainTable.repositionNow = true; // MainScrollView.ResetPosition();// int completeNum = res.compLis.Count; int unfinishNum = res.taskLis.Count; if ((completeNum + unfinishNum) * 300 > 1482) { if (unfinishNum * 300 > 1482) { MainScrollView.Press(true); SpringPanel.Begin(MainScrollView.gameObject, new Vector3(-8, completeNum * 300 + 738, 0), 13); } else { MainScrollView.Press(true); SpringPanel.Begin(MainScrollView.gameObject, new Vector3(-8, (completeNum * 300 + unfinishNum * 300 - 744), 0), 13); } } if (Globals.Instance.MTaskManager.mTaskDailyData.NextTaskId != 0) { } }