public bool CanPractice() { MainGameMode mgm = pCoreMgr.GetGameMode() as MainGameMode; if (ActionPoints < mgm.GetPracticeCost()) { return(false); } return(true); }
public override void RegisterEvent() { view.NextStage.onClick.AddListener(delegate() { mUIMgr.CloseCertainPanel(this); SetupPlayerInfo(); GameMain.GetInstance().GetModule <CoreManager>().ChangeScene("Main", delegate { ICoreManager cm = GameMain.GetInstance().GetModule <CoreManager>(); MainGameMode gm = cm.GetGameMode() as MainGameMode; gm.NextTurn(); }); //mUIMgr.ShowPanel("UIMain"); }); for (int i = 0; i < view.avalableList.Count; i++) { DragEventListener listener = view.avalableList[i].root.gameObject.GetComponent <DragEventListener>(); if (listener == null) { listener = view.avalableList[i].root.gameObject.AddComponent <DragEventListener>(); SpecilistView speView = view.avalableList [i]; //GameObject go = view.avalableList [i].root.gameObject; RegisterAsAvailable(speView); } } foreach (BasePropertyLineView vv in view.baseLines) { BasePropertyLineView nowV = vv; int idx = view.baseLines.IndexOf(nowV); { ClickEventListerner listener = vv.AddButton.gameObject.GetComponent <ClickEventListerner>(); if (listener == null) { listener = vv.AddButton.gameObject.AddComponent <ClickEventListerner>(); listener.OnClickEvent += delegate(PointerEventData eventData) { if (model.LeftPoint <= 0) { return; } model.LeftPoint--; model.extra[idx]++; view.PointLeft.text = model.LeftPoint + ""; view.baseLines[idx].ExtraValue.text = model.extra[idx] + ""; }; } } { ClickEventListerner listener = vv.MinusButton.gameObject.GetComponent <ClickEventListerner>(); if (listener == null) { listener = vv.MinusButton.gameObject.AddComponent <ClickEventListerner>(); listener.OnClickEvent += delegate(PointerEventData eventData) { if (model.extra[idx] <= 0) { return; } model.LeftPoint++; model.extra[idx]--; view.PointLeft.text = model.LeftPoint + ""; view.baseLines[idx].ExtraValue.text = model.extra[idx] + ""; }; } } } }
public override void RegisterEvent() { view.NextStage.onClick.AddListener(delegate() { ICoreManager cm = GameMain.GetInstance().GetModule <CoreManager>(); mUIMgr.CloseCertainPanel(this); cm.ChangeScene("Zhibo", null, delegate { MainGameMode gm = pCoreMgr.GetGameMode() as MainGameMode; if (gm == null) { Debug.LogError("load gm error"); } gm.NextTurn(); }); }); view.ScheduleBtn.onClick.AddListener(delegate() { mUIMgr.ShowPanel("SchedulePanel"); }); view.InspectBtn.onClick.AddListener(delegate() { mUIMgr.ShowPanel("CardsMgr"); }); { ClickEventListerner listener = view.PhoneMiniIcon.gameObject.GetComponent <ClickEventListerner>(); if (listener == null) { listener = view.PhoneMiniIcon.gameObject.AddComponent <ClickEventListerner>(); listener.OnClickEvent += delegate(PointerEventData eventData) { view.PhoneBigPic.gameObject.SetActive(true); view.PhoneMiniIcon.gameObject.SetActive(false); view.PhoneBigPic.transform.localScale = new Vector3(0.3f, 0.3f, 1f); Tween tween = DOTween.To ( () => view.PhoneBigPic.transform.localScale, (x) => view.PhoneBigPic.transform.localScale = x, new Vector3(1f, 1f, 1f), 0.3f ); }; } } { ClickEventListerner listener = view.Close.gameObject.GetComponent <ClickEventListerner>(); if (listener == null) { listener = view.Close.gameObject.AddComponent <ClickEventListerner>(); listener.OnClickEvent += delegate(PointerEventData eventData) { //check position of the phone if (closeCtr) { { Tween tween = DOTween.To ( () => view.PhoneBigPic.rectTransform.anchoredPosition, (x) => view.PhoneBigPic.rectTransform.anchoredPosition = x, new Vector2(778, -285), 0.3f ); } closeCtr = false; //mUIMgr.CloseCertainPanel(); } view.PhoneBigPic.gameObject.SetActive(false); view.PhoneMiniIcon.gameObject.SetActive(true); }; } } foreach (AppView vv in view.appViews) { ClickEventListerner listener = vv.root.gameObject.GetComponent <ClickEventListerner>(); if (listener == null) { listener = vv.root.gameObject.AddComponent <ClickEventListerner>(); listener.OnClickEvent += delegate(PointerEventData eventData) { OpenApp(vv); }; } } }