Exemplo n.º 1
0
 void Start()
 {
     JumpTime = MaxJumpTime;
     if (PlayerPrefs.GetInt("esHost") == 1)
     {
         GameObject playerGameObj = GameObject.Find("socketController1");
         if (playerGameObj != null)
         {
             socketController_1 = playerGameObj.GetComponent <socketController1>();
         }
     }
     else
     {
         GameObject playerGameObj = GameObject.Find("socketController2");
         if (playerGameObj != null)
         {
             socketController_2 = playerGameObj.GetComponent <socketController2>();
         }
     }
 }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     // Random direction
     rigidbody2D.velocity = new Vector2(0, 0) * speed;
     if (PlayerPrefs.GetInt("esHost") == 1)
     {
         GameObject playerGameObj = GameObject.Find("socketController1");
         if (playerGameObj != null)
         {
             socketController_1 = playerGameObj.GetComponent <socketController1>();
         }
     }
     else
     {
         GameObject playerGameObj = GameObject.Find("socketController2");
         if (playerGameObj != null)
         {
             socketController_2 = playerGameObj.GetComponent <socketController2>();
         }
     }
 }