Skip to content

Instantly share code, notes, and snippets.

@Hyperparticle
Created November 28, 2017 16:27
Show Gist options
  • Save Hyperparticle/eb97e2ff0e2f29f2656a290c97f9bbf6 to your computer and use it in GitHub Desktop.
Save Hyperparticle/eb97e2ff0e2f29f2656a290c97f9bbf6 to your computer and use it in GitHub Desktop.
Abstract class for all shapes
public abstract class DrawShape : MonoBehaviour
{
/// <summary>
/// Whether all the points in the shape have been specified
/// </summary>
public abstract bool ShapeFinished { get; }
/// <summary>
/// The status of whether the shape is simulating its physics.
/// Setting this property will enable or disable physics.
/// </summary>
public abstract bool SimulatingPhysics { get; set; }
/// <summary>
/// Adds a new vertex to the shape. The shape should
/// also update its mesh and collider.
/// </summary>
public abstract void AddVertex(Vector2 vertex);
/// <summary>
/// Updates the last added vertex with the new given position.
/// The shape should also update its mesh and collider.
/// </summary>
public abstract void UpdateShape(Vector2 newVertex);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment