Beispiel #1
0
    private void InitKeyboradList()
    {
        GameObject typeLine = Mgr_AssetBundle.Instance.LoadAsset <GameObject>(ABTypes.prefab, AppConst.UIModelTypeLine);
        GameObject KeyCell  = Mgr_AssetBundle.Instance.LoadAsset <GameObject>(ABTypes.prefab, AppConst.UIModelKeyCell);

        foreach (var item in (int[])Enum.GetValues(typeof(KeyBorad)))
        {
            if (item < AppConst.PlayerCustomKeyIndex)
            {
                continue;
            }
            if (item == AppConst.PlayerCustomKeyIndex)
            {
                AddSubKeyboradPageTitle(typeLine, AppConst.StrPlayerKeyBoradTitle);
            }
            UM_KeyCell umCell = Instantiate(KeyCell).GetComponent <UM_KeyCell>();
            umCell.transform.SetParent(m_SubPageKeyBorad.content, false);
            umCell.m_TitleKeyName.text = ((KeyBorad)item).ToString();
            umCell.m_BtnKey.onClick.AddListener(() =>
            {
                umCell.m_BtnKey.interactable = false;
                m_ForWardWaitingPage.SetActive(true);
                m_CurrentCell = umCell;
            });
            m_KeyCellList.Add(umCell);
        }
    }
Beispiel #2
0
 public override void OnOpen()
 {
     base.OnOpen();
     m_CurrentCell = null;
     m_ForWardWaitingPage.SetActive(false);
     m_ShowSubPage = m_SubPages[0];
     Refresh();
 }