Пример #1
0
    void SpawnVinylPlayer()
    {
        var         playerCollider = Player.GetComponent <CapsuleCollider>();
        RespawnArea area;

        do
        {
            // The enemies cannot spawn on the same area as the player
            var i = Random.Range(0, SpawnPoints.Length);
            area = SpawnPoints[i];

            //} while (area.Intersect(playerCollider.bounds));
        } while (!area.IsAvailable);

        Instantiate(Enemy, area.RandomPosition(), Enemy.transform.rotation);
        Instantiate(Enemy, area.RandomPosition(), Enemy.transform.rotation);

        score++;
        Score.text = string.Format("Score: {0}", score);
    }