public void OnGUI()
{
Event current = Event.current;
bool flag = false;
bool flag2 = false;
if (current.type == EventType.KeyDown)
{
flag = current.keyCode == KeyCode.Escape;
flag2 = (current.keyCode == KeyCode.Return) || (current.keyCode == KeyCode.KeypadEnter);
}
using (HorizontalLayout.DoLayout())
{
GUILayout.Space(10f);
using (VerticalLayout.DoLayout())
{
GUILayout.FlexibleSpace();
using (HorizontalLayout.DoLayout())
{
GUILayoutOption[] options = new GUILayoutOption[] { kLabelWidth };
GUILayout.Label(EditorGUIUtility.TextContent("Password|Certificate password."), options);
GUI.SetNextControlName("password");
this.password = GUILayout.PasswordField(this.password, '●', new GUILayoutOption[0]);
}
GUILayout.Space(10f);
using (HorizontalLayout.DoLayout())
{
GUILayout.Label(this.message, this.messageStyle, new GUILayoutOption[0]);
GUILayout.FlexibleSpace();
GUILayoutOption[] optionArray2 = new GUILayoutOption[] { kButtonWidth };
if (GUILayout.Button(EditorGUIUtility.TextContent("Ok"), optionArray2) || flag2)
{
this.message = GUIContent.none;
try
{
if (PlayerSettings.WSA.SetCertificate(this.path, this.password))
{
flag = true;
}
else
{
this.message = EditorGUIUtility.TextContent("Invalid password.");
}
}
catch (UnityException exception)
{
Debug.LogError(exception.Message);
}
}
}
GUILayout.FlexibleSpace();
}
GUILayout.Space(10f);
}
if (flag)
{
base.Close();
}
else if (this.focus != null)
{
EditorGUI.FocusTextInControl(this.focus);
this.focus = null;
}
}