SimObject.checkTaskCompletion C# (CSharp) Method

checkTaskCompletion() public method

Checks the task completion. Should be called whenever an object is interacted in a way that would complete a task. Uses simulation manager to get the current task
public checkTaskCompletion ( ) : void
return void
	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;

			}

		}

	}