PlatformerUtilities Class

Summary

Various utility methods used throughout the PlatformerGameKit.
Assembly
PlatformerGameKit.dll
Namespace
PlatformerGameKit
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["PlatformerUtilities"] class Type type-node

Syntax

public static class PlatformerUtilities

Fields

Name Constant Value Summary
OneContact
An array of one contact for physics queries.
static
OneRaycastHit
An array of one hit for physics queries.
static

Methods

Name Value Summary
Clamp(float, float, float) void
Makes sure the `value` is between the `min` and `max` (inclusive).
static
DoHandle2D(Vector2, float) Vector2
[Editor-Only] Draws a 2D handle at the specified `position` which can be dragged around.
static
DrawBox(Vector3, Vector3, Color, float) void
static
DrawBoxCast(Vector3, Vector3, Vector3, Color, float) void
static
DrawLine(Vector3, Vector3, Color, float) void
static
DrawRay(ContactPoint, Color, float) void
static
DrawRay(ContactPoint2D, Color, float) void
static
DrawRay(RaycastHit, Color, float) void
static
DrawRay(RaycastHit2D, Color, float) void
static
DrawRay(Vector3, Vector3, Color, float) void
static
GetTeam(GameObject) Team
static
InsertAt<T>(T[], int, T) void
Resizes the `array` to be 1 larger and inserts the `item` at the specified `index`.
static
IsAlly(Team, Team) bool
static
IsEnemy(GameObject, GameObject) bool
static
IsEnemy(Team, GameObject) bool
static
IsEnemy(Team, Team) bool
static
NotNegative(float) void
Makes sure the `value` is not negative.
static
NotNegative(int) void
Makes sure the `value` is not negative.
static
PerpendicularA(Vector2) Vector2
Returns a new vector that is perpendicular to the `original`.
static
PerpendicularAXY(Vector3) Vector3
Returns a new vector that is perpendicular to the `original` on the XY plane.
static
PerpendicularB(Vector2) Vector2
Returns a new vector that is perpendicular to the `original`.
static
PerpendicularBXY(Vector3) Vector3
Returns a new vector that is perpendicular to the `original` on the XY plane.
static
RemoveAt<T>(T[], int) void
Removes the item at the specified `index` and resizes the `array` to be 1 smaller.
static
RoundToPixel(GameObject, Vector2) Vector2
[Editor-Only] Returns a copy of the `point` rounded to the nearest pixel of the UnityEngine.SpriteRenderer attached to the `gameObject` (or its parent or children).
static
SmoothDamp(float, float, float, float) float
Returns the `target` if `smoothTime` is 0. Otherwise calls UnityEngine.Mathf.SmoothDamp(System.Single,System.Single,System.Single@,System.Single).
static
SmoothDamp(Vector2, Vector2, Vector2, float) Vector2
Returns the `target` if `smoothTime` is 0. Otherwise calls UnityEngine.Vector2.SmoothDamp(UnityEngine.Vector2,UnityEngine.Vector2,UnityEngine.Vector2@,System.Single).
static