public void SetHunt(StartedHunt startedHunt) { CurrentHunt = startedHunt; _nameText.text = startedHunt.Info.Name; //Show corrent number of boxes _boxesPool.IncreaseUntil(CurrentHunt.Info.NumClues); for (int i = 0; i < _boxesPool.Count; i++) { var box = _boxesPool[i]; if (i < CurrentHunt.Info.NumClues) { box.gameObject.SetActive(true); if (i < CurrentHunt.CurrentStep) { box.SetCompleted(); } else if (i == CurrentHunt.CurrentStep) { //Show empty before clue is actually loaded box.ShowEmptyClueTemp(); } else { box.SetLocked(); } } else { box.gameObject.SetActive(false); } } StartShowingClue(); }
public StartedHunt AddStartedHunt(HuntInfo info, int step = 0) { StartedHunt startedHunt = new StartedHunt(info, step); _startedHunts.Add(startedHunt); UpdateView(); return(startedHunt); }
/// <summary> /// Button calls this on pressed /// </summary> public void SendTaskAnswer() { StartedHunt hunt = CurrentHuntPanel.Get.CurrentHunt; if (!LocalTest.Testing) { ServerHandler.CheckTaskAnswerAndAdvance(hunt.Info.ID, hunt.CurrentStep, _playerInput_text.text, OnTaskAnswerResponse); } else { AdvanceHunt("Correct!"); } }
public void OnStartHuntComplete(string response) { if (response != "localTest") { JObject obj = JObject.Parse(response); if ((int)obj["code"] != 200) { return; } } _appearingWindow.Close(); TabManager.Get.SwitchTab(Tab.StartedHunts); StartedHunt startedhunt = StartedHuntsManager.Get.AddStartedHunt(HuntInfo); }