123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System.Collections;
- using System.Collections.Generic;
- using TriLibCore;
- using UnityEngine;
- public class LoadGlb : MonoBehaviour
- {
- public string glbstr;
- // Start is called before the first frame update
- void Start()
- {
- #if UNITY_EDITOR
- TaskManager.loadFile(Application.streamingAssetsPath + "/ui/"+ glbstr, (AssetLoaderContext ac) => {
- Debug.Log("模型加载完成");
- ac.RootGameObject.transform.localEulerAngles = new Vector3(0, 0, 0);
- ac.RootGameObject.transform.localScale = new Vector3(2, 2, 2);
- }, (AssetLoaderContext ac) => {
- Debug.Log("载材质加完成");
- }, (AssetLoaderContext ac, float f) => {
- if (ac.RootGameObject)
- {
- Debug.Log("加载中=111111111111111111=》" + f);
- }
- Debug.Log("开始加载 ParseModel_Coroutine" + f);
- }, (IContextualizedError error) => {
- }, (this.gameObject as GameObject));
- #else
- TaskManager.loadUrl(Application.streamingAssetsPath + "/ui/"+ glbstr, (AssetLoaderContext ac) => {
- ac.RootGameObject.transform.localEulerAngles = new Vector3(0, 0, 0);
- ac.RootGameObject.transform.localScale = new Vector3(2, 2, 2);
- Debug.Log("模型加载完成");
- }, (AssetLoaderContext ac) => {
- Debug.Log("载材质加完成");
- }, (AssetLoaderContext ac, float f) => {
- if (ac.RootGameObject)
- {
- Debug.Log("加载中=111111111111111111=》" + f);
- }
- Debug.Log("开始加载 ParseModel_Coroutine" + f);
- }, (IContextualizedError error) => {
- }, (this.gameObject as GameObject));
- #endif
- }
- // Update is called once per frame
- void Update()
- {
-
- }
- }
|