Destroy Instanced Materials

Why is this important?

I have added a method within the ExaminableItem script which uses OnDestroy()

  • This destroys the instanced object material, if one was created when using the emission highlight. This means it will save any memory leakage in future.

        private void OnDestroy()
        {
            Destroy(objectMaterial);
        }

Last updated