Exemplo n.º 1
0
        public void InitBtn(UI.RandomEventDialogItem item,int chooseID)
        {
            eventItem = item;
            var exploreChooseItem = item.itemList.Find(x => x.ChooseID == chooseID);
            if (exploreChooseItem != null)
            {
                chooseItem = exploreChooseItem;
                _content.text = exploreChooseItem.content;
                _btn.onClick.RemoveAllListeners();
                _btn.onClick.AddListener(() =>
                {
                    AudioManager.Instance.PlaySound(AudioClipPath.UISound.Button_Click);

                    ///Reward
                    GlobalEventManager.Instance.HandleRewardDataItem(exploreChooseItem.rewardID);
                    ExploreEventManager.Instance.OnRandomEventFinish(item);

                    if (exploreChooseItem.nextEvent != 0)
                    {
                        if (ExploreModule.GetExploreEventDataByKey(exploreChooseItem.nextEvent) != null)
                        {
                            UIGuide.Instance.ShowRandomEventDialog(exploreChooseItem.nextEvent,item.AreaID,item.ExploreID, item.PointID);
                        }
                    }
                    else
                    {
                        ExploreEventManager.Instance.FinishExplorePoint(item.AreaID,item.ExploreID,item.PointID);
                        UIManager.Instance.HideWnd(UIPath.WindowPath.RandomEvent_Dialog);
                    }
                });
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取事件选项
        /// </summary>
        /// <param name="eventID"></param>
        /// <returns></returns>
        public static List <ExploreChooseItem> GetChooseItem(int eventID)
        {
            List <ExploreChooseItem> result = new List <ExploreChooseItem>();
            var List = GetExploreChooseList(eventID);

            for (int i = 0; i < List.Count; i++)
            {
                ExploreChooseItem item = new ExploreChooseItem(
                    List[i].ChooseID);
                result.Add(item);
            }
            return(result);
        }