Beispiel #1
0
    public void DoSpawnAsteroid(AsteroidController prefab, float low, float high)
    {
        Vector2 orbit = new Vector2(0, Random.Range(low, high)).Rotate(Random.Range(0, 359));
        Vector2 trace = new Vector2(orbit.y, -orbit.x).normalized *300;

        prefab.PrefabInstantiate(Planet, (Vector2)Planet.transform.position + orbit, (Vector2)Planet.transform.position + trace);
    }