What is the easiest way to store connections between objects?
-In a scene, I have many cameras.
-Each camera has a fixed set of cameras it may transition to.
-Using for example camera A, the fixed set of cameras belonging to camera A should start to preload assets.
In my mind - the usual suspect is just to create an array in each camera, containing connecting cameras - but I have a hunch that there is a more general way to do this.
I did try to search on internet, but I’m not even sure what this presumable concept is called - “connection tree” is not it?
There seems to be a matrix alternative, not that I understood it.
Other than that, searching for alternatives to linked lists seems to reveal (at least to me) an unknown group of odd/strange programmers. (not sure if there is some internal joke around programmers about linked lists?)
It actually worked out quite ok, I managed to do a scriptable object in Unity and had it store cameras in a list on camera transitions. Since the scriptable object is persistent even after the playmode is shut down in the editor, the linked list was “selflearning” during gameplay filling up the list as I played along. So that was easy enough for me, and only one functioncall. Hurray!
The intuition that there should be an alternativ solution is probably that the reality fooled me to believe that there is some direct way of knowing the relation between objects. Like the moon and earth, or food an taste etc…when it is actually the granularity of the world that forms the linked list of reality.
You should use c# instead of javascript in Unity, (although you have the opportunity to use two(three?) different languages in Unity).
The semantic differences are minor between c# and javascript, but with c# you get wonderful autocomplete in the free accompanying programming editor Monodevelop.
Now they also included most of the previously professional features in the free Unity edition, keeping minor important things for the professional edition. So with the free edition you can do most of the stuff for free, even sell on different appstores as long as you don’t make more money than a certain amount. There seems to be a indie version also. Not read up on all of that.
The C# language fits in a small book, (C# pocket reference, O’reilly), but there seems to very extensive libraries. I was under the impression that c# was very advanced, but its not.
I realized I tricked myself into believing there was a more general solution when I saw the image of the Seven Bridges of Königsberg in one of my google searches.