void StartAnchor() { bool addEvents = false; foreach (Collider2D collider in anchorsList) { if (collider != null) { addEvents = true; } } if (addEvents == false) { return; } Slicer2D slicer = GetComponent <Slicer2D> (); if (slicer != null) { slicer.AddResultEvent(OnAnchorSliceResult); slicer.AddEvent(OnAnchorSlice); } foreach (Collider2D collider in anchorsList) { anchorPolygons.Add(Polygon2DList.CreateFromGameObject(collider.gameObject)[0]); anchorColliders.Add(collider); } }
void Start() { Slicer2D slicer = GetComponent <Slicer2D>(); slicer.AddEvent(OnSlice); slicer.AddResultEvent(AfterSlice); }
void Start() { bool addEvents = false; foreach (Collider2D collider in anchorColliders) { addEvents = true; } if (addEvents == false) { return; } Slicer2D slicer = GetComponent <Slicer2D> (); if (slicer != null) { slicer.AddResultEvent(OnSliceResult); slicer.AddEvent(OnSlice); } foreach (Collider2D collider in anchorColliders) { polygons.Add(Polygon2D.CreateFromCollider(collider.gameObject)); colliders.Add(collider); } }
void Start() { if (anchorCollider == null) { return; } Slicer2D slicer = GetComponent <Slicer2D> (); if (slicer != null) { slicer.AddResultEvent(OnSliceResult); slicer.AddEvent(OnSlice); } polygon = Polygon.CreateFromCollider(anchorCollider.gameObject); }