void OnPostRender() { if (!trackerPanel) { return; } _tracker = trackerPanel.GetColorTracker(); if (_tracker == null || Camera.main == null) { return; } if (!_tracker.isRunning) { DestroyPreviousGraphics(); return; } List <TrackerResult> result = _tracker.Compute(); if (_graphics.Count != result.Count) { DestroyPreviousGraphics(); CreateNewGraphics(result.Count); } for (var i = 0; i < result.Count; i++) { GameObject actual = _graphics[i]; TrackerResult target = result[i]; if (target.state == TrackingState.Tracked) { CoordinateMapper.ConvertInputToScreen(_tracker.input, target.center, ref _reusableScreenPosition); CoordinateMapper.ConvertScreenToUI(_reusableScreenPosition, actual.GetComponent <RectTransform>()); actual.SetActive(true); } else { actual.SetActive(false); } } }