示例#1
0
        void ParseContent(string c)
        {
            UnityAction <string, string> PrintConsole = (content, info) => {
                var s = content + "\n" + info + "\n";
                m_page.content.text += s;
            };
            var text = m_page.input.text;

            string[] split = text.Split(',');
            switch (split[0])
            {
            case "AddCurrency":
                /// Add Currency
                if (split.Length != 2)
                {
                    PrintConsole(c, "Input Error");
                    break;
                }
                var value = Utility.TryParseInt(split[1]);
                PlayerManager.Instance.AddCurrency_Current(value);
                break;

            case "AddMaterial":
                if (split.Length != 3)
                {
                    PrintConsole(c, "Input Error");
                    break;
                }
                var materialID = Utility.TryParseInt(split[1]);
                if (MaterialModule.GetMaterialByMaterialID(materialID) == null)
                {
                    PrintConsole(c, "MaterialID Not Found!");
                    break;
                }
                var valueMa = Utility.TryParseInt(split[2]);
                PlayerManager.Instance.AddMaterialData(materialID, (ushort)valueMa);
                break;

            case "ShowEvent":
                if (split.Length != 2)
                {
                    PrintConsole(c, "Input Error");
                    break;
                }
                var EventID = Utility.TryParseInt(split[1]);
                if (ExploreModule.GetExploreEventDataByKey(EventID) == null)
                {
                    PrintConsole(c, "EventID Not Found!");
                    break;
                }
                UIGuide.Instance.ShowRandomEventDialog(EventID, 0, 0, 0);
                break;
            }
        }
示例#2
0
        public RandomEventDialogItem(int eventID, int areaid, int exploreID, int pointID)
        {
            AreaID    = areaid;
            ExploreID = exploreID;
            PointID   = pointID;

            EventID        = eventID;
            eventName      = ExploreModule.GetEventName(eventID);
            eventTitleName = ExploreModule.GetEventTitleName(eventID);
            eventDesc      = ExploreModule.GetEventDesc(eventID);
            eventBG        = ExploreModule.GetEventBG(eventID);
            itemList       = ExploreModule.GetChooseItem(eventID);
        }