Beispiel #1
0
    private void SpawnSeeds()
    {
        float seedsSize  = 5f;
        Seeds seedsClone = (Seeds)Instantiate(seedsPrefab, transform.position, transform.rotation);

        seedsClone.transform.SetParent(seedsParent.transform);
        seedsClone.transform.localPosition = new Vector3(Random.Range(-420f, 420f), seedsParent.transform.position.y, 0f);
        seedsClone.transform.localScale    = new Vector3(seedsSize, seedsSize, 0);
        seedsClone.GetComponent <Rigidbody2D>().velocity = new Vector2(0, Random.Range(-7, -5));
    }