本文整理汇总了C#中GameManager.SettingPlayers方法的典型用法代码示例。如果您正苦于以下问题:C# GameManager.SettingPlayers方法的具体用法?C# GameManager.SettingPlayers怎么用?C# GameManager.SettingPlayers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameManager
的用法示例。
在下文中一共展示了GameManager.SettingPlayers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start()
{
gameManager = GameObject.Find("GameManager").GetComponent<GameManager>();
GameObject rightUser = GameObject.Find("rightUser").gameObject;
GameObject leftUser = GameObject.Find("leftUser").gameObject;
is_right_user = true;
if(is_right_user)
{
rightUser.AddComponent<Player1>();
leftUser.AddComponent<Player2>();
player1 = rightUser.GetComponent<Player1>();
player2 = leftUser.GetComponent<Player2>();
player1.is_right_user = true;
player2.is_right_user = false;
player = rightUser;
}
else
{
rightUser.AddComponent<Player2>();
leftUser.AddComponent<Player1>();
player1 = leftUser.GetComponent<Player1>();
player2 = rightUser.GetComponent<Player2>();
player1.is_right_user = false;
player2.is_right_user = true;
player = leftUser;
}
gameManager.SettingPlayers();
touchFrame = new TouchFrame();
bt_left = GameObject.Find("leftButton");
bt_right = GameObject.Find("rightButton");
joystick_bar = GameObject.Find("Joystick");
joystick_bg = GameObject.Find("Joystick_background");
bt_spike = GameObject.Find("Joystick_spikeButton");
sprite_bt_left = GameObject.Find("leftButton").GetComponent<tk2dSprite>();
sprite_bt_right = GameObject.Find("rightButton").GetComponent<tk2dSprite>();
touchEffect = GameObject.Find("TouchMotionEffect").GetComponent<TouchMotionEffect>();
if(controller != TouchControllerType.BUTTON)
{
GameObject.DestroyObject(bt_left as Object);
GameObject.DestroyObject(bt_right as Object);
}
if(controller != TouchControllerType.JOYPAD)
{
GameObject.DestroyObject(bt_spike as Object);
GameObject.DestroyObject(joystick_bg as Object);
GameObject.DestroyObject(joystick_bar as Object);
}
cam = GameObject.Find("VollyBallCamera").GetComponent<tk2dCamera>();
SetJoyPadPos();
}