- Home /
Applying Theme to game ?
1) So here i am dealing with a problem to apply some materials to my gameobjects at runtime. i mean from start menu when i select some bunch of colors then in next scene my gameobjects will change to that color. So its a theme. ( Is there any other way ? Please mention ) But i have no idea as to which how i should implement this.
2) Moreover, Please write some description about what things are retain when we change from one scene to another. Recently i learned that to pass numeric score from one scene to another i should use PlayerPrefs. So are there any similar concepts which may cause me trouble when i change scene.
to pass data from one scene to another, you may:
a) create a static class with static members - it will keep it's state when you unload/load scenes.
b) or you can call DontDestroyOnLoad from anywhere in your script attached to GameObject - and from this moment you GameObject will not be destroyed when you loading new scene.
speaking about themes - you can change only diffuse colors - in this case all you need to apply scheme - is to change diffuse colors, not necessarily to apply materials.
Or you can change textures (ar even all materials). It will be more difficult and ineffecient for FPS, but it would give to you much more freedom in makng new themes.
As for me - I'd recommend to start with first way.
Beautiful and precise answer @hav_ngs_ru thank you so much. will work on first way.
Your answer
Follow this Question
Related Questions
Rendering objects into another camera with a different material in HDRP 0 Answers
How to know if my Shader Graph is supported by the SRP Batcher? 1 Answer
Using materials as effects bad practice? 0 Answers
Visual/Texture anomoly .... Never seen this before, image attached 1 Answer
How to save emissive Material assets using "_EMISSION" keyword by script? 1 Answer