Beispiel #1
0
 // Start is called before the first frame update
 void Start()
 {
     bsc    = bs.GetComponent <Text>();
     wsc    = ws.GetComponent <Text>();
     winner = win.GetComponent <Text>();
     rbb    = new Rigidbody[5];
     rbw    = new Rigidbody[5];
     scb    = new Shoot_Black[5];
     scw    = new Shoot_White[5];
     rbb[0] = B0.GetComponent <Rigidbody>();
     rbb[1] = B1.GetComponent <Rigidbody>();
     rbb[2] = B2.GetComponent <Rigidbody>();
     rbb[3] = B3.GetComponent <Rigidbody>();
     rbb[4] = B4.GetComponent <Rigidbody>();
     rbw[0] = W0.GetComponent <Rigidbody>();
     rbw[1] = W1.GetComponent <Rigidbody>();
     rbw[2] = W2.GetComponent <Rigidbody>();
     rbw[3] = W3.GetComponent <Rigidbody>();
     rbw[4] = W4.GetComponent <Rigidbody>();
     scb[0] = B0.GetComponent <Shoot_Black>();
     scb[1] = B1.GetComponent <Shoot_Black>();
     scb[2] = B2.GetComponent <Shoot_Black>();
     scb[3] = B3.GetComponent <Shoot_Black>();
     scb[4] = B4.GetComponent <Shoot_Black>();
     scw[0] = W0.GetComponent <Shoot_White>();
     scw[1] = W1.GetComponent <Shoot_White>();
     scw[2] = W2.GetComponent <Shoot_White>();
     scw[3] = W3.GetComponent <Shoot_White>();
     scw[4] = W4.GetComponent <Shoot_White>();
     for (int i = 0; i < 5; i++)
     {
         rbb[i].velocity = Vector3.zero;
         rbw[i].velocity = Vector3.zero;
         rbb[i].rotation = Quaternion.Euler(new Vector3(0, 0, 0));
         rbw[i].rotation = Quaternion.Euler(new Vector3(0, 0, 0));
         scb[i].alive    = true;
         scw[i].alive    = true;
     }
     rbb[0].position        = new Vector3(-12.5f, 1f, 13f);
     rbb[1].position        = new Vector3(-6f, 1f, 6.5f);
     rbb[2].position        = new Vector3(-12.5f, 1f, 0f);
     rbb[3].position        = new Vector3(-6f, 1f, -6.5f);
     rbb[4].position        = new Vector3(-12.5f, 1f, -13f);
     rbw[0].position        = new Vector3(12.5f, 1f, -13f);
     rbw[1].position        = new Vector3(6f, 1f, -6.5f);
     rbw[2].position        = new Vector3(12.5f, 1f, 0f);
     rbw[3].position        = new Vector3(6f, 1f, 6.5f);
     rbw[4].position        = new Vector3(12.5f, 1f, 13f);
     turnnum                = 0;
     win.transform.position = new Vector3(Screen.width / 2, Screen.height + 500, 0);
 }