Exemple #1
0
    public NPCSpecialConfigData GetNpcSpecialConfigData(int funcType)
    {
        NPCSpecialConfigData nSCdata = null;

        foreach (NPCSpecialConfigData data in NPCSpecialConfigList)
        {
            if (data._FunctionType.Equals(funcType))
            {
                nSCdata = data;
                break;
            }
        }
        return(nSCdata);
    }
Exemple #2
0
    private static void NPCSpecialPostprocess()
    {
        string     path = System.IO.Path.Combine(RESOURCE_NPC_CONFIG_FOLDER, "NPCSpecial.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("Special config file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <NPCSpecialConfigData> tempList = new List <NPCSpecialConfigData>();

            for (int i = 0; i < levelIds.Length; i++)
            {
                if (0 == i || 1 == i)
                {
                    continue;
                }
                NPCSpecialConfigData data = new NPCSpecialConfigData();
                data._NPCID        = Convert.ToInt32(sheet["NpcID"][i]);
                data._FunctionDesc = Convert.ToString(sheet["FunctionDesc"][i]);
                data._FunctionType = Convert.ToInt32(sheet["FunctionType"][i]);
                data.Parameters    = Convert.ToInt32(sheet["Parameters"][i]);
                data.ShopIcon      = Convert.ToString(sheet["ShopIcon"][i]);
                data.ShopTitle     = Convert.ToString(sheet["ShopTitle"][i]);
                //string prefabpath = Convert.ToString(sheet["NpcPrefabPath"][i]);
                //string pathRes = System.IO.Path.Combine(ASSET_ECTYPE_RES_CONFIG_FOLDER, prefabpath + ".prefab");
                //data._NPCPrefab = (GameObject)AssetDatabase.LoadAssetAtPath(pathRes, typeof(GameObject));

                tempList.Add(data);
            }

            CreateNPCSpecialConfigDataBase(tempList);
        }
    }
Exemple #3
0
        void SetLocalButtonAttribute(SMsgInteractCOMMONPackage sMsgInteractCOMMONPackage)//设置每个按钮的属性
        {
            SMsgInteractCOMMONBtn_SC[] BtnListAttribute = sMsgInteractCOMMONPackage.sMsgInteractCOMMONBtn_SC;
            for (int i = 0; i < BtnListAttribute.Length; i++)
            {
                if (m_buttonList[i] != null)
                {
                    switch (BtnListAttribute[i].byBtnType)
                    {
                    case 1:
                        NPCSpecialConfigData nSCData = NPCConfigManager.Instance.NPCSpecialConfigList.FirstOrDefault(P => P._NPCID == sMsgInteractCOMMONPackage.sMsgInteractCOMMON_SC.dwNPCID &&
                                                                                                                     P.Parameters == BtnListAttribute[i].dwParam2);

                        TraceUtil.Log("查找ButtonID:" + BtnListAttribute[i].dwParam2);
                        //m_buttonList[i].SetButtonText(LanguageTextManager.GetString(nSCData._FunctionDesc));
                        if (nSCData != null)
                        {
                            m_buttonList[i].InitButton(nSCData.ShopIcon, nSCData.ShopTitle);
                            m_buttonList[i].SetCallBackFuntion(OnSpecialButtonTapped, BtnListAttribute[i]);
                        }
                        break;

                    case 2:
                        m_buttonList[i].SetButtonText("2,任务");
                        break;

                    case 3:
                        m_buttonList[i].SetButtonText("3,GM");
                        m_buttonList[i].InitButton("", "");
                        m_buttonList[i].SetCallBackFuntion(OnGMButtonTapped, null);
                        break;

                    default:
                        break;
                    }
                }
            }
        }