Exemple #1
0
        //--------------------//

        #region Dispose
        /// <inheritdoc/>
        protected override void OnDispose()
        {
            try
            {
                if (_ownMesh)
                {
                    Mesh?.Dispose();
                }

                if (_asset != null)
                {
                    _asset.ReleaseReference();
                    _asset = null;
                }

                if (_separateMaterials)
                {
                    foreach (var material in Materials)
                    {
                        material.ReleaseReference();
                    }
                }
            }
            finally
            {
                base.OnDispose();
            }
        }