This commit is contained in:
2025-08-04 17:26:24 +09:00
parent 34b1390d09
commit 8b873aa20d
14 changed files with 680 additions and 648 deletions

View File

@@ -73,24 +73,20 @@ public class SimulationModelSource : SimulationModel
int productCount = 0;
int defectCount = 0;
protected override void init()
{
base.init();
eventKey = "generator_event";
}
public override void GetData(string data)
{
var wrapclass = JsonConvert.DeserializeObject<SimulationDefaultJson>(data);
if (wrapclass._event.Contains(eventGenerateProduct))
{
GameObject gb = Instantiate(productPrefab, productPos);
gb.GetComponent<SimulationModelProduct>().SetParent(this.nodeID);
listProducts.Add(gb);
ProductSorting();
}
else if (wrapclass._event.Contains(eventGenerateDefect))
{
GameObject gb = Instantiate(defectPrefab, productPos);
gb.GetComponent<SimulationModelProduct>().SetParent(this.nodeID);
listProducts.Add(gb);
ProductSorting();
}
@@ -116,7 +112,14 @@ public class SimulationModelSource : SimulationModel
{
SimulationModelStore storeModel = model.GetComponent<SimulationModelStore>();
storeModel.maxCapacity = queueCapacity;
storeModel.storeType = storeType;
if (storeType == "fifo")
{
storeModel.storeType = StoreBehavior.FIFO;
}
else
{
storeModel.storeType = StoreBehavior.LIFO;
}
//storeModel.StoreProduct(product);
Destroy(product);
}