public void RemoveAction(AiukButtonEventType type) { if (m_ButtonActions.ContainsKey(type)) { AiukDebugUtility.LogError (string.Format("目标行为处理委托{0}不存在,无法移除", type)); return; } m_ButtonActions.Remove(type); }
public void BindingAction(AiukButtonEventType type, Action action) { if (m_ButtonActions.ContainsKey(type)) { AiukDebugUtility.LogError (string.Format("目标行为处理委托{0}已存在,无法绑定!", type)); return; } m_ButtonActions.Add(type, action); }
private IAiukViewActionRequest <IAiukButton> GetRequest(AiukButtonEventType type) { if (m_Requests.ContainsKey(type)) { var request = m_Requests[type]; return(request); } var newRequest = new AiukViewActionRequest <IAiukButton>(); m_Requests.Add(type, newRequest); return(newRequest); }
private string GetActionToken(AiukButtonEventType type) { if (m_ActionTokens.ContainsKey(type)) { var token = m_ActionTokens[type]; return(token); } var newToken = CContainer.ID + "_" + gameObject.name + "_" + type; m_ActionTokens.Add(type, newToken); return(newToken); }
private void InvokeAction(PointerEventData eventData, AiukButtonEventType type) { CurrentButtonEventData = eventData; if (m_ButtonActions.ContainsKey(type)) { var action = m_ButtonActions[type]; action(); } else { var request = GetRequest(type); m_Dispatcher.IssueRequest(request); } }