public override void OnInspectorGUI() { PacketZoom pz = (PacketZoom)target; var defaultLabelWidth = LabelWidth; LabelWidth = 50.0f; // App ID / API Key fields pz.AppID = EditorGUILayout.TextField("App ID", pz.AppID ?? string.Empty); pz.ApiKey = EditorGUILayout.TextField("API Key", pz.ApiKey ?? string.Empty); EditorGUILayout.Separator(); LabelWidth = 160.0f; // Log Level field pz.LogLevel = (PZLogLevel)EditorGUILayout.EnumPopup("Log Level", pz.LogLevel); EditorGUILayout.Separator(); // Measure App Launch Delay pz.MeasureAppLaunchDelay = EditorGUILayout.Toggle("Meausure App Launch Delay", pz.MeasureAppLaunchDelay); if (pz.MeasureAppLaunchDelay) { EditorGUILayout.HelpBox("You must call PZSpeed.AppLaunchCompleted() once your app has finished launching", MessageType.Info); } EditorGUILayout.Separator(); // Advanced Settings viewAdvancedSettings = EditorGUILayout.Foldout(viewAdvancedSettings, "Advanced Settings"); if (viewAdvancedSettings) { // Use PZ pz.UsePZ = EditorGUILayout.Toggle("Enable PacketZoom", pz.UsePZ); // Should Report Analytics pz.ShouldReportAnalytics = EditorGUILayout.Toggle("Should Report Analytics", pz.ShouldReportAnalytics); LabelWidth = 140.0f; } LabelWidth = defaultLabelWidth; }
void Start() { // grab the initial value of PZ from the config object PacketZoom pz = FindObjectOfType(typeof(PacketZoom)) as PacketZoom; if (pz != null) { usePZ = pz.UsePZ; } StartCoroutine(UpdateLoadingDots()); Debug.Log("Is reporting analytics: " + PZSpeed.ShouldReportAnalytics); Debug.Log("Is measuring app launch delay: " + PZSpeed.IsMeasuringAppLaunchDelay()); var success = PZSpeed.AppLaunchCompleted(); Debug.Log("App launch delay measure success: " + success); }