/// <summary> /// Calls Start on MLHandTrackingStarterKit. /// </summary> void Start() { MLResult result = MLHandTrackingStarterKit.Start(); #if PLATFORM_LUMIN if (!result.IsOk) { Debug.LogErrorFormat("Error: KeyPoseVisualizer failed on MLHandTrackingStarterKit.Start, disabling script. Reason: {0}", result); enabled = false; return; } #endif cur_pose = new string[2]; //cur_pose[0] = "def"; LogToFileHelper logger = new LogToFileHelper(); scn = SceneManager.GetActiveScene(); sceneName = scn.name; //establishing logger for storing interactions locally as a backup StartCoroutine(logger.LogToFileStringArray("log_poses.json", cur_pose)); //creating new session StartCoroutine(consoler.NewSession("http://" + LoggingConfig.ip_address + ":" + LoggingConfig.port + "/ext/" + LoggingConfig.api_key + "/new_session")); StartCoroutine(checkHands()); }
/// <summary> /// Calls Start on MLHandTrackingStarterKit. /// </summary> void Start() { #if PLATFORM_LUMIN MLResult result = MLHandTrackingStarterKit.Start(); if (!result.IsOk) { Debug.LogErrorFormat("Error: HandTrackingExample failed on MLHandTrackingStarterKit.Start, disabling script. Reason: {0}", result); enabled = false; return; } #endif }
/// <summary> /// Calls Start on MLHandTrackingStarterKit. /// </summary> void Start() { MLResult result = MLHandTrackingStarterKit.Start(); #if PLATFORM_LUMIN if (!result.IsOk) { Debug.LogErrorFormat("Error: KeyPoseVisualizer failed on MLHandTrackingStarterKit.Start, disabling script. Reason: {0}", result); _spriteRenderer.material.color = Color.red; enabled = false; return; } #endif }
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> /// Calls Start on MLHandTrackingStarterKit and initializes the lists of hand transforms. /// </summary> void Start() { if (_center == null) { Debug.LogError("Error: HandVisualizer._center is not set, disabling script."); enabled = false; return; } MLResult result = MLHandTrackingStarterKit.Start(); #if PLATFORM_LUMIN if (!result.IsOk) { Debug.LogErrorFormat("Error: HandVisualizer failed calling Start on MLHandTrackingStarterKit, disabling script. Reason: {0}", result); enabled = false; return; } #endif Initialize(); }
/// <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; }