You need to turn the object in the Unity. In inspector, it can be seen that it is turned around, but this is not noticeable in the camera display, i.e. The material does not rotate with the object. In the code, I first assign the material to the object, and only then turn the following code:
obj.transform.rotation = quaternion.euler (0, 90 * k, 0);
where k is a random number from 0 to 3
Then I tried through:
obj.transform.rotate (0, 90 * k, 0);
But the result is the same
Answer 1
I decided the problem. It turned out that the code is working, and it is necessary only in the object in Inspector to open Static and remove the checkbox there from the BatchTIC component. Everything has earned.