1234567891011121314151617181920212223242526272829303132333435 |
- using System.Collections;
- using System.Collections.Generic;
- using TriLibCore;
- using UnityEngine;
- public class ShowModelManager : MonoBehaviour
- {
- public GameObject root;
- public void Onupdate(string url)
- {
- if(root!=null)
- {
- Destroy(root);
- }
- TriLibModelLoad.Load(url, (AssetLoaderContext ac) => {
- ac.RootGameObject.SetActive(false);
-
- }, (AssetLoaderContext ac) => {
-
- root = ac.RootGameObject;
- ac.RootGameObject.transform.parent = this.transform;
- ac.RootGameObject.transform.localPosition = Vector3.zero;
- ac.RootGameObject.transform.localEulerAngles = Vector3.zero;
- ac.RootGameObject.transform.localScale = Vector3.one;
- ac.RootGameObject.SetActive(true);
- }, (AssetLoaderContext ac, float f) => {
-
- }, (IContextualizedError error) => {
-
- });
- }
- }
|