2024-12-05 14:29:27 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using DG.Tweening;
|
|
|
|
|
|
|
|
|
|
public class MoveBg : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public static MoveBg instance;
|
|
|
|
|
public RectTransform rectTransform;
|
2024-12-05 15:48:55 +08:00
|
|
|
|
|
2024-12-05 14:29:27 +08:00
|
|
|
|
private float moveX = 1372;
|
2024-12-05 15:48:55 +08:00
|
|
|
|
public bool isMove;
|
2024-12-05 14:29:27 +08:00
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
2024-12-05 15:48:55 +08:00
|
|
|
|
//StartMove();
|
|
|
|
|
|
2024-12-05 14:29:27 +08:00
|
|
|
|
instance = this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void StartMove()//<2F><>ʼ<EFBFBD>ƶ<EFBFBD>
|
|
|
|
|
{
|
2024-12-05 15:48:55 +08:00
|
|
|
|
rectTransform.DOAnchorPosX(-moveX*2,5).SetEase(Ease.Linear);
|
|
|
|
|
isMove = true;
|
2024-12-05 14:29:27 +08:00
|
|
|
|
}
|
|
|
|
|
public void ReturnPos()//<2F><>λ
|
|
|
|
|
{
|
2024-12-05 15:48:55 +08:00
|
|
|
|
if (isMove)
|
|
|
|
|
{
|
|
|
|
|
rectTransform.DOAnchorPosX(0, 2).SetEase(Ease.Linear);
|
|
|
|
|
isMove = false;
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-05 14:29:27 +08:00
|
|
|
|
}
|
|
|
|
|
}
|