diff --git a/X10D.Unity/src/ComponentExtensions.cs b/X10D.Unity/src/ComponentExtensions.cs
index 6ad7388..01d0a27 100644
--- a/X10D.Unity/src/ComponentExtensions.cs
+++ b/X10D.Unity/src/ComponentExtensions.cs
@@ -14,8 +14,14 @@ public static class ComponentExtensions
/// The component whose child components to retrieve.
/// The type of the components to retrieve.
/// An array representing the child components.
+ /// is .
public static T[] GetComponentsInChildrenOnly(this Component component)
{
+ if (component == null)
+ {
+ throw new ArgumentNullException(nameof(component));
+ }
+
return component.gameObject.GetComponentsInChildrenOnly();
}
}
diff --git a/X10D.Unity/src/Drawing/PolyhedronExtensions.cs b/X10D.Unity/src/Drawing/PolyhedronExtensions.cs
index 108b9a8..94cd4ed 100644
--- a/X10D.Unity/src/Drawing/PolyhedronExtensions.cs
+++ b/X10D.Unity/src/Drawing/PolyhedronExtensions.cs
@@ -14,8 +14,14 @@ public static class PolyhedronExtensions
///
/// The polyhedron whose vertices to update.
/// The vertex to add.
+ /// is .
public static void AddVertex(this Polyhedron polyhedron, Vector3Int vertex)
{
+ if (polyhedron is null)
+ {
+ throw new ArgumentNullException(nameof(polyhedron));
+ }
+
polyhedron.AddVertex(vertex.ToSystemVector());
}
@@ -24,8 +30,14 @@ public static class PolyhedronExtensions
///
/// The polyhedron whose vertices to update.
/// The vertex to add.
+ /// is .
public static void AddVertex(this Polyhedron polyhedron, Vector3 vertex)
{
+ if (polyhedron is null)
+ {
+ throw new ArgumentNullException(nameof(polyhedron));
+ }
+
polyhedron.AddVertex(vertex.ToSystemVector());
}
@@ -34,8 +46,23 @@ public static class PolyhedronExtensions
///
/// The polyhedron whose vertices to update.
/// The vertices to add.
+ ///
+ /// is .
+ /// -or-
+ /// is .
+ ///
public static void AddVertices(this Polyhedron polyhedron, IEnumerable vertices)
{
+ if (polyhedron is null)
+ {
+ throw new ArgumentNullException(nameof(polyhedron));
+ }
+
+ if (vertices is null)
+ {
+ throw new ArgumentNullException(nameof(vertices));
+ }
+
foreach (Vector3Int vertex in vertices)
{
polyhedron.AddVertex(vertex);
@@ -47,8 +74,23 @@ public static class PolyhedronExtensions
///
/// The polyhedron whose vertices to update.
/// The vertices to add.
+ ///
+ /// is .
+ /// -or-
+ /// is .
+ ///
public static void AddVertices(this Polyhedron polyhedron, IEnumerable vertices)
{
+ if (polyhedron is null)
+ {
+ throw new ArgumentNullException(nameof(polyhedron));
+ }
+
+ if (vertices is null)
+ {
+ throw new ArgumentNullException(nameof(vertices));
+ }
+
foreach (Vector3 vertex in vertices)
{
polyhedron.AddVertex(vertex);
diff --git a/X10D.Unity/src/GameObjectExtensions.cs b/X10D.Unity/src/GameObjectExtensions.cs
index 23d7f3c..559ee39 100644
--- a/X10D.Unity/src/GameObjectExtensions.cs
+++ b/X10D.Unity/src/GameObjectExtensions.cs
@@ -13,8 +13,14 @@ public static class GameObjectExtensions
/// The game object whose child components to retrieve.
/// The type of the components to retrieve.
/// An array representing the child components.
+ /// is .
public static T[] GetComponentsInChildrenOnly(this GameObject gameObject)
{
+ if (gameObject == null)
+ {
+ throw new ArgumentNullException(nameof(gameObject));
+ }
+
Transform rootTransform = gameObject.transform;
var components = new List(gameObject.GetComponentsInChildren());