internal void AddAction(MouseEventHandler handler, string description, UIComponent sender, UIMouseEventParameter eventParam) { int idx = actions.Length; Array.Resize(ref actions, idx + 1); actions[idx] = new HookAction(handler, sender, eventParam); Array.Resize(ref dropDownItems, idx + 1); dropDownItems[idx] = description; actionsDropDown.items = dropDownItems; }
private void OnActionChoosed(int idx) { #if DEBUG Debug.LogFormat("PanelHook: HooksPanel.OnActionChoosed - {0}", idx); #endif if (isVisible && idx < 1) { return; } if (idx > 0) { #if DEBUG Debug.LogFormat("PanelHook: HooksPanel.OnActionChoosed - action needed {0}", idx); #endif //Action< HookManager.pHandlerPointer, UIComponent, UIMouseEventParameter> act = (ptr1, sdr1, ep1) => //{ ptr1(sdr1, ep1)}; //act(actions[idx].Handler, actions[idx].Sender, actions[idx].EventParam); HookAction action = actions[idx]; action.Handler(action.Sender, action.EventParam); Hide(); } ClearActions(); }