static ArrayList fnLoadFile(eResBundle eID, string path) { //BKTools.Assetbundle_path + BKTools.Assetbundle_Name_By_Platform + BKTools.bundles_dir[(int)eID] //var ta = BKTools.getBundle(eID).LoadAsset<TextAsset> (path); var ta = BKTools.LoadAsset <TextAsset>(eID, path); var xmlText = ta.text; ArrayList t_aArrayList = new ArrayList(); // 容器 string[] arrs = xmlText.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries); foreach (string str in arrs) { t_aArrayList.Add(str); } return(t_aArrayList); }
//下棋 virtual public Chess setChess(int card_id, ePlayer card_belong, ChessContainer t_grid, BKKZ.POW01.AI.eAI_Type ai_type, bool trigger_shokan_skill, int shoukan_event, int event_sequence) { //TODO 后期加入召唤参数,如果是强制召唤才能把当前格子上的骑士顶开 if (t_grid.my_chess != null) { t_grid.my_chess.KickAway(); } //分支 pve玩家召唤时有可能是第二次召唤 bool need_new = true; long chessid = 0; if (Main.Inst.lv_ctrl.map_data.my_type == eMapType.PvE_Mult || Main.Inst.lv_ctrl.map_data.my_type == eMapType.PvE_Solo) { chessid = Chess.genarateChessID(card_id, (int)card_belong, shoukan_event, event_sequence); need_new = !Main.Inst.dic_chess.ContainsKey(chessid); } Chess the_chess = null; if (need_new) { //创建棋子 the_chess = Instantiate(BKTools.LoadAsset <GameObject>(eResBundle.Prefabs, PrefabPath.Chess)).GetComponent <Chess>(); the_chess.attribute.card_id = card_id; the_chess.belong = card_belong; the_chess.owner = card_belong; the_chess.MouseDown = Main.Inst.MouseDownOnChess; the_chess.MouseUp = Main.Inst.MouseUpOnChess; //召唤信息——对应事件——玩家为-1 the_chess.shoukan_event = shoukan_event; //事件ID确认后可以获得事件序号 the_chess.shoukan_event_sequence = event_sequence; //初始化数据 the_chess.initData(); //初始化图片 the_chess.initImage(); Main.Inst.dic_chess.Add(the_chess.ChessID, the_chess); //创建AI if (card_belong < ePlayer.Player1 || card_belong > ePlayer.Player4) { BKKZ.POW01.AI.MonsterAI.createMonsterAI(the_chess.ChessID, ai_type); } } else { the_chess = Main.Inst.dic_chess[chessid]; the_chess.gameObject.SetActive(true); } t_grid.appendChess(the_chess); //召唤技能 if (trigger_shokan_skill) { the_chess.ShouKanSkillAndPincer(); } //驱散迷雾 //BKTools.FogLift(newchess.container.number, newchess.attribute.spd + GameRule.Default_PvE_Fog_Lift_Range, GameRule.Default_PvE_Fog_Lift_Range, new int[] { (int)newchess.belong }); // Main.Instance.b_setchess = true; // Main.Instance.now_phase = ePhase.Battle; // Main.Instance.b_phase_trigger = true;//从战斗阶段往主要阶段2 // 只有主流会耗卡 if (Main.Inst.now_turnphase.myType == ePhaseType.Main1) { UseHandCard(); } if (Main.Inst.now_turnphase.myType != ePhaseType.Drama) { CheckMoveEvent(the_chess, nextPhaseDefault); } return(the_chess); }