This commit is contained in:
lwj
2025-05-29 20:03:28 +09:00
parent a575295c17
commit 88214ad41f
12 changed files with 5002 additions and 23 deletions

View File

@@ -1,5 +1,58 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &740785748902404519
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3203784354520670926}
- component: {fileID: 4594702753334224545}
m_Layer: 0
m_Name: ProductPos
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3203784354520670926
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 740785748902404519}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1.012, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3725023500115640913}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &4594702753334224545
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 740785748902404519}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &7321839395133301791
GameObject:
m_ObjectHideFlags: 0
@@ -30,6 +83,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3203784354520670926}
- {fileID: 4747722390765838196}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -55,7 +109,7 @@ MonoBehaviour:
eventSpeed: transporter_speed_factor_applied
eventReturning: transporter_returning
listProducts: []
productPos: {fileID: 0}
productPos: {fileID: 3203784354520670926}
productDistance: {x: 0, y: 0.321, z: 0}
onMove:
m_PersistentCalls:

View File

@@ -0,0 +1,105 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3554305899873773484
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1296270255115025987}
- component: {fileID: 8287603524468151029}
- component: {fileID: 577279135108903989}
- component: {fileID: 6807897160572665843}
m_Layer: 0
m_Name: Box_Pallet
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1296270255115025987
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3554305899873773484}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0, y: 0, z: 0}
m_LocalScale: {x: 0.6, y: 0.6, z: 0.6}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &8287603524468151029
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3554305899873773484}
m_Mesh: {fileID: 9013174744734272009, guid: 406d0eeb40eb3ed418618c71369e5e01, type: 3}
--- !u!23 &577279135108903989
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3554305899873773484}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: fdbafe8772a76e54ea98dd58380fd871, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!114 &6807897160572665843
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3554305899873773484}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 36cf0b4a042344b4f922e7d6848b38dd, type: 3}
m_Name:
m_EditorClassIdentifier:
modelName: Box_Pallet
modelType: Product
modelID:
nodeID:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a0607d71a04b3f4459be2d9646fcb429
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,105 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3554305899873773484
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1296270255115025987}
- component: {fileID: 8287603524468151029}
- component: {fileID: 577279135108903989}
- component: {fileID: 6807897160572665843}
m_Layer: 0
m_Name: Box_Pallet_Defect
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1296270255115025987
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3554305899873773484}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &8287603524468151029
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3554305899873773484}
m_Mesh: {fileID: 9013174744734272009, guid: 406d0eeb40eb3ed418618c71369e5e01, type: 3}
--- !u!23 &577279135108903989
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3554305899873773484}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 423d332c0934f2949a4e6ab958c81d08, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!114 &6807897160572665843
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3554305899873773484}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 36cf0b4a042344b4f922e7d6848b38dd, type: 3}
m_Name:
m_EditorClassIdentifier:
modelName: Box_Pallet
modelType: Product
modelID:
nodeID:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: cdaf18132be58d64ebab6d9d81fffbd9
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -30,6 +30,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 9164257624814803601}
- {fileID: 2087524654010474319}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -55,7 +56,7 @@ MonoBehaviour:
eventSpeed: transporter_speed_factor_applied
eventReturning: transporter_returning
listProducts: []
productPos: {fileID: 0}
productPos: {fileID: 9164257624814803601}
productDistance: {x: 0, y: 0.321, z: 0}
onMove:
m_PersistentCalls:
@@ -63,6 +64,37 @@ MonoBehaviour:
onWait:
m_PersistentCalls:
m_Calls: []
--- !u!1 &4352204124086843388
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 9164257624814803601}
m_Layer: 0
m_Name: ProductPos
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &9164257624814803601
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4352204124086843388}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.171, z: 0.769}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7659569373029274947}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1977882749588437156
PrefabInstance:
m_ObjectHideFlags: 0
@@ -71,6 +103,10 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 7659569373029274947}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: dddca9e510e2aa740848cb124244bf21, type: 3}
propertyPath: m_LocalScale.y
value: 3
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: dddca9e510e2aa740848cb124244bf21, type: 3}
propertyPath: m_LocalPosition.x
value: -0

