Does anyone have advice for dealing with the various screen sizes that appear on android and getting an appropriate loading screens ?
In the end my android version is a scaled down iOS (retina) art with black bars added to the sides, and is pretty good at filling up the screen on the android devices. I do this with camera settings and an additional root node transform for the GUI elements. For the iOS versions I had a specific resolution loading screen though and in my first scene, I had the loading screen rendering to texture to get a smooth fade in from loading → menu. My first scene is a loader scene which detects which phone and loads the appropriate next scene.
However, I am kind of stuck with this strategy on android as the splash screens aren’t right. Is there even anything I can do about this ?
My first thought is to just put a SphereCollider trigger around each turret and sort through the objects that enter the collider. But if you get a lot of objects on one turret, then instead of just searching like you’re currently doing you could do something a little more sophisticated. You only need the closest object, and the objects are probably moving in a fairly coherent fashion. The simplest thing that comes to mind is a priority queue. Since everything is moving, you need a way to update the priorities with low cost. You can use a diminishing series of ranges from the turret and only update the distance when the moving entity crosses the threshold from one range to the next. A heap implemented using an Array or List<> is best. You should be able to find one on the internet. You need one priority queue per turret.
But if you have lots of turrets, then all those priority queues can get expensive. The problem you’re describing is called “all nearest neighbors” and is most efficiently solved using a spatial data structure such as a k-d tree. k-d trees aren’t easy to update dynamically, but with everything moving you could just rebuild it every frame.
Be sure to benchmark as you go because it is easy for this stuff to go awry. Data structures is an area where it can be useful to take off your OOP hat.
Hi ,
In asset srore is aviable this plug-in:
if you have a long loading period in your game and need to show a simple loading spalsh bar, this can be the solution!