123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using DG.Tweening;
- namespace MetaClient
- {
- public class UICustomNor : MonoBehaviour
- {
- //[Header("左边界面")]
- //public GameObject leftView;
- //[Header("右边界面")]
- //public GameObject rightView;
- public UICustom uICustom;
- [Header("出现对象")]
- public List<GameObject> objAppear;
- [Header("消失对象")]
- public List<GameObject> objDisAppear;
- [Header("对象类型")]
- public ECustomStyple eCustomStyple = ECustomStyple.None;
- private float tweenTime = 0.5f;
- // Start is called before the first frame update
- void Start()
- {
- Button btn =gameObject.GetComponent<Button>();
- btn.onClick.AddListener(ClickBotton);
- }
- public void ClickBotton()
- {
- if (uICustom.isTween)
- {
- return;
- }
- uICustom.isTween = true;
- uICustom.leftView.transform.DOLocalMoveX(uICustom.tween_leftMin, tweenTime).SetEase(Ease.InOutBack).OnComplete(() => {
- // ClickBtnFun(_objects);
- objDisAppear.ForEach(i => i.SetActive(false));
- objAppear.ForEach(i => i.SetActive(true));
- uICustom.leftView.transform.DOLocalMoveX(0, tweenTime).SetEase(Ease.InOutBack).OnComplete(() => {
- uICustom.isTween = false;
- uICustom.HistoryAdd(eCustomStyple+"");
- uICustom.ChangeECustomStyple(eCustomStyple);
- Debug.Log("222");
- });
- });
- Debug.Log("333");
- uICustom.rightView.transform.DOLocalMoveX(uICustom.tween_rightMax, tweenTime).SetEase(Ease.InOutBack).OnComplete(() => {
- uICustom.rightView.transform.DOLocalMoveX(0, tweenTime).SetEase(Ease.InOutBack).OnComplete(() => {
- });
- });
- }
- void CustomBtnFun() {
- }
- // Update is called once per frame
- void Update()
- {
- }
- }
- }
|