View File

@@ -52,8 +52,8 @@ MonoBehaviour:
eventGenerateProduct: product_generated
eventGenerateDefect: product_defective
eventQueueProduct: product_queued
productPrefab: {fileID: 0}
defectPrefab: {fileID: 0}
productPrefab: {fileID: 3554305899873773484, guid: a0607d71a04b3f4459be2d9646fcb429, type: 3}
defectPrefab: {fileID: 3554305899873773484, guid: cdaf18132be58d64ebab6d9d81fffbd9, type: 3}
listProducts: []
listDefects: []
productPos: {fileID: 0}

File diff suppressed because it is too large Load Diff

View File

@@ -14,7 +14,8 @@ public class SimulationModelConveyor : SimulationModel
Vector3 startPosition;
Vector3 endPosition;
ConcurrentQueue<JObject> dataQueue;
GameObject targetCargo;
GameObject moveTargetCargo;
GameObject storedCargo;
int transportTime;
float elapseTime;
string inputQueueID;
@@ -29,7 +30,7 @@ public class SimulationModelConveyor : SimulationModel
// Update is called once per frame
void Update()
{
if ( targetCargo != null)
if ( moveTargetCargo != null)
{
startPosition = this.transform.Find(nameof(startPosition)).transform.position;
endPosition = this.transform.Find(nameof(endPosition)).transform.position;
@@ -38,11 +39,11 @@ public class SimulationModelConveyor : SimulationModel
if (elapseTime < transportTime)
{
targetCargo.transform.position = Vector3.Lerp(startPosition, endPosition, elapseTime / transportTime);
moveTargetCargo.transform.position = Vector3.Lerp(startPosition, endPosition, elapseTime / transportTime);
}
else if ( elapseTime > transportTime )
{
//targetCargo = null;
moveTargetCargo = null;
elapseTime = 0;
}
@@ -94,16 +95,17 @@ public class SimulationModelConveyor : SimulationModel
SimulationModelStore storeModel = (SimulationModelStore)model;
if ( targetCargo == null)
if ( moveTargetCargo == null)
{
yield return new WaitUntil(() =>
{
targetCargo = storeModel.GetProduct();
return targetCargo != null;
moveTargetCargo = storeModel.GetProduct();
storedCargo = moveTargetCargo;
return moveTargetCargo != null;
});
targetCargo.transform.position = startPosition;
targetCargo.transform.rotation = Quaternion.identity;
moveTargetCargo.transform.position = startPosition;
moveTargetCargo.transform.rotation = Quaternion.identity;
}
@@ -148,8 +150,8 @@ public class SimulationModelConveyor : SimulationModel
SimulationModel model = DataManager.I.GetModel(destinationID);
SimulationModelStore storemodel = (SimulationModelStore)model;
storemodel.StoreProduct(targetCargo);
targetCargo = null;
storemodel.StoreProduct(storedCargo);
storedCargo = null;
}
else if ( rawData.Contains("_to_store"))
@@ -163,8 +165,8 @@ public class SimulationModelConveyor : SimulationModel
SimulationModel model = DataManager.I.GetModel(destinationID);
SimulationModelStore storemodel = (SimulationModelStore)model;
storemodel.StoreProduct(targetCargo);
targetCargo = null;
storemodel.StoreProduct(storedCargo);
storedCargo = null;
}

View File

@@ -58,8 +58,9 @@ public class SimulationModelSink : SimulationModel
SimulationModelStore storeModel = (SimulationModelStore)model;
while (storeModel.storedProducts.Count > queueCapacity)
{
Destroy(storeModel.GetProduct());
//Destroy(storeModel.GetProduct());
totalShipped++;
yield return null;
}
}
}

View File

@@ -81,7 +81,7 @@ public class SaveLoadmanager : MonoBehaviour
loadInfos = JsonConvert.DeserializeObject<List<SimulationModelInfo>>(jsonData);
string resourcePath = "Models";
string resourcePath = "ModelsUpdated";
Dictionary<string, SimulationModel> loadModels = new Dictionary<string, SimulationModel>();