Collections #8
Replies: 1 comment 2 replies
-
Hi @jonborchardt. Great question. Here is one solution, written in pseudocode. Let's assume that BounceMini is the main app.
The reason the list may exist in the BounceModel or the BounceView is because MonoBehaviour (and subclasses) are not purely View nor purely controller, nor purely Model. Each MonoBehaviour (and subclasses) is actually a combination of Model/View/Controller Depending on how you use it. So you can put it in the View or in the Model depending on how you choose to structure things. Experiment with one approach (such as the above approach) and see how it feels. Remember the guiding principle is to separate your concerns so your project is more readable, scaleable, and maintainable. Its a subjective art, not an exact science. Which way did you solve it? Do you like your result? |
Beta Was this translation helpful? Give feedback.
-
How would you handle storing the data ofr a collection of items..
Say you data is an array of balls... all moving with physics... and you want events when they touch each other.
this is not exacty what im building, but it will answer the general question of how to have a model that is a collection.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions