PhaseJumpPro

Design Patterns Code for Unity Games

View the Project on GitHub coinbump/PhaseJumpPro

Module: Core

Classes and utilities that are common to many games.

Class: Base

Description

Provides common interface for all objects.

Example: Go() is a common interface for game objects that need to be kickstarted in some way.

Stability

Simple class. Stable.

Class: CircleSpawner2D

Description

Spawns a game object inside a 2D circle determined by its radius. The spawn area extends from the spawner’s position, which defines the center of the circle.

Stability

Stable.

Class: MonoBehaviour

Description

Common extensions to Unity’s MonoBehaviour class.

Methods

RenderGizmos(EditorUtils.RenderState): Wraps multiple separate Unity calls into one, using a RenderState type.

Stability

Stable.

Class: Node

Description

Base class for all Phase Jump nodes in 3D/2D space.

Contains state machine and auto culling for off camera objects.

Stability

Stable.

Class: Node2D

Node2D

Class: RandomUtils

Description

Utilities for random choices & behavior.

Methods

ChooseFrom(Type[]): Returns a random element from the array, or a default value if the array is empty.

ChooseFrom(List): Returns a random element from the list, or a default value if the array is empty.

VaryFloat(float value, float vary): Returns the original float value + a random delta.

Example: float(10, 3) produces random values between 7-13.

Delta(float delta): Returns a random value between -delta…delta

Stability

Simple utilities. Stable.

Class: RectSpawner2D

Description

Spawns a game object inside a 2D rectangle determined by width, height. The spawn area extends from the spawner’s position, which defines the center of the rectangle.

Stability

Stable.

Class: SnapToGridLoc2D

Description

Specifies a grid location for a game object, with a screen offset. Causes the object to snap to the grid position in the editor.

Public Properties

Vector3Int value: Location in grid space (z axis is used for layers) Vector3 offset: Offset in screen space

Stability

Stable.