示例#1
0
    private void PlaceRowOfScenery(int row, int rowShift)
    {
        var sceneryObject = PillarTileChunkScenery.GenerateRow(row);

        sceneryObject.transform.parent        = transform;
        sceneryObject.transform.eulerAngles   = transform.eulerAngles;
        sceneryObject.transform.localPosition = new Vector3(rowShift * 5, 0, row * 10f);
    }
    int fakeRowIndex = 0; // fujky

    public TrackRow GetRow(int rowIndex)
    {
        UpdateGeneratorForRow(rowIndex);

        var row = currentGenerator.PlaceRow(rowIndex);

        if (rowIndex % Mathf.CeilToInt(5f / currentGenerator.sideSize) == 0)
        {
            var sceneryObject = PillarTileChunkScenery.GenerateRow(fakeRowIndex++);
            sceneryObject.transform.parent   = row.transform;
            sceneryObject.transform.position = row.transform.position;
            // sceneryObject.transform.eulerAngles = row.transform.eulerAngles;

            // sceneryObject.SetColor(palette3.Get3Colors(rowIndex)[1]);
        }

        return(row);
    }