protected override void OnLoad(System.Action OnSuccess, System.Action OnFail)
        {
            gltfComponent = asset.container.AddComponent <GLTFComponent>();

            GLTFComponent.Settings tmpSettings = new GLTFComponent.Settings()
            {
                useVisualFeedback = settings.visibleFlags == AssetPromiseSettings_Rendering.VisibleFlags.VISIBLE_WITH_TRANSITION,
                initialVisibility = settings.visibleFlags != AssetPromiseSettings_Rendering.VisibleFlags.INVISIBLE,
                shaderOverride    = settings.shaderOverride,
                addMaterialsToPersistentCaching = (settings.cachingFlags & MaterialCachingHelper.Mode.CACHE_MATERIALS) != 0
            };

            tmpSettings.OnWebRequestStartEvent += ParseGLTFWebRequestedFile;

            gltfComponent.LoadAsset(url, GetId() as string, false, tmpSettings);
            gltfComponent.OnSuccess += OnSuccess;
            gltfComponent.OnFail    += OnFail;

            asset.name = url;
        }
Exemple #2
0
    void RunTest()
    {
        if (count > sampleCount)
        {
            Debug.Log($"Url = {url} ... Min time = {minTime * 1000}... Max time = {maxTime * 1000}");
            return;
        }

        count++;
        GameObject gameObject = new GameObject("Test");

        lastGameObjectCreated = gameObject;
        GLTFComponent gltfComponent = gameObject.AddComponent <GLTFComponent>();

        GLTFComponent.Settings tmpSettings = new GLTFComponent.Settings()
        {
            useVisualFeedback = false,
            initialVisibility = true,
        };

        gltfComponent.OnFinishedLoadingAsset += RunTest;
        gltfComponent.LoadAsset(Utils.GetTestsAssetsPath() + url, false, tmpSettings);
    }