本文整理汇总了C#中InControl.InputDevice.Vibrate方法的典型用法代码示例。如果您正苦于以下问题:C# InputDevice.Vibrate方法的具体用法?C# InputDevice.Vibrate怎么用?C# InputDevice.Vibrate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InControl.InputDevice
的用法示例。
在下文中一共展示了InputDevice.Vibrate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: buttonClicked
// Map controllers to players
void buttonClicked(InputDevice player,int playerIndex)
{
player.Vibrate(.2f, .2f);
StartCoroutine("vibrateControllerStop", player);
if (player.Action2.WasPressed)
{
buttonList[0].GetComponent<Image>().color = new Color32(50, 50, 50, 255);
buttonList[0].GetComponentInChildren<Text>().enabled = false;
buttonsSet[0] = true;
Main.S.carTop.GetComponent<ArcadeVehicle>().first = playerIndex;
}
else if (player.Action1.WasPressed)
{
buttonList[1].GetComponent<Image>().color = new Color32(50, 50, 50, 255);
buttonList[1].GetComponentInChildren<Text>().enabled = false;
buttonsSet[1] = true;
Main.S.carTop.GetComponent<ArcadeVehicle>().second = playerIndex;
}
else if (player.Action4.WasPressed)
{
buttonList[2].GetComponent<Image>().color = new Color32(50, 50, 50, 255);
buttonList[2].GetComponentInChildren<Text>().enabled = false;
buttonsSet[2] = true;
Main.S.carBottom.GetComponent<ArcadeVehicle>().first = playerIndex;
}
else if (player.Action3.WasPressed)
{
buttonList[3].GetComponent<Image>().color = new Color32(50, 50, 50, 255);
buttonList[3].GetComponentInChildren<Text>().enabled = false;
buttonsSet[3] = true;
Main.S.carBottom.GetComponent<ArcadeVehicle>().second = playerIndex;
}
countSet++;
// If all connected devices have chosen a team prompt for start of game
if (countSet == InputManager.Devices.Count)
{
text.GetComponent<Text>().text = "Press Any Button To Continue";
for (int i = 0; i < buttonsSet.Count; i++)
{
if (buttonsSet[i] == false)
{
if (i == 0 && buttonsSet[i + 1] == true)
{
Main.S.carTop.GetComponent<ArcadeVehicle>().first = Main.S.carTop.GetComponent<ArcadeVehicle>().second;
}
else if (i == 1 && buttonsSet[i - 1] == true)
{
Main.S.carTop.GetComponent<ArcadeVehicle>().second = Main.S.carTop.GetComponent<ArcadeVehicle>().first;
}
else if (i == 2 && buttonsSet[i + 1] == true)
{
Main.S.carBottom.GetComponent<ArcadeVehicle>().first = Main.S.carBottom.GetComponent<ArcadeVehicle>().second;
}
else if (i == 3 && buttonsSet[i - 1] == true)
{
Main.S.carBottom.GetComponent<ArcadeVehicle>().second = Main.S.carBottom.GetComponent<ArcadeVehicle>().first;
}
}
}
cooldown = Time.realtimeSinceStartup;
}
}
示例2: vibrateControllerStop
IEnumerator vibrateControllerStop(InputDevice player)
{
float pauseEndTime = Time.realtimeSinceStartup + .2f;
while (Time.realtimeSinceStartup < pauseEndTime)
{
yield return 0;
}
player.Vibrate(0, 0);
}