UserSceneUI.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using XRTool.Util;
  5. public class UserSceneUI : UserBaseUI<UserSceneUI>
  6. {
  7. public GameObject obj;
  8. public override void show()
  9. {
  10. base.show();
  11. Debug.Log("UI Show===>" + UserSceneManager.Instance.GetScenes().Count);
  12. if(!obj)
  13. LoadResources();
  14. }
  15. public void LoadResources()
  16. {
  17. //加载预制体
  18. Debug.Log("UI LoadResources===>");
  19. // GameScene.Instance.gotoScenes("147");
  20. UnityEngine.Object @object = ResMgr.Instance.Load("SceneChoose2");
  21. GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(@object as GameObject);
  22. obj = gameObject;//GameObject.Instantiate(Resources.Load<GameObject>("SceneChoose2"));
  23. obj.transform.parent = GameScene.Instance.Canvas.transform;
  24. obj.transform.localPosition = Vector3.zero;
  25. obj.transform.localEulerAngles = Vector3.zero;
  26. obj.transform.localScale = Vector3.one;
  27. }
  28. private void OnDestroy()
  29. {
  30. }
  31. }