void Start() { #if PLATFORM_LUMIN MLResult result = MLHandTrackingStarterKit.Start(); if (!result.IsOk) { Debug.LogErrorFormat("Error: MLHandTrackingBehavior failed on MLHandTrackingStarterKit.Start, disabling script. Reason: {0}", result); enabled = false; return; } #endif UpdateKeyPoseStates(); MLHandTrackingStarterKit.SetKeyPointsFilterLevel(_keyPointFilterLevel); MLHandTrackingStarterKit.SetPoseFilterLevel(_poseFilterLevel); }
/// <summary> /// Validate and initialize properties /// </summary> void Start() { if (_behavior == null) { Debug.LogError("Error: HandMeshingExample._behavior is not set, disabling script."); enabled = false; return; } if (_occlusionMaterial == null) { Debug.LogError("Error: HandMeshingExample._occlusionMaterial is not set, disabling script."); enabled = false; return; } if (_flatMaterial == null) { Debug.LogError("Error: HandMeshingExample._flatMaterial is not set, disabling script."); enabled = false; return; } if (_wireframeMaterial == null) { Debug.LogError("Error: HandMeshingExample._wireframeMaterial is not set, disabling script."); enabled = false; return; } if (_statusText == null) { Debug.LogError("Error: HandMeshingExample._status is not set, disabling script."); enabled = false; return; } if (_switchTooltip == null) { Debug.LogError("Error: HandMeshingExample._switchTooltip is not set, disabling script."); enabled = false; return; } _switchTooltip.gameObject.SetActive(false); // Note: MLHandTracking API is not necessary to use Hand Meshing. // It is only used for switching the render modes in this example. MLResult result = MLHandTrackingStarterKit.Start(); #if PLATFORM_LUMIN if (!result.IsOk) { Debug.LogError("Error: HandMeshingExample failed on MLHandTrackingStarterKit.Start, disabling script."); enabled = false; return; } #endif MLHandTrackingStarterKit.EnableKeyPoses(true, _keyposeToSwitch); MLHandTrackingStarterKit.SetPoseFilterLevel(MLHandTracking.PoseFilterLevel.ExtraRobust); MLHandTrackingStarterKit.SetKeyPointsFilterLevel(MLHandTracking.KeyPointFilterLevel.ExtraSmoothed); _timer = _secondsBetweenModes; }