当前位置: 首页>>代码示例>>C#>>正文


C# PlayerScript.getDeck方法代码示例

本文整理汇总了C#中PlayerScript.getDeck方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerScript.getDeck方法的具体用法?C# PlayerScript.getDeck怎么用?C# PlayerScript.getDeck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PlayerScript的用法示例。


在下文中一共展示了PlayerScript.getDeck方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

    // Use this for initialization
    void Start()
    {
        // Initialize hand display
        GameObject[] card_frames = GameObject.FindGameObjectsWithTag("Hand");
        hand_display = new HandScript[DeckManager.MAX_HAND_SIZE];

        for (int idx = 0; idx < card_frames.Length; ++idx) {
            hand_display[idx] = card_frames[idx].GetComponent<HandScript>();
        }

        musicSlider = GameObject.Find ("Slider");
        UI.GetComponentInChildren<Canvas> ().enabled = false;
        shopCanvas.enabled = false;

        units = new List<UnitScript>();

        // give starting deck specifications
        DeckManager d1 = new DeckManager( new CardScript.CardType[] {CardScript.CardType.Currency1, CardScript.CardType.Currency2, CardScript.CardType.HumanInfantry, CardScript.CardType.HumanTank}, new int[] {7, 2, 2, 1} );
        DeckManager d2 = new DeckManager( new CardScript.CardType[] {CardScript.CardType.Currency1, CardScript.CardType.Currency2, CardScript.CardType.AlienInfantry, CardScript.CardType.AlienTank}, new int[] {7, 2, 2, 1} );

        // player setup
        Player1 = new PlayerScript(d1);
        Player2 = new PlayerScript(d2);
        Player1.getDeck().deck.shuffle();
        Player2.getDeck().deck.shuffle();
        turn = 1;

        getPlayer().getDeck().deal();
        drawCards();

        Map = new MapManager(SceneTransitionStorage.map_width, SceneTransitionStorage.map_height, SceneTransitionStorage.map_type, SceneTransitionStorage.fog);

        // map setup
        Map.generatePseudoRandomMap();

        // place alien base
        turn = 2;
        HexScript hex = Map.hex_at_offset_from(Map.map[0][0], false, false, System.Math.Min(Map.width / 2, Map.height / 2));
        p2Base = placeUnit ( UnitScript.Types.A_Base, (int)hex.position.x, (int)hex.position.y );
        //int unit = 4;
        // place one of each unit
        /*for (int adj_idx = 0; adj_idx < 6; ++adj_idx) {
            HexScript adj_hex = Map.adjacentHexTo(hex, adj_idx);

            if (adj_hex != null && adj_hex.getOccupied() == 0) {
                placeUnit((UnitScript.Types)unit, (int)adj_hex.position.x, (int)adj_hex.position.y );
                ++unit;
            }

            if (unit > 7) { break; }
        }*/

        turn = 1;

        if (Map.FOG_OF_WAR) { Map.fog_of_war(true); }

        // place human base
        hex = Map.hex_at_offset_from(Map.map[Map.width - 1][Map.height - 1], false, false, System.Math.Min(Map.width / 2, Map.height / 2));
        p1Base = placeUnit ( UnitScript.Types.H_Base, (int)hex.position.x, (int)hex.position.y );
        // place one of each unit
        /*unit = 0;
        for (int adj_idx = 0; adj_idx < 6; ++adj_idx) {
            HexScript adj_hex = Map.adjacentHexTo(hex, adj_idx);

            if (adj_hex != null && adj_hex.getOccupied() == 0) {
                placeUnit((UnitScript.Types)unit, (int)adj_hex.position.x, (int)adj_hex.position.y );
                ++unit;
            }

            if (unit > 3) { break; }
        }*/
    }
开发者ID:mtkloepf,项目名称:HGD-Lava,代码行数:73,代码来源:GameManagerScript.cs


注:本文中的PlayerScript.getDeck方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。