public virtual void ReadState(PlayerState outState) { if (!string.IsNullOrEmpty(errorDetails)) { outState.ErrorDetails = errorDetails; Debug.LogError(errorDetails); return; } FinchUpdateError err = FinchUpdateError.NotInitialized; if (FinchSettings.HeadUpdateType == FinchHeadUpdateType.RotationUpdate) { err = FinchCore.Update(FinchVR.MainCamera != null ? FinchVR.MainCamera.rotation.ToFinch() : Camera.main.transform.rotation.ToFinch()); } else if (FinchSettings.HeadUpdateType == FinchHeadUpdateType.RotationAndPositionUpdate) { err = FinchCore.Update(FinchVR.MainCamera.rotation.ToFinch(), FinchVR.MainCamera.position.ToFinch()); } else { err = FinchCore.Update(); } if (err != FinchUpdateError.None) { outState.ErrorDetails = "Error update Dash controller data: " + err; Debug.LogError(outState.ErrorDetails); } for (int i = 0; i < (int)FinchChirality.Last; ++i) { outState.ElementsBeginEvents[i] = FinchCore.GetEvents((FinchChirality)i, FinchEventType.Begin); outState.ElementsState[i] = FinchCore.GetEvents((FinchChirality)i, FinchEventType.Process); outState.ElementsEndEvents[i] = FinchCore.GetEvents((FinchChirality)i, FinchEventType.End); outState.IsTouching[i] = FinchCore.GetEvent((FinchChirality)i, FinchControllerElement.Touchpad, FinchEventType.Process); outState.TouchAxes[i] = FinchCore.GetTouchpadAxes((FinchChirality)i); outState.IndexTrigger[i] = FinchCore.GetIndexTrigger((FinchChirality)i); } for (int i = 0; i < (int)FinchNodeType.Last; ++i) { outState.Gyro[i] = FinchCore.GetBoneLocalAngularVelocity(PlayerState.Bones[(FinchNodeType)i]); outState.Accel[i] = FinchCore.GetBoneLocalAcceleration(PlayerState.Bones[(FinchNodeType)i]); } outState.NodesState = FinchCore.NodesState; if (FinchCore.ControllerType == FinchControllerType.Hand) { UpdateLongPressDetection(FinchControllerElement.Touchpad, true, outState); UpdateCalibrationDelay(outState); } else { UpdateLongPressDetection(FinchControllerElement.ButtonZero, false, outState); } }