Skip to content

Commit

Permalink
fix(Tracking): update exception message in ObscuranceQuery
Browse files Browse the repository at this point in the history
The ObscuranceQuery logic was changed so the Target requires either a
Collider or if it has a Rigidbody then there must be at least 1 child
Collider.

The Exception messages we never updated so it provided inaccurate
information if the usage criteria was incorrect.
  • Loading branch information
Christopher - Marcel Böddecker committed Oct 24, 2019
1 parent 4d6e971 commit fa000c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Runtime/Tracking/Query/ObscuranceQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
using Malimbe.XmlDocumentationAttribute;
using Malimbe.PropertySerializationAttribute;
using Zinnia.Cast;
using Zinnia.Data.Type;
using Zinnia.Extension;
using Zinnia.Process;
using Zinnia.Extension;
using Zinnia.Data.Type;

/// <summary>
/// Determines whether any <see cref="Collider"/> obscures a line between two <see cref="GameObject"/>s.
Expand All @@ -30,7 +30,7 @@ public class HitEvent : UnityEvent<HeapAllocationFreeReadOnlyList<RaycastHit>>

public class MissingColliderException : Exception
{
public MissingColliderException(UnityEngine.Object owner, GameObject missingColliderGameObject) : base($"The configured {nameof(Target)} '{missingColliderGameObject}' on '{owner}' needs a {nameof(Rigidbody)} or {nameof(Collider)} on it.") { }
public MissingColliderException(UnityEngine.Object owner, GameObject missingColliderGameObject) : base($"The configured {nameof(Target)} '{missingColliderGameObject}' on '{owner}' needs a {nameof(Collider)} on it or if it has a {nameof(Rigidbody)} on it then a child {nameof(Collider)} is required.") { }
}

/// <summary>
Expand Down Expand Up @@ -121,7 +121,7 @@ protected virtual void OnDisable()
}

/// <summary>
/// Throws a <see cref="MissingColliderException"/> if <see cref="Target"/> has neither a <see cref="Rigidbody"/> nor a <see cref="Collider"/> on it.
/// Throws a <see cref="MissingColliderException"/> if <see cref="Target"/> is missing a <see cref="Collider"/> or if the <see cref="Target"/> has a <see cref="Rigidbody"/> and is missing a child <see cref="Collider"/>.
/// </summary>
protected virtual void CheckTarget()
{
Expand Down

0 comments on commit fa000c5

Please sign in to comment.