코드수정
This commit is contained in:
BIN
Assets/Models/StackerCrane_01.fbx
Normal file
BIN
Assets/Models/StackerCrane_01.fbx
Normal file
Binary file not shown.
107
Assets/Models/StackerCrane_01.fbx.meta
Normal file
107
Assets/Models/StackerCrane_01.fbx.meta
Normal file
@@ -0,0 +1,107 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a567352e336933243b131db7eb5907dd
|
||||
ModelImporter:
|
||||
serializedVersion: 22200
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
materials:
|
||||
materialImportMode: 2
|
||||
materialName: 0
|
||||
materialSearch: 1
|
||||
materialLocation: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 4
|
||||
bakeSimulation: 0
|
||||
resampleCurves: 1
|
||||
optimizeGameObjects: 0
|
||||
removeConstantScaleCurves: 0
|
||||
motionNodeName:
|
||||
animationImportErrors:
|
||||
animationImportWarnings:
|
||||
animationRetargetingWarnings:
|
||||
animationDoRetargetingWarnings: 0
|
||||
importAnimatedCustomProperties: 0
|
||||
importConstraints: 0
|
||||
animationCompression: 1
|
||||
animationRotationError: 0.5
|
||||
animationPositionError: 0.5
|
||||
animationScaleError: 0.5
|
||||
animationWrapMode: 0
|
||||
extraExposedTransformPaths: []
|
||||
extraUserProperties: []
|
||||
clipAnimations: []
|
||||
isReadable: 0
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 1
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
sortHierarchyByName: 1
|
||||
importPhysicalCameras: 1
|
||||
importVisibility: 1
|
||||
importBlendShapes: 1
|
||||
importCameras: 1
|
||||
importLights: 1
|
||||
nodeNameCollisionStrategy: 1
|
||||
fileIdsGeneration: 2
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
keepQuads: 0
|
||||
weldVertices: 1
|
||||
bakeAxisConversion: 0
|
||||
preserveHierarchy: 0
|
||||
skinWeightsMode: 0
|
||||
maxBonesPerVertex: 4
|
||||
minBoneWeight: 0.001
|
||||
optimizeBones: 1
|
||||
meshOptimizationFlags: -1
|
||||
indexFormat: 0
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVMarginMethod: 1
|
||||
secondaryUVMinLightmapResolution: 40
|
||||
secondaryUVMinObjectScale: 1
|
||||
secondaryUVPackMargin: 4
|
||||
useFileScale: 1
|
||||
strictVertexDataChecks: 0
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 3
|
||||
normalCalculationMode: 4
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
referencedClips: []
|
||||
importAnimation: 1
|
||||
humanDescription:
|
||||
serializedVersion: 3
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: 0.5
|
||||
foreArmTwist: 0.5
|
||||
upperLegTwist: 0.5
|
||||
legTwist: 0.5
|
||||
armStretch: 0.05
|
||||
legStretch: 0.05
|
||||
feetSpacing: 0
|
||||
globalScale: 1
|
||||
rootMotionBoneName:
|
||||
hasTranslationDoF: 0
|
||||
hasExtraRoot: 0
|
||||
skeletonHasParents: 1
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
autoGenerateAvatarMappingIfUnspecified: 1
|
||||
animationType: 2
|
||||
humanoidOversampling: 1
|
||||
avatarSetup: 0
|
||||
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
|
||||
importBlendShapeDeformPercent: 1
|
||||
remapMaterialsIfMaterialImportModeIsNone: 0
|
||||
additionalBone: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Prefabs/StackerCrane.meta
Normal file
8
Assets/Prefabs/StackerCrane.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eef66bc97c459c94b96c86701663c244
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
551
Assets/Prefabs/StackerCrane/StackerCrane.prefab
Normal file
551
Assets/Prefabs/StackerCrane/StackerCrane.prefab
Normal file
@@ -0,0 +1,551 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &84151496267335565
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3781143750337797595}
|
||||
- component: {fileID: 8454460130121961209}
|
||||
- component: {fileID: 2956972442784000634}
|
||||
m_Layer: 0
|
||||
m_Name: StackerCrane_01_Lift
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3781143750337797595
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 84151496267335565}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.00000008146034, 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: 6817145635011239913}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &8454460130121961209
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 84151496267335565}
|
||||
m_Mesh: {fileID: 6996815353524655726, guid: a567352e336933243b131db7eb5907dd, type: 3}
|
||||
--- !u!23 &2956972442784000634
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 84151496267335565}
|
||||
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: 7074121452861381994, guid: a567352e336933243b131db7eb5907dd, type: 3}
|
||||
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!1 &211059046321003065
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3684655462316590942}
|
||||
- component: {fileID: 269198741979494856}
|
||||
m_Layer: 0
|
||||
m_Name: StackerCrane
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3684655462316590942
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 211059046321003065}
|
||||
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:
|
||||
- {fileID: 6862055124170816977}
|
||||
- {fileID: 6817145635011239913}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &269198741979494856
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 211059046321003065}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0671ba3dd5120d84fa95f82f0b7004ca, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
BANK:
|
||||
BAY:
|
||||
LEVEL:
|
||||
lift: {fileID: 0}
|
||||
bodyStart: {x: 0, y: 0, z: 0}
|
||||
bodyEnd: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &3264042907083275313
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 577450798675427556}
|
||||
- component: {fileID: 7961661491815865467}
|
||||
- component: {fileID: 2712123774187242948}
|
||||
m_Layer: 0
|
||||
m_Name: StackerCrane_01_Fork_Rear
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &577450798675427556
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3264042907083275313}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.00000008146034, 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: 6817145635011239913}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &7961661491815865467
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3264042907083275313}
|
||||
m_Mesh: {fileID: -5305828669847631536, guid: a567352e336933243b131db7eb5907dd, type: 3}
|
||||
--- !u!23 &2712123774187242948
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3264042907083275313}
|
||||
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: 7074121452861381994, guid: a567352e336933243b131db7eb5907dd, type: 3}
|
||||
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!1 &4457033642086699872
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6817145635011239913}
|
||||
m_Layer: 0
|
||||
m_Name: lift
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6817145635011239913
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4457033642086699872}
|
||||
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:
|
||||
- {fileID: 997135621247390612}
|
||||
- {fileID: 577450798675427556}
|
||||
- {fileID: 3781143750337797595}
|
||||
- {fileID: 535361768049989532}
|
||||
m_Father: {fileID: 3684655462316590942}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &5293074118394098060
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 535361768049989532}
|
||||
m_Layer: 0
|
||||
m_Name: StackerCrane_01_Lift_Glass
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &535361768049989532
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5293074118394098060}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.00000008146034, 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: 6817145635011239913}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &5452977827811288836
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7376213727696736814}
|
||||
- component: {fileID: 6866658327068374132}
|
||||
- component: {fileID: 49057592000795527}
|
||||
m_Layer: 0
|
||||
m_Name: StackerCrane_01_Glass
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7376213727696736814
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5452977827811288836}
|
||||
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: 6862055124170816977}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &6866658327068374132
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5452977827811288836}
|
||||
m_Mesh: {fileID: 1898404254780704084, guid: a567352e336933243b131db7eb5907dd, type: 3}
|
||||
--- !u!23 &49057592000795527
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5452977827811288836}
|
||||
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: 8556262120643298411, guid: a567352e336933243b131db7eb5907dd, type: 3}
|
||||
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!1 &8798365256392938815
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6862055124170816977}
|
||||
- component: {fileID: 8357980336019159288}
|
||||
- component: {fileID: 4682494491370198293}
|
||||
m_Layer: 0
|
||||
m_Name: StackerCrane_01
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6862055124170816977
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8798365256392938815}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.00000008146034, 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:
|
||||
- {fileID: 7376213727696736814}
|
||||
m_Father: {fileID: 3684655462316590942}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &8357980336019159288
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8798365256392938815}
|
||||
m_Mesh: {fileID: -2303676918162449301, guid: a567352e336933243b131db7eb5907dd, type: 3}
|
||||
--- !u!23 &4682494491370198293
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8798365256392938815}
|
||||
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: 4586366901725999179, guid: a567352e336933243b131db7eb5907dd, type: 3}
|
||||
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!1 &9062100363697913999
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 997135621247390612}
|
||||
- component: {fileID: 7246941432848583091}
|
||||
- component: {fileID: 7792230706349749481}
|
||||
m_Layer: 0
|
||||
m_Name: StackerCrane_01_Fork_Front
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &997135621247390612
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9062100363697913999}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.00000008146034, 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: 6817145635011239913}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &7246941432848583091
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9062100363697913999}
|
||||
m_Mesh: {fileID: 3567267625800323532, guid: a567352e336933243b131db7eb5907dd, type: 3}
|
||||
--- !u!23 &7792230706349749481
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9062100363697913999}
|
||||
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: 7074121452861381994, guid: a567352e336933243b131db7eb5907dd, type: 3}
|
||||
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}
|
||||
7
Assets/Prefabs/StackerCrane/StackerCrane.prefab.meta
Normal file
7
Assets/Prefabs/StackerCrane/StackerCrane.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 057179c23841fd344ad9ab4e6e66c496
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -167,6 +167,9 @@ namespace Studio
|
||||
listenerIdMap.Add(type, new());
|
||||
}
|
||||
|
||||
if (id == null)
|
||||
return;
|
||||
|
||||
if (!listenerIdMap[type].ContainsKey(id))
|
||||
{
|
||||
listenerIdMap[type][id] = listener;
|
||||
@@ -176,16 +179,9 @@ namespace Studio
|
||||
listenerIdMap[type][id] += listener;
|
||||
}
|
||||
}
|
||||
public void AddTypeListener(string type, EventHandler<StudioServiceTypeEventArgs> listener)
|
||||
public void AddTypeListener(string type, EventHandler<StudioServiceTypeEventArgs> listener =null)
|
||||
{
|
||||
if (!listenerTypeMap.ContainsKey(type))
|
||||
{
|
||||
listenerTypeMap[type] = listener;
|
||||
}
|
||||
else
|
||||
{
|
||||
listenerTypeMap[type] += listener;
|
||||
}
|
||||
listenerTypeMap[type] = listener;
|
||||
}
|
||||
public void RemoveTypeListener(string type)
|
||||
{
|
||||
@@ -315,22 +311,21 @@ namespace Studio
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!listenerTypeMap.ContainsKey(type))
|
||||
return;
|
||||
var data = new Dictionary<string, Dictionary<string, string>>();
|
||||
data.Add(id, entity);
|
||||
|
||||
if (entity == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
DispatchTypeMachineEvent(type, data);
|
||||
}
|
||||
}
|
||||
|
||||
private void DispatchTypeMachineEvent(string type, Dictionary<string, Dictionary<string, string>> entities)
|
||||
{
|
||||
if (!listenerTypeMap.ContainsKey(type))
|
||||
{
|
||||
Debug.LogError($"Key Value is missing!!!! -Key:{type}-");
|
||||
}
|
||||
|
||||
|
||||
if (listenerTypeMap.ContainsKey(type))
|
||||
{
|
||||
listenerTypeMap[type].Invoke(this, new(type, entities));
|
||||
|
||||
18
Assets/Scripts/Studio/Interfaces/IInfo.cs
Normal file
18
Assets/Scripts/Studio/Interfaces/IInfo.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Studio.VirtualFactory.Info
|
||||
{
|
||||
public interface IInfo
|
||||
{
|
||||
public abstract Dictionary<string, string> Info
|
||||
{
|
||||
get;
|
||||
}
|
||||
public abstract Dictionary<string, string> Label
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Studio/Interfaces/IInfo.cs.meta
Normal file
2
Assets/Scripts/Studio/Interfaces/IInfo.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ae6ca4b2f15db14998f98d2baeb01c5
|
||||
8
Assets/Scripts/Studio/TwinObject/DynamicObject.meta
Normal file
8
Assets/Scripts/Studio/TwinObject/DynamicObject.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a2cf3d76009c0d41babf08313abbd91
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
138
Assets/Scripts/Studio/TwinObject/DynamicObject/AGV.cs
Normal file
138
Assets/Scripts/Studio/TwinObject/DynamicObject/AGV.cs
Normal file
@@ -0,0 +1,138 @@
|
||||
using Studio.VirtualFactory;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Studio.VirtualFactory.Info;
|
||||
|
||||
namespace Studio.Dynamic.TwinObject
|
||||
{
|
||||
public class AGV : MonoBehaviour, IInfo
|
||||
{
|
||||
float dp;
|
||||
Vector3 nextPos;
|
||||
float startX;
|
||||
float endX;
|
||||
float startY;
|
||||
float endY;
|
||||
float rotSpeed;
|
||||
float moveSpeed;
|
||||
float xp;
|
||||
float yp;
|
||||
|
||||
Vector3 endPos;
|
||||
Quaternion startRot;
|
||||
Quaternion endRot;
|
||||
|
||||
private Dictionary<string, string> CurrentEntity;
|
||||
|
||||
private bool isPlay = false;
|
||||
|
||||
public Dictionary<string, string> Info {
|
||||
get
|
||||
{
|
||||
//ToDo 보고싶은 정보 나열한.. 리스트 목록 가져온다..
|
||||
return CurrentEntity;
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<string, string> Label {
|
||||
get
|
||||
{
|
||||
//ToDo 보고싶은 정보 나열한.. 리스트 목록 가져온다..
|
||||
return CurrentEntity;
|
||||
}
|
||||
}
|
||||
|
||||
public void Init(string type,Vector3 pos)
|
||||
{
|
||||
transform.position = pos;
|
||||
startX = transform.position.x;
|
||||
startY = transform.position.z;
|
||||
endX = transform.position.x;
|
||||
endY = transform.position.z;
|
||||
startRot = Quaternion.identity;
|
||||
endRot = Quaternion.identity;
|
||||
isPlay = true;
|
||||
StudioService.instance.AddTypeIdListener(type, transform.name, OnUpdateData);
|
||||
}
|
||||
|
||||
internal void OnUpdateData(object sender, StudioServiceIdEventArgs e)
|
||||
{
|
||||
CurrentEntity = e.Entity;
|
||||
var s = "{";
|
||||
foreach(var t in e.Entity)
|
||||
{
|
||||
s += $"{t.Key}: {t.Value},";
|
||||
}
|
||||
s += "}";
|
||||
Debug.Log(s);
|
||||
SetPos();
|
||||
}
|
||||
|
||||
|
||||
private void SetPos()
|
||||
{
|
||||
dp = 0f;
|
||||
xp = 0f;
|
||||
yp = 0f;
|
||||
|
||||
var xpos = CurrentEntity.FirstOrDefault(x => x.Key.Equals("x", StringComparison.OrdinalIgnoreCase));
|
||||
var ypos = CurrentEntity.FirstOrDefault(x => x.Key.Equals("y", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
|
||||
var x = float.Parse(xpos.Value) * 0.001f;
|
||||
var z = float.Parse(ypos.Value) * 0.001f;
|
||||
endPos = new Vector3(x, transform.position.y, z);
|
||||
startX = transform.position.x;
|
||||
startY = transform.position.z;
|
||||
endX = endPos.x;
|
||||
endY = endPos.z;
|
||||
|
||||
//노드방향으로 회전값알기
|
||||
|
||||
var degree =CurrentEntity.FirstOrDefault(x => x.Key.Equals("DEGREE", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
var deg = float.Parse(degree.Value);
|
||||
deg = 360f - deg;
|
||||
startRot = transform.rotation;
|
||||
endRot = Quaternion.AngleAxis(deg, Vector3.up);
|
||||
}
|
||||
|
||||
void PerforcedRotation()
|
||||
{
|
||||
if (dp >= 1f)
|
||||
return;
|
||||
dp += Time.deltaTime * rotSpeed;
|
||||
transform.rotation = Quaternion.Lerp(startRot, endRot, dp);
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
if (isPlay == false)
|
||||
return;
|
||||
PerforcedMovement();
|
||||
PerforcedRotation();
|
||||
}
|
||||
void PerforcedMovement()
|
||||
{
|
||||
|
||||
xp += Time.deltaTime * moveSpeed;
|
||||
yp += Time.deltaTime * moveSpeed;
|
||||
|
||||
var nx = Mathf.Lerp(startX, endX, xp);
|
||||
var ny = Mathf.Lerp(startY, endY, yp);
|
||||
nextPos = new Vector3(nx, 0, ny);
|
||||
transform.position = nextPos;
|
||||
}
|
||||
|
||||
public void SetMoveSpeed(float speed)
|
||||
{
|
||||
moveSpeed = speed;
|
||||
}
|
||||
|
||||
public void SetRotateSpeed(float aGVRotateSpeed)
|
||||
{
|
||||
rotSpeed = aGVRotateSpeed;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84ad40885a5aaa04e85eb7de0489cc8d
|
||||
83
Assets/Scripts/Studio/TwinObject/DynamicObject/AGVManager.cs
Normal file
83
Assets/Scripts/Studio/TwinObject/DynamicObject/AGVManager.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using Studio.Dynamic.TwinObject;
|
||||
using Studio.Core;
|
||||
|
||||
namespace Studio.Dynamic.M
|
||||
{
|
||||
public class AGVManager : UnitySingleton<AGVManager>
|
||||
{
|
||||
private AGV prf_AGV;
|
||||
public HashSet<AGV> agvs = new();
|
||||
public float AGVMoveSpeed;
|
||||
public float AGVRotateSpeed;
|
||||
public Queue<Dictionary<string, Dictionary<string, string>>> createAgvs = new();
|
||||
|
||||
public void Init()
|
||||
{
|
||||
prf_AGV = Resources.Load<AGV>("TestAGV");
|
||||
StudioService.instance.AddTypeListener("AGV", OnDataUpdate);
|
||||
StudioService.instance.AddTypeIdListener("AGV");
|
||||
}
|
||||
/// <summary>
|
||||
/// MQTT
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnDataUpdate(object sender, StudioServiceTypeEventArgs e)
|
||||
{
|
||||
var entities = e.Entitis;
|
||||
foreach(var entity in entities)
|
||||
{
|
||||
var key = entity.Key;
|
||||
var value = entity.Value;
|
||||
if (agvs.FirstOrDefault(x => x.name.Equals(key)))
|
||||
{
|
||||
Debug.Log($"중복된 ID {key}");
|
||||
continue;
|
||||
}
|
||||
var item = CreateAGV(e.Type, key,value);
|
||||
agvs.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
private AGV CreateAGV(string type, string id ,Dictionary<string,string> entity)
|
||||
{
|
||||
var agv = Instantiate<AGV>(prf_AGV,transform);
|
||||
agv.transform.position = Vector3.zero;
|
||||
agv.name = id;
|
||||
agv.SetMoveSpeed(AGVMoveSpeed);
|
||||
agv.SetRotateSpeed(AGVRotateSpeed);
|
||||
var xPos = entity.FirstOrDefault(x => x.Key.Equals("X", StringComparison.OrdinalIgnoreCase));
|
||||
var yPos = entity.FirstOrDefault(x => x.Key.Equals("Y", StringComparison.OrdinalIgnoreCase));
|
||||
float.TryParse(xPos.Value, out var x);
|
||||
float.TryParse(yPos.Value, out var y);
|
||||
|
||||
var pos = new Vector3(x * 0.001f, 0, y * 0.001f);
|
||||
agv.Init(type,pos);
|
||||
return agv;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// API 연결했을때
|
||||
/// </summary>
|
||||
private void SetBaseUpdate()
|
||||
{
|
||||
var baseDatas = StudioService.instance.apiData;
|
||||
var agvKey = baseDatas.Keys.FirstOrDefault(x => x.Contains("AGV", StringComparison.OrdinalIgnoreCase));
|
||||
var agvDatas = baseDatas[agvKey].Entity;
|
||||
|
||||
foreach(var data in agvDatas)
|
||||
{
|
||||
var id = data.FirstOrDefault(x => x.Key.Equals("ID", StringComparison.OrdinalIgnoreCase));
|
||||
CreateAGV("AGV", id.Value, data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1af5890e725b4a74397a6abcbc5c8b43
|
||||
8
Assets/Scripts/Studio/TwinObject/StaticObject.meta
Normal file
8
Assets/Scripts/Studio/TwinObject/StaticObject.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2597203444f235d43a8c02da446c3ff8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
160
Assets/Scripts/Studio/TwinObject/StaticObject/StackerCrane.cs
Normal file
160
Assets/Scripts/Studio/TwinObject/StaticObject/StackerCrane.cs
Normal file
@@ -0,0 +1,160 @@
|
||||
using Studio.VirtualFactory.Info;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Studio.Staic.STKC
|
||||
{
|
||||
public class StackerCrane : MonoBehaviour, IInfo
|
||||
{
|
||||
private Dictionary<string, string> CurrentEntity;
|
||||
public Dictionary<string, string> Info
|
||||
{
|
||||
get
|
||||
{
|
||||
return CurrentEntity;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Dictionary<string, string> Label
|
||||
{
|
||||
get
|
||||
{
|
||||
return CurrentEntity;
|
||||
}
|
||||
}
|
||||
|
||||
public string BANK;
|
||||
public string BAY;
|
||||
public string LEVEL;
|
||||
|
||||
private float liftSpeed;
|
||||
private float bodySpeed;
|
||||
private float bodyProcess;
|
||||
private float liftProcess;
|
||||
|
||||
private float liftStartY;
|
||||
private float liftEndY;
|
||||
public Transform lift;
|
||||
public Vector3 bodyStart;
|
||||
public Vector3 bodyEnd;
|
||||
|
||||
private Action onMotionStart;
|
||||
|
||||
private int[] values = new int[3];
|
||||
private string curType;
|
||||
public void Init(string type)
|
||||
{
|
||||
curType = type;
|
||||
bodySpeed = 0.3f;
|
||||
liftSpeed = 0.3f;
|
||||
StudioService.instance.AddTypeIdListener(type, transform.name, OnUpdateData);
|
||||
onMotionStart = StartAnim;
|
||||
}
|
||||
|
||||
public void AddInit(string type)
|
||||
{
|
||||
StudioService.instance.AddTypeIdListener(type, transform.name, OnAddOtherUpdateData);
|
||||
}
|
||||
|
||||
private void OnAddOtherUpdateData(object sender, StudioServiceIdEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void StartAnim()
|
||||
{
|
||||
StopAllCoroutines();
|
||||
StartCoroutine(MotionStart());
|
||||
}
|
||||
|
||||
IEnumerator MotionStart()
|
||||
{
|
||||
while (liftProcess < 1f)
|
||||
{
|
||||
Sliding();
|
||||
Lifiting();
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
void Sliding()
|
||||
{
|
||||
bodyProcess += Time.deltaTime * bodySpeed;
|
||||
|
||||
if (bodyProcess >= 1f)
|
||||
bodyProcess = 1f;
|
||||
|
||||
var pos = math.lerp(bodyStart, bodyEnd, bodyProcess);
|
||||
|
||||
transform.localPosition = pos;
|
||||
}
|
||||
|
||||
void Lifiting()
|
||||
{
|
||||
liftProcess += Time.deltaTime * liftSpeed;
|
||||
if (liftProcess >= 1f)
|
||||
{
|
||||
liftProcess = 1f;
|
||||
|
||||
}
|
||||
|
||||
var liftY = math.lerp(liftStartY, liftEndY, liftProcess);
|
||||
var liftPos = lift.position;
|
||||
liftPos.y = liftY;
|
||||
lift.position = liftPos;
|
||||
}
|
||||
|
||||
private void OnUpdateData(object sender, StudioServiceIdEventArgs e)
|
||||
{
|
||||
CurrentEntity = e.Entity;
|
||||
|
||||
|
||||
BANK = CurrentEntity.FirstOrDefault(x => x.Key.Equals(nameof(BANK), StringComparison.OrdinalIgnoreCase)).Value;
|
||||
BAY = CurrentEntity.FirstOrDefault(x => x.Key.Equals(nameof(BAY), StringComparison.OrdinalIgnoreCase)).Value;
|
||||
LEVEL = CurrentEntity.FirstOrDefault(x => x.Key.Equals(nameof(LEVEL), StringComparison.OrdinalIgnoreCase)).Value;
|
||||
|
||||
var x = int.Parse(BANK);
|
||||
var y = int.Parse(LEVEL);
|
||||
var z = int.Parse(BAY);
|
||||
|
||||
if (IsSameValue(x, y, z))
|
||||
return;
|
||||
|
||||
bodyProcess = 0f;
|
||||
liftProcess = 0f;
|
||||
bodyStart = transform.localPosition;
|
||||
bodyEnd = bodyStart;
|
||||
bodyEnd.z = z;
|
||||
|
||||
liftStartY = lift.position.y;
|
||||
liftEndY = y;
|
||||
|
||||
onMotionStart?.Invoke();
|
||||
}
|
||||
|
||||
private bool IsSameValue(int bank, int bay, int level)
|
||||
{
|
||||
|
||||
var sameBank = values[0].Equals(bank);
|
||||
var sameLevel = values[1].Equals(level);
|
||||
var sameBay = values[2].Equals(bay);
|
||||
|
||||
if (sameBank && sameLevel && sameLevel)
|
||||
return true;
|
||||
|
||||
values[0] = bank;
|
||||
values[1] = level;
|
||||
values[2] = bay;
|
||||
return false;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
StudioService.instance.RemoveTypeIdListener(curType, transform.name);
|
||||
onMotionStart -= StartAnim;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0671ba3dd5120d84fa95f82f0b7004ca
|
||||
54
Assets/Scripts/Studio/TwinObject/StaticObject/Stocker.cs
Normal file
54
Assets/Scripts/Studio/TwinObject/StaticObject/Stocker.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using Studio.VirtualFactory.Info;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Studio.Staic.STK
|
||||
{
|
||||
public class Stocker : MonoBehaviour, IInfo
|
||||
{
|
||||
private Dictionary<string, string> CurrentEntity;
|
||||
public Dictionary<string, string> Info
|
||||
{
|
||||
get
|
||||
{
|
||||
return CurrentEntity;
|
||||
}
|
||||
|
||||
}
|
||||
public Dictionary<string, string> Label
|
||||
{
|
||||
get
|
||||
{
|
||||
return CurrentEntity;
|
||||
}
|
||||
}
|
||||
|
||||
public void Init(string type)
|
||||
{
|
||||
StudioService.instance.AddTypeIdListener(type, transform.name, OnUpdateData);
|
||||
}
|
||||
|
||||
public void AddInit(string type)
|
||||
{
|
||||
StudioService.instance.AddTypeIdListener(type, transform.name, OnAddOtherUpdateData);
|
||||
}
|
||||
|
||||
private void OnAddOtherUpdateData(object sender, StudioServiceIdEventArgs e)
|
||||
{
|
||||
foreach(var keyvalue in e.Entity)
|
||||
{
|
||||
if (!CurrentEntity.ContainsKey(keyvalue.Key))
|
||||
CurrentEntity.Add(keyvalue.Key, "");
|
||||
|
||||
CurrentEntity[keyvalue.Key] = keyvalue.Value;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUpdateData(object sender, StudioServiceIdEventArgs e)
|
||||
{
|
||||
CurrentEntity = e.Entity;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e66bb97ac5ecbe748b9a207098542b4e
|
||||
@@ -12,7 +12,7 @@ namespace Studio
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
private int aa;
|
||||
public StockerCrane testcrane;
|
||||
public StackerCrane testcrane;
|
||||
void Awake()
|
||||
{
|
||||
//ConfigConnected.MQTTDomain = "220.90.135.190";
|
||||
|
||||
Reference in New Issue
Block a user