- Home /
Interaction Between Core Logic and GameObjects: A n00b's Architecture Problems
I'm new to Unity and wetting my feet with a Backgammon clone. Currently, I have 3 scripts created to handle game stuff:
- I have my core game logic,
GameController
set up in a C# script as a singleton. This script takes care of instancing my prefab pieces and governing whether or not a move is allowed. - I also have another js script which handles registering mouse clicks on the board mesh, via raycasting, tied to my camera.
- And another js click script on the prefabs which cause the prefabs to change appearance while selected.
However, I'm struggling to tie this all together. When I click on a piece, I want to communicate that to my GameController
, so it can calculate possible moves. Then when I click on a possible move the selected piece needs to move to its new location.
I imagine that there's something horribly wrong with the way I'm going about trying to architect this, but I'm going to blame that on my unity n00b-ness. Let me know if you think you need some code examples, but as this is more of a general architecture question, I'm not sure you will.
Thanks all!
Answer by Jesse Anders · Feb 13, 2011 at 07:59 AM
This might be of some help.
English version here http://docs.unity3d.com/412/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html (first one is the same english text with japanese menus)
Your answer
Follow this Question
Related Questions
How do I hook custom inspectors up to models? 2 Answers
How can I architect a persistent RTS using Unity as the client? 0 Answers
How do you bring your ideas to real code? 1 Answer
How should I setup my book-like game? 0 Answers
Unity architecture 3 Answers