BBGamelib.CCScheduler.unscheduleBlockForKey C# (CSharp) Method

unscheduleBlockForKey() public method

public unscheduleBlockForKey ( string key, System target ) : void
key string
target System
return void
		public void unscheduleBlockForKey(string key, System.Object target)
		{
			// explicity handle nil arguments when removing an object
			if( target==null && key==null)
				return;
			
			NSUtils.Assert( target != null, "Target MUST not be nil");
			NSUtils.Assert( key != null, "key MUST not be NULL");
			
			tHashTimerEntry element = hashForTimers.HASH_FIND_INT (target.GetHashCode());
			if (element != null) {
				
				for(int i=0; i< element.timers.Count; i++ ) {
					CCTimer timer = element.timers[i];
					
					
					if( timer is CCTimerBlock &&  key == ((CCTimerBlock)timer).key ) {
						
						if( timer == element.currentTimer && !element.currentTimerSalvaged ) {
							element.currentTimerSalvaged = true;
						}
						
						element.timers.RemoveAt(i);
						
						// update timerIndex in case we are in tick:, looping over the actions
						if( element.timerIndex >= i )
							element.timerIndex--;
						
						if(element.timers.Count == 0){
							if( currentTarget == element )
								currentTargetSalvaged = true;
							else
								removeHashElement(element);
						}
						return;
					}
				}
			}
			// Not Found
			//	NSLog(@"CCScheduler#unscheduleSelector:forTarget: selector not found: %@", selString);
		}
		#endregion