コード例 #1
0
ファイル: RowGenerator.cs プロジェクト: nsragow/Wrench
    private void PrintRowAt(Vector3 bottomLeft)
    {
        float width  = 0f;
        float height = 0f;


        float x = 0f;
        float y = 0f;
        float z = 0f;

        for (int i = 0; i < perRow; i++)
        {
            GameObject tile = poolManager.get();
            if (tile.GetComponent <SpriteScaler>() == null)
            {
                ///tile.AddComponent<SpriteScaler>().Scale(perRow);
                screwSpawner.PopulateScaledTile(tile, screwPrefab);
            }
            width  = tile.GetComponent <SpriteRenderer>().bounds.size.x;
            height = tile.GetComponent <SpriteRenderer>().bounds.size.x;

            x = bottomLeft.x + (width * i);
            y = bottomLeft.y;
            z = bottomLeft.z;


            tile.transform.position = new Vector3(x, y, 0);


            borderDetector.Track(tile);
// tile.SetActive(true);
            tile.GetComponent <Returnable>().PingMePlease(GetComponent <Pingable>());
        }

        x = bottomLeft.x;
        y = bottomLeft.y + (height);
        z = bottomLeft.z;
        nextBottomLeft = new Vector3(x, y, z);
    }