/// <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) { Assert.isFalse(results.Length == 0, "An empty results array was passed in. No results will ever be returned."); return(_spatialHash.overlapCircle(center, radius, results, layerMask)); }
/// <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) { Assert.isFalse(results.Length == 0, "An empty results array was passed in. No results will ever be returned."); return(_spatialHash.overlapRectangle(ref rect, results, layerMask)); }
/// <summary> /// adds an Entity to the Scene's Entities list /// </summary> /// <param name="entity">The Entity to add</param> public T addEntity <T>(T entity) where T : Entity { Assert.isFalse(entities.contains(entity), "You are attempting to add the same entity to a scene twice: {0}", entity); entities.add(entity); return(entity); }
/// <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) { Assert.isFalse(hits.Length == 0, "An empty hits array was passed in. No hits will ever be returned."); return(_spatialHash.linecast(start, end, hits, layerMask)); }
public static void drawString(this Batcher batcher, NezSpriteFont spriteFont, StringBuilder text, Vector2 position, Color color) { Assert.isFalse(text == null); batcher.drawString(spriteFont, text, position, color, 0.0f, Vector2.Zero, new Vector2(1.0f), SpriteEffects.None, 0.0f); }