Пример #1
0
    public void Loading()
    {
        int i;

        prfb = (GameObject)Resources.Load("Card/Card_controller");                                                          //预设资源获取
        for (i = 0; i < trans.p_amt; i++)                                                                                   //加载玩家方的卡牌实体并入队
        {
            temporary = (GameObject)Instantiate(prfb);                                                                      //加载预设生成实体
            temporary.SetActive(true);
            temporary.GetComponent <Transform>().position = new Vector2(-17.8f + (i + 1) * 35.6f / (trans.p_amt + 1), -5f); //定位
            cc = temporary.GetComponent <Card_controller>();
            //加载乱七八糟的信息
            cc.Set_lct(temporary.GetComponent <Transform>().position);
            cc.Gs_type          = 0;
            cc.Gs_order         = i;
            cc.Gs_eternal_order = i;
            cc.Gs_ctype         = Deep_copy(trans.ci.card_information[trans.Get_card(i)]);
            player_queue.Add(temporary);  //加入玩家队列
        }
        for (i = 0; i < trans.e_amt; i++) //加载敌人的卡牌实体并入队
        {
            temporary = (GameObject)Instantiate(prfb);
            temporary.SetActive(true);
            temporary.GetComponent <Transform>().position = new Vector2(-17.8f + (i + 1) * 35.6f / (trans.e_amt + 1), 5f);
            cc = temporary.GetComponent <Card_controller>();
            cc.Set_lct(temporary.GetComponent <Transform>().position);
            cc.Gs_type          = 1;
            cc.Gs_order         = i;
            cc.Gs_eternal_order = i;
            cc.Gs_ctype         = Deep_copy(trans.ci.card_information[trans.Get_enemy(i)]);
            enemy_queue.Add(temporary);
        }
    }
Пример #2
0
    public void Loading()
    {
        int i;

        prfb = (GameObject)Resources.Load("Card/Card_controller");
        for (i = 0; i < trans.p_amt; i++)//加载玩家的卡牌实体并入队
        {
            temporary = (GameObject)Instantiate(prfb);
            temporary.SetActive(true);
            temporary.GetComponent <Transform>().position = new Vector2(-17.8f + (i + 1) * 35.6f / (trans.p_amt + 1), -5f);
            cc = temporary.GetComponent <Card_controller>();
            cc.Set_lct(temporary.GetComponent <Transform>().position);
            cc.Gs_type     = 0;
            cc.Gs_id       = trans.ci.card_information[trans.Get_card(i)].ID;
            cc.Gs_describe = trans.ci.card_information[trans.Get_card(i)].Describe;
            cc.Gs_level    = trans.ci.card_information[trans.Get_card(i)].Level;
            cc.Gs_atk      = trans.ci.card_information[trans.Get_card(i)].ATK;
            cc.Gs_hp       = trans.ci.card_information[trans.Get_card(i)].HP;
            cc.Gs_order    = i;
            player_queue.Add(temporary);
        }
        for (i = 0; i < trans.e_amt; i++)//加载敌人的卡牌实体并入队
        {
            temporary = (GameObject)Instantiate(prfb);
            temporary.SetActive(true);
            temporary.GetComponent <Transform>().position = new Vector2(-17.8f + (i + 1) * 35.6f / (trans.e_amt + 1), 5f);
            cc = temporary.GetComponent <Card_controller>();
            cc.Set_lct(temporary.GetComponent <Transform>().position);
            cc.Gs_type     = 1;
            cc.Gs_id       = trans.ci.card_information[trans.Get_enemy(i)].ID;
            cc.Gs_describe = trans.ci.card_information[trans.Get_enemy(i)].Describe;
            cc.Gs_level    = trans.ci.card_information[trans.Get_enemy(i)].Level;
            cc.Gs_atk      = trans.ci.card_information[trans.Get_enemy(i)].ATK;
            cc.Gs_hp       = trans.ci.card_information[trans.Get_enemy(i)].HP;
            cc.Gs_order    = i;
            enemy_queue.Add(temporary);
        }

        //Locate(player_queue,-5f);
        //Locate(enemy_queue,5f);
    }