test
This commit is contained in:
@@ -181,6 +181,19 @@ public class InventoryItemFactory : MonoBehaviour
|
||||
rb.linearVelocity = velocity.Value + (Vector3.up * (config?.dropForce ?? 2f));
|
||||
}
|
||||
|
||||
// Если у ItemData нет связанной модели — создаём простой визуал (куб)
|
||||
if (itemData != null && itemData.modelPrefab == null && worldItem != null)
|
||||
{
|
||||
var visual = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
visual.name = "Visual";
|
||||
visual.transform.SetParent(worldItem.transform, false);
|
||||
visual.transform.localPosition = Vector3.zero;
|
||||
visual.transform.localScale = Vector3.one * 0.3f;
|
||||
// Удаляем лишний коллайдер на визуале
|
||||
var col = visual.GetComponent<Collider>();
|
||||
if (col != null) GameObject.Destroy(col);
|
||||
}
|
||||
|
||||
return worldItem;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user