mirror of
https://github.com/nothke/quality-control.git
synced 2026-10-11 19:28:55 +00:00
Item spawn update.
This commit is contained in:
1 parent
b58dc516e1
commit
1b0cf8d159
6 files changed
+127
-22
No files matched your search
@@ -27,6 +27,13 @@ public class ProductType : ScriptableObject
|
||||
newProduct.ApplyDefect(type.SelectDefect());
|
||||
}
|
||||
|
||||
public static void SpawnProduct(ProductType type, DefectType defect, Transform parent, Vector3 position, Quaternion rotation)
|
||||
{
|
||||
var newProduct = Instantiate(type.Prefab, position, rotation, parent);
|
||||
newProduct.Type = type;
|
||||
newProduct.ApplyDefect(defect);
|
||||
}
|
||||
|
||||
public DefectType SelectDefect()
|
||||
{
|
||||
float randomValue = Random.Range(0, 100);
|
||||
|
||||
Reference in new issue
Block a user