mirror of
https://github.com/nothke/quality-control.git
synced 2025-08-31 07:43:42 +00:00
Item spawn update.
This commit is contained in:
@@ -16,4 +16,15 @@ public class ProductSpawner: MonoBehaviour
|
||||
|
||||
ProductType.SpawnProduct(type, transform, randomOrientation.position, rotation);
|
||||
}
|
||||
|
||||
public void SpawnProduct(ProductType type, DefectType defect)
|
||||
{
|
||||
var randomIndex = Random.Range(0, PossibleOrientations.Count);
|
||||
var randomOrientation = PossibleOrientations[randomIndex];
|
||||
|
||||
var rotation = Quaternion.AngleAxis(Random.Range(yRotation.x, yRotation.y), Vector3.up) *
|
||||
randomOrientation.rotation;
|
||||
|
||||
ProductType.SpawnProduct(type, defect, transform, randomOrientation.position, rotation);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user