понедельник, 16 марта 2015 г.

Unity and prefab connection problems

I wonder why my new game with sounds work well in Unity and failed as standalone one.

After investigation I found, that Unity when running in editor ignores missing sound (and C# query to them), but in standalone it generates NullPointer exceptions.

Improving code with check for null decide half of problem.

Second problem arises - shooting laser in "Laser staging" scene is working, but when "Apply" pressed it not applied to all prefab instances. In subprefabs (as laser in ships) it will ignore changes at all and need to update them by hand.

I think this problem can be passed by generating ships in time of battle.