|
I have script that create GameObject. What i want:
I need a c# solution.
(comments are locked)
|
|
Everything expect texture: anotherplayer.renderer.material = new Material (Shader.Find("Transparent/VertexLit")); anotherplayer.renderer.material.mainTexture = Resources.Load("Sasuke", typeof(Texture2D)) as Texture2D; Texture
Mar 28 '10 at 12:35 AM
Andrew Cherkashin
(comments are locked)
|
|
For assigning a texture to the object, I believe you can use the following (Javascript) placed on the object in question:
A similar forum post and the Unity Scripting Reference. I don't know C# unfortunately but this post would seem to suggest you can use a similar line like the following:
Hope that helps. okey, but what's value of mytexture?
Mar 24 '10 at 05:37 AM
Andrew Cherkashin
Sorry for the tardy reply, you've probably worked it out by now, but incase you haven't: 'myTexture' is a variable for storing a reference to the texture you want to put on the object. In the example, the JS one at least, it should show in the Inspector and allow you to choose a texture by dragging it into the slot.
Mar 28 '10 at 06:59 PM
straydogstrut
(comments are locked)
|

Your question could have been made more general by splitting it up into simpler questions. Please see this section in the faq: Break multi-part problems into simpler questions.