New Facebook game using Unity Web Player.

We’ve just released our first Unity game (also using NGUI) on Facebook. It is free to play, so take a look if you have a minute. It is a solitaire-based multiplayer game. It should be fairly easy to understand, but a tutorial is coming soon.

CLICK HERE TO PLAY

It’s been great working with Unity and NGUI. We’re really excited to get this game to market and Unity has made that far easier for us. If there are any questions about the tech I’d be happy to answer.

Main Menu:

In-Game:

  • John Rush

looks good, how do you get facebooks faces on the page like that?

I’m not sure which part you are interested in, so here is the quick overview.

You can retrieve an image through the normal Facebook API (GET request using WWW). That will return a byte array with the image data in it. Once you have the image data you can create a new Texture2D and call LoadImage() with the bytes you got back from Facebook. With that, you can create a new material and set material.mainTexture to the Texture2D with the image.

Then you just have to render that material somewhere. We are using NGUI, so we use a UITexture and set it’s “mainTexture” equal to the newly created texture.

To recap: URL → byte[ ] → Texture2D → Material → UITexture

Let me know if you have any other questions.