using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class InvertedEdges : MonoBehaviour {
	public int NumEdges;
	public float Radius;
	public int low;
	public int high;

	// Use this for initialization
	void Start () {
		EdgeCollider2D edgeCollider = GetComponent<EdgeCollider2D>();
		Vector2[] points = new Vector2[1 + high - low];

		for (int i = low; i <= high; i++)
		{
			float angle = 2 * Mathf.PI * i / NumEdges;
			float x = Radius * Mathf.Cos(angle);
			float y = Radius * Mathf.Sin(angle);

			points[i-low] = new Vector2(x, y);
		}

		edgeCollider.points = points;
	}

	void OnCollisionEnter2D (Collision2D other) {
		
	}
}