예제 #1
0
    private void GetHighwayPieceLength()
    {
        HighwayPiece highwayPiece = GetHighwayPiece();

        HighwayPieceLength = highwayPiece.GetLength();
        ReturnToQueue(highwayPiece);
    }
예제 #2
0
 private void AddHighwayPieces(int num)
 {
     for (int i = 0; i < num; i++)
     {
         HighwayPiece highwayPiece = Instantiate(_highwayPiece, transform, true);
         highwayPiece.gameObject.SetActive(false);
         _highwayPieces.Enqueue(highwayPiece);
     }
 }
예제 #3
0
    private void SpawnHighway()
    {
        for (float f = ChunkCenter.z - _chunkLength / 2; f + Mathf.Epsilon < ChunkCenter.z + _chunkLength / 2 - _highwayPool.HighwayPieceLength / 2;)
        {
            HighwayPiece highwayPiece = _highwayPool.GetHighwayPiece();
            highwayPiece.transform.position = new Vector3(0, 0, f);
            highwayPiece.gameObject.SetActive(true);
            _highwayPieces.Add(highwayPiece);

            f += _highwayPool.HighwayPieceLength;
        }
    }
예제 #4
0
 public void ReturnToQueue(HighwayPiece highwayPiece)
 {
     _highwayPieces.Enqueue(highwayPiece);
     highwayPiece.gameObject.SetActive(false);
 }