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

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

            _stage.touchController.RemoveListener(this);
            _stage = null;
        }
Esempio n. 5
0
        void OnTargetAddedToStage(DisplayObject obj)
        {
            ClearState();

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

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