当前位置: 首页>>代码示例>>C#>>正文


C# GameManager.SettingPlayers方法代码示例

本文整理汇总了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();
 }
开发者ID:hoon0612,项目名称:Pika,代码行数:51,代码来源:TouchManager.cs


注:本文中的GameManager.SettingPlayers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。