-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Models? #1
Comments
@JenkinJoe The models are normal C# classes. Depending on how/what you are doing you wont need them, maybe your presenter or controller just defines those fields. I use them mostly to parse json that comes from the server. |
@cgarciae Assuming that we have a Player Controller & Presenter. How do you handle several different logic behaviors like Player's Camera, Movement, Physics or Animations if you are doing it the "karmic" way? - Placing everything into the controller seems confusing for me especially if you intend to separate Settings per behavior. |
@JenkinJoe The philosophy is to use composition. You create other presenters for e.g. the camera, the characters, ect, and request them via dependency injection. You can create special presenters called elements which are intented to appear in view but they themselves are not views, that is, you cant request them through the router. I'll post 2 videos today about this. |
@cgarciae Yes that's true. But what I intended to achieve is having lossless coupled scripts fullfilling different tasks like those described above. And i did already use Elements for other things such as a Screen Fader or Audio Sources. But doing the same on the player's scripts would result in having redundant instantiated prefabs that do not perform a task. What i really want is a player controller that uses all of those scripts and combines them into one action e.g. walking with animations and physics. So what i was thinking about is more zenject related. By defining something like this in the App\startup.cs:
And in the PlayerPresenter:
So I can use it in the PlayerController, like this:
The script above does only use settings passed by startup.cs : Settings to the PlayerPresenter. Another thing that came up to my mind is to handle camera,animation,movement and physics as services (singleton therefore) in the Player Presenter, which is an element itself and only use the methods/settings in those service classes. That way you can still decide how the Presenter (Player in this case) will handle its movement by either use components of those services or not. A more convenient way would be to nest different elements (Camera, Physics,...) inside one main element (Player Presenter). But then there would be the already mentioned problem with redundant game objects in the scene. Is it somehow possible to use different elements on the same gameObject? edit |
Could you please make a usage example for layouts in Karma? |
@JenkinJoe Sorry about the delay. |
@JenkinJoe Check the videos here: https://github.com/cgarciae/karma/blob/master/README.md#videos |
Alright pal, thanks. I'm glad that you actually respond finally ;)
|
@JenkinJoe
If your view is simple enough you might only need to override You will also need to enable the use of layouts for your app on the Configure method:
Finally, the prefab of your layout will need to exist under |
Hello there,
what are the models in karma?
The text was updated successfully, but these errors were encountered: