public void OnClick() { if (chapterIsFull) { ChapterInfo chapter = MapModel.Instance.GetChapterInfo(itemConfig.id); if (chapter == null || chapter.reward == false) { MapModel.Instance.ChapterReward(itemConfig); haveImage.gameObject.SetActive(true); } else { MapModel.Instance.SwitchChapter(itemConfig); ModuleModel.Instance.RemoveUIModule((int)ModuleEnum.STAR); ScreenSlider.OpenSlid(); } } else { MapModel.Instance.SwitchChapter(itemConfig); ModuleModel.Instance.RemoveUIModule((int)ModuleEnum.STAR); ScreenSlider.OpenSlid(); } }
private void OnClose(GameObject go) { GameMgr.moduleMgr.RemoveUIModule(ModuleEnum.EXCHANGE); if (PlayerModel.Instance.exchangeInfo.sucFun == null) { ScreenSlider.OpenSlid(); } }
override protected void Awake() { base.Awake(); comingTrans.gameObject.SetActive(false); EventTriggerListener.Get(energyButton.gameObject).onClick = OnEnergyClick; EventTriggerListener.Get(gemButton.gameObject).onClick = OnGemClick; EventTriggerListener.Get(coinButton.gameObject).onClick = OnCoinClick; EventTriggerListener.Get(starButton.gameObject).onClick = OnStarClick; EventTriggerListener.Get(skillBtn.gameObject).onClick = OnSkillClick; EventTriggerListener.Get(setBtn.gameObject).onClick = OnSetClick; EventTriggerListener.Get(adBtn.gameObject).onClick = OnADClick; PlayerModel.Instance.updateWealthEvent += OnUpdateWealthEvent; MapModel.Instance.StarRewardEvent += OnStarRewardEvent; PromptModel.Instance.SlideEvent = OnSlideEvent; MapModel.Instance.SwitchChapterEvent = OnSwitchChapterEvent; MapModel.Instance.SelectChapterEvent = OnSelectChapterEvent; mapItemPrefab = GameMgr.resourceMgr.GetGameObject("prefab/mapmodule.ab", "MapItem"); mapList.itemPrefab = mapItemPrefab; chapterItemPrefab = GameMgr.resourceMgr.GetGameObject("prefab/mapmodule.ab", "ChapterItem"); chapterList.itemPrefab = chapterItemPrefab; ScreenSlider.OpenSlid(); InitChapterList(); /** * GameObject buggerPrefab = GameMgr.resourceMgr.GetGameObject("prefab/base.ab", "Bugger"); * GameObject buggerItem = GameObject.Instantiate(buggerPrefab); * buggerItem.transform.SetParent(buggerPos, false); * buggerItem.transform.localPosition = new Vector3(0,-60,0); * bugger = buggerItem.GetComponent<Bugger>(); * * bugger.AddPos(new BuggerPosInfo(new Vector2(-260, 500), new Vector2(-380, 500))); * bugger.AddPos(new BuggerPosInfo(new Vector2(260, 500), new Vector2(380, 500))); * bugger.AddPos(new BuggerPosInfo(new Vector2(-260, 220), new Vector2(-380, 220))); * bugger.AddPos(new BuggerPosInfo(new Vector2(260, 220), new Vector2(380, 220))); * bugger.AddPos(new BuggerPosInfo(new Vector2(-260, -60), new Vector2(-380, -60))); * bugger.AddPos(new BuggerPosInfo(new Vector2(260, -60), new Vector2(380, -60))); * bugger.AddPos(new BuggerPosInfo(new Vector2(-260, -340), new Vector2(-380, -340))); * bugger.AddPos(new BuggerPosInfo(new Vector2(260, -340), new Vector2(380, -340))); * bugger.Show(); **/ UpdateUI(); GameMgr.audioMgr.PlayMusic("beach_brird"); }
override protected void Awake() { base.Awake(); smallPrefab = ResModel.Instance.GetPrefab("prefab/skillmodule/" + "SkillSmallItem"); smallList.itemPrefab = smallPrefab; groupListPrefab = ResModel.Instance.GetPrefab("prefab/skillmodule/" + "SkillGroupList"); groupList.itemPrefab = groupListPrefab; ScreenSlider.OpenSlid(); PosUtil.SetUIPos(starButton, 12); PosUtil.SetUIPos(bottleButton, 14); PromptModel.Instance.SlideEvent = OnSlideEvent; GameObject buggerPrefab = ResModel.Instance.GetPrefab("prefab/base/" + "Bugger"); GameObject buggerItem = GameObject.Instantiate(buggerPrefab); buggerItem.transform.SetParent(buggerPos, false); buggerItem.transform.localPosition = new Vector3(0, 1000, 0); buggerItem.transform.localScale = new Vector3(0.9f, 0.9f, 1); bugger = buggerItem.GetComponent <Bugger>(); bugger.iconId = 10101; bugger.AddPos(new BuggerPosInfo(new Vector2(0, 780), new Vector2(0, 680))); bugger.AddPos(new BuggerPosInfo(new Vector2(-279, 780), new Vector2(-279, 680))); bugger.AddPos(new BuggerPosInfo(new Vector2(279, 780), new Vector2(279, 680))); bugger.AddPos(new BuggerPosInfo(new Vector2(-558, 468), new Vector2(-458, 468))); bugger.AddPos(new BuggerPosInfo(new Vector2(-558, 312), new Vector2(-458, 312))); bugger.AddPos(new BuggerPosInfo(new Vector2(-558, 156), new Vector2(-458, 156))); bugger.AddPos(new BuggerPosInfo(new Vector2(-558, 0), new Vector2(-458, 0))); bugger.AddPos(new BuggerPosInfo(new Vector2(-558, -156), new Vector2(-458, -156))); bugger.AddPos(new BuggerPosInfo(new Vector2(558, 468), new Vector2(458, 468))); bugger.AddPos(new BuggerPosInfo(new Vector2(558, 312), new Vector2(458, 312))); bugger.AddPos(new BuggerPosInfo(new Vector2(558, 156), new Vector2(458, 156))); bugger.AddPos(new BuggerPosInfo(new Vector2(558, 0), new Vector2(458, 0))); bugger.AddPos(new BuggerPosInfo(new Vector2(558, -156), new Vector2(458, -156))); bugger.Show(); InitList(); UpdateUI(); AudioModel.Instance.PlayMusic("rain"); }
override protected void Awake() { base.Awake(); comingTrans.gameObject.SetActive(false); EventTriggerListener.Get(energyButton.gameObject).onClick = OnEnergyClick; EventTriggerListener.Get(gemButton.gameObject).onClick = OnGemClick; EventTriggerListener.Get(coinButton.gameObject).onClick = OnCoinClick; EventTriggerListener.Get(starButton.gameObject).onClick = OnStarClick; EventTriggerListener.Get(skillBtn.gameObject).onClick = OnSkillClick; EventTriggerListener.Get(setBtn.gameObject).onClick = OnSetClick; EventTriggerListener.Get(adBtn.gameObject).onClick = OnADClick; PlayerModel.Instance.updateWealthEvent += OnUpdateWealthEvent; MapModel.Instance.StarRewardEvent += OnStarRewardEvent; PromptModel.Instance.SlideEvent = OnSlideEvent; MapModel.Instance.SwitchChapterEvent = OnSwitchChapterEvent; MapModel.Instance.SelectChapterEvent = OnSelectChapterEvent; mapItemPrefab = ResModel.Instance.GetPrefab("prefab/mapmodule/MapItem"); mapList.itemPrefab = mapItemPrefab; chapterItemPrefab = ResModel.Instance.GetPrefab("prefab/mapmodule/ChapterItem"); chapterList.itemPrefab = chapterItemPrefab; ScreenSlider.OpenSlid(); InitChapterList(); UpdateUI(); AudioModel.Instance.PlayMusic("beach_brird"); }
private void OnClickClose(GameObject go) { GameMgr.moduleMgr.RemoveUIModule(ModuleEnum.ENERGY); ScreenSlider.OpenSlid(); }
private void OnClickClose(GameObject go) { ModuleModel.Instance.RemoveUIModule((int)ModuleEnum.ADREWARD); ScreenSlider.OpenSlid(); }