- Home /
non-dynamic asset load?
Hello all! :)
So I want to creat a Mesh array that will be loaded before my game starts.
In other words I want to have a library where my master script will refere to choose which mesh should use from that array, by giving it a seed. So this array should be always ready to use, since it will always have the same items in it.
I thought it would be possible with the Resources class but it is only used during runtime. So how do I make shuch an array??
P.S.: All the meshes I want to use are in my assets folder.
[EDIT]
This array is static and part of a namespace so I can have access to it anytime. There is no gameObject using it.
Answer by tanoshimi · Nov 26, 2016 at 01:56 PM
Declare a public mesh array in your script, and populate it by dragging the meshes into it in the inspector:
public Mesh[] meshLibrary;
But there is no gameObject that is using the script that has this array. As a library it is part of a namespace, and it is static so I can have access to it anytime. Well, I should have said that to my question, sorry! :/
So make your class a ScriptableObject, not a $$anonymous$$onobehaviour.
ScriptableWhat? Things I dont know! $$anonymous$$nowledge!!! Any good tutorial??