Item spawn update.

This commit is contained in:
Daniel Tyomin
2024-08-19 00:26:03 +02:00
parent b58dc516e1
commit 1b0cf8d159
6 changed files with 127 additions and 22 deletions

View File

@@ -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);
}
}