Adding model in runtime

I have some models from warcraft3 converted into 3ds and I need to assing it to mine default object (cube with collider and mesh). How can I do that?

P.S.: C# examples are welcome.

"and I need to assing it to mine default object" ?? Sorry I have no idea what that means. Please edit your question and explain better.

The size \ length of an array can't be changed. Once created the size of an array will be constant. If you need to change it you have to create a new array and copy the old elements over. You can use System.Array.Resize which does that for you. However when you frequently need to add \ remove elements you might want to use a generic List instead. Next time when you have a question you should ask a question and not necropost such an old question with a comment

2 Answers

2

http://unity3d.com/support/documentation/ScriptReference/Resources.Load.html

Facepalm the explanation of your question leaves a lot to be desired. If you want a good answer you need to ask a good question.

To be honest, I have really no idea what you are trying to do here, but I’ll give it a bash. (Also, I’m terrible with C#, so I’ll give you an example in JScript and you can convert … that is if it has anything to with what you want to do):

function Start () {
var mesh : Mesh = GetComponent(MeshFilter).mesh;
mesh = Resources.Load("foo"); //You will need to replace foo with the name of your mesh
}

I think that should work. Needs to be assigned to your ‘default object’. Created on fly so I can’t be sure if it will work!

Klep