Пример #1
0
        public void SetUp()
        {
            m_TestingContacts = new List <UM_EditorContact>(UM_Settings.Instance.EditorTestingContacts);

            if (UM_Settings.Instance.EditorTestingContacts.Count == 0)
            {
                var contact = new UM_EditorContact("name", "phone", "email");
                UM_Settings.Instance.EditorTestingContacts.Add(contact);
            }
        }
Пример #2
0
        protected override void OnServiceUI()
        {
            using (new SA_WindowBlockWithSpace(new GUIContent("Editor Testing"))) {
                EditorGUILayout.HelpBox("Spesifiy contacts book entries that will be used " +
                                        "while emulating API inside the editor.", MessageType.Info);

                SA_EditorGUILayout.ReorderablList(UM_Settings.Instance.EditorTestingContacts, GetContactDisplayName, DrawProductContent, () => {
                    string name  = "John Smith";
                    string phone = "1–800–854–3680";
                    string email = "*****@*****.**";

                    var contact = new UM_EditorContact(name, phone, email);
                    UM_Settings.Instance.EditorTestingContacts.Add(contact);
                });
            }
        }
Пример #3
0
 private void DrawProductContent(UM_EditorContact contact)
 {
     contact.Name  = SA_EditorGUILayout.TextField("Name", contact.Name);
     contact.Email = SA_EditorGUILayout.TextField("Email", contact.Email);
     contact.Phone = SA_EditorGUILayout.TextField("Phone", contact.Phone);
 }
Пример #4
0
 private string GetContactDisplayName(UM_EditorContact contact)
 {
     return(contact.Name + " (" + contact.Email + ")");
 }