psmove_init() private method

private psmove_init ( PSMove_Version version ) : PSMove_Bool
version PSMove_Version
return PSMove_Bool
示例#1
0
        public void ThreadSetup()
        {
            // Maintains the following psmove state on the stack
            // * psmove tracking state
            // * psmove fusion state
            // * psmove controller state
            // Tracking state is only initialized when we have a non-zero number of tracking contexts
            Context = new WorkerContext(WorkerControllerDataArray, WorkerSettings);

            if (PSMoveAPI.psmove_init(PSMoveAPI.PSMove_Version.PSMOVE_CURRENT_VERSION) == PSMove_Bool.PSMove_False)
            {
                throw new Exception("PS Move API init failed (wrong version?)");
            }
        }
示例#2
0
    private void Start()
    {
        PSMove_Bool init = PSMoveAPI.psmove_init(PSMoveAPI.PSMove_Version.PSMOVE_CURRENT_VERSION);

        if (init == PSMove_Bool.PSMove_True)
        {
            handle = PSMoveAPI.psmove_connect();

            if (handle == System.IntPtr.Zero || PSMoveAPI.psmove_update_leds(handle) == 0)
            {
                Debug.LogError("Could not connect to default PSMove controller");
            }
            else
            {
                Debug.Log("Connection established to default PSMove controller");
                initDone = true;
                SetLED(Color.magenta);
            }
        }
        else
        {
            Debug.LogError("Could not init PSMove API");
        }
    }