private void Awake() { GameSceneManager mGameSceneManager = FindObjectOfType <GameSceneManager>(); RayConfig.LRRayConfig rayConfig = ((RayConfig)Resources.Load(ConstString.Path.RAY_CONFIG)).GetLRRayConfig; LRRay lRRay = new LRRay(transform, rayConfig); RaycastHit lHitInfo; RaycastHit rHitInfo; BoolReactiveProperty lHit = new BoolReactiveProperty(); BoolReactiveProperty rHit = new BoolReactiveProperty(); this.UpdateAsObservable() .Where(_ => mGameSceneManager.SceneState == SceneState.REPLAY) .Subscribe(_ => { lHit.Value = lRRay.LBoxRay(out lHitInfo); rHit.Value = lRRay.RBoxRay(out rHitInfo); }); this.OnCollisionEnterAsObservable() .Where(_ => mGameSceneManager.SceneState == SceneState.REPLAY) .Subscribe(_ => { foreach (ContactPoint point in _.contacts) { Instantiate(mParticle, point.point, Quaternion.identity); } }); }
private void OnDrawGizmos() { if (!mGizmoSwitch) { return; } AccessToResources(); AirRide gizmosAirRide = new AirRide(transform, mRayConfig.GetAirRideRayConfig, mVehicleSettings.GetAirRideSettings); DirectionFixRay dirFixRay = new DirectionFixRay(transform, mRayConfig.GetDirectionFixRayConfig); dirFixRay.DrawGizmos(); gizmosAirRide.DrawGizmos(); LRRay lrRay = new LRRay(transform, mRayConfig.GetLRRayConfig); lrRay.DrawRayGizmos(); DriftScript ds = new DriftScript(mVehicleSettings.GetDriftSettings); ds.OnDrawGimos(transform, GetComponent <Rigidbody>()); }
public WallHitCheck(Transform transform, RayConfig.LRRayConfig rayConfig) { mLRRay = new LRRay(transform, rayConfig); }