feat(shop): configurable package display rotation, pocoregal shelf model
Add _displayRotationEuler to Lieferkarton/ShelfSlot so package prefabs with a non-upright export orientation can be corrected per-container without touching PackageDisplay code. Fixes a bug where flying packages landed with a different rotation than the resting shelf display (PlayerCarry used the raw shelf transform instead of ShelfSlot.GetSlotWorldRotation()). Also adds the pocoregal shelf model (Blender export) and its materials, places it in the Shop scene, registers ShelfSlot as a network prefab, and rescales EmptyBox. See docs/PACKAGE_DISPLAY_SETUP.md for the display-grid setup/troubleshooting reference. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,15 +17,17 @@ namespace AfterHours.Shop
|
||||
private readonly int _columns;
|
||||
private readonly int _rows;
|
||||
private readonly Vector3 _spacing;
|
||||
private readonly Quaternion _rotation;
|
||||
private readonly List<GameObject> _instances = new();
|
||||
private GameObject _prefab;
|
||||
|
||||
public PackageDisplay(Transform root, int columns, int rows, Vector3 spacing)
|
||||
public PackageDisplay(Transform root, int columns, int rows, Vector3 spacing, Vector3 rotationEuler = default)
|
||||
{
|
||||
_root = root;
|
||||
_columns = Mathf.Max(1, columns);
|
||||
_rows = Mathf.Max(1, rows);
|
||||
_spacing = spacing;
|
||||
_rotation = Quaternion.Euler(rotationEuler);
|
||||
}
|
||||
|
||||
/// <summary>Baut die Anzeige auf <paramref name="count"/> Instanzen an (gedeckelt bei maxVisible).</summary>
|
||||
@@ -47,7 +49,7 @@ namespace AfterHours.Shop
|
||||
{
|
||||
var instance = Object.Instantiate(_prefab, _root);
|
||||
instance.transform.localPosition = SlotLocalPosition(_instances.Count);
|
||||
instance.transform.localRotation = Quaternion.identity;
|
||||
instance.transform.localRotation = _rotation;
|
||||
_instances.Add(instance);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user