Esempio n. 1
0
    public void Spawn(int randLane, Transform gameLane, Lane lane, int list_num)
    {
        int spawnPoint = Random.Range(1, 4);

        //Transform of rock platform
        var rockSpawnPoint = gameLane.GetChild(spawnPoint);

        GameObject go = Instantiate(objs[list_num], rockSpawnPoint.position, Quaternion.identity, rockSpawnPoint);

        Debris debris = go.GetComponent <Debris>();

        debris.SetLane(randLane);
        debris.debrisDestroyed.AddListener(OnDebrisDestroyed);

        lane.Occupy();
    }