private bool IsCameraControlledByScrollAction() { if (_activeTranslateTransformAction == null && _scrollActions.Any()) { _activeTranslateTransformAction = _scrollActions.Dequeue(); _activeTranslateTransformAction.Start(transform.position); } if (_activeTranslateTransformAction == null) { return(false); } transform.position = _activeTranslateTransformAction.GetPosition(); if (_activeTranslateTransformAction.ActionStatus == TranslateTransformActionStatus.Completed) { _activeTranslateTransformAction = _scrollActions.Any() ? _scrollActions.Dequeue() : null; } return(true); }
public static TranslateTransformAction Start( Vector3 startPosition, Vector3 targetPosition, float duration, EasingType easingType, Easing easing) { var translateTransformAction = new TranslateTransformAction( targetPosition, duration, easingType, easing); translateTransformAction.Start(startPosition); return(translateTransformAction); }
public override bool TryActivate(BaseControlHandler previousControlHandler) { PlayerController.PlayerState |= PlayerState.Invincible; PlayerController.PlayerState |= PlayerState.Locked; if (_playerTranslationVector.HasValue) { _translateTransformAction = TranslateTransformAction.Start( PlayerController.transform.position, PlayerController.transform.position + _playerTranslationVector.Value, Duration, _playerTranslationEasingType, GameManager.Instance.Easing); } ResetOverrideEndTime(); return(true); }