FairyGUI.GObject.GlobalToLocal C# (CSharp) Method

GlobalToLocal() public method

public GlobalToLocal ( Rect rect ) : Rect
rect UnityEngine.Rect
return UnityEngine.Rect
        public Rect GlobalToLocal(Rect rect)
        {
            Rect ret = new Rect();
            Vector2 v = this.GlobalToLocal(new Vector2(rect.xMin, rect.yMin));
            ret.xMin = v.x;
            ret.yMin = v.y;
            v = this.GlobalToLocal(new Vector2(rect.xMax, rect.yMax));
            ret.xMax = v.x;
            ret.yMax = v.y;
            return ret;
        }

Same methods

GObject::GlobalToLocal ( Vector2 pt ) : Vector2

Usage Example

示例#1
0
        void __touchBegin(EventContext context)
        {
            if (Stage.inst.touchCount > 1)
            {
                Stage.inst.onTouchMove.Remove(__touchMove);
                Stage.inst.onTouchEnd.Remove(__touchEnd);
                if (_started)
                {
                    _started = false;
                    onEnd.Call(context.inputEvent);
                }
                return;
            }

            InputEvent evt = context.inputEvent;

            _startPoint = _host.GlobalToLocal(new Vector2(evt.x, evt.y));
            _lastPoint  = _startPoint;
            _throwPoint = _startPoint;

            _time2   = _time = Time.time;
            _started = false;
            velocity = Vector2.zero;
            position = Vector2.zero;

            Stage.inst.onTouchMove.Add(__touchMove);
            Stage.inst.onTouchEnd.Add(__touchEnd);
        }
All Usage Examples Of FairyGUI.GObject::GlobalToLocal