internal virtual void InternalAddedToStage(FlashStage stage) { drawOrder = 0; CheckUpdateSubscribtion(stage); AddedToStage.Dispatch(this); stage.events.DispatchObjectAdded(this); }
internal override void InternalRemovedFromStage(FlashStage stage) { base.InternalRemovedFromStage(stage); foreach (var child in _children) { child.stage = null; } }
internal override void InternalAddedToStage(FlashStage stage) { base.InternalAddedToStage(stage); foreach (var child in _children) { child.stage = stage; } }
void OnTargetRemovedFromStage(DisplayObject obj) { ClearState(); if (_debugDrawEnabled) { _stage.drawEvent.RemoveListener(DrawDebugRect); } _stage.touchController.RemoveListener(this); _stage = null; }
void OnTargetAddedToStage(DisplayObject obj) { ClearState(); _stage = target.stage; _stage.touchController.AddListener(this); _debugDrawEnabled = Debug.isDebugBuild; if (_debugDrawEnabled) { _stage.drawEvent.AddListener(DrawDebugRect); } }
private void CheckUpdateSubscribtion(FlashStage stage) { var enterFrameExists = _enterFrameEvent != null && _enterFrameEvent.hasListeners; var animationExists = animation != null; var needUpdate = isOnStage && (enterFrameExists || animationExists); if (needUpdate && !_updateSubscribed) { stage.updateEvent.AddListener(_updateHandler); _updateSubscribed = true; } else if (!needUpdate && _updateSubscribed) { stage.updateEvent.RemoveListener(_updateHandler); _updateSubscribed = false; } }
public InputController(FlashStage component) { _component = component; }
internal virtual void InternalRemovedFromStage(FlashStage stage) { CheckUpdateSubscribtion(stage); RemovedFromStage.Dispatch(this); stage.events.DispatchObjectRemoved(this); }