I am completely new to Unity 3D. I own the free version. For my first project, I am trying to make a MineCraft like clone. I followed tutorials, but now i'm trying to change something so it works how I want it. First off, how can I place a cube with a texture on it? Here's a chunk of code where I need to be able to do this:
This spawns a default cube with no texture whatsoever. How do I get a texture?
Here is my entire code ( I followed tutorials, so I shouldn't be saying mine):
The question has been closed Jun 02 '12 at 01:49 AM by Eric5h5 for the following reason:
This should already work if Dirt.png can be found. However, note that Resources.Load is an expensive function. You must call only when you really have to and certainly not several times for the same resource. declare a Texture2D in your script and set it up in the inspector or, if you really can't do otherwise, call Load at Start and store the value.
Now that we worked that out, it appears that minecraft worlds are not thousands of cube, 24 vertices and all that stuff. I've never looked into it, but it seems more complicated than that. Usefull documentation :
answered Jun 02 '12 at 01:44 AM