// TODO this is optimized in Sparrow-s; it maintains an array of things on the Stage
        protected void BroadcastEnterFrameEvent(float passedTime)
        {
            EnterFrame?.Invoke(this, passedTime);
            var displayObjectContainer = this as DisplayObjectContainer;

            if (displayObjectContainer == null)
            {
                return;
            }
            // We need to make a copy here because the Children list might be modified in an EnterFrame event handler
            var copy = new List <DisplayObject>(displayObjectContainer.Children);

            foreach (var child in copy)
            {
                child.BroadcastEnterFrameEvent(passedTime);
            }
        }
Exemple #2
0
        // enter frame event

        private void OnEnterFrame(DisplayObject target, float passedTime)
        {
            EnterFrame?.Invoke(target, passedTime);
        }