public void addTaskToCurrent(TaskNote tn) { TaskNote taskNote = (TaskNote)Instantiate(taskNotePrefab, tasksLayout); taskNote.transform.localScale = new Vector3(1, 1, 1); taskNote.setTask(tn.getTask()); currentChild.getChild().currentTasks.Add(taskNote.getTask().DBId); DBWorker.addCurrentTask(currentChild.getChild(), tn.getTask()); showAddTask(false); }
public void taskChoised(TaskNote taskNote) { currentTaskView.setTask((taskNote == null ? null : taskNote.getTask())); if (currentTask != null) { currentTask.setCurrent(false); } currentTask = taskNote; if (currentTask != null) { currentTask.setCurrent(); } }
void Awake() { //FileWorker.readLevelFromFileForNote ("Components\\Levels\\test.cglvl", ref taskNote); Task[] tasks = DBWorker.loadAllTasks(); //currentTask.setTask (tasks [0]); for (int i = 0; i < tasks.Length; i++) { TaskNote taskNote = (TaskNote)Instantiate(taskNotePrefab, tasksLayout); taskNote.transform.localScale = new Vector3(1, 1, 1); taskNote.setTask(tasks [i]); //taskNote.GetComponent <Button> ().buttonPresed += taskChoised; } }
private void setTaskList(Task[] tasks) { TaskNote [] taskNotes = tasksLayout.GetComponentsInChildren <TaskNote> (); for (int i = 0; i < taskNotes.Length; i++) { DestroyObject(taskNotes [i].gameObject); } for (int i = 0; i < tasks.Length; i++) { TaskNote taskNote = (TaskNote)Instantiate(taskNotePrefab, tasksLayout); taskNote.transform.localScale = new Vector3(1, 1, 1); taskNote.setTask(tasks [i]); } }
void Awake() { User[] children = DBWorker.loadChildren(); for (int i = 0; i < children.Length; i++) { ChildNote childNote = (ChildNote)Instantiate(childNotePrefab, childrenLayout); childNote.transform.localScale = new Vector3(1, 1, 1); childNote.setChild(children [i]); } taskList = DBWorker.loadAllTasks(); for (int i = 0; i < taskList.Length; i++) { TaskNote taskNote = (TaskNote)Instantiate(fullTaskNotePrefab, allTasksLayout); taskNote.transform.localScale = new Vector3(1, 1, 1); taskNote.setTask(taskList [i]); } List <string> monthes = new List <string> (); for (int i = 0; i < MONTH_COUNT; i++) { monthes.Add((i + 1).ToString()); } month.AddOptions(monthes); List <string> years = new List <string> (); //System.DateTime curDateTime = System.DateTime.Now; //for (int i = curDateTime.Year - YEAR_PERIOD + 1; i <= curDateTime.Year; i++) { for (int i = 2017 - YEAR_PERIOD + 1; i <= 2017; i++) { years.Add(i.ToString()); } year.AddOptions(years); List <string> days = new List <string> (); for (int i = 1; i <= DAYS_IN_MONTH; i++) { days.Add(i.ToString()); } day.AddOptions(days); }