public SpriteColorWatch(SpriteColorComponent colorComponent, TweenFloat tween, Vector3 scale, int stage) { ColorComponent = colorComponent; Tween = tween; Scale = scale; Stage = stage; }
public override void UpdateMovement(Vector3 moveVector, bool isForward, ref Vector3 moveDirection) { if (!_addedVector) { SurfaceDetector.main.PlayJumpingSound(_context); if (moveVector.magnitude < 0.15f) { var screenMovementSpace = Quaternion.Euler(0f, Player.Cam.transform.eulerAngles.y, 0f); var forwardVector = screenMovementSpace * Vector3.forward * -2; var rightVector = screenMovementSpace * Vector3.right * 0; moveDirection = forwardVector + rightVector; } _dodgeVector = moveDirection * Settings.DodgeForce; _dodgeVector.y = Settings.DodgeForce * 0.5f; _dodgeTween = new TweenFloat(0, 1, Settings.DodgeLength, Settings.DodgeEase, true); _dodgeTween.Init(); _addedVector = true; } moveDirection = _dodgeVector * _dodgeTween.Get(); //moveDirection = FallVector(moveDirection); if (!_dodgeTween.Active) { _machine.ChangeState <FpNormalState>(); } }
private IEnumerator TweenAnim(System.Action <TweenFloat> action, TweenFloat tweener) { while (tweener.Active) { action(tweener); yield return(null); } }
public SpriteColorWatch(SpriteColorComponent colorComponent, SpriteRendererComponent renderer, TweenFloat tween, Vector3 scale) { ColorComponent = colorComponent; Tween = tween; Scale = scale; Renderer = renderer; Stage = 0; }
private IEnumerator FadeInItem() { var tweener = new TweenFloat(0, 1, 0.5f, EasingTypes.SinusoidalInOut, true); tweener.Init(); while (tweener.Active) { for (int i = 0; i < _entity.Renderers.Length; i++) { _entity.Renderers[i].material.SetFloat("_DissolveAmount", tweener.Get()); } yield return(null); } }
protected void ProcessSetStatus(bool status) { _lastStatusScene = false; if (_fadeTween == null) { _fadeTween = new TweenFloat(0, 1, _transitionLength, EasingTypes.SinusoidalInOut, true); _fadeTween.Init(); } _canvasgroup.interactable = status; _canvasgroup.blocksRaycasts = status; _fadeTween.Restart(_canvasgroup.alpha, status ? 1 : 0); _fadeTween.Play((f => _canvasgroup.alpha = f), null); Status = status; OnStatusChanged(status); }
private void SetFadeTooltip(bool active) { _tween = new TweenFloat(_canvasGroup.alpha, active ? 1 : 0, _fadeSpeed, active ? _fadeInEase : _fadeOutEase, true); _tween.Init(); }
private static void SetupTween(TweenFloat tween) { tween.EasingConfig = EasingTypes.BounceInOut; tween.UnScaled = false; tween.Length = Duration; }