void StartAnchor() { bool addEvents = false; foreach (Collider2D collider in anchor.anchorsList) { if (collider != null) { addEvents = true; } } if (addEvents == false) { return; } Sliceable2D slicer = GetComponent <Sliceable2D> (); if (slicer != null) { slicer.AddResultEvent(OnAnchorSliceResult); slicer.AddEvent(OnAnchorSlice); } anchor.anchorPolygons = new List <Polygon2D>(); anchor.anchorColliders = new List <Collider2D>(); foreach (Collider2D collider in anchor.anchorsList) { anchor.anchorPolygons.Add(Polygon2DList.CreateFromGameObject(collider.gameObject)[0]); anchor.anchorColliders.Add(collider); } }
void Start() { Sliceable2D slicer = GetComponent <Sliceable2D>(); if (slicer != null) { slicer.AddResultEvent(SliceEvent); } posZ = transform.position.z - 0.1f; }
void Start() { Sliceable2D slicer = GetComponent <Sliceable2D>(); slicer.AddResultEvent(SlicerEvent); if (timer == null) { timer = TimerHelper.Create(); } }
// Use this for initialization void Start() { Sliceable2D slicer = GetComponent <Sliceable2D>(); slicer.AddResultEvent(SliceEvent); }