示例#1
0
    public void OnTriggerStay2D(Collider2D other)
    {
        ATPT_BrushSprite brs = other.GetComponent <ATPT_BrushSprite> ();

        if (brs != null)
        {
            brs.Die();
        }
    }
示例#2
0
    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);
        }
    }
示例#3
0
    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);
        }
    }