rabidus-test/Assets/Scripts/ObjectMove.cs

26 lines
715 B
C#
Raw Permalink Normal View History

2023-07-24 16:38:13 +03:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectMove : MonoBehaviour
{
[SerializeField]
private Space _space;
[SerializeField]
private Vector3 _offset;
[SerializeField]
private float _time;
[SerializeField]
private int _repeatCount = 1;
2023-09-18 20:09:22 +03:00
[SerializeField]
private LeanTweenType _ease;
2023-07-24 16:38:13 +03:00
private void Start()
{
if (_space == Space.Self)
2023-09-18 20:09:22 +03:00
LeanTween.moveLocal(gameObject, transform.localPosition + _offset, _time).setLoopPingPong(_repeatCount).setEase(_ease);
2023-07-24 16:38:13 +03:00
else
2023-09-18 20:09:22 +03:00
LeanTween.move(gameObject, transform.position + _offset, _time).setLoopPingPong(_repeatCount).setEase(_ease);
2023-07-24 16:38:13 +03:00
}
}