private void Start()
        {
            poolManager = PoolSystem.PoolManager.Instance;

            Vector3 pos = (transform.position + offset);

            lastY = pos.y;

            poolManager.Spawn(prefabIdentificator, pos, Quaternion.identity);

            for (int i = 0; i < preSpawnOnStart; i++)
            {
                Vector3 newPos = pos;
                newPos.y -= distance * (i + 1);
                Instantiate(preSpawnPrefab, newPos, Quaternion.identity);
            }
        }
Example #2
0
 private void Start()
 {
     poolManager       = PoolSystem.PoolManager.Instance;
     countdown         = 0;
     percentPerRoadway = new RandomWeights(road.RoadwaysCount);
 }