in Scripts/Editor/WitEditorUI.cs [185:219]
public static void LayoutPasswordField(GUIContent key, ref string fieldValue, ref bool isUpdated)
{
// Ensure not null
if (fieldValue == null)
{
fieldValue = string.Empty;
}
// Simple layout
GUILayout.BeginHorizontal();
string newFieldValue;
if (key == null)
{
newFieldValue = EditorGUILayout.PasswordField(fieldValue, WitStyles.PasswordField);
}
else
{
newFieldValue = EditorGUILayout.PasswordField(key, fieldValue, WitStyles.PasswordField);
}
// Layout icon
if (LayoutIconButton(WitStyles.PasteIcon))
{
newFieldValue = EditorGUIUtility.systemCopyBuffer;
GUI.FocusControl(null);
}
GUILayout.EndHorizontal();
// Update if changed
if (!string.Equals(fieldValue, newFieldValue))
{
fieldValue = newFieldValue;
isUpdated = true;
}
}