public void SelectionUI(SerializedProperty templateProp)
{
if (s_Styles == null)
{
s_Styles = new Styles();
}
if (this.TemplateGUIThumbnails.Length < 1)
{
GUILayout.Label(EditorGUIUtility.TextContent("No templates found."), new GUILayoutOption[0]);
}
else
{
int maxRowItems = Mathf.Min((int) Mathf.Max((float) ((Screen.width - 30f) / 80f), (float) 1f), this.TemplateGUIThumbnails.Length);
int num2 = Mathf.Max((int) Mathf.Ceil(((float) this.TemplateGUIThumbnails.Length) / ((float) maxRowItems)), 1);
bool changed = GUI.changed;
GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
templateProp.stringValue = this.Templates[ThumbnailList(GUILayoutUtility.GetRect((float) (maxRowItems * 80f), (float) (num2 * 100f), options), this.GetTemplateIndex(templateProp.stringValue), this.TemplateGUIThumbnails, maxRowItems)].ToString();
bool flag2 = !changed && GUI.changed;
bool flag3 = GUI.changed;
GUI.changed = false;
foreach (string str in PlayerSettings.templateCustomKeys)
{
string templateCustomValue = PlayerSettings.GetTemplateCustomValue(str);
templateCustomValue = EditorGUILayout.TextField(PrettyTemplateKeyName(str), templateCustomValue, new GUILayoutOption[0]);
PlayerSettings.SetTemplateCustomValue(str, templateCustomValue);
}
if (GUI.changed)
{
templateProp.serializedObject.Update();
}
GUI.changed |= flag3;
if (flag2)
{
GUIUtility.hotControl = 0;
GUIUtility.keyboardControl = 0;
templateProp.serializedObject.ApplyModifiedProperties();
PlayerSettings.templateCustomKeys = this.Templates[this.GetTemplateIndex(templateProp.stringValue)].CustomKeys;
templateProp.serializedObject.Update();
}
}
}