void OnGUI()

in Networked Physics/Assets/Oculus/VR/Scripts/OVRLint.cs [89:197]


	void OnGUI()
	{
		GUILayout.Label("OVR Performance Lint Tool", EditorStyles.boldLabel);
		if (GUILayout.Button("Refresh", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)))
		{
			RunCheck();
		}

		string lastCategory = "";

		mScrollPosition = EditorGUILayout.BeginScrollView(mScrollPosition);

		for (int x = 0; x < mRecords.Count; x++)
		{
			FixRecord record = mRecords[x];

			if (!record.category.Equals(lastCategory))  // new category
			{
				lastCategory = record.category;
				EditorGUILayout.Separator();
				EditorGUILayout.BeginHorizontal();
				GUILayout.Label(lastCategory, EditorStyles.label, GUILayout.Width(200));
				bool moreThanOne = (x + 1 < mRecords.Count && mRecords[x + 1].category.Equals(lastCategory));
				if (record.buttonNames != null && record.buttonNames.Length > 0)
				{
					if (moreThanOne)
					{
						GUILayout.Label("Apply to all:", EditorStyles.label, GUILayout.Width(75));
						for (int y = 0; y < record.buttonNames.Length; y++)
						{
							if (GUILayout.Button(record.buttonNames[y], EditorStyles.toolbarButton, GUILayout.Width(200)))
							{
								List<FixRecord> recordsToProcess = new List<FixRecord>();

								for (int z = x; z < mRecords.Count; z++)
								{
									FixRecord thisRecord = mRecords[z];
									bool isLast = false;
									if (z + 1 >= mRecords.Count || !mRecords[z + 1].category.Equals(lastCategory))
									{
										isLast = true;
									}

									if (!thisRecord.complete)
									{
										recordsToProcess.Add(thisRecord);
									}

									if (isLast)
									{
										break;
									}
								}

								UnityEngine.Object[] undoObjects = new UnityEngine.Object[recordsToProcess.Count];
								for (int z = 0; z < recordsToProcess.Count; z++)
								{
									undoObjects[z] = recordsToProcess[z].targetObject;
								}
								Undo.RecordObjects(undoObjects, record.category + " (Multiple)");
								for (int z = 0; z < recordsToProcess.Count; z++)
								{
									FixRecord thisRecord = recordsToProcess[z];
									thisRecord.fixMethod(thisRecord.targetObject, (z + 1 == recordsToProcess.Count), y);
									thisRecord.complete = true;
								}
							}
						}
					}
				}
				EditorGUILayout.EndHorizontal();
				if (moreThanOne || record.targetObject)
				{
					GUILayout.Label(record.message);
				}
			}

			EditorGUILayout.BeginHorizontal();
			GUI.enabled = !record.complete;
			if (record.targetObject)
			{
				EditorGUILayout.ObjectField(record.targetObject, record.targetObject.GetType(), true);
			}
			else
			{
				GUILayout.Label(record.message);
			}
			if (record.buttonNames != null)
			{
				for (int y = 0; y < record.buttonNames.Length; y++)
				{
					if (GUILayout.Button(record.buttonNames[y], EditorStyles.toolbarButton, GUILayout.Width(200)))
					{
						if (record.targetObject != null)
						{
							Undo.RecordObject(record.targetObject, record.category);
						}
						record.fixMethod(record.targetObject, true, y);
						record.complete = true;
					}
				}

			}
			GUI.enabled = true;
			EditorGUILayout.EndHorizontal();
		}

		EditorGUILayout.EndScrollView();
	}