void OnEnable() { sc = (StarCollider2D)target; edgeCollider = sc.GetComponent<EdgeCollider2D>(); if (edgeCollider == null) { sc.gameObject.AddComponent<EdgeCollider2D>(); edgeCollider = sc.GetComponent<EdgeCollider2D>(); } edgeCollider.points = sc.getPoints(edgeCollider.offset); }
void OnEnable() { sc = (StarCollider2D)target; polyCollider = sc.GetComponent <PolygonCollider2D>(); if (polyCollider == null) { polyCollider = sc.gameObject.AddComponent <PolygonCollider2D>(); } polyCollider.points = sc.getPoints(); }
void OnEnable() { sc = (StarCollider2D)target; edgeCollider = sc.GetComponent <EdgeCollider2D>(); if (edgeCollider == null) { sc.gameObject.AddComponent <EdgeCollider2D>(); edgeCollider = sc.GetComponent <EdgeCollider2D>(); } edgeCollider.points = sc.getPoints(edgeCollider.offset); }