// Create a black texture with a size of 800x600
dotTexture = new Texture2D(800, 600);
Color[] colors = dotTexture.GetPixels();
for (int i = 0; i < colors.Length; i++)
colors[i] = Color.black;
dotTexture.SetPixels(colors);
dotTexture.Apply();
dotMaterial.mainTexture = dotTexture; // Set the texture to the material
Я вижу материал и текстуру альбедо материала. Но эта текстура не применяется.
Что я делаю не так?
Я пытаюсь создать черную текстуру в Unity для материала, но она не отображается [code] // Create a black texture with a size of 800x600 dotTexture = new Texture2D(800, 600); Color[] colors = dotTexture.GetPixels(); for (int i = 0; i < colors.Length; i++) colors[i] = Color.black; dotTexture.SetPixels(colors); dotTexture.Apply();
dotMaterial.mainTexture = dotTexture; // Set the texture to the material [/code] Я вижу материал и текстуру альбедо материала. Но эта текстура не применяется. Что я делаю не так?