Exemple #1
0
        void SetupCrashDiag()
        {
            var crashDiagContainer = rootVisualElement.Q(className: k_CloudDiagCrashContainerClassName);

            if (crashDiagContainer == null)
            {
                return;
            }

            var generalTemplate = EditorGUIUtility.Load(k_CloudDiagCrashCommonUxmlPath) as VisualTreeAsset;

            if (generalTemplate != null)
            {
                var newVisual = generalTemplate.CloneTree().contentContainer;
                ServicesUtils.TranslateStringsInTree(newVisual);
                crashDiagContainer.Clear();
                crashDiagContainer.Add(newVisual);
                crashDiagContainer.Add(ServicesUtils.SetupSupportedPlatformsBlock(ServicesUtils.GetCloudDiagCrashSupportedPlatforms()));

                m_CrashServiceGoToDashboard = rootVisualElement.Q(k_CloudDiagCrashGoToDashboardName);
                if (m_CrashServiceGoToDashboard != null)
                {
                    var clickable = new Clickable(() =>
                    {
                        ServicesConfiguration.instance.RequestBaseCloudDiagCrashesDashboardUrl(OpenDashboardOrgAndProjectIds);
                    });
                    m_CrashServiceGoToDashboard.AddManipulator(clickable);
                }

                m_CrashServiceToggle = rootVisualElement.Q <Toggle>(className: k_ServiceToggleClassName);
                SetupServiceToggle();
                RegisterEvent();
            }
        }