/// <summary> /// Создаёт новую задачу (вызывается из кнопки добавления задач) /// </summary> public void CreateNewTask() { var placeForTasks = transform.parent; var newTask = Instantiate(taskPrefab, placeForTasks).GetComponent <Task>(); newTask.Create(TaskTools.GetStatCategory(), TaskTools.GetKey(), TaskTools.GetAmountToComplete(), TaskTools.GetCharacter()); newTask.UpdateView(); var trueTaskController = placeForTasks.GetComponent <TaskController>(); trueTaskController.cooldownEnd = DateTime.Now.AddSeconds(CooldownTimeSeconds); trueTaskController.SaveCooldownTime(); trueTaskController.taskAddBtnIsRendered = false; Destroy(gameObject); }