

The goal for today was to get the planets that needed to be blacked out blacked out while still having access to their original textures. How to do this? First I created a Boolean to keep track of weather the planet was visible or not. That was simple enough, but I ran into problems when I attempted to change the textures based on this variable. I tried several ineffective and weird things like attempting to put references to each and every texture within every planet and only using the applicable ones. This would have required me to put 21 references within each prefab so that would have taken a very long time. Every planet only would need two references so I just decided to use two general names. As you can see by the picture to the right I've created a reference to the texture "none" as well as a reference to a texture "norm". For each planet none is always the file blackbox.jpeg but the reference within norm does vary. The reason for this is so that none can be used when the planet is supposed to be blacked out and "norm" can be used when the planet is its normal color. So far this seems to be working so I shall continue down this route. In other news I also fixed a slight error I didn't know that the game had. Apparently my spawner script was creating six times as many planets and tourists as it needed within the hierarchy so I adjusted the spawn function accordingly. Next class the plan is to (hopefully) attach all the models to the planets and the tourists as well as starting some way of keeping track of the planets that the player owns.
No comments:
Post a Comment