示例#1
0
        /// <summary>
        /// Function called when the volume is being disabled
        /// </summary>
        private void AuraVolume_OnUninitialize(AuraVolume auraVolume)
        {
            if (RegisteredVolumesList.Contains(auraVolume))
            {
                if (RegisteredLightProbesProxyVolumesList.Contains(auraVolume))
                {
                    RegisteredLightProbesProxyVolumesList.Remove(auraVolume);
                }

                if (OnUnregisterVolume != null)
                {
                    OnUnregisterVolume(auraVolume);
                }

                if (Texture2DMasksAtlasComposer.RemoveTexture(auraVolume.texture2DMask.texture))
                {
                    SetTexture2DMasksId();
                    Texture2DMasksAtlasComposer.Generate();
                }

                if (Texture3DMasksAtlasComposer.RemoveTexture(auraVolume.texture3DMask.texture))
                {
                    SetTexture3DMasksId();
                    Texture3DMasksAtlasComposer.Generate();
                }

                RegisteredVolumesList.Remove(auraVolume);
            }

            auraVolume.OnUninitialize -= AuraVolume_OnUninitialize;
        }