Exemple #1
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);
        }
        // PUBLIC

        // PUBLIC STATIC

        // PRIVATE

        // PRIVATE STATIC


        // PRIVATE COROUTINE

        // PRIVATE INVOKE

        //--------------------------------------
        //  Events
        //--------------------------------------

        override public void onReset(BaseManager aBaseManager)
        {
            //JUST RE-GET THIS OFTEN
            _gameManager = UMOM.Instance.getManager <GameManager>();

            //
            if (_gameManager != null)
            {
                if (!_gameManager.hasEventListener(GameManager.SCORE_CHANGED, _onScoreChanged))
                {
                    _gameManager.addEventListener(GameManager.SCORE_CHANGED, _onScoreChanged);
                }
                else
                {
                    _gameManager.removeEventListener(GameManager.SCORE_CHANGED, _onScoreChanged);
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// Gets the manager.
        /// </summary>
        /// <returns>
        /// The manager.
        /// </returns>
        /// <typeparam name='T'>
        /// The 1st type parameter.
        /// </typeparam>
        public bool removeManager <T> () where T : BaseManager
        {
            BaseManager existing_imanager = getManager <T>();
            bool        wasSuccessful_boolean;

            if (existing_imanager == null)
            {
                wasSuccessful_boolean = false;                 //failed
            }
            else
            {
                existing_imanager.onRemoveManager();
                wasSuccessful_boolean = managers.Remove((BaseManager)existing_imanager);
                wasSuccessful_boolean = true;
            }

            //
            //Debug.Log ("2remove???? " + wasSuccessful_boolean);
            return(wasSuccessful_boolean);
        }
Exemple #4
0
 override public void onReset(BaseManager aBaseManager)
 {
     //Debug.Log ("	onReset(): " + this);
 }
Exemple #5
0
 /// <summary>
 /// Ons the reset.
 /// </summary>
 /// <param name='iManager'>
 /// I manager.
 /// </param>
 virtual public void onReset(BaseManager baseManager)
 {
 }