Exemplo n.º 1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         SendToStart sendToStartScript = other.GetComponent <SendToStart>();
         sendToStartScript.SendHome();
     }
 }
Exemplo n.º 2
0
    public void Restart()
    {
        timer.playtime = 0;
        Rigidbody gbrb = gameboard.GetComponent <Rigidbody>();

        gbrb.transform.localRotation = Quaternion.identity;
        foreach (Transform spawnpoint in spawnPoints)
        {
            GameObject  newSphere      = Instantiate(PlayerSpherePrefab, spawnpoint);
            SendToStart sendHomeScript = newSphere.GetComponent <SendToStart>();
            if (sendHomeScript != null)
            {
                sendHomeScript.SendHome();
            }
        }
    }