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; } }
public void SetRange(float range) { RFX4_TransformMotion rfx4_TransformMotion = GetComponent <RFX4_TransformMotion>(); if (rfx4_TransformMotion) { rfx4_TransformMotion.Distance = range; } }
public void SetLayerMask(LayerMask layerMask) { RFX4_TransformMotion rfx4_TransformMotion = GetComponent <RFX4_TransformMotion>(); if (rfx4_TransformMotion) { rfx4_TransformMotion.CollidesWith = layerMask; } }
private void Start() { rf = Eff.GetComponentInChildren <RFX4_TransformMotion>(); speed = 30f; //Destroy(this.GetComponent<MeshFilter>()); }