protected override void OnDrag() { if (_dragTarget != null) { if (_dragTarget.Contains(_transform)) { _transform.localPosition = new Vector3(_dragTarget.transform.localPosition.x, _dragTarget.transform.localPosition.y, _transform.localPosition.z); //swap locations _sisterCereal.MoveToTransform(_sisterCereal.DragTarget.transform); _sisterCereal.ChangeInputState(false); _soundService.PlaySoundEffect(SoundService.SoundEffects.Good2); ChangeInputState(false); _promiseTimerService.WaitFor(1f).Then(() => _sceneManagerService.UnloadSceneAndLoadNext(ScenesEnum.CerealLevel1)); } else { _transform.localPosition = _dragStartPos; } } }
protected override void OnDrag() { if (_dragTarget != null) { if (_dragTarget.Contains(_transform, false)) { _soundService.PlaySoundEffect(SoundService.SoundEffects.StartButton); _transform.position = new Vector3(_dragTarget.transform.position.x, _dragTarget.transform.position.y, _transform.localPosition.z); _spriteRenderer.sprite = _placedSprite; ChangeInputState(false); _promiseTimerService.WaitFor(1f).Then(() => { _sceneManagerService.UnloadScene(ScenesEnum.GameStart); _sceneManagerService.LoadScene(ScenesEnum.SlippersLevel1); }); } else { _transform.localPosition = _dragStartPos; } } }
protected override void OnDrag() { if (_dragTarget != null) { if (_dragTarget.Contains(_transform)) { // if (_checkContinuously) // _transform.localPosition = new Vector3(_dragTarget.transform.localPosition.x, _dragTarget.transform.localPosition.y, _transform.localPosition.z); //swap locations _sisterCar.SpriteRenderer.enabled = false; _spriteRenderer.enabled = false; _crashObject.SetActive(true); _soundService.PlaySoundEffect(SoundService.SoundEffects.CarCrash); _soundService.StopMusic(); ChangeInputState(false); _sisterCar.ChangeInputState(false); _promiseTimerService.WaitFor(2f).Then(() => _sceneManagerService.UnloadSceneAndLoadNext(ScenesEnum.CarsLevel3)); } } }