운송 애니메이션 추가
This commit is contained in:
@@ -8,15 +8,24 @@ public class SimulationModelStore : SimulationModel
|
||||
public int maxCapacity;
|
||||
public List<GameObject> storedProducts = new List<GameObject>();
|
||||
public string storeType = "fifo";
|
||||
public List<Transform> transporterPositions = new List<Transform>();
|
||||
public void StoreProduct(GameObject product)
|
||||
{
|
||||
List<Transform> list = storePositions.FindAll(t => t.childCount == 0);
|
||||
product.transform.parent = list[UnityEngine.Random.Range(0, list.Count)];
|
||||
product.transform.parent = transform;
|
||||
for (int i = 0; i < storePositions.Count; i++)
|
||||
{
|
||||
Transform storePos = storePositions[i];
|
||||
if (storePos.childCount == 0)
|
||||
{
|
||||
product.transform.parent = storePos;
|
||||
break;
|
||||
}
|
||||
}
|
||||
product.transform.localPosition = Vector3.zero;
|
||||
product.transform.localRotation = Quaternion.identity;
|
||||
storedProducts.Add(product);
|
||||
if (storedProducts.Count > maxCapacity)
|
||||
Debug.LogWarning("Max Capacity Reached on : " + nodeID);
|
||||
Debug.LogWarning("Max Capacity " + maxCapacity + " Reached on : " + nodeID);
|
||||
}
|
||||
public GameObject GetProduct()
|
||||
{
|
||||
@@ -36,4 +45,10 @@ public class SimulationModelStore : SimulationModel
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public Transform GetTransporterPosition()
|
||||
{
|
||||
if (transporterPositions.Count == 0)
|
||||
return null;
|
||||
return transporterPositions[UnityEngine.Random.Range(0, transporterPositions.Count)];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user