Ejemplo n.º 1
0
        /// <summary>
        /// Recalculates the inspector target
        /// </summary>
        private void RecalculateInspectorTarget()
        {
            //Debug.Log("RecalculateInspectorTarget");
            _oldInspectorTarget = InspectorTarget;

            if (_isMouseLeave)
            {
                //Debug.Log("   -> InspectorTarget: mouse leave");
                InspectorMouseOutSignal.Emit(InspectorTarget);
                InspectorMouseLeaveSignal.Emit();
                InspectorTarget = null;
                return;
            }

            InspectorTarget = CoordinateProcessor.GetComponentUnderCoordinatesOnAllStages(
                _mouseEvent.GlobalPosition,
                InspectorTargetFilter,
                !SystemManager.Instance.ShiftKeyPressed, // don't stopOnDisabled
                !SystemManager.Instance.AltKeyPressed    // don't stopOnInvisible
                ) as Component;

            // emit signals
            if (_oldInspectorTarget != InspectorTarget)
            {
                //Debug.Log("   -> InspectorTarget: " + InspectorTarget);
                //Debug.Log(3);
                InspectorMouseOutSignal.Emit(_oldInspectorTarget);
                InspectorMouseOverSignal.Emit(InspectorTarget);
            }
        }
Ejemplo n.º 2
0
// ReSharper disable MemberCanBePrivate.Global
        /// <summary>
        /// Finds the component under the mouse poiner
        /// </summary>
        public void RecalculateMouseTarget()
// ReSharper restore MemberCanBePrivate.Global
        {
            if (_isMouseLeave)
            {
                MouseTarget = null;
                return;
            }

            MouseTarget = CoordinateProcessor.GetComponentUnderCoordinatesOnAllStages(
                _mouseEvent.GlobalPosition,
                MouseTargetFilter,
                true, // stopOnDisabled
                true  // stopOnInvisible
                ) as Component;
            //Debug.Log("MouseTarget: " + ComponentUtil.PathToString(MouseTarget, "->"));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Finds the Component stack under the mouse poiner
        /// </summary>
// ReSharper disable MemberCanBePrivate.Global
        public void RecalculateMouseWheelTargets()
// ReSharper restore MemberCanBePrivate.Global
        {
            //Debug.Log("RecalculateMouseWheelTargets: " + deltaY);
            if (_isMouseLeave)
            {
                _mouseWheelTargets.Clear();
                return;
            }

            var members = CoordinateProcessor.GetComponentStackUnderCoordinatesOnAllStages(
                _mouseEvent.GlobalPosition,
                MouseWheelFilter,
                true, true // stopOnDisabled, stopOnInvisible
                );

            _mouseWheelTargets = new List <Component>();

            foreach (DisplayListMember member in members)
            {
                _mouseWheelTargets.Add((Component)member);
            }

            // Important: reverse targets
            //_mouseWheelTargets.Reverse();

//            Debug.Log(string.Format(@"Mouse wheel targets ({0}):
//{1}", _mouseWheelTargets.Count, ComponentUtil.DescribeComponentList(_mouseWheelTargets)));

#if DEBUG
            if (DebugMode)
            {
                Debug.Log(string.Format(@"Mouse wheel targets ({0}): 
{1}", _mouseWheelTargets.Count, ComponentUtil.DescribeComponentList(_mouseWheelTargets)));
            }
#endif
        }