Example #1
0
    //-------------------------------------------------------------------------
    void OnTriggerEnter(Collider other)
    {
        if (mIsSignDestroy)
        {
            return;
        }

        if ("CSpriteFish" != other.gameObject.tag)
        {
            return;
        }

        if (mBullet.getLockFish() == null)
        {
            FishStillSprite sprite_fish = other.gameObject.GetComponent <FishStillSprite>();
            if (sprite_fish != null)
            {
                _hitFish(sprite_fish.getSpriteFish().getRenderFish());
            }
        }
        else
        {
            FishStillSprite sprite_fish = other.gameObject.GetComponent <FishStillSprite>();
            if (sprite_fish != null && sprite_fish.getSpriteFish().getRenderFish().FishObjId == mBullet.getLockFish().FishObjId)
            {
                _hitFish(sprite_fish.getSpriteFish().getRenderFish());
            }
        }
    }
Example #2
0
    //-------------------------------------------------------------------------
    void OnTriggerEnter(Collider other)
    {
        if (mMaxHitFish <= 0)
        {
            mCSpriteFishNetGroup.setTrigger(false);
            return;
        }
        if ("CSpriteFish" != other.gameObject.tag)
        {
            return;
        }

        FishStillSprite sprite_fish = other.gameObject.GetComponent <FishStillSprite>();
        CRenderFish     render_fish = sprite_fish.getSpriteFish().getRenderFish();

        if (render_fish != null)
        {
            _hitFish(render_fish);
        }
    }