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; } } }
public override void Resolve() { if (medicines.All(medicine => medicine.Flipped)) { _soundService.PlaySoundEffect(SoundService.SoundEffects.Good3); _promiseTimerService.WaitFor(1f).Then(() => _sceneManagerService.UnloadSceneAndLoadNext(ScenesEnum.BathroomLevel2)); } }
public override void Resolve() { if (!_shoe.Flipped) { _shoe.ChangeInputState(false); _soundService.PlaySoundEffect(SoundService.SoundEffects.Good1); _promiseTimerService.WaitFor(1f).Then(() => _sceneManagerService.UnloadSceneAndLoadNext(ScenesEnum.SlippersLevel2)); } }
protected override void OnRotateTarget(float rotationAngle) { _transform.localRotation = Quaternion.Euler(0, 0, rotationAngle); ChangeInputState(false); if (!_locked) { _locked = true; _soundService.PlaySoundEffect(SoundService.SoundEffects.Bad2); _promiseTimerService.WaitFor(1f).Then(() => _sceneManagerService.UnloadSceneAndLoadNext(ScenesEnum.CerealLevel3)); } }
public override void Resolve() { if (_shoes.All(shoe => shoe.Flipped)) { for (int i = 0; i < _shoes.Length; i++) { _shoes[i].ChangeInputState(_shoes[i]); } _soundService.PlaySoundEffect(SoundService.SoundEffects.Bad1); _promiseTimerService.WaitFor(1f).Then(() => _sceneManagerService.UnloadSceneAndLoadNext(ScenesEnum.SlipperLevel3)); } }
protected override void OnTap() { if (!_locked) { _locked = false; _spriteRenderer.enabled = false; _closedDoor.SetActive(true); _soundService.PlaySoundEffect(SoundService.SoundEffects.ClostDoorClose); _soundService.PlaySoundEffect(SoundService.SoundEffects.Bad3); _promiseTimerService.WaitFor(1f).Then(() => _sceneManagerService.UnloadSceneAndLoadNext(ScenesEnum.BathroomLevel3)); } }
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)); } } }