private void OnGUI() { EditorGUILayout.BeginVertical(); EditorGUILayout.Space(); EditorGUILayout.LabelField("自动生成View/Presenter文件"); EditorGUILayout.Space(); EditorGUILayout.LabelField("请输入关键字"); EditorGUILayout.Space(); _keyword = EditorGUILayout.TextField(_keyword); EditorGUILayout.Space(); if (GUILayout.Button("Create")) { OnCreateEvent?.Invoke(); } EditorGUILayout.EndVertical(); }
private void Prepare() { cameraWorldVector.x = Vector2.Distance( mainCamera.ScreenToWorldPoint(Vector3.zero), mainCamera.ScreenToWorldPoint(new Vector3(Screen.width, 0f))) * 0.5f; cameraWorldVector.y = Vector2.Distance( mainCamera.ScreenToWorldPoint(Vector3.zero), mainCamera.ScreenToWorldPoint(new Vector3(0f, Screen.height))) * 0.5f; Data = new WallData(cameraWorldVector, thickness, ceilingFactor); try { if (OnCreateEvent != null) { OnCreateEvent.Invoke(); } else { EventExtension.ThrowMessage(nameof(OnCreateEvent)); } } catch (Exception e) { EventExtension.PrintError(e); } }
public static void OpenCreateEditor(OnCreateEvent callBack) { AIEventEditWnd wnd = EditorWindow.GetWindow <AIEventEditWnd>(); wnd.OpenAsCreateMode(); wnd.onCreate = callBack; }
private void buttonSave_Click(object sender, EventArgs e) { if (MessageBox.Show("Create new event?", "Security", MessageBoxButtons.YesNo) == DialogResult.Yes) { var userId = currentUser.Keys.FirstOrDefault(); var userName = currentUser.Values.FirstOrDefault(); if (!string.IsNullOrEmpty(textBoxCreatorName.Text) && userName == textBoxCreatorName.Text) { var userModel = new UserModel() { Id = userId, Name = userName, }; var eventModel = new EventModel() { UserId = userId, Description = textBoxDescription.Text, Date = GetDateTime(dateTimePickerDate.Value, Convert.ToInt32(comboBoxHour.SelectedItem)), Location = textBoxLocation.Text, IsExclusive = checkBoxExclusive.Checked, Guests = invitationGuests.Keys.ToList(), }; OnCreateEvent?.Invoke(eventModel, userModel); } else { MessageBox.Show("Invalid Parameters!"); } } }
public void OnCreateValue() { if (IsValidValue()) { OnCreateEvent?.Invoke(InternalValue); } Close(); }
void CreateEvent(AIClipEvent clipEvent) { if (onCreate != null) { onCreate(clipEvent); //初始名为赋值为类型名 clipEvent.eventName = clipEvent.ToString(); mCurEvet = clipEvent; onCreate = null; } else { Debug.LogError("没有创建回调"); } }
void CreateEvent(AIClipEvent clipEvent) { if (onCreate != null) { onCreate(clipEvent); //初始名为赋值为类型名 clipEvent.eventName = clipEvent.ToString(); mCurEvet = clipEvent; onCreate = null; } else { Debug.LogError("没有创建回调"); } }
private void OnCreate() { OnCreateEvent?.Invoke(Keyword); }
public static void OpenCreateEditor(OnCreateEvent callBack) { AIEventEditWnd wnd = EditorWindow.GetWindow<AIEventEditWnd>(); wnd.OpenAsCreateMode(); wnd.onCreate = callBack; }