Class Criterion
Base class for Criterion implementations.
Inherited Members
Namespace: Unity.Tutorials.Core.Editor
Assembly: Unity.Tutorials.Core.Editor.dll
Syntax
public abstract class Criterion : ScriptableObject
Fields
Completed
Raised when this criterion is completed.
Declaration
[Header("Events")]
public CriterionEvent Completed
Field Value
| Type | Description |
|---|---|
| CriterionEvent |
CriterionCompleted
Raised when any Criterion is completed.
Declaration
public static CriterionEvent CriterionCompleted
Field Value
| Type | Description |
|---|---|
| CriterionEvent |
CriterionInvalidated
Raised when any Criterion is invalidated.
Declaration
public static CriterionEvent CriterionInvalidated
Field Value
| Type | Description |
|---|---|
| CriterionEvent |
Invalidated
Raised when this criterion is invalidated.
Declaration
public CriterionEvent Invalidated
Field Value
| Type | Description |
|---|---|
| CriterionEvent |
isTesting
Is this criterion being tested right now?
Declaration
[SerializeField]
[HideInInspector]
protected bool isTesting
Field Value
| Type | Description |
|---|---|
| bool |
performedAtLeastOneEvaluationSinceTestingStarted
Has at least one evaluation been performed since testing started?
Declaration
protected bool performedAtLeastOneEvaluationSinceTestingStarted
Field Value
| Type | Description |
|---|---|
| bool |
Properties
IsCompleted
Is the Criterion completed. Setting this raises CriterionCompleted/CriterionInvalidated.
Declaration
public bool IsCompleted { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
AutoComplete()
Auto-completes the criterion.
Declaration
public abstract bool AutoComplete()
Returns
| Type | Description |
|---|---|
| bool | True if the auto-completion succeeded. |
CreateFutureObjectReference()
Creates a default FutureObjectReference for this Criterion.
Declaration
protected FutureObjectReference CreateFutureObjectReference()
Returns
| Type | Description |
|---|---|
| FutureObjectReference | The new FutureObjectReference instance |
CreateFutureObjectReference(string)
Creates a FutureObjectReference by specific name for this Criterion.
Declaration
protected FutureObjectReference CreateFutureObjectReference(string referenceName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | referenceName | The reference name to which the created FutureObjectReference point to |
Returns
| Type | Description |
|---|---|
| FutureObjectReference | The new FutureObjectReference instance |
EvaluateCompletion()
Evaluates if the criterion is completed.
Declaration
protected virtual bool EvaluateCompletion()
Returns
| Type | Description |
|---|---|
| bool | True if the criterion is completed, false otherwise |
GetFutureObjectReferences()
Returns FutureObjectReference for this Criterion.
Declaration
protected virtual IEnumerable<FutureObjectReference> GetFutureObjectReferences()
Returns
| Type | Description |
|---|---|
| IEnumerable<FutureObjectReference> | An IEnumerable of all future objects references for this Criterion |
OnValidate()
Destroys unreferenced future references.
Declaration
protected virtual void OnValidate()
See Also
ResetCompletionState()
Resets the completion state.
Declaration
public void ResetCompletionState()
StartTesting()
Starts testing of the criterion.
Declaration
public virtual void StartTesting()
StopTesting()
Stops testing of the criterion.
Declaration
public virtual void StopTesting()
UpdateCompletion()
Runs update logic for the criterion.
Declaration
public virtual void UpdateCompletion()
UpdateFutureObjectReferenceNames()
Updates names of the references.
Declaration
protected void UpdateFutureObjectReferenceNames()