/// <summary> /// 界面初始化 /// <summary> /// <param name="view">控制的窗口</param> /// <param name="userData">用户数据</param> public void OnInit(SelectRoleFormView view, object userData) { m_SelectRoleFormView = view; m_CreateRoleButtons = new Button[4]; m_CreateRoleButtons[0] = m_SelectRoleFormView.ButtonCreateRole1; m_CreateRoleButtons[1] = m_SelectRoleFormView.ButtonCreateRole2; m_CreateRoleButtons[2] = m_SelectRoleFormView.ButtonCreateRole3; m_CreateRoleButtons[3] = m_SelectRoleFormView.ButtonCreateRole4; for (int i = 0; i < m_CreateRoleButtons.Length; i++) { m_CreateRoleButtons[i].onClick.AddListener(CreateRole); } m_RoleLists = new Transform[4]; m_RoleLists[0] = m_SelectRoleFormView.RoleItemView1; m_RoleLists[1] = m_SelectRoleFormView.RoleItemView2; m_RoleLists[2] = m_SelectRoleFormView.RoleItemView3; m_RoleLists[3] = m_SelectRoleFormView.RoleItemView4; for (int i = 0; i < m_RoleLists.Length; i++) { ButtonHelper buttonHelper = m_RoleLists[i].GetComponent <ButtonHelper>(); m_RoleLists[i].GetComponent <Button>().onClick.AddListener(buttonHelper.OnClickEvent); buttonHelper.OnClick = SetSelectRole; } m_SelectRoleFormView.btnStart.onClick.AddListener(EnterGame); m_SelectRoleFormView.btnDeleteRole.onClick.AddListener(DeleateRole); m_SelectRoleFormView.btnToLogOn.onClick.AddListener(GoToLogOn); }
/// <summary> /// 界面初始化 /// </summary> /// <param name="view">控制的窗口</param> /// <param name="userData">用户数据</param> public void OnInit(SelectRoleFormView view, object userData) { m_SelectRoleFormView = view; }