Beispiel #1
0
    public bool detectShoot() //returns true when shoot gesture is detected
    {
        switch (_curShootState)
        {
        case shootState.NORM:
            if (_handRightRel.z > _shootDetZ && _handLeftRel.z > _shootDetZ)
            //if ((handRightRel.z > shootDetZ && handLeftRel.z < shootDetZ) || (handRightRel.z < shootDetZ && handLeftRel.z > shootDetZ))
            {
                _curShootState = shootState.SHOOT;
                _curHandState  = handState.MID;
                _maxRotY       = 0;
                //Debug.Log("PEEEEEEEEEEEEEEEEEEEEEEEEEEWWWWWWWWWWW");
                return(true);
            }
            break;

        case shootState.SHOOT:
            if (_handRightRel.z < _shootBackDetZ && _handLeftRel.z < _shootBackDetZ)
            {
                _curShootState = shootState.NORM;
            }
            break;

        default: Debug.LogWarning("detectShoot no STATE"); break;
        }
        return(false);
    }
Beispiel #2
0
 public void reset()
 {
     _maxRotY       = 0;
     _curShootState = shootState.NORM;
     _curHandState  = handState.MID;
 }