Подскажите, пожалуйста, возможно ли с помощью аналогичного кода:
Синтаксис:
Используется csharp
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void Start() {
Texture2D texture = new Texture2D(128, 128);
GetComponent<Renderer>().material.mainTexture = texture;
for (int y = 0; y < texture.height; y++) {
for (int x = 0; x < texture.width; x++) {
Color color = ((x & y) != 0 ? Color.white : Color.gray);
texture.SetPixel(x, y, color);
}
}
texture.Apply();
}
}
using System.Collections;
public class ExampleClass : MonoBehaviour {
void Start() {
Texture2D texture = new Texture2D(128, 128);
GetComponent<Renderer>().material.mainTexture = texture;
for (int y = 0; y < texture.height; y++) {
for (int x = 0; x < texture.width; x++) {
Color color = ((x & y) != 0 ? Color.white : Color.gray);
texture.SetPixel(x, y, color);
}
}
texture.Apply();
}
}
задать объекту texture изначально прозрачную текстуру, не проходясь циклом по каждому пикселю?