this question is now resolved. the simple answer is “there is no such book”. Please CLOSE this question (tick any useful answer). You get “points” so that you can open new questions in the future, without moderation.
Do not hesitate to ask any new, further questions at all.
To expand on comments here,
1, write a script,
2, in the constrictor say something like “Debug Log Hello”,
3, click Play
#It seems everything you do is attaching behaviours to game objects…
.
well – yes, of course. you must know that’s the entire nature of a game engine??? it would be as if you said “damn it, programming for android I’m always dealing with this screen thing…”
{note that, of course obviously, you can have ordinary static classes in the very few situations that is relevant in a typical game (for example, just for math calculations, etc etc}
#where is the entry point?
.
“The First Scene, Dude”
100% of scene-based programs of course, obviously, have a first scene which you mark as persistent, and you have all the persistent stuff (from networking to social media to payments to AI to scoring etc etc) in there. As mentioned often, ok, unity “forgot” to just click that in automatically when you open a new project (which would save you “three whole clicks”) but … so what? if a new programmer can’t grasp the notion that the first scene runs first it’s hard to know what to do right?
#where do you start your singleton classes?
.
well that would be “when the program launches” (ie, in this space-time universe: “the first scene” … see previous point!!)
note that you have the annoyance of “linking” singleton-or-static like concepts to coroutine concepts: ok, that’s always a nuisance and can take up to three lines of code. yes, every team will have their own standard solution they always use. I like my “Grid” one because it is just idiotically simple (you just manually type in 1 line of code in the sort of register there for each new overall-singleton-like-monobehaviour you add)
note that this is purely a syntax problem. all you are saying is, what’s the tidiest way in code to get to those guys. I personally like the look of Grid.networking.DoSomething() with the capitalisation like that, if you prefer another solution, whatever, it’s 3 lines of code, suit yourself. To be absolutely clear you can just NOT USE such a “convenient syntax maker” and just “.Find” the item every single time {setting aside performance issues} … my point is ALL WE ARE TALKING ABOUT HERE is a “syntax pretty-fier”: it is less than nothing, it has absolutely no computer science conceptual significance.
To recap…
It seems everything you do is attaching behaviours to game objects…
answer … “uh, yeah”
where is the entry point?
the answer to that one is so simple I won’t type it out again
where do you start your singleton classes?
look back to “where is the entry point?” – same answer
{note that, of course obviously, monobehaviours / coroutines can’t be “singletons”, it’s meaningless: they are already things that are completely persistent over time and space; so you (trivially) want to “link to them”, just as a syntax matter, so that they can be “used like” singletons or statics.}
then you just have the question convenient way to refer to those guys in code? Each team will have their own 3-line solution for that {for example: personally, I’d use a preprocessor, because I love preprocessing text files!, but there is no preprocessor in the unity milieu} … check the “Grid” one linked below for a incredibly simple and rock-solid trivial solution.