Exemple #1
0
 /// <summary>
 /// sets the number of degrees between each subdivision for use with EndCapType.Smooth
 /// </summary>
 /// <returns>The per subdivision.</returns>
 /// <param name="degreesPerSubdivision">Degrees per subdivision.</param>
 public LineRenderer setDegreesPerSubdivision(float degreesPerSubdivision)
 {
     Insist.isTrue(degreesPerSubdivision > 0, "degreesPerSubdivision must be greater than 0");
     this.degreesPerSubdivision = degreesPerSubdivision;
     return(this);
 }
Exemple #2
0
 /// <summary>
 /// gets all the colliders that fall within the specified circle
 /// </summary>
 /// <returns>the number of Colliders returned</returns>
 /// <param name="center">Center.</param>
 /// <param name="radius">Radius.</param>
 /// <param name="results">Results.</param>
 /// <param name="layerMask">Layer mask.</param>
 public static int OverlapCircleAll(Vector2 center, float radius, Collider[] results, int layerMask = AllLayers)
 {
     Insist.IsFalse(results.Length == 0,
                    "An empty results array was passed in. No results will ever be returned.");
     return(_spatialHash.OverlapCircle(center, radius, results, layerMask));
 }
Exemple #3
0
 /// <summary>
 /// casts a line through the spatial hash and fills the hits array up with any colliders that the line hits
 /// </summary>
 /// <returns>The all.</returns>
 /// <param name="start">Start.</param>
 /// <param name="end">End.</param>
 /// <param name="hits">Hits.</param>
 /// <param name="layerMask">Layer mask.</param>
 public static int LinecastAll(Vector2 start, Vector2 end, RaycastHit[] hits, int layerMask = AllLayers)
 {
     Insist.IsFalse(hits.Length == 0, "An empty hits array was passed in. No hits will ever be returned.");
     return(_spatialHash.Linecast(start, end, hits, layerMask));
 }
Exemple #4
0
 /// <summary>
 /// gets all the colliders that fall within the specified rect
 /// </summary>
 /// <returns>the number of Colliders returned</returns>
 /// <param name="rect">Rect.</param>
 /// <param name="results">Results.</param>
 /// <param name="layerMask">Layer mask.</param>
 public static int OverlapRectangleAll(ref RectangleF rect, Collider[] results, int layerMask = AllLayers)
 {
     Insist.IsFalse(results.Length == 0,
                    "An empty results array was passed in. No results will ever be returned.");
     return(_spatialHash.OverlapRectangle(ref rect, results, layerMask));
 }
Exemple #5
0
 /// <summary>
 /// removes a SceneComponent from the SceneComponents list
 /// </summary>
 public void removeSceneComponent(SceneComponent component)
 {
     Insist.isTrue(_sceneComponents.contains(component), "SceneComponent {0} is not in the SceneComponents list!", component);
     _sceneComponents.remove(component);
     component.onRemovedFromScene();
 }