本文整理汇总了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; }
}*/
}