123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using DG.Tweening;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using XRTool.Util;
- public class UserManager :Singleton<UserManager>
- {
- public AccountData NowChoose = null;
- public GameObject NowChooseGo = null;
- public void removeUser()
- {
- NowChooseGo.SetActive(false);
- NowChoose = null;
- }
- public void setNowUser(AccountData ad,Transform t,Texture tex)
- {
- NowChoose = ad;
- if (Instance.NowChooseGo==null)
- Instance.NowChooseGo = GameObject.Instantiate(WindowsManager.Instance.GetPrefab(WindowConfig.windowType.Login,"UserIcon")).gameObject;
- Instance.NowChooseGo.GetComponent<RawImage>().texture = tex;
- Instance.NowChooseGo.transform.localScale = Vector3.one;
- Instance.NowChooseGo.transform.localEulerAngles = Vector3.zero;
- Instance.NowChooseGo.transform.position = t.position;
- }
- public void MoveIcon(Vector3 v3,Transform t,Action callback)
- {
- if (Instance!=null&&Instance.NowChooseGo != null)
- {
- Instance.NowChooseGo.transform.SetParent(t);
- Instance.NowChooseGo.transform.localEulerAngles = Vector3.zero;
- Instance.NowChooseGo.transform.localScale = Vector3.one;
- Instance.NowChooseGo.transform.DOLocalMove(v3, 0.5f).OnComplete(() => {
- callback.Invoke();
- });
- Instance.NowChooseGo.transform.GetComponent<RectTransform>().DOSizeDelta(t.GetComponent<RectTransform>().sizeDelta, 0.5f).OnComplete(() => {
- });
- }
- }
- }
|