21 lines
619 B
C#
21 lines
619 B
C#
using UnityEngine;
|
|
|
|
namespace Animations
|
|
{
|
|
public class UpdateTween : MonoBehaviour
|
|
{
|
|
private bool _isAnimating = true;
|
|
private float _animationTime = 0f;
|
|
|
|
private void Update()
|
|
{
|
|
if (!_isAnimating) return;
|
|
|
|
transform.position = Vector3.Lerp(Vector3.zero, transform.forward * 5.0f, _animationTime);
|
|
transform.localScale = Vector3.Lerp(Vector3.one, Vector3.one * 2.0f, _animationTime);
|
|
_animationTime += Time.deltaTime;
|
|
|
|
if (_animationTime >= 1.0f) _isAnimating = false;
|
|
}
|
|
}
|
|
} |