-
Notifications
You must be signed in to change notification settings - Fork 117
Core Concepts
With traditional development in Unity, even a small project can sometimes become difficult to keep organized, where even a small change in game logic can break your UI, requiring major time-consuming work. And while the asset store gives us a fantastic supply of helpful tools and assets at our disposal, they're often mixed-concern components that can be a nightmare to use with each other. uFrame helps keep your game logic organized as your project grows in size by separating different types of logic into different categories. For example, let's say we have a "Player" element in our game. In uFrame that player might look something like this:
- ViewModel - The objects in your world. Holds your data structure, things like Health, Coins, XP, etc.
- Controller - Handles game/business logic for your commands, like AddHealth(), RemoveCoins(), AddXP(), etc.
- View - The visual/auditory representation of your game object. Binds to the ViewModel for visual/auditory representation in your game
The ViewModel and Controller live "behind the scenes". They contain pure logic that doesn't necessarily know what's happening in your scene. The View will be attached to your game objects in Unity and are essentially the link between the game world and your data. This is an important concept when using uFrame: ViewModels and Controllers are pure logic, and your Views link them to your Unity game.