Concepts
Reusability
Reusability is a core concept in ZoboUI, shaping how user interfaces are constructed and maintained. ZoboUI's design philosophy deviates from defining classes per element type and instead embraces a component-driven approach to UI development in Unity.
Component-Driven Development
ZoboUI encourages a development style that encapsulates styles within reusable components. This practice ensures that styles are not duplicated unnecessarily across your project, which not only aligns with the DRY (Don't Repeat Yourself) principle but also promotes greater modularity and maintainability.
Templates in Unity UI Toolkit
Unity UI Toolkit's template system is an excellent example of reusability. Templates allow you to define a common UI structure in a UXML file and reuse it across multiple UI documents.
Reference: Unity - Reusing UXML Files
Custom Controls
Furthermore, ZoboUI complements Unity's approach by facilitating the creation of custom controls. These controls bundle both the appearance and behavior, encapsulating logic within components, allowing for more sophisticated and reusable UI elements.
Reference: Unity - Encapsulating UXML with Logic
By fostering a component-driven design philosophy, ZoboUI ensures that your UI is not just a collection of independent elements, but a cohesive system of reusable components that streamline development and enable consistent UI patterns across your project.