cleanup() 공개 메소드

public cleanup ( ) : void
리턴 void
예제 #1
0
        void detachChild(CCNode child, bool cleanup)
        {
            // IMPORTANT:
            //  -1st do onExit
            //  -2nd cleanup
            if (_isRunning)
            {
                child.onExitTransitionDidStart();
                child.onExit();
            }

            child.parent = null;
            _children.Remove(child);


            // If you don't do cleanup, the child's actions will not get removed and the
            // its scheduledSelectors_ dict will not get released!
            if (cleanup)
            {
                child.cleanup();
            }
            else
            {
                child.gameObject.SetActive(false);
            }
        }
예제 #2
0
        public virtual void cleanup()
        {
            // actions
            stopAllActions();
            unscheduleAllSelectors();

            if (_children != null)
            {
                var enumerator = _children.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    CCNode child = enumerator.Current;
                    child.cleanup();
                }
                _children.Clear();
            }
            this.parent = null;
            recycleGear();
        }
예제 #3
0
 public virtual void removeAllChildrenAndCleanup(bool cleanup = true)
 {
     if (_children != null)
     {
         for (int i = _children.Count - 1; i >= 0; i--)
         {
             CCNode c = _children [i];
             if (_isRunning)
             {
                 c.onExitTransitionDidStart();
                 c.onExit();
             }
             if (cleanup)
             {
                 c.cleanup();
             }
             else
             {
                 c.parent = null;
             }
         }
         _children.Clear();
     }
 }
예제 #4
0
		void detachChild(CCNode child, bool cleanup)
		{
			// IMPORTANT:
			//  -1st do onExit
			//  -2nd cleanup
			if (_isRunning)
			{
				child.onExitTransitionDidStart();
				child.onExit();
			}
			
			child.parent = null;
			_children.Remove(child);
			
			
			// If you don't do cleanup, the child's actions will not get removed and the
			// its scheduledSelectors_ dict will not get released!
			if (cleanup)
				child.cleanup ();
			else
				child.gameObject.SetActive(false);
		}