Tuesday, April 16, 2024
HomeSample Page

Sample Page Title


I want to know some higher coding patterns to load belongings based mostly on participant settings. Say that customers are allowed to pick out 1 of many skins for a weapon. Now after I load that weapon object, I would like the belongings for that pores and skin to be loaded as an alternative of the default.

My query is: what is an efficient coding sample to retailer the person’s pores and skin alternative, and to learn/use this saved knowledge to programmatically load a prefab or texture later?

Right now, what I’ve is a scroll view with buttons that present every distinctive pores and skin. When the button is pressed, it saves the pores and skin texture’s file identify to JSON. Then, later, after I wish to work out what to make use of, I learn that subject from JSON and name Resources.Load() on the file identify.

Is there a greater method to do that? This could be very guide and error inclined since I’ve to specify the feel’s file identify in my code for every button. Right now I’m making an attempt to seize the feel’s file identify by way of Image.sprite.identify, however this additionally has a degree of guide work concerned. It requires realizing which subdirectory of the Resources folder the sprite is in.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments