public static DialogInputHoldRandom Show(BComponent unit, System.Action <object> evt) { DialogInputHoldRandom result = EditorWindow.GetWindowWithRect <DialogInputHoldRandom>( new Rect(0f, 0f, 300f, 100f), true, "Set new time values on random selected"); result.unitRandom = unit as Components.Composites.RandomSelector; result.skin = Resources.Load <GUISkin>("dialog"); result.evt = evt; result.ShowPopup(); return(result); }
public void MenuMoreComponentRandom(System.Action <object> evt, BComponent unit) { GenericMenu menu = new GenericMenu(); menu.AddItem(new GUIContent("Copy"), false, (obj) => { evt(obj); }, "Copy-Unit"); menu.AddItem(new GUIContent("Cut"), false, (obj) => { evt(obj); }, "Cut-Unit"); menu.AddSeparator(""); menu.AddItem(new GUIContent("Hold Time on Random Selection"), false, (obj) => { DialogInputHoldRandom.Show(unit, evt); }, "Hold" ); menu.ShowAsContext(); }