public void OnTriggerStay2D(Collider2D other) { ATPT_BrushSprite brs = other.GetComponent <ATPT_BrushSprite> (); if (brs != null) { brs.Die(); } }
void OnTriggerStay2D(Collider2D other) { ATPT_BrushSprite brs = other.GetComponent <ATPT_BrushSprite> (); if (brs == null) { return; } float spd = brs._Runner._Speed; if (spd < _SpdThres) { brs.Die(); } else { _Broken.Invoke(); Destroy(gameObject); } }
void OnTriggerEnter2D(Collider2D other) { ATPT_BrushSprite brs = other.GetComponent <ATPT_BrushSprite> (); if (brs == null) { return; } float scl = brs.transform.lossyScale.x; float myScl = transform.lossyScale.x; //Debug.Log ("scl:" + scl + " blockScl:" + myScl); bool bBlock = false; if (_blkType == BlockType.LARGER) { bBlock = (scl > myScl); } else if (_blkType == BlockType.SMALLER) { bBlock = (scl < myScl); } if (bBlock) { brs.Die(); _Kill.Invoke(); } else { _Solve.Invoke(); Destroy(gameObject); } }