Exemplo n.º 1
0
    private void DoWaitingForMovePress()
    {
        statusText.text = "Take a Move controller into your right hand.\nWave the controller around until\nthe pitch angle seems to converge.\nPress X to start calibrating.\n";
        if (kinectSelection.GetNumberOfSelectedPlayers() < 1)
        {
            currentState = State.WaitingForSkeleton;
        }

        for (int i = 0; i < 4; i++)
        {
            if (psMoveWrapper.sphereVisible[i] && psMoveWrapper.isButtonCross[i])
            {
                currentState                  = State.Calibrating;
                numberOfSamplesTaken          = 0;
                calibratingPSMoveControllerId = i;

                foreach (GameObject sphere in calibrationSpheres)
                {
                    Destroy(sphere);
                }

                calibrationSpheres = new List <GameObject>();

                rawPSMoveSamples = new List <Vector3>();
                psMoveSamples    = new List <Vector3>();
                kinectSamples    = new List <Vector3>();

                coordinateSystem.ResetTransforms();

                UpdateFloorNormal();
            }
            if (psMoveWrapper.sphereVisible[i] && psMoveWrapper.WasPressed(i, PSMoveWrapper.TRIANGLE))
            {
                UpdateFloorNormal();
            }
        }
    }