Ejemplo n.º 1
0
 private void OnLoadComplete(GltfAssetBase gltfAsset, bool success)
 {
     if (success)
     {
         Renderer[] renderers = gltfAsset.gameObject.GetComponentsInChildren <Renderer>();
         foreach (Renderer renderer in renderers)
         {
             ReplaceMaterialToMrtk(renderer);
         }
         Debug.Log("Gltf model was loaded");
         isLoaded = true;
         OnModelLoaded?.Invoke();
     }
 }
Ejemplo n.º 2
0
    void GLTFast_onLoadComplete(GltfAssetBase asset)
    {
#if UNITY_DOTS_HYBRID
        // TODO: calculate the bounding box
        trackBallCtrl.SetTarget(new Bounds(asset.transform.position, Vector3.one));
#else
        sceneInstance = (asset as GltfAsset).sceneInstance;
        var bounds = CalculateLocalBounds(asset.transform);

        if (trackBallCtrl != null)
        {
            trackBallCtrl.SetTarget(bounds);
        }
#endif
    }