public void EveryLocation(string dst) { Lucky.LuckyUtils.Log("every location " + dst); TicketFlag = true; MapTrafficView.instance.ShowLocation(dst); Event target = EventList.Find(x => x.condition == dst); if (target != null) { OnePageNoteBook data = new OnePageNoteBook(target, TimeManager.instance.NowTime, ImageList[target.id]); MessageBus.Post(data); } /*switch (dst) * { * case "上海": * //AccidentGenerator.Instance.CreateAccident(AccidentType.airport, 8, 999, TimeManager.instance.NowTime, 4); * break; * }*/ if (dst == "沈阳") { //InfoView.Show(new InfoMessage("终于,你推开家门,感受到了一阵温暖而又熟悉的气息...", "到家了!")); //TimeManager.instance.StopTimeManager(); // TimeManager.instance.SetEnding(); } }
private void SetData(OnePageNoteBook data) { DayImage.sprite = SpriteManager.Instance.GetSprite(data.imagePath); FirstText.text = data.FirstText; InitEvent(data); InvalidView(); }
private bool AddNote(OnePageNoteBook data) { Debug.Log("add note"); //RedPoints.gameObject.SetActive(true); NoteBookModel.Instance.noteBookList.Add(data); Show(); TimeManager.instance.StopTimeManager(); return(false); }
private bool CreateNewNote(OnePageNoteBook data) { GameObject prefab = PrefabManager.Instance.GetPrefabs(Prefabs.OneDayShow); GameObject panelObj = GameObject.Instantiate <GameObject>(prefab); panelObj.transform.SetParent(content); LuckyUtils.MakeIndentity(panelObj.transform); panelObj.GetComponent <OneDayView>().contentMessage = data; panelObj.SetActive(true); LuckyUtils.MakeIndentity(panelObj.transform); return(false); }
private void InitEvent(OnePageNoteBook data) { if (data.chosen == -1) { DateText.text = data.time.ToString("MM/dd HH:mm"); int count = data.buttontext.Count; for (int i = 0; i < buttons.Count; i++) { if (i < count) { buttons[i].gameObject.SetActive(true); texts[i].text = data.buttontext[i]; int temp = i; buttons[i].onClick.AddListener(delegate() { for (int j = 0; j < buttons.Count; j++) { if (j == temp) { continue; } else { buttons[j].gameObject.SetActive(false); } } SecondText.text = data.finaltext[temp]; data.chosen = temp; }); } else { buttons[i].gameObject.SetActive(false); } } } else { for (int i = 0; i < buttons.Count; i++) { if (i == data.chosen) { buttons[i].gameObject.SetActive(true); texts[i].text = data.buttontext[i]; SecondText.text = data.finaltext[i]; } else { buttons[i].gameObject.SetActive(false); } } } }
public void EveryThirtyMinutes(DateTime dt) { Event target = null; //get current status Lucky.LuckyUtils.Log("where " + UserTicketsModel.Instance.where); Lucky.LuckyUtils.Log("Count " + RandomCityList.Count); switch (UserTicketsModel.Instance.where) { case Where.City: { if (RandomCityList.Count != 0 && CityFlag) { target = RandomCityList[rnd.Next(0, RandomCityList.Count)]; if (target != null) { RandomCityList.Remove(target); } CityFlag = false; } break; } case Where.Train: { if (RandomTrainList.Count != 0 && TicketFlag) { int temp = rnd.Next(0, RandomTrainList.Count); target = RandomTrainList[temp]; if (target != null) { RandomTrainList.Remove(target); } TicketFlag = false; CityFlag = true; } break; } case Where.AirPlane: { break; } } if (target != null) { OnePageNoteBook data = new OnePageNoteBook(target, TimeManager.instance.NowTime, ImageList[target.id]); MessageBus.Post(data); } }