Exemplo n.º 1
0
        /// <summary>
        /// ReAdd all managers.
        /// </summary>
        private void _reAddAllManagersFromInspector()
        {
            //COPY FROM MASTER LIST (FROM INSPECTOR)
            List <BaseManager> copyOfManagersList = new List <BaseManager>(managers);

            //CLEAR MASTER LIST
            managers.RemoveAll((abstractManager) => true);               //remove 'all'

            //ADD FROM COPY TO MASTER LIST
            //	NOTE: THIS PROPERLY CALLS THE ADD EVENTS WITHOUT THE DELETE EVENTS


            BaseManager aBaseManager;

            for (int index_int = copyOfManagersList.Count - 1; index_int >= 0; index_int--)
            {
                //
                aBaseManager = copyOfManagersList[index_int];
                //
                //WHY WOULD IT BE NULL? I THINK THERE IS A BLANK ADDED IN THE EDITORWINDOW, AND UNTIL WE DRAG SOMETHING THERE ITS BLANK (BLANKISH)
                if (aBaseManager != null)
                {
                    System.Type type = aBaseManager.GetType();
                    GenericsUtility.invokeGenericMethodByType(UMOM.Instance, "_addManagerByForce", type);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Removes all managers.
        /// </summary>
        /// <returns>
        /// The all managers.
        /// </returns>
        public bool removeAllManagers()
        {
            bool wasSuccessful_boolean = true;

            System.Type toBeDestroyed_type;

            for (int count_int = managers.Count - 1; count_int >= 0; count_int--)
            {
                BaseManager aBaseManager = managers[count_int];
                if (aBaseManager != null)
                {
                    toBeDestroyed_type = aBaseManager.GetType();
                    GenericsUtility.invokeGenericMethodByType(UMOM.Instance, "removeManager", toBeDestroyed_type);
                }
            }

            return(wasSuccessful_boolean);
        }