Example #1
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="eventData"></param>
    public void OnInputUp(InputEventData eventData)
    {
        _EventState = GROUPEVENT.Idle;
        _EventValue = Vector4.zero;

        _IIS = null;
        _IDs.Clear();
        _Fingers.Clear();
    }
Example #2
0
    /// <summary>
    ///
    /// </summary>
    public void SeperatingEvent()
    {
        //Debug.Log("Event Stats :" + _EventState);
        //Excuting Condition
        if (_EventState != GROUPEVENT.Idle)
        {
            return;
        }
        if (_Fingers.Count < 2)
        {
            return;
        }

        foreach (KeyValuePair <uint, Finger> pair in _Fingers)
        {
            uint   key   = pair.Key;
            Finger value = pair.Value;

            //Step1. Checking GroupPush & GroupPull
            {
                Vector3 DeltaPosition = (value.OrinPosition - value.ViewPosition);

                if (
                    Mathf.Abs(DeltaPosition.x) < 0.09f &&
                    Mathf.Abs(DeltaPosition.y) < 0.09f &&
                    Mathf.Abs(DeltaPosition.z) > 0.02f)
                {
                    _EventState = GROUPEVENT.PushAndPull;
                    return;
                }
            }

            //Step2. Checking Drag & Select
            {
                Vector3 DeltaPosition = (value.OrinPosition - value.ViewPosition);
                float   Threshold     = DeltaPosition.x + DeltaPosition.y;

                if (
                    Mathf.Abs(DeltaPosition.x) > 0.09f &&
                    Mathf.Abs(DeltaPosition.y) > 0.09f &&
                    Mathf.Abs(DeltaPosition.z) < 0.02f)
                {
                    _EventState = GROUPEVENT.PartialSelect;
                    return;
                }
            }

            //Step3. ?
            {
            }
        }
    }
Example #3
0
 // Use this for initialization
 void Start()
 {
     _IDs        = new Queue <uint>();
     _Fingers    = new Dictionary <uint, Finger>();
     _EventState = GROUPEVENT.Idle;
 }