This shows you the differences between two versions of the page.
|
pjv:laboratoare:2025:a01 [2025/10/06 13:41] alexandru.gradinaru |
pjv:laboratoare:2025:a01 [2025/10/06 13:54] (current) alexandru.gradinaru [Concept general – „Replay / Ghost Car”] |
||
|---|---|---|---|
| Line 232: | Line 232: | ||
| - | === 🧩 Exemple de design pattern-uri === | + | === Exemple de design pattern-uri === |
| - | ==== 🔸 Command Pattern (pentru input) ==== | + | ==== Command Pattern (pentru input) ==== |
| <code csharp> | <code csharp> | ||
| public interface ICommand { | public interface ICommand { | ||
| Line 253: | Line 253: | ||
| </code> | </code> | ||
| - | ==== 🔸 Observer Pattern (pentru UI) ==== | + | ==== Observer Pattern (pentru UI) ==== |
| <code csharp> | <code csharp> | ||
| public class Car : MonoBehaviour { | public class Car : MonoBehaviour { | ||
| Line 273: | Line 273: | ||
| ---- | ---- | ||
| - | ==== 🎬 Concept general – „Replay / Ghost Car” ==== | + | ==== Concept general – „Replay / Ghost Car” ==== |
| În timpul cursei, fiecare acțiune de control (accelerare, frânare, viraj) este înregistrată ca un Command cu un timestamp. | În timpul cursei, fiecare acțiune de control (accelerare, frânare, viraj) este înregistrată ca un Command cu un timestamp. | ||
| Line 365: | Line 365: | ||
| void Start() => startTime = Time.time; | void Start() => startTime = Time.time; | ||
| - | void Update() | + | void FixedUpdate() |
| { | { | ||
| if (currentIndex >= replayCommands.Count) return; | if (currentIndex >= replayCommands.Count) return; | ||
| Line 397: | Line 397: | ||
| - | ==== 🧩 Integrare în scenă ==== | + | ==== Integrare în scenă ==== |
| Creezi două mașini: | Creezi două mașini: | ||
| Line 426: | Line 426: | ||
| - | === 📚 Resurse recomandate === | + | === Resurse recomandate === |
| * Unity Manual – [[https://docs.unity3d.com/Manual/MultipleCameras.html|Multiple Cameras and Split Screen]] | * Unity Manual – [[https://docs.unity3d.com/Manual/MultipleCameras.html|Multiple Cameras and Split Screen]] | ||
| * Unity Learn – [[https://learn.unity.com/project/input-system|New Input System Fundamentals]] | * Unity Learn – [[https://learn.unity.com/project/input-system|New Input System Fundamentals]] | ||