something for increasing FPS.
Need to change a list to a dictionary so instead of the array going "Element 0, element 1, etc" i can change the element name to spawnId in
objectpool.cs
Using "Where" or "Find" hurts performance. I'm trying to find a way to just define a gameobject without having to search for it first. I use this a lot in
handleworldmessages.cs. Biggest thing is op_clientupdate uses this 100% of the time, and it is sent from the server to the client every 30milliseconds.
in a script other than objectpool.cs, i use the below line to define a gameobject thats in a list array:
GameObject temp = ObjectPool.instance.spawnlist.Where(obj => obj.name == spawn_id.ToString()).SingleOrDefault();
Id like to do something like below in a dict array, cutting out the search using the spawnId as the element# in the array, so I don't have to search by name:
GameObject temp = ObjectPool.instance.spawndict[spawn_id];
In the pc editor, it's np @ 60 fps. in firefox it's 30fps. In chrome, it's like 17-23 fps. (from what i've noticed). Pretty sure this is causing it.