예제 #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);
 }