UIBG.cs 916 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5. using UnityEngine.UI;
  6. public class UIBG : MonoBehaviour
  7. {
  8. // Start is called before the first frame update
  9. void Awake()
  10. {
  11. }
  12. // Update is called once per frame
  13. void Update()
  14. {
  15. float bl = (float)Screen.width / 1920f;
  16. float bl2 = (float)Screen.height / 1080f;
  17. if (GetTexture2D.urlbase.Contains("329"))
  18. {
  19. bl = (float)Screen.width / 5760f;
  20. bl2 = (float)Screen.width / 1620f;
  21. }
  22. if(bl>bl2)
  23. {
  24. this.transform.localScale = new Vector3(bl2,bl2,bl2);
  25. }else
  26. {
  27. this.transform.localScale = new Vector3(bl, bl, bl);
  28. }
  29. }
  30. public void gotomain()
  31. {
  32. GetTexture2D.urlbase = "169blue";
  33. SceneManager.LoadScene(0);
  34. }
  35. }