private void SetTaskCategory(Task _task, TaskStatus _newStatus, TaskStatus _previousStatus = TaskStatus.NONE) { // REMOVING OF LIST switch (_previousStatus) { case TaskStatus.NONE: break; case TaskStatus.ACHIEVED: activeTasks.Remove(_task); break; case TaskStatus.IN_PROGRESS: activeTasks.Remove(_task); break; case TaskStatus.FAILED: failedTasks.Remove(_task); break; default: Debug.LogError("ERROR_TASKS: Someghing went wrong, make sure the task " + _task.name + " of type " + _task.GetType() + " inherits properly"); break; } // ADDING ON LIST switch (_newStatus) { case TaskStatus.NONE: Debug.LogError("ERROR_TASKS: Someghing went wrong, make sure the task " + _task.name + " of type " + _task.GetType() + " inherits properly"); break; case TaskStatus.ACHIEVED: achievedTasks.Add(_task); break; case TaskStatus.IN_PROGRESS: activeTasks.Add(_task); break; case TaskStatus.FAILED: failedTasks.Add(_task); break; default: Debug.LogError("ERROR_TASKS: Someghing went wrong, make sure the task " + _task.name + " of type " + _task.GetType() + " inherits properly"); break; } }