SmallLoginItem.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using TMPro;
  4. using UnityEngine;
  5. using UnityEngine.Networking;
  6. using UnityEngine.UI;
  7. public class SmallLoginItem : MonoBehaviour
  8. {
  9. bool isChooseBig;
  10. public RawImage iconImg;
  11. public TextMeshProUGUI textName;
  12. public AccountData ad;
  13. public void setData(AccountData ad,bool isChooseBig)
  14. {
  15. this.isChooseBig = isChooseBig;
  16. this.ad = ad;
  17. textName.text = ad.name;
  18. if(ad.avatar=="")
  19. {
  20. ad.avatar = Application.streamingAssetsPath + "/icon/1.png";
  21. }
  22. DownLoadXRManager.DownLoadForTexture(DownLoadXRManager.getTestData(( ad.avatar)), (Texture2D tex) => {
  23. texture = tex;
  24. iconImg.texture = tex;
  25. }, null);
  26. // StartCoroutine(UnityWebRequestGetData(Application.streamingAssetsPath+ad.iconUrl));
  27. }
  28. Texture2D texture;
  29. private void OnDestroy()
  30. {
  31. Destroy(texture);
  32. }
  33. public void ChooseIcon()
  34. {
  35. UserManager.Instance.setNowUser(this.ad, this.transform, iconImg.texture);
  36. LoginDataManager.Instance.setOftenUseAcc(this.ad);
  37. LoginWindowsManager.Instance.gotologinPassWord();
  38. }
  39. }