Messing with meshes and object spawning

This commit is contained in:
Daniel Tyomin
2024-08-18 23:36:45 +02:00
parent 8e357f12d6
commit a90c2400eb
19 changed files with 3720 additions and 651 deletions

View File

@@ -20,9 +20,9 @@ public class ProductType : ScriptableObject
public DefectProbability[] DefectProbabilities;
public static void SpawnProduct(ProductType type, Transform origin)
public static void SpawnProduct(ProductType type, Transform parent, Vector3 position, Quaternion rotation)
{
var newProduct = Instantiate(type.Prefab, origin);
var newProduct = Instantiate(type.Prefab, position, rotation, parent);
newProduct.Type = type;
newProduct.ApplyDefect(type.SelectDefect());
}