-1

I have a unity scene. I try to display a texture that changes dynamically.

I draw some shape on this texture. How can I do it?

If I use onGUI and Graphics.DrawTexture method, it works too slow on mobile platform.

Fattie
  • 27,874
  • 70
  • 431
  • 719
zakjma
  • 2,030
  • 12
  • 40
  • 81
  • 1
    note, NEVER, EVER use "ongui" (2016). It is deprecated and does not work. (Just use the UI system for your buttons, etc.) You basically use SetPixel to "paint" on textures; google for 1000s of examples. Please search first before asking. – Fattie Jun 04 '16 at 13:02
  • 1
    Possible duplicate of [Unity3D looking for setPixels example to paint with texture in C#](http://stackoverflow.com/questions/21291826/unity3d-looking-for-setpixels-example-to-paint-with-texture-in-c-sharp) – Fattie Jun 04 '16 at 13:02

1 Answers1

1

Use a canvas with an Image attached to it You can apply a texture through there. The OnGUI method is deprecated, try not to use it.

Daniel Jones
  • 115
  • 1
  • 3
  • 10