Log in or register to post comments

change 3D model at runtime

September 6, 2019 - 2:50am #1

Hello everyone.

I'm developing an app in where I need to change the 3D model association at runtime.

Now I do the association with database with the children object, but I need to change that association at runtime.

I suppose the association are made in the following code:

protected virtual void OnTrackingFound()

    {

        if (mTrackableBehaviour)

        {

            var rendererComponents = mTrackableBehaviour.GetComponentsInChildren<Renderer>(true);

            var colliderComponents = mTrackableBehaviour.GetComponentsInChildren<Collider>(true);

            var canvasComponents = mTrackableBehaviour.GetComponentsInChildren<Canvas>(true);

            // Enable rendering:

            foreach (var component in rendererComponents)

                component.enabled = true;

            // Enable colliders:

            foreach (var component in colliderComponents)

                component.enabled = true;

            // Enable canvas':

            foreach (var component in canvasComponents)

                component.enabled = true;

        }

    }

Can anyone help me, please?

Cheers.

Log in or register to post comments