Ejemplo n.º 1
0
Archivo: Node.cs Proyecto: Zamir7/urho
 public void RemoveAction(BaseAction action)
 {
     Application.Current.ActionManager.RemoveAction(action, this);
 }
Ejemplo n.º 2
0
		internal void RemoveAction(BaseAction action, Node target)
		{
			if (action == null || target == null)
				return;

			HashElement element;
			if (targets.TryGetValue(target, out element))
			{
				int limit = element.ActionStates.Count;
				bool actionFound = false;

				for (int i = 0; i < limit; i++)
				{
					var actionState = element.ActionStates[i];

					if (actionState.Action == action && actionState.OriginalTarget == target)
					{
						RemoveActionAtIndex(i, element);
						actionFound = true;
						break;
					}
				}
			}
		}
Ejemplo n.º 3
0
 protected ActionState(BaseAction action, Node target)
 {
     this.Action = action;
     this.Target = target;
     this.OriginalTarget = target;
 }
Ejemplo n.º 4
0
		public ActionState AddAction(BaseAction action, Node target, bool paused = false)
		{
			Debug.Assert(action != null);
			Debug.Assert(target != null);

			HashElement element;
			if (!targets.TryGetValue(target, out element))
			{
				element = new HashElement();
				element.Paused = paused;
				element.Target = target;
				targets.Add(target, element);
				targetsAvailable = true;
			}

			ActionAllocWithHashElement(element);
			var isActionRunning = false;
			foreach (var existingState in element.ActionStates)
			{
				if (existingState.Action == action)
				{
					isActionRunning = true;
					break;
				}
			}
			Debug.Assert(!isActionRunning, "Action is already running for this target.");
			var state = action.StartAction(target);
			element.ActionStates.Add(state);

			return state;
		}