|
下面是我的截图:
unity3d的代码:
if (m_locaPixellArray != null && m_locaPixellArray.Length > 0)
{
Texture2D.Destroy(localUserTexture);
localUserTexture = new Texture2D(bitMapLocalWeight, bitMapLocalHeight, TextureFormat.RGB24, true);
Color[] colors = new Color[bitMapLocalWeight * bitMapLocalHeight];
for (int i = 0; i < colors.Length; i++)
{
colors.r = m_locaPixellArray[3 * i] / 255f;
colors.g = m_locaPixellArray[3 * i + 1] / 255f;
colors.b = m_locaPixellArray[3 * i + 2] / 255f;
colors.a = 1;
}
localUserTexture.SetPixels(colors);
localUserTexture.Apply();
}
|
|