Skip to content

Instantly share code, notes, and snippets.

@Hyperparticle
Last active November 28, 2017 16:01
Show Gist options
  • Save Hyperparticle/5bcd6b864591504a98611b77805cdeec to your computer and use it in GitHub Desktop.
Save Hyperparticle/5bcd6b864591504a98611b77805cdeec to your computer and use it in GitHub Desktop.
Draw Controller - Version 1
public class DrawController : MonoBehaviour
{
// ...
private void AddShapeVertex(Vector2 position)
{
if (CurrentShapeToDraw == null) {
// ...
} else {
if (IsDrawingShape) {
CurrentShapeToDraw.AddVertex(position);
} else {
CurrentShapeToDraw.SimulatingPhysics = true;
CurrentShapeToDraw = null;
}
}
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment