void OnComplete(bool success, string errorMessage, bool close) { if (!_isVisible) { Debug.LogWarning("[SRDebugger] Received callback at unexpected time. ???"); return; } if (!success && !close) { return; } _isVisible = false; // Destroy it all so it doesn't linger in the scene using memory _popover.gameObject.SetActive(false); Destroy(_popover.gameObject); _popover = null; _sheet = null; BugReportScreenshotUtil.ScreenshotData = null; _callback(success, errorMessage); }
private void Load() { var popoverPrefab = Resources.Load <BugReportPopoverRoot>(SRDebugPaths.BugReportPopoverPath); var sheetPrefab = Resources.Load <BugReportSheetController>(SRDebugPaths.BugReportSheetPath); if (popoverPrefab == null) { Debug.LogError("[SRDebugger] Unable to load bug report popover prefab"); return; } if (sheetPrefab == null) { Debug.LogError("[SRDebugger] Unable to load bug report sheet prefab"); return; } _popover = SRInstantiate.Instantiate(popoverPrefab); _popover.CachedTransform.SetParent(CachedTransform, false); _sheet = SRInstantiate.Instantiate(sheetPrefab); _sheet.CachedTransform.SetParent(_popover.Container, false); _sheet.SubmitComplete = SubmitComplete; _sheet.CancelPressed = CancelPressed; _sheet.TakingScreenshot = TakingScreenshot; _sheet.ScreenshotComplete = ScreenshotComplete; _popover.CachedGameObject.SetActive(false); }