Пример #1
0
 internal virtual void InternalAddedToStage(FlashStage stage)
 {
     drawOrder = 0;
     CheckUpdateSubscribtion(stage);
     AddedToStage.Dispatch(this);
     stage.events.DispatchObjectAdded(this);
 }
Пример #2
0
 internal override void InternalRemovedFromStage(FlashStage stage)
 {
     base.InternalRemovedFromStage(stage);
     foreach (var child in _children)
     {
         child.stage = null;
     }
 }
Пример #3
0
 internal override void InternalAddedToStage(FlashStage stage)
 {
     base.InternalAddedToStage(stage);
     foreach (var child in _children)
     {
         child.stage = stage;
     }
 }
Пример #4
0
        void OnTargetRemovedFromStage(DisplayObject obj)
        {
            ClearState();

            if (_debugDrawEnabled)
            {
                _stage.drawEvent.RemoveListener(DrawDebugRect);
            }

            _stage.touchController.RemoveListener(this);
            _stage = null;
        }
Пример #5
0
        void OnTargetAddedToStage(DisplayObject obj)
        {
            ClearState();

            _stage = target.stage;
            _stage.touchController.AddListener(this);

            _debugDrawEnabled = Debug.isDebugBuild;
            if (_debugDrawEnabled)
            {
                _stage.drawEvent.AddListener(DrawDebugRect);
            }
        }
Пример #6
0
        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;
            }
        }
Пример #7
0
 public InputController(FlashStage component)
 {
     _component = component;
 }
Пример #8
0
 internal virtual void InternalRemovedFromStage(FlashStage stage)
 {
     CheckUpdateSubscribtion(stage);
     RemovedFromStage.Dispatch(this);
     stage.events.DispatchObjectRemoved(this);
 }