Re: make unity 3d accessible

Great, thanks for the invite. I just pushed the updates. Give them a try when you get the chance.

I have to admit that I had to look up the rules to Go Fish again, because it's been such a long time.
It's definitely a fun game. But it also a multiplayer game, so you will have to either deal with network code or create a simple AI for it.

Anyway, to your questions:
I have been told repeatedly that I have very limited skills in explaining things, so I apologize in advance.

1. GameObjects: Yes, definitely use individual game objects for each card. If the goal is to later add things like graphics or animation, you will need that separation of them being their own individual entities.
When you make your card class, you need to derive from MonoBehaviour, like all components, and then add that component to your GameObject.

2. Components: Components are C# scripts that are linked to a game object. A game object is really nothing more than an empty entity that sits around in space and does almost nothing other than having a position, rotation and scale. But you can attach scripts to it that give it more functionality. It's where practically ALL the functionality comes from. Scripts attached to a game object are called components. Game Objects can have multiple components attached to them - and usually they do. The scripts need to be derived from MonoBehaviour - that will cause the default functions, like Start and Update etc, to be called.

3. Children: The scene in Unity is hierarchical. That means game objects in the scene can have sub object attached to them. Those are also game objects, with their own components attached. But because their are children of another object, they are tied to their position. Simply put: If I put a piece of paper in my pocket and then walk into my yard, the piece of paper will also be moved into the yard. It didn't move on it's own, and it didn't change its rela tive position to me (in other words, it is still in my pocket). But it goes where I go.
This has a lot of very helpful consequences for the graphics of a game. For example: One can make a game object and place it in the top half of the screen. Then you add a few children to it. One is a text on the screen, and there are two images that are positioned just right and left of the text.
If all of these are children of the same parent game object, then you can animate and move that parent game object around the screen and the text and the stars will move along with. They won't change position relative to each other - the stars will always stay on the sides of the text.
Other than graphics, using children comes with other conveniences. If you delete the parent game object, all children will also be deleted. That is VERY comfortable. Also, if you hide the parent, all the children will become invisible too. Very convenient if you want to disable your gameplay to bring u p something like a pause menu.
For your Go Fish game, I'd recommend putting the game logic script on a game object, and then creating all the cards as children underneath it.

4. Events: Unity is both very event based and not very event based at all. You have your standard functions that every component (aka MonoBehaviour) comes with, such as Awake, OnEnable, OnDisable, Start, Update, OnDestroy and such. But you can also register yourself as a listener for all kinds of events.  You can also very easily create your own callbacks functions and have other scripts register with you to become listeners to that event. And then there is the option of sending an event message through the hierarchy of your scene, which means every component (aka script deriving from MonoBehaviour) that implements a function names like that event will get called.

I know that there are probably close to a million tutorials for Unity out there, but I don't think I've come ac ross one yet that doesn't use the Editor.

Personally, I think prefabs are the most powerful feature in Unity, aside from the general principle of using components for everything. And I haven't yet figured out how to create them without the Inspector - which is sadly completely inaccessible.

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mikrima via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mikrima via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Victorious via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mikrima via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mikrima via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Victorious via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mikrima via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mikrima via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mikrima via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mikrima via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mikrima via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mikrima via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mikrima via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mikrima via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mikrima via Audiogames-reflector

Reply via email to