- Home /
How do i use material variables across all scenes?
Hello Community,
i know how to use static variables in order to use floats integers or booleans across all scenes, but how does it work with 'more complex' variables like Material or Texture? At the moment I have a script that is not attacht to any gameobject, but contains a lot of static declarations. but know I would like to have a static array
public static Material[] skin = {?????};
in this script in order to be able to use it everywhere in my project. The only method I know for defining such an array is with drag and drop in the inspector, but I static variables are not shown in the inspector :(. Does anyone know, how I can define this array? (Or another method to use an Material array across all scenes?). I would be really thankful for any answers, jep7
A material and a texture are both resources and can be re-linked as you please. A variable is simply a container, or piece of memory and the Type defines how much memory is allocated. $$anonymous$$aterial and Texture2D are Types and so can be assigned to variables just like ints or bools.
$$anonymous$$ost people tend to use Lists these days
http://answers.unity3d.com/questions/24289/is-it-possible-to-show-static-variables-in-the-ins.html
Your answer
Follow this Question
Related Questions
Is there a way to edit a static variable 2 Answers
Accesing instantiated gameobjects from another script 2 Answers
static var problemme 0 Answers
Advice on static variables and object references 1 Answer
GetComponent for all enemies 1 Answer