Ejemplo n.º 1
0
    public void SetCollisionCallback(Func <CollisionHitCallbackStruct, bool> CallBack)
    {
        RFX4_RaycastCollision rfx4_RaycastCollision = GetComponent <RFX4_RaycastCollision>();

        if (rfx4_RaycastCollision != null)
        {
            if (nowCallBack != null)
            {
                try
                {
                    rfx4_RaycastCollision.CollisionHandle -= nowCallBack;
                    nowCallBack = null;
                }
                catch { }
                nowCallBack = (sender, e) =>
                {
                    if (CallBack != null && e != null)
                    {
                        CallBack(new CollisionHitCallbackStruct()
                        {
                            hitPoint = e.point, targetObj = e.collisionObj
                        });
                    }
                };
                rfx4_RaycastCollision.CollisionHandle += nowCallBack;
            }
        }
    }
Ejemplo n.º 2
0
    public void SetRange(float range)
    {
        RFX4_RaycastCollision rfx4_RaycastCollision = GetComponent <RFX4_RaycastCollision>();

        if (rfx4_RaycastCollision != null)
        {
            rfx4_RaycastCollision.RaycastDistance = range;
        }
    }
Ejemplo n.º 3
0
    public void SetLayerMask(LayerMask layerMask)
    {
        RFX4_RaycastCollision rfx4_RaycastCollision = GetComponent <RFX4_RaycastCollision>();

        if (rfx4_RaycastCollision != null)
        {
            rfx4_RaycastCollision.CollidesWith = layerMask;
        }
    }