This shows you the differences between two versions of the page.
|
pjv:laboratoare:2025:a02 [2025/10/22 13:42] andrei.lapusteanu |
pjv:laboratoare:2025:a02 [2025/10/23 12:06] (current) andrei.lapusteanu |
||
|---|---|---|---|
| Line 29: | Line 29: | ||
| https://unity.com/how-to/architect-game-code-scriptable-objects#:~:text=ScriptableObject%20is%20a%20serializable%20Unity,to%20manage%20changes%20and%20debugging. | https://unity.com/how-to/architect-game-code-scriptable-objects#:~:text=ScriptableObject%20is%20a%20serializable%20Unity,to%20manage%20changes%20and%20debugging. | ||
| + | |||
| + | === Resurse Andrei L === | ||
| + | |||
| + | * Explicatii pattern-uri in Unity (Factory, Pooling, State, Command, Observer, MVC & MVP) [[https://learn.unity.com/tutorial/65e0df08edbc2a2447bf0b98?uv=2022.3&projectId=65de084fedbc2a0699d68bfb#|aici]] | ||
| + | * PDF cu toate pattern-urile (Unity): {{:pjv:laboratoare:2025:unity_patterns.pdf|}} | ||
| + | * PDF despre Scriptable Objects si arhitectura modulara cu ele (Unity): {{:pjv:laboratoare:2025:unity_modular_architecture.pdf|}} | ||
| + | * PDF despre guideline-uri de programare C# (Unity): {{:pjv:laboratoare:2025:unity_cleaner_code.pdf|}} | ||
| + | * Repo cu exemple de pattern-uri (Unity): [[https://github.com/Unity-Technologies/game-programming-patterns-demo|aici]] | ||
| </hidden> | </hidden> | ||
| Line 74: | Line 82: | ||
| * Command | * Command | ||
| * Observer | * Observer | ||
| + | * Cu evenimente C# sau ''UnityEvent'' | ||
| * Object Pooling | * Object Pooling | ||
| - | * MVC (cu ScriptableObjects) | + | * MVC |
| + | * Cu scriptable objects sau Event Bus | ||
| Line 606: | Line 616: | ||
| </code> | </code> | ||
| - | <hidden> | ||
| ===== Event Bus ===== | ===== Event Bus ===== | ||
| - | Prezentam un pentru decuplare si mai "loosely coupled" decat cele anterioare (un fel de "final boss" 🙂), intrucat folosind aceasta metoda puteti comunica fara nicio referinta (nici macar indirecta, precum in cazul comunicarii via ''ScriptableObjects''. | + | Prezentam un pattern pentru decuplare si mai "loosely coupled" decat cele anterioare (un fel de "final boss" 🙂), intrucat folosind aceasta metoda puteti comunica fara nicio referinta (nici macar indirecta, precum in cazul comunicarii via ''ScriptableObjects''. |
| <note important> | <note important> | ||
| Line 674: | Line 683: | ||
| creeaza o clasa completa cu tot cu constructor, 2 proprietati (''Current'', ''Max''), equality check. | creeaza o clasa completa cu tot cu constructor, 2 proprietati (''Current'', ''Max''), equality check. | ||
| + | |||
| + | ==== Singleton ==== | ||
| + | |||
| + | Event bus-ul propus este un **Singleton** (adeseori considerat de fapt un [[https://www.geeksforgeeks.org/system-design/why-is-singleton-design-pattern-is-considered-an-anti-pattern|anti-pattern]]), anume astfel ne asiguram de faptul ca event bus-ul are o singura instanta si este accesibil in mod global. Detaliile de implmenetare ale acestuia sunt omise in laborator. | ||
| + | |||
| ===== Exemplu implementare Event Bus ===== | ===== Exemplu implementare Event Bus ===== | ||
| Line 757: | Line 771: | ||
| </code> | </code> | ||
| - | |||
| - | </hidden> | ||