Exemple #1
0
        public void RemoveTouchListener(OnTouchDelegate onTouchDelegate, SGTouchPhase phase)
        {
            switch (phase)
            {
            case SGTouchPhase.Began:
            {
                if (_onTouchBegan != null)
                {
                    _onTouchBegan -= onTouchDelegate;
                }
            }
            break;

            case SGTouchPhase.Stationary:
            {
                if (_onTouchStationary != null)
                {
                    _onTouchStationary -= onTouchDelegate;
                }
            }
            break;

            case SGTouchPhase.End:
            {
                if (_onTouchEnd != null)
                {
                    _onTouchEnd -= onTouchDelegate;
                }
            }
            break;
            }
        }
Exemple #2
0
 public void Reset()
 {
     _fingerId   = -1;
     Phase       = SGTouchPhase.None;
     Position    = Vector2.zero;
     _instanceId = -1;
 }
Exemple #3
0
        public void AddTouchListener(OnTouchDelegate onTouchDelegate, SGTouchPhase phase)
        {
            switch (phase)
            {
            case SGTouchPhase.Began:
            {
                _onTouchBegan += onTouchDelegate;
            }
            break;

            case SGTouchPhase.Stationary:
            {
                _onTouchStationary += onTouchDelegate;
            }
            break;

            case SGTouchPhase.End:
            {
                _onTouchEnd += onTouchDelegate;
            }
            break;
            }
        }
Exemple #4
0
 public void ConvertSGTouch(TouchPhase phase, Vector2 pos)
 {
     Phase    = ConverTouchPhase(phase);
     Position = pos;
 }
Exemple #5
0
 public void ConvertSGTouch(Touch touch)
 {
     Phase    = ConverTouchPhase(touch.phase);
     Position = touch.position;
 }