Example #1
0
    public void SetCollisionCallback(Func <CollisionHitCallbackStruct, bool> CallBack)
    {
        RFX4_TransformMotion rfx4_TransformMotion = GetComponent <RFX4_TransformMotion>();

        if (rfx4_TransformMotion)
        {
            if (nowCallBack != null)
            {
                try
                {
                    rfx4_TransformMotion.CollisionEnter -= nowCallBack;
                    nowCallBack = null;
                }
                catch { }
            }
            nowCallBack = (sender, e) =>
            {
                if (CallBack != null && e != null)
                {
                    CallBack(new CollisionHitCallbackStruct()
                    {
                        hitPoint = e.Hit.point, targetObj = e.Hit.transform.gameObject
                    });
                }
            };
            rfx4_TransformMotion.CollisionEnter += nowCallBack;
        }
    }
Example #2
0
    public void SetRange(float range)
    {
        RFX4_TransformMotion rfx4_TransformMotion = GetComponent <RFX4_TransformMotion>();

        if (rfx4_TransformMotion)
        {
            rfx4_TransformMotion.Distance = range;
        }
    }
Example #3
0
    public void SetLayerMask(LayerMask layerMask)
    {
        RFX4_TransformMotion rfx4_TransformMotion = GetComponent <RFX4_TransformMotion>();

        if (rfx4_TransformMotion)
        {
            rfx4_TransformMotion.CollidesWith = layerMask;
        }
    }
Example #4
0
 private void Start()
 {
     rf    = Eff.GetComponentInChildren <RFX4_TransformMotion>();
     speed = 30f;
     //Destroy(this.GetComponent<MeshFilter>());
 }