LoadGlb.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using TriLibCore;
  4. using UnityEngine;
  5. public class LoadGlb : MonoBehaviour
  6. {
  7. public string glbstr;
  8. // Start is called before the first frame update
  9. void Start()
  10. {
  11. #if UNITY_EDITOR
  12. TaskManager.loadFile(Application.streamingAssetsPath + "/ui/"+ glbstr, (AssetLoaderContext ac) => {
  13. Debug.Log("模型加载完成");
  14. ac.RootGameObject.transform.localEulerAngles = new Vector3(0, 0, 0);
  15. ac.RootGameObject.transform.localScale = new Vector3(2, 2, 2);
  16. }, (AssetLoaderContext ac) => {
  17. Debug.Log("载材质加完成");
  18. }, (AssetLoaderContext ac, float f) => {
  19. if (ac.RootGameObject)
  20. {
  21. Debug.Log("加载中=111111111111111111=》" + f);
  22. }
  23. Debug.Log("开始加载 ParseModel_Coroutine" + f);
  24. }, (IContextualizedError error) => {
  25. }, (this.gameObject as GameObject));
  26. #else
  27. TaskManager.loadUrl(Application.streamingAssetsPath + "/ui/"+ glbstr, (AssetLoaderContext ac) => {
  28. ac.RootGameObject.transform.localEulerAngles = new Vector3(0, 0, 0);
  29. ac.RootGameObject.transform.localScale = new Vector3(2, 2, 2);
  30. Debug.Log("模型加载完成");
  31. }, (AssetLoaderContext ac) => {
  32. Debug.Log("载材质加完成");
  33. }, (AssetLoaderContext ac, float f) => {
  34. if (ac.RootGameObject)
  35. {
  36. Debug.Log("加载中=111111111111111111=》" + f);
  37. }
  38. Debug.Log("开始加载 ParseModel_Coroutine" + f);
  39. }, (IContextualizedError error) => {
  40. }, (this.gameObject as GameObject));
  41. #endif
  42. }
  43. // Update is called once per frame
  44. void Update()
  45. {
  46. }
  47. }