using System.Collections; using System.Collections.Generic; using UnityEngine; using DG.Tweening; public class ViewWnd : MonoBehaviour { private bool isOpen = true; private RectTransform rect; public Transform jiantou; private void Start() { rect = this.GetComponent(); Debug.Log(transform.localPosition.x); } public void ChangeState() { if (isOpen) { rect.DOLocalMoveX(1235, 1f); jiantou.localScale = new Vector3(-1, 1, 1); isOpen = false; } else { isOpen = true; jiantou.localScale = new Vector3(1, 1, 1); rect.DOLocalMoveX(652, 1f); } } }