本文整理汇总了C#中PlayerType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerType.ToString方法的具体用法?C# PlayerType.ToString怎么用?C# PlayerType.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerType
的用法示例。
在下文中一共展示了PlayerType.ToString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddNewPlayerAsChildAndDisable
private void AddNewPlayerAsChildAndDisable(PlayerType type)
{
GameObject player = (GameObject) Instantiate(Resources.Load("Players" + "/" + type.ToString()));
player.transform.parent = transform;
player.transform.localPosition = Vector3.zero;
player.SetActive(false);
playerHT[type] = player;
}
示例2: GetPlayerPrefab
public static GameObject GetPlayerPrefab(PlayerType type)
{
string path = string.Empty;
path = System.IO.Path.Combine("Prefabs", "Player");
path = System.IO.Path.Combine(path, "Player_" + type.ToString()).Replace("\\", "/");
GameObject go = GetPrefab(path);
return go;
}
示例3: PlayerEntity
/// <summary>
/// Constructs a new player in the defult position.
/// </summary>
/// <param name="playerType">Type of player selected.</param>
public PlayerEntity(PlayerType playerType)
: base("Player" + playerType.ToString(), InitBounding(new Point(270, 430), playerType), 1)
{
_playerType = playerType;
_grazebox = InitGrazeBox(Hitbox.Centroid, playerType);
_cannonAux = 0;
_cannonMain = 0;
_cooldown = 0;
}
示例4: GetPlayer
private static Player GetPlayer(PlayerType playerType, string config)
{
switch (playerType)
{
case PlayerType.Human: return new HumanPlayer();
case PlayerType.Computer: return new ComputerPlayer((AILevel)Enum.Parse(typeof(AILevel), config));
case PlayerType.Network:
ChessConnection cnn;
if (string.IsNullOrEmpty(config))
cnn = new Server();
else
cnn = new Client(System.Net.IPAddress.Parse(config));
return new NetworkPlayer(cnn);
}
throw new NotSupportedException(playerType.ToString());
}
示例5: PlayerTypeToString
///////////////////////////////////////////////////////////////////////////////////////
// Static Methods
///////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Get a string that can be displayed from a PlayerType
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public static string PlayerTypeToString(PlayerType type)
{
string playerTypeString;
switch(type)
{
case PlayerType.SmartComputer:
playerTypeString = "Smart Compuer";
break;
default:
playerTypeString = type.ToString();
break;
}
return playerTypeString;
}
示例6: PlayersContextMenu_ItemClicked
private void PlayersContextMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
_playerType = Utilities.ParseEnum<PlayerType>(e.ClickedItem.Name);
Settings.Default.PlayerType = _playerType.ToString();
}
示例7: generateStringCommand
private String generateStringCommand(PlayerType player, int x, int y)
{
return player.ToString() + x.ToString() + y.ToString();
}