rabidus-test/Assets/Scripts/ObjectMove.cs

24 lines
631 B
C#
Raw 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;
private void Start()
{
if (_space == Space.Self)
LeanTween.moveLocal(gameObject, transform.localPosition + _offset, _time).setLoopPingPong(_repeatCount);
else
LeanTween.move(gameObject, transform.position + _offset, _time).setLoopPingPong(_repeatCount);
}
}