public TaskController(TaskModel taskModel, TaskData taskData, GameContext context) { _taskModel = taskModel; _taskObjects = taskModel.GetTasks(); _taskbar = Object.Instantiate(taskData.TaskStruct.TaskbarPrefab, context.Canvas.transform).GetComponent <TaskbarView>(); _taskbar.Initialize(_taskObjects.Length, taskModel); taskModel.LoadTaskObject += LoadTaskObject; foreach (var taskObject in _taskObjects) { taskObject.Initialize(context.Canvas, taskData); taskObject.CompletedTask += CompleteTask; if (taskObject is TaskObjectExecutable executeTask) { _executeTasks.Add(executeTask); } } }
public TaskFactory(TaskData taskData, Transform root, GameContext context) { _tasks = root.GetComponentsInChildren <TaskObjectStatic>(); _context = context; }
public abstract void Initialize(Canvas canvas, TaskData taskData);