Exemple #1
0
    void CreateCameraDropDown(TestLoader loader)
    {
        if (cameraObject != null)
        {
            cameraObject.SetActive(true);
        }

#if UNITY_DOTS_HYBRID
        // TODO: query cameras and feed into list
#else
        sceneInstance = loader.sceneInstance;
        if (sceneInstance?.cameras != null && sceneInstance.cameras.Count > 0)
        {
            var names = new string[sceneInstance.cameras.Count];
            for (var index = 0; index < sceneInstance.cameras.Count; index++)
            {
                names[index] = sceneInstance.cameras[index].name;
            }

            cameraDropDown = new DropDown(names, true, "Camera");
            cameraDropDown.SetIndex(-1);
        }
        else
#endif
        {
            cameraDropDown = null;
        }
    }
Exemple #2
0
    public void InstantiateScene(int sceneIndex)
    {
#if GLTFAST_4_OR_NEWER
        var success = gltf1.InstantiateScene(sceneIndex);
#if !UNITY_DOTS_HYBRID
        sceneInstance = gltf1.sceneInstance;
#endif
#endif
    }
Exemple #3
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
    }