public void Init() { isGround = false; _stageObjectDropUseCase = new StageObjectDropUseCase(rigidbody2d); _stageObjectRotateUseCase = new StageObjectRotateUseCase(transform); this.FixedUpdateAsObservable() .Where(_ => isGround == false) .Subscribe(_ => { // _stageObjectDropUseCase.UpdateGravity(color); }) .AddTo(this); this.OnCollisionEnter2DAsObservable() .Subscribe(_ => { var roundPosition = transform.RoundPosition(); transform .DOMove(roundPosition, StageObjectConfig.CORRECT_TIME) .OnComplete(() => { isGround = true; _stageObjectDropUseCase.ResetVelocity(); }); }) .AddTo(this); }
public void Init() { _stageObjectRotateUseCase = new StageObjectRotateUseCase(transform); }