26 lines
715 B
C#
26 lines
715 B
C#
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;
|
|
[SerializeField]
|
|
private LeanTweenType _ease;
|
|
|
|
private void Start()
|
|
{
|
|
if (_space == Space.Self)
|
|
LeanTween.moveLocal(gameObject, transform.localPosition + _offset, _time).setLoopPingPong(_repeatCount).setEase(_ease);
|
|
else
|
|
LeanTween.move(gameObject, transform.position + _offset, _time).setLoopPingPong(_repeatCount).setEase(_ease);
|
|
}
|
|
}
|