Esempio n. 1
0
    private void OnEnable()
    {
        npcInfoService  = new NpcInfoService();
        textInfoService = new TextInfoService();
        npcTeamService  = new NpcTeamService();

        NpcInfoHandler.Instance.manager.Awake();
        GameItemsHandler.Instance.manager.Awake();
    }
Esempio n. 2
0
    /// <summary>
    /// 团队创建 UI
    /// </summary>
    public static void GUINpcTeamCreate(NpcTeamService npcTeamService, NpcTeamBean npcTeamData)
    {
        GUILayout.Label("Npc团队创建", GUILayout.Width(100), GUILayout.Height(20));

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("创建", GUILayout.Width(100), GUILayout.Height(20)))
        {
            npcTeamData.valid = 1;
            npcTeamService.InsertData(npcTeamData);
        }
        GUILayout.EndHorizontal();

        GUINpcTeamItem(npcTeamData);
    }
Esempio n. 3
0
    /// <summary>
    /// 团队查询 UI
    /// </summary>
    public static void GUINpcTeamFind(
        TextInfoService textInfoService, NpcTeamService npcTeamService,
        string findIdsStr, List <NpcTeamBean> listFindData, Dictionary <long, List <TextInfoBean> > mapTeamTalkInfo,
        out string outFindIdsStr, out List <NpcTeamBean> outlistFindData, out Dictionary <long, List <TextInfoBean> > outMapTeamTalkInfo)
    {
        GUILayout.Label("Npc团队查询", GUILayout.Width(100), GUILayout.Height(20));
        GUILayout.BeginHorizontal();
        outFindIdsStr = EditorGUILayout.TextArea(findIdsStr + "", GUILayout.Width(200), GUILayout.Height(20));

        if (GUILayout.Button("查询团队", GUILayout.Width(100), GUILayout.Height(20)))
        {
            long[] findIds = StringUtil.SplitBySubstringForArrayLong(findIdsStr, ',');
            listFindData = npcTeamService.QueryDataById(findIds);
        }

        if (GUILayout.Button("查询顾客团队", GUILayout.Width(100), GUILayout.Height(20)))
        {
            listFindData = npcTeamService.QueryDataByType((int)NpcTeamTypeEnum.Customer);
        }
        if (GUILayout.Button("查询好友团队", GUILayout.Width(100), GUILayout.Height(20)))
        {
            listFindData = npcTeamService.QueryDataByType((int)NpcTeamTypeEnum.Friend);
        }
        if (GUILayout.Button("查询捣乱团队", GUILayout.Width(100), GUILayout.Height(20)))
        {
            listFindData = npcTeamService.QueryDataByType((int)NpcTeamTypeEnum.Rascal);
        }
        if (GUILayout.Button("查询杂项团队", GUILayout.Width(100), GUILayout.Height(20)))
        {
            listFindData = npcTeamService.QueryDataByType((int)NpcTeamTypeEnum.Sundry);
        }
        if (GUILayout.Button("查询助兴团队", GUILayout.Width(100), GUILayout.Height(20)))
        {
            listFindData = npcTeamService.QueryDataByType((int)NpcTeamTypeEnum.Entertain);
        }
        if (GUILayout.Button("查询扫兴团队", GUILayout.Width(100), GUILayout.Height(20)))
        {
            listFindData = npcTeamService.QueryDataByType((int)NpcTeamTypeEnum.Disappointed);
        }
        GUILayout.EndHorizontal();
        if (listFindData != null)
        {
            NpcTeamBean itemRemoveData = null;
            foreach (NpcTeamBean itemData in listFindData)
            {
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("更新", GUILayout.Width(100), GUILayout.Height(20)))
                {
                    npcTeamService.Update(itemData);
                }
                if (GUILayout.Button("删除", GUILayout.Width(100), GUILayout.Height(20)))
                {
                    npcTeamService.DeleteDataById(itemData.id);
                    itemRemoveData = itemData;
                }
                if (GUILayout.Button("查询团队对话", GUILayout.Width(100), GUILayout.Height(20)))
                {
                    List <TextInfoBean> listNpcTeamTalkInfo = textInfoService.QueryDataByMarkId(TextEnum.Talk, itemData.GetTalkIds());
                    HandleTalkInfoDataByMarkId(listNpcTeamTalkInfo, mapTeamTalkInfo);
                }
                GUILayout.EndHorizontal();
                GUINpcTeamItem(itemData);
                GUILayout.Space(20);
            }
            if (itemRemoveData != null)
            {
                listFindData.Remove(itemRemoveData);
                itemRemoveData = null;
            }
        }
        outlistFindData    = listFindData;
        outMapTeamTalkInfo = mapTeamTalkInfo;
    }
Esempio n. 4
0
 public override void InitData()
 {
     npcTeamService = new NpcTeamService();
 }