rabidus-test/Assets/LeanSize.cs

33 lines
658 B
C#
Raw Normal View History

2023-09-18 20:09:22 +03:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LeanSize : MonoBehaviour
{
[SerializeField]
private float _size;
[SerializeField]
private float _time;
[SerializeField]
private LeanTweenType _ease;
[SerializeField]
private bool _onStart;
private void Start()
{
if (_onStart)
LeanAction();
}
public void SetSize(float size)
{
transform.localScale = Vector3.one * size;
}
[ContextMenu("Debug action")]
public void LeanAction()
{
LeanTween.scale(gameObject, Vector3.one * _size, _time).setEase(_ease);
}
}