예제 #1
0
        public static void OpenWindow(Func <int> onInit, Func <int, string> onRefresh, Action <int> onConfirm)
        {
            ConfigInfoWindow win = GetWindow <ConfigInfoWindow>();

            win.position = new Rect(600, 300, 400, 400);
            win.maxSize  = new Vector2(300, 500);
            win.Show();
            win.m_OnInitCallBack    = onInit;
            win.m_OnRefreshCallBack = onRefresh;
            win.m_OnConfirmCallBack = onConfirm;
            win.Init();
        }
예제 #2
0
 private void OnAdd()
 {
     ConfigInfoWindow.OpenWindow(() =>
     {
         return(m_MissionList != null ? m_MissionList.Count : 0);
     }, (index) =>
     {
         string str = "";
         if (m_MissionList != null && m_MissionList.Count > index)
         {
             str = $"{m_MissionList[index].ID}";
         }
         return(str);
     }, (index) =>
     {
         if (m_MissionList != null && m_MissionList.Count > index)
         {
             if (!m_Target.m_MissionList.Contains(m_MissionList[index].ID))
             {
                 m_Target.m_MissionList.Add(m_MissionList[index].ID);
             }
         }
     });
 }
예제 #3
0
        private void OnSelect()
        {
            List <NpcVO> npcListTemplateList = null;

            ConfigInfoWindow.OpenWindow(() =>
            {
                List <NpcVO> allNpcs = ConfigVO <NpcVO> .Instance.GetList();
                if (allNpcs != null && allNpcs.Count > 0)
                {
                    npcListTemplateList      = new List <NpcVO>();
                    KMapPathType mapPathType = m_Target.m_Root.GetGamingMapPathType();
                    for (int iAllNpc = 0; iAllNpc < allNpcs.Count; iAllNpc++)
                    {
                        NpcVO vo = allNpcs[iAllNpc];
                        if ((mapPathType == KMapPathType.KMapPath_Groud && vo.motionType == (int)MotionType.Human) ||
                            (mapPathType == KMapPathType.KMapPath_Space && vo.motionType == (int)MotionType.Ship))
                        {
                            npcListTemplateList.Add(vo);
                        }
                    }
                }
                return(npcListTemplateList != null ? npcListTemplateList.Count : 0);
            }, (index) =>
            {
                string str = "";
                if (npcListTemplateList != null && npcListTemplateList.Count > index)
                {
                    str = $"{npcListTemplateList[index].ID}_{npcListTemplateList[index].Name}";
                }
                return(str);
            }, (index) =>
            {
                m_Target.m_SelectNpcIndex = index;
            });
            //NpcInfoWindow.OpenWindow(m_Target);
        }
예제 #4
0
 private void OnSelect()
 {
     ConfigInfoWindow.OpenWindow(() =>
     {
         List <IconVO> iconList = ConfigVO <IconVO> .Instance.GetList();
         return(iconList != null ? iconList.Count : 0);
     }, (index) =>
     {
         List <IconVO> iconList = ConfigVO <IconVO> .Instance.GetList();
         string str             = "";
         if (iconList != null && iconList.Count > index)
         {
             str = $"{iconList[index].ID}_{iconList[index].squareName}";
         }
         return(str);
     }, (index) =>
     {
         List <IconVO> iconList = ConfigVO <IconVO> .Instance.GetList();
         if (iconList != null && iconList.Count > index)
         {
             m_Target.m_IconConfId = iconList[index].ID;
         }
     });
 }