本文整理汇总了C#中PlayerMovement.GetPlayerNum方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerMovement.GetPlayerNum方法的具体用法?C# PlayerMovement.GetPlayerNum怎么用?C# PlayerMovement.GetPlayerNum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerMovement
的用法示例。
在下文中一共展示了PlayerMovement.GetPlayerNum方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DEVTOOLprevPlayer
public void DEVTOOLprevPlayer(PlayerMovement currentPlayer)
{
print("prev player request");
bool switchedPlayer = false;
int prevPlayerNum = currentPlayer.GetPlayerNum() - 1;
do
{
if (prevPlayerNum < 1)
prevPlayerNum = playerMovers.Count;
if (!playerMovers[prevPlayerNum - 1].isControllerConnected())
{
int temp = playerMovers[prevPlayerNum - 1].GetPlayerNum();
playerMovers[prevPlayerNum - 1].SetPlayer(currentPlayer.GetPlayerNum(), developerModeOn);
currentPlayer.SetPlayer(temp, developerModeOn);
switchedPlayer = true;
break;
}
prevPlayerNum--;
}
while (!switchedPlayer);
}
示例2: DEVTOOLnextPlayer
public void DEVTOOLnextPlayer(PlayerMovement currentPlayer)
{
print("next player request");
bool switchedPlayer = false;
int nextPlayerNum = currentPlayer.GetPlayerNum() + 1;
do
{
if (nextPlayerNum > playerMovers.Count)
nextPlayerNum = 1;
if (!playerMovers[nextPlayerNum - 1].isControllerConnected())
{
int temp = playerMovers[nextPlayerNum - 1].GetPlayerNum();
playerMovers[nextPlayerNum - 1].SetPlayer(currentPlayer.GetPlayerNum(), developerModeOn);
currentPlayer.SetPlayer(temp, developerModeOn);
switchedPlayer = true;
break;
}
nextPlayerNum++;
}
while (!switchedPlayer);
}