// Update is called once per frame void Update() { if (taskUI == null) { taskUI = FindObjectOfType <TaskUI>(); } if (active && showOnUi) { taskUI.ShowUiObject(myMinimapObj); myMinimapObj.SetActive(true); } else if (!showOnUi) { taskUI.CloseUiObject(myMinimapObj); myMinimapObj.SetActive(false); } else { myMinimapObj.SetActive(false); } if (active && done && !removed) { taskUI.RemoveTask(this); removed = true; Invoke("TurnOff", .5f); } }
void Awake() { _Instance = this; taskListGrid = transform.Find("Bg/Scroll View/Grid").GetComponent <UIGrid>(); tween = GetComponent <TweenPosition>(); }
private void Awake() { _instance = this; taskParentPanel = transform.parent.GetComponent <TweenPosition>(); tasksList = transform.Find("Task-Scroll-View/Grid").GetComponent <UIGrid>(); btn_close = transform.Find("CloseBtn").GetComponent <UIButton>(); btn_close.onClick.Add(new EventDelegate(this, "CloseTaskPanel")); }
void Awake() { _instance = this; taskListGrid = transform.Find("Scroll View/Grid").GetComponent<UIGrid>(); tween = this.GetComponent<TweenPosition>(); closeButton = transform.Find("CloseButton").GetComponent<UIButton>(); EventDelegate ed = new EventDelegate(this, "OnClose"); closeButton.onClick.Add(ed); }
void Awake() { _instance = this; taskListGrid = transform.Find("Scroll View/Grid").GetComponent <UIGrid>(); tween = this.GetComponent <TweenPosition>(); closeButton = transform.Find("CloseButton").GetComponent <UIButton>(); EventDelegate ed = new EventDelegate(this, "OnClose"); closeButton.onClick.Add(ed); }
void Awake() { _instance = this; taskListGrid = transform.Find("Scroll View/Grid").GetComponent <UIGrid> (); TaskManager._instance.OnTaskChange += this.OnTaskChange; tween = this.GetComponent <TweenPosition> (); close_btn = transform.Find("close_btn").GetComponent <UIButton> (); EventDelegate ed = new EventDelegate(this, "OnClose"); close_btn.onClick.Add(ed); }
void Start() { ui = FindObjectOfType <TaskUI>(); dropMgr = FindObjectOfType <DropManager> (); character = FindObjectOfType <CharacterScript> (); camCtrl = FindObjectOfType <CameraController> (); stairCtrl = FindObjectOfType <StairController> (); exp = FindObjectOfType <XPController> (); queue = new List <int> (); ResetCam(); smallButton = FindObjectOfType <SmallHelpButton> (); }
void Awake() { _instance = this; taskListGrid = transform.Find("Scroll View/Grid").GetComponent<UIGrid>(); taskItemPrefab = Resources.Load<GameObject>("Task-Item"); closeBtn = transform.Find("btn-close").GetComponent<UIButton>(); tween = this.GetComponent<TweenScale>(); EventDelegate ed = new EventDelegate(this, "On_TaskUI_Close_Click"); closeBtn.onClick.Add(ed); EventDelegate ed1 = new EventDelegate(this,"OnTweenFinish"); tween.onFinished.Add(ed1); //TaskManager._instance.OnAsyncTaskComplete += this.OnAsyncTaskComplete; TaskManager._instance.OnAsyncTaskComplete = this.OnAsyncTaskComplete; }
// GET api/task public IEnumerable <TaskUI> Get() { IList <TaskUI> taskUIlist = new List <TaskUI>(); TaskUI taskUI; foreach (Task task in _db.Tasks.Include(x => x.User)) { taskUI = new TaskUI(task); var parentTaskList = _db.ParentTasks.Include(x => x.Task).Where(y => y.Task.Any(z => z.TaskId == task.TaskId)); var projectList = _db.Projects.Include(x => x.Task).Where(y => y.Task.Any(z => z.TaskId == task.TaskId)); Project project = null; ParentTask parentTask = null; User user = null; if (parentTaskList != null && parentTaskList.Any()) { parentTask = parentTaskList.First(x => x.Task.Any()); } if (projectList != null && projectList.Any()) { project = projectList.First(x => x.Task.Any()); } if (parentTask != null) { taskUI.ParentTaskId = parentTask.ParentTaskId; taskUI.Parent_task = parentTask.Parent_Task; } if (project != null) { taskUI.ProjectId = project.ProjectId; taskUI.Project_Name = project.Project_Name; } user = task.User.FirstOrDefault(); if (user != null) { taskUI.UserId = user.UserId; taskUI.User_name = user.FirstName; } taskUIlist.Add(taskUI); } return(taskUIlist); }
public void AddTask(ApplianceKey key, string text) { if (m_TaskLayoutGroup == null) { m_TaskLayoutGroup = GameObject.FindWithTag("task_layout_group"); } Debug.Assert(m_TaskLayoutGroup != null); GameObject task = Instantiate(m_TaskUIPrefab, m_TaskLayoutGroup.transform); TaskUI ui = task.GetComponent <TaskUI>(); Debug.Assert(ui != null); ui.m_ApplianceName = text; m_TaskUIList.Add(key, ui); m_TaskStates.Add(key, TaskState.Incomplete); }
void Awake() { _instance = this; taskListGrid = transform.Find("Scroll View/Grid").GetComponent <UIGrid>(); taskItemPrefab = Resources.Load <GameObject>("Task-Item"); closeBtn = transform.Find("btn-close").GetComponent <UIButton>(); tween = this.GetComponent <TweenScale>(); EventDelegate ed = new EventDelegate(this, "On_TaskUI_Close_Click"); closeBtn.onClick.Add(ed); EventDelegate ed1 = new EventDelegate(this, "OnTweenFinish"); tween.onFinished.Add(ed1); //TaskManager._instance.OnAsyncTaskComplete += this.OnAsyncTaskComplete; TaskManager._instance.OnAsyncTaskComplete = this.OnAsyncTaskComplete; }
void OnClickChindItem(ButtonScript obj, object args, int param1, int param2) { TaskUI.CurrentId = param1; QuestSystem.aqid = param1; AcceptableCell acell = obj.GetComponent <AcceptableCell>(); if (curCell != null) { curCell.stateSp.gameObject.SetActive(false); curCell.statetwoSp.gameObject.SetActive(false); } curCell = acell; acell.stateSp.gameObject.SetActive(true); acell.statetwoSp.gameObject.SetActive(true); //ShowTaskIonf (param1); TaskUI tui = taskInfoObj.GetComponent <TaskUI> (); tui.ShowTaskIonf(param1); }
// Use this for initialization void Start() { ui = FindObjectOfType <TaskUI>(); gameData = FindObjectOfType <FMC_GameDataController> (); main = FindObjectOfType <GameController> (); FMC_TaskCreation.newTaskCreated += NewTask; if (gameData != null) { gameData.createFirstTask(); } else { Debug.LogError("Achtung! There's no GameData object"); } ui.SetSolution(""); }
private void OnClickPTaskBtn(ButtonScript obj, object args, int param1, int param2) { if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Team)) { teampassCount--; isteamquestbtn = true; } SwitchBtnSprite(false); teamObj.SetActive(false); tasksObj.SetActive(true); if (isquestbtn) { passCount = 0; isquestbtn = false; } passCount++; if (passCount >= 2) { TaskUI.SwithShowMe(); } GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_MainTaskUI); }
// Use this for initialization void Start() { ui = FindObjectOfType <TaskUI>(); exp = FindObjectOfType <XPController>(); drop = FindObjectOfType <DropManager>(); shb = FindObjectOfType <SmallHelpButton> (); camControl = FindObjectOfType <CameraController>(); gameControl = FindObjectOfType <GameController>(); screenCenter = camControl.OverlayToWorld(new Vector3(Screen.width / 2, Screen.height / 2, 10)); texts = theStar.GetComponentsInChildren <TMPro.TextMeshPro>(); reference = theYellowThing; theShadow.SetActive(false); theStar.SetActive(false); theYellowThing.SetActive(false); textObj.SetActive(false); string levelString = ContentData.getLabelText("title_LevelUp"); uiText.text = levelString.ToUpper(); }
void Awake() { instance = this; taskListGrid = transform.Find("Scroll View/Grid").GetComponent <UIGrid>(); closeBtn = transform.Find("btn-close").GetComponent <UIButton>(); }
void InitQuestKindItem() { foreach (GameObject c in chindCellList) { maingrid.RemoveChild(c.transform); c.transform.parent = null; c.gameObject.SetActive(false); chindCellPoolList.Add(c); } chindCellList.Clear(); maingrid.Reposition(); int index = maingrid.GetIndex(QuestKindsObj[0].transform); List <QuestData> qdas = QuestSystem.GetQuestDataForQuestKind(QuestKinds[0]); List <QuestData> qds = new List <QuestData> (); Profession pro = Profession.get((JobType)GamePlayer.Instance.GetIprop(PropertyType.PT_Profession), GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel)); for (int i = 0; i < qdas.Count; i++) { if (qdas[i].questKind_ == QuestKind.QK_Profession) { if (qdas[i].JobLevel_ != 1) { if (qdas[i].jobtype_ == (int)GamePlayer.Instance.GetIprop(PropertyType.PT_Profession)) { if (qdas[i].JobLevel_ - GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel) == 1) { qds.Add(qdas[i]); } } } } } for (int i = 0; i < qds.Count; i++) { if (QuestSystem.IsFDailyQuest()) { if (qds[i].questKind_ == QuestKind.QK_Daily) { continue; } } GameObject objCell = null; if (chindCellPoolList.Count > 0) { objCell = chindCellPoolList[0]; chindCellPoolList.Remove(objCell); } else { objCell = Object.Instantiate(item) as GameObject; } UIManager.SetButtonEventHandler(objCell, EnumButtonEvent.OnClick, OnClickChindItem, qds[i].id_, 0); maingrid.AddChild(objCell.transform, ++index); objCell.SetActive(true); objCell.transform.localScale = Vector3.one; AcceptableCell acell = objCell.GetComponent <AcceptableCell>(); acell.Qdata = qds[i]; chindCellList.Add(objCell); maingrid.repositionNow = true; } if (chindCellList.Count > 0) { // AcceptableCell acell = chindCellList[0].GetComponent <AcceptableCell>(); acell.stateSp.gameObject.SetActive(true); acell.statetwoSp.gameObject.SetActive(true); curCell = acell; TaskUI tui = taskInfoObj.GetComponent <TaskUI> (); tui.ShowTaskIonf(qds[0].id_); QuestSystem.aqid = qds[0].id_; } else { TaskUI tui = taskInfoObj.GetComponent <TaskUI> (); tui.closeItem(); tui.chuansongBtn.gameObject.SetActive(false); tui.abnegateBtn.gameObject.SetActive(false); } }
// GET api/task/5 public TaskUI Get(int id) { //return "value"; var taskList = _db.Tasks.Include(x => x.User).Where(y => y.TaskId == id); Task task = null; if (taskList != null && taskList.Any()) { task = taskList.First(); } TaskUI taskUI; if (task != null) { taskUI = new TaskUI(task); var parentTaskList = _db.ParentTasks.Include(x => x.Task).Where(y => y.Task.Any(z => z.TaskId == task.TaskId)); var projectList = _db.Projects.Include(x => x.Task).Where(y => y.Task.Any(z => z.TaskId == task.TaskId)); Project project = null; ParentTask parentTask = null; User user = null; if (parentTaskList != null && parentTaskList.Any()) { parentTask = parentTaskList.First(x => x.Task.Any()); } if (projectList != null && projectList.Any()) { project = projectList.First(x => x.Task.Any()); } if (parentTask != null) { taskUI.ParentTaskId = parentTask.ParentTaskId; taskUI.Parent_task = parentTask.Parent_Task; } if (project != null) { taskUI.ProjectId = project.ProjectId; taskUI.Project_Name = project.Project_Name; } if (task.User != null && task.User.Any()) { user = task.User.First(); } if (user != null) { taskUI.UserId = user.UserId; taskUI.User_name = user.FirstName; } } else { throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound)); } return(taskUI); }
// PUT api/task/5 public HttpResponseMessage Put(int id, [FromBody] TaskUI taskUI) { Task task = _db.Tasks.Find(id); if (task == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } if (taskUI.UserId != null) { User user = _db.Users.Find(taskUI.UserId); if (user != null) { task.User = new List <User>(); task.User.Add(user); } } if (taskUI.ParentTaskId != null) { var previousParentTaskList = _db.ParentTasks.Include(x => x.Task).Where(y => y.Task.Any(z => z.TaskId == taskUI.TaskId)); ParentTask previousParentTask = null; if (previousParentTaskList != null && previousParentTaskList.Any()) { previousParentTask = previousParentTaskList.First(); if (previousParentTask.Task != null) { previousParentTask.Task.Remove(task); _db.Entry(previousParentTask).State = EntityState.Modified; } } var parentTaskList = _db.ParentTasks.Include(x => x.Task).Where(y => y.ParentTaskId == taskUI.ParentTaskId); ParentTask parentTask = null; if (parentTaskList != null && parentTaskList.Any()) { parentTask = parentTaskList.First(); } if (parentTask != null) { if (parentTask.Task == null) { parentTask.Task = new List <Task>(); } parentTask.Task.Add(task); _db.Entry(parentTask).State = EntityState.Modified; } } if (taskUI.ProjectId != null) { var previousProjectList = _db.Projects.Include(x => x.Task).Where(y => y.Task.Any(z => z.TaskId == taskUI.TaskId)); Project previousProject = null; if (previousProjectList != null && previousProjectList.Any()) { previousProject = previousProjectList.First(); if (previousProject.Task != null) { previousProject.Task.Remove(task); _db.Entry(previousProject).State = EntityState.Modified; } } var projectList = _db.Projects.Include(x => x.Task).Where(y => y.ProjectId == taskUI.ProjectId); Project project = null; if (projectList != null && projectList.Any()) { project = projectList.First(); } if (project != null) { if (project.Task == null) { project.Task = new List <Task>(); } project.Task.Add(task); _db.Entry(project).State = EntityState.Modified; } } task.Status = taskUI.Status; task.Start_Date = taskUI.Start_Date; task.End_date = taskUI.End_date; task.Priority = taskUI.Priority; _db.Entry(task).State = EntityState.Modified; try { if (ModelState.IsValid) { _db.SaveChanges(); } else { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } } catch (DbUpdateConcurrencyException) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } return(Request.CreateResponse(HttpStatusCode.OK, taskUI)); }
// POST api/task public HttpResponseMessage Post([FromBody] TaskUI taskUI) { Task task = new Task(taskUI); if (taskUI.UserId != null) { User user = _db.Users.Find(taskUI.UserId); if (user != null) { task.User = new List <User>(); task.User.Add(user); } } _db.Tasks.Add(task); try { if (ModelState.IsValid) { _db.SaveChanges(); if (taskUI.ParentTaskId != null) { var parentTaskList = _db.ParentTasks.Include(x => x.Task).Where(y => y.ParentTaskId == taskUI.ParentTaskId); ParentTask parentTask = null; if (parentTaskList != null && parentTaskList.Any()) { parentTask = parentTaskList.First(); } if (parentTask != null) { if (parentTask.Task == null) { parentTask.Task = new List <Task>(); } parentTask.Task.Add(task); _db.Entry(parentTask).State = EntityState.Modified; } } if (taskUI.ProjectId != null) { var projectList = _db.Projects.Include(x => x.Task).Where(y => y.ProjectId == taskUI.ProjectId); Project project = null; if (projectList != null && projectList.Any()) { project = projectList.First(); } if (project != null) { if (project.Task == null) { project.Task = new List <Task>(); } project.Task.Add(task); _db.Entry(project).State = EntityState.Modified; } } _db.SaveChanges(); } else { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } } catch (DbUpdateConcurrencyException) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } HttpResponseMessage httpResponseMessage = Request.CreateResponse(HttpStatusCode.Created, taskUI); httpResponseMessage.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = task.TaskId })); return(httpResponseMessage); }
public void PutTest() { ProjectController controller = new ProjectController(); controller.Request = new System.Net.Http.HttpRequestMessage { RequestUri = new Uri("http://localhost:50328/api/project") }; controller.Configuration = new System.Web.Http.HttpConfiguration(); controller.Configuration.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional }); controller.RequestContext.RouteData = new HttpRouteData( route: new HttpRoute(), values: new HttpRouteValueDictionary { { "controller", "project" } }); UserController userController = new UserController(); userController.Request = new System.Net.Http.HttpRequestMessage { RequestUri = new Uri("http://localhost:50328/api/project") }; userController.Configuration = new System.Web.Http.HttpConfiguration(); userController.Configuration.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional }); userController.RequestContext.RouteData = new HttpRouteData( route: new HttpRoute(), values: new HttpRouteValueDictionary { { "controller", "user" } }); TaskController taskController = new TaskController(); taskController.Request = new System.Net.Http.HttpRequestMessage { RequestUri = new Uri("http://localhost:50328/api/project") }; taskController.Configuration = new System.Web.Http.HttpConfiguration(); taskController.Configuration.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional }); taskController.RequestContext.RouteData = new HttpRouteData( route: new HttpRoute(), values: new HttpRouteValueDictionary { { "controller", "task" } }); ParentTaskController parentTaskController = new ParentTaskController(); parentTaskController.Request = new System.Net.Http.HttpRequestMessage { RequestUri = new Uri("http://localhost:50328/api/project") }; parentTaskController.Configuration = new System.Web.Http.HttpConfiguration(); parentTaskController.Configuration.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional }); parentTaskController.RequestContext.RouteData = new HttpRouteData( route: new HttpRoute(), values: new HttpRouteValueDictionary { { "controller", "task" } }); int userId = 0; int projectId = 0; int parentTaskId = 0; User userTest = new User(); userTest.EmployeeId = "2222"; userTest.FirstName = "fnameTest"; userTest.LastName = "lnameTest"; userController.Post(userTest); IEnumerable <User> userResult = userController.Get(); if (userResult.Count() > 0 && userResult.Any(x => (x.EmployeeId == "2222" && x.FirstName.Equals("fnameTest") && x.LastName.Equals("lnameTest")))) { userId = userResult.First(x => (x.EmployeeId == "2222" && x.FirstName.Equals("fnameTest") && x.LastName.Equals("lnameTest"))).UserId; userTest = userController.Get(userId); } // Act ProjectUI projectTest = new ProjectUI(); projectTest.Project_Name = "unitTestingProject"; projectTest.Priority = 3; projectTest.StartDate = DateTime.Now.Date; projectTest.EndDate = DateTime.Now.Date.AddDays(2); projectTest.UserId = userId; projectTest.Username = userTest.FirstName; controller.Post(projectTest); IEnumerable <ProjectUI> projectResult = controller.Get(); if (projectResult.Count() > 0 && projectResult.Any(x => (x.Project_Name == "unitTestingProject" && x.Priority == 3 && x.StartDate == DateTime.Now.Date && x.EndDate == DateTime.Now.Date.AddDays(2) && x.UserId == userId))) { projectTest = projectResult.First(x => (x.Project_Name == "unitTestingProject" && x.Priority == 3 && x.StartDate == DateTime.Now.Date && x.EndDate == DateTime.Now.Date.AddDays(2) && x.UserId == userId)); projectId = projectTest.ProjectId; } ParentTask parentTaskTest = new ParentTask(); parentTaskTest.Parent_Task = "parentTaskTest"; parentTaskController.Post(parentTaskTest); var parentTaskResult = parentTaskController.Get(); if (parentTaskResult.Count() > 0 && parentTaskResult.Any(x => (x.Parent_Task == "parentTaskTest"))) { parentTaskTest = parentTaskResult.First(x => (x.Parent_Task == "parentTaskTest")); parentTaskId = parentTaskTest.ParentTaskId; } TaskUI taskTest = new TaskUI(); taskTest.ParentTaskId = parentTaskId; taskTest.ProjectId = projectId; taskTest.Priority = 3; taskTest.Start_Date = DateTime.Now.Date; taskTest.End_date = DateTime.Now.Date.AddDays(2); taskTest.UserId = userId; taskController.Post(taskTest); var taskResult = taskController.Get(); if (taskResult.Count() > 0 && taskResult.Any(x => (x.ParentTaskId == parentTaskId && x.Priority == 3 && x.Start_Date == DateTime.Now.Date && x.End_date == DateTime.Now.Date.AddDays(2) && x.ProjectId == projectId))) { taskTest = taskResult.First(x => (x.ParentTaskId == parentTaskId && x.Priority == 3 && x.Start_Date == DateTime.Now.Date && x.End_date == DateTime.Now.Date.AddDays(2) && x.ProjectId == projectId)); } taskTest.Priority = 15; taskController.Put(taskTest.TaskId, taskTest); taskTest = taskController.Get(taskTest.TaskId); taskController.Delete(taskTest.TaskId); parentTaskController.Delete(parentTaskId); controller.Delete(projectId); userController.DeleteUser(userId); controller.Dispose(); userController.Dispose(); parentTaskController.Dispose(); taskController.Dispose(); // Assert Assert.That(taskTest.Priority, Is.EqualTo(15)); }
private void Awake() { _instance = this; }
//GameController _main; public PauseState(TaskUI ui) { _ui = ui; //_main = main; }
void Awake() { instance = this; }
private void Awake() { _instance = this; doAnim = this.GetComponent <DOTweenAnimation>(); taskListContent = transform.Find("Scroll View/Viewport/Content").gameObject; }
public LevelUpState(TaskUI ui, LevelUpScreen screen) { _screen = screen; _ui = ui; }
private void OnClickrenwuBtn(ButtonScript obj, object args, int param1, int param2) { TaskUI.SwithShowMe(); }