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); } }