Пример #1
0
        protected void OnDestroy()
        {
            if (CheckStatus())                          // Check if the system is enabled
            {
                if (!CoreBehaviour.RemoveManager(this)) // Catch failrue to remove manager
                {
                    Debug.LogError("Unable to remove manager " + GetType());
                }
            }

            // Continue calls to derived object
            PostDestroy();
        }
        /// <summary>
        /// Deinitialize the manager.
        /// </summary>
        /// <returns> Whether the manager was deinitialized successfully. </returns>
        public bool Deinitialize()
        {
            if (CheckStatus())                         // Check if the system is enabled
            {
                if (CoreBehaviour.RemoveManager(this)) // Ensure the manager was removed
                {
                    return(true);
                }
                else // Catch failrue to remove manager
                {
                    Debug.LogError("Unable to remove manager " + GetType());
                }
            }

            return(false);
        }