//создать список всех камней в первую итерацию static void find_stones(int[,] Initboard, ArrayList st) { stone newstone = new stone(); for (int i = 0; i <= 10; ++i) { for (int j = 0; j <= 10; ++j) { if (Initboard[i, j] == 1) { newstone.x = i; newstone.y = j; newstone.owner = 1; st.Add(newstone); } if (Initboard[i, j] == 2) { newstone.x = i; newstone.y = j; newstone.owner = 2; st.Add(newstone); } } } }
// Start is called before the first frame update void Start() { //初始化对象 //山和云的对象 LB_11 = GameObject.FindWithTag("BackGround_11").GetComponent <LoopBack>(); LB_12 = GameObject.FindWithTag("BackGround_12").GetComponent <LoopBack>(); LB_13 = GameObject.FindWithTag("BackGround_13").GetComponent <LoopBack>(); LB_21 = GameObject.FindWithTag("BackGround_21").GetComponent <LoopBack>(); LB_22 = GameObject.FindWithTag("BackGround_22").GetComponent <LoopBack>(); LB_23 = GameObject.FindWithTag("BackGround_23").GetComponent <LoopBack>(); LB_31 = GameObject.FindWithTag("BackGround_31").GetComponent <LoopBack>(); LB_32 = GameObject.FindWithTag("BackGround_32").GetComponent <LoopBack>(); LB_33 = GameObject.FindWithTag("BackGround_33").GetComponent <LoopBack>(); LB_41 = GameObject.FindWithTag("BackGround_41").GetComponent <LoopBack>(); LB_42 = GameObject.FindWithTag("BackGround_42").GetComponent <LoopBack>(); LB_43 = GameObject.FindWithTag("BackGround_43").GetComponent <LoopBack>(); LB_51 = GameObject.FindWithTag("BackGround_51").GetComponent <LoopBack>(); LB_52 = GameObject.FindWithTag("BackGround_52").GetComponent <LoopBack>(); LB_53 = GameObject.FindWithTag("BackGround_53").GetComponent <LoopBack>(); LB_61 = GameObject.FindWithTag("BackGround_61").GetComponent <LoopBack>(); LB_62 = GameObject.FindWithTag("BackGround_62").GetComponent <LoopBack>(); LB_63 = GameObject.FindWithTag("BackGround_63").GetComponent <LoopBack>(); //树林的对象 LBFT_11 = GameObject.FindWithTag("small_1").GetComponent <LoopBackForTree>(); LBFT_12 = GameObject.FindWithTag("middle_1").GetComponent <LoopBackForTree>(); LBFT_13 = GameObject.FindWithTag("big_1").GetComponent <LoopBackForTree>(); LBFT_21 = GameObject.FindWithTag("small_2").GetComponent <LoopBackForTree>(); LBFT_22 = GameObject.FindWithTag("middle_2").GetComponent <LoopBackForTree>(); LBFT_23 = GameObject.FindWithTag("big_2").GetComponent <LoopBackForTree>(); //地面的对象 LFG_11 = GameObject.FindWithTag("ground_1").GetComponent <LoopForGround>(); LFG_12 = GameObject.FindWithTag("ground_11").GetComponent <LoopForGround>(); LFG_21 = GameObject.FindWithTag("ground_2").GetComponent <LoopForGround>(); LFG_22 = GameObject.FindWithTag("ground_22").GetComponent <LoopForGround>(); //小麦的对象 wh = GameObject.FindWithTag("wheat").GetComponent <wheat>(); //黄河的对象 mR = GameObject.FindWithTag("river").GetComponent <moveRiver>(); //河里的水的对象 RMD = GameObject.FindWithTag("water").GetComponent <RiverMoveDown>(); // sT = GameObject.FindWithTag("stone").GetComponent <stone>(); sT_2 = GameObject.FindWithTag("stone_2").GetComponent <stone>(); // th_1 = GameObject.FindWithTag("thorns_1").GetComponent <thorns>(); th_2 = GameObject.FindWithTag("thorns_2").GetComponent <thorns>(); // mU = GameObject.FindWithTag("peach").GetComponent <moveUp>(); }