public virtual void checkTaskCompletion() {
Task t = sm.CurrentTask;
//make sure a task exists.
if (t != null) {
//if the tasks interaction object is this object.
if (t.TaskObject == this) { //you've completed this task.
//you've just completed the task.
Debug.Log("Completed Task");
t.State = Task.CompleteState.completed;
}
}
}